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_service.php
159 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 | $reviews_enabled = $this->displayData['reviewsEnabled']; |
| 15 | $rev_sub_title = $this->displayData['review_sub']; |
| 16 | |
| 17 | $vik = VAPApplication::getInstance(); |
| 18 | |
| 19 | ?> |
| 20 | |
| 21 | <div class="vapempblock <?php echo $this->escape($this->service->layout); ?> <?php echo $this->escape($vik->getThemeClass('background')); ?>" id="vapempblock<?php echo (int) $this->service->id; ?>"> |
| 22 | |
| 23 | <div class="vapempinfoblock"> |
| 24 | |
| 25 | <?php |
| 26 | if (strlen($this->service->image) && file_exists(VAPMEDIA_SMALL . DIRECTORY_SEPARATOR . $this->service->image)) |
| 27 | { |
| 28 | ?> |
| 29 | <div class="vapempimgdiv"> |
| 30 | <a href="javascript:void(0)" class="vapmodal" onClick="vapOpenModalImage('<?php echo VAPMEDIA_URI . $this->service->image; ?>', this);"> |
| 31 | <?php |
| 32 | // render image tag |
| 33 | echo JHtml::fetch('vaphtml.media.display', $this->service->image, [ |
| 34 | 'loading' => 'lazy', |
| 35 | 'alt' => $this->service->name, |
| 36 | 'small' => false, |
| 37 | ]); |
| 38 | ?> |
| 39 | </a> |
| 40 | </div> |
| 41 | <?php |
| 42 | } |
| 43 | ?> |
| 44 | |
| 45 | <div class="vap-empmain-block"> |
| 46 | |
| 47 | <div class="vap-empheader-div"> |
| 48 | |
| 49 | <div class="vapempnamediv"> |
| 50 | <a href="<?php echo JRoute::rewrite('index.php?option=com_vikappointments&view=servicesearch&id_service=' . $this->service->id . ($this->itemid ? '&Itemid=' . $this->itemid : '')); ?>"> |
| 51 | <?php echo $this->service->name; ?> |
| 52 | </a> |
| 53 | </div> |
| 54 | |
| 55 | <?php if ($reviews_enabled): ?> |
| 56 | <div class="vapempratingwrapper"> |
| 57 | <div class="vapempratingdiv"> |
| 58 | <?php |
| 59 | // Display the rating stars through this helper method. |
| 60 | // Set the argument to false to use FontAwesome icons |
| 61 | // in place of the images. |
| 62 | echo JHtml::fetch('vikappointments.rating', $this->service->rating, $image = true); |
| 63 | ?> |
| 64 | </div> |
| 65 | <?php if (!empty($rev_sub_title)): ?> |
| 66 | <div class="vap-empsubreview-div"> |
| 67 | <?php echo $rev_sub_title; ?> |
| 68 | </div> |
| 69 | <?php endif; ?> |
| 70 | </div> |
| 71 | <?php endif; ?> |
| 72 | |
| 73 | </div> |
| 74 | |
| 75 | <div class="vapempdescdiv"> |
| 76 | <?php |
| 77 | // display long service description |
| 78 | echo VikAppointments::renderHtmlDescription($this->service->description, 'servicesearch'); |
| 79 | ?> |
| 80 | </div> |
| 81 | |
| 82 | </div> |
| 83 | |
| 84 | </div> |
| 85 | |
| 86 | <div class="vapempcontactdiv"> |
| 87 | <span class="vapempcontactsp"> |
| 88 | |
| 89 | <?php |
| 90 | if ($this->service->quick_contact) |
| 91 | { |
| 92 | ?> |
| 93 | <span class="vap-price-info-box service-ask left-side"> |
| 94 | <i class="fas fa-envelope"></i> |
| 95 | |
| 96 | <span class="vapempquickcontsp"> |
| 97 | <a href="javascript:void(0)" onClick="vapGoToMail('.vapempinfoblock');"> |
| 98 | <?php echo JText::translate('VAPSERQUICKCONTACT'); ?> |
| 99 | </a> |
| 100 | </span> |
| 101 | </span> |
| 102 | <?php |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * Check whether the price of the service should be displayed or not. |
| 107 | * |
| 108 | * @since 1.7 |
| 109 | */ |
| 110 | if (VikAppointments::shouldDisplayServicePrice($this->service)) |
| 111 | { |
| 112 | $service_cost = VAPSpecialRates::getRate($this->service->id, $this->idEmployee, $this->date, $this->service->min_per_res); |
| 113 | |
| 114 | if ($this->service->priceperpeople) |
| 115 | { |
| 116 | $service_cost *= $this->service->min_per_res; |
| 117 | } |
| 118 | ?> |
| 119 | <span class="vap-price-info-box service-price"> |
| 120 | <i class="fas fa-money-bill"></i> |
| 121 | |
| 122 | <span class="vapempserpricesp"> |
| 123 | <?php echo VAPFactory::getCurrency()->format($service_cost); ?> |
| 124 | </span> |
| 125 | </span> |
| 126 | <?php |
| 127 | } |
| 128 | ?> |
| 129 | |
| 130 | <span class="vap-price-info-box service-duration"> |
| 131 | <i class="fas fa-clock"></i> |
| 132 | |
| 133 | <span class="vapempsertimesp"> |
| 134 | <?php echo VikAppointments::formatMinutesToTime($this->service->duration); ?> |
| 135 | </span> |
| 136 | </span> |
| 137 | |
| 138 | </span> |
| 139 | </div> |
| 140 | |
| 141 | </div> |
| 142 | |
| 143 | <script> |
| 144 | |
| 145 | function vapUpdateServiceRate(rate) { |
| 146 | /** |
| 147 | * @todo Should the rate be updated |
| 148 | * also in case the new cost has been |
| 149 | * nullified (free)? |
| 150 | */ |
| 151 | |
| 152 | if (rate > 0) { |
| 153 | // update only if the rate is higher than 0 |
| 154 | jQuery('.vapempserpricesp').html(VAPCurrency.getInstance().format(rate)); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | </script> |
| 159 |