<template include="./plugin/hfdr_umbbs/overwrite/view/htm/my.common.template.htm">
	<slot name="my_body">
	
<div class="card1 card-threadlist border-1">
			<div class="col-md-06">
			<div class="col-md-07">	
	
	

			<form action="<?php echo url('my-password');?>" method="post" id="form">
				<div class="setting-input-1 ivu-form-item">
					<div class="ivu-form-item-label">当前密码</div>
					<input type="password" class="ivu-form-item-content-1 ivu-input" id="password_old" name="password_old" placeholder="<?php echo lang('password_old');?>" required="">
					<div class="invalid-feedback"></div>
				</div>
				
				<div class="setting-input-1 ivu-form-item">
						<div class="ivu-form-item-label">新密码</div>
					<input type="password" class="ivu-form-item-content-1 ivu-input" id="password_new" name="password_new" placeholder="<?php echo lang('password_new');?>" required="">
					<div class="invalid-feedback"></div>
				</div>
				
				<div class="setting-input-1 ivu-form-item">
						<div class="ivu-form-item-label">重复密码</div>
					<input type="password" class="ivu-form-item-content-1 ivu-input" id="password_new_repeat" name="password_new_repeat" placeholder="<?php echo lang('password_new_repeat');?>" required="">
					<div class="invalid-feedback"></div>
				</div>
				<div class="ivu-form-item-content">
					<button type="submit" class="btn-primary btn-6-1 btn-secondary" id="submit" data-loading-text="<?php echo lang('submiting');?>...">提交</button>
				</div>
			</form>
		
		</div>
		</div>
		</div>
	</slot>
</template>

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

<script>
$('a[data-active="my"]').addClass('active');
$('a[data-active="my-password"]').addClass('active');
</script>
<script>
$('li[data-active="fid-00"]').addClass('active');
</script>
<script>
var jform = $('#form');
var jsubmit = $('#submit');
jform.on('submit', function() {
	jform.reset();
	jsubmit.button('loading');
	var postdata = jform.serializeObject();
	postdata.password_old = $.md5(postdata.password_old);
	postdata.password_new = $.md5(postdata.password_new);
	postdata.password_new_repeat = $.md5(postdata.password_new_repeat);
	$.xpost(jform.attr('action'), postdata, function(code, message) {
		if(code == 0) {
			$.alert(message);
			jsubmit.button(message).delay(3000).button('reset');
		} 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>