-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetSubcategories.php
50 lines (48 loc) · 1.48 KB
/
getSubcategories.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
<?php
include "connection.php";
$categoryname = $_REQUEST['q'];
$qury = "select * from subcategory where category='$categoryname'";
$result = mysqli_query($conn, $qury);
if (mysqli_num_rows($result) > 0) {
?>
<table class="table">
<thead>
<tr>
<th>Sr No.</th>
<th>Sub Category Name</th>
<th>Sub Category Description</th>
<th>Category Name</th>
</tr>
</thead>
<tbody>
<?php
$k = 0;
while ($category = mysqli_fetch_array($result)) {
$k++;
?>
<tr>
<td><?php echo $k; ?></td>
<td><?php echo $category[1]; ?></td>
<td><?php echo $category[2]; ?></td>
<td><?php echo $category[3]; ?></td>
<td><a onclick="return confirm('Are you Sure you want to Delete?')"
href="deletesubcategory.php?subcatid=<?php echo $category[0]; ?>"><i class="fa fa-trash"></i></a>
</td>
<td><a href="editsubcategory.php?subcatid=<?php echo $category[0]; ?>"><i class="fa fa-user-edit"></i></a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
} else {
?>
<div class="row">
<div class="col-md-6 offset-md-3">
<div class="alert alert-danger">No Data Found <span class="close" data-dismiss="alert">×</span></div>
</div>
</div>
<?php
}