<!doctype html>
<html lang="zh_CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"  />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="{?$saxue_sitename?}">
<title>{?$saxue_sitename?}手机版</title>
<link rel="stylesheet" href="{?$saxue_skin_url?}/css/touch-app.css" />
<link rel="apple-touch-startup-image" href="{?$saxue_skin_url?}/images/320x460.png" />
<link rel="apple-touch-icon" apple-touch-icon-precomposed="false" sizes="57x57" href="{?$saxue_skin_url?}/images/cover.png"/>
<script src="{?$saxue_skin_url?}/js/zepto.min.js"></script>
<script src="{?$saxue_skin_url?}/js/app.js"></script>
<script>(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(d.href.indexOf("http")||~d.href.indexOf(e.host))&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone")</script>
</head>
<body>
<div class="ui-container">
    <header>
        <div class="ui-header-bar">
			<a class="ui-return" href="javascript:" title="返回上一页"></a>
            <div class="ui-pagetitle">注册</div>
            <a href="/" class="ui-righthome" title="返回首页"></a>
        </div>
    </header>
	<section class="ui-articles-container">
		<form class="form cf" name="formreg" id="formreg">
			<input type="hidden" name="vcode" value="1">
			<input type="hidden" name="action" value="newuser">
			<fieldset>
				<div class="frow">
					<label class="col4 flabel">用户名：</label>
					<div class="col8 last">
						<input type="text" class="text" maxlength="30" style="width:160px" name="uname">
					</div>
				</div>
				<div class="frow">
					<label class="col4 flabel">密　码：</label>
					<div class="col8 last">
					<input type="password" class="text" maxlength="20" style="width:160px" name="password">
					</div>
				</div>
				<div class="frow">
					<label class="col4 flabel">确认密码：</label>
					<div class="col8 last">
					<input type="password" class="text" maxlength="20" style="width:160px" name="repassword">
					</div>
				</div>
				<div class="frow">
					<label class="col4 flabel">邮箱：</label>
					<div class="col8 last">
					<input type="text" class="text" maxlength="30" style="width:160px" name="email">
					</div>
				</div>
				<div class="frow">
					<button type="button" class="btn btn-primary btn-large" id="clkreg" name="submit">注　册</button>
				</div>
				<div class="frow foot">
					<a href="login.php">已有账号？请点击登录</a>
				</div>
			</fieldset>
		</form>
	</section>
</div>
{?include file = "footer.html"?}
<script>
$(function(){
	var doreg = false;
	$("#clkreg").tap(function () {
		if(doreg) return;
		doreg = true;
		$.post('register.php', $('#formreg').serialize(), function(res){
			var reff='{?$jumpurl?}';
			if(reff=='' || reff==window.location.href){
				reff='/member/';
			}
			if(res.flag==0) {
				dologin = false;
				popTip(res.msg);
				return false;
			}else if(data.flag == 1){
				popTip('注册成功，请使用注册邮箱激活帐号');
			}else if(data.flag == 2){
				popTip('注册成功，等待管理员审核帐号');
			}else if(data.flag == 3){
				popTip('注册成功，激活邮件发送失败，请联系管理员审核帐号');
			}else{
				popTip('注册完成，请牢记您的帐号和密码');
			}
			setTimeout(function(){window.location.href=reff}, 3000);
		}, 'json')
    })
})
</script>
</body>
</html>