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

<?php include "head.php" ; ?>
<style>
    .event-box img {
        height: 300px;
        width: 100%;
        min-height: 100%;
    }
    .event-title {
        font-weight: 500;
        color: #4b94e5;
        /*width: 40%;*/
    }
    .event-para {
        /*width: 60%;*/
        margin-left: 10px;
    }
</style>
<body>
	<!-- Main Wrapper -->

	<div class="main-wrapper">

		<!-- Header -->

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

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

		
			<!-- Breadcrumb -->
			<?php include "breadcrumbuser.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 "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-4">
													<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>Applied</h6>
															<h3>
															<?php
            											        $post_sql = "SELECT count(apply_id) as tot FROM apply_request WHERE user_id = '$user_id' " ;
            											     //   $post_sql = "SELECT count(apply_id) as tot FROM apply_request WHERE user_id = '$user_id' And apply_status = 2 " ;
            											        $post_res = $config->query($post_sql);
            											        $post = $post_res->fetch_assoc();
            											        echo $post['tot'];
            											    ?>
															</h3>
														</div>
													</div>
												</div>
												
												<div class="col-md-12 col-lg-4">
													<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>Wallet</h6>
															<h3><?= empty($row['total_amount']) ? 0 : $row['total_amount']; ?></h3>
														</div>
													</div>
												</div>
												
												<div class="col-md-12 col-lg-4">
													<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>Notification</h6>
															<h3>0</h3>
														</div>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>
							
							<div class="row">
								<div class="col-md-7 col-lg-8 col-xl-9">
						    <?php
						        $sno = 1;
								$sql = "SELECT * FROM report_master WHERE customer_id = '$user_id' AND status = 1 ORDER BY id DESC " ;
						        $res = $config->query($sql);
						        if($res->num_rows > 0){
						    ?>
							<div class="card card-table">
								<div class="card-body">
								
									<!-- Invoice Table -->
									<div class="table-responsive">
										<table class="table table-hover table-center mb-0">
											<thead>
												<tr>
													<th>Invoice No</th>
													<th>Category</th>
													<th>Package</th>
													<th>Type</th>
													<th>Amount</th>
													<th>Validity</th>
													<th>Action</th>
													<th></th>
												</tr>
											</thead>
											<tbody>
											     <?php
        									        while($list = $res->fetch_assoc()){
        									            $status = $list['status'];
        									            $cate_id = $list['cate_id'];
        									            $sub_cate_id = $list['sub_cate_id'];
        									            $job_id = $list['job_id'];
        									            $id = $list['id'];
        									    ?>
												<tr>
													<td>
														<a href="invoice-view.html">#INV<?= date('my') ?><?= substr($list['category'],0,1) ?><?= $list['id'] ?></a>
													</td>
													<td><?= $list['category'] ?></td>
													<td><?= $list['package'] ?></td>
													<td><?= $list['type'] ?></td>
													<td>Rs.<?= $list['price'] ?></td>
													<td><?= $list['validity'] ?> Days</td>
													<!--<td>14 Nov 2019</td>-->
													<td class="text-right">
														<div class="table-action">
															<a href="invoice-view.php?invoice=<?= $id ?>" 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-primary-light">
																<i class="fas fa-print"></i> Print
															</a>
														</div>
													</td>
												</tr>
												<?php $sno++; } ?>
											</tbody>
										</table>
									</div>
									<!-- /Invoice Table -->
									
								</div>
							</div>
							<?php }else{ ?>
							<div class="row d-flex justify-content-center align-items-center" style="height:50vh;">
							    <img src="assets/img/noresult.png" class="img-fluid">
							</div>
							<?php } ?>
						</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>




















