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/opulanceindia/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/imyrqtmy/public_html/opulanceindia/todaysdeal.php
<?php 

session_start();
error_reporting(E_ERROR | E_PARSE);
$se = $_SESSION["id"];
if (!isset($_SESSION['id'])) {
    // header("Location: login.php");
}
include("admin/includes/config.php");;
 

  //  include("admin/includes/config.php"); 

  //  error_reporting(E_ERROR | E_PARSE);

   if(isset($_POST['add_to_cart']))
   {
       $product_name  = $_POST['product_name'];
       $price   = $_POST['price'];
       $photo  = $_POST['photo'];
   
       $product_quantity = 1;
       $select_cart = mysqli_query($conn,"select * from `cart` where name='$product_name'");

       if (mysqli_num_rows($select_cart) > 0) {
        echo "<script>alert('Product Already Added to Cart');</script>";
    } else {
        $query = mysqli_query($conn, "INSERT INTO cart (name, price, photo, quantity) VALUES ('$product_name','$price','$photo','$product_quantity')");
        if ($query) {
            echo "<script>alert('Product Added to Cart');</script>";
        } else {
            echo "<script>alert('Failed to Add Product to Cart');</script>";
        }
    }

    //    if(mysqli_num_rows($select_cart)>0){
    //        $display_message[]="Product Already Added to Cart"; 
    //    }else{
    //    $query = mysqli_query($conn, "insert into cart (name, price, photo, quantity) values ('$product_name','$price','$photo','$product_quantity')");
    //        $display_message[]="Product Added to Cart";
   
    //    } 
   }
   ?>


