<?php include("header.php");
 include("side.php");
 include("../db.php");

?>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.22/css/jquery.dataTables.css">
  
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.js">
</script>

<style >
	.badge-statuss {
    color: #fff;
    background-color:red!important;

}
/*.add-cate-img {
 padding: 0px 0px!important;
}*/
</style>
            <div id="layoutSidenav_content">
                <main>
                    <div class="container-fluid">
                        <h2 class="mt-30 page-title">Shops</h2>
                        <ol class="breadcrumb mb-30">
                            <li class="breadcrumb-item"><a href="index.php">Dashboard</a></li>
                            <li class="breadcrumb-item active">Shops</li>
                        </ol>
                        <div class="row justify-content-between">
							<div class="col-lg-12">
								<a href="add_shop.php" class="add-btn hover-btn">Add New</a>
							</div>
							
							<div class="col-lg-12 col-md-12">
								<div class="card card-static-2 mt-30 mb-30">
									<div class="card-title-2">
										<h4>All Shops</h4>
									</div>
									<div class="card-body-table">
										<div class="table-responsive">
											<table class="table ucp-table table-hover" id="table_id">
												<thead>
													<tr>
														<th style="width:60px">ID</th>
														<th>Image</th>
														<th>Shop Name</th>
														<th>Category</th>
														<th style="width: 200px;">Name</th>
														<th style="width: 200px;">Mobile</th>
														<th style="width: 120px;">Status</th>
														<th style="width: 150px;">Action</th>
													</tr>
												</thead>
												<tbody>
													<?php 
													$sql=mysqli_query($conn,"SELECT * FROM `shops` WHERE 1");
													$sn='1';
													while ($row=mysqli_fetch_object($sql)) {
													?>		
													<tr>
														<td><?=$sn++;?></td>
														<td><div class="cate-img">
															<?php if(isset($row->image)){
															echo '<img src="../images/noimage.png" alt="">';

															} else{
															echo '<img src="../uploads/<?=$row->image;?>" alt="">';
															}
															?>
															</div>
														</td>
														<td><?=$row->shop_name;?></td>
														<td><?=$row->categtory;?></td>
														<td><?=$row->name;?></td>
														<td><?=$row->mobile;?></td>
														<td>
															<?php if($row->status == '1' or $row->status == '2'){ echo '<span class="badge-item badge-status"> Active</span>'; } else { echo '<span class="badge-item badge-statuss"> Deactive</span>'; }?></span></td>
														<td class="action-btns">
														
														<td class="action-btns">
															<a href="shop_view.html" class="view-shop-btn"><i class="fas fa-eye"></i></a>
															<a href="shop_products.html" class="list-btn"><i class="fas fa-list-alt"></i></a>
															<a href="#" class="edit-btn"><i class="fas fa-edit"></i></a>
														</td>
													</tr>
													<?php } ?>
													
												</tbody>
											</table>
										</div>
									</div>
								</div>
							</div>
                        </div>
                    </div>
                </main>
               <?php include("footer.php"); ?>