<?= $this->extend($config->viewLayout) ?>
<?= $this->section('main') ?>
<!-- Bootstrap core CSS -->

<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/color.css">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/demo/demo.css">
<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.min.js"></script>
<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>



<div class="row">
	<div class="col-md-8">

</div>

		<div class="col-md-4">
		<?php if($attempt == 1) { ?>
			<div class="boxlogin">
				<center>
					<img src="/assets/images/<?php echo FLD_APP; ?>/logo_s.png" width="150px">
				</center><br />
				<?= view('Myth\Auth\Views\_message_block') ?>

				<form action="<?= route_to('login') ?>" method="post">
					<?= csrf_field() ?>

					<?php if ($config->validFields === ['email']) : ?>
						<div class="form-group">
							<label for="login"><?= lang('Auth.email') ?></label>
							<input type="email" class="form-control <?php if (session('errors.login')) : ?>is-invalid<?php endif ?>" name="login" placeholder="<?= lang('Auth.email') ?>">
							<div class="invalid-feedback">
								<?= session('errors.login') ?>
							</div>
						</div>
					<?php else : ?>
						<div class="form-group">
							<input type="text" class="form-control <?php if (session('errors.login')) : ?>is-invalid<?php endif ?>" name="login" placeholder="Nama Pengguna">
							<div class="invalid-feedback">
								<?= session('errors.login') ?>
							</div>
						</div>
					<?php endif; ?>

					<div class="form-group">
						<input type="password" name="password" class="form-control  <?php if (session('errors.password')) : ?>is-invalid<?php endif ?>" placeholder="<?= lang('Auth.password') ?>">
						<div class="invalid-feedback">
							<?= session('errors.password') ?>
						</div>
					</div>

					<?php if ($config->allowRemembering) : ?>
						<div class="form-check">
							<label class="form-check-label">
								<input type="checkbox" name="remember" class="form-check-input" <?php if (old('remember')) : ?> checked <?php endif ?>>
								<?= lang('Auth.rememberMe') ?>
							</label>
						</div>
					<?php endif; ?>

					<br>

					<button type="submit" class="btn btn-primary btn-block"><?= lang('Auth.loginAction') ?></button>
				</form>
				<br />
				<center><span class="loginft"><?php echo LOGINF; ?></span></center>
				<?php if ($config->allowRegistration) : ?>
					<p><a href="<?= route_to('register') ?>"><?= lang('Auth.needAnAccount') ?></a></p>
				<?php endif; ?>
				<?php if ($config->activeResetter) : ?>
					<p><a href="<?= route_to('forgot') ?>"><?= lang('Auth.forgotYourPassword') ?></a></p>
				<?php endif; ?>

			</div>
		<?php } else if($attempt == 0) { ?>
			<div class="boxlogin">
				<center>
					<img src="/assets/images/<?php echo FLD_APP; ?>/logo_s.png" width="150px">

					<br />
					<br />
				
				<br />
				Anda telah melakukan <br/>kesalahan memasukkan data<br/>lebih dari 3 kali.<br/>
				Sila tunggu beberapa saat untuk memulai lagi
				</center><br />
				<br/>
				<center><span class="loginft"><?php echo LOGINF; ?></span></center>

			</div>
			<?php } else if($attempt == 2) { ?>
			<div class="boxlogin">
				<center>
					<img src="/assets/images/<?php echo FLD_APP; ?>/logo_s.png" width="150px">

					<br />
					<br />
				
				<br />
				AKUN INI<br/>sedang dipergunakan<br/>di tempat lain<br/>
				Sila Logout terlebih dulu
				</center><br />
				<br/>
				<center><span class="loginft"><?php echo LOGINF; ?></span></center>

			</div>
			<?php } ?>



		</div>




	</div>

	<script>
		$(document).ready(function() {
			/*
		$("button").click(function(){
	    	$("p").slideToggle();
  		});
		*/
		});

		function daftar() {
			$('#daftar').show(1500);
		}
		/*
			$('#nik').on('keydown keyup click input submit mouseenter', function (e) {
		    // Handle e.type
		    alert('Type: ' + e.type);
		});
		*/
		$('#nik').on('input', function(e) {
			var nikl = $('#nik').val().length;
			if (nikl == 16) {
				//check status pendaftar
				thenik = $('#nik').val();
				$.ajax({
					type: 'post',
					url: "<?php echo base_url(); ?>/ceknik",
					data: {
						thenik: thenik,
						"<?= csrf_token() ?>": "<?= csrf_hash() ?>"
					},
					success: function(data) {
						var respon = $.parseJSON(data);
						console.log(respon);

						if (respon.ada == 1) {
							var exdd = $.parseJSON(respon.foto);
							exddtext = '';
							$.each(exdd, function(index, val) {
								cekf = "<input type='checkbox' value='" + index + "' name='checkf[]' checked />&nbsp;&nbsp;";
								exddtext += cekf + '<a href="/tampilkan/' + val[1] + '"  target="blank">' + val[0] + '</a><br/>';
							});

							$('#exdokumen').html(exddtext);
						}
					}

				});
			}

		});
	</script>



	<style>
		body {
			/* The image used */
			/* Full height */
			height: 100%;
			/*font-family: 'Titillium Web', sans-serif;*/

			/* Center and scale the image nicely */
			/*  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;*/

			background: url("/assets/images/<?php echo FLD_APP; ?>/login_bg.jpg") no-repeat center center fixed;
			-webkit-background-size: cover;
			-moz-background-size: cover;
			-o-background-size: cover;
			background-size: cover;



		}

		#hdaftar {
			background-color: black;
			color: white;
		}

		.boxlogin {
			position: relative;
			margin-top: 150px;
			border-radius: 5px;
			border-style: dotted;
			background-color: #e1eae6;
			border-width: 2px;
			border-color: #bbb;
			padding: 20px;
			box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
		}

		.boxdaftar {
			position: relative;
			margin-top: 100px;
			border-radius: 5px;
			border-style: double;
			border-width: 10px;
			min-height: 550px;
			border-color: #bbb;
			padding: 10px;
			background-color: rgba(225, 234, 230, 0.8);
			box-shadow: rgba(60, 64, 67, 0.2) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px;
		}


		#daftar {
			/*visibility:hidden;*/
			display: none;

		}

		input {
			margin-top: 3px;
			margin-bottom: 3px;
			height: 35px;
			padding: 5px;
			border-radius: 10px;
			border-style: solid;
			border-width: 1px;
			font-size: 20px;
			background-color: rgba(255, 255, 255, 0.7);
		}

		label {
			font-weight: 400;
		}

		.card {
			background-color: rgba(225, 225, 225, .9);
			border-radius: 5px;
			border-style: solid;
			border-color: rgba(255, 255, 255, 0.3);
			border-width: 0px;
		}

		.card-header {
			/*background-color: rgba(150, 150, 150, 1);*/
			color: #333;
			margin-top: 0px;
			margin-bottom: 10px;
			overflow-y: hidden;
			height: 100px;
		}

		.loginft {
			font-size: 10px;
		}

		.card-body {
			padding: 20px;
		}


		input[type="file"] {
			font-size: 17px;
			color: #b8b8b8;
			/*color: transparent;*/
			width: 300px;

		}
	</style>

	<?= $this->endSection() ?>