-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathriwayatPengaduan.php
More file actions
127 lines (107 loc) · 2.68 KB
/
Copy pathriwayatPengaduan.php
File metadata and controls
127 lines (107 loc) · 2.68 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
<?php
require 'koneksi.php';
if($_SESSION['nik'] == ""){
header('location: login.php');
}
else{
$varNik = $_SESSION['nik'];
$query = "SELECT * FROM pengaduan WHERE nik = '$varNik';";
$result = mysqli_query($conn, $query);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="CSS/style.css">
<script type="text/javascript">
function checkDelete(){
return confirm('Yakin Data Ingin Dihapus?');
}
</script>
<title>RIWAYAT PENGADUAN MASYARAKAT</title>
</head>
<body>
<div class="sidebar">
<a href="dashboard.php">DASHBOARD</a>
<a href="formPengaduan.php">FORM PENGADUAN</a>
<a class="active" href="riwayatPengaduan.php">RIWAYAT PENGADUAN</a>
<a href="logout.php">LOGOUT</a>
</div>
<div class="content">
<h2>LIHAT RIWAYAT PENGADUAN</h2>
<div class="container">
<center>
<table border="1">
<tr>
<th>ID</th>
<th>Tanggal Pengaduan</th>
<th>NIK</th>
<th>Laporan</th>
<th>Foto</th>
<th>Status</th>
<th>Action</th>
</tr>
<?php
while ($data = mysqli_fetch_assoc($result)) {
?>
<tr>
<td>
<?php echo $data['id_pengaduan']; ?>
</td>
<td>
<?php echo $data['tgl_pengaduan']; ?>
</td>
<td>
<?php echo $data['nik']; ?>
</td>
<td>
<?php echo $data['isi_laporan']; ?>
</td>
<td>
<img src="media/laporan/<?php echo $data['foto']; ?>" width="300px">
</td>
<td>
<?php
if($data['status'] == '0'){
echo "Belum Ditanggapi";
}
elseif($data['status'] == 'proses'){
echo "Sedang Diproses";
}
elseif($data['status'] == 'selesai'){
echo "Laporan Selesai";
}
else{
echo "Laporan Invalid";
}
?>
</td>
<td>
<?php
if($data['status'] == 'selesai'){
?>
<a href="lihatTanggapan.php?idPengaduan=<?php echo $data["id_pengaduan"] ?>">Lihat Tanggapan<i>👁</i></a>
<br><br>
<?php
}
else{
?>
<a href="editPengaduan.php?edit=<?php echo $data["id_pengaduan"] ?>">edit<i>✏</i></a>
<br><br>
<a onclick="return checkDelete()" href="prosesUser.php?delete=<?php echo $data['id_pengaduan'] ?>">Delete<i>🗑</i></a>
<?php
}
?>
</td>
</tr>
<?php
}
?>
</table>
</center>
</div>
</div>
</body>
</html>