<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="SHORTCUT ICON" href="<?php echo e(asset('images/eicon.png')); ?>">

    <title>eventry.ng | Admin Login </title>

    <!-- Bootstrap -->
    <link href="vendors/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">

    <!-- Custom Theme Style -->
    <link href="css/custom.css" rel="stylesheet">
</head>

<body style="background:#F7F7F7; background-image: url('images/bg.jpg');">
<div class="">
    <a class="hiddenanchor" id="toregister"></a>
    <a class="hiddenanchor" id="tologin"></a>

    <div id="wrapper">
        <div id="login" class=" form" style="background: rgba(1,1,1,.5); padding: 20px; border-radius: 20px;">
            <section class="login_content">
                <center>
                <img src="<?php echo e(asset('images/eventry.png')); ?>" class="img-responsive"><br><br><br>
                </center>
                <form id="signin" method="POST" action="#">
                    <input type="hidden" name="_token" value="<?php echo e(csrf_token()); ?>">
                    <h1>Admin Login</h1>
                    <div>
                        <input type="email" name="email" class="form-control" placeholder="Username" required="" />
                    </div>
                    <div>
                        <input type="password" name="password" class="form-control" placeholder="Password" required="" />
                    </div>
                    <div>
                        <div id="validate"></div><br>
                        <button class="btn btn-default submit" id="btn">Log in</button>
                    </div>
                    <div class="clearfix"></div>

                        <div class="clearfix"></div>
                        <br />
                        <div>

                            <p>©2016 | eventry.ng -  All Rights Reserved.</p>
                        </div>
                    </div>
                </form>
            </section>
        </div>

    </div>
</div>
<script src="<?php echo e(asset('vendors/jquery/dist/jquery.min.js')); ?>"></script>
<script>
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });

    $(document).ready(function(){
        $('#signin').submit(function (e) {
            e.preventDefault();
            $('#validate').html('Validating... Please wait');
            $('#btn').prop('disabled', true);

            var dataString = $(this).serialize();
//            console.log(dataString);
            $.ajax({
                type: "POST",
                url: "signin",
                data: dataString,
                dataType: "JSON",
                success: function(data){
                    if (data.status == 1) {
                        $('#validate').html(data.encounters);
                        $('#btn').prop('disabled', false);
                    }
                    else{
                        $('#validate').html(data.encounters);
                        window.location.href='home';
                    }
                }
            });

        });
    });
</script>
</body>
</html>