<?php 
require_once("header.php");
require_once("session_check.php");
?>

			<!-- page template area start -->
			<section id="about" style="background:#f1f1f1;">
			    <div class="container mt-0 pb-0 pt-5">	
    				<div class="row">
    					<div class="col-lg-12">
    					<h1 class="title mt-0 mb-10" style="text-align:center;">My Bookings</h1>
    						<?php
    						$sql_order = "SELECT * FROM `sc_orders` WHERE `user_id` = '".$_SESSION['USER_ID']."' AND `consultation_charge_paid` = 'Yes' ORDER BY `order_id` DESC";
    						$exe_order = mysqli_query($connection,$sql_order);
    						$num_order = mysqli_num_rows($exe_order);
    						if($num_order>0)
    						{
    						while($arr_order = mysqli_fetch_array($exe_order))
    						{								
    							?>	
    							<div class="col-xs-12" style="border: 1px solid #CCC; background:#fff; border-radius:5px; margin-bottom:15px;">
									<div class="pt-10 pb-10" style="text-align:left;">
										<p style="margin-bottom:5px;"><span style="text-align:left;"><b>Order Date & Time</b> </span> <span style="float:right;"><b><?php echo date('d.m.Y, h:i A',strtotime($arr_order['post_date']));?></b></span></p>
										<p style="margin-bottom:5px;"><span style="text-align:left;">Order ID </span> <span style="float:right;"><?php echo $arr_order['orderid'];?></span></p>
										<p style="margin-bottom:5px;"><span style="text-align:left;">Grand Total </span> <span style="float:right;"> &#8377; <?php echo $arr_order['price'];?></span></p>
										<p style="margin-bottom:5px;"><span style="text-align:left;">Payment Status </span> <span style="float:right;"><?php echo $arr_order['payment_status'];?></span></p>
										<p style="margin-bottom:5px;"><span style="text-align:left;">Work Status </span> <span style="float:right;"><?php echo $arr_order['work_status'];?></span></p>
									<p style="text-align:left;"><button type="button" class="btn btn-flat btn-theme-colored border-left-theme-color-2-4px" style="width:50%;" onclick="window.location.href='order-details.php?order_id=<?php echo $arr_order['order_id'];?>'">View Details</button></p>
									</div>	
    							</div>
    						<?php
    						}
    						}
    						else
    						{
    						?>
    						<div class="" style="color:#ff0000; text-align:center;">No order posted yet!</div>
    						<?php
    						}
    						?>
    						</div>
    					</div>
    				</div>
			    </section>
			    <!-- page template area end -->
  
<?php require_once("footer.php");?>