<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta content="zh-cn" http-equiv="Content-Language" />
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
		<meta name="renderer" content="webkit"/>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0,  user-scalable=no"/>
		<title>{%$lngpack.sitename%}</title>
		<meta name="keywords" content="{%$lngpack.keyword%}" />
		<meta name="description" content="{%$lngpack.description%}" />
		<link rel="icon" type="image/png" href="{%$icon_16%}" sizes="16x16"/>
		<link rel="icon" type="image/png" href="{%$icon_32%}" sizes="32x32"/>
		<link rel="icon" type="image/png" href="{%$icon_64%}" sizes="64x64"/>
		<link href="{%$rootpath%}css/bootstrap.css" rel="stylesheet" type="text/css" />
		<link href="{%$rootpath%}css/espcmsp8_font.css" rel="stylesheet" type="text/css" />
		<link href="{%$rootpath%}css/swiper.min.css" rel="stylesheet" type="text/css" />
		<link href="{%$rootpath%}css/espcmsp8_all.css" rel="stylesheet" type="text/css" />
		<link href="{%$rootpath%}css/espcms_p8_public.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/jquery.min.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/bootstrap.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/swiper.min.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/espcms_base.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/espcms_formvalidation.js"></script>
		<script type="text/javascript" src="{%$rootdir%}espcms_includes/js/espcms_dialog.js"></script>
		<script type="text/javascript">
			var InterValObj;
				var curCount = {%$curCount%}
			;
			$(window).load(function () {
				$("#checkmobliesend").espcms_formvalidation({
					focusName: "#mobile",
					verifyURL: "{%$mlink.verify%}",
					verifyQueryString: "userid={%$member.userid%}",
					verifyField: "mobile",
					display_icon_err: false
				});
				$('#moblie_invitation').unbind('click').bind('click', function () {
					var mobile = $('#mobile').val();
					if (!espcms_match(mobile, '^1[0-9]{10}$')) {
					$('#mobile').focus();
						return false;
					}
					curCount = {%$curCount%};

					$(this).attr("disabled", "true");
					$(this).text("Regain verification code after " + curCount + " second");
					InterValObj = window.setInterval(SetRemainTime, 1000);

					$.ajax({
						type: "post",
						url: '{%$mlink.vercode%}',
						data: {'mobile': mobile},
						dataType: 'json',
						success: function (data) {
							if (data.code == 'false') {
								window.clearInterval(InterValObj);
								$("#moblie_invitation").removeAttr("disabled");
								$('#moblie_invitation').text("GetVlCode");
							}
						}
					});
				});
			});
			function SetRemainTime() {
				if (curCount == 0) {

					window.clearInterval(InterValObj);
					$("#moblie_invitation").removeAttr("disabled");
					$('#moblie_invitation').text("GetVlCode");
				} else {
					curCount--;
					$('#moblie_invitation').text("Regain verification code after " + curCount + " second");
				}
			}
		</script>
	</head>

	<body>
		{%link file="public/head.html"%}
		<section class="bann_container">
			<div class="container page_bann_title">
				<h2>Member Center</h2>
			</div>
		</section>

		<section class="container espcms_page_book">
			<div class="row">
				<div class="espcms_member_login">
					<div class="panel panel-info">
						<div class="panel-heading"><h3>Cell phone number binding</h3></div>
						<div class="panel-body">
							<form name="checkmobliesend" id="checkmobliesend" method="post" class="form-horizontal admin-form" action="{%$mlink.binding_save%}">
								<input type="hidden" name="tokenname" value="{%$tokenkey.token_name%}"/>
								<input type="hidden" name="tokenkey" value="{%$tokenkey.token_key%}"/>
								<div class="form-group">
									<label class="col-sm-2 control-label">ID</label>
									<div class="col-sm-9 pt6">{%$member.username%}</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">E-mail</label>
									<div class="col-sm-9 pt6">{%$member.email%}</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">Moblie</label>
									<div class="col-sm-9">
										<input type="text" name="mobile" id="mobile" value="{%$member.mobile%}" class="form-control" data-validation="^1[\d]{10}$"  placeholder="Please enter 11 mobile phone number" title="Please enter 11 mobile phone number" data-validation-msg="Sorry: The phone number was entered incorrectly, please re-enter!" validation-warning="Sorry: the phone number already exists"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">Verification Code</label>
									<div class="col-sm-9">
										<input type="text" name="mobliesn" class="form-control" id="mobliesn" maxlength="6" placeholder="Please enter a 6-digit verification code" title="Please enter a 6-digit verification code" data-validation="^[\w]{6}$" data-validation-msg="Sorry, the phone verification code is entered incorrectly, please go back and re-enter!"/>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label"></label>
									<div class="col-sm-9"><button type="button" id="moblie_invitation" class="btn btn-warning">GetVlCode</button></div>
								</div>
								<div class="form-group">
									<div class="col-sm-offset-2 col-sm-9">
										<input type="submit" class="btn btn-success btn-block" formmethod="POST" value="Confirm binding mobile phone"/>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</section>
		{%link file="public/footer.html"%}
	</body>
</html>