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 (0750) :  /home2/imyrqtmy/public_html/agriba/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/agriba/guest-checkout.php
<?php require 'includes/db-conn.inc.php';?>
<!DOCTYPE html>
<html lang="en">
   <meta http-equiv="content-type" content="text/html;charset=utf-8" />
   <head>
       <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
        <link rel="stylesheet" href="css/index.css">
        <link rel="stylesheet" href="css/checkout.css">
     <?php  include 'includes/head.php'; ?>
     <style>
        #coupon-box{
  display: none;
 }  
 #coupon-box2{
  display: none;
 }
     </style>
   </head>
   <body>
      <div class="backdrop"></div>
      <a class="backtop fas fa-arrow-up" href="#"></a>
      <?php include 'includes/top-header.php';
            include 'includes/header.php';
            include 'includes/website-menu.php'; 
         include 'includes/side-category.php';
         // // include 'includes/cart-sidebar.php';
         //    include 'includes/side-menu.php';
            include 'includes/mobile-footer.php';
         ?>
      <section class="inner-section checkout-part">
         <div class="container">
            <div class="row">
               <div class="col-lg-12">
                  <div class="alert-info">
                     <h3>Checkout</h3>
                  </div>
               </div>
               <div class="col-lg-12">
                  <div class="account-card">
                     <div class="account-title">
                        <h4>Your order</h4>
                     </div>
                     <div class="account-content">
                        <div class="table-scroll">
                           <table class="table-list">
                              <thead>
                                 <tr>
                               
                                    <th scope="col">Product</th>
                                    <th scope="col">Price</th>
                                    <th scope="col">Remove</th>
                                 </tr>
                              </thead>
                              <tbody>
