Editing: quick_view.php
Kembali
<?php include 'components/connect.php'; session_start(); include 'components/wishlist_cart.php'; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>quick view</title> <!-- font awesome cdn link --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"> <!-- custom css file link --> <link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/quick_view.css"> <link rel="stylesheet" href="./css/modal.css"> <link rel="stylesheet" href="https://cdn.tutorialjinni.com/intl-tel-input/17.0.8/css/intlTelInput.css"/> <script src="https://cdn.tutorialjinni.com/intl-tel-input/17.0.8/js/intlTelInput.min.js"></script> </head> <body> <?php include 'components/user_header.php'; ?> <?php include 'sidebarcontent.php'?> <section class="quick-view"> <h1 class="heading">quick view</h1> <?php $pid = $_GET['pid']; $select_products = mysqli_query($conn,"SELECT * FROM `products` WHERE id = $pid"); if(mysqli_num_rows($select_products) > 0){ while($fetch_product =mysqli_fetch_assoc($select_products)){ $GLOBALS['category']=$fetch_product['category']; $GLOBAL['product']=$fetch_product['id']; ?> <div class="box"> <input type="hidden" name="pid" value="<?= $fetch_product['id']; ?>"> <input type="hidden" name="name" value="<?= $fetch_product['name']; ?>"> <input type="hidden" name="price" value="<?= $fetch_product['price']; ?>"> <input type="hidden" name="image" value="<?= $fetch_product['image_01']; ?>"> <div class="row"> <div class="image-container"> <div class="main-image"> <img src="uploaded_img/<?= $fetch_product['image_01']; ?>" id="mainImage" alt=""> </div> <div class="sub-image"> <img src="uploaded_img/<?= $fetch_product['image_01']; ?>" class="thumbnils" alt=""> <img src="uploaded_img/<?= $fetch_product['image_02']; ?>" class="thumbnils" alt=""> <img src="uploaded_img/<?= $fetch_product['image_03']; ?>" class="thumbnils" alt=""> </div> </div> <div class="content"> <h3><?= $fetch_product['name'];?></h3> <a href='category.php?category=<?=$fetch_product['category']?>'><?= $fetch_product['category']?></a> <!-- a href="category.php?category=' . $categories_row['category'] . --> <!-- <div class="name"> ?></div> --> <div class="flex"> <div class="price"><span style="color:black">HSN: </span><?= $fetch_product['hs_code']; ?></div> </div> <label style="font-size:2rem">Discription</label> <div class="details"><?= $fetch_product['details']; ?></div> <div class="flex-btn"> <a href="https://wa.me/+918461003127?text= Dear SPT, I hope this message finds you well. I am interested in acquiring <?= $fetch_product['name']; ?> from your company and would like to request a quotation for the same. Kindly provide me with the following information: Product/Service Name: Quantity/Duration (if applicable): Specific Features/Specifications (if applicable): Desired Delivery Date/Timeframe: Any Additional Information:" target="_blank" class="quote-btn btn " id="connectWA" >get in touch on <i class="fab fa-whatsapp "></i></a> <!--<input type="submit" value="Get Quote" class="quote-btn btn" name="add_to_cart" style="text-align:center">--> <button name="quotebtn" class="quote-btn btn" id="modal-btn" style="text-align:center">Get Quote</button> </div> </div> </div> </div> <?php include 'modal.php'; } }else{ echo '<p class="empty">no products added yet!</p>'; } if (isset($_POST['email'])) { $product_name = $_POST['product_name']; $hs_code = $_POST['hs_code']; $msg = $_POST['msg']; $user_name = $_POST['name']; $user_contact = $_POST['phone']; $country_code=$_POST['country-code']; $main_number=$country_code.$user_contact; $user_email = $_POST['email']; $shipping_term=$_POST['shipping_term']; $inspection=$_POST['inspection']; $packaging_term=$_POST['packaging_term']; $country=$_POST['country']; $port=$_POST['port']; $quantity=$_POST['quantity']; // echo($_POST['email']); // print_r($shipping_term,$inspection,$packaging_term); // echo($product_name); $insert_quote = mysqli_query($conn, "INSERT INTO quotataion (product_name,hs_code,message,user_name, user_contact,user_email,quantity,inspection,shipping_term,country,destination_port) VALUES('$product_name','$hs_code','$msg','$user_name',$main_number,'$user_email','$quantity','$inspection','$shipping_term','$country','$port')"); if($insert_quote){ echo('done'); }else{ echo(mysqli_error($conn)); } } ?> <section class="home-products"> <h1 class="heading">Related products</h1> <div class="product-wrapper"> <!-- <div class="swiper-wrapper"> --> <?php $select_products = mysqli_query($conn, "SELECT * FROM `products`WHERE category LIKE '%{$category}%' LIMIT 3"); $select_products_all = mysqli_query($conn, "SELECT * FROM `products`"); if (mysqli_num_rows($select_products) > 0) { while ($fetch_product = mysqli_fetch_assoc($select_products)) { ?> <form action="" method="post" class="slide "> <a href="quick_view.php?pid=<?= $fetch_product['id']; ?>"> <input type="hidden" name="pid" value="<?= $fetch_product['id']; ?>"> <input type="hidden" name="name" value="<?= $fetch_product['name']; ?>"> <input type="hidden" name="price" value="<?= $fetch_product['price']; ?>"> <input type="hidden" name="image" value="<?= $fetch_product['image_01']; ?>"> <!-- <a href="quick_view.php?pid=<?= $fetch_product['id']; ?>" class="fas fa-eye"></a> --> <img src="uploaded_img/<?= $fetch_product['image_01']; ?>" alt=""> <div class="name"><?= $fetch_product['name']; ?></div> <div class="flex"> <div class="price"><span style="color:black">HSN: </span><?= $fetch_product['price']; ?></div> <!-- <input type="number" name="qty" class="qty" min="1" max="99" onkeypress="if(this.value.length == 2) return false;" value="1"> --> </div> </a> <!-- <input type="button" value="get Quote" class="btn getqoutebtn" id="modal-btn" name="quotebtn"> --> </form> <!-- open Modal --> <!-- <div id="myModal" class="modal">--> <!-- Modal content --> <!-- <div class="modal-content custome-modal">--> <!-- <span class="close">×</span>--> <!-- <div action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post" class="quote-form">--> <!-- <h2>Get Quotation</h2>--> <!-- <input type="hidden" name="pid" value="<?= $fetch_product['id']; ?>">--> <!-- <input type="hidden" name="product_name" value="<?= $fetch_product['name']; ?>">--> <!-- <input type="hidden" name="hs_code" value="<?= $fetch_product['hs_code']; ?>">--> <!-- <input type="text" name="name" placeholder="Name" class="textarea">--> <!-- <input type="email" name="email" placeholder="Email" class="textarea">--> <!-- <input type="number" name="phone" placeholder="Mobile Number" class="textarea">--> <!-- <input type="text" name="msg" placeholder="Message if any" class="textarea " id="msg"> --> <!-- <textarea name="msg" class="box " id="msg" placeholder="Message if any"></textarea>--> <!-- <input type="submit" name="submit" class="btn"> --> <!--</div>--> <!-- </div>--> <!-- </div>--> <?php } } else { echo '<p class="empty">no products added yet!</p>'; } ?> </div> </section> </section> <?php include 'components/footer.php'; ?> <script src="js/script.js"></script> <!-- <script src="js/modal.js"></script> --> <script> let thumbnil=document.getElementsByClassName("thumbnils"); let activeImage=document.getElementsByClassName("active"); console.log(thumbnil) for(var i=0; i<thumbnil.length;i++){ thumbnil[i].addEventListener('click', function(e){ e.preventDefault() if(activeImage.length>0){ activeImage[0].classList.remove('active') } this.classList.add('active') document.getElementById('mainImage').src = this.src } ) // thumbnil[i].onclick(()=>{ // }) // document.thumbnil[i].addEventListener('click', // (e)=>{ // e.preventDefault() // } // ) } </script> </body> </html>
SIMPAN PERUBAHAN