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 / employeeslist.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
employeeslist.php
75 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 employees list view controller.
18 *
19 * @since 1.7
20 */
21 class VikAppointmentsControllerEmployeeslist extends VAPControllerAdmin
22 {
23 /**
24 * AJAX task used to return the availability table of a specific 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 date 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_ser'] = $input->getUint('id_ser', 0);
40 $args['id_emp'] = $input->getUint('id_emp', 0);
41 $args['date'] = $input->getString('date', '');
42
43 // get model
44 $model = $this->getModel();
45 // use model to create the timeline
46 $timeline = $model->getTimeline($args);
47
48 if (!$timeline)
49 {
50 // raise error message
51 $error = $model->getError($index = null, $string = false);
52
53 if ($error instanceof Exception)
54 {
55 UIErrorFactory::raiseError($error->getCode(), $error->getMessage());
56 }
57 else
58 {
59 UIErrorFactory::raiseError(500, $error);
60 }
61 }
62
63 // set item ID as display data
64 $args['itemid'] = $input->getUint('Itemid');
65
66 // create timeline response
67 $result = new stdClass;
68 $result->html = $timeline->display($args);
69 $result->timeline = $timeline->getTimeline();
70
71 // send timeline to caller
72 $this->sendJSON($result);
73 }
74 }
75