<?php
error_reporting(0); 
$installfile='../../config/houzhi-lock.txt';
include("../../config/config.php");
if(file_exists($installfile)){
$agent = $_SERVER['HTTP_USER_AGENT'];
if(strpos($agent,"Android") || strpos($agent,"iPhone") || strpos($agent,"iPad") || strpos($agent,"MIDP-2.0") || strpos($agent,"Opera Mini") || strpos($agent,"UCWEB") || strpos($agent,"NetFront") || strpos($agent,"Windows CE") || strpos($agent,"SymbianOS")){ 
echo "<script>location.href='/m$dshz'</script>";
exit;
}
include("../../config/conn.php");
include("../../config/common.php");

}else{ 
echo "<script>location.href='/install/'</script>";
exit;
}

?>
<!DOCTYPE html>
<html lang="ZH-cn">
<head>
<meta charset="gb2312">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><?php echo $name?></title>
<link rel="stylesheet" href="/layui/css/layui.css">
<link rel="stylesheet" href="/2019newui/qiantai/css/login.css">
<SCRIPT language=javascript src="/2019newui/js/jquery.min.js"></SCRIPT>
</head>
<body>
<div class="kit-login">
<div class="kit-login-bg"></div>
<div class="kit-login-wapper">
<h2 class="kit-login-slogan">欢迎登录 <br> <?php echo $name?></h2>
<div class="kit-login-form">
<h4 class="kit-login-title">代理登录</h4>
<form class="layui-form layui-form-pane" action="" method="post" name="FormInfo" id="FormInfo">
<div class="kit-login-row">
<div class="kit-login-col">
<span class="kit-login-input">
<input type="text" name="name" placeholder="代理账号" required lay-verify="required" >
</span>
</div>
</div>
<div class="kit-login-row">
<div class="kit-login-col">
<span class="kit-login-input">
<input type="password" name="pass" placeholder="代理密码" required lay-verify="required" >
</span>
</div>
</div>
<div class="kit-login-row">
<button class="layui-btn kit-login-btn"  lay-submit="" lay-filter="FormInfo">代理登录</button>
</div>
<div class="kit-login-row" style="margin-bottom:0;">
<?php if($reg==1){?><a href="reg<?php echo $dshz?>" style="color: rgb(153, 153, 153); text-decoration: none; font-size: 13px;" id="forgot">注册账号</a><?php }?>
</div>
</form>
</div>
</div>
</div>
<script src="/layui/layui.js"></script>
<script>
layui.use(['form', 'layedit', 'laydate', 'element', 'jquery', 'layer'], function(){
var form = layui.form
,layer   = layui.layer
,layedit = layui.layedit
,element = layui.element
,$= layui.jquery
,laydate = layui.laydate;
form.on('submit(FormInfo)', function (data) {
var index = layer.load(4, {
shade: [0.1,'#fff'] 
});
$.ajax({
type:'POST',
url:'/loginpost<?php echo $dshz?>',
data:$("#FormInfo").serialize(),
dataType:'json',
success:function(result){
if(result.status == 'true'){
layer.closeAll('loading');
layer.open({
type: 1
,offset: 'auto'
,id: 'layerMsg'
,content: '<div style="padding: 20px 100px;">登录成功</div>'
,btn: '确定'
,btnAlign: 'c'
,shade: 0
,closeBtn: 0
,yes: function(index){
location.href=result.url;
}
});
}else{
layer.closeAll('loading');
layer.msg(result.msg);
}
}	
});
return false;
});
});
</script>
</body>
</html>