当前位置: 首页>>代码示例>>PHP>>正文


PHP Appointment::removeEvent方法代码示例

本文整理汇总了PHP中Appointment::removeEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP Appointment::removeEvent方法的具体用法?PHP Appointment::removeEvent怎么用?PHP Appointment::removeEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Appointment的用法示例。


在下文中一共展示了Appointment::removeEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: header

         $app->appointmentEmail($data, true);
         $data['success'] = true;
     }
     header('Content-Type: application/json; charset=utf-8');
     echo json_encode($data);
     exit;
 } elseif ($_GET['page'] === "cancel-booked") {
     $now = new \DateTime();
     $date = new \DateTime($_POST['appointment_start']);
     $now->add(new \DateInterval("PT" . STUDENT_APPOINTMENT_MIN_HOURS_CANCELLATION . "H"));
     if ($now > $date) {
         throw new \InvalidArgumentException("Cannot cancel appointment.");
     }
     $data['appointment_start'] = $_POST['appointment_start'];
     $data['student'] = $SESSION->student_num;
     $data['emp_id'] = $app->removeEvent($data['student'], $data['appointment_start']);
     $data['remaining'] = $app->getAppointmentCount($_POST['appointment_type_id'], $_POST['appointment_start']);
     $app->appointmentEmail($data, false);
     header('Content-Type: application/json; charset=utf-8');
     echo json_encode($data);
     exit;
 } elseif ($_GET['page'] === "fetch-open") {
     $openSlots = $app->getStudentAppointments($_GET['start'], $_GET['end'], $_GET['appointment_type_id'], $_GET['emp_id']);
     $bookedSlots = $app->getStudentAppointments($_GET['start'], $_GET['end'], $_GET['appointment_type_id'], $_GET['emp_id'], false);
     // map a [datetime+employee_id] to the corresponding booked slots info
     foreach ($bookedSlots as $slot) {
         $booked["{$slot['appointment_start']}{$slot['emp_id']}"] = $slot;
     }
     $ownedSlots = array();
     $foundOpen = array();
     $slots = array();
开发者ID:hughnguy,项目名称:php,代码行数:31,代码来源:book-appointment.php


注:本文中的Appointment::removeEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。