<?php
    include "head.php" ;
    session_start();
    date_default_timezone_set("Asia/Kolkata");

    if(isset($_SESSION['user_id']) && isset($_SESSION['user_name']) && $_SESSION['user_cate'] === "vendor"){
        $user_id = $_SESSION['user_id'] ;
        $username = $_SESSION['user_name'] ;
        $email = $_SESSION['user_email'] ;
        $phone = $_SESSION['user_phone'] ;
        $company = $_SESSION['company'] ;
        $vendor_image = $_SESSION['vendor_image'] ;
    }else{
        header("Location:vendor_login.php") ;
    }
?>

	<body>

		<!-- Main Wrapper -->
		<div class="main-wrapper">
		
			<!-- Header -->
			<?php include "header.php" ; ?>
			<!-- /Header -->
			
			<!-- 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="d-flex justify-content-between align-items-start">
        							    <h4 class="mb-4">User List</h4>
        							    <a href="add_user.php" class="btn btn-sm bg-primary-light">Back</a>
        							</div>
									<div class="appointment-tab">

										<div class="tab-content">
										
											 <!--Upcoming Appointment Tab -->
											<div class="tab-pane show active" id="active">
												<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>S.No</th>
																		<th>Name</th>
																		<!-- <th>Initial</th> -->
																		<th>Mobile Number</th>
																		<th>Email Id</th>
																		<th>City</th>
																	</tr>
																</thead>
																<tbody>
																    <?php
																        $sno = 1;
                                        						        $pro_sql = "SELECT * FROM user_profile WHERE ref_id = '$user_id' " ;
                                        						        $pro_res = $config->query($pro_sql);
                    											        while($pro = $pro_res->fetch_assoc()){
                    											            $uid = $pro['user_id'];
																    ?>
																	<tr>
																	    <td><?= $sno;?></td>
																	    <td>
																			<h2 class="table-avatar">
																				<a href="javascript:void(0);" class="avatar avatar-sm mr-2"><img class="avatar-img rounded-circle" 
																				src="assets/img/<?= (empty($pro['up_image'])) ? 'no-avatar.png' : 'user/profile/'.$pro['up_image'] ; ?>" alt="User <?= $pro['user_name'] ?> Image"></a>
																				<a href="javascript:void(0);"><?= $pro['user_name'] ?></a>
																			</h2>
																		</td>
																		<?php
    																		$ref_sql = $config->query("SELECT * FROM master_login WHERE Master_id = '$uid' AND Master_Type = 3 ") ;
    																		$ref = $ref_sql->fetch_assoc();
                                        						        ?>
                                        						        <!-- <td><?= $ref['name_initial'] ?></td> -->
																		<td><?= $ref['Master_phone'] ?></td>
																		<td><?= $ref['Master_Username'] ?></td>
																		<td><?= $pro['city'] ?></td>
																	</tr>
																		<?php  $sno++;} ?>
																
																</tbody>
															</table>		
														</div>
													</div>
												</div>
											</div>
											 <!--/Upcoming Appointment Tab -->
											
										</div>
									</div>
								</div>
							</div>

						</div>
					</div>

				</div>

			</div>		
			<!-- /Page Content -->
   
			<!-- Footer -->
		    <?php include "footer.php" ; ?>
			<!-- /Footer -->
		   
		</div>
		<!-- /Main Wrapper -->
		<!-- custom style -->
	    <style>
	        .show-icon {
                position: absolute;
                cursor: pointer;
                right: 15px;
                top: 50%;
                transform: translateY(-50%);
                font-size: 13px;
                color: #9d9b9b;
            }
	    </style>
	    <!-- custom script -->
	    <script>
	        const password = document.getElementById('password');
	        const icon = document.getElementById('pass-icon');
	        function showhide(){
	            if(password.type === "password"){
	                password.setAttribute("type","text");
	                icon.setAttribute("class","fas fa-eye show-icon");
	            }else{
	                password.setAttribute("type","password");
	                icon.setAttribute("class","fas fa-eye-slash show-icon");
	            }
	        }
	        
	    </script>
		<!-- 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>
		
		<!-- Select2 JS -->
		<script src="assets/plugins/select2/js/select2.min.js"></script>
		
		<!-- Dropzone JS -->
		<script src="assets/plugins/dropzone/dropzone.min.js"></script>
		
		<!-- Bootstrap Tagsinput JS -->
		<script src="assets/plugins/bootstrap-tagsinput/js/bootstrap-tagsinput.js"></script>
		
		<!-- Profile Settings JS -->
		<script src="assets/js/profile-settings.js"></script>
		
		<!-- Custom JS -->
		<script src="assets/js/script.js"></script>
		<script>
    		<?php if(isset($_SESSION['status']) && !empty($_SESSION['status'])) { ?>
    		    swal({
                  title: "<?= $_SESSION['status'] ?>",
                  text: "",
                  icon: "<?= $_SESSION['alert'] ?>",
                });
            <?php unset($_SESSION['status']) ; } ?>
        </script>
        <script>
    		<?php if(isset($_SESSION['check']) && !empty($_SESSION['check'])) { ?>
    		    swal({
                    title: "<?= $_SESSION['check'] ?>", 
                    text: "",
                    icon: "<?= $_SESSION['alert'] ?>",
                });
            <?php unset($_SESSION['check']) ; } ?>
        </script>
	</body>

<!-- doccure/doctor-profile-settings.html  30 Nov 2019 04:12:15 GMT -->
</html>