<?php
/**
 * index.php -- Sign In Page
 */

$pageTitle = 'Sign In';

//date_default_timezone_set('Africa/Lagos');

include '../inc/config.inc.php'; // Configuration

error_reporting(E_ALL);
ini_set('display_errors', 1);

session_start();
if ( isset($_SESSION['admin']) ){
	header('Location: dashboard');
}

?>

<!doctype html>
<html lang="en-uk">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Alert Signals Nation - Admin Login</title>
    <!-- Favicon -->
    <link rel="shortcut icon" href="../img/Signals-Alert-3.png" />
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <!-- Typography CSS -->
    <link rel="stylesheet" href="css/typography.css">
    <!-- Style CSS -->
    <link rel="stylesheet" href="css/style.css">
    <!-- Responsive CSS -->
    <link rel="stylesheet" href="css/responsive.css">

    <script src="../plugins/sweetalerts/promise-polyfill.js"></script>
    <link href="../plugins/sweetalerts/sweetalert.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <!-- loader Start -->
    <div id="loading">
        <div id="loading-center">
        </div>
    </div>
    <!-- loader END -->
    <!-- Sign in Start -->
    <section class="sign-in-page">
        <div class="container p-0" id="sign-in-page-box">
            <div class="bg-white form-container sign-in-container">
                <div class="sign-in-page-data">
                    <div class="sign-in-from w-100 m-auto" id="admin">
                        <a class="sign-in-logo mb-5" href="#"><img src="../img/Transparrant-alert-nation.png" style="padding-left: 40px; padding-top: 10px; width: 350px; height: 100px;" class="img-fluid" alt="logo"></a>
                        <h1 class="mb-3 text-center">Sign in</h1>
                        <p class="text-center text-dark">Enter your email address and password to access admin panel.</p>

                        <form class="mt-4" id="loginForm" v-on:submit.prevent>
                            <div class="form-group">
                                <label for="exampleInputEmail2">Email address</label>
                                <input type="email" class="form-control mb-0" id="email" v-model="loginDetails.email" placeholder="Enter email">
                            </div>
                            <div class="form-group">
                                <label for="exampleInputPassword2">Password</label>
                                <a href="#" class="float-right">Forgot password?</a>
                                <input type="password" class="form-control mb-0" id="password" v-model="loginDetails.password" placeholder="Password">
                            </div>
                            <div class="sign-info">
                                <button type="button" class="btn btn-primary mb-2" @click="checkLoginForm()" id="btnSignin">Sign In</button>
                            </div>
                        </form>

                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- Sign in END -->
    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="../plugins/jquery-3.1.1.min.js"></script>
    <script src="../plugins/sweetalerts/sweetalert2.min.js"></script>
    <script src="https://unpkg.com/@popperjs/core@2/dist/umd/popper.js"></script>

    <!--<script src="js/jquery.min.js"></script>
    <script src="js/popper.min.js"></script>-->
    <script src="js/bootstrap.min.js"></script>
    <!-- Appear JavaScript -->
    <script src="js/jquery.appear.js"></script>
    <!-- Countdown JavaScript -->
    <script src="js/countdown.min.js"></script>
    <!-- Counterup JavaScript -->
    <script src="js/waypoints.min.js"></script>
    <script src="js/jquery.counterup.min.js"></script>
    <!-- Wow JavaScript -->
    <script src="js/wow.min.js"></script>
    <!-- Apexcharts JavaScript -->
    <script src="js/apexcharts.js"></script>
    <!-- lottie JavaScript -->
    <script src="js/lottie.js"></script>
    <!-- Slick JavaScript -->
    <script src="js/slick.min.js"></script>
    <!-- Select2 JavaScript -->
    <script src="js/select2.min.js"></script>
    <!-- Owl Carousel JavaScript -->
    <script src="js/owl.carousel.min.js"></script>
    <!-- Magnific Popup JavaScript -->
    <script src="js/jquery.magnific-popup.min.js"></script>
    <!-- Smooth Scrollbar JavaScript -->
    <script src="js/smooth-scrollbar.js"></script>
    <!-- Style Customizer -->
    <script src="js/style-customizer.js"></script>
    <!-- Chart Custom JavaScript -->
    <script src="js/chart-custom.js"></script>
    <!-- Custom JavaScript -->
    <script src="js/custom.js"></script>

    <script src="../vuejs/vue.js"></script>
    <script src="../vuejs/axios.js"></script>
    <script>
        // Site Under Maintenance
        /*swal({
            html: '<span style="font-size:25px!important;">Users please note:<br><b>Site is under maintenance.</b><br><br>We\'ll be back soon.</span>',
            type: 'info',
            showConfirmButton: false,
            allowOutsideClick: false,
            allowEscapeKey: false,
        });*/

        // BASE URL and API Inclusion
        const BASE_URL = '<?= $BASE_URL; ?>';
        const API = `${BASE_URL}api/admin.php`;
    </script>
    <script src="../vuejs/admin.js"></script>

</body>
</html>