-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage-category.php
125 lines (100 loc) · 5.31 KB
/
manage-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
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
124
125
<?php
session_start();
error_reporting(0);
include('includes/dbconnection.php');
if (strlen($_SESSION['jpaid']==0)) {
header('location:logout.php');
} else{
// Code for deleting the job category
if(isset($_GET['delid']))
{
$rid=intval($_GET['delid']);
$sql="delete from tblcategory where ID=:rid";
$query=$dbh->prepare($sql);
$query->bindParam(':rid',$rid,PDO::PARAM_STR);
$query->execute();
echo "<script>alert('Data deleted');</script>";
echo "<script>window.location.href = 'manage-category.php'</script>";
}
?>
<!doctype html>
<html lang="en" class="no-focus"> <!--<![endif]-->
<head>
<title>Job Portal - Manage Category</title>
<link rel="stylesheet" href="assets/js/plugins/datatables/dataTables.bootstrap4.min.css">
<link rel="stylesheet" id="css-main" href="assets/css/codebase.min.css">
</head>
<body>
<div id="page-container" class="sidebar-o sidebar-inverse side-scroll page-header-fixed main-content-narrow">
<?php include_once('includes/sidebar.php');?>
<?php include_once('includes/header.php');?>
<!-- Main Container -->
<main id="main-container">
<!-- Page Content -->
<div class="content">
<h2 class="content-heading">Manage Category</h2>
<!-- Dynamic Table Full Pagination -->
<div class="block">
<div class="block-header bg-gd-emerald">
<h3 class="block-title">Manage Category</h3>
</div>
<div class="block-content block-content-full">
<!-- DataTables init on table by adding .js-dataTable-full-pagination class, functionality initialized in js/pages/be_tables_datatables.js -->
<table class="table table-bordered table-striped table-vcenter js-dataTable-full-pagination">
<thead>
<tr>
<th class="text-center">#</th>
<th>Category Name</th>
<th class="d-none d-sm-table-cell">Creation Date</th>
<th class="d-none d-sm-table-cell" style="width: 15%;">Action</th>
</tr>
</thead>
<tbody>
<?php
$sql="SELECT * from tblcategory";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $row)
{ ?>
<tr>
<td class="text-center"><?php echo htmlentities($cnt);?></td>
<td class="font-w600"><?php echo htmlentities($row->CategoryName);?></td>
<td class="d-none d-sm-table-cell"><?php echo htmlentities($row->PostingDate);?></td>
<td class="d-none d-sm-table-cell"><a href="manage-category.php?delid=<?php echo ($row->id);?>" onclick="return confirm('Do you really want to Delete ?');" class="btn btn-danger btn-sm">Delete</a> <a href="edit-category.php?editid=<?php echo htmlentities ($row->id);?>" class="btn btn-primary btn-sm"> Edit</a></td>
</tr>
<?php $cnt=$cnt+1;}} ?>
</tbody>
</table>
</div>
</div>
<!-- END Dynamic Table Full Pagination -->
<!-- END Dynamic Table Simple -->
</div>
<!-- END Page Content -->
</main>
<!-- END Main Container -->
<?php include_once('includes/footer.php');?>
</div>
<!-- END Page Container -->
<!-- Codebase Core JS -->
<script src="assets/js/core/jquery.min.js"></script>
<script src="assets/js/core/popper.min.js"></script>
<script src="assets/js/core/bootstrap.min.js"></script>
<script src="assets/js/core/jquery.slimscroll.min.js"></script>
<script src="assets/js/core/jquery.scrollLock.min.js"></script>
<script src="assets/js/core/jquery.appear.min.js"></script>
<script src="assets/js/core/jquery.countTo.min.js"></script>
<script src="assets/js/core/js.cookie.min.js"></script>
<script src="assets/js/codebase.js"></script>
<!-- Page JS Plugins -->
<script src="assets/js/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="assets/js/plugins/datatables/dataTables.bootstrap4.min.js"></script>
<!-- Page JS Code -->
<script src="assets/js/pages/be_tables_datatables.js"></script>
</body>
</html>
<?php } ?>