-
Notifications
You must be signed in to change notification settings - Fork 29
/
admin.php
309 lines (280 loc) · 5.77 KB
/
admin.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
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<?php
session_start();
?>
<html>
<style>
body {
font-family: calibri;
margin: 0; padding: 0;
background-color: #e6e6e6;
}
table {
margin: 1em 0 3em 0;
}
table tr th, table tr td {
background: #323232;
color: #FFF;
padding: 0.75em 0.5em;
text-align: left;
}
table tr td {
background: #FFF;
color: #47433F;
border-top: 1px solid #EEE;
}
.label {
background-color: #141414;
width:100%;
height:auto;
padding-left: 3px;
padding-top:3px;
padding-bottom: 3px;
color: white;
top: 0;
}
.nav {
background-color: #444444;
margin-left:1%;
margin-top:1%;
margin-right:1%;
border: none;
width:98%;
position: relative;
overflow: hidden;
text-transform: uppercase;
font-family: calibri;
}
.nav a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.nav a:hover {
background: #14aa6c;
color: white;
}
.container {
background-color: white;
border: black solid;
height:auto;
width: 97%;
margin-top: 1%;
margin-left: 1%;
margin-right: 1%;
margin-bottom: 1%;
overflow: hidden;
}
.left {
background-color: white;
overflow: hidden;
height:auto;
width: 80%;
margin-top: 1%;
margin-left: 9%;
float:left;
font-family: calibri;
padding:10px;
}
.right{
background-color: white;
overflow: hidden;
height:auto;
width: 47%;
margin-top: 1%;
margin-right: 1%;
float:right;
border: #444444 solid;
border-width: 1px;
font-family: calibri;
}
.down{
background-color: white;
height:auto;
width: 95%;
margin-top: 2%;
margin-left: 2%;
margin-right: 2%;
float:right;
font-family: calibri;
padding:10px;
}
.banner {
width: auto;
height: 30px;
padding-top: 8px;
padding-bottom: 8px;
font-size: 20px;
text-align: center;
color: WHITE;
font-weight: bold;
background: #14aa6c;
border: #14aa6c solid 1px;
font-family: calibri;
}
input[type=text]{
text-align:left;
padding: 12px 6px;
color: #444444;
border: #2a992c;
background-color: #dddddd;
margin-top:5px;
margin-left:5px;
margin-right:5px;
font-family: calibri;
}
input[type=password]{
text-align:left;
width: 50%;
padding: 12px 6px;
color: #444444;
border: #2a992c;
background-color:#dddddd;
margin-top:5px;
margin-left:5px;
margin-right:5px;
font-family: calibri;
}
input[type=text]:focus {
cursor:pointer;
background-color: white;
border-color:#14aa6c;
border-style: solid;
}
input[type=submit]:hover {
background-color: #14aa6c;
border: none;
color: white;
-webkit-transition:background 0.5s ease-in-out;
-moz-transition:background 0.5s ease-in-out;
transition:background-color 0.5s ease-in-out;
}
input[type=submit] {
background-color: #444444;
border: none;
padding: none;
color: white;
width:98%;
height: 45px;
margin-top:5%;
margin-left:1%;
margin-right:1%;
border-radius: 7px;
}
input[type=password]:focus {
cursor:pointer;
background-color: white;
border-color:#14aa6c;
border-style: solid;
}
.dropdown {
overflow: hidden;
float: left;
}
.dropdown .dropbtn {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
</style>
<title>Account</title>
</head>
<body>
<section class="left">
<div class="banner">
EDIT ACCOUNT
</div>
<center>
<form method="post">
<?php
if (isset($_POST['submit']))
{
include 'db.php';
$fullname=$_POST['fullname'] ;
$username=$_POST['username'] ;
$emailaddress=$_POST['emailaddress'];
$device = $_POST['device_Id'] ;
$password= $_POST['password'] ;
$position= $_POST['position'] ;
$committee= $_POST['committee'];
mysqli_query($db,"INSERT INTO `accounts`(Fullname ,Username, Emailaddress,device_Id, Password, Position, Committee)
VALUES ('$fullname','$username','$emailaddress','$device_Id','$password','$position', '$committee')");
}
?>
</form>
<table width="90%" border="2" style="border-collapse:collapse;">
<thead> <tr>
<th> Fullname </th>
<th> Username </th>
<th> Email Address </th>
<th> Device ID </th>
<th> Password </th>
<th> Position </th>
<th> Committee</th>
<th colspan="2">Action</th>
</tr>
</thead>
<script>
function myFunction() {
var r = confirm("Are you sure?");
if (r == true) {
return true;
} else {
return false;
}
document.getElementById("demo").innerHTML = txt;
}
</script>
<?php
include("db.php");
$result=mysqli_query($db,"SELECT * FROM accounts WHERE id=1");
if($_SESSION['position']=='Barangay Secretary'){
while($test = mysqli_fetch_array($result))
{
$id = $test['ID'];
echo "<tr align='center'>";
echo"<td><font color='black'>" .$test['Fullname']."</font></td>";
echo"<td><font color='black'>" .$test['Username']."</font></td>";
echo"<td><font color='black'>" .$test['Emailaddress']."</font></td>";
echo"<td><font color='black'>" .$test['device_Id']."</font></td>";
echo"<td><font color='black'>". $test['Password']. "</font></td>";
echo"<td><font color='black'>". $test['Position']. "</font></td>";
echo"<td><font color='black'>". $test['Committee']. "</font></td>";
echo"<td> <a href ='adminedit.php?ID=$id'onclick='return myFunction()'>Edit</a>";
echo "</tr>";
} //while
} //if
mysqli_close($db);
?>
</section>
</table>
</center>
</body>
</html>