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

$user=$_SESSION["username"];
$data=mysqli_query($con, "SELECT * from tbl_user where username ='$user'");
$showData=mysqli_fetch_array($data);
$a=$_GET["id"];
$kedai=mysqli_query($con, "SELECT * from tbl_shop where shop_id='$a'");

//buang data



?>
<!doctype html>
<html>
<head>

	<!-- youtube.com /DarkCode -->
	<meta charset="utf-8">
	<title>BOOKINGs</title>
<!-- Custom styles for this template -->
    <link href="css/heroic-features.css" rel="stylesheet">

  <meta charset="utf-8">
	<title>BOOKING SESSION</title>
	<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>

</head>

<body>
<a href="logout.php">logout</a><br>
<center>
<form method="post">

Time<input type="time" name="time" required> <br>
Date<input type="date" name="date" required> <br>
Service type
<select name="HH">
<?php
while ($satukedai=mysqli_fetch_array($kedai))
{
?>

<option value="<?php echo $satukedai['shop_id']; ?>"><?php echo $satukedai['shop_name']; ?></option>
<?php
}
?>
</select>
<br>


Request (if any)<input type="text" name="request" <br>

<input type="submit" name="submit" value="submit"> <br>
</form>


<?php
// stackoverflow
if (isset($_POST["HH"]))
{
//get data
//$p1=$_POST["user_id"];
$p2=$_POST["time"];
$p3=$_POST["date"];
$p4="PENDING";
$p5=$_POST["HH"];

mysqli_query($con,"INSERT INTO tbl_booking (booking_time,booking_date,booking_status, user_id, shop_id) values ('$p2','$p3','$p4','$user','$p5')") or die (mysqli_error($con));
echo "A request has been made. Click <a href='main.php'>here</a> to BACK";



}

?>


//result<br><br>


 
  </body>

</html>


</center>

</body>
</html>