<?php
session_start();
include_once "library/inc.connection.php";
include_once "library/inc.library.php";
?>

<!doctype html>
<html class="no-js" lang="en">
<head>
    <link rel="shortcut icon" href="images/kemenaglogo.png">
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>SIPA MAN 4 BOGOR</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" type="image/png" href="assets/images/icon/favicon.ico">
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/css/font-awesome.min.css">
    <link rel="stylesheet" href="assets/css/themify-icons.css">
    <link rel="stylesheet" href="assets/css/metisMenu.css">
    <link rel="stylesheet" href="assets/css/owl.carousel.min.css">
    <link rel="stylesheet" href="assets/css/slicknav.min.css">
    <!-- amchart css -->
    <link rel="stylesheet" href="https://www.amcharts.com/lib/3/plugins/export/export.css" type="text/css" media="all" />
    <!-- others css -->
    <link rel="stylesheet" href="assets/css/typography.css">
    <link rel="stylesheet" href="assets/css/default-css.css">
    <link rel="stylesheet" href="assets/css/styles.css">
    <link rel="stylesheet" href="assets/css/responsive.css">
    <!-- modernizr css -->
    <script src="assets/js/vendor/modernizr-2.8.3.min.js"></script>
</head>

<body>
    <div id="preloader">
        <div class="loader"></div>
    </div>
    <!-- preloader area end -->
    
    <!-- login area start -->
    <div class="login-area login-s2">
        <div class="container">
            <div class="login-box">
                <form name="logForm" method="post" action="cek_login.php" enctype="multipart/form-data">
                    <div class="login-form-head">
                        <h4>Login</h4>
                        <p>Selamat datang di Sistem Informasi Pembayaran Administrasi (SIPA) MAN 4 Bogor. </p>
                    </div>
                    <div class="login-form-body">
                        <?php 
                        if(isset($_GET['pesan'])){
                            if($_GET['pesan'] == "gagal"){
                                echo "
                                <div class='form-gp'>
                                <div class='alert alert-danger alert-dismissible fade show' role='alert'>
                                <p>Login gagal! username dan password salah!</p>
                                <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
                                <span class='fa fa-times'></span>
                                </button>
                                </div>
                                </div>
                                ";
                            }else if($_GET['pesan'] == "logout"){
                                echo "
                                <div class='form-gp'>
                                <div class='alert alert-success alert-dismissible fade show' role='alert'>
                                <p>Anda telah berhasil logout</p>
                                <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
                                <span class='fa fa-times'></span>
                                </button>
                                </div>
                                </div>
                                ";
                            }else if($_GET['pesan'] == "belum_login"){
                                echo "
                                <div class='form-gp'>
                                <div class='alert alert-warning alert-dismissible fade show' role='alert'>
                                <p>Anda harus login untuk mengakses halaman admin</p>
                                <button type='button' class='close' data-dismiss='alert' aria-label='Close'>
                                <span class='fa fa-times'></span>
                                </button>
                                </div>
                                </div>
                                ";
                            }
                        }
                        ?>
                        <div class="form-gp">
                            <label for="exampleInputEmail1">Username</label>
                            <input type="text" name="username" id="exampleInputEmail1">
                            <i class="ti-user"></i>
                        </div>
                        <div class="form-gp">
                            <label for="exampleInputPassword1">Password</label>
                            <input type="password" name="password" id="exampleInputPassword1">
                            <i class="ti-lock"></i>
                        </div>
                        <div class="submit-btn-area">
                            <button id="form_submit" type="submit" name="btnLogin" value="Login">Masuk<i class="ti-arrow-right"></i></button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <!-- login area end -->

    <!-- jquery latest version -->
    <script src="assets/js/vendor/jquery-2.2.4.min.js"></script>
    <!-- bootstrap 4 js -->
    <script src="assets/js/popper.min.js"></script>
    <script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/js/owl.carousel.min.js"></script>
    <script src="assets/js/metisMenu.min.js"></script>
    <script src="assets/js/jquery.slimscroll.min.js"></script>
    <script src="assets/js/jquery.slicknav.min.js"></script>

    <!-- others plugins -->
    <script src="assets/js/plugins.js"></script>
    <script src="assets/js/scripts.js"></script>
</body>

</html>