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 / calendar / appointments.php
vikappointments / admin / layouts / calendar Last commit date
appointments.php 2 days ago index.html 2 days ago
appointments.php
201 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 array $appointments A list of appointments.
18 */
19 extract($displayData);
20
21 if (!$appointments)
22 {
23 // no appointment, nothing to show...
24 return '';
25 }
26
27 $config = VAPFactory::getConfig();
28 $currency = VAPFactory::getCurrency();
29
30 $vik = VAPApplication::getInstance();
31
32 $hasCost = false;
33
34 // check whether we have at least an appointment with a cost,
35 // otherwise we can assume that the provider is offering free
36 // services and we can avoid displaying such column
37 foreach ($appointments as $row)
38 {
39 if ($row->total_cost > 0)
40 {
41 $hasCost = true;
42 break;
43 }
44 }
45
46 ?>
47
48 <table cellpadding="4" cellspacing="0" border="0" width="100%" class="<?php echo $vik->getAdminTableClass(); ?>">
49
50 <?php echo $vik->openTableHead(); ?>
51 <tr>
52
53 <!-- ID -->
54
55 <th class="<?php echo $vik->getAdminThClass('left nowrap hidden-phone'); ?>" width="1%" style="text-align: left;">
56 <?php echo JText::translate('VAPMANAGERESERVATION0'); ?>
57 </th>
58
59 <!-- BEGIN -->
60
61 <th class="<?php echo $vik->getAdminThClass('nowrap'); ?>" width="5%" style="text-align: center;">
62 <?php echo JText::translate('VAPMANAGERESERVATION5'); ?>
63 </th>
64
65 <!-- END -->
66
67 <th class="<?php echo $vik->getAdminThClass('nowrap hidden-phone'); ?>" width="5%" style="text-align: center;">
68 <?php echo JText::translate('VAPMANAGERESERVATION6'); ?>
69 </th>
70
71 <!-- SERVICE -->
72
73 <th class="<?php echo $vik->getAdminThClass('left'); ?>" width="10%" style="text-align: left;">
74 <?php echo JText::translate('VAPMANAGERESERVATION4'); ?>
75 </th>
76
77 <!-- CUSTOMER -->
78
79 <th class="<?php echo $vik->getAdminThClass('left'); ?>" width="10%" style="text-align: left;">
80 <?php echo JText::translate('VAPMANAGERESERVATION38'); ?>
81 </th>
82
83 <!-- PEOPLE -->
84
85 <th class="<?php echo $vik->getAdminThClass('nowrap hidden-phone'); ?>" width="5%" style="text-align: center;">
86 <?php echo JText::translate('VAPMANAGERESERVATION25'); ?>
87 </th>
88
89 <!-- TOTAL -->
90
91 <?php
92 if ($hasCost)
93 {
94 ?>
95 <th class="<?php echo $vik->getAdminThClass('nowrap hidden-phone'); ?>" width="5%" style="text-align: center;">
96 <?php echo JText::translate('VAPMANAGERESERVATION9'); ?>
97 </th>
98 <?php
99 }
100 ?>
101
102 <!-- STATUS -->
103
104 <th class="<?php echo $vik->getAdminThClass('hidden-phone'); ?>" width="8%" style="text-align: center;">
105 <?php echo JText::translate('VAPMANAGERESERVATION12'); ?>
106 </th>
107
108 <!-- PREVIEW -->
109
110 <th class="<?php echo $vik->getAdminThClass(); ?>" width="5%" style="text-align: center;">
111 <?php echo JText::translate('VAPMANAGERESERVATION20'); ?>
112 </th>
113
114 </tr>
115 <?php echo $vik->closeTableHead(); ?>
116
117 <?php
118 foreach ($appointments as $i => $row)
119 {
120 ?>
121 <tr class="row<?php echo ($i % 2); ?>" id="vaptabrow<?php echo $row->id; ?>" data-id="<?php echo $row->id; ?>">
122
123 <!-- ID -->
124
125 <td class="hidden-phone">
126 <?php echo $row->id; ?>
127 </td>
128
129 <!-- BEGIN -->
130
131 <td style="text-align: center;">
132 <?php echo JHtml::fetch('date', $row->checkin_ts, $config->get('timeformat')); ?>
133 </td>
134
135 <!-- END -->
136
137 <td style="text-align: center;" class="hidden-phone">
138 <?php echo JHtml::fetch('date', VikAppointments::getCheckout($row->checkin_ts, $row->duration), $config->get('timeformat')); ?>
139 </td>
140
141 <!-- SERVICE -->
142
143 <td>
144 <?php echo $row->service_name; ?>
145 </td>
146
147 <!-- CUSTOMER -->
148
149 <td>
150 <?php
151 if ($row->purchaser_nominative)
152 {
153 echo $row->purchaser_nominative;
154 }
155 else
156 {
157 echo $row->purchaser_mail;
158 }
159 ?>
160 </td>
161
162 <!-- PEOPLE -->
163
164 <td style="text-align: center;" class="hidden-phone">
165 <?php echo $row->people; ?>
166 </td>
167
168 <!-- TOTAL COST -->
169
170 <?php
171 if ($hasCost)
172 {
173 ?>
174 <td style="text-align: center;" class="hidden-phone">
175 <?php echo $currency->format($row->total_cost); ?>
176 </td>
177 <?php
178 }
179 ?>
180
181 <!-- STATUS -->
182
183 <td style="text-align: center;" class="hidden-phone">
184 <?php echo JHtml::fetch('vaphtml.status.display', $row->status); ?>
185 </td>
186
187 <!-- PREVIEW -->
188
189 <td style="text-align: center;">
190 <a href="javascript:void(0)" onclick="displayDetailsView([<?php echo $row->id; ?>]);">
191 <i class="fas fa-eye"></i>
192 </a>
193 </td>
194
195 </tr>
196 <?php
197 }
198 ?>
199
200 </table>
201