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 / finance / payments / table.php
vikappointments / admin / layouts / statistics / widgets / finance / payments Last commit date
chart.php 6 days ago index.html 6 days ago table.php 6 days ago
table.php
190 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 <!-- PAYMENT -->
43
44 <th style="text-align: left;" class="<?php echo $ordering['column'] == 'payname' ? 'sorted' : ''; ?>">
45 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPMANAGERESERVATION13', 'payname', $ordering['direction'], $ordering['column'], 'asc'); ?>
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', 'VAPORDERS', '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 <!-- PAYMENT CHARGE -->
79
80 <th style="text-align: right;" class="<?php echo $ordering['column'] == 'payment' ? 'sorted' : ''; ?>">
81 <?php echo JHtml::fetch('vaphtml.admin.customsort', 'VAPINVPAYCHARGE', 'payment', $ordering['direction'], $ordering['column'], 'desc'); ?>
82 </th>
83
84 </tr>
85 </thead>
86
87 <tbody>
88 <?php
89 foreach ($data as $totals)
90 {
91 ?>
92 <tr>
93
94 <!-- PAYMENT -->
95
96 <td style="text-align: left;" class="<?php echo $ordering['column'] == 'payname' ? 'sorted' : ''; ?>">
97 <?php echo $totals['name']; ?>
98 </td>
99
100 <!-- COUNT -->
101
102 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'count' ? 'sorted' : ''; ?>">
103 <?php echo isset($totals['count']) ? $totals['count'] : 0; ?>
104 </td>
105
106 <!-- TOTAL GROSS -->
107
108 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'total' ? 'sorted' : ''; ?>">
109 <?php echo $currency->format(isset($totals['total']) ? $totals['total'] : 0); ?>
110 </td>
111
112 <!-- TOTAL TAX -->
113
114 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'tax' ? 'sorted' : ''; ?>">
115 <?php echo $currency->format(isset($totals['tax']) ? $totals['tax'] : 0); ?>
116 </td>
117
118 <!-- TOTAL NET -->
119
120 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'net' ? 'sorted' : ''; ?>">
121 <?php echo $currency->format(isset($totals['net']) ? $totals['net'] : 0); ?>
122 </td>
123
124 <!-- TOTAL DISCOUNT -->
125
126 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'discount' ? 'sorted' : ''; ?>">
127 <?php echo $currency->format(isset($totals['discount']) ? $totals['discount'] : 0); ?>
128 </td>
129
130 <!-- PAYMENT CHARGE -->
131
132 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'payment' ? 'sorted' : ''; ?>">
133 <?php echo $currency->format(isset($totals['payment']) ? $totals['payment'] : 0); ?>
134 </td>
135
136 </tr>
137 <?php
138 }
139 ?>
140 </tbody>
141
142 <tfoot>
143 <tr>
144
145 <!-- PAYMENT -->
146
147 <td style="text-align: left;" class="<?php echo $ordering['column'] == 'payname' ? 'sorted' : ''; ?>">&nbsp;</td>
148
149 <!-- COUNT -->
150
151 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'count' ? 'sorted' : ''; ?>">
152 <?php echo $footer['count'] ?? 0; ?>
153 </td>
154
155 <!-- TOTAL GROSS -->
156
157 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'total' ? 'sorted' : ''; ?>">
158 <?php echo $currency->format($footer['total'] ?? 0); ?>
159 </td>
160
161 <!-- TOTAL TAX -->
162
163 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'tax' ? 'sorted' : ''; ?>">
164 <?php echo $currency->format($footer['tax'] ?? 0); ?>
165 </td>
166
167 <!-- TOTAL NET -->
168
169 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'net' ? 'sorted' : ''; ?>">
170 <?php echo $currency->format($footer['net'] ?? 0); ?>
171 </td>
172
173 <!-- TOTAL DISCOUNT -->
174
175 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'discount' ? 'sorted' : ''; ?>">
176 <?php echo $currency->format($footer['discount'] ?? 0); ?>
177 </td>
178
179 <!-- PAYMENT CHARGE -->
180
181 <td style="text-align: right;" class="<?php echo $ordering['column'] == 'payment' ? 'sorted' : ''; ?>">
182 <?php echo $currency->format($footer['payment'] ?? 0); ?>
183 </td>
184
185 </tr>
186 </tfoot>
187
188 </table>
189 </div>
190