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


PHP Facilities::getFacility方法代码示例

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


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

示例1: getPerformerByUid

 /**
  * Method getPerformerByUid()
  * @param $uid
  * @return array|bool
  */
 private function getPerformerByUid($uid)
 {
     $User = new User();
     $user = $User->getUser($uid);
     unset($User);
     if ($user === false) {
         return false;
     }
     $user = (object) $user;
     if ($user->facility_id == 0) {
         return false;
     }
     $Facilities = new Facilities();
     $facility = $Facilities->getFacility(['id' => $user->facility_id]);
     if ($user === false) {
         return false;
     }
     $facility = (object) $facility;
     $performer = ['assignedEntity' => ['id' => ['@attributes' => ['root' => UUID::v4()]]]];
     $performer['assignedEntity']['addr'] = ['@attributes' => ['use' => 'HP'], 'streetAddressLine' => ['@value' => isset($user->street) ? $user->street : ''], 'city' => ['@value' => isset($user->city) ? $user->city : ''], 'state' => ['@value' => isset($user->state) ? $user->state : ''], 'postalCode' => ['@value' => isset($user->postal_code) ? $user->postal_code : ''], 'country' => ['@value' => isset($user->country_code) ? $user->country_code : '']];
     $performer['assignedEntity']['telecom'] = ['@attributes' => ['value' => 'tel:' . (isset($user->phone) ? $user->phone : '')]];
     $performer['assignedEntity']['representedOrganization'] = ['id' => ['@attributes' => ['root' => '2.16.840.1.113883.4.6']]];
     $performer['assignedEntity']['assignedPerson']['name'] = ['name' => ['prefix' => $this->primaryProvider['title'], 'given' => $this->primaryProvider['fname'], 'family' => $this->primaryProvider['lname']]];
     $performer['assignedEntity']['representedOrganization']['name'] = $facility->name;
     $performer['assignedEntity']['representedOrganization']['telecom'] = $this->telecomBuilder($this->facility['phone'], 'WP');
     $performer['assignedEntity']['representedOrganization']['addr'] = $this->addressBuilder('WP', $this->facility['address'] . ' ' . $this->facility['address_cont'], $this->facility['city'], $this->facility['state'], $this->facility['postal_code'], $this->facility['country_code']);
     return $performer;
 }
开发者ID:igez,项目名称:gaiaehr,代码行数:33,代码来源:CCDDocument.php

示例2: save_details

 public function save_details()
 {
     $district = $this->session->userdata("district_province_id");
     $facility_id = $this->input->post('facility_id');
     //Check if we are in editing mode first; if so, retrieve the edited record. if not, create a new one!
     if (strlen($facility_id) > 0) {
         $facility = Facilities::getFacility($facility_id);
         //Retrieve the fridges for this facility
         $fridges = Facility_Fridges::getFacilityFridges($facility_id);
         //Delete all these existing facility-fridge combinations
         foreach ($fridges as $fridge) {
             $fridge->delete();
         }
     } else {
         $facility = new Facilities();
     }
     $facility->facilitycode = $this->input->post('facilitycode');
     $facility->name = $this->input->post('name');
     $facility->facilitytype = $this->input->post('type');
     $facility->district = $district;
     $facility->email = $this->input->post('email');
     $facility->phone = $this->input->post('phone');
     $facility->save();
     $facility_id = $facility->id;
     $fridges = $this->input->post('fridges');
     $counter = 0;
     foreach ($fridges as $fridge) {
         if ($fridge > 0) {
             $facility_fridge = new Facility_Fridges();
             $facility_fridge->Facility = $facility_id;
             $facility_fridge->Fridge = $fridge;
             $facility_fridge->Timestamp = date('U');
             $facility_fridge->save();
             $counter++;
         } else {
             $counter++;
             continue;
         }
     }
     redirect("facility_management/district_list");
 }
开发者ID:bamcod,项目名称:Disease-Surveillance,代码行数:41,代码来源:facility_management.php

