calendarweek.php
3 years ago
cart.php
1 month ago
confirmapp.php
2 years ago
empattachser.php
4 years ago
empeditcoupon.php
4 years ago
empeditcustfield.php
4 years ago
empeditlocation.php
4 years ago
empeditpay.php
4 years ago
empeditprofile.php
5 months ago
empeditservice.php
4 years ago
empeditwdays.php
4 years ago
emplocwdays.php
4 years ago
emplogin.php
2 years ago
employeesearch.php
2 years ago
employeeslist.php
4 years ago
empmakerecur.php
1 month ago
empmanres.php
1 month ago
empsettings.php
2 years ago
empsubscr.php
4 years ago
empsubscrorder.php
1 year ago
index.html
6 years ago
modules.php
1 year ago
order.php
5 months ago
packages.php
4 years ago
packagesconfirm.php
4 years ago
packagesorder.php
1 year ago
servicesearch.php
2 years ago
subscriptions.php
4 years ago
subscrpayment.php
1 year ago
userprofile.php
5 months ago
waitinglist.php
4 years ago
calendarweek.php
66 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 | VAPLoader::import('libraries.mvc.controllers.admin'); |
| 15 | |
| 16 | /** |
| 17 | * VikAppointments weekly calendar controller. |
| 18 | * |
| 19 | * @since 1.7 |
| 20 | */ |
| 21 | class VikAppointmentsControllerCalendarweek extends VAPControllerAdmin |
| 22 | { |
| 23 | /** |
| 24 | * AJAX task used to return the availability table of a specific service/employee. |
| 25 | * |
| 26 | * This method expects the following parameters to be sent via POST or GET. |
| 27 | * |
| 28 | * @param integer id_emp The employee ID. |
| 29 | * @param integer id_ser The service ID. |
| 30 | * @param string day The check-in date. |
| 31 | * |
| 32 | * @return void |
| 33 | */ |
| 34 | public function availtableajax() |
| 35 | { |
| 36 | $input = JFactory::getApplication()->input; |
| 37 | |
| 38 | $args = array(); |
| 39 | $args['id_emp'] = $input->getUint('id_emp', 0); |
| 40 | $args['id_ser'] = $input->getUint('id_ser', 0); |
| 41 | $args['start'] = $input->getString('day', ''); |
| 42 | $args['people'] = $input->getUint('people', null); |
| 43 | $args['locations'] = $input->getUint('locations', null); |
| 44 | |
| 45 | $args['layout'] = 'weekly'; |
| 46 | |
| 47 | // get model |
| 48 | $model = $this->getModel('employeesearch'); |
| 49 | // use model to create the timeline |
| 50 | $calendar = $model->getCalendar($args); |
| 51 | |
| 52 | // prepare layout data |
| 53 | $data = array( |
| 54 | 'calendar' => $calendar, |
| 55 | 'id_service' => $args['id_ser'], |
| 56 | 'id_employee' => $args['id_emp'], |
| 57 | ); |
| 58 | |
| 59 | // render layout |
| 60 | $html = JLayoutHelper::render('blocks.calendar.weekly', $data); |
| 61 | |
| 62 | // send calendar to caller |
| 63 | $this->sendJSON(json_encode($html)); |
| 64 | } |
| 65 | } |
| 66 |