<?php $base_url = base_url(); ?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>Đăng nhập |SBG</title>

		<meta name="description" content="User login page" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />

		<!-- basic styles -->

		<link href="<?php echo $base_url;?>assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="<?php echo $base_url;?>assets/css/font-awesome.min.css" />

		<link rel="stylesheet" href="<?php echo $base_url;?>assets/css/ace-fonts.css" />

		<!-- ace styles -->

		<link rel="stylesheet" href="<?php echo $base_url;?>assets/css/ace.min.css" />
		<link rel="stylesheet" href="<?php echo $base_url;?>assets/css/ace-rtl.min.css" />

		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="<?php echo $base_url;?>assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->

		<!--[if lt IE 9]>
		<script src="<?php echo $base_url;?>assets/js/html5shiv.js"></script>
		<script src="<?php echo $base_url;?>assets/js/respond.min.js"></script>
		<![endif]-->
	</head>

	<body class="login-layout">
		<div class="main-container">
			<div class="main-content">
				<div class="row">
					<div class="col-sm-10 col-sm-offset-1">
						<div class="login-container">

							<div class="space-6"></div>

							<div class="position-relative">
								<div id="login-box" class="login-box visible widget-box no-border">
									<div class="widget-body">
										<div class="widget-main">
											<h4 class="header blue lighter bigger">
												<i class="icon-cloud-upload green"></i>
												SBGOnline Administration |<small>Đăng nhập</small>
											</h4>

											<form action="<?php echo $base_url;?>admin/home/login" id="frmLogin" method="POST">
												<fieldset>
													<label class="block clearfix has-error">
														<div class="help-block">
														<?php 
															if($this->session->flashdata('login_error')){
																//echo 'Sai username hoặc password!';
																echo lang('_SBG_ADMIN_LOGIN_FAIL_MSG');
															}
														?>
														</div>
													</label>
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" name="login_name" class="form-control" placeholder="Tài khoản" />
															<i class="icon-user"></i>
														</span>
														<div class="help-block"> </div>
													</label>

													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="password" name="passwd" class="form-control" placeholder="Mật khẩu" />
															<i class="icon-lock"></i>
														</span>
														<div class="help-block"> </div>
													</label>

													<div class="space"></div>

													<div class="clearfix">
														<label class="inline">
															<input type="checkbox" class="ace" />
															<span class="lbl"> Ghi nhớ</span>
														</label>
															<!--a href="index.htm" title=""-->
															<button type="submit" name="submit" id="login-button" class="pull-right btn btn-sm btn-primary">
																<i class="icon-key"></i>
																Đăng nhập
															</button>
														<!--/a-->
													</div>

													<div class="space-4"></div>
												</fieldset>
											</form>
										</div><!-- /widget-main -->
									</div><!-- /widget-body -->
								</div><!-- /login-box -->

							</div><!-- /position-relative -->
						</div>
					</div><!-- /.col -->
				</div><!-- /.row -->
			</div>
		</div><!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->

		<script type="text/javascript">
			window.jQuery || document.write("<script src='<?php echo $base_url;?>assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
		</script>
		<script src="<?php echo $base_url;?>assets/js/bootstrap.min.js"></script>
		<script src="<?php echo $base_url;?>assets/js/jquery.validate.min.js"></script>
		
		<script src="<?php echo $base_url;?>assets/js/ace-elements.min.js"></script>
		<script src="<?php echo $base_url;?>assets/js/ace.min.js"></script>
		<!-- <![endif]-->

		<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='/assets/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
</script>
<![endif]-->

		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='<?php echo $base_url;?>assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>

		<!-- inline scripts related to this page -->

		<script type="text/javascript">
			function show_box(id) {
			 jQuery('.widget-box.visible').removeClass('visible');
			 jQuery('#'+id).addClass('visible');
			}
			$('#frmLogin').validate({
				errorElement: 'label',
				errorClass: 'help-block',
				focusInvalid: true,
				rules: {
					passwd: {
						required: true,
					},
					login_name: {
						required: true
					}
				},
		
				messages: {
					login_name: {
						required: "Chưa nhập tài khoản admin",
					},
					passwd: {
						required: "Vui lòng nhập mật khẩu.",
					}
				},

				highlight: function (e) {
					$(e).closest('label').removeClass('has-info').addClass('has-error');
				},
		
				success: function (e) {
					$(e).closest('label').removeClass('has-error').addClass('has-info');
					$(e).remove();
				},
			});
		</script>
	</body>
</html>
