-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-admin.php
51 lines (38 loc) · 1.76 KB
/
index-admin.php
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
require_once("bootstrap.php");
if (isset($_POST['id'])) {
$id = $_POST['id'];
if (isset($_POST['img']) && isset($_POST['title'])
&& isset($_POST['band']) && isset($_POST['desc'])
&& isset($_POST['year']) && isset($_POST['genre'])
&& isset($_POST['quantity']) && isset($_POST['price'])) {
$dbh->updateItem($_POST['title'], $_POST['band'], $_POST['img'], $_POST['desc'], $_POST['genre'], $_POST['price'], $_POST['quantity'], $_POST['year'], $_POST['id']);
unset($_POST);
}
}
if (isset($_POST['add'])) {
if (isset($_POST['img']) && isset($_POST['title'])
&& isset($_POST['band']) && isset($_POST['desc'])
&& isset($_POST['year']) && isset($_POST['genre'])
&& isset($_POST['quantity']) && isset($_POST['price'])) {
$dbh->addItem($_POST['title'], $_POST['band'], $_POST['img'], $_POST['desc'], $_POST['genre'], $_POST['price'], $_POST['quantity'], $_POST['year']);
unset($_POST);
}
}
if (isset($_POST['delete'])) {
$dbh->deleteItem($_POST['item']);
unset($_POST);
}
if (isset($_POST['st']) && isset($_POST['ord'])) {
$dbh->updateOrderStatus($_POST['st'], $_POST['ord']);
unset($_POST);
}
$collection = $dbh->getAlbums();
$orders = $dbh->getOrders();
$orders = array_reverse($orders);
$templateParams["pageName"] = "Admin";
$templateParams["pageMainNav"] = "nav.php";
$templateParams["pageMainSection"] = "articoli-admin.php";
$templateParams["pageSecondarySection"] = "ordini-admin.php";
require("template/base-admin.php");
?>