本文整理汇总了PHP中Appointment::readAppointment方法的典型用法代码示例。如果您正苦于以下问题:PHP Appointment::readAppointment方法的具体用法?PHP Appointment::readAppointment怎么用?PHP Appointment::readAppointment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Appointment
的用法示例。
在下文中一共展示了Appointment::readAppointment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_Activities
/**
* Function to get activities
* @param array $current_user - user data
* @param string $free_busy -
*/
function add_Activities($current_user, $free_busy = '')
{
if (isset($current_user->start_hour) && $current_user->start_hour != '') {
list($sthour, $stmin) = explode(":", $current_user->start_hour);
$hr = $sthour + 0;
$this->day_start_hour = $hr;
} else {
$this->day_start_hour = 8;
}
if (isset($current_user->end_hour) && $current_user->end_hour != '') {
list($endhour, $endmin) = explode(":", $current_user->end_hour);
$endhour = $endhour + 0;
$this->day_end_hour = $endhour;
} else {
$this->day_end_hour = 23;
}
if ($this->view == 'week') {
$start_datetime = $this->date_time->getThisweekDaysbyIndex(1);
$end_datetime = $this->date_time->getThisweekDaysbyIndex(7);
} elseif ($this->view == 'month') {
$start_datetime = $this->date_time->getThismonthDaysbyIndex(0);
$end_datetime = $this->date_time->getThismonthDaysbyIndex($this->date_time->daysinmonth - 1);
} elseif ($this->view == 'year') {
$start_datetime = $this->date_time->getThisyearMonthsbyIndex(0);
$end_datetime = $this->date_time->get_first_day_of_changed_year('increment');
} else {
$start_datetime = $this->date_time;
$end_datetime = $this->date_time->getTodayDatetimebyIndex(23);
}
$activities = array();
$activities = Appointment::readAppointment($current_user->id, $start_datetime, $end_datetime, $this->view);
if (!empty($activities)) {
foreach ($activities as $key => $value) {
if ($this->view == 'day') {
if (empty($this->day_slice[$value->formatted_datetime]->activities)) {
$this->day_slice[$value->formatted_datetime]->activities = array();
}
array_push($this->day_slice[$value->formatted_datetime]->activities, $value);
} elseif ($this->view == 'week') {
if (empty($this->week_slice[$value->formatted_datetime]->activities)) {
$this->week_slice[$value->formatted_datetime]->activities = array();
}
array_push($this->week_slice[$value->formatted_datetime]->activities, $value);
} elseif ($this->view == 'month') {
if (empty($this->month_array[$value->formatted_datetime]->activities)) {
$this->month_array[$value->formatted_datetime]->activities = array();
}
array_push($this->month_array[$value->formatted_datetime]->activities, $value);
} elseif ($this->view == 'year') {
if (empty($this->year_array[$value->formatted_datetime]->activities)) {
$this->year_array[$value->formatted_datetime]->activities = array();
}
array_push($this->year_array[$value->formatted_datetime]->activities, $value);
} else {
die("view:" . $this->view . " is not defined");
}
}
}
}