One Hat Cyber Team
Your IP :
216.73.216.152
Server IP :
27.254.111.200
Server :
Linux wh-sh59.csloxinfo.com 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64
Server Software :
Apache
PHP Version :
5.5.38
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
vhosts
/
oakwine.co.th
/
httpdocs
/
controller
/
Edit File:
order_detailController.php
<?php SYS::DOMAIN("Order_detail"); $action = isset($_GET["action"]) ? $_GET["action"] : null ; switch ($action) { case "add" : if (isset($_GET["id"])){ $add = true; $productInstance = new Product(); $productInstance->get($_GET["id"]); if ($productInstance->id!=""){ $pri = $productInstance->promotion=="Yes" ? $productInstance->price : $productInstance->priceNormal; //print_r($_POST); //$n = !isset($_POST['num']) ? $_POST['num'] : isset($_SESSION['cart'][$productInstance->id]) ? $_SESSION['cart'][$productInstance->id]['num']+1 : 1; $n = 1; if (count($_POST)>0){ $n =$_POST['num']; }else if (isset($_SESSION['cart'][$productInstance->id])){ $n = $_SESSION['cart'][$productInstance->id]['num']+1; } $n = $n>=$productInstance->stock ? $productInstance->stock : $n; $products = array('id'=>$productInstance->id, "num"=>$n, "price"=>$pri, "send"=>$productInstance->priceSend); $_SESSION['cart'][$productInstance->id] = $products; } } echo '<script language="javascript">window.location.href = "index.php?page=Product/cart"</script>'; break; case "updateCart" : for($i=0; $i<count($_POST['id']); $i++){ $_SESSION['cart'][$_POST['id'][$i]]['num'] = $_POST['num'][$i]; if ($_SESSION['cart'][$_POST['id'][$i]]['num']<=0){ unset($_SESSION['cart'][$_POST['id'][$i]]); } } echo '<script language="javascript">window.location.href = "index.php?page=Product/cart"</script>'; break; case "del" : if (isset($_GET['id'])){ unset($_SESSION['cart'][$_GET['id']]); } echo '<script language="javascript">window.location.href = "index.php?page=Product/cart"</script>'; break; /*case "save" : $order_detailInstance = new Order_detail(); $excute = $order_detailInstance->save($_POST); if($excute) { $order_detailInstance->lastRow(); header("location:?page=Order_detail/show&id=$order_detailInstance->id"); } break; case "update" : $order_detailInstance = new Order_detail(); $order_detailInstance->get($_GET["id"]); $excute = $order_detailInstance->update($_POST); if($excute) { header("location:?page=Order_detail/show&id=$order_detailInstance->id"); } break; case "delete" : $order_detailInstance = new Order_detail(); $order_detailInstance->get($_GET["id"]); $excute = $order_detailInstance->delete(); if($excute) { header("location:?page=Order_detail/list"); } break;*/ } ?>
Simpan