default.php
140 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package VikAppointments |
| 4 | * @subpackage mod_vikappointments_services |
| 5 | * @author E4J s.r.l. |
| 6 | * @copyright Copyright (C) 2023 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 to this file |
| 12 | defined('ABSPATH') or die('No script kiddies please!'); |
| 13 | |
| 14 | $itemid = $params->get('itemid'); |
| 15 | |
| 16 | $listing = VikAppointments::getServicesListingDetails(); |
| 17 | |
| 18 | $currency = VAPFactory::getCurrency(); |
| 19 | |
| 20 | $pagination = $params->get('pagination', 0); |
| 21 | $navigation = $params->get('navigation', 1); |
| 22 | $autoplay = $params->get('autoplay', 1); |
| 23 | |
| 24 | ?> |
| 25 | |
| 26 | <div class="vamodservices-container wrap"> |
| 27 | <div id="vamodservices-<?php echo $module_id; ?>" class="owl-carousel owl-theme vamodservices-inner"> |
| 28 | |
| 29 | <?php foreach ($services as $service): ?> |
| 30 | <div class="vamodservices-item item"> |
| 31 | |
| 32 | <div class="vamodservices-boxdiv"> |
| 33 | |
| 34 | <?php if (!empty($service['image']) && $params->get('showimg')): ?> |
| 35 | <div class="vamodservices-image-box"> |
| 36 | <img src="<?php echo VAPMEDIA_URI . $service['image']; ?>" class="vamodservices-img" style="width: 100%;" alt="<?php echo htmlspecialchars($service['name']); ?> "/> |
| 37 | </div> |
| 38 | <?php endif; ?> |
| 39 | |
| 40 | <div class="vainf"> |
| 41 | |
| 42 | <div class="vamodservices-divblock"> |
| 43 | |
| 44 | <div class="vamodservices-name"><?php echo $service['name']; ?></div> |
| 45 | |
| 46 | <?php if ($params->get('showdesc')): ?> |
| 47 | <div class="vamodservices-desc"> |
| 48 | <?php |
| 49 | /** |
| 50 | * Displays the short description if specified, otherwise takes the first N |
| 51 | * characters from the long one. |
| 52 | * |
| 53 | * @since 1.4 |
| 54 | */ |
| 55 | echo VikAppointments::renderShortHtmlDescription($service['description'], $listing['desclength']); |
| 56 | ?> |
| 57 | </div> |
| 58 | <?php endif; ?> |
| 59 | |
| 60 | </div> |
| 61 | |
| 62 | </div> |
| 63 | |
| 64 | <div class="vamodservices-detailsbox"> |
| 65 | |
| 66 | <div class="vamodservices-details"> |
| 67 | |
| 68 | <?php if ($params->get('showduration')): ?> |
| 69 | <div class="vamodservices-duration"> |
| 70 | <span class="vamodservices-durlabel"><?php echo JText::translate('VASERVICESDURATIONTEXT'); ?></span> |
| 71 | <span class="vamodservices-dur"> <?php echo VikAppointments::formatMinutesToTime($service['duration']); ?></span> |
| 72 | </div> |
| 73 | <?php endif; ?> |
| 74 | |
| 75 | <?php if ($params->get('showprice') && $service['price'] > 0): ?> |
| 76 | <div class="vamodservices-cost"> |
| 77 | <div class="vamodservices-price"> |
| 78 | <?php |
| 79 | if ($params->get('showpricelabel')) |
| 80 | { |
| 81 | ?> |
| 82 | <span class="vamodservices-pricelabel"><?php echo JText::translate('VASERVICESPRICELABELTEXT'); ?> </span> |
| 83 | <?php |
| 84 | } |
| 85 | |
| 86 | echo $currency->format($service['price']); |
| 87 | ?> |
| 88 | </div> |
| 89 | </div> |
| 90 | <?php endif; ?> |
| 91 | |
| 92 | </div> |
| 93 | |
| 94 | <?php if ($params->get('showbutton')): ?> |
| 95 | <span class="vamodservices-view"> |
| 96 | <a href="<?php echo JRoute::rewrite('index.php?option=com_vikappointments&view=servicesearch&id_service=' . $service['id'] . ($itemid ? '&Itemid=' . $itemid : '')); ?>" class="vap-btn blue"> |
| 97 | <?php echo JText::translate('VASERVICESCONTINUE'); ?> |
| 98 | </a> |
| 99 | </span> |
| 100 | <?php endif; ?> |
| 101 | |
| 102 | </div> |
| 103 | |
| 104 | </div> |
| 105 | |
| 106 | </div> |
| 107 | <?php endforeach; ?> |
| 108 | |
| 109 | </div> |
| 110 | </div> |
| 111 | |
| 112 | <?php |
| 113 | /** |
| 114 | * The buttons named "next" and "prev" are now translatable. |
| 115 | * |
| 116 | * @since 1.3.2 |
| 117 | */ |
| 118 | JText::script('JPREV'); |
| 119 | JText::script('JNEXT'); |
| 120 | ?> |
| 121 | |
| 122 | <script> |
| 123 | (function($) { |
| 124 | 'use strict'; |
| 125 | |
| 126 | $(function() { |
| 127 | $("#vamodservices-<?php echo $module_id; ?>").owlCarousel({ |
| 128 | items: <?php echo $params->get('numb_roomrow', 4); ?>, |
| 129 | autoplay: <?php echo $autoplay == 1 || $autoplay === 'true' ? 'true' : 'false'; ?>, |
| 130 | autoplayTimeout: <?php echo (int) $params->get('autoplaytime', 5000); ?>, |
| 131 | dots: <?php echo $pagination == 1 || $pagination === 'true' ? 'true' : 'false'; ?>, |
| 132 | nav: <?php echo $navigation == 1 || $navigation === 'true' ? 'true' : 'false'; ?>, |
| 133 | navText: [Joomla.JText._('JPREV'), Joomla.JText._('JNEXT')], |
| 134 | lazyLoad: true, |
| 135 | loop: true, |
| 136 | }); |
| 137 | }); |
| 138 | })(jQuery); |
| 139 | </script> |
| 140 |