-
Notifications
You must be signed in to change notification settings - Fork 2
/
category.php
39 lines (39 loc) · 1.24 KB
/
category.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
<?php include('header.php'); ?>
<body>
<?php include('navbar.php'); ?>
<div class="container">
<h1 class="page-header text-center">CATEGORY CRUD</h1>
<div class="row">
<div class="col-md-12">
<a href="#addcategory" data-toggle="modal" class="pull-right btn btn-primary"><span class="glyphicon glyphicon-plus"></span> Category</a>
</div>
</div>
<div style="margin-top:10px;">
<table class="table table-striped table-bordered">
<thead>
<th>Category Name</th>
<th>Action</th>
</thead>
<tbody>
<?php
$sql="select * from category order by categoryid asc";
$query=$conn->query($sql);
while($row=$query->fetch_array()){
?>
<tr>
<td><?php echo $row['catname']; ?></td>
<td>
<a href="#editcategory<?php echo $row['categoryid']; ?>" data-toggle="modal" class="btn btn-success btn-sm"><span class="glyphicon glyphicon-pencil"></span> Edit</a> || <a href="#deletecategory<?php echo $row['categoryid']; ?>" data-toggle="modal" class="btn btn-danger btn-sm"><span class="glyphicon glyphicon-trash"></span> Delete</a>
<?php include('category_modal.php'); ?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
<?php include('modal.php'); ?>
</body>
</html>