public function system_updates_home($update_status = NULL, $update_presence = NULL)
 {
     // echo "<pre>";print_r($update_presence);exit;
     $permissions = 'super_permissions';
     $data['user_types'] = Access_level::get_access_levels($permissions);
     $identifier = $this->session->userdata('user_indicator');
     $status = isset($update_presence) && ($update_presence = 1) ? 1 : NULL;
     if (isset($status) && $status == 1) {
         $status_ = "TRUE";
         $available_update = 1;
     } else {
         $status_ = "FALSE";
         $available_update = 0;
     }
     $latest_update_time = $this->latest_server_update_time();
     // echo "<pre>";print_r($latest_update_time);echo "</pre>";exit;
     // echo $available_update;exit;
     $update_records = update_model::get_prior_records();
     // echo "<pre>";print_r($update_records);exit;
     $data['available_update'] = $available_update;
     $data['latest_update_time'] = $latest_update_time;
     $data['update_status'] = $status_;
     $data['update_records'] = $update_records;
     $data['title'] = "System Updates";
     $data['banner_text'] = "System Management";
     $data['banner_text'] = "System Management";
     $template = 'shared_files/template/template';
     $data['latest_hash'] = $hash;
     $data['content_view'] = "offline/offline_admin_home";
     $this->load->view($template, $data);
 }
 public function latest_update_time($return_type = NULL)
 {
     $update_time = update_model::get_latest_local_timestamp($return_type);
     // echo "<pre>";print_r($update_time);exit();
     // echo $update_time;
     // $update_time = json_encode($update_time,JSON_PRETTY_PRINT);
     echo json_encode($update_time);
     // $update_time = json_decode($update_time,true);
     // print_r($update_time);
 }
 public function system_update_status()
 {
     $local_data = update_model::get_latest_local_timestamp();
     // echo "<pre>";print_r($local_data);exit;
     $server_data = $this->get_server_update_data();
     $server_time = $server_data[0]['added_on'];
     $local_time = $local_data[0]['added_on'];
     if (strtotime($server_time) > strtotime($local_time)) {
         // echo "Update Required";
         $status = 1;
     } else {
         // echo "No update required";
         $status = 0;
     }
     // echo "<pre>";print_r($local_time);exit;
     return $status;
 }
Beispiel #4
0
 /**
  * Добавляет к блоку данные о проводниках и зазорах
  */
 public function wideandgap($rec)
 {
     $rec = multibyte::cp1251_to_utf8($rec);
     // TODO duble code
     // update block size
     extract($rec);
     $sql = "SELECT id FROM customers WHERE customer='{$customer}'";
     $rs = sql::fetchOne($sql);
     if (empty($rs)) {
         $sql = "INSERT INTO customers (customer) VALUES ('{$customer}')";
         sql::query($sql);
         $customer_id = sql::lastId();
     } else {
         $customer_id = $rs[id];
     }
     $sql = "SELECT id,comment_id FROM blocks WHERE customer_id='{$customer_id}' AND blockname='{$board}'";
     $rs = sql::fetchOne($sql);
     if (!empty($rs)) {
         $params = json_decode(multibyte::Unescape(sqltable_model::getComment($rs["comment_id"])), true);
         //получим текщий комент
         $params["wideandgaps"] = update_model::parsexstring($wideandgaps);
         $comment_id = sqltable_model::getCommentId(multibyte::Json_encode(multibyte::recursiveEscape($params)));
         $id = $rs["id"];
         $sql = "UPDATE blocks SET comment_id='{$comment_id}' WHERE id='{$id}'";
         sql::query($sql);
         echo json_encode($params);
     }
     /* если не нашелся такой блок, то не понятно как вызывался метод, блок создается раньше вызовом coppers и другими
      * wideandgaps вызывается для готовых блоков, не вижу смысла отрабатывать ситуацию когда блока нет
      */
 }