<?php
include("db.php");
$date = date("Y-m-d H:i:s");

?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <title>Driver Logbook</title>
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/fonts/font-awesome.min.css">
    <link rel="stylesheet" href="assets/css/Login-Form-Clean.css">
    <link rel="stylesheet" href="assets/css/Login-Form-Dark.css">
    <link rel="stylesheet" href="assets/css/Registration-Form-with-Photo.css">
    <link rel="stylesheet" href="assets/css/styles.css">
     <link rel="icon" type="image/x-icon" href="assets/img/Untitled-1.png">
</head>

<body style="background-color: rgb(32,53,80);">
    <h2 class="sr-only">Login Form</h2>
    <div class="login-clean" style="height: 599px;background-image: url(&quot;assets/img/star-sky.jpg&quot;);">
        <form method="post" action="process.php" style="height: 410px;">
            <h2 class="sr-only">Login Form</h2><img src="assets/img/Untitled-1.png" style="width: 220px;margin-top: -80px;margin-bottom: -26px;">
            <h1 style="margin-top: -37px;margin-left: 59px;">Login</h1>
            <div class="illustration"></div>
            <?php
              if(@$_GET['Empty']==true){
                ?>
                <div class="alert-light text-danger mb-3 py-2"><?php echo $_GET['Empty'] ?></div>
                <?php
              }
            ?>
            <?php
              if(@$_GET['Invalid']==true){
                ?>
                <div class="alert-light text-danger mb-3 py-2"><?php echo $_GET['Invalid'] ?></div>
                <?php
              }
            ?>
            
              <input type="hidden" name="date" value="<?php echo date("d-m-Y");?>">
              <div class="form-group"><select class="form-control" type="text" name="username" placeholder="Username">
              <option>--Select username--</option>
              <?php $name = mysqli_query($conn, "SELECT * FROM users ORDER BY username");
              while($row = mysqli_fetch_array($name)){?>
                <option><?php echo $row['username']?><option>
                <?php }?>
            </select></div>
            <div class="form-group"><input class="form-control" type="password" name="password" placeholder="Password"></div>
            <div class="form-group"><input class="btn btn-primary btn-block" name="login" value="Login" type="submit" style="background-color: rgb(32,53,80);"></div><a href="admin-module/index.php" class="forgot">Login as admin</a></form>
    </div>
    <script src="assets/js/jquery.min.js"></script>
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>
</body>

</html>
