PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / trunk
VikAppointments Services Booking Calendar vtrunk
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 3 years ago cart.php 3 months ago confirmapp.php 18 hours 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 6 months ago empeditservice.php 4 years ago empeditwdays.php 4 years ago emplocwdays.php 4 years ago emplogin.php 18 hours ago employeesearch.php 18 hours ago employeeslist.php 4 years ago empmakerecur.php 3 months ago empmanres.php 3 months ago empsettings.php 2 years ago empsubscr.php 4 years ago empsubscrorder.php 2 years ago index.html 7 years ago modules.php 2 years ago order.php 6 months ago packages.php 4 years ago packagesconfirm.php 4 years ago packagesorder.php 2 years ago servicesearch.php 18 hours ago subscriptions.php 4 years ago subscrpayment.php 2 years ago userprofile.php 18 hours ago waitinglist.php 4 years 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