-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin-editCategories.php
More file actions
44 lines (41 loc) · 1.21 KB
/
Copy pathadmin-editCategories.php
File metadata and controls
44 lines (41 loc) · 1.21 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
<?php
require_once "user.php";
CheckIfAdminLoggedIn();
?>
<?php
include 'Geeksforsaletop.php';
?>
<div id="content">
<?php include 'admin-buttons.php'; ?>
<t1> Edit top categories</t1></br>
<form action="admin-editTopCategory.php" method="post">
<select name="category">
<?php
$sql = 'select * from productcategory';
$sth = $db->prepare($sql);
$sth->execute();
$sth->setFetchMode(PDO::FETCH_ASSOC);
while($row = $sth->fetch()){
echo "<option value=\"".$row['id']."\">".$row['categoryName']."</option>";
}
?>
</select>
<input type="submit" name="submit" value="Edit Category">
</form>
</br><t1> Edit sub categories</t1></br>
<form action="admin-editSubCategories.php" method="post">
<select name="category">
<?php
$sql = 'select * from subcategory';
$sth = $db->prepare($sql);
$sth->execute();
$sth->setFetchMode(PDO::FETCH_ASSOC);
while($row = $sth->fetch()){
echo "<option value=\"".$row['id']."\">".$row['name']."</option>";
}
?>
</select>
<input type="submit" name="submit" value="Edit Category">
</form>
</div>
</BODY>