File manager - Edit - /home/custbahd/public_html/webs/monitor/clients/marylhouse/index/tests/index.php
Back
<?php session_start(); require_once("../db/dbcontroller.php"); $db_handle = new DBController(); if(!empty($_GET["action"])) { switch($_GET["action"]) { case "add": if(!empty($_POST["quantity"])) { $productByCode = $db_handle->runQuery("SELECT * FROM shop WHERE code='" . $_GET["code"] . "'"); $itemArray = array($productByCode[0]["code"]=>array('name'=>$productByCode[0]["name"], 'code'=>$productByCode[0]["code"], 'quantity'=>$_POST["quantity"], 'type'=>$productByCode[0]["type"], 'price'=>$productByCode[0]["price"], 'image'=>$productByCode[0]["image"])); $productByCode = $db_handle->runQuery("SELECT * FROM shop WHERE code='" . $_GET["code"] . "'"); $itemArray = array($productByCode[0]["code"]=>array('name'=>$productByCode[0]["name"], 'code'=>$productByCode[0]["code"], 'quantity'=>$_POST["quantity"], 'type'=>$productByCode[0]["type"], 'price'=>$productByCode[0]["price"], 'image'=>$productByCode[0]["image"])); if(!empty($_SESSION["cart_item"])) { if(in_array($productByCode[0]["code"],array_keys($_SESSION["cart_item"]))) { foreach($_SESSION["cart_item"] as $k => $v) { if($productByCode[0]["code"] == $k) { if(empty($_SESSION["cart_item"][$k]["quantity"])) { $_SESSION["cart_item"][$k]["quantity"] = 0; } $_SESSION["cart_item"][$k]["quantity"] += $_POST["quantity"]; } } } else { $_SESSION["cart_item"] = array_merge($_SESSION["cart_item"],$itemArray); } } else { $_SESSION["cart_item"] = $itemArray; } } break; case "remove": if(!empty($_SESSION["cart_item"])) { foreach($_SESSION["cart_item"] as $k => $v) { if($_GET["code"] == $k) unset($_SESSION["cart_item"][$k]); if(empty($_SESSION["cart_item"])) unset($_SESSION["cart_item"]); } } break; case "empty": unset($_SESSION["cart_item"]); break; } } ?> <?php //including the database connection file include_once("../db/config.php"); //fetching data in descending order (lastest entry first) //$result = mysql_query("SELECT * FROM users ORDER BY id DESC"); // mysql_query is deprecated $result = mysqli_query($mysqli, "SELECT * FROM checkout ORDER BY id DESC"); // using mysqli_query instead ?> <!DOCTYPE html> <html lang="en"> <head> <title>Maryl House Admin Colors </title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link href="https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,200;0,300;0,400;0,500;0,700;0,800;1,200;1,300;1,400;1,500;1,700&display=swap" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet"> <link href="lib/flaticon/font/flaticon.css" rel="stylesheet"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="../css/animate.css"> <link rel="stylesheet" href="../css/owl.carousel.min.css"> <link rel="stylesheet" href="../css/owl.theme.default.min.css"> <link rel="stylesheet" href="../css/magnific-popup.css"> <link rel="stylesheet" href="../css/flaticon.css"> <link href="../style.css" type="text/css" rel="stylesheet" /> <!--Icons--> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="https://maxst.icons8.com/vue-static/landings/animated-icons/icons/menu-arrow/menu-arrow.json"> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <!--Animations--> <link rel="stylesheet" type="text/css" href="../css/Attention/blink.css"> <link rel="stylesheet" type="text/css" href="../css/Attention/bounce.css"> <link rel="stylesheet" type="text/css" href="../css/Attention/flicker.css"> <link rel="stylesheet" type="text/css" href="../css/Attention/jello.css"> <link rel="stylesheet" type="text/css" href="../css/Attention/pulsate.css"> <link rel="stylesheet" type="text/css" href="../css/Attention/shake.css"> <link rel="stylesheet" type="text/css" href="../css/Attention/vibrate.css"> <link rel="stylesheet" type="text/css" href="../css/Attention/wobble.css"> <link rel="stylesheet" type="text/css" href="../css/Background/background.css"> <link rel="stylesheet" type="text/css" href="../css/Bounce/bounce.css"> <link rel="stylesheet" type="text/css" href="../css/Text/blur-out.css"> <link rel="stylesheet" type="text/css" href="../css/Text/flicker-glow.css"> <link rel="stylesheet" type="text/css" href="../css/Text/focus-in.css"> <link rel="stylesheet" type="text/css" href="../css/Text/tracking-in.css"> <link rel="stylesheet" type="text/css" href="../css/Text/tracking-out.css"> <link rel="stylesheet" href="../css/style.css"> <style type="text/css"> /*Unbeatable Grid*/ #color { background-color: #a4508b; background-image: linear-gradient(200deg, #a4508b 0%, #5f0a87 74%); padding: 2px; min-height: 100px; } #color > div { color: black; font-size: 4vw; border-radius: 10px; padding: 2px; } #color div div{ font-weight: bold; color: white; font-size: 12px; text-align: center; width: 100%; min-height: 100px; padding: 2px; z-index: 999; } #color .discount{ margin-left: 5px; font-size: 10px; color: white; width: 30px; height: 30px; padding: 5px 5px; border-radius: 50px; background: black; } #color div div span{ margin-left: 10px; } #color div div i{ float: right; margin-right: 10px; margin-top: 4px; } #color > div div img{ float: left; width: 20%; min-height: 50px; border-radius: 10px; } #color .original{ text-decoration: line-through; } #color .price{ } </style> </head> <body> <h2 align="center">Top Selections </h2> <br> <div id="color" style="background-image: url('images/about.jpg');background-position: center;background-size: contain;"> <div> <div> <?php $product_array = $db_handle->runQuery("SELECT * FROM shop WHERE id=45"); if (!empty($product_array)) { foreach($product_array as $key=>$value){ ?> <form method="post" action="index.php?action=add&code=<?php echo $product_array[$key]["code"]; ?>"> <?php echo "<img src='../admin/shop/images/".$product_array[$key]['image']."'>"; ?> <div align="center"> <span class=""><?php echo $product_array[$key]["flavor"]; ?></span> <span class=""><?php echo $product_array[$key]["type"]; ?></span> <br> <span class="discount"><?php echo $product_array[$key]["discount"]; ?></span> <br> <span class="original"><?php echo number_format ($product_array[$key]["original"])."ugx"; ?></span> <span class="price"><?php echo number_format ($product_array[$key]["price"])."ugx"; ?></span> </div> </form> <?php } } ?> </div> </div> </div> <script src="../js/jquery.min.js"></script> <script src="../js/jquery-migrate-3.0.1.min.js"></script> <script src="../js/popper.min.js"></script> <script src="../js/bootstrap.min.js"></script> <script src="../js/jquery.easing.1.3.js"></script> <script src="../js/jquery.waypoints.min.js"></script> <script src="../js/jquery.stellar.min.js"></script> <script src="../js/owl.carousel.min.js"></script> <script src="../js/jquery.magnific-popup.min.js"></script> <script src="../js/jquery.animateNumber.min.js"></script> <script src="../js/scrollax.min.js"></script> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBVWaKrjvy3MaE7SQ74_uJiULgl1JY0H2s&sensor=false"></script> <script src="../js/google-map.js"></script> <script src="../js/main.js"></script> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 2.7 |
proxy
|
phpinfo
|
Settings