示例3: save

 public function save()
 {
     $i = 0;
     $valid = $this->_validate_submission();
     if ($valid == false) {
         $this->add();
     } else {
         $editing = false;
         $diseases = Disease::getAllObjects();
         $weekending = $this->input->post("week_ending");
         $reporting_year = $this->input->post("reporting_year");
         $epiweek = $this->input->post("epiweek");
         $facility = $this->input->post("facility");
         $reportingfacilities = $this->input->post("reporting_facilities");
         $expectedfacilities = $this->input->post("expected_facilities");
         $lmcase = $this->input->post("lmcase");
         $lfcase = $this->input->post("lfcase");
         $lmdeath = $this->input->post("lmdeath");
         $lfdeath = $this->input->post("lfdeath");
         $gmcase = $this->input->post("gmcase");
         $gfcase = $this->input->post("gfcase");
         $gmdeath = $this->input->post("gmdeath");
         $gfdeath = $this->input->post("gfdeath");
         $sickness = $this->input->post("disease");
         $reported_by = $this->input->post("reported_by");
         $designation = $this->input->post("designation");
         $lab_id = $this->input->post("lab_id");
         $surveillance_ids = $this->input->post("surveillance_ids");
         $data_exists = Surveillance::getFacilityData($epiweek, $reporting_year, $facility);
         if ($lab_id > 0) {
             $editing = true;
         }
         if ($data_exists->id && $editing == false) {
             $data = array();
             $data['duplicate_facility'] = Facilities::getFacility($facility);
             $data['duplicate_epiweek'] = $epiweek;
             $data['duplicate_reporting_year'] = $reporting_year;
             $data['existing_data'] = true;
             $this->add($data);
             return;
         }
         $total_diseases = Disease::getTotal();
         $timestamp = date('d/m/Y');
         $i = 0;
         foreach ($diseases as $disease) {
             if ($editing == true) {
                 $surveillance = Surveillance::getSurveillance($surveillance_ids[$i]);
             } else {
                 $surveillance = new Surveillance();
             }
             $surveillance->Week_Ending = $weekending;
             $surveillance->Epiweek = $epiweek;
             $surveillance->Facility = $facility;
             $surveillance->Submitted = $reportingfacilities;
             $surveillance->Expected = $expectedfacilities;
             $surveillance->Lmcase = $lmcase[$i];
             $surveillance->Lfcase = $lfcase[$i];
             $surveillance->Lmdeath = $lmdeath[$i];
             $surveillance->Lfdeath = $lfdeath[$i];
             if (isset($gmcase[$i])) {
                 $surveillance->Gmcase = $gmcase[$i];
                 $surveillance->Gfcase = $gfcase[$i];
                 $surveillance->Gmdeath = $gmdeath[$i];
                 $surveillance->Gfdeath = $gfdeath[$i];
             }
             $surveillance->Disease = $disease;
             $surveillance->Reporting_Year = $reporting_year;
             $surveillance->Created_By = $this->session->userdata('user_id');
             $surveillance->Date_Created = date("Y-m-d");
             $surveillance->Reported_By = $reported_by;
             $surveillance->Designation = $designation;
             $surveillance->Total_Diseases = $total_diseases;
             $surveillance->Date_Reported = $timestamp;
             $surveillance->save();
             $i++;
         }
         //end foreach
         //Lab Data
         if ($editing == true) {
             $labdata = Lab_Weekly::getLabObject($lab_id);
         } else {
             $labdata = new Lab_Weekly();
         }
         $totaltestedlessfive = $this->input->post("total_tested_less_than_five");
         $totaltestedgreaterfive = $this->input->post("total_tested_greater_than_five");
         $totalpositivelessfive = $this->input->post("total_positive_less_than_five");
         $totalpositivegreaterfive = $this->input->post("total_positive_greater_than_five");
         $remarks = $this->input->post("remarks");
         $labdata->Epiweek = $epiweek;
         $labdata->Week_Ending = $weekending;
         $labdata->Facility = $facility;
         $labdata->Malaria_Below_5 = $totaltestedlessfive;
         $labdata->Malaria_Above_5 = $totaltestedgreaterfive;
         $labdata->Positive_Below_5 = $totalpositivelessfive;
         $labdata->Positive_Above_5 = $totalpositivegreaterfive;
         $labdata->Remarks = $remarks;
         $labdata->Reporting_Year = $reporting_year;
         $labdata->Date_Created = date("Y-m-d");
         $labdata->save();
         if ($editing) {
//.........这里部分代码省略.........
开发者ID:bamcod,项目名称:Disease-Surveillance,代码行数:101,代码来源:weekly_facility.php


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