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


PHP Facilities::getParent方法代码示例

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


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

示例1: create_order


//.........这里部分代码省略.........
             $data["is_update"] = 0;
             $data["is_view"] = 0;
             if ($order_type == 0) {
                 //satellite
                 $facility_code = $this->input->post("satellite_facility", TRUE);
                 $data['page_title'] = "Satellite Facility(F-MAPS)";
                 $data['banner_text'] = "Satellite Facility(F-MAPS)";
                 if ($facility_code == null) {
                     $facility_code = $this->session->userdata("facility");
                 } else {
                     $data['hide_generate'] = 1;
                 }
             } else {
                 if ($order_type == 1) {
                     //standalone
                     $facility_code = $this->session->userdata('facility');
                     $facility_id = $this->session->userdata('facility_id');
                     $data['commodities'] = Sync_Drug::getActiveList();
                     $data['page_title'] = "Stand-Alone MAPS";
                     $data['banner_text'] = "Maps Form";
                 } else {
                     if ($order_type == 2) {
                         //dispensing_point
                         $facility_code = $this->session->userdata('facility');
                         $facility_id = $this->session->userdata('facility_id');
                         $data['commodities'] = Sync_Drug::getActiveList();
                         $data['page_title'] = "Central Dispensing Point";
                         $data['banner_text'] = "Maps Form";
                         $order_type = 0;
                     } else {
                         //aggregate
                         $facility_code = $this->session->userdata('facility');
                         $data['page_title'] = "Aggregate Maps List";
                         $facility = Facilities::getParent($facility_code);
                         $parent_code = $facility['parent'];
                         if ($parent_code == $facility_code) {
                             //Check if button was clicked to start new aggregate order
                             $data['hide_generate'] = 2;
                         }
                         $data['banner_text'] = "Aggregate Maps List";
                     }
                 }
             }
             if (!empty($content_array)) {
                 $fmaps_array = $content_array;
                 $data['fmaps_array'] = $fmaps_array['fmaps_array'];
                 $facility_id = $fmaps_array['fmaps_array'][0]['facility_id'];
                 $data['facility_id'] = $facility_id;
                 $facilities = Sync_Facility::getCode($facility_id, $order_type);
                 $facility_code = $facilities['code'];
                 $code = $fmaps_array['fmaps_array'][0]['code'];
                 $code = $this->getDummyCode($code, $order_type);
                 //Central or Satellite or Aggregate
                 $data['status'] = strtolower($fmaps_array['fmaps_array'][0]['status_name']);
                 $data['created'] = $fmaps_array['fmaps_array'][0]['created'];
                 // Pending, Approved, ...
                 $data['options'] = $fmaps_array['options'];
                 $data['hide_btn'] = 1;
                 $maps_id = $fmaps_array['fmaps_array'][0]['maps_id'];
                 //Complet id with #
                 $map_id = $fmaps_array['fmaps_array'][0]['map_id'];
                 //Id from DB
                 $data['maps_id'] = $maps_id;
                 $data['map_id'] = $map_id;
                 $data['logs'] = Maps_Log::getMapLogs($map_id);
                 if ($data['options'] == "view") {
开发者ID:OmondiKevin,项目名称:ADT,代码行数:67,代码来源:order.php

示例2: data_upload

 public function data_upload()
 {
     if ($_POST['btn_save']) {
         $objReader = new PHPExcel_Reader_Excel2007();
         if ($_FILES['file']['tmp_name']) {
             $objPHPExcel = $objReader->load($_FILES['file']['tmp_name']);
         } else {
             $this->session->set_userdata('upload_counter', '1');
             redirect("fcdrr_management/index");
         }
         $arr = $objPHPExcel->getActiveSheet()->toArray(null, true, true, true);
         $highestColumm = $objPHPExcel->setActiveSheetIndex(0)->getHighestColumn();
         $highestRow = $objPHPExcel->setActiveSheetIndex(0)->getHighestRow();
         //Top Details
         $facility_name = $arr[5]['B'] . $arr[5]['C'] . $arr[5]['D'] . $arr[5]['E'];
         $province = $arr[6]['B'] . $arr[6]['C'] . $arr[6]['D'] . $arr[6]['E'];
         $facility_code = $arr[5]['R'] . $arr[5]['S'] . $arr[5]['T'];
         $district = $arr[6]['R'] . $arr[6]['S'] . $arr[6]['T'];
         $type_of_service_art = $arr[8]['C'];
         $type_of_service_pmtct = $arr[8]['E'];
         $type_of_service_pep = $arr[8]['H'];
         if ($type_of_service_art && $type_of_service_pmtct && $type_of_service_pep) {
             $services_offered = "ART,PMTCT,PEP";
         } else {
             if ($type_of_service_pmtct && $type_of_service_art) {
                 $services_offered = "ART,PMTCT";
             } else {
                 if ($type_of_service_pep && $type_of_service_art) {
                     $services_offered = "ART,PEP";
                 } else {
                     if ($type_of_service_pmtct && $type_of_service_pep) {
                         $services_offered = "PMTCT,PEP";
                     } else {
                         if ($type_of_service_art) {
                             $services_offered = "ART";
                         }
                         if ($type_of_service_pmtct) {
                             $services_offered = "PMTCT";
                         }
                         if ($type_of_service_pep) {
                             $services_offered = "PEP";
                         }
                     }
                 }
             }
         }
         @$services_offered;
         $programme_sponsor_gok = $arr[4]['D'];
         $programme_sponsor_pepfar = $arr[4]['G'];
         $programme_sponsor_msf = $arr[4]['L'];
         $programme_sponsor = "";
         if ($programme_sponsor_gok) {
             $programme_sponsor = "GOK";
         }
         if ($programme_sponsor_pepfar) {
             $programme_sponsor = "PEPFAR";
         }
         if ($programme_sponsor_msf) {
             $programme_sponsor = "MSF";
         }
         $updated_on = date("U");
         //Reporting Period
         @($beginning = trim($arr[10]['D'] . $arr[10]['E']));
         @($ending = $arr[10]['R'] . $arr[10]['S'] . $arr[10]['T']);
         $start = explode("-", $beginning);
         $day = $start[0];
         $month = $start[1];
         $year = $start[2];
         $beginning = "20" . $year . "-" . $month . "-" . $day;
         $beginning = date('Y-m-d', strtotime($beginning));
         $ending = str_replace('/', '-', $ending);
         $old_ending = strtotime($ending);
         $ending = date('Y-m-d', $old_ending);
         $central_facility = $this->session->userdata('facility');
         $parent = Facilities::getParent($central_facility);
         $central_site = $parent->parent;
         //Comments
         for ($i = 105; $i <= 109; $i++) {
             for ($j = 1; $j <= $highestColumm; $j++) {
             }
             @($comments .= $arr[$i]['A'] . $arr[$i]['B'] . $arr[$i]['C'] . $arr[$i]['D'] . $arr[$i]['E'] . $arr[$i]['G'] . $arr[$i]['H'] . $arr[$i]['L']);
         }
         $unique_id = 0;
         $this->load->database();
         $facility_order_query = $this->db->query("SELECT MAX(id) AS id FROM facility_order");
         $facility_order_results = $facility_order_query->result_array();
         $facility_id = $facility_order_results[0]['id'];
         $order_number = $facility_id + 1;
         $unique_id = md5($order_number . $facility_code);
         $query = $this->db->query("INSERT INTO facility_order (`id`, `status`, `created`, `updated`, `code`, `period_begin`, `period_end`, `comments`, `reports_expected`, `reports_actual`, `services`, `sponsors`, `delivery_note`, `order_id`, `facility_id`,`central_facility`,`unique_id`) VALUES ('{$order_number}', '0', CURDATE(), '{$updated_on}', '2', '{$beginning}', '{$ending}', '{$comments}', NULL, NULL, '{$services_offered}', '{$programme_sponsor}', NULL, NULL, '{$facility_code}','{$central_site}','{$unique_id}');");
         $facility_id = $unique_id;
         $user_id = $this->session->userdata('full_name');
         $query = $this->db->query("SELECT MAX(id) AS id FROM order_comment");
         $results = $query->result_array();
         $last_id = $results[0]['id'];
         $last_id = $last_id + 1;
         $last_id = md5($last_id . $facility_code);
         //Adding comments
         $order_comment = new Order_Comment();
         $order_comment->Order_Number = $facility_id;
//.........这里部分代码省略.........
开发者ID:OmondiKevin,项目名称:ADT_MTRH,代码行数:101,代码来源:fcdrr_management.php


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