<?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);
 exit();	
}
// 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"  style="position: relative;">

        <div class="row bg-white" style="position: sticky;top: 0px;z-index: 150;">

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

            
            <div class="col-12 py-2 border-bottom border-light" style="background-color: #27a795;">

                <div class="d-flex flex-row align-items-center justify-content-center">


                    <div class="col-xl-10 col-lg-12 text-dark px-0 ">


                        <nav aria-label="breadcrumb text-right" dir="rtl">
                            <ol class="breadcrumb m-0" style="background-color: #00000000;color: white;">
                                <li class="breadcrumb-item px-1"><a class="text-decoration-none breadcrumptitles" href="index.php">بازگشت به صفحه اصلی</a></li> 
                                <li class="breadcrumb-item px-1 active breadcrumptitlesactive" aria-current="page">دسته بندی -> <?php echo $selectedcategory;?></li>
                            </ol>
                        </nav>

                    </div>

                </div>

            </div>

 

        </div>


        <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 mb-4" style="position: relative;">

                <div class="" style="position: sticky;top: 217px;z-index: 100;">



                <div class="mb-3 rounded" style="background-color: #f3f3f3;">



                    <div class="brandsheader rounded" style="position: relative;height: 40px;overflow: hidden;">



                        <div style="position: absolute; top: 0%;right: 0%;width: 100%;height: 5px;z-index: 2;background-color: #20b2aa;"></div>
                        <div class="text-right d-flex align-items-center justify-content-end px-3" style="position: absolute; top: 0%;right: 0%;min-width: 50%;height: 30px;z-index: 2;background-color: #20b2aa;clip-path: polygon(0 0, 100% 0, 100% 100%, 15% 99%);">

                            <span style="font-size: 0.85rem; color: #fff; font-weight: 700;">برندها</span>

                        </div>





                    </div>

                    <div class="d-flex flex-wrap p-2 justify-content-end">
                               
                             <?php include("tools/mainprobrands.php");?>

                    </div>




                </div>



                <div class="mb-3 rounded" style="background-color: #f3f3f3;">



                    <div class="brandsheader rounded" style="position: relative;height: 40px;overflow: hidden;">



                        <div style="position: absolute; top: 0%;right: 0%;width: 100%;height: 5px;z-index: 2;background-color: #4b4a8e;"></div>
                        <div class="text-right d-flex align-items-center justify-content-end px-3" style="position: absolute; top: 0%;right: 0%;min-width: 50%;height: 30px;z-index: 2;background-color: #4b4a8e;clip-path: polygon(0 0, 100% 0, 100% 100%, 15% 99%);">

                            <span style="font-size: 0.85rem; color: #fff; font-weight: 700;">سبد خرید</span>

                        </div>





                    </div>
					
					
                        <div class="d-flex align-items-center justify-content-between mx-2">

                            <a href="cart.php" class="btn btn-warning"><span class=" " style="font-size: 0.8rem; color: #121212; font-weight: 700;">مشاهده</span></a>
                            <span class=" " style="font-size: 0.85rem; color: #121212; font-weight: 700;">لیست اقلام</span>

                        </div>

                    <div class="row pt-2 pb-3 collapse show" id="collapsecartlist" style="">
                       
                          <?php include("tools/mainprocartcard.php");?>
                        
                        
                        
                    </div>
                    
                    




                </div>

                <div class="mb-3 rounded" style="background-color: #f3f3f3;">



                    <div class="brandsheader rounded" style="position: relative;height: 40px;overflow: hidden;">



                        <div style="position: absolute; top: 0%;right: 0%;width: 100%;height: 5px;z-index: 2;background-color: #87cefa;"></div>
                        <div class="text-right d-flex align-items-center justify-content-end px-3" style="position: absolute; top: 0%;right: 0%;min-width: 50%;height: 30px;z-index: 2;background-color: #87cefa;clip-path: polygon(0 0, 100% 0, 100% 100%, 15% 99%);">

                            <span style="font-size: 0.85rem; color: #fff; font-weight: 700;">دسته بندی ها</span>

                        </div>





                    </div>

                    <div class="d-flex flex-wrap p-2 justify-content-end">
  <?php include("tools/mainprocats.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="flex-row-reverse row">


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


                        </div>

            </div>

        </div>


    </div>

    
 <?php include("tools/notmodal.php");?>
<div class="modal" id="infomodal" tabindex="-1" >
  <div class="modal-dialog modal-dialog-scrollable">
    <div class="modal-content">
      <div class="bg-success rounded m-1 p-1 d-flex align-items-center justify-content-between">
        
        <button type="button" class="close bg-white d-flex align-items-center justify-content-center py-1 px-2 rounded" data-dismiss="modal" aria-label="Close">
          <span class="m-0 p-0 text-dark" aria-hidden="true">&times;</span>
        </button>
          
          <h5 class="modal-title text-white h6">اطلاعات محصول</h5>
      </div>
      <div class="modal-body text-right">
       
          <div class="row m-1 bg-light rounded py-2" id="infomodaldata">
          
              

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

    ?>
