]]jkjjgdjffksdkdxmnvbcbcvbvcbbbbbbbbbvcbcbvcbmnmbnwqeqwewqskfgj
במ12[cvbnvbnvcvbcvbcvbvvvccccccccccccccvbcvbcvbnmnmqewv;'
/
home
/
u729855735
/
public_html
/
visualgallery
/
Upload FileeE
HOME
<?php require('inc/db.php'); if(isset($_POST['wishlist'])){ $sku = $_POST['item_id']; $img = $_POST['item_image']; $nm = $_POST['item_name']; $price = $_POST['item_price']; $cat = $_POST['item_cat']; if(isset($_SESSION['UID'])){ $uid = $_SESSION['UID']; $check = "SELECT * FROM wishlist WHERE prd_sku='$sku' AND user_id='$uid'"; $exe = mysqli_query($conn,$check); if(mysqli_num_rows($exe) > 0){ $err = "Already added in wishlist! Please choose different product!"; echo "<script>setTimeout(function() { history.back() }, 2000);</script>"; } else{ $wish = "INSERT INTO wishlist(prd_sku,user_id,product_img,product_nm,product_price,product_cat) VALUES('$sku','$uid','$img','$nm','$price','$cat')"; $run = mysqli_query($conn,$wish); if($run){ $success = "Product added to wishlist!"; echo "<script>setTimeout(function() { history.back() }, 3000);</script>"; } else{ $err = "An error occured. Try again!"; echo "<script>setTimeout(function() { history.back() }, 3000);</script>"; } } } else{ $err = "Please login first before proceed!"; echo "<script>setTimeout(function() { location.href='login.php'; }, 3000);</script>"; } } if(isset($_GET['prsku'])){ $prsku = $_GET['prsku']; $del = "DELETE FROM wishlist WHERE prd_sku='$prsku'"; $que_del = mysqli_query($conn,$del); if($que_del){ $success = "Item removed successfully!"; echo "<script>setTimeout(function() { history.back(); }, 3000);</script>"; } else{ $err = "Oops! Failed to delete item."; echo "<script>setTimeout(function() { history.back(); }, 3000);</script>"; } } ?> <script src="assets/js/swal.js"></script> <?php if(isset($success)) {?> <script> setTimeout(function () { swal("Success!","<?php echo $success;?>!","success"); }, 100); </script> <?php } ?> <?php if(isset($err)) {?> <script> setTimeout(function () { swal("Failed!","<?php echo $err;?>!","error"); }, 100); </script> <?php } ?>