default.php
3 days ago
default.xml
3 days ago
default_appointment.php
3 days ago
default_attendees.php
3 days ago
default_backbutton.php
3 days ago
default_countdown.php
3 days ago
default_locations.php
3 days ago
default_orderdetails.php
3 days ago
default_service.php
3 days ago
default_usernote.php
3 days ago
default_usernote_block.php
3 days ago
index.html
3 days ago
track.php
3 days ago
default_service.php
75 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 | // we are inside a foreach, extract the current element of the cycle |
| 15 | $appointments = $this->groupServices; |
| 16 | |
| 17 | ?> |
| 18 | |
| 19 | <div class="vaporderboxcontent"> |
| 20 | |
| 21 | <!-- BOX TITLE --> |
| 22 | |
| 23 | <div class="vap-order-first"> |
| 24 | <h3 class="vaporderheader vap-head-first"><?php echo $appointments[0]->service->name; ?></h3> |
| 25 | </div> |
| 26 | |
| 27 | <?php |
| 28 | // Iterate all the appointments that belong to this service, |
| 29 | // that might occur in case of a multi-order. |
| 30 | foreach ($appointments as $appointment) |
| 31 | { |
| 32 | // keep track of the current appointment |
| 33 | $this->appointment = $appointment; |
| 34 | |
| 35 | // increase counter |
| 36 | $this->count++; |
| 37 | |
| 38 | // display the appointment details and the purchased options |
| 39 | echo $this->loadTemplate('appointment'); |
| 40 | } |
| 41 | |
| 42 | // check whether the cancellation is enabled |
| 43 | if (VAPFactory::getConfig()->getBool('enablecanc') && $this->order->statusRole == 'APPROVED') |
| 44 | { |
| 45 | $count = count($this->order->appointments); |
| 46 | |
| 47 | if ($count == 1) |
| 48 | { |
| 49 | // cancel the booked appointment |
| 50 | $canc_all_text = 'VAPORDERCANCBUTTON'; |
| 51 | } |
| 52 | else |
| 53 | { |
| 54 | // cancel all the appointments |
| 55 | $canc_all_text = 'VAPORDERCANCALLBUTTON'; |
| 56 | } |
| 57 | |
| 58 | // display the global cancellation button only at the end of the list, after |
| 59 | // checking the possibility |
| 60 | if ($this->count == $count && $this->canUserCancelAll) |
| 61 | { |
| 62 | ?> |
| 63 | <div class="vapordercancdiv vapcancallbox"> |
| 64 | <button type="button" class="vap-btn red" onClick="vapCancelButtonPressed('<?php echo $this->cancelURI; ?>');"> |
| 65 | <i class="far fa-calendar-times"></i> |
| 66 | <?php echo JText::translate($canc_all_text); ?> |
| 67 | </button> |
| 68 | </div> |
| 69 | <?php |
| 70 | } |
| 71 | } |
| 72 | ?> |
| 73 | |
| 74 | </div> |
| 75 |