<?php include("header.php");
 include("side.php");
 include("../db.php");
 $id=$_GET['id'];

?>
<link rel="stylesheet" type="text/css" href="css/boot.css">
            <div id="layoutSidenav_content">
                <main>
                    <div class="container-fsluid">
                        <h2 class="mt-30 page-title">&nbsp;&nbsp;Product</h2>
                        <ol class="breadcrumb mb-30">
                            <li class="breadcrumb-item"><a href="index.php">Dashboard</a></li>
                            <li class="breadcrumb-item"><a href="products.php?main=7&cat=1">Product</a></li>
                            <li class="breadcrumb-item active">Product view</li>
                        </ol>
                        <div class="row">
							<div class="col-lg-6 col-lg-offset-3 col-md-6">
								<div class="card card-static-2 mb-30">
									<div class="card-body-table">
										<div class="shopowner-content-left text-center pd-20">
										<?php 	$sql=mysqli_query($conn,"SELECT * FROM `product` WHERE id='$id'");
											while ($row=mysqli_fetch_object($sql)) {
												// $admin_id=$row->admin_id;
											 ?>

											<div style="display: inline-block;">
												
												
												<?php if(isset($row->image1)){ echo '<img class="mySlides shop_img" src=../uploads/'.$row->image1; } else { echo '<img class="mySlides shop_img"  src="images/product/img-1.jpg" alt="">'; } ?>
												
												<?php if(isset($row->image2)){ echo '<img class="mySlides shop_img"  src=../uploads/'.$row->image2; } else { echo '<img class="mySlides shop_img"  src="images/product/img-1.jpg" alt="">'; } ?>

												<?php if(isset($row->image3)){ echo '<img class="mySlides shop_img"  src=../uploads/'.$row->image3; } else { echo '<img class="mySlides shop_img"  src="images/product/img-1.jpg" alt="">'; } ?>

												<button class="w3-button w3-display-left" onclick="plusDivs(-1)">&#10094;</button>
												<button class="w3-button w3-display-right" onclick="plusDivs(+1)">&#10095;</button>

											</div>

											<ul class="product-dt-purchases">
												<li>
													<div class="product-status">
													 <span class="badge-item-2 badge-status"><?=$row->product_name;?></span>
													</div>
												</li>
												<li>
													<div class="product-status">
														<span class="badge-item-2 badge-status"><?php if($row->status='1'){ echo 'Active'; } else { echo 'Unactive'; };?></span>
													</div>
												</li>
											</ul>
											<div class="shopowner-dts">
												<div class="shopowner-dt-list">
													<span class="left-dt">Product Name</span>
													<span class="right-dt"><?=$row->product_name;?></span>
												</div>
												<div class="shopowner-dt-list">
													<span class="left-dt">Category</span>
													<span class="right-dt"><?=$row->category;?></span>
												</div>
												<div class="shopowner-dt-list">
													<span class="left-dt">Price</span>
													<span class="right-dt"><?=$row->price;?></span>
												</div>
												<div class="shopowner-dt-list">
													<span class="left-dt"><?=$row->detail;?></span>
													<!-- <span class="right-dt"><?=$row->detail;?></span> -->
												</div>
	
											</div>
										<?php } ?>
										</div>
									</div>
								</div>
							</div>


						<!-- 	<div class="col-lg-6 col-md-6">
								<div class="card card-static-2 mb-30">
									<div class="card-body-table">
										<div class="shopowner-content-left text-center pd-20">
											<?php 	$sql=mysqli_query($conn,"SELECT * FROM `shops` WHERE id='$admin_id'");
											while ($row=mysqli_fetch_object($sql)) {
												$admin_id=$row->admin_id;
											 ?>

											<div style="display: inline-block;">
												
												
												<?php if(isset($row->image)){ echo '<img class="mySlides shop_img" src=../uploads/'.$row->image; } else { echo '<img class="mySlides shop_img"  src="images/product/img-1.jpg" alt="">'; } ?>
												
												
												<button class="w3-button w3-display-left" onclick="plusDivs(-1)">&#10094;</button>
												<button class="w3-button w3-display-right" onclick="plusDivs(+1)">&#10095;</button>

											</div>

											<ul class="product-dt-purchases">
												<li>
													<div class="product-status">
													 <span class="badge-item-2 badge-status"><?=$row->product_name;?></span>
													</div>
												</li>
												<li>
													<div class="product-status">
														<span class="badge-item-2 badge-status"><?php if($row->status='1'){ echo 'Active'; } else { echo 'Unactive'; };?></span>
													</div>
												</li>
											</ul>
											<div class="shopowner-dts">
												<div class="shopowner-dt-list">
													<span class="left-dt">Product Name</span>
													<span class="right-dt"><?=$row->product_name;?></span>
												</div>
												<div class="shopowner-dt-list">
													<span class="left-dt">Category</span>
													<span class="right-dt"><?=$row->category;?></span>
												</div>
												<div class="shopowner-dt-list">
													<span class="left-dt">Price</span>
													<span class="right-dt"><?=$row->price;?></span>
												</div>
												<div class="shopowner-dt-list">
													<span class="left-dt"><?=$row->detail;?></span>
													<!-- <span class="right-dt"><?=$row->detail;?></span> -->
												</div>
	
											</div>
										<?php } ?>
										</div>
									</div>
								</div>
							</div>
 -->



                        </div>
                    </div>
                </main>
               <?php include("footer.php"); ?>

               <script>
               	var slideIndex = 1;
showDivs(slideIndex);

function plusDivs(n) {
  showDivs(slideIndex += n);
}

function showDivs(n) {
  var i;
  var x = document.getElementsByClassName("mySlides");
  if (n > x.length) {slideIndex = 1}
  if (n < 1) {slideIndex = x.length} ;
  for (i = 0; i < x.length; i++) {
    x[i].style.display = "none";
  }
  x[slideIndex-1].style.display = "block";
}
               </script>