-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_category_management.php
95 lines (77 loc) · 3.36 KB
/
admin_category_management.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>SandoCA</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link rel="stylesheet" type="text/css" href="assets/bootstrap-3.3.6-dist/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" id="topnav">
<div class="container-fluid">
<div class="navbar-header">
<a href="index.php" class="navbar-brand">SandoCA</a>
</div>
</div>
</div>
<p><br><br></p>
<p><br><br></p>
<div class="container-fluid">
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8" id="err_msg"></div>
<div class="col-md-2"></div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-8">
<div class="panel panel-primary">
<a href="test_admin.php">Back</a>
<div class="panel-heading">Category Management</div>
<div class="panel-body">
<form>
<input type="text" id="search" placeholder="Search by Category Title">
</form>
<button><tr><th><a href="admin_category_add.php">Add Category</a></th></tr></button>
<table id="categoryTable" border="1">
<tr>
<th>Category ID</th>
<th>Category Title</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</table>
<script>
// Function to fetch and display categories based on search
function fetchCategories(search) {
$.ajax({
url: "admin_category_fetch.php",
type: "POST",
data: { search: search },
success: function(response) {
$("#categoryTable").html(response);
}
});
}
// Initial load of categories
fetchCategories("");
// Trigger search as user types
$("#search").keyup(function() {
var searchText = $(this).val();
fetchCategories(searchText);
});
</script>
</div>
<div class="panel-footer"></div>
</div>
</div>
<div class="col-md-2"></div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.slick/1.6.0/slick.min.js"></script>
<script src="assets/bootstrap-3.3.6-dist/js/bootstrap.min.js"></script>
<script src="main.js"></script>
</body>
</html>