當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Appointment::readAppointment方法代碼示例

本文整理匯總了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");
             }
         }
     }
 }
開發者ID:Bergdahls,項目名稱:YetiForceCRM,代碼行數:64,代碼來源:Calendar.php


注:本文中的Appointment::readAppointment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。