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
/
View File Name :
productController.php
<?php SYS::DOMAIN("Product"); $action = isset($_GET["action"]) ? $_GET["action"] : null ; switch ($action) { case "save" : $productInstance = new Product(); $_POST["dateCreate"] = date('Y-m-d H:i'); print_r($_POST); $excute = $productInstance->save($_POST); if($excute) { $productInstance->lastRow(); header("location:?page=Product/show&id=$productInstance->id"); } break; case "update" : $productInstance = new Product(); /*$_POST["dateCreate"] = date('Y-m-d H:i');*/ $productInstance->get($_GET["id"]); $excute = $productInstance->update($_POST); if($excute) { header("location:?page=Product/show&id=$productInstance->id"); } break; case "delete" : $productInstance = new Product(); $productInstance->get($_GET["id"]); $excute = $productInstance->delete(); if($excute) { header("location:?page=Product/list"); } break; case "addstock" : /*$productInstance = new Product(); $productInstance->get($_GET["id"]); $excute = $productInstance->delete(); if($excute) { header("location:?page=Product/list"); }*/ $stockInstance = new Stock(); $_POST["eventDate"] = date('Y-m-d H:i'); $excute = $stockInstance->save($_POST); if($excute) { $stockInstance->lastRow(); $productInstance = new Product(); $productInstance->get($_POST["product"]); $stock = $stockInstance->quantity+$productInstance->stock; $excute = $productInstance->update(array("stock"=>$stock)); header("location:?page=Product/show&id=".$productInstance->id); } break; } ?>