<?php $__env->startSection('content'); ?>

 	<?php if($errors->has()): ?>
    	<div class="alert alert-danger">
		<?php foreach ($errors->all() as $row): ?>
	      <?php echo $row; ?><br />
	  	<?php endforeach; ?>
        </div>
	<?php endif; ?>	
	
	<?php echo Form::open(array('action' => 'AccountController@postLogin', 'id' => 'login_from')); ?>
	<div class="black-form">
		<a href="<?php echo URL::to('/'); ?>" class="banq-logo"></a>
		<div class="lock"></div>
		<p>PLEASE ENTER YOUR LOGIN DETAILS</p>
		<div class="form-group">
			<?php echo Form::email('email', null, array('id' => 'email', 'class' => 'form-control', 'required' => true, 'placeholder' => 'Email Address')); ?><span></span>
		</div>
		<div id="pass_div" class="form-group">
			<?php echo Form::password('password', array('id' => 'password', 'class' => 'form-control', 'required' => true, 'placeholder' => 'Password')); ?><span id="error_pass">&nbsp;</span>
		</div>
		<button type="submit" class="btn">LOGIN</button>
		<p>FORGOT YOUR PASSWORD?</p>
		<a href="<?php echo URL::to('account/forgot'); ?>" class="btn-small">RESET PASSWORD</a>
		<p class="info">We are committed to maintaining the confidentiality, integrity and security of any personal information about our users. Please refer to our <a href="#">Security and Privacy Policy</a> for more information on our standards and practices.</p>
	</div>
    <?php echo Form::close(); ?>
    
    <?php $__env->startSection('scripts'); ?>
  	<script>
		$(document).ready(function(){	
			$( "#login_from" ).submit(function() {
				$("#pass_div").removeClass("active");
				$('#error_pass').html('');
				$.ajax({
					type: 'POST',
					url: '/account/login',
					data: 'email=' + $('[name=email]').val() + '&password=' + $('[name=password]').val(),
					success: function(data){
						if(data.status == 'OK')
						{
							$('#login_from').unbind('submit').submit();
							return true;
						}
						else
						{
							$("#pass_div").addClass("active");
							$('#error_pass').html('INCORRECT PASSWORD');
						}
					}
				});
				
				return false;
			});
		});
    </script>
    <?php $__env->stopSection(); ?>
    
<!--	<div class="black-form reset-pass">
		<a href="<?php echo URL::to('/'); ?>" class="banq-logo"></a>
		<div class="lock"></div>
		<p>PLEASE ENTER YOUR EMAIL ADDRESS</p>
		<div class="form-group">
			<input type="text" class="form-control" placeholder="Email">
		</div>
		<button type="submit" class="btn">RESET PASSWORD</button>
		<p class="info">We are committed to maintaining the confidentiality, integrity and security of any personal information about our users. Please refer to our <a href="#">Security and Privacy Policy</a> for more information on our standards and practices.</p>
	</div>-->
<?php $__env->stopSection(); ?>  