<{import file="index/header.html" title="电话修改"}>
<div class="tab"><a href="?m=user&a=safe" class="ch">电话修改</a></div>
<div class="lbox">
	<form action="#" method="post">
		<table width="100%" class="etable">
			<tr>
				<td width="120">新号码 </td>
				<td><input type="text" name="mobile" id="mobile" value=""/></td>
			</tr>
			<tr>
				<td>验证码：</td>
				<td>
					<input type="text" name="vcode" id="vcode" size="10"/>
					<img id="vcode_img" src="index.php?m=ajax&a=vcode"/>
					<a href="javascript:;" class="refreshImg" onClick="freshVcode()"></a>
				</td>
			</tr> 
			<tr>
				<td>短信验证码：</td>
				<td>
					<input type="text" name="sms_code" class="reg_input2" id="sms_code" placeholder="手机验证码"/>
					<input id="zphone" type="button" value="获取手机验证码">
				</td>
			</tr> 
			<tr>
				<td>&nbsp; </td>
				<td><input type="submit" name="submit" class="submit" value="保存"/></td>
			</tr>
		</table>  
	</form> 	
</div> 
<{include file="index/footer.html"}>
<script type="text/javascript">
$(function(){
	$("form").submit(function(){
		var mobile = $("#mobile").val(); 
		var sms_code = $("#sms_code").val();
		$.post('?m=user&a=mobile_update_act',{mobile:mobile, sms_code:sms_code},function(data){
			if(data == '1'){
				alert('修改成功');
				location.href="?m=user&a=mobile";
			}else{
				alert(data);
			}
		});
		return false;
	});
	// 获得验证码 
	$("#zphone").click(function(){  
		var mobile = $('#mobile').val();
		var vcode = $('#vcode').val(); 
		send_sms(mobile, vcode, '#zphone');
	});
});
</script>