GIF89a php
Current File : /home/hencockfreshchic/public_html/order-overview.php
<?php
ob_start();
ini_set('error_reporting', E_STRICT);
include("connect.php");
include("checkSession.php");
mysqli_set_charset($conn,'utf8');
date_default_timezone_set('Asia/Kolkata');
session_start();
 if($_COOKIE["mobb"]=="" && $_COOKIE["email"]=="" && $_COOKIE["user_id"]==""){
   echo '<script>window.location.href="login.php";</script>';
 }
?>
<!DOCTYPE php>
<html lang="en">
  <?php include'include/head.php'?>
   <body >
      <div class="se-pre-con"></div>
      <div class="main">
         <!-- HEADER START -->
         <?php include'include/header.php'?>
         <!-- HEADER END -->      
         <!-- Bread Crumb STRAT -->
        
         <!-- Bread Crumb END --> 
         <?php 
         // cart api
         $sqlCart="SELECT * FROM `my_cart` WHERE `user_id`='".$_COOKIE["user_id"]."'";
         $rsCart=mysqli_query($conn,$sqlCart);
         $checkCart=mysqli_num_rows($rsCart);

         $sqlUser="SELECT * FROM `app_admin` WHERE `sr`='".$_COOKIE["user_id"]."'";
         $rsUser=mysqli_query($conn,$sqlUser);
         $rowUser=mysqli_fetch_assoc($rsUser);

         ?>
         <!-- CONTAIN START -->
         <section class="checkout-section ptb-70 topmar">
            <div class="container">
               <div class="row">
                  <div class="col-12">
                     <div class="checkout-step mb-40">
                        <ul>
                           <li>
                              <!-- <a href="checkout.php"> -->
                                 <a>
                                 <div class="step">
                                    <div class="line"></div>
                                    <div class="circle">1</div>
                                 </div>
                                 <span>Shipping</span> 
                              </a>
                           </li>
                           <li class="active">
                              <!-- <a href="order-overview.php"> -->
                                 <a>
                                 <div class="step">
                                    <div class="line"></div>
                                    <div class="circle">2</div>
                                 </div>
                                 <span>Order Overview</span> 
                              </a>
                           </li>
                           <li>
                             <!--  <a href="payment.php"> -->
                              <a>
                                 <div class="step">
                                    <div class="line"></div>
                                    <div class="circle">3</div>
                                 </div>
                                 <span>Payment</span> 
                              </a>
                           </li>
                           <li>
                            <!--   <a href="order-complete.php"> -->
                              <a>
                                 <div class="step">
                                    <div class="line"></div>
                                    <div class="circle">4</div>
                                 </div>
                                 <span>Order Complete</span> 
                              </a>
                           </li>
                           <li>
                              <div class="step">
                                 <div class="line"></div>
                              </div>
                           </li>
                        </ul>
                        <hr>
                     </div>
                     <div class="checkout-content">
                        <div class="row">
                           <div class="col-12">
                              <div class="heading-part align-center">
                                 <h2 class="heading">Order Overview</h2>
                              </div>
                           </div>
                        </div>
                        <div class="row">
                           <div class="col-md-8 mb-sm-30">
                              <div class="cart-item-table commun-table mb-30">
                                 <div class="table-responsive">
                                    <table class="table">
                                       <thead>
                                          <tr>
                                             <th>Product</th>
                                             <th>Product Detail</th>
                                             <th>Sub Total</th>
                                             <th>Action</th>
                                          </tr>
                                       </thead>
                                       <tbody>
                                           <?php
                                          while($rowCart=mysqli_fetch_array($rsCart))
                                          {
                                             // fetch product details
                                             $sqlP="SELECT * FROM `products` WHERE `sr`='".$rowCart['prod_id']."'";
                                             $rsP=mysqli_query($conn,$sqlP);
                                             $rowP=mysqli_fetch_assoc($rsP);

                                             // get discount price
                                             $sqlDis="SELECT * FROM `prod_discount` WHERE `prod_id`='".$rowCart['prod_id']."'";
                                             $rsDis=mysqli_query($conn,$sqlDis);
                                             $checkDis=mysqli_num_rows($rsDis);
                                             $rowDis=mysqli_fetch_assoc($rsDis);
                                             if($checkDis>0){
                                                $price=$rowP["sale_price"]-(($rowP["sale_price"]*$rowDis["discounts"])/100);
                                             }
                                             else
                                             {
                                                $price=$rowP["sale_price"];
                                             }
                                          ?>
                                          <tr id="<?php echo "a".$rowCart['sr']; ?>">
                                             <td class="">
                                                <a href="product-page.php?prod_id=<?php echo $rowP["sr"]; ?>&product=<?php echo $rowP['p_name']; ?>&category=<?php echo $rowP['subcat_name']; ?>">
                                                   <div class="product-image cart-img-box"><img alt="Honour" src="<?php echo "admin.cpanel/".$rowP["image"]; ?>"></div>
                                                </a>
                                             </td>
                                             <td>
                                                <div class="product-title">
                                                   <a href="product-page.php?prod_id=<?php echo $rowP["sr"]; ?>&product=<?php echo $rowP['p_name']; ?>&category=<?php echo $rowP['subcat_name']; ?>"><?php echo $rowP["p_name"]; ?></a>
                                                   <div class="product-info-stock-sku m-0">
                                                      <div>
                                                         <label>Price: </label>
                                                         <div class="price-box"><i class="fa fa-inr"></i> <span class="info-deta price"><?php echo $price; ?></span> </div>
                                                      </div>
                                                   </div>
                                                   <div class="product-info-stock-sku m-0">
                                                      <div>
                                                         <label>Quantity: </label>
                                                         <span class="info-deta"><?php echo $rowCart['qty']; ?></span> 
                                                      </div>
                                                   </div>
                                                </div>
                                             </td>
                                             <td>
                                                <div data-id="100" class="total-price price-box"><i class="fa fa-inr"></i> <span class="price"><?php echo $rowCart['qty']*$price; ?></span> </div>
                                             </td>
                                             <td><i class="fa fa-trash cart-remove-item" data-id="100" title="Remove Item From Cart" onclick="delCartItem3('<?php echo $rowCart['sr']; ?>')"></i></td>
                                          </tr>
                                          <?php }  ?>
                                       </tbody>
                                    </table>
                                 </div>
                              </div>
                              
                              <script> 
                                       setInterval(function(){                                     

                                         if (window.XMLHttpRequest) {
                                         xmlhttp = new XMLHttpRequest();
                                          } else {          
                                         xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                                         } 
                                         xmlhttp.onreadystatechange=function() 
                                          {
                                           if (this.readyState==4 && this.status==200) 
                                          {
                                          document.getElementById("checkout_details").innerHTML=this.responseText;         
                                          }
                                         };
                                         xmlhttp.open("GET","cartTotal2.php",true);
                                         xmlhttp.send();

                                       },2000);
                                       </script>

                                       <div id="checkout_details" class="cart-total-table commun-table mb-30"></div>

                              <div class="right-side float-none-xs"> <a href="payment.php" class="btn btn-success"><span>Next</span></a> </div>
                           </div>
                           <div class="col-md-4">
                              <div class="cart-total-table address-box commun-table mb-30">
                                 <div class="table-responsive">
                                    <table class="table">
                                       <thead>
                                          <tr>
                                             <th>Shipping Address</th>
                                          </tr>
                                       </thead>
                                       <tbody>
                                          <tr>
                                             <td>
                                                <ul>
                                                   <li class="inner-heading"> <b><?php echo $rowUser["user_name"]; ?></b> </li>
                                                   <li>
                                                      <p><?php echo $rowUser["address"]; ?></p>
                                                   </li>
                                                   <li>
                                                      <p><?php echo $rowUser["state"]." ".$rowUser["city"].", ".$rowUser["landmark"]."-".$rowUser["pincode"]; ?></p>
                                                   </li>
                                                   <li>
                                                      <p>India</p>
                                                   </li>
                                                </ul>
                                             </td>
                                          </tr>
                                       </tbody>
                                    </table>
                                 </div>
                              </div>
                              <div class="cart-total-table address-box commun-table">
                                 <div class="table-responsive">
                                    <table class="table">
                                       <thead>
                                          <tr>
                                             <th>Billing Address</th>
                                          </tr>
                                       </thead>
                                       <tbody>
                                          <tr>
                                             <td>
                                                <ul>
                                                   <li class="inner-heading"> <b><?php echo $rowUser["user_name"]; ?></b> </li>
                                                   <li>
                                                      <p><?php echo $rowUser["address"]; ?></p>
                                                   </li>
                                                   <li>
                                                      <p><?php echo $rowUser["state"]." ".$rowUser["city"].", ".$rowUser["landmark"]."-".$rowUser["pincode"]; ?></p>
                                                   </li>
                                                   <li>
                                                      <p>India</p>
                                                   </li>
                                                </ul>
                                             </td>
                                          </tr>
                                       </tbody>
                                    </table>
                                 </div>
                              </div>
                              <button type="button" class="btn-color outline m-2" data-toggle="modal" data-target="#exampleModalCenter"><span>Apply Coupon</span></button>
                           </div>
                        </div>
                     </div>
                  </div>
               </div>
            </div>
         </section>
         <!-- CONTAINER END --> 
         
         <!-- FOOTER START -->
         <?php include'include/footer.php'?>
         <div class="scroll-top">
            <div class="scrollup"></div>
         </div>

         <!-- Modal -->
      <div class="modal fade" id="exampleModalCenter" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <h5 class="modal-title" id="exampleModalLongTitle">Apply Coupon Code</h5>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
             
             <div class="modal-body">
               <form>
                  <label for="coupon" >Enter Coupon Code</label>
                  <input class="form-control" type="text" maxlength="20" placeholder="Enter Coupon Code" id="coupon" name="coupon">
               </form>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn-color outline" onclick="applyCouponCode()"><span>Apply Coupon</span></button>
            </div>
          </div>
        </div>
      </div>
         <!-- FOOTER END --> 
      </div>
      <script src="js/jquery-1.12.3.min.js"></script>
      <script src="js/tether.min.js"></script> 
      <script src="js/bootstrap.min.js"></script>  
      <script src="js/jquery.downCount.js"></script>
      <script src="js/jquery-ui.min.js"></script> 
      <script src="js/fotorama.js"></script>
      <script src="js/jquery.magnific-popup.js"></script> 
      <script src="js/owl.carousel.min.js"></script>  
      <script src="js/custom.js"></script>
   </body>
</html>