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

<!--{hook user_login_start.htm}-->
<style>
	 @media (max-width:576px) {
    #body{
    padding-top: 0;
    
    }
	#footer{
		display: none;
	}
    .navbar{
        display: none;
    }
	.bottom-nav{
		display: none;
	}
    }
</style>
<div class="row">
	<div class="col-lg-8 mx-auto">
		
		<div class="card overflow-hidden mb-0">
			
			<div class="card-body p-0 ajax_modal_body">
				<div class="row">
					<!-- 380*370 -->
					<div class="col-6 p-5 background hidden-sm hidden-md"  <?php if ($light_config['login_page_banner'] != '') { ?> style="background-image: url('<?php echo $light_config['login_page_banner'] ;?>');"<?php }else{?>style="background-image: url('./plugin/zaesky_theme_light/view/img/login_bg.png');"<?php }?>>
						<!-- <div>
							<p class="h3">一条长长长长长长长长的slogan</p>
							<p class="">一条短的副标题</p>
						</div> -->
					</div>
					<div class="col-lg-6 login-card-right" >
						<div class="login-card-right-bg">

						</div>
						<div class="mt-5">
						<div class="lead text-gray"><?php echo lang('user_login');?></div>
							<div class="h2 mt-2"><i class="fa fa-user-circle"></i> <?php echo lang('welcome_back');?></div>
						</div>
						<div class="mt-2">
							<!--{hook user_login_title_after.htm}-->
						</div>
						<div class="my-5">
						<form action="<?php echo url('user-login');?>" method="post" id="form">
							<div class="form-group input-group">
								<div class="input-group-prepend">
									<span class="input-group-text"><i class="icon icon-user icon-fw"></i></span>
								</div>
								<input type="text" class="form-control" placeholder="<?php echo lang('email');?>" id="email" name="email">
								
							</div>
							<div class="invalid-feedback"></div>
							<!--{hook user_login_email_after.htm}-->
							<div class="form-group input-group">
								<div class="input-group-prepend">
									<span class="input-group-text"><i class="icon icon-lock icon-fw"></i></span>
								</div>
								<input type="password" class="form-control" placeholder="<?php echo lang('password');?>" id="password" name="password">
							</div>
							<div class="invalid-feedback"></div>
							<!--{hook user_login_password_after.htm}-->
							<div class="form-group">
								<button type="submit" class="btn btn-primary btn-lg btn-block" id="submit" data-loading-text="<?php echo lang('submiting');?>..."><?php echo lang('login');?></button>
							</div>
							<!--{hook user_login_submit_after.htm}-->
							<div class="media mt-4">
								<div>
									<!--{hook user_login_form_footer_left.htm}-->
								</div>
								<div class="media-body text-right">
									<!--{hook user_login_form_footer_right_start.htm}-->
									<a href="<?php echo url('user-create');?>" class="text-muted"><small><?php echo lang('user_create');?></small></a>
									<?php if(!empty($conf['user_resetpw_on'])) { ?>
									<a href="<?php echo url('user-resetpw');?>" class="text-muted ml-3"><small><?php echo lang('forgot_pw');?></small></a>
									<?php } ?>
									<!--{hook user_login_form_footer_right_end.htm}-->
								</div>
							</div>
						</form>
					</div>
					<a class="text-primary text-center d-block" href="./"><i class="el-icon-back"></i> 暂不登录，随便逛逛</a>

					</div>
				</div>
				
			</div>
		</div>
		<!--{hook user_login_card_after.htm}-->
	</div>
</div>


<!--{hook user_login_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 jemail = $('#email');
var jpassword = $('#password');
var referer = '<?php echo $referer;?>';
jform.on('submit', function() {
	jform.reset();
	jsubmit.button('loading');
	var postdata = jform.serializeObject();
	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');
		}
		/*
		if(code == 0) {
			jsubmit.button(message).delay(1000).location(referer);
		} else if(code == 'email') {
			jemail.alert(message).focus();
			jsubmit.button('reset');
		} else if(code == 'password') {
			jpassword.alert(message).focus();
			jsubmit.button('reset');
		} else {
			alert(message);
			jsubmit.button('reset');
		}*/
	});
	return false;
});

</script>

<!--{hook user_login_js.htm}-->