<?php
session_start();
if(isset($_SESSION['user_email']))
{
$user_email=$_SESSION['user_email'];    
require_once('sidebar.php');
require_once('header.php');
require_once("database.php");
$query="SELECT id FROM  customers where email='$user_email'";
$customer_id=db::getCell($query);
$q="SELECT COUNT(*) FROM  order_information where NOT status='Delivered' && customer_id='$customer_id'";
$active_orders=db::getCell($q);
$q1="SELECT COUNT(*) FROM  order_information WHERE status='Delivered' && customer_id='$customer_id'";
$total_orders=db::getCell($q1);
?>
  <div class="content" >
        <div class="content">
          <div class="container-fluid" style="margin-top:-40px">
            <div class="row">
              <div class="col-md-12">
                <div class="card " style="min-height:550px">
                    
                <div class="card-header card-header-info">
                  <h4 class="card-title ">Dashboard</h4>
                </div>
                    
								<div class=" card-body row">
         <!--                           <div class="col-lg-4 col-sm-4 col-md-4" >-->
         <!--                               <div class="card bg-teal-400" style="background-color:#E93E21">-->
         <!--                               <div class="card-body">-->
									<!--	<div class="d-flex">-->
									<!--		<h3  class="card-title " style="color:white" >Shezan Cuisine</h3>-->
									<!--	</div>-->
					    <!--            	<div style="color:white">-->
         <!--                                   <h5>96</h5> -->
									<!--	</div>-->
									<!--</div>-->
         <!--                                   </div>-->
         <!--                           </div>-->
                                    <div class="col-lg-6 col-sm-6 col-md-6" >
                                        <a href="active_order.php"> 
                                        <div class="card bg-teal-400" style="background-color:#E93E21">
                                        <div class="card-body">
										<div class="d-flex">
											<h3 class="card-title " style="color:white" >Delivered Orders</h3>
										</div>
					                	
					                	<div style="color:white">
                                       <h5><?php echo $total_orders; ?></h5>
                                            </div>
									</div>
                                            </div></a>
                                    </div>
                                     <div class="col-lg-6 col-sm-6 col-md-6" >
                                         <a href="active_order.php">
                                        <div class="card bg-teal-400" style="background-color:#E93E21">
                                        <div class="card-body">
										<div class="d-flex">
											<h3  class="card-title " style="color:white">Active Orders</h3>
										 
					                	</div>
					                	
					                	<div style="color:white">
                                            <h5><?php echo $active_orders; ?></h5> 
										</div>
									</div>
                                            </div></a>
                                    </div>
            <!--                        <div class="col-md-12">-->
            <!--  <div class="card ">-->
            <!--    <div class="card-header card-header-text card-header-rose">-->
            <!--      <div class="card-text" style="background:#E93E21">-->
            <!--        <h4 class="card-title">Map</h4>-->
            <!--      </div>-->
            <!--    </div>-->
            <!--    <div class="card-body ">-->
            <!--      <h4 class="card-title"></h4>-->
            <!--      <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2519.713571762574!2d4.365194915560442!3d50.836469167355986!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x47c3c48f8e9d1fbd%3A0xc4bdb01484648f1d!2sShezan!5e0!3m2!1sen!2s!4v1598596766435!5m2!1sen!2s" style="width:100%" height="450" frameborder="0" style="border:0;" allowfullscreen="" aria-hidden="false" tabindex="0"></iframe>-->
            <!--    </div>-->
            <!--  </div>-->
            <!--</div>-->
                                    
                    </div>
                    
                    
                 
                          </div>
                          </div>
                          </div>

<?php
    include ("footer.php");
    }
else
{
   echo "<script>
            window.location.href = '../index.php';
            </script>";
}
?>