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


PHP Facilities::get_days_from_last_sync方法代码示例

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


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

示例1: index

 public function index()
 {
     !$this->session->userdata('user_id') ? redirect('user') : null;
     $identifier = $this->session->userdata('user_indicator');
     // get user_id
     $user_id = $this->session->userdata('user_id');
     //get last log in
     $lastlogin = user::get_last_login($user_id);
     //pass data to view
     $data['lastlogin'] = date("l, jS F Y g:i a", strtotime($lastlogin));
     //exit;
     switch ($identifier) {
         case 'moh':
             $view = 'shared_files/template/dashboard_template_v';
             break;
         case 'facility_admin':
         case 'facility':
             //check if password is default
             //get last order
             $lastorder = user::get_last_order($user_id);
             //pass data to view
             if (!empty($lastorder)) {
                 $data['lastorder'] = date("l, jS F Y ", strtotime($lastorder['last_order']));
                 $data['order_no'] = $lastorder['order_no'];
                 $data['commodity_name'] = $lastorder['commodity_name'];
                 $data['quantity_ordered_pack'] = $lastorder['quantity_ordered_pack'];
                 $data['quantity_ordered_unit'] = $lastorder['quantity_ordered_unit'];
                 $data['order_total'] = $lastorder['order_total'];
             } else {
                 $data['no_order'] = "N/A";
             }
             $lastissue = user::get_last_issue($user_id);
             if (!empty($lastissue)) {
                 $data['last_issue'] = date("l, jS F Y ", strtotime($lastissue['last_issue']));
                 $data['commodity_name'] = $lastissue['commodity_name'];
                 $data['qty_issued'] = $lastissue['qty_issued'];
                 $data['issued_to'] = $lastissue['issued_to'];
             } else {
                 $data['no_issue'] = "N/A";
             }
             $username = $this->session->userdata('user_email');
             $facility_id = $this->session->userdata('facility_id');
             $reply = User::getPass($username);
             $user_data = $reply->toArray();
             $token = $user_data["password"];
             $default = '123456';
             $data['identifier'] = $identifier;
             $salt = '#*seCrEt!@-*%';
             $password = md5($salt . $default);
             if ($token == "{$password}") {
                 //$data['content_view'] = "shared_files/activation";
                 //$this -> session -> set_flashdata('system_success_message', "This is a security measure.Please Change Your Password to Proceed.");
                 $view = 'shared_files/enforce_change';
                 //$this -> load -> view('shared_files/activation');
             } else {
                 $last_synced = Facilities::get_days_from_last_sync($facility_id);
                 // $last_synced = 10;
                 if ($last_synced > 7) {
                     $view = "shared_files/template/template";
                     $data['last_synced'] = $last_synced;
                     $data['content_view'] = "shared_files/synchronize_now";
                 } else {
                     $view = 'shared_files/template/template';
                     $data['content_view'] = "facility/facility_home_v";
                     $data['facility_dashboard_notifications'] = $this->get_facility_dashboard_notifications_graph_data();
                 }
                 // echo "<pre>"; print_r($last_synced); echo "</pre>"; exit;
             }
             break;
         case 'recovery':
             $facility = $this->session->userdata('facility_id');
             $view = 'shared_files/template/template';
             $data['title'] = "User Management";
             $data['banner_text'] = "User Management";
             $data['current_user_id'] = $this->session->userdata('user_id');
             $data['content_view'] = "shared_files/user_recovery_v";
             $data['listing'] = Users::get_user_list_facility($facility);
             break;
         case 'district':
             $data['content_view'] = "subcounty/subcounty_home_v";
             $view = 'shared_files/template/template';
             break;
         case 'moh_user':
             $view = '';
             break;
         case 'scmlt':
         case 'rtk_county_admin':
         case 'allocation_committee':
         case 'rtk_partner_admin':
         case 'rtk_manager':
         case 'rtk_partner_admin':
         case 'rtk_partner_super':
             redirect('http://41.89.6.223/HCMP/user');
             //redirect('http://192.168.133.23/HCMP/user');
             break;
         case 'super_admin':
             $view = 'shared_files/template/dashboard_v';
             $data['content_view'] = "shared_files/template/super_admin_template";
             break;
             // case 'allocation_committee':
//.........这里部分代码省略.........
开发者ID:arnold-okoth,项目名称:HCMP2015,代码行数:101,代码来源:home.php


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