default.php
1 month ago
default.xml
1 month ago
default_calendars.php
1 month ago
default_checkout.php
1 month ago
default_contact.php
1 month ago
default_filterbar.php
1 month ago
default_login.php
1 month ago
default_options.php
1 month ago
default_reviews.php
1 month ago
default_service.php
1 month ago
default_timeline.php
1 month ago
default_waitlist.php
1 month ago
index.html
1 month ago
default.php
180 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 | JHtml::fetch('vaphtml.assets.select2'); |
| 15 | JHtml::fetch('vaphtml.assets.fancybox'); |
| 16 | JHtml::fetch('vaphtml.assets.fontawesome'); |
| 17 | |
| 18 | // reviews section |
| 19 | $reviews_enabled = VikAppointments::isServicesReviewsEnabled(); |
| 20 | $rev_sub_title = ''; |
| 21 | |
| 22 | if ($this->service->reviews->size > 0) |
| 23 | { |
| 24 | $rev_sub_title = JText::plural('VAPREVIEWSSUBTITLE_N', $this->service->reviews->size); |
| 25 | } |
| 26 | |
| 27 | if ($this->service->reviews->votes > 0 && $this->service->reviews->votes != $this->service->reviews->size) |
| 28 | { |
| 29 | if (!empty($rev_sub_title)) |
| 30 | { |
| 31 | $rev_sub_title .= ", "; |
| 32 | } |
| 33 | |
| 34 | $rev_sub_title .= JText::plural('VAPVOTESSUBTITLE_N', $this->service->reviews->votes); |
| 35 | } |
| 36 | |
| 37 | if (empty($rev_sub_title)) |
| 38 | { |
| 39 | $rev_sub_title = JText::translate('VAPREVIEWSSUBTITLE_N_0'); |
| 40 | } |
| 41 | |
| 42 | ?> |
| 43 | |
| 44 | <!-- SERVICE DETAILS --> |
| 45 | |
| 46 | <?php |
| 47 | // Register the service details within a property of this class |
| 48 | // to make it available also for the sublayout. |
| 49 | $this->displayData = array( |
| 50 | 'reviewsEnabled' => $reviews_enabled, |
| 51 | 'review_sub' => $rev_sub_title, |
| 52 | ); |
| 53 | |
| 54 | // Get service template with name, description, |
| 55 | // image and so on. |
| 56 | echo $this->loadTemplate('service'); |
| 57 | ?> |
| 58 | |
| 59 | <!-- CONTACT FORM --> |
| 60 | |
| 61 | <?php |
| 62 | // load the contact form only if enabled |
| 63 | if ($this->service->quick_contact) |
| 64 | { |
| 65 | // get quick contact template |
| 66 | echo $this->loadTemplate('contact'); |
| 67 | } |
| 68 | ?> |
| 69 | |
| 70 | <!-- SEARCH FORM --> |
| 71 | |
| 72 | <form name="sersearchform" action="<?php echo JRoute::rewrite('index.php?option=com_vikappointments&view=servicesearch&id_service=' . $this->service->id . ($this->itemid ? '&Itemid=' . $this->itemid : '')); ?>" method="post" id="vapsersearchform"> |
| 73 | |
| 74 | <!-- FILTER BAR --> |
| 75 | |
| 76 | <?php |
| 77 | // Get filterbar template, containing the selection of the employee, |
| 78 | // the month and the number of people. |
| 79 | echo $this->loadTemplate('filterbar'); |
| 80 | ?> |
| 81 | |
| 82 | <!-- CALENDARS --> |
| 83 | |
| 84 | <?php |
| 85 | // get calendars (and timeline) template |
| 86 | echo $this->loadTemplate('calendars'); |
| 87 | ?> |
| 88 | |
| 89 | <!-- TIMELINE --> |
| 90 | |
| 91 | <?php |
| 92 | /** |
| 93 | * Display timeline template. |
| 94 | * Before 1.7 version, this layout was included |
| 95 | * within default_calendar.php |
| 96 | * |
| 97 | * @since 1.7 |
| 98 | */ |
| 99 | echo $this->loadTemplate('timeline'); |
| 100 | ?> |
| 101 | |
| 102 | <!-- OPTIONS --> |
| 103 | |
| 104 | <?php if ($this->service->options): ?> |
| 105 | <div class="details-options-wrapper"> |
| 106 | <?php echo $this->loadTemplate('options'); ?> |
| 107 | </div> |
| 108 | <?php endif; ?> |
| 109 | |
| 110 | <!-- CHECKOUT --> |
| 111 | |
| 112 | <?php |
| 113 | // get checkout template containing the recurrence box and the checkout buttons |
| 114 | echo $this->loadTemplate('checkout'); |
| 115 | ?> |
| 116 | |
| 117 | <input type="hidden" name="id_service" value="<?php echo (int) $this->service->id; ?>" /> |
| 118 | <input type="hidden" name="date" value="<?php echo $this->escape($this->date); ?>" id="vapdayselected" /> |
| 119 | <input type="hidden" name="people" value="" id="vappeopleselected" /> |
| 120 | |
| 121 | <input type="hidden" name="view" value="servicesearch" /> |
| 122 | <input type="hidden" name="option" value="com_vikappointments" /> |
| 123 | </form> |
| 124 | |
| 125 | <!-- CONFIRMATION FORM --> |
| 126 | |
| 127 | <form name="confirmapp" action="<?php echo JRoute::rewrite('index.php?option=com_vikappointments&view=confirmapp' . ($this->itemid ? '&Itemid=' . $this->itemid : '')); ?>" method="post" id="vapempconfirmapp"> |
| 128 | |
| 129 | <input type="hidden" name="id_service" value="" id="vapconfserselected" /> |
| 130 | <input type="hidden" name="id_employee" value="" id="vapconfempselected" /> |
| 131 | <input type="hidden" name="date" value="" id="vapconfdayselected" /> |
| 132 | <input type="hidden" name="hour" value="" id="vapconfhourselected" /> |
| 133 | <input type="hidden" name="min" value="" id="vapconfminselected" /> |
| 134 | <input type="hidden" name="people" value="1" id="vapconfpeopleselected" /> |
| 135 | |
| 136 | <input type="hidden" name="from" value="1" /> |
| 137 | <input type="hidden" name="view" value="confirmapp" /> |
| 138 | <input type="hidden" name="option" value="com_vikappointments" /> |
| 139 | |
| 140 | </form> |
| 141 | |
| 142 | <!-- REVIEWS --> |
| 143 | |
| 144 | <?php |
| 145 | if (VikAppointments::isServicesReviewsEnabled()) |
| 146 | { |
| 147 | // Register the review details within a property of this class |
| 148 | // to make it available also for the sublayout. |
| 149 | $this->displayData = array( |
| 150 | 'subtitle' => $rev_sub_title, |
| 151 | ); |
| 152 | |
| 153 | // get reviews template |
| 154 | echo $this->loadTemplate('reviews'); |
| 155 | } |
| 156 | ?> |
| 157 | |
| 158 | <!-- WAITING LIST --> |
| 159 | |
| 160 | <?php |
| 161 | if (VikAppointments::isWaitingList()) |
| 162 | { |
| 163 | // load resources needed to support the WL phone field |
| 164 | JHtml::fetch('vaphtml.assets.intltel'); |
| 165 | |
| 166 | // get waiting list template (modal box) |
| 167 | echo $this->loadTemplate('waitlist'); |
| 168 | } |
| 169 | ?> |
| 170 | |
| 171 | <script> |
| 172 | |
| 173 | /** |
| 174 | * @usedby views/servicesearch/tmpl/default_calendars.php |
| 175 | * @usedby layouts/blocks/checkout.php |
| 176 | */ |
| 177 | var LAST_TIMESTAMP_USED = null; |
| 178 | |
| 179 | </script> |
| 180 |