<?php 

      
                        $sqlp=mysqli_query($conn,"select * from tbl_product") or die(mysqli_query($conn));
                          while($rowp =mysqli_fetch_assoc($sqlp)){
                            $productName[$rowp['productid']] = $rowp['productname'];
                            $imageName[$rowp['productid']]   = $rowp['thumb1'];
                            $productId[$rowp['productid']]   = $rowp['productid'];
                            $productsku[$rowp['productid']]   = $rowp['skucode'];
                          }
                           $total = 0;
                           // $shippingcharge =0;
                        if(mysqli_num_rows($sqlc)>0){


$sqlcc=mysqli_query($conn,"select * from tbl_order_details where order_id='$cartkey'") or die(mysqli_query($conn));
                        while($rowcc = mysqli_fetch_assoc($sqlcc)){

                            $total += ($rowcc['price'] * $rowcc['quanitity']);
                             "Rs. ".$rowcc['price'] * $rowcc['quanitity']; 

                               // $shippingcharge +=$rowc['shipping'];
                               $orderidd =$rowcc['order_id'];
                               $quantity =$rowcc['quanitity'];
                               $price =$rowcc['price'];
                               $sku =$rowcc['sku'];
                               $size =$rowcc['size'];
                               $unit =$rowcc['unit'];
                          ?>
                                 <tr>
                                    <td class="table-image"><img src="media/product/thumb/<?php echo $imageName[$rowcc['product_id']]; ?>" style="width: 100px;border: 1px solid lightgrey;border-radius: 7px;" alt="product"><p><?php echo substr($productName[$rowcc['product_id']],0,50);?><small> × <b><?php echo $quantity; ?></b></small></p>
                                     <?php if($size=='0') {  } else { echo "<p style='font-size:12px'> $size</p>"; } ?>
                                    </td>
                                    <td class="table-name">
                                       <h6>₹ <?php echo ($quantity * $price); ?></h6>
                                    </td>
                                    <td class="table-action"><a class="trash removecart" itemid="<?php echo $rowcc['id'];?>" href="#" title="Remove Wishlist"><i class="icofont-trash"></i></a></td>
                                 </tr>
                     <?php }
                        }
                        else
                        {
                           echo "<script>location.href='index.php';</script>";
                        }


                        ?>   
                              </tbody>
                           </table>
                        </div>
                        <div class="chekout-coupon" style="display: none;">
                           <button class="coupon-btn">Do you have a coupon code?</button>
                           <div class="coupon-form" style="display: flex;">
                              <input type="text" placeholder="Enter your coupon code" id="coupon_str" style="text-transform: uppercase;">
                              
                              <button type="submit" onclick="set_coupon()"><span>apply</span></button>
                           </div>
                           <div id="coupon_result" style="font-weight: 400;font-size: 12px;margin-top: 9px;padding-left: 19px;"></div>
                        </div>
                        <div class="checkout-charge">
                           <ul>
                              <li><span>Sub total</span><span>₹ <?php echo $total;?></span></li>
                              <li><span>Delivery Charge</span><span>
                                    <?php      
                                         if($total>499){
                                          $shipping =0;
                                            }else if($total<499 && $total>1){
                                              $shipping =60;
                                            }
                                            else {
                                              $shipping =0;
                                            }
                                            echo "₹ ".$shipping;
                                    ?>  
                        
                              </span></li>
                              <li id="coupon-box"><span >Discount</span><span style="float: right;" class="float-right text-success" id="coupon_price"></span></li>
                              <li><span>Total</span><span id="order_total_price"> ₹ <?php echo round($total+$shipping);?></span></li>
                           </ul>
                        </div>
                     </div>
                  </div>
               </div>

               <div class="col-lg-12">
                  <div class="account-card mb-0">
                     <div class="account-title">
                         <h4>Billing Address</h4>
                     </div>
               <form method="post" autocomplete="off" action="orderConfirm.php">    

                        <div class="form-group">
                        <input type="hidden" name="orderidd" value="<?php echo $orderidd; ?>" required>
                         <input type="hidden" id="getcoupon" name="txtcouponcode" value="">
                       <input type="hidden" name="id" value="<?php echo rand(10000,99999); ?>">
                       <input type="hidden" name="subTotal" value="<?php echo $total;?>">
                       <input type="hidden" name="totalAmount" value="<?php echo round($total+$shipping);?>">
                        <input type="hidden" name="logintype" value="guest">
                        <input type="hidden" name="shippingCharge" value="<?php echo $shipping;?>">
                        </div>

                        <div class="row">
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Name <span class="text-danger">*</span></label><input class="form-control" type="text" name="name" placeholder="Enter your Name" required value="">
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Mobile Number <span class="text-danger">*</span></label><input class="form-control" name="phone" type="number" placeholder="Enter your Mobile number" required value="" >
                              </div>
                           </div> 
                        </div>

                        <div class="row">
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Alternate Mobile Number</label><input class="form-control" name="phone2" type="number" placeholder="Enter your number">
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Email Id <span class="text-danger">*</span></label><input class="form-control" name="email" type="text" placeholder="Enter your Email Id" required value="">
                              </div>
                           </div> 
                        </div>

                        <div class="form-group">
                           <label class="form-label">Address <span class="text-danger">*</span></label><input class="form-control" type="text" name="address" placeholder="Enter your Address" required>
                        </div>

                        <div class="row">
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Pincode <span class="text-danger">*</span></label><input class="form-control" name="pincode" type="number" placeholder="Enter your Pincode" required>
                              </div>
                           </div> 
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">City <span class="text-danger">*</span></label><input class="form-control" name="city" type="text" placeholder="Enter your city" required>
                              </div>
                           </div>
                           
                        </div> 

                        <div class="row">
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">State <span class="text-danger">*</span></label><input class="form-control" name="state" type="text" placeholder="Enter your State" required>
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Country <span class="text-danger">*</span></label><input class="form-control" name="country" type="text" placeholder="Enter your Country" required>
                              </div>
                           </div> 
                            <div class="checkout-check"><input class="billingAddress" type="checkbox" id="checkout-check2" name="txtsamebilladdress" value="1"><label for="checkout-check2">Delivery Address Same as Billing Address.</label></div> 
                        </div>   
         
                     <!-- shipping -->
                    <span class="shippingAddress"> 
                     <div class="account-title">
                        <h4>Delivery Address</h4>
                     </div>
                        <div class="row">
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Name <span class="text-danger">*</span></label><input class="form-control" type="text" name="txtdelname" placeholder="Enter your Name" value="">
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Mobile Number <span class="text-danger">*</span></label><input class="form-control" name="txtdelphone" min-length="10" max-length="10" type="number" placeholder="Enter your Mobile number" value="" >
                              </div>
                           </div> 
                        </div>

                        <div class="row">
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Alternate Mobile Number</label><input class="form-control" name="txtdelphone2" min-length="10" max-length="10" type="number" placeholder="Enter your number">
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Email Id <span class="text-danger">*</span></label><input class="form-control" name="txtdelemail" type="text" placeholder="Enter your Email Id" value="">
                              </div>
                           </div> 
                        </div>

                        <div class="form-group">
                           <label class="form-label">Address <span class="text-danger">*</span></label><input class="form-control" type="text" name="txtdeladdress" placeholder="Enter your Address">
                        </div>

                        <div class="row">
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Pincode <span class="text-danger">*</span></label><input class="form-control" name="txtdelpincode" type="number" placeholder="Enter your Pincode">
                              </div>
                           </div> 
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">City <span class="text-danger">*</span></label><input class="form-control" name="txtdelcity" type="text" placeholder="Enter your city" >
                              </div>
                           </div>
                           
                        </div> 

                        <div class="row">
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">State <span class="text-danger">*</span></label><input class="form-control" name="txtdelstate" type="text" placeholder="Enter your State" >
                              </div>
                           </div>
                           <div class="col-md-6">
                              <div class="form-group">
                                 <label class="form-label">Country <span class="text-danger">*</span></label><input class="form-control" name="txtdelcountry" type="text" placeholder="Enter your Country" >
                              </div>
                           </div> 
                        </div>  
                     </span>

                        <!-- shipping close -->
                             
                  </div>
             
   </div>
