-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodifyManagement.php
More file actions
278 lines (264 loc) · 11.1 KB
/
modifyManagement.php
File metadata and controls
278 lines (264 loc) · 11.1 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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<?php
session_start();
if (empty($_SESSION['user_id'])) {
header('location: index.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Admin Management</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">
<?php
if (isset($_POST['addManagement']))
{
?>
<form action="addManager.php" id="addManager" name="addManager" method="post">
<fieldset>
<!-- Form Name -->
<legend>Add a New Manager</legend>
<!-- Text input-->
<div>
<labelfor="firstName">First Name</label>
<div>
<input id="firstName" name="firstName" type="text" placeholder="First name" required="">
</div>
</div>
<!-- Text input-->
<div>
<label for="Last Name">Last Name</label>
<div>
<input id="lastName" name="lastName" type="text" placeholder="Last Name" required="">
</div>
</div>
<!-- Text input-->
<div>
<label for="email">E-mail Address</label>
<div>
<input id="email" name="email" type="text" placeholder="email" required="">
</div>
</div>
<!-- Select Basic -->
<div>
<label for="Enabled">Enabled</label>
<div>
<select id="Enabled" name="Enabled" class="form-control">
<option value="1">Yes</option>
<option value="2">No</option>
</select>
</div>
</div>
<br /><br />
<input type="submit" value="Send Request"> <input type="reset" value="Reset">
</form>
<?php
}
include_once ('include/db-config.php');
if (isset($_POST['usersid']))
{
$userid=$_POST['usersid'];
$modifyMgt=$db_con->prepare("SELECT * FROM management WHERE managementID=:userid");
$modifyMgt->bindParam(':userid',$userid);
$modifyMgt->execute();
while ( $row = $modifyMgt->fetch(PDO::FETCH_ASSOC))
{
$firstName=$row['first_name'];
$lastName=$row['last_name'];
$email=$row['email'];
$enabled=$row['fenabled'];
if ($enabled==1)
{
$enabledText="Yes";
}
else
{
$enabledText="No";
}
?>
<form action="EditManager.php" id="EditManager" name="EditManager" method="post">
<fieldset>
<!-- Form Name -->
<legend>Edit Manager</legend>
<!-- Text input-->
<div>
<labelfor="firstName">First Name</label>
<div>
<input id="firstName" name="firstName" type="text" placeholder="First name" required=""
value="<?php echo $firstName; ?>">
</div>
</div>
<!-- Text input-->
<div>
<label for="Last Name">Last Name</label>
<div>
<input id="lastName" name="lastName" type="text" placeholder="Last Name" required=""
value="<?php echo $lastName; ?>">
</div>
</div>
<!-- Text input-->
<div>
<label for="email">E-mail Address</label>
<div>
<input id="email" name="email" type="text" placeholder="email" required="" value="<?php echo $email; ?>">
</div>
</div>
<!-- Select Basic -->
<div>
<label for="Enabled">Enabled</label>
<div>
<select id="Enabled" name="Enabled" class="form-control">
<option value="2">Choose an Option</option>
<option value="1">Yes</option>
<option value="0">No</option>
</select>
</div>
</div>
<br /><br />
<input type="hidden" id="mgtID" name="mgtID" value="<?php echo $userid; ?>">
<input type="submit" value="Send Request"> <input type="reset" value="Reset">
</form>
<?php
}
}
?>
<!-- /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>