代码拉取完成,页面将自动刷新
同步操作将从 智云信通/QROpenAgreement 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
require './class/function.php';
require './class/db.class.php';
require './lib/Smarty.class.php';
$smarty = new Smarty;
$db = ConnectMysqli::getIntance();
$wmj = $db->getRow('select * from config where k="wmj"');
$wmjcontent = $wmj['content'];
$config = json_decode($wmj['v'], true);
$lock_id = $_GET['id']*1 ;
$lock = $db->getRow('select * from locks where id='.$lock_id);
//$lock = ['sn'=>'WMJ16881234'];
if (!$lock) {
$data = array(
'state' => 0,
'msg' => '非法访问',
);
} else {
if( empty($_GET['agree']) )
{
//echo $wmjcontent;
$adata = array(
'lock_id'=>$lock_id ,
'content'=>$wmjcontent ,
);
$smarty->assign('adata', $adata);
return $smarty->display('agree.html');
}
if ($config['aeskey']) {
$lock['sn'] = aesEncrypt($lock['sn'], $config['aeskey']);
}
$result = httpPost('https://www.wmj.com.cn/api/openlock.html?appid='.$config['appid'].'&appsecret='.$config['appsecret'], $lock['sn']);
$result = json_decode(trim($result, "\xEF\xBB\xBF"), true);
if ($result['state']) {
$data = array(
'state' => 1,
'msg' => '开门成功',
);
} else {
$data = array(
'state' => 0,
'msg' => '开门失败',
);
}
}
$smarty->assign('data', $data);
$smarty->display('index.html');
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。