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