<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>登录成功</title>
<link href="http://cdnjs.bootcss.com/ajax/libs/twitter-bootstrap/2.3.1/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="__CSS__/style.css">
</head>

<body>
<dl>
	<dt> <img src="__IMG__/qq.png" alt="" />
		<h2>使用<?php echo $medianame;?>账号登录成功</h2>
		<p>登录过程中本站绝不会获取您的<?php echo $medianame;?>密码，请放心使用</p>
	</dt>
	<dd class="quick_form">
		<form method="post" action ="/index.php?s=/Pub/Snslogin/reg" id="quick_form" class="form-horizontal">
			<input type="hidden" name="ac" value="quick_register">
			<input type='hidden' name='type' value='<?php echo $type;?>'>
			<input type='hidden' name='face' value='{$face}'>
			<input type='hidden' name='openid' value='<?php echo $openid;?>'>
			<label>网站昵称：
				<input name="uname" type="text" class="txt" value="<?php echo $username;?>"/>
				<span class='notice uname'></span> </label>
			<input type="button" value="直接登录" class="btn quick_register"/>
			<!--<input type="button" value="绑定账号" class="btn bind"/>
			<p class="notice">如果你选择直接登录，你将使用<?php echo $medianame;?>账号链接本网站。
				下次登录时如使用其他合作网站账号，网站将重新记录账号信息。因此，建议你选择绑定账号。只需一步，轻松实现。</p>-->
		</form>
	</dd>
	<dd class="bind_form">
		<ul>
			<li><a href="javascript:;">如果你没有本站账号</a></li>
			<li class="current">如果你有本站账号</li>
		</ul>
		<form method="post" action="index.php" id="bind_form">
			<input type="hidden" name="ac" value="bind">
			<input type='hidden' name='type' value='<?php echo $type;?>'>
			<input type='hidden' name='openid' value='<?php echo $openid;?>'>
			<label>用户名：
				<input name="uname"  class="txt" type="text">
				<span class='notice uname'> * </span> </label>
			<label>密 &nbsp; &nbsp;码：
				<input name="pwd"  class="txt" type="password">
				<span class='notice pwd'> * </span> </label>
			<input type="button" value="绑 定" class="btn bind"/>
			<input type="button" value="返 回" class="btn back"/>
		</form>
	</dd>
	<dd class="reg_form">
		<ul>
			<li class="current">如果你没有本站账号</li>
			<li><a href="javascript:;">如果你有本站账号</a></li>
		</ul>
		<form method="post" action="index.php" id="reg_form">
			<input type="hidden" name="ac" value="reg">
			<input type='hidden' name='type' value='<?php echo $type;?>'>
			<input type='hidden' name='openid' value='<?php echo $openid;?>'>
			<label>用户名：
				<input name="uname"  class="txt" type="text" value="<?php echo $uname;?>">
				<span class='notice uname'> * </span> </label>
			<label>密 &nbsp; &nbsp;码：
				<input name="pwd"  class="txt" type="password">
				<span class='notice pwd'> * </span> </label>
			<label>邮 &nbsp; &nbsp;箱：
				<input name="email"  class="txt" type="text">
				<span class='notice email'></span> </label>
			<input type="button" value="注 册" class="btn reg"/>
			<input type="button" value="返 回" class="btn back"/>
		</form>
	</dd>
</dl>
<script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>

<script type="text/javascript">
window.onerror=function(){return true;}
$(document).ready(function(){ 
	try{
		$('.quick_register').click(function(){
			$.post(
				'/index.php?s=/Pub/Snslogin/checkuser',
				{
					uname:$('[name="uname"]').val()
				},
				function(data){
					if(data.status==1){
						$('#quick_form .uname').html(data.info);
					}else{
						$('#quick_form').submit();	
					}
				}
			);
		});	
		$('.quick_form .bind').click(function(){
			$('.bind_form').show();
			$('.reg_form').hide();
			$('.quick_form').hide();
		});
		$('li a').click(function(e) {
			$('.bind_form,.reg_form').show();
			$(this).closest('dd').hide();
		});
		$('.back').click(function(){
			$('dd').hide();
			$('.quick_form').show();
		});
		$('[name="uname"],[name="pwd"]').focus(function(e) {
			$(this).next('.notice').html(' * ');
		});
		$('.bind_form .bind').click(function(e) {
			if($.trim($('.bind_form [name="uname"]').val())==""){
				$('.bind_form .uname').html(' * 用户名不能为空');	
				return false;
			}
			if($.trim($('.bind_form [name="pwd"]').val())==""){
				$('.bind_form .pwd').html(' * 密码不能为空');
				return false;	
			}
			$.post(
				'index.php',
				{a:'chkbind',uname:$('.bind_form [name="uname"]').val(),pwd:$('.bind_form [name="pwd"]').val()},
				function(data){
					if(data=='-1'){
						$('.bind_form .uname').html(' * 用户名不存在');
					}else if(data=='-2'){
						$('.bind_form .pwd').html(' * 密码错误');
					}else{
						$('#bind_form').submit();	
					}
				}
			);
			
		});
		$('.reg_form .reg').click(function(e) {
			if($.trim($('.reg_form [name="uname"]').val())==""){
				$('.reg_form .uname').html(' * 用户名不能为空');	
				return false;
			}
			if($.trim($('.reg_form [name="pwd"]').val())==""){
				$('.reg_form .pwd').html(' * 密码不能为空');	
				return false;
			}
			$.post(
				'index.php',
				{a:'chkreg',uname:$('.reg_form [name="uname"]').val()},
				function(data){
					if(data=='false'){
						$('.reg_form .uname').html(' * 用户名已存在');
					}else{
						$('#reg_form').submit();	
					}
				}
			);
			
		});
	}catch(e){}
});
</script>
</body>
</html>