PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / 1.2.21
VikAppointments Services Booking Calendar v1.2.21
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / site / controllers / calendarweek.php
vikappointments / site / controllers Last commit date
calendarweek.php 2 days ago cart.php 2 days ago confirmapp.php 2 days ago empattachser.php 2 days ago empeditcoupon.php 2 days ago empeditcustfield.php 2 days ago empeditlocation.php 2 days ago empeditpay.php 2 days ago empeditprofile.php 2 days ago empeditservice.php 2 days ago empeditwdays.php 2 days ago emplocwdays.php 2 days ago emplogin.php 2 days ago employeesearch.php 2 days ago employeeslist.php 2 days ago empmakerecur.php 2 days ago empmanres.php 2 days ago empsettings.php 2 days ago empsubscr.php 2 days ago empsubscrorder.php 2 days ago index.html 2 days ago modules.php 2 days ago order.php 2 days ago packages.php 2 days ago packagesconfirm.php 2 days ago packagesorder.php 2 days ago servicesearch.php 2 days ago subscriptions.php 2 days ago subscrpayment.php 2 days ago userprofile.php 2 days ago waitinglist.php 2 days 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