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


PHP Room::populate方法代码示例

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


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

示例1: newAction

 public function newAction()
 {
     $colIndex = $this->_getParam('colIndex');
     $sessionFilters = $this->_calendarSession->filter;
     if (!isset($sessionFilters->columns[$colIndex])) {
         $msg = __('Cannot generate column with that index, there is no filter defined for that column Index: ') . $colIndex;
         throw new Exception($msg);
     }
     $column = $sessionFilters->columns[$colIndex];
     $providerId = (int) $column['providerId'];
     $this->view->providerId = $providerId;
     $headerText = '';
     if ($providerId > 0) {
         $provider = new Provider();
         $provider->setPersonId($providerId);
         $provider->populate();
         $headerText = $provider->displayName;
     }
     $roomId = 0;
     if (isset($column['roomId'])) {
         $roomId = $column['roomId'];
     }
     $this->view->roomId = $roomId;
     if ($roomId > 0) {
         $room = new Room();
         $room->id = $roomId;
         $room->populate();
         $headerText .= ' -> ' . $room->name;
     }
     if (isset($column['dateFilter'])) {
         $headerText .= " ({$column['dateFilter']})";
     }
     $this->view->headerText = $headerText;
     $templates = array('' => '');
     $templates['tpl1'] = 'Provider 1 Template';
     $templates['tpl2'] = 'Provider 2 Template';
     $templates['tpl3'] = 'Provider 3 Template';
     $this->view->templates = $templates;
     // $this->_calendarSession->filter; calendar filter
     $this->render('new');
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:41,代码来源:ScheduleController.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: getBuildingDefaultLocation

 public static function getBuildingDefaultLocation($personId, $defaultLocationId = null)
 {
     // get default building given user's person id, if $defaultLocationId is defined then room is returned
     $user = new User();
     $user->personId = $personId;
     $user->populateWithPersonId();
     $user->populate();
     $building = null;
     $room = null;
     if (strlen($user->preferences) > 0) {
         $xmlPreferences = new SimpleXMLElement($user->preferences);
         $room = new Room();
         $room->roomId = (int) $xmlPreferences->currentLocation;
         if ($room->populate()) {
             $building = $room->building;
         }
     }
     if ($defaultLocationId === null) {
         if ($building === null) {
             $building = new Building();
             $building->buildingId = (int) $user->defaultBuildingId;
             $building->populate();
         }
         return $building;
     } else {
         if ($room === null) {
             $room = new Room();
             $room->roomId = (int) $defaultLocationId;
             $room->populate();
         }
         return $room;
     }
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:33,代码来源:Building.php

示例4: radioRelay_plugin_setting_page

function radioRelay_plugin_setting_page()
{
    global $_, $myUser, $conf;
    if (isset($_['section']) && $_['section'] == 'radioRelay') {
        if ($myUser != false) {
            $radioRelayManager = new RadioRelay();
            $radioRelays = $radioRelayManager->populate();
            $roomManager = new Room();
            $rooms = $roomManager->populate();
            //Si on est en mode modification
            if (isset($_['id'])) {
                $id_mod = $_['id'];
                $selected = $radioRelayManager->getById($id_mod);
                $description = $selected->GetName();
                $button = "Modifier";
            } else {
                $description = "Ajout d'un relais";
                $button = "Ajouter";
            }
            ?>

			<div class="span9 userBloc">


				<h1>Relais</h1>
				<p>Gestion des relais radio</p>  
				<form action="action.php?action=radioRelay_add_radioRelay" method="POST">
					<fieldset>
						<legend><?php 
            echo $description;
            ?>
</legend>

						<div class="left">
							<label for="nameRadioRelay">Nom</label>
							<?php 
            if (isset($selected)) {
                echo '<input type="hidden" name="id" value="' . $id_mod . '">';
            }
            ?>
							<input type="text" id="nameRadioRelay" value="<?php 
            if (isset($selected)) {
                echo $selected->getName();
            }
            ?>
" onkeyup="$('#vocalCommand').html($(this).val());" name="nameRadioRelay" placeholder="Lumiere Canapé…"/>
							<small>Commande vocale associée : "<?php 
            echo $conf->get('VOCAL_ENTITY_NAME');
            ?>
, allume <span id="vocalCommand"></span>"</small>
							<label for="descriptionRadioRelay">Description</label>
							<input type="text" value="<?php 
            if (isset($selected)) {
                echo $selected->getDescription();
            }
            ?>
" name="descriptionRadioRelay" id="descriptionRadioRelay" placeholder="Relais sous le canapé…" />
							<label for="radioCodeRadioRelay">Code radio</label>
							<input type="text" value="<?php 
            if (isset($selected)) {
                echo $selected->getRadioCode();
            }
            ?>
" name="radioCodeRadioRelay" id="radioCodeRadioRelay" placeholder="0,1,2…" />
							<label for="roomRadioRelay">Pièce</label>
							<select name="roomRadioRelay" id="roomRadioRelay">
								<?php 
            foreach ($rooms as $room) {
                if (isset($selected)) {
                    $selected_room = $selected->getRoom();
                } else {
                    if (isset($_['room'])) {
                        $selected_room = $_['room'];
                    } else {
                        $selected_room = null;
                    }
                }
                ?>

									<option <?php 
                if ($selected_room == $room->getId()) {
                    echo "selected";
                }
                ?>
 value="<?php 
                echo $room->getId();
                ?>
"><?php 
                echo $room->getName();
                ?>
</option>
									<?php 
            }
            ?>
								</select>
							<label for="pulseRadioRelay">Mode impulsion (laisser à zéro pour désactiver le mode impulsion ou definir un temps d'impulsion en milli-seconde)</label>
							<input type="text" name="pulseRadioRelay" value="<?php 
            if (isset($selected)) {
                echo $selected->getPulse();
            } else {
//.........这里部分代码省略.........
开发者ID:thib3113,项目名称:yana-server,代码行数:101,代码来源:relay.plugin.disabled.php

示例5: myPreferencesLocation

 public static function myPreferencesLocation()
 {
     static $room = null;
     if ($room !== null) {
         return $room;
     }
     $auth = Zend_Auth::getInstance();
     $room = new Room();
     if ((int) $auth->getIdentity()->personId > 0) {
         $user = new User();
         $user->userId = (int) $auth->getIdentity()->personId;
         $user->populate();
         $xmlPreferences = new SimpleXMLElement($user->preferences);
         $roomId = (string) $xmlPreferences->currentLocation;
         $room->roomId = (int) $roomId;
         $room->populate();
     }
     return $room;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:19,代码来源:User.php

示例6: Configuration

$r1->setRead('1');
$r1->setDelete('1');
$r1->setCreate('1');
$r1->setUpdate('1');
$r1->setRank('1');
$r1->save();
$conf = new Configuration();
$conf->put('plugin_kodiCmd_api_url_kodi', 'http://192.168.1.107:85/jsonrpc');
$conf->put('plugin_kodiCmd_api_timeout_kodi', 5);
$conf->put('plugin_kodiCmd_api_recognition_status', '');
$ro = new Room();
$ro->setName('KODI');
$ro->setDescription('De la bonne zic, un bon p\'tit film....');
$ro->save();
$roomManager = new Room();
$rooms = $roomManager->populate();
foreach ($rooms as $room) {
    if ($room->getName() == "KODI") {
        $kodiRoomId = $room->getId();
    }
}
$id = 0;
$kodi = new KodiCmd();
$kodi->setName('à droite');
$kodi->setDescription('se déplacer à droite');
$kodi->setJson('"method":"Input.Right","id":"1"');
$kodi->setConfidence('0.8');
$kodi->setRoom($kodiRoomId);
$kodi->save();
$kodi = new KodiCmd();
$kodi->setName('à gauche');
开发者ID:eflye,项目名称:yana-plugins,代码行数:31,代码来源:install.php

示例7: _generateEventColumnData

 protected function _generateEventColumnData(array $filters)
 {
     // filters assume to be sanitized
     $appointment = new Appointment();
     $appointment->providerId = $filters['providerId'];
     $appointment->roomId = $filters['roomId'];
     $appointment->start = $filters['dateFilter'] . ' ' . self::FILTER_TIME_START;
     $appointment->end = $filters['dateFilter'] . ' ' . self::FILTER_TIME_END;
     $startTime = strtotime($appointment->start);
     $endTime = strtotime($appointment->end);
     // we need to get the length of time to create number of rows in the grid
     $timeLen = ($endTime - $startTime) / 60 / self::FILTER_MINUTES_INTERVAL;
     // NOTE: height is 22px for xp, default 20px
     // prepopulate return data
     $columnData = array();
     //$maps = array();
     $start = $startTime;
     $end = $endTime;
     $ctr = 0;
     while ($start <= $end) {
         $map = array();
         $map['start'] = $start;
         $start = strtotime('+' . self::FILTER_MINUTES_INTERVAL . ' minutes', $start);
         $map['end'] = $start;
         //$maps[$ctr] = $map;
         $row = array();
         // assign row id as rowNumber and columnIndex
         $columnData[$ctr] = array('id' => $ctr + 1, 'data' => array(''), 'map' => $map);
         $ctr++;
     }
     $columnDataCtr = count($columnData);
     $data = array('apps' => array(), 'events' => array());
     $mapIndex = 0;
     $apps = array();
     foreach ($appointment->getIter() as $app) {
         $start = strtotime($app->start);
         for ($i = $mapIndex; $i < $columnDataCtr; $i++) {
             $map = $columnData[$mapIndex]['map'];
             $mapIndex = $i;
             if ($start >= $map['start'] && $start <= $map['end']) {
                 if (!isset($data['apps'][$i])) {
                     $data['apps'][$i] = array();
                 }
                 $data['apps'][$i][] = $app;
                 break;
             }
         }
     }
     $mapIndex = 0;
     $events = array();
     trigger_error('looping schedule event started');
     $scheduleEvent = new ScheduleEvent();
     $db = Zend_Registry::get('dbAdapter');
     $sqlSelect = $db->select()->from('scheduleEvents')->where('providerId = ?', $appointment->providerId)->where('roomId = ?', $appointment->roomId)->where('start >= ?', $appointment->start)->where('end <= ?', $appointment->end)->where('start <= end')->order('start ASC');
     $stmt = $db->query($sqlSelect);
     $stmt->setFetchMode(Zend_Db::FETCH_ASSOC);
     while ($row = $stmt->fetch()) {
         $event = new ScheduleEvent();
         $event->populateWithArray($row);
         $start = strtotime($event->start);
         for ($i = $mapIndex; $i < $columnDataCtr; $i++) {
             $map = $columnData[$i]['map'];
             $mapIndex = $i;
             if ($start >= $map['start'] && $start <= $map['end']) {
                 if (!isset($data['events'][$i])) {
                     $data['events'][$i] = array();
                 }
                 $data['events'][$i] = $event;
                 break;
             }
         }
     }
     trigger_error('looping schedule event ended');
     $colMultiplier = 1;
     $zIndex = 0;
     foreach ($data['apps'] as $index => $apps) {
         $ctr = count($apps);
         $columnData[$index]['userdata']['ctr'] = $ctr;
         if ($ctr > $colMultiplier) {
             $colMultiplier = $ctr;
         }
         for ($i = 0; $i < $ctr; $i++) {
             $app = $apps[$i];
             $this->_populateAppointmentRow($app, $columnData, $index, $i, $ctr);
         }
     }
     $header = "{$filters['dateFilter']}<br>";
     $title = $filters['dateFilter'];
     // temporarily set the header as providerId
     $providerId = (int) $filters['providerId'];
     $roomId = (int) $filters['roomId'];
     if ($providerId > 0) {
         $provider = new Provider();
         $provider->setPersonId($providerId);
         $provider->populate();
         $name = $provider->optionName;
         // we simply replace the comma with its html equivalent (&#44;) because this may cause not to render the header
         $header .= str_replace(',', '&#44;', $name);
         $title .= ' -> ' . $name;
     }
//.........这里部分代码省略.........
开发者ID:dragonlet,项目名称:clearhealth,代码行数:101,代码来源:CalendarController.php

示例8: getFacility

 public function getFacility()
 {
     $ret = '';
     $roomId = (int) $this->roomId;
     if ($roomId > 0) {
         $room = new Room();
         $room->roomId = $roomId;
         $room->populate();
         $ret = $room->building->name . '->' . $room->name;
     }
     return $ret;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:12,代码来源:Visit.php

示例9: 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

示例10: kodi_plugin_setting_page

function kodi_plugin_setting_page()
{
    global $_, $myUser;
    if (isset($_['section']) && $_['section'] == 'kodiCmd') {
        if ($myUser != false) {
            $kodiManager = new KodiCmd();
            $kodiCmds = $kodiManager->populate();
            $roomManager = new Room();
            $rooms = $roomManager->populate();
            ?>

		<div class="span9 userBloc">


		<h1>KODI</h1>
		<p>Gestion media-center</p>  
		<ul class="nav nav-tabs">
			<li <?php 
            echo !isset($_['block']) || $_['block'] == 'cmd' ? 'class="active"' : '';
            ?>
 > <a href="setting.php?section=kodiCmd&amp;block=cmd"><i class="fa fa-angle-right"></i> Commandes Vocales</a></li>
			<li <?php 
            echo isset($_['block']) && $_['block'] == 'new' ? 'class="active"' : '';
            ?>
 > <a href="setting.php?section=kodiCmd&amp;block=new"><i class="fa fa-angle-right"></i> Ajouter une Commande</a></li>
		</ul>

		<?php 
            if (isset($_['section']) && $_['section'] == 'kodiCmd' && @$_['block'] == 'new') {
                ?>
		<form action="action.php?action=kodiCmd_add_kodiCmd" method="POST">
		<fieldset>
		    <div class="left">
			    <label for="name">Nom</label>
			    <input type="text" id="name" onkeyup="$('#vocalCommand').html($(this).val());" name="name" placeholder="musique suivante"/> <small>Commande vocale associée : "<span id="vocalCommand"></span>"</small></label>
			    
			    <label for="description">Description</label>
			    <input type="text" name="description" id="description" placeholder="Lire la prochaine musique" />
			    <label for="kodiJsonCode">Code json de la commande</label>
			    <input type="text" name="kodiJsonCode" id="kodiJsonCode" placeholder='"method":"Input.Right","id":"1"' /> <a href="http://wiki.kodi.org/index.php?title=JSON-RPC_API/v6" target="_blank" >JSON-RPC_API-V6-WIKI </a>
                            <label for="room">Pièce</label>
                            <select name="room" id="room">
			    	<?php 
                foreach ($rooms as $room) {
                    ?>
			    	<option value="<?php 
                    echo $room->getId();
                    ?>
" <?php 
                    echo $room->getName() == "KODI" ? "selected" : "";
                    ?>
><?php 
                    echo $room->getName();
                    ?>
</option>
			    	<?php 
                }
                ?>
			    </select>   
                            <label for="confidence">Confidence</label>
                            <select name="confidence" id="confidence">
                                <?php 
                for ($confidence = 1; $confidence <= 9; $confidence++) {
                    ?>
                                
                                    <option value=0.<?php 
                    echo $confidence;
                    ?>
 <?php 
                    echo $confidence == 8 ? "selected" : "";
                    ?>
>0.<?php 
                    echo $confidence;
                    ?>
</option>
                                <?php 
                }
                ?>
                            </select>                          
			</div>

  			<div class="clear"></div>
		    <br/><button type="submit" class="btn">Ajouter</button>
	  	</fieldset>
		<br/>
	</form>
	
		<?php 
            }
            if (isset($_['section']) && $_['section'] == 'kodiCmd' && @$_['block'] == 'edit') {
                $kodiCmd = new KodiCmd();
                $kodiCmd = $kodiCmd->getById($_['id']);
                ?>
		<form action="action.php?action=kodiCmd_edit_kodiCmd" method="POST">
		<fieldset>
		    <div class="left">
			    <label for="name">Nom</label>
				<input type="hidden" name="id" value="<?php 
                echo $kodiCmd->getId();
                ?>
//.........这里部分代码省略.........
开发者ID:eflye,项目名称:yana-plugins,代码行数:101,代码来源:kodi.plugin.php

示例11: paymentReceiptAction

 public function paymentReceiptAction()
 {
     // d96de46c-be90-45b0-b5f9-0b4abee76483
     $referenceId = $this->_getParam('referenceId');
     $personId = (int) $this->_getParam('personId');
     $visitId = (int) $this->_getParam('visitId');
     $data = $this->_getAttachmentData($referenceId);
     $patient = new Patient();
     $patient->personId = $personId;
     if ($personId > 0) {
         $patient->populate();
     }
     $person = $patient->person;
     $visit = new Visit();
     $visit->visitId = $visitId;
     if ($visitId > 0) {
         $visit->populate();
     }
     $practiceId = (int) $visit->practiceId;
     if (!$practiceId > 0) {
         $buildingId = (int) $visit->buildingId;
         if ($buildingId > 0) {
             $building = new Building();
             $building->buildingId = $buildingId;
             $building->populate();
             $practiceId = (int) $building->practiceId;
         } else {
             $roomId = (int) $visit->roomId;
             if ($roomId > 0) {
                 $room = new Room();
                 $room->roomId = $roomId;
                 $room->populate();
                 $practiceId = (int) $room->building->practiceId;
             }
         }
     }
     $practice = new Practice();
     $practice->practiceId = $practiceId;
     if ($practiceId > 0) {
         $practice->populate();
     }
     $primaryAddress = $practice->primaryAddress;
     $xml = new SimpleXMLElement('<data/>');
     $xmlPractice = $xml->addChild('practice');
     $this->_addChild($xmlPractice, 'name', $practice->name);
     $this->_addChild($xmlPractice, 'primaryLine1', $primaryAddress->line1);
     $primaryCityStateZip = $primaryAddress->city . ' ' . $primaryAddress->state . ' ' . $primaryAddress->postalCode;
     $this->_addChild($xmlPractice, 'primaryCityStateZip', $primaryCityStateZip);
     $this->_addChild($xmlPractice, 'mainPhone', $practice->mainPhone->number);
     $xmlPatient = $xml->addChild('patient');
     $name = $person->firstName . ' ' . $person->middleName . ' ' . $person->lastName;
     $this->_addChild($xmlPatient, 'name', $name);
     $addresses = Address::listAddresses($personId);
     if (isset($addresses[Address::TYPE_BILLING])) {
         $address = $addresses[Address::TYPE_BILLING];
     } else {
         if (isset($addresses[Address::TYPE_HOME])) {
             $address = $addresses[Address::TYPE_HOME];
         } else {
             if (isset($addresses[Address::TYPE_MAIN])) {
                 $address = $addresses[Address::TYPE_MAIN];
             } else {
                 if (isset($addresses[Address::TYPE_SEC])) {
                     $address = $addresses[Address::TYPE_SEC];
                 } else {
                     if (isset($addresses[Address::TYPE_OTHER])) {
                         $address = $addresses[Address::TYPE_OTHER];
                     } else {
                         $address = array_pop($addresses);
                     }
                 }
             }
         }
     }
     $billingCityStateZip = $address->city . ' ' . $address->state . ' ' . $address->postalCode;
     $this->_addChild($xmlPatient, 'billingLine1', $address->line1);
     $this->_addChild($xmlPatient, 'billingCityStateZip', $billingCityStateZip);
     $iterator = new PatientProcedureIterator();
     $iterator->setFilters(array('visitId' => $visitId));
     $procedures = array();
     foreach ($iterator as $row) {
         $procedures[] = $row->code;
     }
     $iterator = new PatientDiagnosisIterator();
     $iterator->setFilters(array('visitId' => $visitId));
     $diagnoses = array();
     foreach ($iterator as $row) {
         $diagnoses[] = $row->code;
     }
     $xmlNotes = $xmlPatient->addChild('notes');
     $note = implode(',', $procedures) . " \t " . implode(',', $diagnoses) . " \t " . date('m/d/y', strtotime($visit->dateOfTreatment));
     $this->_addChild($xmlNotes, 'note', $note);
     $today = date('Y-m-d');
     $todaysTotal = 0;
     $iterator = new PaymentIterator();
     $iterator->setFilters(array('visitId' => $visitId, 'company' => 'System', 'paymentDate' => $today));
     $payments = array();
     foreach ($iterator as $row) {
         $payments[] = $row;
     }
//.........这里部分代码省略.........
开发者ID:dragonlet,项目名称:clearhealth,代码行数:101,代码来源:ReportsController.php

示例12: door_plugin_setting_page

function door_plugin_setting_page()
{
    global $_, $myUser;
    if (isset($_['section']) && $_['section'] == 'door') {
        if ($myUser != false) {
            $doorManager = new Door();
            $doors = $doorManager->populate();
            $roomManager = new Room();
            $rooms = $roomManager->populate();
            ?>

		<div class="span9 userBloc">


		<h1>Porte</h1>
		<p>Gestion des portes</p>  

		<form action="action.php?action=door_add_door" method="POST">
		<fieldset>
		    <legend>Ajout d'un porte</legend>

		    <div class="left">
			    <label for="nameDoor">Nom</label>
			    <input type="text" id="nameDoor" onkeyup="$('#vocalCommand').html($(this).val());" name="nameDoor" placeholder="Lumiere Canapé…"/>
			    <small>Commande vocale associée : "YANA, ouvre <span id="vocalCommand"></span>"</small>
			    <label for="descriptionDoor">Description</label>
			    <input type="text" name="descriptionDoor" id="descriptionDoor" placeholder="Porte de l'entrée…" />
			    <label for="pinDoorRelay">Pin GPIO verouillage (relais)</label>
			    <input type="text" name="pinDoorRelay" id="pinDoorRelayRelay" placeholder="0,1,2…" />
			    <label for="pinDoorRelay">Pin GPIO etat (capteur hall)</label>
			    <input type="text" name="pinDoorCaptor" id="pinDoorCaptor" placeholder="0,1,2…" />
			    <label for="roomDoor">Pièce</label>
			    <select name="roomDoor" id="roomDoor">
			    	<?php 
            foreach ($rooms as $room) {
                ?>
			    	<option value="<?php 
                echo $room->getId();
                ?>
"><?php 
                echo $room->getName();
                ?>
</option>
			    	<?php 
            }
            ?>
			    </select>
			</div>

  			<div class="clear"></div>
		    <br/><button type="submit" class="btn">Ajouter</button>
	  	</fieldset>
		<br/>
	</form>

		<table class="table table-striped table-bordered table-hover">
	    <thead>
	    <tr>
	    	<th>Nom</th>
		    <th>Description</th>
		    <th>Pin GPIO verouillage</th>
		    <th>Pin GPIO etat</th>
		    <th>Pièce</th>
	    </tr>
	    </thead>
	    
	    <?php 
            foreach ($doors as $door) {
                $room = $roomManager->load(array('id' => $door->getRoom()));
                ?>
	    <tr>
	    	<td><?php 
                echo $door->getName();
                ?>
</td>
		    <td><?php 
                echo $door->getDescription();
                ?>
</td>
		    <td><?php 
                echo $door->getPinRelay();
                ?>
</td>
		    <td><?php 
                echo $door->getPinCaptor();
                ?>
</td>
		    <td><?php 
                echo $room->getName();
                ?>
</td>
		    <td><a class="btn" href="action.php?action=door_delete_door&id=<?php 
                echo $door->getId();
                ?>
"><i class="icon-remove"></i></a></td>
	    </tr>
	    <?php 
            }
            ?>
	    </table>
//.........这里部分代码省略.........
开发者ID:kofeve,项目名称:yana-server,代码行数:101,代码来源:door.plugin.disabled.php

示例13: _generate4010A1

 protected static function _generate4010A1($claimId, array $claim)
 {
     static $ctr = 0;
     static $visits = array();
     static $practices = array();
     static $insurancePrograms = array();
     static $providers = array();
     static $patients = array();
     $claimId = (int) $claimId;
     $claimLine = new ClaimLine();
     $claimLine->populateByClaimId($claimId);
     $visitId = (int) $claimLine->visitId;
     if (!isset($visits[$visitId])) {
         $visit = new Visit();
         $visit->visitId = $visitId;
         $visit->populate();
         $visits[$visitId] = $visit;
     }
     $visit = $visits[$visitId];
     $patientId = (int) $visit->patientId;
     if (!isset($patients[$patientId])) {
         $patient = new Patient();
         $patient->personId = $patientId;
         $patient->populate();
         $patients[$patientId] = $patient;
     }
     $patient = $patients[$patientId];
     $practiceId = (int) $visit->practiceId;
     if (!isset($practices[$practiceId])) {
         $practice = new Practice();
         $practice->practiceId = $practiceId;
         $practice->populate();
         $practices[$practiceId] = $practice;
     }
     $practice = $practices[$practiceId];
     $insuranceProgramId = (int) $visit->activePayerId;
     if (!isset($insurancePrograms[$insuranceProgramId])) {
         $insurance = new InsuranceProgram();
         $insurance->insuranceProgramId = $insuranceProgramId;
         $insurance->populate();
         $insurancePrograms[$insuranceProgramId] = $insurance;
     }
     $insuranceProgram = $insurancePrograms[$insuranceProgramId];
     $providerId = (int) $visit->treatingPersonId;
     if (!isset($providers[$providerId])) {
         $provider = new Provider();
         $provider->personId = $providerId;
         $provider->populate();
         $providers[$providerId] = $provider;
     }
     $provider = $providers[$providerId];
     $billAs = (int) $provider->billAs;
     if ($billAs > 0) {
         $providerId = $billAs;
         if (!isset($providers[$providerId])) {
             $provider = new Provider();
             $provider->personId = $providerId;
             $provider->populate();
             $providers[$providerId] = $provider;
         }
         $provider = $providers[$providerId];
     }
     $subscribers = array();
     $enumeration = new Enumeration();
     $enumeration->populateByUniqueName(InsuranceProgram::INSURANCE_ENUM_NAME);
     $enumerationClosure = new EnumerationClosure();
     foreach ($enumerationClosure->getAllDescendants($enumeration->enumerationId, 1, true) as $enum) {
         $rowset = $enumerationClosure->getAllDescendants($enum->enumerationId, 1, true);
         if ($enum->key == InsuranceProgram::INSURANCE_SUBSCRIBER_ENUM_KEY) {
             foreach ($rowset as $row) {
                 $subscribers[$row->key] = $row->name;
             }
             break;
         }
     }
     $insuredRelationship = new InsuredRelationship();
     $db = Zend_Registry::get('dbAdapter');
     $sqlSelect = $db->select()->from($insuredRelationship->_table)->where('insurance_program_id = ?', (int) $insuranceProgram->insuranceProgramId)->where('person_id = ?', (int) $patientId)->where('active = 1')->order('program_order')->limit(1);
     if ($row = $db->fetchRow($sqlSelect)) {
         $insuredRelationship->populateWithArray($row);
     }
     $subs = $insuredRelationship->subscriber;
     $subscriberAddr = $subs->address;
     $relationship = null;
     $relationshipCode = $insuredRelationship->subscriberToPatientRelationship;
     if (isset($subscribers[$relationshipCode])) {
         $relationship = $subscribers[$relationshipCode];
     }
     if ($relationship === null) {
         $relationship = 'Self';
         $relationshipCode = 18;
         $subs = new Person();
         $subs->personId = $insuredRelationship->personId;
         $subs->populate();
     }
     $subscriber = array('id' => (int) $subs->personId, 'relationship_code' => $relationshipCode, 'group_number' => $insuredRelationship->groupNumber, 'group_name' => $insuredRelationship->groupName, 'relationship' => $relationship, 'last_name' => $subs->lastName, 'first_name' => $subs->firstName, 'middle_name' => $subs->middleName, 'address' => array('line1' => $subscriberAddr->line1, 'line2' => $subscriberAddr->line2, 'city' => $subscriberAddr->city, 'state' => $subscriberAddr->state, 'zip' => $subscriberAddr->zipCode), 'date_of_birth' => date('Ymd', strtotime($subs->dateOfBirth)), 'gender' => $subs->gender, 'contract_type_code' => '', 'contract_amount' => '', 'contract_percent' => '', 'contract_code' => '', 'contract_discount_percent' => '', 'contract_version' => '');
     $practiceAddr = $practice->primaryAddress;
     $room = new Room();
     $room->roomId = (int) $visit->roomId;
     $room->populate();
//.........这里部分代码省略.........
开发者ID:dragonlet,项目名称:clearhealth,代码行数:101,代码来源:Claim.php

示例14: propise_plugin_setting_page

function propise_plugin_setting_page()
{
    global $_, $myUser, $conf;
    if (isset($_['section']) && $_['section'] == 'propise') {
        require_once 'Data.class.php';
        require_once 'Sensor.class.php';
        if (!$myUser) {
            throw new Exception('Vous devez être connecté pour effectuer cette action');
        }
        $sensorManager = new Sensor();
        $sensors = $sensorManager->populate();
        $roomManager = new Room();
        $rooms = $roomManager->populate();
        $selected = new Sensor();
        //Si on est en mode modification
        if (isset($_['id'])) {
            $selected = $sensorManager->getById($_['id']);
        }
        ?>

		<div class="span9 userBloc">

			<h1>Propise</h1>
			<p>Gestion des multi-sondes</p>  

			<fieldset>
			    <legend>Ajouter/Modifier une sonde</legend>

			    <div class="left">

				    <label for="labelSensor">Nom</label>
				    <input type="hidden" id="id" value="<?php 
        echo $selected->id;
        ?>
">
				    <input type="text" id="labelSensor" value="<?php 
        echo $selected->label;
        ?>
" placeholder="Sonde du salon"/>
			
				    <label for="uidSensor">UID</label>
				    <input type="text" value="<?php 
        echo $selected->uid;
        ?>
" id="uidSensor" placeholder="sonde-1,sonde-2..." />
				    

				    <label for="locationSensor">Pièce de la maison</label>
				    <select id="locationSensor">
				    	<?php 
        foreach ($rooms as $room) {
            ?>
				    	<option <?php 
            if ($selected->location == $room->getId()) {
                echo "selected";
            }
            ?>
 value="<?php 
            echo $room->getId();
            ?>
"><?php 
            echo $room->getName();
            ?>
</option>
				    	<?php 
        }
        ?>
				    </select>
				   
				</div>

	  			<div class="clear"></div>
			    <br/><button onclick="plugin_propise_save(this)" class="btn">Enregistrer</button>
		  	</fieldset>
			<br/>


			<fieldset>
				<legend>Consulter les sondes existants</legend>
				<table class="table table-striped table-bordered table-hover">
				    <thead>
					    <tr>
					    	<th>Nom</th>
						    <th>UID</th>
						    <th>Pièce</th>
						    <th colspan="2"></th>
						    
					    </tr>
				    </thead>
			    
			    	<?php 
        foreach ($sensors as $sensor) {
            $room = $roomManager->load(array('id' => $sensor->location));
            ?>
					<tr>
				    	<td><?php 
            echo $sensor->label;
            ?>
</td>
					    <td><?php 
//.........这里部分代码省略.........
开发者ID:rikimaruneo,项目名称:yana-server,代码行数:101,代码来源:propise.plugin.php

示例15: ajaxStationFromAppointmentAction

 function ajaxStationFromAppointmentAction()
 {
     $appointmentId = (int) $this->_getParam('appointmentId');
     $stationId = $this->_getParam('stationId');
     trigger_error('st: ' . $stationId, E_USER_NOTICE);
     $personId = '';
     $routing = new Routing();
     $json = Zend_Controller_Action_HelperBroker::getStaticHelper('json');
     $json->suppressExit = true;
     $appointment = new LegacyAppointment();
     $appointment->appointmentId = $appointmentId;
     $appointment->populate();
     //appointment already arrived, prevent a dupe
     if ($appointment->arrived > 0) {
         return $json->direct(array(false));
     }
     $patientId = $appointment->patientId;
     $provider = new Provider();
     $provider->personId = $appointment->providerId;
     $provider->populate();
     if (strlen($stationId) > 0) {
         trigger_error('st: ' . $stationId, E_USER_NOTICE);
     } elseif (strlen($provider->routingStation) > 0) {
         $stationId = $provider->routingStation;
     } else {
         if ($appointment->roomId > 0) {
             $room = new Room();
             $room->roomId = $appointment->roomId;
             $room->populate();
             if (strlen($room->routingStation) > 0) {
                 $stationId = $room->routingStation;
             }
         }
     }
     $routing->personId = $appointment->patientId;
     $routing->stationId = $stationId;
     $routing->appointmentId = $appointment->appointmentId;
     $routing->providerId = $appointment->providerId;
     $routing->roomId = $appointment->roomId;
     $routing->timestamp = date('Y-m-d H:i:s');
     if ($routing->personId > 0 && strlen($stationId) > 0) {
         $appointment->arrived = 1;
         $appointment->persist();
         $routing->persist();
         return $json->direct(array(true));
     }
     return $json->direct(array(false));
 }
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:48,代码来源:RoutingController.php


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