<!--Billing address -->
<!-- payment form -->
 <div class="col-lg-12">
                  <div class="account-card mb-0">
                     <div class="account-title">
                        <h4>payment option</h4>
                     </div>
                     <div class="account-content">
                        <div class="row">
                          <div class="col-md-6 col-lg-3 alert fade show">
                                <label>
                                    <div class="payment-card payment active">
                                    <input type="radio" name="paymentMode" value="COD" checked>
                                       <span style="font-weight: 500;">Cash on Delivery (COD) </span>
                                   </div>
                                </label>
                           </div> 

                           <!--<div class="col-md-6 col-lg-4 alert fade show">-->
                           <!--     <label>-->
                           <!--         <div class="payment-card payment">-->
                           <!--           <input type="radio" name="paymentMode" value="Online Payment" checked>-->
                           <!--            <span style="font-weight: 500;">Online Payment </span>-->
                           <!--          </div>-->
                           <!--     </label>-->
                           <!--</div> -->
                        </div>
                     </div>
               
                     <div class="checkout-proced"><button name="orderConfirm" type="submit" class="btn btn-inline">Proceed To Checkout</button></div>     
                  </div>
               </div>
<!-- payment form close -->
</form>

            </div>
         </div>
      </section>

      <?php include 'includes/footer.php'; ?>

      <script src="vendor/bootstrap/jquery-1.12.4.min.js"></script><script src="vendor/bootstrap/popper.min.js"></script><script src="vendor/bootstrap/bootstrap.min.js"></script><script src="vendor/countdown/countdown.min.js"></script><script src="vendor/niceselect/nice-select.min.js"></script><script src="vendor/slickslider/slick.min.js"></script><script src="vendor/venobox/venobox.min.js"></script><script src="js/nice-select.js"></script><script src="js/countdown.js"></script><script src="js/accordion.js"></script><script src="js/venobox.js"></script><script src="js/slick.js"></script><script src="js/main.js"></script>
           <script>
         $(".shippingAddress").show();
         $(".billingAddress").click(function() {
             if($(this).is(":checked")) {
                 $(".shippingAddress").hide();
             } else {
                 $(".shippingAddress").show();
             }
         });
      </script>
      <script>
  function set_coupon(){
    var coupon_str=jQuery('#coupon_str').val();
    if(coupon_str!='')
    {
      jQuery('#coupon_result').html('');
      $.ajax({
        url:'setcoupon.php',
        type:'post',
        data:'coupon_str='+coupon_str,
        success:function(resultdata){ 
        var parsedObj = JSON.parse(resultdata);
        if(parsedObj.is_error=='yes')
        {
             jQuery('#coupon-box').hide();
             jQuery('#coupon-box2').hide();
            jQuery('#coupon_result').html(parsedObj.result).css('color', 'red');
        }
        if(parsedObj.is_error=='no')
        {
            jQuery('#coupon-box').show();
            jQuery('#coupon-box2').show();
            jQuery('#coupon_price').html(parsedObj.couponvalue);  
            jQuery('#order_total_price').html(parsedObj.result);
            jQuery('#getcoupon').val(parsedObj.couponcode);
            jQuery('#totalamount').html(parsedObj.totalamount);
            jQuery('#coupon_result').html(parsedObj.message).css('color', 'green');

        }

        // console.log(parsedObj.result);

        }
      });
    }
  }
</script>

   </body>
 
</html>

MMCT - 2023