<?php $base_url = base_url();?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>SBG Online</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" />
                <link rel="stylesheet" href="<?php echo $base_url; ?>assets/css/custom.css" />

		<!--[if lte IE 8]>
		  <link rel="stylesheet" href="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="assets/js/html5shiv.js"></script>
		<script src="assets/js/respond.min.js"></script>
		<![endif]-->
	</head>

	<body class="login-layout">
		<div class="main-container no-margin">
			<div class="main-content">
				<div class="row">
					<div class="space-6"></div>
                                        <div class="col-md-8 site-info">
						<div class="title-box col-md-8">
							<img src="<?php echo $base_url; ?>assets/img/logo_soanbai_online_black.png" class="img-responsive">
							<div class="row">
								<img src="<?php echo $base_url; ?>assets/img/logo_Violet.png" class="img-responsive col-md-3">
								<img src="<?php echo $base_url; ?>assets/img/logo_viettel.png" class="img-responsive col-md-3" style="margin-top:20px">
							</div>
						</div>
					</div>
					
					<div class="col-md-4">
						<div class="login-container">
							<div class="position-relative">
								<div id="login-box" class="login-box visible widget-box no-border" style="background: transparent">
									<div class="widget-body" style="background:transparent">
										<div class="widget-main" style="background:transparent">
											<h4 class="header blue lighter bigger">
												<i class="icon-cloud-upload green"></i>
												SBGOnline | <small><a href="#" data-toggle="modal" data-target="#modal-signup">Đăng ký</a></small>
											</h4>
											<form action="<?php echo $base_url; ?>frontend/home/signin" id="validation-form" method="POST">
												<fieldset>
													<label class="block clearfix has-error">
														<div class="help-block">
														<?php 
															if($this->session->flashdata('login_error')){
																echo 'Thông tin đăng nhập không chính xác!';
															}
														?>
														</div>
													</label>
													<label class="block clearfix has-error">
														<span class="block input-icon input-icon-right">
															<input type="text" class="form-control" name="username" placeholder="Số điện thoại" />
															<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" class="form-control" name="password" placeholder="Mật khẩu" />
															<i class="icon-lock"></i>
														</span>
														<div class="help-block"> </div>
													</label>
													<h4>
													<small><a href="#" data-toggle="modal" data-target="#modal-forgotpass">Quên mật khẩu</a></small>
													</h4>	
													<div class="space"></div>
								
													<div class="clearfix">
														<label class="inline">
															<input type="checkbox" name="remember_me" class="ace" />
															<span class="lbl"> Ghi nhớ</span>
														</label>

														<!--a href="index-user.html" 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 -->

		<div class="modal fade" id="modal-signup" tabindex="-1" role="dialog"aria-hidden="true">
		  <div class="modal-dialog">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
		        <h4 class="modal-title">Đăng ký tài khoản</h4>
		      </div>
		      <div class="modal-body">
		      	<div class="alert alert-block alert-success" style="text-align: justify;">
	
						<p>
							Để đăng ký tài khoản tài khoản trên hệ thống Soạn Bài giảng trực tuyến (SBG Online), Quí vị hãy soạn tin nhắn theo cú pháp:
						<strong>
							SBG DK
						</strong>
						gửi tới
						<strong>
						8062</strong> (500đ/tin).
						</p>
						<p>
						Sau khi nhận được tin nhắn Đăng kí tài khoản của Quí vị, hệ thống SBG Online sẽ gửi lại thông tin Đăng nhập vào điện thoại của Quí vị.
						</p>
						<p>
						Nếu đã nhận được thông tin Đăng nhập hệ thống SBG Online gửi tới điện thoại của mình, Quí vị hãy điền thông tin và nhấn vào <strong>Đăng nhập</strong> để đăng nhập vào hệ thống.
						</p>
						<p>
						Nếu có vướng mắc gì về việc Đăng kí, Quí vị hãy gọi số <strong>01662860000</strong> để được hỗ trợ.
						</p>
				</div>
		      </div>
		    </div>
		  </div>
		</div>
		
		<div class="modal fade" id="modal-forgotpass" tabindex="-1" role="dialog"aria-hidden="true">
		  <div class="modal-dialog">
		    <div class="modal-content">
		      <div class="modal-header">
		        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
		        <h4 class="modal-title">Quên mật khẩu</h4>
		      </div>
		      <div class="modal-body">
		      	<div class="alert alert-block alert-success">						
							<p>
								Để lấy lại mật khẩu của mình trên hệ thống SBG Online, Quí vị hãy dùng <strong>số điện thoại đã đăng kí tài khoản</strong> và soạn tin theo cú pháp: <strong>SBG MK</strong> gửi tới <strong>8062 </strong>(500đ/tin).
							</p>
				</div>
		      </div>
		    </div>
		  </div>
		</div>
		<!-- 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');
			}

			$('#register-button').click(function(){
					$('#modal-login').modal('show')
			})

			$('#validation-form').validate({
				errorElement: 'label',
				errorClass: 'help-block',
				focusInvalid: true,
				rules: {
					password: {
						required: true,
					},
					username: {
						required: true
					}
				},
		
				messages: {
					username: {
						required: "Vui lòng nhập tài khoản hoặc số điện thoại",
					},
					password: {
						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>
