<?php
session_start();
include ("includes/database.php");
include ("includes/setting.php");

$username=$_SESSION["username"];
$dataPengguna=mysqli_query($con,"SELECT * from tbl_user where username='$username'");
$showDataPengguna=mysqli_fetch_array($dataPengguna);

?>

<!DOCTYPE html>
<html lang="en">


  <head>


    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>FIX-IT-ALL</title>

    <!-- Bootstrap core CSS -->
    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="css/heroic-features.css" rel="stylesheet">

<!-- Page Content -->
    <div class="container">
  <link rel="stylesheet" type="text/css" href="styleall.css">

  </head>

  <body>

    <!-- Navigation -->
    <!-- w3school -->
    <style>
ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: url(images/pinkk.png);
}

li {
  float: left;
}

li a {
  display: block;
  font-family: verdana;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}

li a:hover {
  background-color: #fff2e6;
}
</style>

<body>

<ul>
     <li><a class="active" href="main.php">Home</a></li>
  <li><a href="about.php">About</a></li>
  <li><a href="pilih.php">Choose Shop</a></li>
  <li><a href="profile.php">Profile</a></li>
  <li><a href="feedback.php">Feedback</a></li>
  <li><a href="logout.php">Logout</a></li>
        
</ul>
<br>

    </nav>         
                          
</div>
<!-- /.panel-heading -->
<div class="panel-body">
<div class="table-responsive">
<table class="table">
<thead align="center">

<!-- w3schools.com -->
<style>
#customers {
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

#customers td, #customers th {
  border: 1px solid #ddd;
  padding: 8px;
}

#customers tr:nth-child(even){background: url(images/peach.jpg);}

#customers tr:hover {background-color: #F7EBC3;}

#customers th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: #DEFDE0;
  color: black;
}

</style>
</head>

<body>
<table id="customers">
<tr>
<th>NO.</th>
<th>NAME</th>
<th>DATE</th>
<th>TIME</th>
<th>STATUS</th>
<th>SHOP NAME</th>
</tr>
</thead>
                           
                                                                 
<?php
$dataSubjects=mysqli_query($con,"SELECT * from tbl_booking where user_id='$showDataPengguna[username]'");
$bil_subjects=mysqli_num_rows($dataSubjects);

?>                              
                                   
<tbody>

<?php
if ($bil_subjects==0)
{
?>
<tr>
<td colspan="5">No record found!</td>

</tr>
<?php
}
else
{

$numbers=1;
while ($showSubjects=mysqli_fetch_array($dataSubjects))
    {
$dataSubjects1=mysqli_query($con,"SELECT * from tbl_shop where shop_id='$showSubjects[shop_id]'");
$bil_subjects1=mysqli_num_rows($dataSubjects1);
$showSubjects1=mysqli_fetch_array($dataSubjects1);

if ($bil_subjects1==0)
{

$a1="Not Available";

}
else 
{
$a1=$showSubjects1['shop_name'];


}


?>
<tr align="center">
<td><?php echo $numbers++;?></td>
<td><?php echo $showSubjects['user_id'];?></td>
<td><?php echo $showSubjects['booking_date'];?></td>
<td><?php echo $showSubjects['booking_time'];?></td>
<td><?php echo $showSubjects['booking_status'];?></td>
<td><?php echo $a1;?></td>
</tr>

<?php
}
}
?>
                                       
</tbody>
</table>         
</div>

   
    <br>
    <br>
    
    <!-- Footer -->
    <footer class="py-4 bg-dark">
      <div class="container" align="center">
        <p class="m-0 text-center text-white">Copyright &copy;Fix-It-All 2018</p>
      </div>
      <!-- /.container -->
    </footer>

    <!-- Bootstrap core JavaScript -->
    <script src="vendor/jquery/jquery.min.js"></script>
    <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

  </body>

</html>

