PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / 1.2.21
VikAppointments Services Booking Calendar v1.2.21
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / admin / layouts / statistics / widgets / options / revenue / table.php
vikappointments / admin / layouts / statistics / widgets / options / revenue Last commit date
chart.php 6 days ago count.php 6 days ago index.html 6 days ago items.php 6 days ago table.php 6 days ago
table.php
172 lines
1 <?php
2 /**
3 * @package VikAppointments
4 * @subpackage core
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved.
7 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 * @link https://vikwp.com
9 */
10
11 // No direct access
12 defined('ABSPATH') or die('No script kiddies please!');
13
14 /**
15 * Layout variables
16 * -----------------
17 * @var VAPStatisticsWidget $widget The instance of the widget to be displayed.
18 * @var mixed $data The table rows data.
19 * @var mixed $footer The table footer.
20 */
21 extract($displayData);
22
23 if (empty($data))
24 {
25 // do nothing in case of empty data
26 return;
27 }
28
29 $currency = VAPFactory::getCurrency();
30
31 // get ordering
32 $ordering = $widget->getOrdering();
33
34 ?>
35
36 <div class="widget-revenue-table">
37 <table data-widget-id="<?php echo $widget->getID(); ?>">
38
39 <thead>
40 <tr>
41
42 <!-- DATE -->
43
44 <th style="text-align: left;" class="<?php echo $ordering['column'] == 'date' ? 'sorted' : ''; ?>">
45 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPMANAGEINVOICE2', 'date', $ordering['direction'], $ordering['column'], 'desc'); ?>
46 </th>
47
48 <!-- COUNT -->
49
50 <th style="text-align: right;" class="<?php echo $ordering['column'] == 'count' ? 'sorted' : ''; ?>">
51 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPMENUOPTIONS', 'count', $ordering['direction'], $ordering['column'], 'desc'); ?>
52 </th>
53
54 <!-- TOTAL GROSS -->
55
56 <th style="text-align: right;" class="<?php echo $ordering['column'] == 'total' ? 'sorted' : ''; ?>">
57 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPTOTALGROSS', 'total', $ordering['direction'], $ordering['column'], 'desc'); ?>
58 </th>
59
60 <!-- TOTAL TAX -->
61
62 <th style="text-align: right;" class="<?php echo $ordering['column'] == 'tax' ? 'sorted' : ''; ?>">
63 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPTOTALTAX', 'tax', $ordering['direction'], $ordering['column'], 'desc'); ?>
64 </th>
65
66 <!-- TOTAL NET -->
67
68 <th style="text-align: right;" class="<?php echo $ordering['column'] == 'net' ? 'sorted' : ''; ?>">
69 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPTOTALNET', 'net', $ordering['direction'], $ordering['column'], 'desc'); ?>
70 </th>
71
72 <!-- TOTAL DISCOUNT -->
73
74 <th style="text-align: right;" class="<?php echo $ordering['column'] == 'discount' ? 'sorted' : ''; ?>">
75 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPMANAGEPACKAGE13', 'discount', $ordering['direction'], $ordering['column'], 'desc'); ?>
76 </th>
77
78 </tr>
79 </thead>
80
81 <tbody>
82 <?php
83 foreach ($data as $date => $totals)
84 {
85 ?>
86 <tr>
87
88 <!-- DATE -->
89
90 <td style="text-align: left;" class="<?php echo $ordering['column'] == 'date' ? 'sorted' : ''; ?>">
91 <?php echo $date; ?>
92 </td>
93
94 <!-- COUNT -->
95
96 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'count' ? 'sorted' : ''; ?>">
97 <?php echo $totals['count']; ?>
98 </td>
99
100 <!-- TOTAL GROSS -->
101
102 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'total' ? 'sorted' : ''; ?>">
103 <?php echo $currency->format($totals['total']); ?>
104 </td>
105
106 <!-- TOTAL TAX -->
107
108 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'tax' ? 'sorted' : ''; ?>">
109 <?php echo $currency->format($totals['tax']); ?>
110 </td>
111
112 <!-- TOTAL NET -->
113
114 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'net' ? 'sorted' : ''; ?>">
115 <?php echo $currency->format($totals['net']); ?>
116 </td>
117
118 <!-- TOTAL DISCOUNT -->
119
120 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'discount' ? 'sorted' : ''; ?>">
121 <?php echo $currency->format($totals['discount']); ?>
122 </td>
123
124 </tr>
125 <?php
126 }
127 ?>
128 </tbody>
129
130 <tfoot>
131 <tr>
132
133 <!-- DATE -->
134
135 <td style="text-align: left;" class="<?php echo $ordering['column'] == 'date' ? 'sorted' : ''; ?>">&nbsp;</td>
136
137 <!-- COUNT -->
138
139 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'count' ? 'sorted' : ''; ?>">
140 <?php echo $footer['count'] ?? 0; ?>
141 </td>
142
143 <!-- TOTAL GROSS -->
144
145 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'total' ? 'sorted' : ''; ?>">
146 <?php echo $currency->format($footer['total'] ?? 0); ?>
147 </td>
148
149 <!-- TOTAL TAX -->
150
151 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'tax' ? 'sorted' : ''; ?>">
152 <?php echo $currency->format($footer['tax'] ?? 0); ?>
153 </td>
154
155 <!-- TOTAL NET -->
156
157 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'net' ? 'sorted' : ''; ?>">
158 <?php echo $currency->format($footer['net'] ?? 0); ?>
159 </td>
160
161 <!-- TOTAL DISCOUNT -->
162
163 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'discount' ? 'sorted' : ''; ?>">
164 <?php echo $currency->format($footer['discount'] ?? 0); ?>
165 </td>
166
167 </tr>
168 </tfoot>
169
170 </table>
171 </div>
172