<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<title>{echo admin_title()}</title>
<!--header-->
{template _:header}
<style>
.layui-tab {margin:-10px 0 15px 0;}
.layui-form-item .layui-input-inline {margin-right:0;}
#login {background:#EEE;}
#login-content {background:#FFF;width:300px;height:200px;padding:20px;position:absolute;top:50%;left:50%;margin-top:-135px;margin-left:-170px;}
</style>
</head>
<body id="login">
<div id="login-content">
	<div class="layui-tab layui-tab-brief">
		<ul class="layui-tab-title">
			<li class="layui-this"><h3>代理商登陆</h3></li>
		</ul>
	</div>
	<div class="layui-form layui-form-pane">
		<form name="theform" id="theform" method="post" action="{echo url('login/doLogin')}">
			<div class="layui-form-item">
				<label for="username" class="layui-form-label">代理编号：</label>
				<input type="text" name="agent_no" id="agent_no" class="layui-input layui-input-inline" style="width:188px">
			</div>
			<div class="layui-form-item">
				<label for="password" class="layui-form-label">代理密码：</label>
				<input type="password" name="password" id="password" class="layui-input layui-input-inline" style="width:188px">
			</div>
			<div class="layui-form-item" style="display:none;">
				<label for="verify" class="layui-form-label">验证码：</label><input type="verify" name="verify" id="verify" class="layui-input layui-input-inline">
			</div>
			<div class="layui-form-item" style="text-align:center;">
				<button type="submit" name="submit" value="login" id="submit" class="layui-btn layui-btn-fluid">立即登录</button>
			</div>
		</form>
	</div>
</div>
{template _:footer}
<script type="text/javascript">
$("#theform").ajaxForm({
	dataType: "json",
	timeout: 30000,
	data: {ajax:"json"},
	success: function(data){
		if(data.status == 0) {
			showAlert(data.message);
		} else {
			showInfo(data.message, function(){
				gotourl('{echo url('index/index')}');
			});
		}
	},
	error: function(xhr, status){
		console.log(xhr);
	},
	complete: function(){
		hideLoader();
	},
	beforeSend: function(){
		showLoader();
	}
});
</script>
</body>
</html>