<?php require_once("../resources/config.php"); 
    
$query = query(" SELECT * FROM products WHERE product_id =" . escape_string($_GET['id']) . " " );

confirm($query);

while($row = fetch_array($query)):

$naziv = $row['product_title']; 
$categoryname = show_product_category_title($row['product_category_id']);

?>

<!DOCTYPE html>
<html lang="sr">

<?php include(TEMPLATE_FRONT . DS . "head.php"); ?>
    
<body>
    
<span class="loader"></span>
<header>
    <?php include(TEMPLATE_FRONT . DS . "header.php");?>   
</header>
<section class="banner pb-0" style="background-color: #f7f7f7 ;">
  <div class="container">
    <ol class="breadcrumb">
      <li class="breadcrumb-item">
        <a href="index.php">Početna</a>
      </li>
        <li class="breadcrumb-item">
        <a href="#"><?php echo $categoryname; ?></a>
      </li>
    </ol>
  </div>
</section>
    
    
<section class="gap no-top" style="background-color: #f7f7f7 ;">
  <div class="container">
    <div class="row">
        <div class="col-lg-6">
        <div class="pd-gallery">
          
            <div class="pd-main-img">
              <img id="NZoomImg" alt="ballon" src="../resources/<?php echo display_image($row['product_image']); ?>" >
              
            </div>
        </div>
      </div>
      <div class="col-lg-6">
        <div class="product-info">
            <div class="d-flex align-items-center"><p><?php echo $categoryname; ?></p></div>    
          <h2><?php echo $row['product_title']; ?></h2>
          
          <div class="price">
            <div>
              <div class="d-flex"><h3><?php echo $row['product_price']; ?> din.</h3></div>
              <span class="dots">Na stanju, <?php echo $row['product_quantity']; ?> komada</span>
              <div class="quantity">
                <h6>Količina:</h6>
                <input type="number" class="input-text" step="1" min="1" name="quantity" value="1">
              </div>
              <div class="add-to-cart">
                <a href="../resources/cart.php?add=<?php echo $row['product_id']    ; ?>" class="btn"><span>Dodaj u korpu</span></a>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="col-lg-6">
        <div class="payment-methods">
<!--
          <ul class="product_meta">
                <li><span class="theme-bg-clr">Kategorije:</span>
                  <?php get_categories3(); ?>
                </li>
          </ul>
-->
          <ul class="social-media ">
            <li><a href="#"><i class="fa-brands fa-facebook-f"></i></a></li>
            <li><a href="#"><i class="fa-brands fa-instagram"></i></a></li>
            <li><a href="#"><i class="fa-brands fa-tiktok"></i></a></li>
            <li><a href="#"><i class="fa-brands fa-youtube"></i></a></li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</section>
<section class="gap">
  <div class="container">
    <div class="comment mt-0">
      <h3>Opis</h3>
      <div class="boder"></div>
      <p><?php echo $row['product_description']; ?></p>
      <div class="party-balloons">
        <ul>
          <li><img alt="chak" src="assets/img/chak.png">Wide Selection Of Foil Balloons</li>
          <li><img alt="chak" src="assets/img/chak.png">Latex Balloons For Valentine's Day</li>
          <li><img alt="chak" src="assets/img/chak.png">Best Options In Balloons Themes</li>
          <li><img alt="chak" src="assets/img/chak.png">completely elegant & classy for your loved one.</li>
        </ul>
        </div>
    </div>
  </div>
</section>
<section class="gap no-top">
  <div class="container">
    <div class="comment mt-0">
      <h3>You May Also Like</h3>
            <div class="boder"></div>
    </div>
    <div class="product-slider two owl-carousel owl-theme">
      <div class="item">
        <div class="product-style">
          <img alt="img" src="https://via.placeholder.com/195x210">
          <a href="#">
            <h5>Love Script Silver Baloon</h5>
          </a>
            <h6>$28.61</h6>
            <span>In stock, 21 units</span>
            <div class="add-to-cart">
              <a href="#" class="btn"><span>Add to Cart</span></a>
              <a href="#" class="heart-wishlist">
                <i class="fa-regular fa-heart"></i>
              </a>
            </div>
        </div>
      </div>
      <div class="item">
        <div class="product-style">
          <img alt="img" src="https://via.placeholder.com/195x210">
          <h4>Save 16%</h4>
          <a href="#">
            <h5>Birthday Party Balloon Decoration</h5>
          </a>
            <div class="d-flex"><h6>$16.69</h6><del>20.20</del></div>
            <span>In stock, 21 units</span>
            <div class="add-to-cart">
              <a href="#" class="btn"><span>Add to Cart</span></a>
              <a href="#" class="heart-wishlist">
                <i class="fa-regular fa-heart"></i>
              </a>
            </div>
        </div>
      </div>
      <div class="item">
        <div class="product-style">
          <img alt="img" src="https://via.placeholder.com/195x210">
          <a href="#">
            <h5>Party Love Box Balloon</h5>
          </a>
            <h6>$28.61</h6>
            <span>In stock, 21 units</span>
            <div class="add-to-cart">
              <a href="#" class="btn"><span>Add to Cart</span></a>
              <a href="#" class="heart-wishlist">
                <i class="fa-regular fa-heart"></i>
              </a>
            </div>
        </div>
      </div>
      <div class="item">
        <div class="product-style">
          <img alt="img" src="https://via.placeholder.com/195x210">
          <h4>Save 16%</h4>
          <a href="#">
            <h5>Red Heart Balloon Decoration</h5>
          </a>
            <div class="d-flex"><h6>$16.69</h6><del>20.20</del></div>
            <span>In stock, 21 units</span>
            <div class="add-to-cart">
              <a href="#" class="btn"><span>Add to Cart</span></a>
              <a href="#" class="heart-wishlist">
                <i class="fa-regular fa-heart"></i>
              </a>
            </div>
        </div>
      </div>
      <div class="item">
        <div class="product-style">
          <img alt="img" src="https://via.placeholder.com/195x210">
          <a href="#">
            <h5>Mattalic Latex Balloons</h5>
          </a>
            <h6>$28.61</h6>
            <span>In stock, 21 units</span>
            <div class="add-to-cart">
              <a href="#" class="btn"><span>Add to Cart</span></a>
              <a href="#" class="heart-wishlist">
                <i class="fa-regular fa-heart"></i>
              </a>
            </div>
        </div>
      </div>
      <div class="item">
        <div class="product-style">
          <img alt="img" src="https://via.placeholder.com/195x210">
          <a href="#">
            <h5>Party Love Box Balloon</h5>
          </a>
            <h6>$28.61</h6>
            <span>In stock, 21 units</span>
            <div class="add-to-cart">
              <a href="#" class="btn"><span>Add to Cart</span></a>
              <a href="#" class="heart-wishlist">
                <i class="fa-regular fa-heart"></i>
              </a>
            </div>
        </div>
      </div>
    </div>
  </div>
</section>  

    <?php endwhile; ?>
<footer class="gap">
    <?php include(TEMPLATE_FRONT . DS . "footer.php");?>  
</footer>
<!-- progress -->
<div id="progress">
      <span id="progress-value"><i class="fa-solid fa-arrow-up"></i></span>
</div>
<!-- jQuery -->
<script src="assets/js/jquery-3.6.0.min.js"></script>
<!-- Bootstrap Js -->
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/owl.carousel.min.js"></script>
<!-- fancybox -->
<script src="assets/js/jquery.fancybox.min.js"></script>
<script src="assets/js/custom.js"></script>
</body>
</html>