代码拉取完成,页面将自动刷新
<?php
require_once("inc/common.inc.php");
$rentype=intval($rentype);
if ($rentype==1){
$mobile=trim($mobile);
$shang=trim($shang);
$mac=trim($mac);
$Rid=intval($Rid);
$yancode=trim($yancode);
//是否为空
if($mobile=="" or $Rid==0 or $mac=="" or strlen($mac)!=12 or $shang=="" or $yancode==""){echo "0";exit();}
//验证手机号格式
if(!eregi("^[0-9]{11,11}$",$mobile)){echo "0";exit();}
// echo md5($mac."{mx}".$shang."{z}".$mobile."{w}".$Rid)."<br>".$sign;
// exit();
//验证码
if(md5($mac."{mx}".$shang."{z}".$mobile."{w}".$Rid."{w}".$yancode."{w}")!=$sign){echo "0";exit();}
$reginfo=$db->getinfo("select top 1 * from mx_view_sms_relog where mac='$mac' and rid='$Rid' and mobile='$mobile' and yancode='$yancode'");
if (!is_array($reginfo)){echo "0";exit();}
else{
$db->excu("BEGIN TRANSACTION DEPS02_DEL");
$thistime=date("Y-m-d H:i:s");
//更新mac认证
$db->excu("update mx_maclist set renzhengtype='1',isrenzheng='1',mobile='$mobile',firstrid='$Rid',firsttime='$thistime',isonline='1' where mac='$mac' and isrenzheng='0' ");
$maclist=$db->getinfo("select top 1 * from mx_shang_maclist where mac='$mac' and shanghuid='$shang'");
if (!is_array($maclist)){
$macinfo=$db->getinfo("select top 1 id from mx_maclist where mac='$mac'");
$db->excu("insert into mx_shang_maclist (macid,shanghuid,biaoshi,mac,firsttime,mobile,renzhengtype,isrenzheng,ispop,zongrenum,isonline,mactype,createdate)values('$macinfo[id]','$shang','$biaoshi','$mac','$thistime','$mobile','1','1','1','1','1','0','$thistime')");
}
else{
$db->excu("update mx_shang_maclist set biaoshi='$biaoshi',firsttime='$thistime',mobile='$mobile',renzhengtype='1',isrenzheng='1',ispop='1',zongrenum=zongrenum+1,isonline='1',mactype='0' where mac='$mac' and shanghuid='$shang'");
}
$db->excu("update mx_sms_relog set isuse='1' where id='$reginfo[id]' and isuse='0'");
$db->excu("COMMIT TRANSACTION DEPS02_DEL");
echo "1";
}
}
elseif ($rentype==2){
$shang=trim($shang);
$mac=trim($mac);
$Rid=intval($Rid);
$yancode=trim($yancode);
//是否为空
if($Rid==0 or $mac=="" or strlen($mac)!=12 or $shang=="" or $yancode==""){echo "0";exit();}
//验证码
if(md5($mac."{mx}".$shang."{z}{w}".$Rid."{w}".$yancode."{w}")!=$sign){echo "0";exit();}
$reginfo=$db->getinfo("select top 1 * from mx_view_weixin_relog where shanghuid='$shang' and yancode='$yancode'");
if (!is_array($reginfo)){echo "0";exit();}
else{
$db->excu("BEGIN TRANSACTION DEPS02_DEL");
$thistime=date("Y-m-d H:i:s");
//更新mac认证
$db->excu("update mx_maclist set renzhengtype='2',isrenzheng='1',mobile='$mobile',firstrid='$Rid',firsttime='$thistime' where mac='$mac' and isrenzheng='0' ");
$maclist=$db->getinfo("select top 1 * from mx_shang_maclist where mac='$mac' and shanghuid='$shang'");
if (!is_array($maclist)){
$macinfo=$db->getinfo("select top 1 id from mx_maclist where mac='$mac'");
$db->excu("insert into mx_shang_maclist (macid,shanghuid,biaoshi,mac,firsttime,renzhengtype,isrenzheng,ispop,zongrenum,mactype,createdate)values('$macinfo[id]','$shang','$biaoshi','$mac','$thistime','2','1','1','1','0','$thistime')");
}
else{
$db->excu("update mx_shang_maclist set biaoshi='$biaoshi',firsttime='$thistime',renzhengtype='2',isrenzheng='1',ispop='1',zongrenum=zongrenum+1,mactype='0' where mac='$mac' and shanghuid='$shang'");
}
$db->excu("update mx_weixin_relog set isuse='1' where id='$reginfo[id]' and isuse='0'");
$db->excu("COMMIT TRANSACTION DEPS02_DEL");
echo "1";
}
}
elseif ($rentype==3){
$shang=trim($shang);
$mac=trim($mac);
$Rid=intval($Rid);
$username=trim($username);
$password=trim($password);
//是否为空
if($Rid==0 or $mac=="" or strlen($mac)!=12 or $shang=="" or $username==""or $password==""){echo "0";exit();}
//验证码
if(md5($mac."{mx}".$shang."{z}{w}".$Rid."{w}".$username."{w}")!=$sign){echo "0";exit();}
$reginfo=$db->getinfo("select top 1 * from mx_shanghu_wifiuser where wfiusername='$username' and wipassword='".md5($wipassword)."' and hanghuid='$shang'");
if (!is_array($reginfo)){echo "0";exit();}
else{
$db->excu("BEGIN TRANSACTION DEPS02_DEL");
$thistime=date("Y-m-d H:i:s");
//更新mac认证
$db->excu("update mx_maclist set renzhengtype='3',isrenzheng='0',mobile='$mobile',firstrid='$Rid',firsttime='$thistime' where mac='$mac' and isrenzheng='0' ");
$maclist=$db->getinfo("select top 1 * from mx_shang_maclist where mac='$mac' and shanghuid='$shang'");
if (!is_array($maclist)){
$macinfo=$db->getinfo("select top 1 id from mx_maclist where mac='$mac'");
$db->excu("insert into mx_shang_maclist (macid,shanghuid,biaoshi,mac,firsttime,renzhengtype,isrenzheng,ispop,zongrenum,mactype,createdate)values('$macinfo[id]','$shang','$biaoshi','$mac','$thistime','3','1','1','1','0','$thistime')");
}
else{
$db->excu("update mx_shang_maclist set biaoshi='$biaoshi',firsttime='$thistime',renzhengtype='3',isrenzheng='1',ispop='1',zongrenum=zongrenum+1,mactype='0' where mac='$mac' and shanghuid='$shang'");
}
$db->excu("update mx_weixin_relog set isuse='1' where id='$reginfo[id]' and isuse='0'");
$db->excu("COMMIT TRANSACTION DEPS02_DEL");
echo "1";
}
}
elseif ($rentype==99){
$shang=trim($shang);
$mac=trim($mac);
$Rid=intval($Rid);
//是否为空
if($Rid==0 or $mac=="" or strlen($mac)!=12 or $shang==""){echo "0";exit();}
//验证码
if(md5($mac."{mx}".$shang."{z}{w}".$Rid."{w}")!=$sign){echo "0";exit();}
//获取商户
$shanginfo=$db->getinfo("select top 1 * from mx_view_shanghu where id='$shang' and isok='1' and startdate<='".date("Y-m-d 23:59:59")."' and enddate>='".date("Y-m-d 00:00:00")."'");
if (!is_array($shanginfo)){
echo "0";exit();
}
//获取设备信息
$shebei=get_shebeiinfo_online($Rid," and shanghuid='$shanginfo[id]' and startdate<='".date("Y-m-d 23:59:59")."' and enddate>='".date("Y-m-d 00:00:00")."' and iscandoing='1'");
if (!is_array($shebei)){
echo "0";exit();
}
//判断是否在白名单或者黑名单中
if(strpos("##,".$shanginfo["whitelist"].",",",$mac,")){$iswhite=1;}
if(strpos("##,".$shanginfo["blacklist"].",",",$mac,")){$isbalck=1;}
if ($isbalck==1){
echo "0";exit();
}
//判断商家mac是否存在
$shangmac=$db->getinfo("select * from mx_shang_maclist where mac='$mac' and shanghuid='$shanginfo[id]'");
if (is_array($shangmac)){
if ($shangmac["isrenzheng"]==1 or $iswhite==1){
echo "1";exit();
}else{
echo "0";exit();
}
}
}
elseif ($rentype==999){
$shang=trim($shang);
$mac=trim($mac);
$Rid=intval($Rid);
//是否为空
if($Rid==0 or $mac=="" or strlen($mac)!=12 or $shang==""){echo "0";exit();}
//验证码
if(md5($mac."{mx}".$shang."{z}{w}".$Rid."{w}")!=$sign){echo "0";exit();}
//获取商户
$shanginfo=$db->getinfo("select top 1 * from mx_view_shanghu where id='$shang' and isok='1' and startdate<='".date("Y-m-d 23:59:59")."' and enddate>='".date("Y-m-d 00:00:00")."'");
if (!is_array($shanginfo)){
echo "0";exit();
}
//获取设备信息
$shebei=get_shebeiinfo_online($Rid," and shanghuid='$shanginfo[id]' and startdate<='".date("Y-m-d 23:59:59")."' and enddate>='".date("Y-m-d 00:00:00")."' and iscandoing='1'");
if (!is_array($shebei)){
echo "0";exit();
}
//判断是否在白名单或者黑名单中
if(strpos("##,".$shanginfo["whitelist"].",",",$mac,")){$iswhite=1;}
if(strpos("##,".$shanginfo["blacklist"].",",",$mac,")){$isbalck=1;}
if ($isbalck==1){
echo "0";exit();
}
//判断商家mac是否存在
$shangmac=$db->getinfo("select * from mx_shang_maclist where mac='$mac' and shanghuid='$shanginfo[id]'");
if (is_array($shangmac)){
if ($shangmac["isrenzheng"]==1 or $iswhite==1){
$db->excu("update mx_maclist set isonline='1' where mac='$mac' ");
$db->excu("update mx_shang_maclist set ispop='1',isonline='1' where id='$shangmac[id]'");
echo "1";exit();
}else{
echo "0";exit();
}
}
}
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。