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


PHP Room::setRoomId方法代码示例

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


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

示例1: generateEventColumnData

 protected function generateEventColumnData($columnIndex)
 {
     $columnIndex = (int) $columnIndex;
     $columnData = array();
     $scheduleEventIterator = new ScheduleEventIterator();
     $appointmentIterator = new AppointmentIterator();
     if (!isset($this->getCurrentDisplayFilter()->columns[$columnIndex])) {
         throw new Exception(__("Cannot generate column with that index, there is no filter defined for that column Index: ") . $columnIndex);
     }
     $this->_session->currentAppointments[$columnIndex] = array();
     $filter = $this->getCurrentDisplayFilter();
     $filterTimeStart = strtotime($filter->start);
     $filterTimeEnd = strtotime($filter->end);
     $paramFilters = $filter->columns[$columnIndex];
     if (isset($paramFilters['dateFilter'])) {
         $filter->date = date('Y-m-d', strtotime($paramFilters['dateFilter']));
     }
     $paramFilters['start'] = $filter->date . ' ' . $filter->start;
     $paramFilters['end'] = $filter->date . ' ' . $filter->end;
     $paramFilters['start'] = $filter->date . ' ' . $filter->start;
     $paramFilters['end'] = $filter->date . ' 23:59:59';
     $scheduleEventIterator->setFilter($paramFilters);
     // we need to get the length of time to create number of rows in the grid
     $timeLen = ($filterTimeEnd - $filterTimeStart) / 60 / $filter->increment;
     for ($i = 0; $i <= $timeLen; $i++) {
         $row = array();
         // assign row id as rowNumber and columnIndex
         $row['id'] = $i . $columnIndex;
         $row['data'][0] = '';
         $columnData[$i] = $row;
     }
     $filterToTimeStart = strtotime($paramFilters['start']);
     $appointmentIterator->setFilter($paramFilters);
     // hold the temporary data counter
     $tmpDataCtr = array();
     $colMultiplier = 1;
     $patient = new Patient();
     $room = new Room();
     $zIndex = 0;
     foreach ($appointmentIterator as $row) {
         $startToTime = strtotime($row->start);
         $endToTime = strtotime($row->end);
         $tmpStart = date('H:i', $startToTime);
         $tmpEnd = date('H:i', $endToTime);
         $timeLen = ($endToTime - $startToTime) / 60 / $filter->increment;
         $tmpIndex = ($startToTime - $filterToTimeStart) / 60 / $filter->increment;
         if (!isset($columnData[$tmpIndex])) {
             break;
         }
         $index = $tmpIndex;
         for ($j = 1; $j <= $timeLen; $j++) {
             if (!isset($columnData[$index])) {
                 break;
             }
             $index++;
         }
         $j--;
         $height = 20 * $j * 1.1;
         $marginLeft = 8;
         $multiplier = 1;
         // generate ranges code inside if ($multiplier === 1) block
         $incTime = $startToTime;
         $ranges = array();
         for ($ctr = 1; $ctr <= $timeLen; $ctr++) {
             $ranges[] = date('H:i', $incTime);
             $incTime = strtotime("+{$filter->increment} minutes", $incTime);
         }
         // check for appointment intersection
         foreach ($tmpDataCtr as $keyCtr => $dataCtr) {
             if (in_array($tmpStart, $dataCtr['ranges'])) {
                 // merge the ranges if we need to have a nested multiple bookings
                 // uncomment if this is not the case and move the generate ranges to its proper location for code optimization
                 $tmpDataCtr[$keyCtr]['ranges'] = array_merge($dataCtr['ranges'], $ranges);
                 $tmpDataCtr[$keyCtr]['multiplier']++;
                 $multiplier = $tmpDataCtr[$keyCtr]['multiplier'];
                 break;
             }
         }
         if ($multiplier === 1) {
             $tmpDataCtr[] = array('ranges' => $ranges, 'multiplier' => $multiplier);
         } else {
             $marginLeft = ($multiplier - 1) * 250;
         }
         if ($multiplier > $colMultiplier) {
             $colMultiplier = $multiplier;
         }
         $patient->setPersonId($row->patientId);
         $patient->populate();
         $person = $patient->person;
         $room->setRoomId($row->roomId);
         $room->populate();
         $this->_session->currentAppointments[$columnIndex][$row->appointmentId] = $row;
         $mark = '';
         if (strlen($row->appointmentCode) > 0) {
             $mark = "({$row->appointmentCode})";
         }
         $zIndex++;
         // where to use room?
         $columnData[$tmpIndex]['id'] = $row->appointmentId . 'i' . $columnData[$tmpIndex]['id'];
         $appointmentId = $row->appointmentId;
//.........这里部分代码省略.........
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:101,代码来源:CalendarController.php

示例2: listHistoryAction

 public function listHistoryAction()
 {
     $personId = (int) $this->_getParam('personId');
     $future = (int) $this->_getParam('future');
     $rows = array();
     $appointmentTemplate = new AppointmentTemplate();
     $reasons = $appointmentTemplate->getAppointmentReasons();
     $iterator = new AppointmentIterator(null, false);
     $filters = array('patientId' => $personId);
     if ($future) {
         $filters['start'] = date('Y-m-d');
     }
     $iterator->setFilters($filters);
     foreach ($iterator as $app) {
         $personId = (int) $app->patientId;
         $appointmentId = (int) $app->appointmentId;
         $providerId = (int) $app->providerId;
         $roomId = (int) $app->roomId;
         list($dateStart, $timeStart) = explode(' ', $app->start);
         list($dateEnd, $timeEnd) = explode(' ', $app->end);
         $providerName = '';
         if ($providerId > 0) {
             $provider = new Provider();
             $provider->setPersonId($providerId);
             $provider->populate();
             $providerName = $provider->displayName;
         }
         $roomName = '';
         if ($roomId > 0) {
             $room = new Room();
             $room->setRoomId($roomId);
             $room->populate();
             $roomName = $room->displayName;
         }
         $routing = new Routing();
         $routing->personId = $personId;
         $routing->appointmentId = $appointmentId;
         $routing->providerId = $providerId;
         $routing->roomId = $roomId;
         $routing->populateByAppointments();
         $station = $routing->stationId;
         $reason = $app->reason;
         $appointmentReason = isset($reasons[$reason]) ? $reasons[$reason]['name'] : '';
         $row = array();
         $row['id'] = $appointmentId;
         $row['data'] = array();
         $row['data'][] = $dateStart;
         $row['data'][] = $timeStart . ' - ' . $timeEnd;
         $row['data'][] = $providerName;
         $row['data'][] = $app->title;
         $row['data'][] = $roomName;
         $row['data'][] = $appointmentReason;
         $row['data'][] = $app->appointmentCode;
         $row['data'][] = $routing->stationId;
         $rows[] = $row;
     }
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $json->direct(array('rows' => $rows));
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:60,代码来源:AppointmentController.php

示例3: array

 $description = $database->escapeString($_POST['description']);
 $hotelId = $database->escapeString($_POST['hotelId']);
 $room->setRoomName($name);
 $room->setPrice($price);
 $room->setPersons($persons);
 $room->setIsAvailable($isAvailable);
 if ($isAvailable == 1) {
     $room->setAvailableUntil($availableUntil);
 } else {
     $room->setAvailableUntil("NOT AVAILABLE");
 }
 $room->setDescription($description);
 $room->setHotelId($hotelId);
 if (isset($_POST['roomId'])) {
     $roomId = $database->escapeString($_POST['hotelId']);
     $room->setRoomId($roomId);
     $hotel->update($database);
 } else {
     $roomId = $room->create($database);
 }
 if (count($_FILES) != 0) {
     $error = 0;
     $files = array();
     $uploaddir = "../images/rooms/large/";
     $uploaddirthumb = "../images/rooms/thumb/";
     $nameArray = $_FILES['mediaUploads']['name'];
     $typeArray = $_FILES['mediaUploads']['type'];
     $tmpNameArray = $_FILES['mediaUploads']['tmp_name'];
     $errorArray = $_FILES['mediaUploads']['error'];
     $sizeArray = $_FILES['mediaUploads']['size'];
     for ($count = 0; $count < count($_FILES['mediaUploads']['name']); $count++) {
开发者ID:jetmirhaxhisefa,项目名称:rezervime,代码行数:31,代码来源:createAndEditRoom.php


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