<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="">
	<meta name="author" content="">
	<link rel="icon" type="image/png" sizes="16x16" href="<?=base_url();?>/assets/favicon.png">
	<title>Summit-CRM</title>
	<link href="<?=base_url();?>/assets/login.css" rel="stylesheet">
	<link href="<?=base_url();?>/assets/style.css" rel="stylesheet">
	<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
	<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
	<!--[if lt IE 9]>
	<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
	<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
	<![endif]-->
</head>
<?php
helper('cookie');
if(!isset($email)) { $email = ''; }
if(!isset($password)) { $password = ''; }

?>
<body>
	<div class="preloader">
		<div class="loader">
			<div class="loader__figure"></div>
			<p class="loader__label">Summit-CRM</p>
		</div>
	</div>
	<section id="wrapper" class="login-register login-sidebar" style="background-image:url(<?=base_url();?>/assets/images/bg-01.jpg);">
		<div class="login-box card">
			<div class="card-body">	
				<form class="form-horizontal form-material text-center" id="loginform" method='POST'>
					<a href="javascript:void(0)"><img src="<?=base_url();?>/assets/images/logo.png" /></a>
					<?php if(isset($validation)) { ?>
						<div class='alert alert-danger alert-dismissible mt-5'>
							<?= $validation->listErrors(); ?>
							<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"> <span aria-hidden="true"></span> </button>
						</div>
					<?php } ?>
					<?php if (session()->getFlashdata('loginError')) : ?>
						<div class="alert alert-danger alert-dismissible mt-5">
							<?= session()->getFlashdata('loginError') ?>
							<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"> <span aria-hidden="true"></span> </button>
						</div>
					<?php endif; ?>
					<div class="form-group m-t-40">
						<div class="col-xs-12">
							<input class="form-control" type="text" name='email' required placeholder="Email" value='<?=$email;?>' />
						</div>
					</div>
					<div class="form-group">
						<div class="col-xs-12">
							<!-- <input class="form-control" type="password" name='password' placeholder="Password" value='' /> -->
							<input class="form-control" type="password" name='password' placeholder="Password" value='<?=$password;?>' />
						</div>
					</div>
					<div class="form-group row">
						<div class="col-md-12">
							<div class="d-flex no-block align-items-center">
								<div class="form-check">
									<input type="checkbox" class="form-check-input" name='rememberme' value='1' <?php if(isset($rememberme)) { echo 'checked'; }?> /> <label class="form-check-label">Remember me</label>
								</div> 
							</div>   
						</div>
					</div>
					<div class="form-group text-center m-t-20">
						<div class="col-xs-12">
							<button class="btn btn-info btn-lg w-100 text-uppercase btn-rounded text-white" type="submit">Log In</button>
						</div>
					</div>
				</form>
			</div>
			<div class='card-footer'>
				<p class='ms-auto'>&copy; 4SKA1 2022 - 2024</p>
				<!-- <p>Selamat datang, <?= session('email') ?>!</p> -->
			</div>
		</div>
	</section>
	<script src="<?=base_url();?>/assets/jquery/jquery.min.js"></script>
	<script src="<?=base_url();?>/assets/bootstrap.bundle.min.js"></script>
	<script type="text/javascript">
	$(function() {
		$(".preloader").fadeOut();
	});
	$(function() {
		$('[data-bs-toggle="tooltip"]').tooltip()
	});
	</script>
</body>
</html>