<?php
session_start();
if(isset($_SESSION['User'])){
include("db.php");
?>



<!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">
</head>

<body style="background-image: url(&quot;assets/img/star-sky.jpg&quot;);">
  <form action="cars.php" method="POST">
  <div class="form-container" style="padding-top:60px">
    <div class="card" style=" max-width:900px; width:80%; margin:auto; border-radius:20px;" >
    
  <div class="card-header">
    <?php $name = mysqli_query($conn, "SELECT username FROM users WHERE username='$_SESSION[User]'");
    $row = mysqli_fetch_array($name);{?>
    <h5 class="mb-0" style="float:left;">Welcome <?php echo $row['username'];?> </h5>
    <input type="hidden" value="<?php echo $row['username'];?>" name="username">
  </div><br>
        <div class="card-body" >
          <button style="height: 60px;background-color: rgb(7,90,166);width: 100%;border-radius:20px;"><p style=" text-align:center; margin-top:2%; font-size:20px; color:#fff;">Select Vehicle</p></button><br><br><br><br>
          <input type="hidden" value="<?php echo $row['username'];?>" name="username">
            <button formaction="trips.php" style="height: 60px;background-color: rgb(7,166,128);width: 100%;border-radius:20px;"><p style=" text-align:center; margin-top:2%; font-size:30px; color:#fff;">View Profile</p></i></button>
              <?php } ?>
        </div></form><br>

        <form action="logout.php" method="POST">
            <input type="submit" name="logout" value="Logout" class="btn btn-warning btn-block mb-3" style="width:40%; margin:0 auto">
        </form>


    </div>
  </div>
</div>
    <script src="assets/js/jquery.min.js"></script>
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>
  
</body>

</html>
<?php }else{
  header("Location: index.php");
}?>