<!DOCTYPE html>
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en">
   <!--<![endif]-->
   <?php require "inc/head.php" ?>
   <body>
      <!-- =====  LODER  ===== -->
      <!-- <div class="loder"></div> -->
      <div class="wrapper">
         <!-- =====  HEADER START  ===== -->
         <?php require "inc/header.php" ?>
         <!-- =====  HEADER END  ===== --> 
         <!-- =====  BANNER STRAT  ===== -->
         <div class="breadcrumb">
            <h1>Products</h1>
            <ul>
               <li><a href="index.php">Home</a></li>
               <li class="active">Products</li>
            </ul>
         </div>
         <!-- =====  BREADCRUMB END===== --> 
         <!-- =====  CONTAINER START  ===== -->
         <div class="container">

         <?php
                                            if(isset($display_message)){
                                                foreach($display_message as $display_message){
                                            
                                                echo "<div class= 'display_message'>
                                                <span>$display_message</span>
                                                <i class= 'fas fs-times' onClick='this.parentElement.style.display=`none`';></i>
                                            </div>";
                                            }
                                            }
                                            ?> 
                                            
            <div class="row">
            <div id="column-right" class="col-sm-4 col-md-4 col-lg-3 ">
                  <div class="left-sidebar-widget">
                     <div class="all-category mb_50">
                        <div class="heading-part ">
                           <h2 class="sub_title pull-left">All Category</h2>
                        </div>
                        <div class="nav-responsive">
                           <ul>

                           <?php  
                            $query = "SELECT sc.*, COUNT(p.id) AS product_count 
                                        FROM scategories sc 
                                        LEFT JOIN products p ON sc.id = p.scategory_id
                                        GROUP BY sc.id";
                            $query_run = mysqli_query($conn, $query);

                            if($query_run) {
                                foreach($query_run as $row) {

                            ?>
                              <li><b><a href="productbycat.php?id=<?php echo $row['id']; ?>"><?php echo $row['scat_name'] ?>  (<span><?php echo $row['product_count']; ?></span>)</a></b></li>

                              <?php }}  ?>
                           </ul>
                        </div>
                     </div>
                  
                  </div>
                 
               </div>
               <div class="col-sm-8 col-md-8 col-lg-9 mb_30">
                  <div class="row">
              
                           <?php
                            $query = "SELECT * FROM products WHERE today_deals='1' ";
                                 // $query = "SELECT * FROM products";
                                 $query_run =mysqli_query($conn, $query);
                                 if(mysqli_num_rows($query_run) > 0){
                                 foreach($query_run as $row){

                                       $discount_percentage = 0;
                                       if($row['dprice'] > 0) {
                                          $discount_percentage = round((($row['dprice'] - $row['price']) / $row['dprice']) * 100);
                                       }
                              ?>

                     <form action="" method="post">
                     <div class="product-layout product-grid col-lg-4 col-md-4 col-xs-6 ">
                        <div class="item">
                           <div class="product-thumb clearfix mb_30">
                              <div class="image product-imageblock"> <a href="product-detail.php?id=<?php echo $row['id']; ?>"> <img data-name="product_image" src="<?php echo "admin/products/" . $row['image1']; ?>"  alt="iPod Classic" title="iPod Classic" class="img-responsive pro" /> <img src="<?php echo "admin/products/" . $row['image2']; ?>" alt="iPod Classic" title="iPod Classic" class="img-responsive pro" /> </a> </div>
                              <div class="caption product-detail text-left">
                              <h6 data-name="product_name" class="product-name mt_20">
                                          <a href="product-detail.php?id=<?php echo $row['id']; ?>" title="<?php echo htmlspecialchars($row['product_name'], ENT_QUOTES, 'UTF-8'); ?>">
                                             <?php echo mb_strimwidth($row['product_name'], 0, 25, "..."); ?>
                                          </a>
                                       </h6>   
                              <!-- <h6 data-name="product_name" class="product-name mt_20"><a href="product-detail.php?id=<?php echo $row['id']; ?>" title="Casual Shirt With Ruffle Hem"><?php echo $row['product_name'] ?></a></h6> -->
                                 <div class="rating"> <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-1x"></i><i class="fa fa-star fa-stack-1x"></i></span> <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-1x"></i><i class="fa fa-star fa-stack-1x"></i></span> <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-1x"></i><i class="fa fa-star fa-stack-1x"></i></span> <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-1x"></i><i class="fa fa-star fa-stack-1x"></i></span> <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-1x"></i><i class="fa fa-star fa-stack-x"></i></span> </div>
                                 <!-- <span class="price"><span class="amount"><span class="currencySymbol">$</span>70.00</span> </span> -->
                                 <!-- <p class="product-desc mt_20 mb_60"> More room to move. With 80GB or 160GB of storage and up to 40 hours of battery life, the new iPod classic lets you enjoy up to 40,000 songs or up to 200 hours of video or any combination wherever you go.Cover Flow. Browse through your music collection by flipping..</p> -->
                                 
                                 <div class="price-btn">
                                               <!-- <span class="currencySymbol">₹</span> 
                                               <del><?php echo $row['dprice']; ?></del>  -->
                                               <span class="currencySymbol">₹</span> 
                                               <?php echo $row['price']; ?>
                                            </div>
                                 <!-- <span class="price"><span class="amount"><span class="currencySymbol" style="color:red;font-size:14px;">₹</span> <del style="color:red; font-size:14px;"><?php echo  $row['dprice']; ?></del></span> </span> 
                                 <span class="price"><span class="amount"><span class="currencySymbol">₹</span> <?php echo  $row['price']; ?></span> </span>  -->
                                 <div class="button-group text-center">
                                 <a href="product-detail.php?id=<?php echo $row['id']; ?>" class="cart-btn"><i class="fa fa-eye"></i></a>
                                      
                                      <button  type="submit" name="add_to_cart"  class="cart-btn"> <i class="fa fa-shopping-cart"></i></button> 
                                      
                                      <input type="hidden" name = "product_name" value="<?php echo $row['product_name']; ?>">
                                            <input type="hidden" name = "price" value = "<?php echo $row['price']; ?>">
                                            <input type="hidden" name = "photo" value = "<?php echo "admin/products/". $row['image1']; ?>">
                                 </div>
                              </div>
                           </div>
                        </div>
                     </div>
                     </form>

                     <?php }} ?>


                    
                  </div>
               </div>
          
            </div>
         </div>
         <!-- =====  CONTAINER END  ===== --> 
         <!-- =====  FOOTER START  ===== -->
         <?php require "inc/footer.php" ?>
         <!-- =====  FOOTER END  ===== --> 
      </div>
      <a id="scrollup">Scroll</a> 
      <script src="js/jQuery_v3.1.1.min.js"></script> 
      <script src="js/owl.carousel.min.js"></script> 
      <script src="js/bootsnav.js"></script> 
      <script src="js/bootstrap.min.js"></script> 
      <script src="js/jquery.magnific-popup.js"></script> 
      <script src="js/custom.js"></script> 
      <script src="js/jquery-ui.js"></script> 
      <script>
         $(function() {
           $("#slider-range").slider({
             range: true,
             min: 0,
             max: 500,
             values: [75, 300],
             slide: function(event, ui) {
               $("#amount").val("$" + ui.values[0] + " - $" + ui.values[1]);
             }
           });
           $("#amount").val("$" + $("#slider-range").slider("values", 0) +
             " - $" + $("#slider-range").slider("values", 1));
         });
      </script>
   </body>
</html>

MMCT - 2023