<?php

/**
 * usergetpw2.php
 *
 * @version       v0.01
 * @create time   2011-5-30
 * @update time   
 * @author        wiipu
 * @copyright     Copyright (c) 寰櫘绉戞妧 WiiPu Tech Inc. ( http://www.wiipu.com)
 * @informaition  

 * Update Record:
 *
 */

	define('THISPATHROOT', str_replace('ui/3g/usergetpw2.php', '', str_replace('\\', '/', __FILE__)));
	require_once(THISPATHROOT.'include/db_conn.php');
	
	$account=sqlReplace(trim($_GET['account']));
	$vercode=sqlReplace(trim($_GET['vercode']));
	$result=$wiibbsUser->getUserByVercode($account,$vercode);
	if(!$result)
	{
		alertInfo3g($_['tip_expired']);
	}
	$header_title=$_['text_forgetPwd'];
	require_once('htmltop.php');
?>
<body> 
<script type="text/javascript">
	function jqmSimpleMessage(message) {
		$("<div class='ui-loader ui-overlay-shadow ui-body-b ui-corner-all'><h1>" + message + "</h1></div>")
			.css({
				display: "block",
				opacity: 0.96,
				top: window.pageYOffset+100
			})
			.appendTo("body").delay(800)
			.fadeOut(1500, function(){
				$(this).remove();
			});
	}
	$(document).ready(function(){
		$("#submit").click(function(){
			var name=$("#account").val();
			var vercode=$("#vercode").val();
			var pwd1=$("#pwd1").val();
			var pwd2=$("#pwd2").val();
			if (pwd1==''){ 
				jqmSimpleMessage('<?php echo $_['alert_forgetPw21']?>');
				return false;
			}
			if (pwd2==''){
				jqmSimpleMessage('<?php echo $_['alert_forgetPw22'];?>');
				return false;
			}else if (pwd1!=pwd2){
				jqmSimpleMessage('<?php echo $_['alert_forgetPw23'];?>');
				return false;
			}	
			$.ajax({
				url:"usergetpw_do.php",
				type:'post',
				data:{
					account:name,
					'vercode':vercode,
					act:'step2',
					'pwd1':pwd1,
					'pwd2':pwd2
				},
				success:function(rt){
					if (rt=="S"){
						jqmSimpleMessage('<?php echo $_['suc_forgetPw2'];?>');
						location.href='login.php';
						
					}else if (rt=="E"){
						jqmSimpleMessage('<?php echo $_['error_forgetPw2'];?>');
					}
				}
			});
			return false;
		});
	});
</script>
<div data-role="page" id="album-list">

	<div data-role="header" data-position="fixed" data-theme="b">
		<a href="index.html" data-rel="back"><?php echo $_['btn_goback'];?></a>
		<h1><?php echo $_['text_forgetPwd']?></h1>
		<a href="register.php" data-icon="arrow-r" data-iconpos="right" data-ajax="false"><?php echo $_['btn_register'];?></a>
	</div>
	<div data-role="content">
		<form action="usergetpw_do.php?act=step2" method="post" data-ajax="false">
			<div data-role="fieldcontain">
				<label for="name"><?php echo $_['text_newPwd']?>锛?/label>
				<input type="password" name="pwd1" id="pwd1" />
			</div>
			<div data-role="fieldcontain">
				<label for="name"><?php echo $_['text_confirmPwd']?>锛?/label>
				<input type="password" name="pwd2" id="pwd2" />
				<input type="hidden" name="account" value='<?php echo $account;?>' id="account"/>
				<input type="hidden" name="vercode" value='<?php echo $vercode;?>' id="vercode" />
			</div>
			<div data-role="fieldcontain">
				<label for="name"> </label>
				<input type="submit" data-theme="b" data-inline="true" value="<?php echo $_['btn_submit']?>" id="submit"/>
			</div>
		
		</form> 
	</div><!-- /content -->	
	<div data-role="footer" data-position="fixed">
		<?php require_once('bottom.php');?>
	</div><!-- /footer -->
	
</div><!-- /page -->


</body>
<?php
	require_once(ROOT_PATH.'include/htmlbottom.php');
?>