-
Notifications
You must be signed in to change notification settings - Fork 0
/
item.php
123 lines (120 loc) · 4.75 KB
/
item.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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php include_once('header.php'); ?>
<?php
include"essential.php";
$query="SELECT * FROM Items";
?>
<div class="post">
<h2 class="title"><a href="#">Item List </a></h2>
<div style="clear: both;"> </div>
<script type='text/javascript' src='./js/jquery.min.js'></script>
<script type='text/javascript' src='./js/items.js'></script>
<?php if($_SESSION['ID']==0){
?>
<p class="meta">
<span class="date">Click to edit the details of any item!</span>
</p>
<button type="button" id='view' class="more">View Catalog</button>
<button type="button" id='add' class="more">Add a new item</button>
<?php }
?>
<br><br><br><br>
<div class="entry">
<form method="POST" action="dbentry.php" name="delete">
<table class="item-table" id="itemDetails">
<tr>
<td>ID</td>
<td>Description</td>
<td>Brand</td>
<td>Name</td>
<td>Price</td>
<td>Category</td>
<?php if($_SESSION['ID']==0){
?>
<td>Delete Option</td>
<?php }
?>
</tr>
<?php echo generateItems2($query); ?>
</table>
</form>
<form id="newItemDetails" method="post" action="dbentry.php">
Enter Item details:
<table >
<tr>
<td>Name</td>
<td><input type="text" name="Name" required></td>
</tr>
<tr>
<td>Description</td>
<td><input type="text" name="Description" required></td>
</tr>
<tr>
<td>Brand</td>
<td>
<select name="Brand"><?php echo genBrand();?></select>
</td>
</tr>
<tr>
<td>Price</td>
<td><input type="text" name="Price" required></td>
</tr>
<tr>
<td>Category</td>
<td>
<select name="Category" id='itemType'>
<option value="HDD">Hard Disk Drive</option>
<option value="Motherboard">Motherboard</option>
<option value="Processor">Processor</option>
<option value="RAM">RAM</option>
<option value="Monitor">Monitor</option>
</select>
</td>
</tr>
<tbody class="Category" id="HDD">
<tr>
<td>Size</td>
<td><input type="text" name="Field1"></td>
</tr>
</tbody>
<tbody class="Category" id="Motherboard">
<tr>
<td>Chipset</td>
<td><input type="text" name="Field2"></td>
</tr>
</tbody>
<tbody class="Category" id="Monitor">
<tr>
<td>Resolution</td>
<td><input type="text" name="Field3"></td>
</tr>
<tr>
<td>ScreenSize</td>
<td><input type="text" name="Field4"></td>
</tr>
</tbody>
<tbody class="Category" id="Processor">
<tr>
<td>Frequency</td>
<td><input type="text" name="Field5"></td>
</tr>
<tr>
<td>Cores</td>
<td><input type="text" name="Field6"></td>
</tr>
</tbody>
<tbody class="Category" id="RAM">
<tr>
<td>Frequency</td>
<td><input type="text" name="Field7"></td>
</tr>
<tr>
<td>Size</td>
<td><input type="text" name="Field8"></td>
</tr>
</tbody>
</table>
<input type="submit" class="more" value="Submit">
</form>
</div>
</div>
<?php include_once('footer.php'); ?>