calendar
1 day ago
login
1 day ago
payment
1 day ago
alert.php
1 day ago
carttotals.php
1 day ago
checkout.php
1 day ago
couponform.php
1 day ago
index.html
1 day ago
login.php
1 day ago
options.php
1 day ago
paymentmethods.php
1 day ago
quickcontact.php
1 day ago
reviews.php
1 day ago
timeline.php
1 day ago
waitlist.php
1 day ago
waitlist.php
105 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 | $id_service = isset($displayData['id_service']) ? $displayData['id_service'] : 0; |
| 15 | $id_employee = isset($displayData['id_employee']) ? $displayData['id_employee'] : 0; |
| 16 | $title = isset($displayData['title']) ? $displayData['title'] : ''; |
| 17 | $itemid = isset($displayData['itemid']) ? $displayData['itemid'] : null; |
| 18 | |
| 19 | if (is_null($itemid)) |
| 20 | { |
| 21 | // item id not provided, get the current one (if set) |
| 22 | $itemid = JFactory::getApplication()->input->getInt('Itemid'); |
| 23 | } |
| 24 | |
| 25 | $vik = VAPApplication::getInstance(); |
| 26 | |
| 27 | ?> |
| 28 | |
| 29 | <div class="vap-overlay" id="vapaddwaitlistoverlay" style="display: none;"> |
| 30 | <div class="vap-modal-box" style="width: 80%;max-width: 800px;height: 60%;margin-top:10px;"> |
| 31 | |
| 32 | <div class="vap-modal-head"> |
| 33 | <div class="vap-modal-head-title"> |
| 34 | <h3><?php echo $title; ?></h3> |
| 35 | </div> |
| 36 | |
| 37 | <div class="vap-modal-head-dismiss"> |
| 38 | <a href="javascript: void(0);" onClick="vapCloseWaitListOverlay('vapaddwaitlistoverlay');">×</a> |
| 39 | </div> |
| 40 | </div> |
| 41 | |
| 42 | <div class="vap-modal-body" style="height:90%;overflow:scroll;"> |
| 43 | |
| 44 | </div> |
| 45 | |
| 46 | </div> |
| 47 | </div> |
| 48 | |
| 49 | <?php |
| 50 | JText::script('VAPWAITLISTADDED0'); |
| 51 | ?> |
| 52 | |
| 53 | <script> |
| 54 | |
| 55 | function vapOpenWaitListOverlay(ref, date, title) { |
| 56 | if (title) { |
| 57 | jQuery('.vap-modal-head-title h3').text(title); |
| 58 | } |
| 59 | |
| 60 | jQuery('#' + ref).show(); |
| 61 | |
| 62 | UIAjax.do( |
| 63 | '<?php echo $vik->ajaxUrl('index.php?option=com_vikappointments&tmpl=component&view=pushwl' . ($itemid ? '&Itemid=' . $itemid : ''), false); ?>', |
| 64 | { |
| 65 | date: date, |
| 66 | id_service: <?php echo $id_service; ?>, |
| 67 | id_employee: <?php echo $id_employee; ?>, |
| 68 | }, |
| 69 | (resp) => { |
| 70 | try { |
| 71 | // try to decode JSON |
| 72 | resp = JSON.parse(resp); |
| 73 | } catch (err) { |
| 74 | // nothing to decode |
| 75 | } |
| 76 | |
| 77 | if (Array.isArray(resp)) { |
| 78 | // in case of array, join the elements |
| 79 | resp = resp.join("\n"); |
| 80 | } |
| 81 | |
| 82 | jQuery('.vap-modal-body').html(resp); |
| 83 | }, |
| 84 | (err) => { |
| 85 | alert(Joomla.JText._('VAPWAITLISTADDED0')); |
| 86 | } |
| 87 | ); |
| 88 | } |
| 89 | |
| 90 | function vapCloseWaitListOverlay(ref) { |
| 91 | jQuery('#' + ref).hide(); |
| 92 | jQuery('.vap-modal-body').html(''); |
| 93 | } |
| 94 | |
| 95 | jQuery('.vap-modal-box').on('click', function(e) { |
| 96 | // ignore outside clicks |
| 97 | e.stopPropagation(); |
| 98 | }); |
| 99 | |
| 100 | jQuery('.vap-overlay').on('click', function() { |
| 101 | vapCloseWaitListOverlay('vapaddwaitlistoverlay'); |
| 102 | }); |
| 103 | |
| 104 | </script> |
| 105 |