-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_roles.php
169 lines (151 loc) · 4.15 KB
/
view_roles.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<!-- Author Name: Sudipto Ghosh-->
<?php require_once('check_login.php');?>
<?php include('head.php');?>
<?php include('header.php');?>
<?php include('sidebar.php');?>
<?php include('connect.php');?>
<?php
if(isset($_GET['id']))
{ ?>
<div class="popup popup--icon -question js_question-popup popup--visible">
<div class="popup__background"></div>
<div class="popup__content">
<h3 class="popup__content__title">
Sure
</h1>
<p>Are You Sure To Delete This Record?</p>
<p>
<a href="del_roles.php?id=<?php echo $_GET['id']; ?>" class="button button--success" data-for="js_success-popup">Yes</a>
<a href="view_roles.php" class="button button--error" data-for="js_success-popup">No</a>
</p>
</div>
</div>
<?php } ?>
<div class="pcoded-content">
<div class="pcoded-inner-content">
<div class="main-body">
<div class="page-wrapper">
<div class="page-header">
<div class="row align-items-end">
<div class="col-lg-8">
<div class="page-header-title">
<div class="d-inline">
<h4>Role</h4>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="page-header-breadcrumb">
<ul class="breadcrumb-title">
<li class="breadcrumb-item">
<a href="dashboard.php"> <i class="feather icon-home"></i> </a>
</li>
<li class="breadcrumb-item"><a>Manage Roles</a>
</li>
<li class="breadcrumb-item"><a href="view_roles.php">Role</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="page-body">
<div class="card">
<div class="card-header">
<div class="col-sm-10">
<a href="assign_roles.php"><button class="btn btn-primary pull-right">+ Add Role</button></a>
</div>
</div>
<div class="card-block">
<div class="table-responsive dt-responsive">
<table id="dom-jqry" class="table table-striped table-bordered nowrap">
<thead>
<tr>
<th>Name</th>
<th>Slug</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM `tbl_role` where delete_status=0";
$result = $conn->query($sql);
$i=1;
while($row = $result->fetch_assoc()) {
?>
<tr>
<!-- <td><?php echo $i;?></td> -->
<td><?php echo $row['role_name']; ?></td>
<td><?php echo $row['slug']; ?></td>
<td>
<a href="edit_roles.php?id=<?=$row['id'];?>"class="btn btn-xs btn-primary"><i class="feather icon-edit m-t-10 f-16 " ></i></a>
<a href="view_roles.php?id=<?=$row['id'];?>" class="btn btn-xs btn-danger"><i class="feather icon-trash-2 close-card m-b-0"></i></a>
</td>
</tr>
<?php $i++;}
?>
</tbody>
<tfoot>
<tr>
<th>Name</th>
<th>Slug</th>
<th>Action</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="#">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include('footer.php');?>
<?php if(!empty($_SESSION['success'])) { ?>
<div class="popup popup--icon -success js_success-popup popup--visible">
<div class="popup__background"></div>
<div class="popup__content">
<h3 class="popup__content__title">
Success
</h1>
<p><?php echo $_SESSION['success']; ?></p>
<p>
<?php echo "<script>setTimeout(\"location.href = 'view_roles.php';\",1500);</script>"; ?>
<!-- <button class="button button--success" data-for="js_success-popup">Close</button> -->
</p>
</div>
</div>
<?php unset($_SESSION["success"]);
} ?>
<?php if(!empty($_SESSION['error'])) { ?>
<div class="popup popup--icon -error js_error-popup popup--visible">
<div class="popup__background"></div>
<div class="popup__content">
<h3 class="popup__content__title">
Error
</h1>
<p><?php echo $_SESSION['error']; ?></p>
<p>
<?php echo "<script>setTimeout(\"location.href = 'view_roles.php';\",1500);</script>"; ?>
<!-- <button class="button button--error" data-for="js_error-popup">Close</button> -->
</p>
</div>
</div>
<?php unset($_SESSION["error"]); } ?>
<script>
var addButtonTrigger = function addButtonTrigger(el) {
el.addEventListener('click', function () {
var popupEl = document.querySelector('.' + el.dataset.for);
popupEl.classList.toggle('popup--visible');
});
};
Array.from(document.querySelectorAll('button[data-for]')).
forEach(addButtonTrigger);
</script>