diff --git a/img/cart.png b/img/cart.png new file mode 100644 index 0000000000000000000000000000000000000000..63e4eb4a35e951c23509eb6cfc3ffbb1cddbd646 Binary files /dev/null and b/img/cart.png differ diff --git a/img/category.png b/img/category.png new file mode 100644 index 0000000000000000000000000000000000000000..19fba32b74b37ae9ab7b350a50e29b3623bafcb2 Binary files /dev/null and b/img/category.png differ diff --git a/img/editproduct.png b/img/editproduct.png new file mode 100644 index 0000000000000000000000000000000000000000..c26da9944f7145e8d23808a7ada92bec11c2a96b Binary files /dev/null and b/img/editproduct.png differ diff --git a/img/editprofile.png b/img/editprofile.png new file mode 100644 index 0000000000000000000000000000000000000000..07bbf54c0b80989144aa765d3c434dc2ab0471cd Binary files /dev/null and b/img/editprofile.png differ diff --git a/img/home.png b/img/home.png new file mode 100644 index 0000000000000000000000000000000000000000..56be167ce7d2de854058888b23cfd5bce3a48a84 Binary files /dev/null and b/img/home.png differ diff --git a/img/login.png b/img/login.png new file mode 100644 index 0000000000000000000000000000000000000000..530956122a9054266944908b70022d88bf1c95c3 Binary files /dev/null and b/img/login.png differ diff --git a/img/product.png b/img/product.png new file mode 100644 index 0000000000000000000000000000000000000000..56f4834836682eea3fd3ac87f255393fe334e2c5 Binary files /dev/null and b/img/product.png differ diff --git a/img/profile.png b/img/profile.png new file mode 100644 index 0000000000000000000000000000000000000000..e443ee80a8110e1b1c2ed0756650ab8a2f5bca1c Binary files /dev/null and b/img/profile.png differ diff --git a/img/register.png b/img/register.png new file mode 100644 index 0000000000000000000000000000000000000000..aa37da78092192ea290f228404b4591d49e50469 Binary files /dev/null and b/img/register.png differ diff --git a/src/App/controller/product/ProductController.php b/src/App/controller/product/ProductController.php index eed89532bd99c57f0418957870bdec57eb76dbf7..c575cb388e2619d69ce82e36adfe40623a118014 100644 --- a/src/App/controller/product/ProductController.php +++ b/src/App/controller/product/ProductController.php @@ -5,7 +5,6 @@ class ProductController extends Controller{ public function index($id){ if($this->userRole !== 1) { - // throw new Exception("You are not allowed to view this page", 405); header("Location: /login"); exit(); } diff --git a/src/App/models/ProductModel.php b/src/App/models/ProductModel.php index 10ffa030db6711951712798858cff3e1a142fdbc..dd596852b6b4da0a35798e99adf1c0a5bb9d5264 100644 --- a/src/App/models/ProductModel.php +++ b/src/App/models/ProductModel.php @@ -91,12 +91,11 @@ class ProductModel extends Model{ $stmt = $this->database->getConn()->prepare("UPDATE products SET category_id = ?, name = ?, description = ?, price = ?, stock = ? WHERE id =$id"); $stmt->bind_param("issii", $category_id, $name, $description, $price, $stock); - - // Menjalankan pernyataan SQL + if ($stmt->execute()) { - return true; // Produk berhasil ditambahkan + return true; } else { - return false; // Gagal menambahkan produk + return false; } }