assign('companyid', $Data['companyid']); $this->display('Index/rgdcd_catalog'); } public function index_list() { $Data = I(''); $ResData = ytapi_query("select count(*) from person_data where clzt=0 and company_code=" . $Data['companyid']); $this->assign('dcd', $ResData[0]['count(*)']); $this->assign('companyid', $Data['companyid']); // print_r($Data['companyid']); $this->display('Index/fire_inspector'); // print_r($ResData[0]['count(*)']); } public function electronics_list() { $Data = I(''); // print_r($Data); $ResData = ytapi_query("select count(*) from jingan_analysis_data where status=0 and clzt=0 and company_code=" . $Data['companyid']." and content != '设备离线'"); $this->assign('dcd', $ResData[0]['count(*)']); $this->assign('companyid', $Data['companyid']);; $this->display('Index/electronics_inspector'); } public function change() { $Data = I(''); $company_code = $Data['companyid']; switch ($Data['type']) { case 'untreated': $status = "and clzt=0"; break; case 'treated': $status = "and clzt=1"; break; default: break; } $ResData = ytapi_query("select id,content,timestamp,artificial_code,clzt from person_data where company_code='" . $company_code . "' " . $status . " order by timestamp desc LIMIT 1000"); // print_r($ResData); foreach ($ResData as $key => $value) { $str = str_replace('"]', '', $ResData[$key]['content']); $ResData[$key]['content'] = str_replace('["', '', $str); } // print_r($company_code); $this->assign('companyid', $company_code); $this->assign('ResData', $ResData); $this->display('Index/fire_inspector-list'); } public function change1() { $Data = I(''); $company_code = $Data['companyid']; // print_r($Data); // exit(); switch ($Data['type']) { case 'untreated': $status = "and clzt=0"; break; case 'treated': $status = "and clzt=1"; break; default: break; } // print_r("select id,content,timestamp,supervise_code,clzt from jingan_analysis_data where status=0 and content !='设备离线' and company_code='" . $company_code . "' " . $status . " order by timestamp desc LIMIT 1000"); // exit(); $ResData = ytapi_query("select id,content,timestamp,supervise_code,clzt from jingan_analysis_data where status=0 and content !='设备离线' and company_code='" . $company_code . "' " . $status . " order by timestamp desc LIMIT 1000"); foreach ($ResData as $key => $value) { $str = str_replace('"]', '', $ResData[$key]['content']); $ResData[$key]['content'] = str_replace('["', '', $str); } $this->assign('companyid', $company_code); $this->assign('ResData', $ResData); // print_r($ResData); // exit(); $this->display('Index/electronics_inspector-list'); } //报警明细 public function index() { $Data = I(); // print_r($Data['companyid']); $res = ytapi_query("select * from person_data where id=" . $Data['id']); if ($res[0]['clzt']) { $res[0]['wtype'] = "已处理"; } else { $res[0]['wtype'] = "未处理"; } $str = str_replace('"]', '', $res[0]['content']); $res[0]['content'] = str_replace('["', '', $str); if ($res[0]['cl_time'] == '1978-00-00 00:00:00') { $res[0]['cl_time'] = ''; } $this->assign('companyid', $Data['companyid']); $this->assign('res', $res[0]); if ($res[0]['clzt'] == 0) { $this->display('Index/dcdyclxq'); } else { $this->display('Index/dcdwclxq'); } } //电子督察单报警明细 public function index1() { $Data = I(); $res = ytapi_query("select * from jingan_analysis_data where id=" . $Data['id']." and status=0"); if ($res[0]['clzt']) { $res[0]['wtype'] = "已处理"; } else { $res[0]['wtype'] = "未处理"; } $str = str_replace('"]', '', $res[0]['content']); $res[0]['content'] = str_replace('["', '', $str); if ($res[0]['cl_time'] == '1978-00-00 00:00:00') { $res[0]['cl_time'] = ''; } // print_r($res); if ($res[0]['type']==1||$res[0]['type']==2||$res[0]['type']==3){ if (!empty($res[0]['mainframe_id'])){ $a=substr($res[0]['mainframe_id'],2); } $arr=M()->query("select owner_name from sp_owner where owner_code='".$a."'"); // print_r("select info from sp_owner_point where device_code='".$a."' and `loop`=".$res[0]['loop_number']." and pno=".$res[0]['position_number'].""); if(strlen($res[0]['loop_number'])==4){ $zj=substr($res[0]['loop_number'],0,strlen($res[0]['loop_number'])-3); $hl=(int)substr($res[0]['loop_number'],1); $arr1=M()->query("select info from sp_owner_point where device_code='".$a."' and `loop`='".$hl."' and pno='".$res[0]['position_number']."' and host_num='".$zj."'"); }else{ $arr1=M()->query("select info from sp_owner_point where device_code='".$a."' and `loop`='".$res[0]['loop_number']."' and pno='".$res[0]['position_number']."'"); } if (!empty($arr1[0]['info'])){ $res[0]['nr']="设备名称:".$arr[0]['owner_name'].",回路号:".$res[0]['loop_number'].",点位号:".$res[0]['position_number'].",点位描述:".$arr1[0]['info'].""; }else{ $res[0]['nr']="设备名称:".$arr[0]['owner_name'].",回路号:".$res[0]['loop_number'].",点位号:".$res[0]['position_number']; } }else if ($res[0]['type']==4){ if (strpos($res[0]['content'],"泵") !== false){ if (!empty($res[0]['device_id'])){ // print_r($res[0]['device_id']); // print_r("select owner_name from sp_owner where owner_code='".substr($res[0]['device_id'],0,strlen($res[0]['device_id'])-1)."'"); $arr=M()->query("select owner_name from sp_owner where owner_code='".substr($res[0]['device_id'],0,strlen($res[0]['device_id'])-1)."'"); if (!empty($arr[0]['owner_name'])){ $res[0]['nr']="设备名称:".$arr[0]['owner_name']; }else{ $arr1=M()->query("select owner_name from sp_owner where owner_code='".$res[0]['device_id']."'"); if (!empty($arr1[0]['owner_name'])){ $res[0]['nr']="设备名称:".$arr1[0]['owner_name']; }else{ $res[0]['nr']=""; } } } } }else{ $res[0]['nr']=""; } // print_r($res[0]); $this->assign('companyid', $Data['companyid']); $this->assign('res', $res[0]); if ($res[0]['clzt'] == 0) { $this->display('Index/dzdcdyclxq'); } else { $this->display('Index/dzdcdwclxq'); } } //提交上传 public function outputs() { // dump(I()); if ($_SESSION['phone'] == '15000012454' || $_SESSION['idphone'] == '15000012454') { $html = <<