-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.php
More file actions
239 lines (237 loc) · 8.54 KB
/
Copy pathusers.php
File metadata and controls
239 lines (237 loc) · 8.54 KB
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<?php
session_start();
if (empty($_SESSION['user_id'])) {
header('location: index.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Admin Users</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600" rel="stylesheet">
<link href="css/font-awesome.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/pages/dashboard.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<style>
table{
width:100%;
border-collapse: separate;
}
#example_filter{
float:right;
}
#example_paginate{
float:right;
}
label {
display: inline-flex;
margin-bottom: .5rem;
margin-top: .5rem;
}
</style>
<script>
$(document).ready(function() {
$('#editUsers').DataTable(
{
"aLengthMenu": [[5, 10, 25, -1], [5, 10, 25, "All"]],
"iDisplayLength": 30
}
);
} );
function checkAll(bx) {
var cbs = document.getElementsByTagName('input');
for(var i=0; i < cbs.length; i++) {
if(cbs[i].type == 'checkbox') {
cbs[i].checked = bx.checked;
}
}
}
</script>
<script>
$(document).ready(function() {
$('#currentUsers').DataTable( {
"dom": '<"toolbar">frtip'
} );
$("div.toolbar").html('<strong>Users</strong>');
} );
</script>
<style>
.toolbar {
float: left;
}
</style>
</head>
<body>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap4.min.js"></script>
<?php
$userid = $_SESSION['user_id'];
?>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span
class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span> </a><a class="brand" href="index.php">Tanyard Springs Board Portal</a>
<!--/.nav-collapse -->
</div>
<!-- /container -->
</div>
<!-- /navbar-inner -->
</div>
<!-- /navbar -->
<div class="subnavbar">
<div class="subnavbar-inner">
<div class="container">
<ul class="mainnav">
<li><a href="dashboard.php"><em class="icon-dashboard"></em><span>Dashboard</span> </a> </li>
<li> <a href ="add.php"><em class ="icon-dashboard"></em><span>Add Motion</span></a></li>
<li><a href="vote.php"><em class ="icon-dashboard"></em><span>Vote</span></a></li>
<li><a href="discussions.php"><em class ="icon-dashboard"></em><span>Discussions</span></a></li>
<li><a href="userprefs.php"><em class ="icon-dashboard"></em><span>Prefences</span></a></li>
<li class="active"><a href="users.php"><em class="icon-dashboard"></em><span>Users</span></a></li>
<li><a href="logout.php"><em class="icon-dashboard"></em><span>Logout</span></a> </li>
</ul>
</div>
<!-- /container -->
</div>
<!-- /subnavbar-inner -->
</div>
<!-- /subnavbar -->
<div class="main">
<div class="main-inner">
<div class="container">
<div class="row">
<!--<div class="alert alert-danger" role="alert">
<strong>ALERT: </strong>This message is as of October 17, 2018. Please be advised this site will be moved to a new server in the next week
</div>-->
<div class="container">
<div class="row">
<div class="toolbar"><strong>Users</strong> | <strong><a href="management.php">Management</a></strong></div>
<table id="currentUsers" name="currentUsers" border="1" id="example" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>User Name</th>
<th>E-mail Address</th>
<th>Enabled</th>
<th>Edit</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="5" style="text-align: center; vertical-align: middle;">Do you want to add a new user?</td>
<td>
<form id="addUser" id="addUser" method="post" action="modifyUser.php">
<input id="addUser" name="addUser" type="hidden" value="addUser">
<input type="Submit" name="Submit" value="Add User">
</form>
</td>
</tr>
<?php
include_once('include/db-config.php');
$users = $db_con->prepare("select * from users;");
$users->execute();
while ($row = $users->fetch(PDO::FETCH_ASSOC)) {
?>
<form id="editUsers" name="editUsers" action="modifyUser.php" method="POST">
<?php
$usersid = $row['users_id'];
?>
<tr>
<td><?php
echo $row['first_name'];
?> </td>
<td><?php
echo $row['last_name'];
?> </td>
<td><?php
echo $row['username'];
?> </td>
<td><?php
echo $row['email'];
?> </td>
<?php
$enabled = $row['enabled'];
if ($enabled == 1) {
$enabledText = "Yes";
} else {
$enabledText = "No";
}
?>
<td><?php
echo $enabledText;
?></td>
<?php
echo '<input type="hidden" id="usersid" name="usersid" value="' . $usersid . '">';
?>
<td><input type="Submit" name="Submit" value="Edit"></td>
</tr>
</form>
<?php
} //end of while
?>
</tbody>
<tfoot>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>User Name</th>
<th>E-mail</th>
<th>Enabled</th>
<th>Edit user</th>
</tr>
</tfoot>
</table>
<br />
<br />
<br />
<br />
<br />
<?php
$users->closeCursor();
?>
<!-- /span6 -->
<!-- /span6 -->
</div>
<!-- /row -->
</div>
<!-- /container -->
</div>
<!-- /main-inner -->
</div>
<!-- /main -->
<!-- /extra -->
<div class="footer">
<div class="footer-inner">
<div class="container">
<div class="row">
<div class="span12"> © 2013 <a href="http://www.egrappler.com/">Bootstrap Responsive Admin Template</a>. </div>
<!-- /span12 -->
</div>
<!-- /row -->
</div>
<!-- /container -->
</div>
<!-- /footer-inner -->
</div>
<!-- /footer -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
</body>
</html>