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


PHP Appointment::setCaptainId方法代码示例

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


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

示例1: retrieveAppointments

 public function retrieveAppointments($user_type, $email, $appointment_cat)
 {
     include_once "DatabaseBook.class.php";
     $db = DatabaseBook::getInstance();
     $mysqli = $db->getConnection();
     if ($user_type == "Captain") {
         $query = "select * from ea_appointments as ap inner join ea_users as usr on ap.id_users_providers = usr.id where usr.email = '{$email}'";
     } elseif ($user_type == "Customer") {
         $query = "select * from ea_appointments as ap inner join ea_users as usr on ap.id_users_customer = usr.id where usr.email = '{$email}'";
     }
     if ($appointment_cat == "past") {
         $query .= " AND ap.end_datetime < curdate()";
     } elseif ($appointment_cat == "upcoming") {
         $query .= " AND ap.start_datetime > curdate()";
     }
     $result = $mysqli->query($query);
     $counter = 0;
     $list = array();
     while ($news_row = $result->fetch_array()) {
         $appointment = new Appointment();
         //$appointment = $appointment->createObject($appointment,$news_row);
         $appointment->setAppointmentId($news_row[0]);
         $appointment->setAppointmentDate($news_row['start_datetime']);
         //  $appointment -> setAppointmentDeposit($news_row['appointment_deposit']);
         //  $appointment -> setHullId($news_row['hull_id']);
         $appointment->setUserId($news_row['id_users_customer']);
         $appointment->setCaptainId($news_row['id_users_provider']);
         // $appointment -> setAppointmentStatus($news_row['appointment_status']);
         $list[$counter] = $appointment;
         $counter++;
     }
     return $list;
 }
开发者ID:poliang13,项目名称:Captains-Hubs,代码行数:33,代码来源:Appointment.class.php


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