-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodifica.php
More file actions
26 lines (22 loc) · 1.17 KB
/
Copy pathmodifica.php
File metadata and controls
26 lines (22 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
require_once("./bootstrap.php");
if(isset($_GET['vendorChoice'])){
$vendorChoice = $dbm->getFactory()->getProduct($_GET['vendorChoice']);
$categories = $dbm -> getFactory()->getCategories();
$templateParams["name"] = "modifica_section.php";
$templateParams["title"] = "modifica";
if(isset($_POST["productDescription"]) && isset($_POST["quantity"]) && isset($_POST["price"])){
if(!empty($_POST["quantity"]) && !empty($_POST["price"])){
$dbm->getRequests()->changeProductPrice($vendorChoice->ProductID, $_POST['price']);
$dbm->getRequests()->changeProductQuantity($vendorChoice->ProductID, $_POST['quantity']);
$dbm->getRequests()->changeProductDescription($vendorChoice->ProductID, $_POST["productDescription"]);
$templateParams['success'] = "Prodotto modificato correttamente";
$vendorChoice = $dbm->getFactory()->getProduct($_GET['vendorChoice']);
}
else{
$templateParams["error"] = "Errore nella modifica del prodotto";
}
}
}
require("./template/base.php");
?>