<?php
error_reporting(0); 
include("../../config/config.php");
$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;
}
if($reg==0){echo err();}
?>
<!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="text" name="nikname" 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>
<?php if($yqmkg==1){?>
<div class="kit-login-row">
<div class="kit-login-col">
<span class="kit-login-input">
<input type="text" name="yqm" placeholder="邀请码" required lay-verify="required" >
</span>
</div>
</div>
<?php }?>
<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;">
<a href="index<?php echo $dshz?>" style="color: rgb(153, 153, 153); text-decoration: none; font-size: 13px;" id="forgot">已有账号，返回登录</a>
</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(3, {
shade: [0.1,'#fff'] 
});
$.ajax({
type:'POST',
url:'/regpost<?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='/index<?php echo $dshz?>';
}
});
}else{
layer.closeAll('loading');
layer.msg(result.msg);
}
}	
});
return false;
});
});
</script>
</body>
</html>