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


PHP Facilities::facility_loggins方法代码示例

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


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

示例1: facility_mapping

 public function facility_mapping()
 {
     //get the current year and date
     $year = date("Y");
     $month = date("m");
     //pick the user data from the session
     $identifier = $this->session->userdata('user_indicator');
     $county_id = $this->session->userdata('county_id');
     //Get facility code from the session then pick the name from the database
     $facility_code = $this->session->userdata('facility_id');
     $facility_code_ = isset($facility_code) && $facility_code > 0 ? facilities::get_facility_name_($facility_code)->toArray() : null;
     $facility_name = $facility_code_[0]['facility_name'];
     //pick the district from the session then get the name
     $district_id = $this->session->userdata('district_id');
     //Get the name of the county
     $county_name = Counties::get_county_name($county_id);
     $county_name = $county_name['county'];
     $data['get_facility_data'] = facilities::get_facilities_online_per_district($county_id);
     $get_dates_facility_went_online = facilities::get_dates_facility_went_online($county_id);
     $data['data'] = $this->get_county_facility_mapping_ajax_request("on_load");
     // Graph data of last issued
     if ($this->session->userdata('user_indicator') != 'facility') {
         $facility_issues = Facilities::facility_issued($this->session->userdata('user_indicator'), $county_id, $district_id, $facility_code);
         $facility_last_issue = array();
         $facility_last_issue = array_merge($facility_last_issue, array("graph_id" => 'issued-graph'));
         $facility_last_issue = array_merge($facility_last_issue, array("graph_title" => 'Days Since Last Issue'));
         $facility_last_issue = array_merge($facility_last_issue, array("graph_type" => 'bar'));
         $facility_last_issue = array_merge($facility_last_issue, array("graph_yaxis_title" => 'Days'));
         $facility_last_issue = array_merge($facility_last_issue, array("graph_categories" => array()));
         $facility_last_issue = array_merge($facility_last_issue, array("series_data" => array("Days from Last issued" => array())));
         foreach ($facility_issues as $last_issued) {
             $facility_last_issue['graph_categories'] = array_merge($facility_last_issue['graph_categories'], array($last_issued['Facility Name']));
             $facility_last_issue['series_data']['Days from Last issued'] = array_merge($facility_last_issue['series_data']['Days from Last issued'], array((int) $last_issued['Days from last issue']));
         }
         //$facility_last_issue['series_data']['Days from Last issued'] = sort($facility_last_issue['series_data']['Days from Last issued'],'descend');
         $facility_issued_ = $this->hcmp_functions->create_high_chart_graph($facility_last_issue);
         $data['facility_last_issues'] = $facility_issued_;
         //Graph data of last issued
         // Graph data of last orders
         $facility_orderings = Facilities::facility_ordered($this->session->userdata('user_indicator'), $county_id, $district_id, $facility_code);
         $facility_last_order = array();
         $facility_last_order = array_merge($facility_last_order, array("graph_id" => 'ordered-graph'));
         $facility_last_order = array_merge($facility_last_order, array("graph_title" => 'Days Since Last Order'));
         $facility_last_order = array_merge($facility_last_order, array("graph_type" => 'bar'));
         $facility_last_order = array_merge($facility_last_order, array("graph_yaxis_title" => 'Days'));
         $facility_last_order = array_merge($facility_last_order, array("graph_categories" => array()));
         $facility_last_order = array_merge($facility_last_order, array("series_data" => array("Days From Last Order" => array())));
         foreach ($facility_orderings as $last_ordered) {
             $facility_last_order['graph_categories'] = array_merge($facility_last_order['graph_categories'], array($last_ordered['Facility Name']));
             $facility_last_order['series_data']['Days From Last Order'] = array_merge($facility_last_order['series_data']['Days From Last Order'], array((int) $last_ordered['Days From Last Order']));
         }
         $facility_ordered_ = $this->hcmp_functions->create_high_chart_graph($facility_last_order);
         $data['facility_last_orders'] = $facility_ordered_;
         // Graph data of last logged
         $facility_loggins = Facilities::facility_loggins($this->session->userdata('user_indicator'), $county_id, $district_id, $facility_code);
         $facility_last_loggin = array();
         $facility_last_loggin = array_merge($facility_last_loggin, array("graph_id" => 'logged-graph'));
         $facility_last_loggin = array_merge($facility_last_loggin, array("graph_title" => 'Days From Last Seen'));
         $facility_last_loggin = array_merge($facility_last_loggin, array("graph_type" => 'bar'));
         $facility_last_loggin = array_merge($facility_last_loggin, array("graph_yaxis_title" => 'Days'));
         $facility_last_loggin = array_merge($facility_last_loggin, array("graph_categories" => array()));
         $facility_last_loggin = array_merge($facility_last_loggin, array("series_data" => array("Days From Last Seen" => array())));
         foreach ($facility_loggins as $last_loggin) {
             $facility_last_loggin['graph_categories'] = array_merge($facility_last_loggin['graph_categories'], array($last_loggin['Facility Name']));
             $facility_last_loggin['series_data']['Days From Last Seen'] = array_merge($facility_last_loggin['series_data']['Days From Last Seen'], array((int) $last_loggin['Days From Last Seen']));
         }
         $facility_loggin_ = $this->hcmp_functions->create_high_chart_graph($facility_last_loggin);
         $data['facility_last_loggin'] = $facility_loggin_;
     }
     if ($this->input->is_ajax_request()) {
         $data['district_data'] = districts::getDistrict($this->session->userdata('county_id'));
         return $this->load->view('subcounty/ajax/facility_roll_out_at_a_glance_v', $data);
     } else {
         $data['title'] = "User Logs";
         $data['banner_text'] = "System Use Statistics";
         $data['report_view'] = "subcounty/ajax/facility_roll_out_at_a_glance_v";
         $data['sidebar'] = !$this->session->userdata('facility_id') ? "shared_files/report_templates/side_bar_sub_county_v" : "shared_files/report_templates/side_bar_v";
         $data['content_view'] = "facility/facility_reports/reports_v";
         $data['active_panel'] = !$this->session->userdata('facility_id') ? "system_usage" : "system_usage";
         $data['district_data'] = districts::getDistrict($this->session->userdata('county_id'));
         $view = 'shared_files/template/template';
         $this->load->view($view, $data);
     }
 }
开发者ID:Kone132,项目名称:HCMP-1,代码行数:84,代码来源:reports.php


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