<?php
    session_start();
    if(isset($_SESSION['user_id']) && isset($_SESSION['user_name']) && $_SESSION['user_cate'] === "vendor"){
        $user_id = $_SESSION['user_id'] ;
        $username = $_SESSION['user_name'] ;
        $ticket = $_SESSION['last_ticket'] ;
        $company = $_SESSION['company'] ;
        $vendor_image = $_SESSION['vendor_image'] ;
    }else{
        header("Location:vendor_login.php") ;
    }
?>

<?php include "head.php" ; ?>
<body>
	<!-- Main Wrapper -->

	<div class="main-wrapper">

		<!-- Header -->

		<?php include "header.php" ; ?>

		<!-- /Header -->
	<body>

		
			<!-- Breadcrumb -->
			<?php include "breadcrumb.php" ; ?>
			<!-- /Breadcrumb -->
			
			<!-- Page Content -->
			<div class="content">
				<div class="container-fluid">

					<div class="row">
						<div class="col-md-5 col-lg-4 col-xl-3 theiaStickySidebar">
							
							<!-- Profile Sidebar -->
							<?php include "vendor_sidebar.php" ; ?>
							<!-- /Profile Sidebar -->
							
						</div>
						
						<div class="col-md-7 col-lg-8 col-xl-9">
							<div class="row">
								<div class="col-md-12">
									<div class="card dash-card">
										<div class="card-body">
											<div class="row">
												<div class="col-md-12 col-lg-3">
													<div class="dash-widget dct-border-rht">
														<div class="circle-bar circle-bar1">
															<div class="circle-graph1" data-percent="75">
																<img src="assets/img/icon-01.png" class="img-fluid" alt="patient">
															</div>
														</div>
														<div class="dash-widget-info">
															<h6>POST ADD</h6>
															<?php
            											        $post_sql = "SELECT (SELECT count(event_id) FROM event_post WHERE vendor_id = '$user_id' And e_status = 2)as appr,
            											                    (SELECT count(event_id) FROM event_post WHERE vendor_id = '$user_id' And e_status = 1 ) as pend FROM event_post WHERE vendor_id = '$user_id' " ;
            											        $post_res = $config->query($post_sql);
            											        $post = $post_res->fetch_assoc();
            											    ?>
															<h3><?= $post['pend']; ?> / <?= $post['appr'] ?></h3>
														</div>
													</div>
												</div>
												
												<div class="col-md-12 col-lg-3">
													<div class="dash-widget dct-border-rht">
														<div class="circle-bar circle-bar2">
															<div class="circle-graph2" data-percent="65">
																<img src="assets/img/icon-02.png" class="img-fluid" alt="Patient">
															</div>
														</div>
														<div class="dash-widget-info">
															<h6>Today Visit</h6>
															<h3>0</h3>
														</div>
													</div>
												</div>
												
												<div class="col-md-12 col-lg-3">
													<div class="dash-widget dct-border-rht">
														<div class="circle-bar circle-bar3">
															<div class="circle-graph3" data-percent="50">
																<img src="assets/img/icon-03.png" class="img-fluid" alt="Patient">
															</div>
														</div>
														<div class="dash-widget-info">
															<h6>Enquiry</h6>
															<h3>0</h3>
														</div>
													</div>
												</div>
												<div class="col-md-12 col-lg-3">
													<div class="dash-widget">
														<div class="circle-bar circle-bar2">
															<div class="circle-graph2" data-percent="60">
																<img src="assets/img/icon-03.png" class="img-fluid" alt="Patient">
															</div>
														</div>
														<div class="dash-widget-info">
															<h6 style="font-size: 12px;">Pending / Approved</h6>
															<?php
            											        $sql = "SELECT (SELECT count(order_id) as tot FROM order_master WHERE customer_id = '$user_id' And order_status = 1 ) as tot 
            											        ,(SELECT count(order_id) as tot FROM order_master WHERE customer_id = '$user_id' And order_status = 2 ) as approve FROM order_master " ;
            											        $res = $config->query($sql);
            											        if($res->num_rows > 0){
            											        $row = $res->fetch_assoc();
            											    ?>
															<h3><?= $row['tot']; ?> / <?= $row['approve']; ?> </h3>
															<?php }else{ ?>
															<p class="text-muted">No Requests</p>
															<?php } ?>
														</div>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							
							<!--<div class="row">-->
							<!--	<div class="col-md-12">-->
							<!--		<h4 class="mb-4">Patient Appoinment</h4>-->
							<!--		<div class="appointment-tab">-->
									
										<!-- Appointment Tab -->
							<!--			<ul class="nav nav-tabs nav-tabs-solid nav-tabs-rounded">-->
							<!--				<li class="nav-item">-->
							<!--					<a class="nav-link active" href="#upcoming-appointments" data-toggle="tab">Upcoming</a>-->
							<!--				</li>-->
							<!--				<li class="nav-item">-->
							<!--					<a class="nav-link" href="#today-appointments" data-toggle="tab">Today</a>-->
							<!--				</li> -->
							<!--			</ul>-->
										<!-- /Appointment Tab -->
										
							<!--			<div class="tab-content">-->
										
											<!-- Upcoming Appointment Tab -->
							<!--				<div class="tab-pane show active" id="upcoming-appointments">-->
							<!--					<div class="card card-table mb-0">-->
							<!--						<div class="card-body">-->
							<!--							<div class="table-responsive">-->
							<!--								<table class="table table-hover table-center mb-0">-->
							<!--									<thead>-->
							<!--										<tr>-->
							<!--											<th>Patient Name</th>-->
							<!--											<th>Appt Date</th>-->
							<!--											<th>Purpose</th>-->
							<!--											<th>Type</th>-->
							<!--											<th class="text-center">Paid Amount</th>-->
							<!--											<th></th>-->
							<!--										</tr>-->
							<!--									</thead>-->
							<!--									<tbody>-->
							<!--										<tr>-->
							<!--											<td>-->
							<!--												<h2 class="table-avatar">-->
							<!--													<a href="patient-profile.html" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" src="assets/img/patients/patient.jpg" alt="User Image"></a>-->
							<!--													<a href="patient-profile.html">Richard Wilson <span>#PT0016</span></a>-->
							<!--												</h2>-->
							<!--											</td>-->
							<!--											<td>11 Nov 2019 <span class="d-block text-info">10.00 AM</span></td>-->
							<!--											<td>General</td>-->
							<!--											<td>New Patient</td>-->
							<!--											<td class="text-center">$150</td>-->
							<!--											<td class="text-right">-->
							<!--												<div class="table-action">-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-info-light">-->
							<!--														<i class="far fa-eye"></i> View-->
							<!--													</a>-->
																				
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-success-light">-->
							<!--														<i class="fas fa-check"></i> Accept-->
							<!--													</a>-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-danger-light">-->
							<!--														<i class="fas fa-times"></i> Cancel-->
							<!--													</a>-->
							<!--												</div>-->
							<!--											</td>-->
							<!--										</tr>-->
							<!--										<tr>-->
							<!--											<td>-->
							<!--												<h2 class="table-avatar">-->
							<!--													<a href="patient-profile.html" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" src="assets/img/patients/patient1.jpg" alt="User Image"></a>-->
							<!--													<a href="patient-profile.html">Charlene Reed <span>#PT0001</span></a>-->
							<!--												</h2>-->
							<!--											</td>-->
							<!--											<td>3 Nov 2019 <span class="d-block text-info">11.00 AM</span></td>-->
							<!--											<td>General</td>-->
							<!--											<td>Old Patient</td>-->
							<!--											<td class="text-center">$200</td>-->
							<!--											<td class="text-right">-->
							<!--												<div class="table-action">-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-info-light">-->
							<!--														<i class="far fa-eye"></i> View-->
							<!--													</a>-->
																				
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-success-light">-->
							<!--														<i class="fas fa-check"></i> Accept-->
							<!--													</a>-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-danger-light">-->
							<!--														<i class="fas fa-times"></i> Cancel-->
							<!--													</a>-->
							<!--												</div>-->
							<!--											</td>-->
							<!--										</tr>-->
							<!--										<tr>-->
							<!--											<td>-->
							<!--												<h2 class="table-avatar">-->
							<!--													<a href="patient-profile.html" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" src="assets/img/patients/patient2.jpg" alt="User Image"></a>-->
							<!--													<a href="patient-profile.html">Travis Trimble  <span>#PT0002</span></a>-->
							<!--												</h2>-->
							<!--											</td>-->
							<!--											<td>1 Nov 2019 <span class="d-block text-info">1.00 PM</span></td>-->
							<!--											<td>General</td>-->
							<!--											<td>New Patient</td>-->
							<!--											<td class="text-center">$75</td>-->
							<!--											<td class="text-right">-->
							<!--												<div class="table-action">-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-info-light">-->
							<!--														<i class="far fa-eye"></i> View-->
							<!--													</a>-->
																				
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-success-light">-->
							<!--														<i class="fas fa-check"></i> Accept-->
							<!--													</a>-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-danger-light">-->
							<!--														<i class="fas fa-times"></i> Cancel-->
							<!--													</a>-->
							<!--												</div>-->
							<!--											</td>-->
							<!--										</tr>-->
							<!--										<tr>-->
							<!--											<td>-->
							<!--												<h2 class="table-avatar">-->
							<!--													<a href="patient-profile.html" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" src="assets/img/patients/patient3.jpg" alt="User Image"></a>-->
							<!--													<a href="patient-profile.html">Carl Kelly <span>#PT0003</span></a>-->
							<!--												</h2>-->
							<!--											</td>-->
							<!--											<td>30 Oct 2019 <span class="d-block text-info">9.00 AM</span></td>-->
							<!--											<td>General</td>-->
							<!--											<td>Old Patient</td>-->
							<!--											<td class="text-center">$100</td>-->
							<!--											<td class="text-right">-->
							<!--												<div class="table-action">-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-info-light">-->
							<!--														<i class="far fa-eye"></i> View-->
							<!--													</a>-->
																				
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-success-light">-->
							<!--														<i class="fas fa-check"></i> Accept-->
							<!--													</a>-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-danger-light">-->
							<!--														<i class="fas fa-times"></i> Cancel-->
							<!--													</a>-->
							<!--												</div>-->
							<!--											</td>-->
							<!--										</tr>-->
							<!--										<tr>-->
							<!--											<td>-->
							<!--												<h2 class="table-avatar">-->
							<!--													<a href="patient-profile.html" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" src="assets/img/patients/patient4.jpg" alt="User Image"></a>-->
							<!--													<a href="patient-profile.html">Michelle Fairfax <span>#PT0004</span></a>-->
							<!--												</h2>-->
							<!--											</td>-->
							<!--											<td>28 Oct 2019 <span class="d-block text-info">6.00 PM</span></td>-->
							<!--											<td>General</td>-->
							<!--											<td>New Patient</td>-->
							<!--											<td class="text-center">$350</td>-->
							<!--											<td class="text-right">-->
							<!--												<div class="table-action">-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-info-light">-->
							<!--														<i class="far fa-eye"></i> View-->
							<!--													</a>-->
																				
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-success-light">-->
							<!--														<i class="fas fa-check"></i> Accept-->
							<!--													</a>-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-danger-light">-->
							<!--														<i class="fas fa-times"></i> Cancel-->
							<!--													</a>-->
							<!--												</div>-->
							<!--											</td>-->
							<!--										</tr>-->
							<!--										<tr>-->
							<!--											<td>-->
							<!--												<h2 class="table-avatar">-->
							<!--													<a href="patient-profile.html" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" src="assets/img/patients/patient5.jpg" alt="User Image"></a>-->
							<!--													<a href="patient-profile.html">Gina Moore <span>#PT0005</span></a>-->
							<!--												</h2>-->
							<!--											</td>-->
							<!--											<td>27 Oct 2019 <span class="d-block text-info">8.00 AM</span></td>-->
							<!--											<td>General</td>-->
							<!--											<td>Old Patient</td>-->
							<!--											<td class="text-center">$250</td>-->
							<!--											<td class="text-right">-->
							<!--												<div class="table-action">-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-info-light">-->
							<!--														<i class="far fa-eye"></i> View-->
							<!--													</a>-->
																				
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-success-light">-->
							<!--														<i class="fas fa-check"></i> Accept-->
							<!--													</a>-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-danger-light">-->
							<!--														<i class="fas fa-times"></i> Cancel-->
							<!--													</a>-->
							<!--												</div>-->
							<!--											</td>-->
							<!--										</tr>-->
							<!--									</tbody>-->
							<!--								</table>		-->
							<!--							</div>-->
							<!--						</div>-->
							<!--					</div>-->
							<!--				</div>-->
											<!-- /Upcoming Appointment Tab -->
									   
											<!-- Today Appointment Tab -->
							<!--				<div class="tab-pane" id="today-appointments">-->
							<!--					<div class="card card-table mb-0">-->
							<!--						<div class="card-body">-->
							<!--							<div class="table-responsive">-->
							<!--								<table class="table table-hover table-center mb-0">-->
							<!--									<thead>-->
							<!--										<tr>-->
							<!--											<th>Patient Name</th>-->
							<!--											<th>Appt Date</th>-->
							<!--											<th>Purpose</th>-->
							<!--											<th>Type</th>-->
							<!--											<th class="text-center">Paid Amount</th>-->
							<!--											<th></th>-->
							<!--										</tr>-->
							<!--									</thead>-->
							<!--									<tbody>-->
							<!--										<tr>-->
							<!--											<td>-->
							<!--												<h2 class="table-avatar">-->
							<!--													<a href="patient-profile.html" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" src="assets/img/patients/patient6.jpg" alt="User Image"></a>-->
							<!--													<a href="patient-profile.html">Elsie Gilley <span>#PT0006</span></a>-->
							<!--												</h2>-->
							<!--											</td>-->
							<!--											<td>14 Nov 2019 <span class="d-block text-info">6.00 PM</span></td>-->
							<!--											<td>Fever</td>-->
							<!--											<td>Old Patient</td>-->
							<!--											<td class="text-center">$300</td>-->
							<!--											<td class="text-right">-->
							<!--												<div class="table-action">-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-info-light">-->
							<!--														<i class="far fa-eye"></i> View-->
							<!--													</a>-->
																				
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-success-light">-->
							<!--														<i class="fas fa-check"></i> Accept-->
							<!--													</a>-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-danger-light">-->
							<!--														<i class="fas fa-times"></i> Cancel-->
							<!--													</a>-->
							<!--												</div>-->
							<!--											</td>-->
							<!--										</tr>-->
							<!--										<tr>-->
							<!--											<td>-->
							<!--												<h2 class="table-avatar">-->
							<!--													<a href="patient-profile.html" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" src="assets/img/patients/patient7.jpg" alt="User Image"></a>-->
							<!--													<a href="patient-profile.html">Joan Gardner <span>#PT0006</span></a>-->
							<!--												</h2>-->
							<!--											</td>-->
							<!--											<td>14 Nov 2019 <span class="d-block text-info">5.00 PM</span></td>-->
							<!--											<td>General</td>-->
							<!--											<td>Old Patient</td>-->
							<!--											<td class="text-center">$100</td>-->
							<!--											<td class="text-right">-->
							<!--												<div class="table-action">-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-info-light">-->
							<!--														<i class="far fa-eye"></i> View-->
							<!--													</a>-->
																				
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-success-light">-->
							<!--														<i class="fas fa-check"></i> Accept-->
							<!--													</a>-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-danger-light">-->
							<!--														<i class="fas fa-times"></i> Cancel-->
							<!--													</a>-->
							<!--												</div>-->
							<!--											</td>-->
							<!--										</tr>-->
							<!--										<tr>-->
							<!--											<td>-->
							<!--												<h2 class="table-avatar">-->
							<!--													<a href="patient-profile.html" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" src="assets/img/patients/patient8.jpg" alt="User Image"></a>-->
							<!--													<a href="patient-profile.html">Daniel Griffing <span>#PT0007</span></a>-->
							<!--												</h2>-->
							<!--											</td>-->
							<!--											<td>14 Nov 2019 <span class="d-block text-info">3.00 PM</span></td>-->
							<!--											<td>General</td>-->
							<!--											<td>New Patient</td>-->
							<!--											<td class="text-center">$75</td>-->
							<!--											<td class="text-right">-->
							<!--												<div class="table-action">-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-info-light">-->
							<!--														<i class="far fa-eye"></i> View-->
							<!--													</a>-->
																				
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-success-light">-->
							<!--														<i class="fas fa-check"></i> Accept-->
							<!--													</a>-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-danger-light">-->
							<!--														<i class="fas fa-times"></i> Cancel-->
							<!--													</a>-->
							<!--												</div>-->
							<!--											</td>-->
							<!--										</tr>-->
							<!--										<tr>-->
							<!--											<td>-->
							<!--												<h2 class="table-avatar">-->
							<!--													<a href="patient-profile.html" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" src="assets/img/patients/patient9.jpg" alt="User Image"></a>-->
							<!--													<a href="patient-profile.html">Walter Roberson <span>#PT0008</span></a>-->
							<!--												</h2>-->
							<!--											</td>-->
							<!--											<td>14 Nov 2019 <span class="d-block text-info">1.00 PM</span></td>-->
							<!--											<td>General</td>-->
							<!--											<td>Old Patient</td>-->
							<!--											<td class="text-center">$350</td>-->
							<!--											<td class="text-right">-->
							<!--												<div class="table-action">-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-info-light">-->
							<!--														<i class="far fa-eye"></i> View-->
							<!--													</a>-->
																				
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-success-light">-->
							<!--														<i class="fas fa-check"></i> Accept-->
							<!--													</a>-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-danger-light">-->
							<!--														<i class="fas fa-times"></i> Cancel-->
							<!--													</a>-->
							<!--												</div>-->
							<!--											</td>-->
							<!--										</tr>-->
							<!--										<tr>-->
							<!--											<td>-->
							<!--												<h2 class="table-avatar">-->
							<!--													<a href="patient-profile.html" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" src="assets/img/patients/patient10.jpg" alt="User Image"></a>-->
							<!--													<a href="patient-profile.html">Robert Rhodes <span>#PT0010</span></a>-->
							<!--												</h2>-->
							<!--											</td>-->
							<!--											<td>14 Nov 2019 <span class="d-block text-info">10.00 AM</span></td>-->
							<!--											<td>General</td>-->
							<!--											<td>New Patient</td>-->
							<!--											<td class="text-center">$175</td>-->
							<!--											<td class="text-right">-->
							<!--												<div class="table-action">-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-info-light">-->
							<!--														<i class="far fa-eye"></i> View-->
							<!--													</a>-->
																				
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-success-light">-->
							<!--														<i class="fas fa-check"></i> Accept-->
							<!--													</a>-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-danger-light">-->
							<!--														<i class="fas fa-times"></i> Cancel-->
							<!--													</a>-->
							<!--												</div>-->
							<!--											</td>-->
							<!--										</tr>-->
							<!--										<tr>-->
							<!--											<td>-->
							<!--												<h2 class="table-avatar">-->
							<!--													<a href="patient-profile.html" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" src="assets/img/patients/patient11.jpg" alt="User Image"></a>-->
							<!--													<a href="patient-profile.html">Harry Williams <span>#PT0011</span></a>-->
							<!--												</h2>-->
							<!--											</td>-->
							<!--											<td>14 Nov 2019 <span class="d-block text-info">11.00 AM</span></td>-->
							<!--											<td>General</td>-->
							<!--											<td>New Patient</td>-->
							<!--											<td class="text-center">$450</td>-->
							<!--											<td class="text-right">-->
							<!--												<div class="table-action">-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-info-light">-->
							<!--														<i class="far fa-eye"></i> View-->
							<!--													</a>-->
																				
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-success-light">-->
							<!--														<i class="fas fa-check"></i> Accept-->
							<!--													</a>-->
							<!--													<a href="javascript:void(0);" class="btn btn-sm bg-danger-light">-->
							<!--														<i class="fas fa-times"></i> Cancel-->
							<!--													</a>-->
							<!--												</div>-->
							<!--											</td>-->
							<!--										</tr>-->
							<!--									</tbody>-->
							<!--								</table>		-->
							<!--							</div>	-->
							<!--						</div>	-->
							<!--					</div>	-->
							<!--				</div>-->
											<!-- /Today Appointment Tab -->
											
							<!--			</div>-->
							<!--		</div>-->
							<!--	</div>-->
							<!--</div>-->

						</div>
					</div>

				</div>

			</div>		
			<!-- /Page Content -->
   	<!-- Footer -->

		<?php include "footer.php" ; ?>

		<!-- /Footer -->
	</div>

	<!-- /Main Wrapper -->

	<!-- jQuery -->

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

	<!-- Bootstrap Core JS -->

	<script src="assets/js/popper.min.js"></script>

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

	<!-- Sticky Sidebar JS -->
    <script src="assets/plugins/theia-sticky-sidebar/ResizeSensor.js"></script>
    <script src="assets/plugins/theia-sticky-sidebar/theia-sticky-sidebar.js"></script>
	
	<!-- Circle Progress JS -->
	<script src="assets/js/circle-progress.min.js"></script>
		
	<!-- Slick JS -->

	<script src="assets/js/slick.js"></script>

	<!-- Custom JS -->

	<script src="assets/js/script.js"></script>
		

</body>

<!-- doccure/  30 Nov 2019 04:11:53 GMT -->

</html>