-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
86 lines (49 loc) · 1.66 KB
/
admin.php
File metadata and controls
86 lines (49 loc) · 1.66 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
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<html>
<head>
<title>Admin Page</title>
</head>
<style>
</style>
<body>
<?php
include 'db_connect.php';
// Admin page will be a series of buttons
// Item list, will dump all the items to the screen, along with their prices and descriptions
//------ button 2, Edit item button
// Populate an html form with the current item description, price, etc and allow the admin to edit it, or delete it.
// add new item button, same as above but blank fields
//------ button to show users
//------ button to allow editing of a user account via user id.
$loginResult = "";
parse_str(parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY), $output);
?>
<form action='' method='post'>
<button name = 'editInventory' type = 'submit'>Edit Inventory Item</button>
<button name = 'addItem' type = 'submit'>Add An Item</button>
<a href = "index.html"><button name = 'home' type = 'button'>Back to Home</button></a>
</form>
<?php
if(isset($_POST['editInventory'])){
?>
<form action = "editItem.php" method = "post">
<input type = "text" name = "itemID" placeholder = "Enter Item ID to Edit"><br><br>
<input type="submit" value="Submit">
</form>
<?php
}//if
?>
<?php
if(isset($_POST['addItem'])){
?>
<form action="addItem.php" method = "post">
<input type="text" name="itemName" placeholder="Enter Item Name"><br><br>
<input type="text" name="itemCat" placeholder="Enter Item Category"><br><br>
<input type="text" name="itemPrice" placeholder="Enter Item Price"><br><br>
<input type="text" name="itemImg" placeholder="Enter Item Image URL"><br><br>
<input type="submit" value="Submit">
</form>
<?php
}//if(isset($_POST['addItem'])){
?>
</body>
</html>