-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathrole.php
176 lines (124 loc) · 6.16 KB
/
role.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
170
171
172
173
174
175
176
<?php include 'app/inc/header.php'; ?>
<?php
// Delete Role By Id
$delrole = isset($_GET['delrole']) ? $_GET['delrole'] : '';
if (isset($delrole) && is_numeric($delrole) && isset($_GET['remove']) == 'removeid') {
$delrole = preg_replace('/[^a-zA-Z0-9-]/', '', $delrole);
$delRole = $rol->deleteRoleById($delrole);
}
?>
<!--====== Start Main Wrapper Section======-->
<section class="d-flex" id="wrapper">
<?php include 'app/inc/sidebar.php'; ?>
<div class="page-content-wrapper">
<!-- Header BreadCrumb -->
<div class="content-header">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="dashboard.php"><i class="material-icons">home</i>Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Roles</li>
</ol>
</nav>
<div class="create-item">
<a href="createrole.php" class="theme-primary-btn btn btn-primary"><i class="material-icons">add</i>Add New
Role</a>
</div>
</div>
<!-- Header BreadCrumb -->
<?php
if (isset($delRole)) {
echo $delRole;
}
?>
<!-- main-content -->
<div class="main-content">
<!-- Users DataTable-->
<div class="row mt-3">
<div class="col-md-12">
<div class="card bg-white">
<div class="card-body mt-3">
<div class="table-responsive">
<table id="roleTable" class="table table-striped table-borderless" style="width:100%">
<thead>
<tr>
<th>SL</th>
<th>Display Name</th>
<th>Role Name</th>
<th>Status</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php
$rolelist = $rol->selectAllRole();
if ($rolelist) {
$i = 0;
while ($result = $rolelist->fetch_assoc()) {
$i++;
?>
<tr>
<td class="pt-3"><?php echo $i; ?></td>
<td class="pt-3"><?php echo $result['roledname']; ?></td>
<td class="pt-3"><span
class="badge badge-lg badge-secondary text-white"><?php echo $result['rolename']; ?></span>
</td>
<td class="pt-3">
<?php if ($result['status'] == '0') {?>
<span class="badge badge-lg badge-success text-white">Active</span>
<?php }elseif($result['status'] == '1'){ ?>
<span class="badge badge-lg badge-warning text-white">Deactive</span>
<?php } ?>
</td>
<td class="text-center pt-3">
<a class="btn btn-info"
href="editrole.php?roleid=<?php echo $result['roleid']; ?>">Edit Role</a>
<?php if ($result['rolename'] == "Author") { ?>
<?php if ( isset($access) == '$access' ) { ?>
<a class="btn btn-danger" onclick="return confirm('You can not Remove account !')"
href="#"> No Action </a>
<?php } ?>
<?php }else{ ?>
<?php if ( isset($edit) == '$edit' ) { ?>
<a class="btn btn-danger" onclick="return confirm('Are you sure to Delete ?')"
href="?remove=removeid&&delrole=<?php echo $result['roleid']; ?>">Delete Role</a>
<?php } ?>
<?php } ?>
</td>
</tr>
<?php }}else{ ?>
<tr>
<td colspan="5" class="text-center">No role created yet !</td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- Users DataTable-->
<div class="row mt-3">
<div class="col-md-12">
<div class="card ">
<div class="card-body footer-p">
<p>Design and developed by Nababur rahaman send a thanks giving mail or do you want any support :)
<a href="mailto:[email protected]">[email protected]</a>
</p>
<p>Do you want to develop any php or laravel or wordpress project ? send a mail:) <a
href="mailto:[email protected]">[email protected]</a> </p>
<p>CEO of GridTemaplate: <a target="_blank"
href="https://www.gridtemplate.com/">https://www.gridtemplate.com/</a>
</p>
<p>Connect with Github: <a target="_blank"
href="https://github.com/nababur">https://github.com/nababur</a>
</p>
</div>
</div>
</div>
</div>
</div>
<!-- main-content -->
</div>
</section>
<!--====== End Main Wrapper Section======-->
<?php include 'app/inc/footer.php'; ?>