@extends('layouts.adminLayout')

@section('title')
Login | Bilbord MediaWall Admin
@stop

@section('styles')
<style>
	body {
		position: fixed;
		left: 0;
		right: 0;
		width: 100%;
		height: 100%;
	}
	.holder{
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%,-50%);
	}
	.login{
		text-align: center;
	}
</style>
@stop

@section('scripts')

@stop

@section('sidebar')
@overwrite

@section('content')
<div class="holder">

	<form class="login" method="POST" action="">
		{{-- Hash::make('secret') --}}
		<h2>Bilbord - Admin</h2>
		<div class="form-group">
			<input id="userEmail" class="email form-control" name="email" type="email" placeholder="Email" autofocus>
		</div>
		<div class="form-group">
			<input id="userPassword" class="pass form-control" name="pass" type="password" placeholder="Password">
		</div>
		<!-- <a href="javascript:0;" id="login-btn" class="submit btn btn-primary" >Login</a> -->
		<button class="btn btn-primary" type="submit">Login</button>
	</form>
</div>

<script>
	function login(){
		$.ajax({
			url  : '<?php echo url(); ?>'+"/admin/loginValidate",
			type : 'post',
			dataType:'json',
			data : {
				pass : $('.pass').val()
			},
			success : function() {
				top.location.href = '<?php echo url(); ?>'+'/admin';
			},
			error: function() {
				alert("Nope!");
			}
		});
	}

	/*Login*/
	/*$(document).on('click', '#login-btn', login);

	$(document).keypress(function(e) {
		if(e.which == 13) {
			login();
		}
	});*/
</script>
@stop
