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 / customers / preferred / employees.php
vikappointments / admin / layouts / statistics / widgets / customers / preferred Last commit date
employees.php 6 days ago index.html 6 days ago services.php 6 days ago
employees.php
203 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 */
20 extract($displayData);
21
22 if (!isset($data))
23 {
24 // do nothing in case of empty data
25 return;
26 }
27
28 if (!$data)
29 {
30 echo VAPApplication::getInstance()->alert(JText::translate('JGLOBAL_NO_MATCHING_RESULTS'));
31 return ;
32 }
33
34 $currency = VAPFactory::getCurrency();
35
36 // get ordering
37 $ordering = $widget->getOrdering();
38
39 foreach ($data as $customer => $table)
40 {
41 ?>
42 <h4 style="margin: 10px 0;"><?php echo $customer; ?></h4>
43
44 <div class="widget-revenue-table">
45 <table data-widget-id="<?php echo $widget->getID(); ?>">
46
47 <thead>
48 <tr>
49
50 <!-- EMPLOYEE -->
51
52 <th style="text-align: left;" class="<?php echo $ordering['column'] == 'employee' ? 'sorted' : ''; ?>">
53 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPMANAGERESERVATION3', 'employee', $ordering['direction'], $ordering['column'], 'asc'); ?>
54 </th>
55
56 <!-- COUNT -->
57
58 <th style="text-align: right;" class="<?php echo $ordering['column'] == 'count' ? 'sorted' : ''; ?>">
59 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPORDERS', 'count', $ordering['direction'], $ordering['column'], 'desc'); ?>
60 </th>
61
62 <?php
63 if ($widget->hasFinanceAccess())
64 {
65 ?>
66 <!-- TOTAL GROSS -->
67
68 <th style="text-align: right;" class="<?php echo $ordering['column'] == 'total' ? 'sorted' : ''; ?>">
69 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPTOTALGROSS', 'total', $ordering['direction'], $ordering['column'], 'desc'); ?>
70 </th>
71
72 <!-- TOTAL TAX -->
73
74 <th style="text-align: right;" class="<?php echo $ordering['column'] == 'tax' ? 'sorted' : ''; ?>">
75 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPTOTALTAX', 'tax', $ordering['direction'], $ordering['column'], 'desc'); ?>
76 </th>
77
78 <!-- TOTAL NET -->
79
80 <th style="text-align: right;" class="<?php echo $ordering['column'] == 'net' ? 'sorted' : ''; ?>">
81 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPTOTALNET', 'net', $ordering['direction'], $ordering['column'], 'desc'); ?>
82 </th>
83
84 <!-- TOTAL DISCOUNT -->
85
86 <th style="text-align: right;" class="<?php echo $ordering['column'] == 'discount' ? 'sorted' : ''; ?>">
87 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPMANAGEPACKAGE13', 'discount', $ordering['direction'], $ordering['column'], 'desc'); ?>
88 </th>
89 <?php
90 }
91 ?>
92
93 </tr>
94 </thead>
95
96 <tbody>
97 <?php
98 foreach ($table['body'] as $totals)
99 {
100 ?>
101 <tr>
102
103 <!-- EMPLOYEE -->
104
105 <td style="text-align: left;" class="<?php echo $ordering['column'] == 'employee' ? 'sorted' : ''; ?>">
106 <?php echo $totals['employee']; ?>
107 </td>
108
109 <!-- COUNT -->
110
111 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'count' ? 'sorted' : ''; ?>">
112 <?php echo isset($totals['count']) ? $totals['count'] : 0; ?>
113 </td>
114
115 <?php
116 if ($widget->hasFinanceAccess())
117 {
118 ?>
119 <!-- TOTAL GROSS -->
120
121 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'total' ? 'sorted' : ''; ?>">
122 <?php echo $currency->format(isset($totals['total']) ? $totals['total'] : 0); ?>
123 </td>
124
125 <!-- TOTAL TAX -->
126
127 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'tax' ? 'sorted' : ''; ?>">
128 <?php echo $currency->format(isset($totals['tax']) ? $totals['tax'] : 0); ?>
129 </td>
130
131 <!-- TOTAL NET -->
132
133 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'net' ? 'sorted' : ''; ?>">
134 <?php echo $currency->format(isset($totals['net']) ? $totals['net'] : 0); ?>
135 </td>
136
137 <!-- TOTAL DISCOUNT -->
138
139 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'discount' ? 'sorted' : ''; ?>">
140 <?php echo $currency->format(isset($totals['discount']) ? $totals['discount'] : 0); ?>
141 </td>
142 <?php
143 }
144 ?>
145
146 </tr>
147 <?php
148 }
149 ?>
150 </tbody>
151
152 <tfoot>
153 <tr>
154
155 <!-- EMPLOYEE -->
156
157 <td style="text-align: left;" class="<?php echo $ordering['column'] == 'employee' ? 'sorted' : ''; ?>">&nbsp;</td>
158
159 <!-- COUNT -->
160
161 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'count' ? 'sorted' : ''; ?>">
162 <?php echo isset($table['footer']['count']) ? $table['footer']['count'] : 0; ?>
163 </td>
164
165 <?php
166 if ($widget->hasFinanceAccess())
167 {
168 ?>
169 <!-- TOTAL GROSS -->
170
171 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'total' ? 'sorted' : ''; ?>">
172 <?php echo $currency->format(isset($table['footer']['total']) ? $table['footer']['total'] : 0); ?>
173 </td>
174
175 <!-- TOTAL TAX -->
176
177 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'tax' ? 'sorted' : ''; ?>">
178 <?php echo $currency->format(isset($table['footer']['tax']) ? $table['footer']['tax'] : 0); ?>
179 </td>
180
181 <!-- TOTAL NET -->
182
183 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'net' ? 'sorted' : ''; ?>">
184 <?php echo $currency->format(isset($table['footer']['net']) ? $table['footer']['net'] : 0); ?>
185 </td>
186
187 <!-- TOTAL DISCOUNT -->
188
189 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'discount' ? 'sorted' : ''; ?>">
190 <?php echo $currency->format(isset($table['footer']['discount']) ? $table['footer']['discount'] : 0); ?>
191 </td>
192 <?php
193 }
194 ?>
195
196 </tr>
197 </tfoot>
198
199 </table>
200 </div>
201 <?php
202 }
203