<?php


include("tools/header.php");?>
<?php
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: cart.php");
}
?>
<?php include("tools/cartdataset.php");?>
<?php include("tools/cartforms.php");?>


<body>

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

        <div class="row">

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

            <div class="col-12 cart-top-layer-container  getshadow">

                <div class="cart-top-layer-back greenblue"></div>
                <div class="cart-top-layer greenbluedark"></div>
                <div class="cart-top-layer-img"></div>

                <div class="d-flex flex-row justify-content-center bg-dark align-items-center mt-lg-5 mt-3">

                    <div class="col-xl-9 col-lg-10 col-md-11 ">

                        <div class="h3 font-weight-bold text-white text-right ">سبد خرید محصولات</div>

                    </div>

                </div>






            </div>

            
            

            <div class="col-12 products-body mb-md-5 px-0" style="overflow: hidden;">




 

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


                <div class="d-flex flex-row justify-content-center mt-xl-5 my-lg-5 my-md-3">



                    <div class="col-xl-8 col-lg-9 col-md-10 col-12 px-0">

                        <div class="d-flex flex-row justify-content-center align-items-start" style="position:-webkit-sticky; position:sticky; top:0;">

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

								 <div class="rad-10 py-3 px-4 greenbluedark mx-2 my-2">

                                    <div class="product-cart-review-title   text-white text-right">



                                        <div>لیست اقلام سبد خرید</div>



                                    </div>

                                </div>
								
								



                                <div class="row mt-1 px-2 pt-2">
                                    
                                    

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

 

                                </div>



                                <div class="mt-4 mb-1 mx-1">

                                    <div class="greenbluedark rad-10 py-3 px-3">

										                                    

                                    <div class="product-cart-review-title   text-white text-right mb-3">



                                        <div>قیمت کل: 
                                        
                                        <?php $totalpriceofcartz = $queries -> fa_number($queries -> getFactorTotal("Exec calc_temp_factor_total @cod_cast = '".$_SESSION['uzi']."', @ucid = '".$_SESSION['ucid']."'"));echo $totalpriceofcartz;?> 
                                        
                                        ریال
                                        
                                        </div>



                                    </div>
										
										
                                        <div class="m-2">

                                            <form class="" dir="rtl" method="post" action="cart.php">
                                                <div class="form-row ">

                                                    <div class="col-12  text-right" style="font-size: 0.85rem; color: #fff; font-weight: 700;">

                                                        <div class="">یادداشت فاکتور</div>
                                                    </div>

                                                    <div class="col-12  d-flex align-items-center mt-2">
                                                        <textarea class="form-control border-0" cols="3" name="cartnote"></textarea>
                                                    </div>

													
													
													<div class="col-12 text-right mt-3 " style="font-size: 0.9rem; color: #121212; font-weight: 400;">
													
													     <div class="p-2 bg-white rounded-sm">لطفا فاکتور های خود را تنها در ساعت های بین 9 صبح تا 10 شب ارسال نمایید</div>
													</div>

                                                    <div class="col-12  text-right mt-4">



                                                        <button type="submit" class="btn btn-light mt-2 px-5" name="submitcart">پرداخت و ثبت فاکتور</button>
                                                    </div>


                                                </div>
                                            </form>

                                        </div>
                                    </div>

                                </div>

                            </div>

                        </div>


                    </div>




                </div>





            </div>




        </div>
    </div>



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