-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
533 lines (477 loc) · 15.1 KB
/
index.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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
<?php
//Mulai Sesion
session_start();
if (isset($_SESSION["ses_username"]) == "") {
header("location: login.php");
} else {
$data_nama = $_SESSION["ses_nama"];
$data_level = $_SESSION["ses_level"];
}
//KONEKSI DB
include "inc/koneksi.php";
$connect = new PDO("mysql:host=localhost;dbname=db_form", "root", "");
$sql = $koneksi->query("SELECT * from tb_profil");
while ($data = $sql->fetch_assoc()) {
$nama = $data['nama_profil'];
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Data SURVEI DPMTPSP</title>
<link rel="icon" href="dist/img/logo.png">
<!-- Tell the browser to be responsive to screen width -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Font Awesome -->
<link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<!-- DataTables -->
<link rel="stylesheet" href="plugins/datatables-bs4/css/dataTables.bootstrap4.css">
<!-- overlayScrollbars -->
<link rel="stylesheet" href="dist/css/adminlte.min.css">
<!-- Select2 -->
<link rel="stylesheet" href="plugins/select2/css/select2.min.css">
<link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">
<!-- Google Font: Source Sans Pro -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
<!-- Alert -->
<script src="plugins/alert.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
</head>
<body class="hold-transition sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">
<!-- Navbar -->
<nav class="main-header navbar navbar-expand navbar-dark">
<!-- Left navbar links -->
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" data-widget="pushmenu" href="#">
<i class="fas fa-bars text-white"></i>
</a>
</li>
</ul>
<!-- SEARCH FORM -->
<ul class="navbar-nav ml-auto">
<li class="nav-item d-none d-sm-inline-block">
<a href="index.php" class="nav-link">
<font color="#eee">
<b>
<?php echo $nama; ?>
</b>
</font>
</a>
</li>
</ul>
</nav>
<!-- /.navbar -->
<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
<a href="index.php" class="brand-link">
<img src="dist/img/logo.png" alt="AdminLTE Logo" class="brand-image" style="opacity: .8">
<span class="brand-text"> DATA SURVEI</span>
</a>
<!-- Sidebar -->
<div class="sidebar">
<!-- Sidebar user (optional) -->
<div class="user-panel mt-2 pb-2 mb-2 d-flex">
<div class="image">
<img src="dist/img/user.png" class="img-circle elevation-1" alt="User Image">
</div>
<div class="info">
<a href="index.php" class="d-block">
<?php echo $data_nama; ?>
</a>
</div>
</div>
<!-- Sidebar Menu -->
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
<li class="nav-item">
<a href="index.php" class="nav-link">
<i class="nav-icon far fa fa-users"></i>
<p>
Data Survei
</p>
</a>
</li>
<?php if ($data_level == "Admin") : ?>
<li class="nav-item">
<a href="jumlah_data.php" class="nav-link">
<i class="nav-icon far fa fa-users"></i>
<p>
Jumlah Data
</p>
</a>
</li>
<li class="nav-item">
<a href="admin/penggona/data_pengguna.php" class="nav-link">
<i class="nav-icon far fa fa-users"></i>
<p>
Data Pengguna
</p>
</a>
</li>
<li class="nav-item">
<a href="filter.php" class="nav-link">
<i class="nav-icon far fa fa-download"></i>
<p>
Unduh
</p>
</a>
</li>
<?php endif ?>
<li class="nav-link"></li>
<a onclick="return confirm('Apakah anda yakin akan keluar ?')" href="logout.php" class="nav-link">
<i class="nav-icon far fa-circle text-danger"></i>
<p>
Logout
</p>
</a>
</li>
</nav>
<!-- /.sidebar-menu -->
</div>
<!-- /.sidebar -->
</aside>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
</section>
<!-- Main content -->
<section class="content">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title">
<i class="fa fa-table"></i> Data Survei
</h3>
</div>
<!-- /.card-header -->
<div class="card-body">
<div class="table-responsive">
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label>Tanggal</label>
<input type="text" name="daterange" class="form-control" placeholder="Rentang tanggal" id="tanggal" />
</div>
</div>
<div class="col-md-2">
<div class="list-group">
<label>Gender</label>
<?php
$query = "
SELECT DISTINCT gender FROM tb_form ORDER BY gender DESC
";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach ($result as $row) {
?>
<div class="list-group-item checkbox">
<label><input type="checkbox" class="common_selector gender" value="<?php echo $row['gender']; ?>"> <?php echo $row['gender']; ?></label>
</div>
<?php
}
?>
</div>
</div>
<div class="col-md-2">
<div class="list-group">
<label>Pendidikan</label>
<div style="height: 170px; overflow-y: auto; overflow-x: hidden;">
<?php
$query = "SELECT DISTINCT pendidikan FROM tb_form ORDER BY pendidikan DESC";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach ($result as $row) {
?>
<div class="list-group-item checkbox">
<label><input type="checkbox" class="common_selector pendidikan" value="<?php echo $row['pendidikan']; ?>"> <?php echo $row['pendidikan']; ?></label>
</div>
<?php
}
?>
</div>
</div>
</div>
<div class="col-md-3">
<div class="list-group">
<label>Pekerjaan</label>
<div style="height: 170px; overflow-y: auto; overflow-x: hidden;">
<?php
$query = "
SELECT DISTINCT pekerjaan FROM tb_form ORDER BY pekerjaan DESC
";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach ($result as $row) {
?>
<div class="list-group-item checkbox">
<label><input type="checkbox" class="common_selector pekerjaan" value="<?php echo $row['pekerjaan']; ?>"> <?php echo $row['pekerjaan']; ?></label>
</div>
<?php
}
?>
</div>
</div>
</div>
<div class="col-md-2">
<div class="list-group">
<label>Query 1</label>
<?php
$query = "
SELECT DISTINCT soal1 FROM tb_form ORDER BY soal1 DESC
";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach ($result as $row) {
?>
<div class="list-group-item checkbox">
<label><input type="checkbox" class="common_selector soal1" value="<?php echo $row['soal1']; ?>"> <?php echo $row['soal1']; ?></label>
</div>
<?php
}
?>
</div>
</div>
<div class="col-md-2">
<div class="list-group">
<label>Query 2</label>
<?php
$query = "
SELECT DISTINCT soal2 FROM tb_form ORDER BY soal2 DESC
";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach ($result as $row) {
?>
<div class="list-group-item checkbox">
<label><input type="checkbox" class="common_selector soal2" value="<?php echo $row['soal2']; ?>"> <?php echo $row['soal2']; ?></label>
</div>
<?php
}
?>
</div>
</div>
<div class="col-md-2">
<div class="list-group">
<label>Query 3</label>
<?php
$query = "
SELECT DISTINCT soal3 FROM tb_form ORDER BY soal3 DESC
";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach ($result as $row) {
?>
<div class="list-group-item checkbox">
<label><input type="checkbox" class="common_selector soal3" value="<?php echo $row['soal3']; ?>"> <?php echo $row['soal3']; ?></label>
</div>
<?php
}
?>
</div>
</div>
<div class="col-md-2">
<div class="list-group">
<label>Query 4</label>
<?php
$query = "
SELECT DISTINCT soal4 FROM tb_form ORDER BY soal4 DESC
";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach ($result as $row) {
?>
<div class="list-group-item checkbox">
<label><input type="checkbox" class="common_selector soal4" value="<?php echo $row['soal4']; ?>"> <?php echo $row['soal4']; ?></label>
</div>
<?php
}
?>
</div>
</div>
<div class="col-md-2">
<div class="list-group">
<label>Query 5</label>
<?php
$query = "
SELECT DISTINCT soal5 FROM tb_form ORDER BY soal5 DESC
";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach ($result as $row) {
?>
<div class="list-group-item checkbox">
<label><input type="checkbox" class="common_selector soal5" value="<?php echo $row['soal5']; ?>"> <?php echo $row['soal5']; ?></label>
</div>
<?php
}
?>
</div>
</div>
<div class="col-md-2">
<div class="list-group">
<label>Query 6</label>
<?php
$query = "
SELECT DISTINCT soal6 FROM tb_form ORDER BY soal6 DESC
";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach ($result as $row) {
?>
<div class="list-group-item checkbox">
<label><input type="checkbox" class="common_selector soal6" value="<?php echo $row['soal6']; ?>"> <?php echo $row['soal6']; ?></label>
</div>
<?php
}
?>
</div>
</div>
</div>
<br>
<table id="example1" class="table table-bordered table-striped">
<thead>
<tr>
<th>No</th>
<th>tanggal</th>
<th>Gender</th>
<th>Pendidikan</th>
<th>Pekerjaan</th>
<th>Query1</th>
<th>Query2</th>
<th>Query3</th>
<th>Query4</th>
<th>Query5</th>
<th>Query6</th>
</tr>
</thead>
<tbody>
<?php
$sql = $koneksi->query("SELECT * from tb_form");
$no = 1;
while ($row = $sql->fetch_assoc()) {
?>
<tr>
<td>
<?php echo $no++; ?>
</td>
<td>
<?php echo $row['tanggal']; ?>
</td>
<td>
<?php echo $row['gender']; ?>
</td>
<td>
<?php echo $row['pendidikan']; ?>
</td>
<td>
<?php echo $row['pekerjaan']; ?>
</td>
<td>
<?php echo $row['soal1']; ?>
</td>
<td>
<?php echo $row['soal2']; ?>
</td>
<td>
<?php echo $row['soal3']; ?>
</td>
<td>
<?php echo $row['soal4']; ?>
</td>
<td>
<?php echo $row['soal5']; ?>
</td>
<td>
<?php echo $row['soal6']; ?>
</td>
</tr>
<?php
}
?>
</tbody>
</div>
</tfoot>
</table>
</div>
</div>
<!-- /.card-body -->
<!-- /. WEB DINAMIS DISINI ############################################################################### -->
<div class="container-fluid">
<?php
if (isset($_GET['page'])) {
$hal = $_GET['page'];
switch ($hal) {
//Asrama
case 'data-survei':
include "index.php";
break;
case 'del-survei':
include "admin/survei/del_survei.php";
break;
//default
default:
echo "<center><h1> ERROR !</h1></center>";
break;
}
}
?>
</div>
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<footer class="main-footer">
<div class="float-right d-none d-sm-block">
Copyright ©
<a target="_blank" href="https://dpmptsp.ponorogo.go.id/">
<strong>DPMPTSP</strong>
</a>
2021 All rights reserved.
</div>
<b>Created 2021</b>
</footer>
<!-- Control Sidebar -->
<aside class="control-sidebar control-sidebar-dark">
<!-- Control sidebar content goes here -->
</aside>
<!-- /.control-sidebar -->
</div>
<!-- ./wrapper -->
<!-- jQuery -->
<script src="js/jquery-1.10.2.min.js"></script>
<!-- Bootstrap 4 -->
<script src="js/bootstrap.min.js"></script>
<!-- Select2 -->
<script src="plugins/select2/js/select2.full.min.js"></script>
<!-- DataTables -->
<script src="plugins/datatables/jquery.dataTables.js"></script>
<script src="plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js"></script>
<!-- page script -->
<script src="plugins/jquery-datatable/extensions/export/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script type="text/javascript" src="chart/chart.js"></script>
<script src="js/filter.js"></script>
</body>
</html>