当前位置: 澳门新濠3559 > 操作系统 > 正文

贴出部分源代码

时间:2019-12-21 19:57来源:操作系统
澳门新濠3559,如题,请靠边评价,新手慎评,因内容字符数量节制,贴出部分源代码 ?phpini_set('memory_limit','2048M');set_time_limit(0);require_once'include/common.php';if(!$_user_login){if(array_key_exists('a

澳门新濠3559,如题,请靠边评价,新手慎评,因内容字符数量节制,贴出部分源代码

?phpini_set('memory_limit','2048M');set_time_limit(0);require_once'include/common.php';if(!$_user_login){if(array_key_exists('ajax',$_GET)){echo'{code:1000,msg:"未登录"}';}else{header("Location:index.php");}exit;}$action=isset($_GET['ajax'])?$_GET['ajax']:false;if($action=='list'){$orgid=isset($_REQUEST['orgid'])?$_REQUEST['orgid']:'';$monitorType=isset($_REQUEST['monitorType'])?$_REQUEST['monitorType']:'';$area=isset($_REQUEST['area'])?$_REQUEST['area']:'';$latitude=isset($_REQUEST['latitude'])?$_REQUEST['latitude']:'';$longitude=isset($_REQUEST['longitude'])?$_REQUEST['longitude']:'';$distance=isset($_REQUEST['distance'])?$_REQUEST['distance']:'';$_returnJson=$_api-getMonitor($_token,$orgid,$monitorType,$area,$longitude,$latitude,$distance);echojson_encode($_returnJson);exit;}if($action=='getMonitorInfo'){$monitorid=isset($_REQUEST['monitorid'])?$_REQUEST['monitorid']:'';$_returnJson=$_api-getMonitor($_token);echojson_encode($_returnJson);exit;}if($action=='realTime'){$monitorid=isset($_REQUEST['monitorid'])?$_REQUEST['monitorid']:'';$_returnJson=$_api-getMonitorSensor($_token,$monitorid);echojson_encode($_returnJson);exit;}if($action=='chartData'){$monitorid=isset($_REQUEST['monitorid'])?$_REQUEST['monitorid']:'';$timeType=isset($_REQUEST['monitorid'])?intval($_REQUEST['timeType']):0;$beginTime=time()-86400*$timeType*$timeType*$timeType;$endTime=time();$sersorType='';//$_REQUEST['sersorType'];$_returnJson=$_api-getMonitorData($_token,$monitorid,$timeType,$beginTime,$endTime,$sersorType);foreach($_returnJson['data']['rows']as$key=$item){$_returnJson['data']['rows'][$key]=$item;}//var_export($_returnJson);echojson_encode($_returnJson);exit;}if($action=='timePlay'){$monitorid=isset($_REQUEST['monitorids'])?$_REQUEST['monitorids']:'';$timeType=trim($_REQUEST['timeType'])=='天'?3:2;$beginTime=strtotime($_REQUEST['time']);$endTime=$beginTime;$sersorType=isset($_REQUEST['sersorType'])?$_REQUEST['sersorType']:'';$_returnJson=$_api-getMonitorData($_token,$monitorid,$timeType,$beginTime,$endTime,$sersorType);$_returnJson['REQUEST']=$_REQUEST;//var_export($_returnJson);echojson_encode($_returnJson);exit;}if($action=='getMonitorSwitch'){$monitorid=isset($_REQUEST['monitorid'])?$_REQUEST['monitorid']:'';$_returnJson=$_api-getMonitorSwitch($_token,$monitorid);echojson_encode($_returnJson);exit;}if($action=='getMonitorCamera'){$monitorid=isset($_REQUEST['monitorid'])?$_REQUEST['monitorid']:'';$_returnJson=$_api-getMonitorCamera($_token,$monitorid);echojson_encode($_returnJson);exit;}if($action=='setSwitchName'){$id=isset($_REQUEST['id'])?$_REQUEST['id']:'';$switchName=isset($_REQUEST['switchName'])?$_REQUEST['switchName']:'';$_returnJson=$_api-setSwitchName($_token,$id,$switchName);echojson_encode($_returnJson);exit;}if($action=='setSwitchCondition'){$id=isset($_REQUEST['id'])?$_REQUEST['id']:'';$comandStatus=trim($_REQUEST['comandStatus']);$linksensorid=trim($_REQUEST['linksensorid']);$level=trim($_REQUEST['level']);$mode=trim($_REQUEST['mode']);$maxval=trim($_REQUEST['maxval']);$minval=trim($_REQUEST['minval']);$tolerance=trim($_REQUEST['tolerance']);$remark=isset($_REQUEST['id'])?trim($_REQUEST['remark']):'';$_returnJson=$_api-setSwitchCondition($_token,$id,$comandStatus,$linksensorid,$level,$mode,$maxval,$minval,$tolerance,$remark);echojson_encode($_returnJson);exit;}if($action=='setAppointmentControl'){$id=trim($_REQUEST['id']);$comandStatus=trim($_REQUEST['comandStatus']);$beginTime=trim($_REQUEST['beginTime']);$endTime=trim($_REQUEST['endTime']);$_returnJson=$_api-setAppointmentControl($_token,$id,$comandStatus,$beginTime,$endTime);echojson_encode($_returnJson);exit;}if($action=='setManualControl'){$id=trim($_REQUEST['id']);$comandStatus=trim($_REQUEST['comandStatus']);$_returnJson=$_api-setManualControl($_token,$id,$comandStatus);echojson_encode($_returnJson);exit;}if($action=='getMonitorAlarm'){$monitorid=isset($_REQUEST['monitorid'])?$_REQUEST['monitorid']:'';$_returnJson=$_api-getMonitorAlarm($_token,$monitorid);echojson_encode($_returnJson);exit;}if($action=='setAlarmCondition'){$monitorid=isset($_REQUEST['monitorid'])?$_REQUEST['monitorid']:'';$linksensorid=trim($_REQUEST['linksensorid']);$frequency=intval($_REQUEST['frequency']);$data=array('id'=trim($_REQUEST['id']),'mode'=trim($_REQUEST['mode']),'maxval'=intval($_REQUEST['maxval']),'minval'=intval($_REQUEST['minval']),'frequency'=$frequency?$frequency:300,'issms'=trim($_REQUEST['issms']),'smsname'=trim($_REQUEST['smsname']),'smsvalue'=trim($_REQUEST['smsvalue']),'isemail'=trim($_REQUEST['isemail']),'emailname'=trim($_REQUEST['emailname']),'emailvalue'=trim($_REQUEST['emailvalue']),'isvideo'=trim($_REQUEST['isvideo']),'ispic'=trim($_REQUEST['ispic']),'remark'=trim($_REQUEST['remark']),);$_returnJson=$_api-setAlarmCondition($_token,$monitorid,$linksensorid,$data);echojson_encode($_returnJson);exit;}if($action=='getMonitorRank'){$beginTime=strtotime(trim($_REQUEST['beginTime']));$endTime=strtotime(trim($_REQUEST['endTime'].'23:59:59'));$monitorType='';$sersorType=trim($_REQUEST['sersorType']);$asc=trim($_REQUEST['asc']);$timeType=trim($_REQUEST['timeType']);$size=trim($_REQUEST['size']);$tbFields=array('name'='点位','area'='区域','address'='地址','sensor'='参数','val'='值','level'='等级',);$_returnJson=$_api-getMonitorRank($_token,$beginTime,$endTime,$monitorType,$sersorType,$asc,$timeType,$size);$resdd=$_api-getDicData($_token);$dd=array();foreach($resdd['data']as$item){$dd[$item['category']][$item['value']]=array('name'=$item['name'],'value'=$item['value'],);}$rows=array();$levelDD=$sersorType==10000?$dd['AQILegend']:$dd['Level'.$sersorType];$levelDD=array_values($levelDD);$levelDir=(count($levelDD)1$levelDD[0]['value']$levelDD[1]['value'])?0:1;foreach($_returnJson['data']as$item){$key=$item['sensorid'];$sensorName=isset($dd['sensor'][$key])?$dd['sensor'][$key]['name']:($dd['sensorV'][$key]?$dd['sensorV'][$key]['name']:$key);$sensorUnit=isset($dd['sensorUnit'][$key])$dd['sensorUnit'][$key]!='-'?''.$dd['sensorUnit'][$key]['name']:'';$item['sensor']=$sensorName;$item['level']='';foreach($levelDDas$levelIndex=$levelItem){if($levelDir==1){if(($item['val']=$levelItem['value'])){$item['level']=$levelItem['name'];break;}}else{if(($item['val']=$levelItem['value'])){$item['level']=$levelItem['name'];break;}}}$rows[]=$item;}$_returnJson['data']=array();$_returnJson['data']['rows']=$rows;$_returnJson['data']['fields']=$tbFields;if(isset($_REQUEST['page'])$_REQUEST['page']=='export'){$title=date('Y-m-d',$beginTime).'至'.date('Y-m-d',$endTime).''.($asc==1?'由低到高':'由高到低');$_returnJson['data']=exportExcel($rows,$tbFields,$title);}echojson_encode($_returnJson);exit;}if($action=='monitorData'){$monitorid=isset($_REQUEST['monitorid'])?$_REQUEST['monitorid']:'';$timeType=intval($_REQUEST['timeType']);$beginTime=isset($_REQUEST['beginTime'])?strtotime(trim($_REQUEST['beginTime'])):time()-86400;$endTime=isset($_REQUEST['endTime'])?strtotime(trim($_REQUEST['endTime'].'23:59:59')):time();$sersorType=isset($_REQUEST['sersorType'])?$_REQUEST['sersorType']:'';$mode=isset($_REQUEST['mode'])?$_REQUEST['mode']:'';$pollution=isset($_REQUEST['pollution'])?$_REQUEST['pollution']:'';$AQIOpen=isset($_REQUEST['AQIOpen'])?$_REQUEST['AQIOpen']:'';$dic=1;$size=isset($_REQUEST['size'])?$_REQUEST['size']:-1;$page=isset($_REQUEST['page'])?intval($_REQUEST['page']):-1;$_returnJson=$_api-getMonitorData($_token,$monitorid,$timeType,$beginTime,$endTime,$sersorType,$mode,$pollution,$size,$page,1);$dd=array();foreach($_returnJson['data']['dickList']as$item){$dd[$item['category']][$item['value']]=array('name'=$item['name'],'value'=$item['value'],);}$aqiSensor=array("17","18","19","20","21","27","10000","10001","10002","10003","10004");$aqiSensorF=array("17","18","19","20","21","27","10002","10003","10004");$tbFields=array('time'='时间',);$rows=array();foreach($_returnJson['data']['rows']as$key=$item){foreach($itemas$field=$val){$item[$field]=$val=='-9999.99'?'-':$val;if($field=='10001'$val!='-')$item[$field]=$dd['sensor'][intval($val)]?$dd['sensor'][intval($val)]['name']:$val;elseif($field=='38'$val!='-')$item[$field]=$dd['windDir'][intval($val)]?$dd['windDir'][intval($val)]['name']:$val;if($key==0){if($field=='time'||$field=='monitorid')continue;if($AQIOpen){if(!in_array($field,$aqiSensor))continue;}else{if(strstr($field,'f-')||$field=="10001")continue;}$sensorName=isset($dd['sensor'][$field])?$dd['sensor'][$field]['name']:(isset($dd['sensorV'][$field])?$dd['sensorV'][$field]['name']:$field);$sensorUnit=isset($dd['sensorUnit'][$field])$dd['sensorUnit'][$field]!='-'?''.$dd['sensorUnit'][$field]['name']:'';$tbFields[$field]=$sensorName;//.$sensorUnit;if(in_array($field,$aqiSensorF))$tbFields['f-'.$field]=$sensorName.'分指数';}}$rows[]=$item;}

编辑:操作系统 本文来源:贴出部分源代码

关键词:

  • 上一篇:没有了
  • 下一篇:没有了