<?php include _include(APP_PATH.'view/htm/header.inc.htm');?>

<!--{hook user_create_start.htm}-->
<div class="row">
<div class="login-1">
	<div class="login-2">
	<form action="<?php echo url('user-create');?>" method="post" id="form"  class="login-3">
			<div class="login-4">
				欢迎注册umbbs
				<!--{hook user_login_title_after.htm}-->
			</div>
			<div class="login-4-1">
					<div class="login-5">
					email
					</div>
					<div class="login-6">
					<div class="login-7">
						<input type="email" class="form-control" placeholder="<?php echo lang('email');?>" name="email" id="email" required>
					</div>
					</div>
					</div>
					
					<!--{hook user_create_email_after.htm}-->
					<div class="login-4-1">
					<div class="login-5">
					昵称
					</div>
					<div class="login-6">
					<div class="login-7">
						<input type="text" class="form-control" placeholder="<?php echo lang('username');?>" name="username" id="username">
					</div>
					</div>
					</div>
					<!--{hook user_create_username_after.htm}-->
					<div class="login-4-1">
					<div class="login-5">
					密码
					</div>
					<div class="login-6">
					<div class="login-7">
					
								<input type="password" class="form-control" placeholder="<?php echo lang('password');?>" name="password" id="password">
							</div>
						</div>
					</div>
					
					<!--{hook user_create_password_after.htm}-->

					<div class="login-4-1">
						<button type="submit" class="btn btn-primary btn-block  btn-block-2" id="submit" data-loading-text="<?php echo lang('submiting');?>..." <?php if($conf['user_create_email_on']) { ?>disabled<?php } ?>><?php echo lang('next_step');?></button>
					</div>
					<!--{hook user_create_submit_after.htm}-->
					
							<!--{hook user_create_form_footer_left.htm}-->
					
					<div class="login-9">
							<!--{hook user_create_form_footer_right_start.htm}-->
							<a href="<?php echo url('user-login');?>" class="text-muted-5">已有账户？立即登陆</a>
							<?php if(!empty($conf['user_resetpw_on'])) { ?>
							<a href="<?php echo url('user-resetpw');?>" class="text-muted-5 ml-3"><?php echo lang('forgot_pw');?></a>
							<?php } ?>
							<!--{hook user_create_form_footer_right_end.htm}-->
						</div>
						</form>
					</div>

		<!--{hook user_create_card_after.htm}-->
</div>
</div>
<!--{hook user_create_end.htm}-->

<?php include _include(APP_PATH.'view/htm/footer.inc.htm');?>

<script src="<?php echo $conf['view_url'];?>js/md5.js"></script>

<script>
var jform = $('#form');
var jsubmit = $('#submit');
var jsend = $('#sendcode');
var referer = '<?php echo http_referer();?>';
jsend.on('click', function() {
	jform.reset();
	jsend.button('loading');
	var postdata = jform.serialize();
	$.xpost(jsend.attr('action'), postdata, function(code, message) {
		if(code == 0) {
			$('#code').focus();
			var t = 60; // 倒计时
			jsend.button('<?php echo lang('user_send_sucessfully');?> 60 ');
			jsubmit.button('reset');
			// 倒计时，重新发送
			var handler = setInterval(function() {
				jsend.button('<?php echo lang('user_send_sucessfully');?> '+(--t)+' ');
				if(t == 0) {
					clearInterval(handler);
					jsend.button('reset');
				}
			}, 1000);
		} else if(code < 0) {
			$.alert(message, -1);
			jsend.button('reset');
		} else {
			jform.find('[name="'+code+'"]').alert(message).focus();
			jsend.button('reset');
		}
	});
	return false;
});

jform.on('submit', function() {
	var postdata = jform.serializeObject();
	jsubmit.button('loading');
	postdata.password = $.md5(postdata.password);
	$.xpost(jform.attr('action'), postdata, function(code, message) {
		if(code == 0) {
			jsubmit.button(message).delay(1000).location(referer);
		} else if(xn.is_number(code)) {
			alert(message);
			jsubmit.button('reset');
		} else {
			jform.find('[name="'+code+'"]').alert(message).focus();
			jsubmit.button('reset');
		}
	});
	return false;
});

</script>
<script>
$('li[data-active="fid-00"]').addClass('active');
</script>
<!--{hook user_create_js.htm}-->