<?php 


include("tools/header.php");?>
<?php

 
$calledcatcode = "products.php";
$iscatcalled = false;
if(isset($_GET['cat'])){
  if(!empty(trim($_GET['cat']))){
      
      
      $iscatcalled=true;
      $calledcatcode = "products.php?cat=".$_GET['cat'];
  }  
    
    
}
    

if(isset($_GET['cart'])){
    
$getcartitem = $_GET['cart'];    
 
if(!empty(trim($getcartitem))){
    
   //call db for delete item
 
  $queries -> deletefactortemp("EXEC deletetempfactors @p1= ".$_SESSION['uzi']." , @p2 = ".$_SESSION['pzi'].", @ucid = ".$_SESSION['ucid'].", @kala = ".$getcartitem.", @cid = ".$_SESSION['uzi']);
    
}

header("Location: ".$calledcatcode);
}
// call for cart items
$carts = array('img' => 'assets/imgs/meats.jpg',"name" => "test","count" => "10", "id" => "1234","price" => "12321");
$cart = array();
array_push($cart,$carts);   
?>
<?php include("tools/handlesearch.php");?>

<body style="overflow-x: visible;">

    <div class="container-fluid bg-white">

        <div class="row">

            <?php include("tools/pronav.php");?>


            <div class="col-12 products-body ">


                <div class="products-top-layer"></div>
                <?php include("tools/prosearch.php");?>



                <div class="row mt-xl-5 mt-lg-4 mt-3">

                    <div class="col-xl-3 col-lg-3 col-12 order-lg-2 order-1 px-sm-0 px-lg-3 px-md-2" style="position: relative;">

                        <div class="d-flex flex-row justify-content-center align-items-start"  style="position: sticky;top: 10px;z-index: 100;" >

                            <div class="col-12 rad-10 px-0 bg-white pb-2 ">

                                <div class="rad-10  py-2 px-3 mx-1 mt-2" style="background-color: #ffe38f;" data-toggle="collapse" href="#collapsecartlist" role="button" aria-expanded="false" aria-controls="collapsecartlist">

                                    <div class="product-cart-review-title d-flex align-items-center justify-content-between">


                                        <div class="bg-d d-flex align-items-center justify-content-start text-dark shopcartbadgeholder">





                                            <a href="#" class="text-decoration-none">
                                                <div class=" d-flex align-items-center justufy-content-start text-center " style="color: #121212;">

                                                    <i class="fas  fa-arrow-down "></i>
                                                </div>
                                            </a>


                                        </div>

                                        <span>سبد خرید</span>


                                    </div>

                                </div>


                                <div class="row mt-1 px-2 pt-2 collapse show " id="collapsecartlist">




                                     <?php include("tools/procartcard.php");?>

                                </div>

                            </div>

                        </div>


                    </div>


                    <div class="col-xl-9 col-lg-9 col-12 order-lg-1 order-2 mt-lg-0 my-3 ">


                        <div class="row">



                            <?php include("tools/procard.php");?>


                        </div>


                    </div>



                </div>






            </div>

        </div>


    </div>

    
  <?php include("tools/notmodal.php");?>
    
    
    
    <?php
    
     if(!$resultofinfo){
         include("tools/nupfooter.php");
     }else{
             include("tools/profooter.php");
    
    
     }
    

    ?>
