You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

73 lines
3.3 KiB

<?php
#設定愛家梯(aijiati)紧急推送地址
#昶屹
#$sys_code = "CSVIP1";
#$api_password = "DqgAtA";
#永佳捷
date_default_timezone_set('Asia/Taipei');
$sys_code = "OPBIOD";
$api_password = "123456";
#普來特富
#date_default_timezone_set('PRC');
#$sys_code = "6TJQBP";
#$api_password = "123456";
$url_array = Array("getMd5Token" => "http://139.196.43.134:61088//zaagtech-1.0.0/iotinterface/getMd5Token",
"getAccessToken" => "http://139.196.43.134:61088//zaagtech-1.0.0/iotinterface/getAccessToken",
"getSessionToken" => "http://139.196.43.134:61088//zaagtech-1.0.0/iotinterface/getSessionToken",
"getElvByCompany" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getElvByCompany",
"getElvInfo" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getElvInfo",
"getElvReport" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getElvReport",
"getRunTime" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getRunTime",
"getFault" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getFault",
"getEvent" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getEvent",
"getHisRuntime" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getHisRuntime",
"getHisFault" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getHisFault",
"getHisEvent" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getHisEvent",
"getMaintainList" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getMaintainList",
"getFaultList" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getFaultList",
"getElevatorParameter" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getElevatorParameter",
"getDeviceRunInfo" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getDeviceRunInfo",
"getPreviewURLsByImei" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/getPreviewURLsByImei",
"setWarningPost" => "http://139.196.43.134:61088/zaagtech-1.0.0/iotinterface/setWarningPost",
"setTestAlarm" => "http://47.117.5.18:61096/test/user/sendTestAlarm"
);
function postdata($parm, $url){
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // 对认证证书来源的检查
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); // 从证书中检查SSL加密算法是否存在
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $parm);
$results = curl_exec($curl);
curl_close($curl);
return json_decode($results, true);
}
function aijiati_sendTestAlarm($sys_code, $api_password, $url_array){
//echo 'value='.$value.'<br>';
$parm = [
"sys_code" => $sys_code,
"password" => $api_password,
"imei" => "861902055871565", #永佳捷帳號下的測試imei
#"imei" => "867590066283351", #普來特富帳號下的測試imei
"flag" => "1100",
"insert_time" => date("Y-m-d H:i:s"),
"flagMsg" => "故障信息"
];
$parm = json_encode($parm);
$results = postdata($parm, $url_array["setTestAlarm"]);
print_r($results);
}
aijiati_sendTestAlarm($sys_code, $api_password, $url_array);
?>