File manager - Edit - /home/custbahd/irungikitchen.com/admin1/orders/index.php
Back
<?php session_start(); //including the database connection file include_once("../../db/config.php"); ?> <?php 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 checkout WHERE code='" . $_GET["code"] . "'"); $itemArray = array($productByCode[0]["code"]=>array('name'=>$productByCode[0]["name"], 'code'=>$productByCode[0]["code"], 'type'=>$productByCode[0]["type"], 'quantity'=>$_POST["quantity"], 'price'=>$productByCode[0]["price"], 'image'=>$productByCode[0]["image"])); $productByCode = $db_handle->runQuery("SELECT * FROM home_products WHERE code='" . $_GET["code"] . "'"); $itemArray = array($productByCode[0]["code"]=>array('name'=>$productByCode[0]["name"], 'code'=>$productByCode[0]["code"], 'type'=>$productByCode[0]["type"], 'quantity'=>$_POST["quantity"], '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 //while($res = mysql_fetch_array($result)) { // mysql_fetch_array is deprecated, we need to use mysqli_fetch_array include_once("../../db/config.php"); ?> <!doctype html> <html class="no-js" xmlns:og="http://ogp.me/ns#"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>Orders | Irungi Kitchen ©</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Place favicon.ico in the root directory --> <link rel="icon" href="../../img/fav-icon.png" type="image/x-icon" /> <!--Boxicons--> <link href="../assets/boxicon.min.css" rel="stylesheet"> <!--Animations--> <link rel="stylesheet" type="text/css" href="../../css/animations/style.css"> <link rel="stylesheet" type="text/css" href="../../css/animations/attention/blink.css"> <link rel="stylesheet" type="text/css" href="../../css/animations/attention/bounce.css"> <link rel="stylesheet" type="text/css" href="../../css/animations/attention/flicker.css"> <link rel="stylesheet" type="text/css" href="../../css/animations/attention/jello.css"> <link rel="stylesheet" type="text/css" href="../../css/animations/attention/pulsate.css"> <link rel="stylesheet" type="text/css" href="../../css/animations/attention/shake.css"> <link rel="stylesheet" type="text/css" href="../../css/animations/attention/vibrate.css"> <link rel="stylesheet" type="text/css" href="../../css/animations/attention/wobble.css"> <!-- Modernizr JS --> <script src="../../assets/js/vendor/modernizr-2.8.3.min.js"></script> <style type="text/css"> body { background-image: url(../../img/error-bg1.jpg); background-attachment: fixed; background-position: top; } /*Logo Section*/ .logo img{ border-radius: 100px; } table { padding: 30px; border-radius: 10px; background: #f195b2; } /*Welcome Section*/ .welcome-section .welcome-content a{ color: #000; text-decoration: underline; } /*Wishlist Section*/ .wishlist-section .cart-table .table th { text-align: left; width: 120px; padding-bottom: 20px; border-bottom: 1px solid rgba(0, 0, 0, 0.4); } .wishlist-section .cart-table .table:last-child th { text-align: center; padding-bottom: 10px; } .wishlist-section .cart-table .table td { text-align: center; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(0, 0, 0, 0.4); } .wishlist-section .cart-table .table img { width: 50px; height: 50px; object-fit: cover; border-radius: 3px; } .wishlist-section .cart-table .table .pro-thumbnail { width: 160px; } /*Home Link Button*/ a.view{ background: #000; color: #f195b2; text-decoration: none; text-transform: uppercase; line-height: 36px; padding: 10px; font-size: 12px; font-weight: 600; border-radius: 3px; border: none; cursor: pointer; transition: 1s; } a.view:hover { color: #f195b2; background: #fff; } /*Home Link Button*/ .home_btn a{ background: #f195b2; color: #000; text-decoration: none !important; text-transform: uppercase; line-height: 36px; padding: 10px 40px; font-size: 14px; font-weight: 600; border-radius: 3px; border: none; cursor: pointer; transition: 1s; } .home_btn a i { margin-right: 10px; } .home_btn a:hover { color: #f195b2; background: #000; } /*Copyright Section*/ .copyright-section .copyright-content p:first-child{ color: rgba(0, 0, 0, 0.7); margin-top: 40px; } .copyright-section .copyright-content p:last-child{ color: rgba(0, 0, 0, 0.7); font-size: 12px; } .copyright-section .copyright-content a{ color: rgba(0, 0, 0, 0.7); text-decoration: none; } </style> </head> <body> <div id="main-wrapper"> <div class="logo" align="center"> <a href="../"><img src="../../img/il.png" alt="Irungi Kitchen"></a> </div> <br> <!-- Welcome Section Start --> <div class="welcome-section"> <div class="container"> <div class="row align-items-center"> <div class=""> <div class="welcome-content" align="center"> <?php $sql = "SELECT * FROM checkout"; //use for MySQLi-OOP $query = $conn->query($sql); if($row = $query->fetch_assoc() == 0) { echo"<h2>NO ORDERS YET</h2>"; echo "<div class='home_btn' align='center'><a href='../'><i class='bx bx-caret-left'></i> GO BACK </a></div>"; }else { echo"<h2>ORDERS</h2>"; } ?> </div> </div> </div> </div> <br> <!-- Welcome Section End --> <!--Wishlist section start--> <div class="wishlist-section"> <div class="container"> <div class="row"> <div class="col-12"> <!-- Cart Table --> <div class="cart-table"> <table class="table" align="center"> <thead> <tr> <th class="pro-thumbnail">Names</th> <th class="pro-title">Order Code</th> <th class="pro-price">Price</th> <th class="pro-price">Item(s)</th> <th class="pro-stock">Delivery</th> <th class="pro-stock">Total</th> <th class="pro-stock">View</th> </tr> </thead> <tbody> <?php $sql = "SELECT * FROM checkout_admin ORDER BY id DESC"; //use for MySQLi-OOP $query = $conn->query($sql); while($row = $query->fetch_assoc()){ echo "<tr> <td>".$row['fname']." ".$row['lname']."</td> <td class='pro-title' style='line-height: 45px;'><a> ".$row['order_code']."</a> </td> <td class='pro-price'><span> ".number_format($row['subtotal'])."/- </span></td> <td class='pro-price'><span> ".$row['items']." </span></td> <td class='pro-stock'><span class='in-stock'> ".number_format($row['delivery'])."/-</span></td> <td><span class='total'><b> ".number_format($row['total'])."/-</b></span></td> <td class='pro-stock'><a href='order/?code=".$row['order_code']."&email=".$row['email']."' class='view'>DETAILS</a></td> </tr>"; } ?> </tbody> </table> </div> </div> </div> </div> </div> <br> <br> <!--Wishlist section end--> <!-- Copyright Section Start --> <div class="copyright-section"> <div class="container"> <div class="row align-items-center"> <div class=""> <div class="copyright-content" align="center"> <p>Irungi Kitchen © <script>document.write(new Date().getFullYear());</script></p> <p>Powered by <a target="_blank" href="https://customassistinc.com">Custom Assist Inc.</a></p> </div> </div> </div> </div> <!-- Copyright Section End --> </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 2.4 |
proxy
|
phpinfo
|
Settings