initiall commit
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
$id = $_GET['id'];
|
||||
$data = mysqli_query($conn, "SELECT * FROM penduduk_miskin WHERE id='$id'");
|
||||
$d = mysqli_fetch_array($data);
|
||||
|
||||
// Penanganan variasi nama kolom database (antisipasi huruf besar/kecil)
|
||||
$jumlah_keluarga = $d['jumlah_keluarga'] ?? $d['anggota_keluarga'] ?? 0;
|
||||
$umur = $d['umur'] ?? 0;
|
||||
$pendidikan = $d['pendidikan_terakhir'] ?? '';
|
||||
$lat = $d['latitude'] ?? $d['Latitude'] ?? '';
|
||||
$lng = $d['longitude'] ?? $d['Longitude'] ?? '';
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Edit Data Miskin</title>
|
||||
<style>
|
||||
body { font-family: sans-serif; background: #f4f7f6; display: flex; justify-content: center; padding: 40px; }
|
||||
.card { background: white; padding: 25px; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); width: 380px; }
|
||||
label { font-size: 13px; font-weight: bold; color: #495057; display: block; margin-top: 10px; }
|
||||
input { width: 100%; padding: 10px; margin: 5px 0 12px 0; border: 1px solid #ddd; border-radius: 5px; box-sizing: border-box; }
|
||||
button { width: 100%; padding: 12px; background: #fd7e14; color: white; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; margin-top: 10px; transition: background 0.2s; }
|
||||
button:hover { background: #e8590c; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="card">
|
||||
<h3 style="color:#fd7e14; text-align:center; margin-bottom: 20px;">Edit Data Warga</h3>
|
||||
<form action="proses_edit_miskin.php" method="POST">
|
||||
<!-- ID Warga (Hidden) -->
|
||||
<input type="hidden" name="id" value="<?php echo $d['id']; ?>">
|
||||
|
||||
<label>Nama Kepala Keluarga (KK)</label>
|
||||
<input type="text" name="nama_kk" value="<?php echo $d['nama_kk']; ?>" required>
|
||||
|
||||
<label>Alamat Domisili</label>
|
||||
<input type="text" name="alamat" value="<?php echo $d['alamat']; ?>" required>
|
||||
|
||||
<!-- INPUT YANG SEBELUMNYA HILANG KITA TAMBAHKAN DI BAWAH INI -->
|
||||
<label>Jumlah Anggota Keluarga</label>
|
||||
<input type="number" name="anggota_keluarga" value="<?php echo $jumlah_keluarga; ?>" required>
|
||||
|
||||
<label>Umur Kepala Keluarga</label>
|
||||
<input type="number" name="umur" value="<?php echo $umur; ?>" required>
|
||||
|
||||
<label>Pendidikan Terakhir</label>
|
||||
<input type="text" name="pendidikan_terakhir" value="<?php echo $pendidikan; ?>" required>
|
||||
|
||||
<label>Latitude (Titik Peta)</label>
|
||||
<input type="text" name="latitude" value="<?php echo $lat; ?>" required>
|
||||
|
||||
<label>Longitude (Titik Peta)</label>
|
||||
<input type="text" name="longitude" value="<?php echo $lng; ?>" required>
|
||||
|
||||
<button type="submit">UPDATE DATA WARGA</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
$id = mysqli_real_escape_string($conn, $_GET['id']);
|
||||
$data = mysqli_query($conn, "SELECT * FROM pengaduan_warga WHERE id='$id'");
|
||||
$d = mysqli_fetch_array($data);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="id">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Edit Data Pengaduan</title>
|
||||
<style>
|
||||
body { font-family: sans-serif; background: #f4f7f6; display: flex; justify-content: center; padding: 40px; }
|
||||
.card { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); width: 350px; }
|
||||
input, textarea { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #ddd; border-radius: 5px; box-sizing: border-box; font-family: sans-serif; }
|
||||
button { width: 100%; padding: 10px; background: #dc2626; color: white; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; }
|
||||
label { font-size: 12px; font-weight: bold; color: #555; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="card">
|
||||
<h3 style="color:#dc2626; text-align:center; margin-bottom:15px;">Edit Laporan Warga</h3>
|
||||
<form action="proses_edit_pengaduan.php" method="POST">
|
||||
<input type="hidden" name="id" value="<?php echo $d['id']; ?>">
|
||||
|
||||
<label>Nama Pelapor</label>
|
||||
<input type="text" name="nama_pelapor" value="<?php echo $d['nama_pelapor']; ?>" required>
|
||||
|
||||
<label>Kontak Pelapor</label>
|
||||
<input type="text" name="kontak_pelapor" value="<?php echo $d['kontak_pelapor']; ?>" required>
|
||||
|
||||
<label>Deskripsi Laporan / Aduan</label>
|
||||
<textarea name="deskripsi_laporan" rows="4" required><?php echo $d['deskripsi_laporan']; ?></textarea>
|
||||
|
||||
<button type="submit">UPDATE LAPORAN</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
$id = $_GET['id'];
|
||||
// Proteksi string agar aman dari error sql injection
|
||||
$id = mysqli_real_escape_string($conn, $id);
|
||||
$data = mysqli_query($conn, "SELECT * FROM masjid WHERE id='$id'");
|
||||
$d = mysqli_fetch_array($data);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Edit Data Masjid</title>
|
||||
<style>
|
||||
body { font-family: 'Segoe UI', sans-serif; background: #f4f7f6; display: flex; justify-content: center; padding: 50px; }
|
||||
.card { background: white; padding: 25px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); width: 400px; }
|
||||
h3 { color: #10b981; text-align: center; margin-bottom: 20px; }
|
||||
label { font-size: 13px; font-weight: 600; color: #475569; display: block; margin-top: 10px; }
|
||||
input { width: 100%; padding: 10px; margin: 5px 0 15px 0; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; }
|
||||
button { width: 100%; padding: 12px; background: #10b981; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 14px; }
|
||||
button:hover { background: #059669; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="card">
|
||||
<h3>Edit Lokasi Masjid</h3>
|
||||
<form action="proses_edit_masjid.php" method="POST">
|
||||
<input type="hidden" name="id" value="<?php echo $d['id']; ?>">
|
||||
|
||||
<label>Nama Masjid</label>
|
||||
<input type="text" name="nama_masjid" value="<?php echo $d['nama_masjid']; ?>" required>
|
||||
|
||||
<label>Nama PIC</label>
|
||||
<input type="text" name="nama_pic" value="<?php echo $d['nama_pic']; ?>" required>
|
||||
|
||||
<label>Radius Jangkauan (Meter)</label>
|
||||
<input type="number" name="radius_meter" value="<?php echo $d['radius_meter']; ?>" required>
|
||||
|
||||
<button type="submit">UPDATE DATA MASJID</button>
|
||||
<center><br><a href="index.php" style="text-decoration:none; color:gray; font-size:13px;">← Kembali ke Peta</a></center>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
$id = $_GET['id'];
|
||||
mysqli_query($conn, "DELETE FROM penduduk_miskin WHERE id='$id'");
|
||||
header("location:index.php");
|
||||
?>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
|
||||
if (isset($_GET['id'])) {
|
||||
$id = mysqli_real_escape_string($conn, $_GET['id']);
|
||||
|
||||
$query = "DELETE FROM pengaduan_warga WHERE id = '$id'";
|
||||
|
||||
if (mysqli_query($conn, $query)) {
|
||||
echo "<script>
|
||||
alert('Laporan pengaduan berhasil dihapus!');
|
||||
window.location.href='index.php';
|
||||
</script>";
|
||||
} else {
|
||||
echo "Gagal menghapus data: " . mysqli_error($conn);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
$id = $_GET['id'];
|
||||
mysqli_query($conn, "DELETE FROM masjid WHERE id='$id'");
|
||||
header("location:index.php");
|
||||
?>
|
||||
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
session_start();
|
||||
include 'koneksi.php';
|
||||
if (!isset($_SESSION['user_role']) || !in_array($_SESSION['user_role'], ['admin','walikota'])) {
|
||||
header('Location: login.php'); exit;
|
||||
}
|
||||
|
||||
// Tambah histori
|
||||
if (isset($_POST['tambah'])) {
|
||||
$id_warga = (int)$_POST['id_warga'];
|
||||
$jenis = mysqli_real_escape_string($conn, $_POST['jenis_bantuan']);
|
||||
$jumlah = mysqli_real_escape_string($conn, $_POST['jumlah'] ?? '');
|
||||
$tgl = mysqli_real_escape_string($conn, $_POST['tanggal_bantuan']);
|
||||
$ket = mysqli_real_escape_string($conn, $_POST['keterangan'] ?? '');
|
||||
$petugas = mysqli_real_escape_string($conn, $_SESSION['user_nama']);
|
||||
mysqli_query($conn, "INSERT INTO histori_bantuan (id_warga,jenis_bantuan,jumlah,tanggal_bantuan,keterangan,petugas) VALUES ($id_warga,'$jenis','$jumlah','$tgl','$ket','$petugas')");
|
||||
header('Location: histori_bantuan.php?added=1'); exit;
|
||||
}
|
||||
|
||||
// Hapus histori
|
||||
if (isset($_GET['hapus'])) {
|
||||
$id = (int)$_GET['hapus'];
|
||||
mysqli_query($conn, "DELETE FROM histori_bantuan WHERE id=$id");
|
||||
header('Location: histori_bantuan.php'); exit;
|
||||
}
|
||||
|
||||
$warga_list = mysqli_query($conn, "SELECT id, nama_kk FROM penduduk_miskin ORDER BY nama_kk");
|
||||
$histori = mysqli_query($conn, "SELECT h.*, p.nama_kk FROM histori_bantuan h JOIN penduduk_miskin p ON h.id_warga=p.id ORDER BY h.tanggal_bantuan DESC");
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="id">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Histori Bantuan - WebGIS Pontianak</title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<style>
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
body { font-family: 'Plus Jakarta Sans', sans-serif; background: #f1f5f9; }
|
||||
.topbar { background: #0f172a; color: white; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; }
|
||||
.topbar h1 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
|
||||
.topbar h1 i { color: #22c55e; }
|
||||
.topbar a { color: #94a3b8; text-decoration: none; font-size: 12px; margin-left: 16px; }
|
||||
.topbar a:hover { color: white; }
|
||||
.topbar-role { background: rgba(255,255,255,0.1); padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; }
|
||||
.container { max-width: 1100px; margin: 28px auto; padding: 0 20px; display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
|
||||
.card { background: white; border-radius: 16px; border: 1px solid #e2e8f0; overflow: hidden; }
|
||||
.card-header { padding: 18px 22px; border-bottom: 1px solid #f1f5f9; }
|
||||
.card-header h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
|
||||
.card-header h2 i { color: #22c55e; }
|
||||
.card-body { padding: 20px 22px; }
|
||||
.form-group { margin-bottom: 14px; }
|
||||
.form-group label { font-size: 11px; font-weight: 700; color: #475569; display: block; margin-bottom: 5px; }
|
||||
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 9px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 13px; font-family: inherit; color: #0f172a; }
|
||||
.btn-submit { width: 100%; padding: 11px; background: #0f172a; color: white; border: none; border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; }
|
||||
table { width: 100%; border-collapse: collapse; }
|
||||
th { background: #f8fafc; padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; color: #64748b; }
|
||||
td { padding: 12px 14px; border-top: 1px solid #f1f5f9; font-size: 13px; }
|
||||
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 10px; font-weight: 700; }
|
||||
.b-blt { background: #fef3c7; color: #d97706; }
|
||||
.b-sembako { background: #dcfce7; color: #16a34a; }
|
||||
.b-bpjs { background: #dbeafe; color: #2563eb; }
|
||||
.b-lain { background: #f1f5f9; color: #475569; }
|
||||
.btn-del { background: #fef2f2; color: #dc2626; border: none; padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; text-decoration: none; }
|
||||
.alert-success { background: #dcfce7; border: 1px solid #bbf7d0; color: #16a34a; padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; grid-column: 1/-1; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="topbar">
|
||||
<h1><i class="fa-solid fa-hand-holding-heart"></i> Histori Bantuan Warga</h1>
|
||||
<div style="display:flex;align-items:center;gap:8px;">
|
||||
<span class="topbar-role"><?= htmlspecialchars($_SESSION['user_nama']) ?> (<?= $_SESSION['user_role'] ?>)</span>
|
||||
<a href="index.php"><i class="fa-solid fa-map"></i> Peta</a>
|
||||
<a href="logout.php"><i class="fa-solid fa-right-from-bracket"></i> Logout</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<?php if (isset($_GET['added'])): ?>
|
||||
<div class="alert-success"><i class="fa-solid fa-circle-check"></i> Data bantuan berhasil ditambahkan!</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- FORM TAMBAH -->
|
||||
<div class="card">
|
||||
<div class="card-header"><h2><i class="fa-solid fa-plus-circle"></i> Tambah Bantuan</h2></div>
|
||||
<div class="card-body">
|
||||
<form method="POST">
|
||||
<div class="form-group">
|
||||
<label>Nama Warga</label>
|
||||
<select name="id_warga" required>
|
||||
<option value="">-- Pilih Warga --</option>
|
||||
<?php while($w = mysqli_fetch_assoc($warga_list)): ?>
|
||||
<option value="<?= $w['id'] ?>"><?= htmlspecialchars($w['nama_kk']) ?></option>
|
||||
<?php endwhile; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Jenis Bantuan</label>
|
||||
<select name="jenis_bantuan" required>
|
||||
<option value="BLT">BLT (Bantuan Langsung Tunai)</option>
|
||||
<option value="Sembako">Paket Sembako</option>
|
||||
<option value="BPJS">BPJS Kesehatan</option>
|
||||
<option value="PKH">PKH</option>
|
||||
<option value="Lainnya">Lainnya</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Jumlah / Nominal</label>
|
||||
<input type="text" name="jumlah" placeholder="Contoh: Rp 600.000 / 5 Kg Beras">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Tanggal Bantuan</label>
|
||||
<input type="date" name="tanggal_bantuan" required value="<?= date('Y-m-d') ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Keterangan</label>
|
||||
<textarea name="keterangan" rows="3" placeholder="Keterangan tambahan..."></textarea>
|
||||
</div>
|
||||
<button type="submit" name="tambah" class="btn-submit">
|
||||
<i class="fa-solid fa-floppy-disk"></i> Simpan Bantuan
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- TABEL HISTORI -->
|
||||
<div class="card">
|
||||
<div class="card-header"><h2><i class="fa-solid fa-clock-rotate-left"></i> Riwayat Bantuan</h2></div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>#</th><th>Warga</th><th>Jenis</th><th>Jumlah</th><th>Tanggal</th><th>Petugas</th><th>Aksi</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $no=1; while ($h = mysqli_fetch_assoc($histori)):
|
||||
$bc = ['BLT'=>'b-blt','Sembako'=>'b-sembako','BPJS'=>'b-bpjs'][$h['jenis_bantuan']] ?? 'b-lain';
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $no++ ?></td>
|
||||
<td><strong><?= htmlspecialchars($h['nama_kk']) ?></strong></td>
|
||||
<td><span class="badge <?= $bc ?>"><?= $h['jenis_bantuan'] ?></span></td>
|
||||
<td><?= htmlspecialchars($h['jumlah'] ?? '-') ?></td>
|
||||
<td style="font-size:12px;color:#64748b;"><?= date('d M Y', strtotime($h['tanggal_bantuan'])) ?></td>
|
||||
<td style="font-size:12px;"><?= htmlspecialchars($h['petugas'] ?? '-') ?></td>
|
||||
<td><a href="?hapus=<?= $h['id'] ?>" class="btn-del" onclick="return confirm('Hapus data ini?')"><i class="fa-solid fa-trash"></i></a></td>
|
||||
</tr>
|
||||
<?php endwhile; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+1218
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
session_start();
|
||||
include 'koneksi.php';
|
||||
if (!isset($_SESSION['user_role']) || !in_array($_SESSION['user_role'], ['admin','walikota'])) {
|
||||
header('Location: login.php'); exit;
|
||||
}
|
||||
|
||||
// Update status laporan
|
||||
if (isset($_POST['update_status'])) {
|
||||
$id = (int)$_POST['id'];
|
||||
$status = mysqli_real_escape_string($conn, $_POST['status']);
|
||||
$catatan= mysqli_real_escape_string($conn, $_POST['catatan_admin'] ?? '');
|
||||
mysqli_query($conn, "UPDATE laporan_cepat SET status='$status', catatan_admin='$catatan' WHERE id=$id");
|
||||
header('Location: kelola_laporan.php?updated=1'); exit;
|
||||
}
|
||||
|
||||
$q = mysqli_query($conn, "SELECT * FROM laporan_cepat ORDER BY tgl_lapor DESC");
|
||||
$total = mysqli_num_rows($q);
|
||||
$masuk = mysqli_num_rows(mysqli_query($conn, "SELECT id FROM laporan_cepat WHERE status='Masuk'"));
|
||||
$proses = mysqli_num_rows(mysqli_query($conn, "SELECT id FROM laporan_cepat WHERE status='Diproses'"));
|
||||
$selesai = mysqli_num_rows(mysqli_query($conn, "SELECT id FROM laporan_cepat WHERE status='Selesai'"));
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="id">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Kelola Laporan - WebGIS Pontianak</title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<style>
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
body { font-family: 'Plus Jakarta Sans', sans-serif; background: #f1f5f9; color: #0f172a; }
|
||||
.topbar {
|
||||
background: #0f172a; color: white; padding: 14px 28px;
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
}
|
||||
.topbar h1 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
|
||||
.topbar h1 i { color: #3b82f6; }
|
||||
.topbar-right { display: flex; align-items: center; gap: 12px; }
|
||||
.topbar-role { background: rgba(255,255,255,0.1); padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; }
|
||||
.topbar a { color: #94a3b8; text-decoration: none; font-size: 12px; }
|
||||
.topbar a:hover { color: white; }
|
||||
|
||||
.container { max-width: 1100px; margin: 28px auto; padding: 0 20px; }
|
||||
|
||||
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
|
||||
.stat-card { background: white; border-radius: 14px; padding: 20px; border: 1px solid #e2e8f0; }
|
||||
.stat-card .num { font-size: 28px; font-weight: 800; }
|
||||
.stat-card .lbl { font-size: 12px; color: #64748b; margin-top: 4px; font-weight: 600; }
|
||||
.stat-card .icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: 12px; }
|
||||
|
||||
.card { background: white; border-radius: 16px; border: 1px solid #e2e8f0; overflow: hidden; }
|
||||
.card-header { padding: 18px 24px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; justify-content: space-between; }
|
||||
.card-header h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
|
||||
.card-header h2 i { color: #3b82f6; }
|
||||
|
||||
table { width: 100%; border-collapse: collapse; }
|
||||
th { background: #f8fafc; padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; }
|
||||
td { padding: 13px 16px; border-top: 1px solid #f1f5f9; font-size: 13px; vertical-align: top; }
|
||||
tr:hover td { background: #fafbfc; }
|
||||
|
||||
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 10px; font-weight: 700; }
|
||||
.b-masuk { background: #fef3c7; color: #d97706; }
|
||||
.b-diproses { background: #dbeafe; color: #2563eb; }
|
||||
.b-selesai { background: #dcfce7; color: #16a34a; }
|
||||
.b-kat { background: #f1f5f9; color: #475569; font-size: 10px; padding: 2px 7px; border-radius: 4px; font-weight: 600; }
|
||||
|
||||
.btn-sm { padding: 6px 12px; border-radius: 7px; font-size: 11px; font-weight: 700; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
|
||||
.btn-primary { background: #eff6ff; color: #2563eb; }
|
||||
.btn-back { background: #0f172a; color: white; text-decoration: none; padding: 8px 16px; border-radius: 8px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
|
||||
|
||||
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999; align-items: center; justify-content: center; }
|
||||
.modal-overlay.open { display: flex; }
|
||||
.modal { background: white; border-radius: 18px; padding: 28px; width: 460px; max-width: 95vw; }
|
||||
.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
|
||||
.modal h3 i { color: #3b82f6; }
|
||||
.form-group { margin-bottom: 14px; }
|
||||
.form-group label { font-size: 11px; font-weight: 700; color: #475569; display: block; margin-bottom: 5px; }
|
||||
.form-group select, .form-group textarea { width: 100%; padding: 9px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 13px; font-family: inherit; }
|
||||
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
|
||||
.btn-cancel { background: #f1f5f9; color: #64748b; padding: 9px 18px; border-radius: 8px; border: none; font-size: 13px; font-weight: 700; cursor: pointer; }
|
||||
.btn-save { background: #0f172a; color: white; padding: 9px 18px; border-radius: 8px; border: none; font-size: 13px; font-weight: 700; cursor: pointer; }
|
||||
|
||||
.alert-success { background: #dcfce7; border: 1px solid #bbf7d0; color: #16a34a; padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="topbar">
|
||||
<h1><i class="fa-solid fa-bell"></i> Kelola Laporan Masyarakat</h1>
|
||||
<div class="topbar-right">
|
||||
<span class="topbar-role"><i class="fa-solid fa-circle-user"></i> <?= htmlspecialchars($_SESSION['user_nama']) ?> (<?= $_SESSION['user_role'] ?>)</span>
|
||||
<a href="index.php"><i class="fa-solid fa-map"></i> Kembali ke Peta</a>
|
||||
<a href="logout.php"><i class="fa-solid fa-right-from-bracket"></i> Logout</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<?php if (isset($_GET['updated'])): ?>
|
||||
<div class="alert-success"><i class="fa-solid fa-circle-check"></i> Status laporan berhasil diperbarui!</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="stats">
|
||||
<div class="stat-card">
|
||||
<div class="icon" style="background:#f8fafc; color:#64748b;"><i class="fa-solid fa-list"></i></div>
|
||||
<div class="num"><?= $total ?></div><div class="lbl">Total Laporan</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="icon" style="background:#fef3c7; color:#d97706;"><i class="fa-solid fa-inbox"></i></div>
|
||||
<div class="num" style="color:#d97706;"><?= $masuk ?></div><div class="lbl">Masuk / Baru</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="icon" style="background:#dbeafe; color:#2563eb;"><i class="fa-solid fa-gears"></i></div>
|
||||
<div class="num" style="color:#2563eb;"><?= $proses ?></div><div class="lbl">Sedang Diproses</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="icon" style="background:#dcfce7; color:#16a34a;"><i class="fa-solid fa-circle-check"></i></div>
|
||||
<div class="num" style="color:#16a34a;"><?= $selesai ?></div><div class="lbl">Selesai</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2><i class="fa-solid fa-table-list"></i> Daftar Laporan Masuk</h2>
|
||||
<a href="index.php" class="btn-back"><i class="fa-solid fa-map"></i> Lihat di Peta</a>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Pelapor</th>
|
||||
<th>Kategori</th>
|
||||
<th>Deskripsi</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Status</th>
|
||||
<th>Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
mysqli_data_seek($q, 0);
|
||||
$no = 1;
|
||||
while ($d = mysqli_fetch_assoc($q)):
|
||||
$badgeClass = ['Masuk'=>'b-masuk','Diproses'=>'b-diproses','Selesai'=>'b-selesai'][$d['status']] ?? 'b-masuk';
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $no++ ?></td>
|
||||
<td>
|
||||
<strong><?= htmlspecialchars($d['nama_pelapor']) ?></strong><br>
|
||||
<span style="font-size:11px;color:#94a3b8;"><?= htmlspecialchars($d['kontak_pelapor']) ?></span>
|
||||
</td>
|
||||
<td><span class="badge b-kat"><?= $d['kategori'] ?></span></td>
|
||||
<td style="max-width:220px;"><?= htmlspecialchars(substr($d['deskripsi'],0,80)) ?>...</td>
|
||||
<td style="font-size:12px;color:#64748b;"><?= date('d M Y', strtotime($d['tgl_lapor'])) ?></td>
|
||||
<td><span class="badge <?= $badgeClass ?>"><?= $d['status'] ?></span></td>
|
||||
<td>
|
||||
<button class="btn-sm btn-primary" onclick="openModal(<?= $d['id'] ?>, '<?= $d['status'] ?>', '<?= addslashes($d['catatan_admin'] ?? '') ?>')">
|
||||
<i class="fa-solid fa-pen"></i> Update
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endwhile; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- MODAL UPDATE STATUS -->
|
||||
<div class="modal-overlay" id="modal">
|
||||
<div class="modal">
|
||||
<h3><i class="fa-solid fa-pen-to-square"></i> Update Status Laporan</h3>
|
||||
<form method="POST">
|
||||
<input type="hidden" name="update_status" value="1">
|
||||
<input type="hidden" name="id" id="modal-id">
|
||||
<div class="form-group">
|
||||
<label>Status</label>
|
||||
<select name="status" id="modal-status">
|
||||
<option value="Masuk">Masuk</option>
|
||||
<option value="Diproses">Diproses</option>
|
||||
<option value="Selesai">Selesai</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Catatan Admin</label>
|
||||
<textarea name="catatan_admin" id="modal-catatan" rows="3" placeholder="Tulis catatan tindak lanjut..."></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn-cancel" onclick="closeModal()">Batal</button>
|
||||
<button type="submit" class="btn-save"><i class="fa-solid fa-floppy-disk"></i> Simpan</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function openModal(id, status, catatan) {
|
||||
document.getElementById('modal-id').value = id;
|
||||
document.getElementById('modal-status').value = status;
|
||||
document.getElementById('modal-catatan').value = catatan;
|
||||
document.getElementById('modal').classList.add('open');
|
||||
}
|
||||
function closeModal() {
|
||||
document.getElementById('modal').classList.remove('open');
|
||||
}
|
||||
document.getElementById('modal').addEventListener('click', function(e) {
|
||||
if (e.target === this) closeModal();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
$host = "localhost";
|
||||
$user = "root";
|
||||
$pass = "";
|
||||
$db = "db_gis_spbu"; // Sesuaikan dengan nama database kamu
|
||||
|
||||
$conn = mysqli_connect($host, $user, $pass, $db);
|
||||
|
||||
if (!$conn) {
|
||||
die("Koneksi ke database gagal: " . mysqli_connect_error());
|
||||
}
|
||||
?>
|
||||
+527
@@ -0,0 +1,527 @@
|
||||
<?php
|
||||
session_start();
|
||||
include 'koneksi.php';
|
||||
|
||||
$error = '';
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$username = trim($_POST['username'] ?? '');
|
||||
$password = md5(trim($_POST['password'] ?? ''));
|
||||
$q = mysqli_query($conn, "SELECT * FROM users WHERE username='$username' AND password='$password' LIMIT 1");
|
||||
if ($q && mysqli_num_rows($q) > 0) {
|
||||
$user = mysqli_fetch_assoc($q);
|
||||
$_SESSION['user_id'] = $user['id'];
|
||||
$_SESSION['user_nama'] = $user['nama'];
|
||||
$_SESSION['user_role'] = $user['role'];
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
} else {
|
||||
$error = 'Username atau password salah!';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="id" data-theme="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Login - WebGIS Pontianak</title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<style>
|
||||
:root {
|
||||
--bg: #0b1120;
|
||||
--bg2: #111827;
|
||||
--card: #161f30;
|
||||
--border: rgba(255,255,255,0.07);
|
||||
--border2: rgba(255,255,255,0.13);
|
||||
--text: #f1f5f9;
|
||||
--muted: #94a3b8;
|
||||
--accent: #3b82f6;
|
||||
--accent2: #60a5fa;
|
||||
--btn: #3b82f6;
|
||||
--btn-text: #ffffff;
|
||||
--input-bg: #1e2b40;
|
||||
--input-bd: rgba(255,255,255,0.1);
|
||||
--input-focus: #3b82f6;
|
||||
--tag-bg: rgba(59,130,246,0.15);
|
||||
--tag-col: #93c5fd;
|
||||
--shadow: 0 40px 100px rgba(0,0,0,0.6);
|
||||
--err-bg: rgba(239,68,68,0.12);
|
||||
--err-bd: rgba(239,68,68,0.3);
|
||||
--err-col: #f87171;
|
||||
}
|
||||
|
||||
[data-theme="light"] {
|
||||
--bg: #e8eef7;
|
||||
--bg2: #dde5f0;
|
||||
--card: #ffffff;
|
||||
--border: rgba(0,0,0,0.06);
|
||||
--border2: rgba(0,0,0,0.12);
|
||||
--text: #0f172a;
|
||||
--muted: #64748b;
|
||||
--accent: #2563eb;
|
||||
--accent2: #3b82f6;
|
||||
--btn: #2563eb;
|
||||
--btn-text: #ffffff;
|
||||
--input-bg: #f1f5fb;
|
||||
--input-bd: rgba(0,0,0,0.1);
|
||||
--input-focus: #2563eb;
|
||||
--tag-bg: #eff6ff;
|
||||
--tag-col: #1d4ed8;
|
||||
--shadow: 0 40px 100px rgba(0,0,0,0.15);
|
||||
--err-bg: #fef2f2;
|
||||
--err-bd: #fecaca;
|
||||
--err-col: #dc2626;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
html, body { height: 100%; }
|
||||
|
||||
body {
|
||||
font-family: 'Sora', sans-serif;
|
||||
background: var(--bg);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px;
|
||||
transition: background 0.4s;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* background orbs */
|
||||
.orb {
|
||||
position: fixed;
|
||||
border-radius: 50%;
|
||||
filter: blur(80px);
|
||||
opacity: 0.25;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.4s;
|
||||
}
|
||||
.orb1 { width: 500px; height: 500px; background: #3b82f6; top: -150px; left: -100px; }
|
||||
.orb2 { width: 400px; height: 400px; background: #8b5cf6; bottom: -100px; right: -80px; }
|
||||
.orb3 { width: 300px; height: 300px; background: #06b6d4; top: 40%; left: 40%; }
|
||||
|
||||
[data-theme="light"] .orb { opacity: 0.12; }
|
||||
|
||||
/* theme toggle */
|
||||
.theme-toggle {
|
||||
position: fixed;
|
||||
top: 20px; right: 20px;
|
||||
width: 44px; height: 44px;
|
||||
border-radius: 12px;
|
||||
background: var(--card);
|
||||
border: 1px solid var(--border2);
|
||||
color: var(--muted);
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
transition: all 0.3s;
|
||||
z-index: 100;
|
||||
box-shadow: 0 4px 20px rgba(0,0,0,0.2);
|
||||
}
|
||||
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
|
||||
|
||||
/* card */
|
||||
.card {
|
||||
background: var(--card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 24px;
|
||||
width: 100%;
|
||||
max-width: 440px;
|
||||
padding: 48px 44px;
|
||||
box-shadow: var(--shadow);
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
|
||||
animation: fadeUp 0.5s ease both;
|
||||
}
|
||||
|
||||
@keyframes fadeUp {
|
||||
from { opacity: 0; transform: translateY(24px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
/* logo */
|
||||
.logo-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
margin-bottom: 36px;
|
||||
}
|
||||
|
||||
.logo-icon {
|
||||
width: 52px; height: 52px;
|
||||
border-radius: 16px;
|
||||
background: linear-gradient(135deg, #2563eb, #7c3aed);
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
flex-shrink: 0;
|
||||
box-shadow: 0 8px 24px rgba(37,99,235,0.4);
|
||||
}
|
||||
|
||||
.logo-text h1 {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
transition: color 0.4s;
|
||||
}
|
||||
|
||||
.logo-text p {
|
||||
font-size: 11px;
|
||||
color: var(--muted);
|
||||
margin-top: 2px;
|
||||
transition: color 0.4s;
|
||||
}
|
||||
|
||||
/* badge */
|
||||
.badge-live {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
background: var(--tag-bg);
|
||||
color: var(--tag-col);
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
padding: 4px 10px;
|
||||
border-radius: 999px;
|
||||
margin-bottom: 20px;
|
||||
letter-spacing: 0.04em;
|
||||
transition: background 0.4s, color 0.4s;
|
||||
}
|
||||
|
||||
.dot-live {
|
||||
width: 6px; height: 6px;
|
||||
border-radius: 50%;
|
||||
background: currentColor;
|
||||
animation: pulse 1.8s infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%,100% { opacity: 1; transform: scale(1); }
|
||||
50% { opacity: 0.4; transform: scale(0.7); }
|
||||
}
|
||||
|
||||
/* heading */
|
||||
.heading {
|
||||
font-size: 26px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
line-height: 1.2;
|
||||
margin-bottom: 6px;
|
||||
transition: color 0.4s;
|
||||
}
|
||||
|
||||
.subheading {
|
||||
font-size: 13px;
|
||||
color: var(--muted);
|
||||
margin-bottom: 28px;
|
||||
transition: color 0.4s;
|
||||
}
|
||||
|
||||
/* divider */
|
||||
.divider {
|
||||
height: 1px;
|
||||
background: var(--border);
|
||||
margin: 0 -44px 28px;
|
||||
transition: background 0.4s;
|
||||
}
|
||||
|
||||
/* form */
|
||||
.field { margin-bottom: 18px; }
|
||||
|
||||
.field label {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: var(--muted);
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 8px;
|
||||
transition: color 0.4s;
|
||||
}
|
||||
|
||||
.input-wrap { position: relative; }
|
||||
|
||||
.input-wrap i.ico {
|
||||
position: absolute;
|
||||
left: 14px; top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: var(--muted);
|
||||
font-size: 14px;
|
||||
pointer-events: none;
|
||||
transition: color 0.4s;
|
||||
}
|
||||
|
||||
.input-wrap input {
|
||||
width: 100%;
|
||||
padding: 13px 14px 13px 42px;
|
||||
background: var(--input-bg);
|
||||
border: 1.5px solid var(--input-bd);
|
||||
border-radius: 12px;
|
||||
font-size: 14px;
|
||||
font-family: 'Sora', sans-serif;
|
||||
color: var(--text);
|
||||
outline: none;
|
||||
transition: all 0.25s;
|
||||
}
|
||||
|
||||
.input-wrap input::placeholder { color: var(--muted); opacity: 0.6; }
|
||||
.input-wrap input:focus { border-color: var(--input-focus); background: var(--input-bg); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
|
||||
|
||||
/* eye toggle */
|
||||
.eye-btn {
|
||||
position: absolute;
|
||||
right: 14px; top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background: none; border: none;
|
||||
color: var(--muted); font-size: 14px;
|
||||
cursor: pointer; padding: 0;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.eye-btn:hover { color: var(--accent); }
|
||||
|
||||
/* error */
|
||||
.error-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
background: var(--err-bg);
|
||||
border: 1px solid var(--err-bd);
|
||||
color: var(--err-col);
|
||||
padding: 11px 14px;
|
||||
border-radius: 10px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 18px;
|
||||
animation: shake 0.4s ease;
|
||||
}
|
||||
|
||||
@keyframes shake {
|
||||
0%,100% { transform: translateX(0); }
|
||||
20%,60% { transform: translateX(-6px); }
|
||||
40%,80% { transform: translateX(6px); }
|
||||
}
|
||||
|
||||
/* button */
|
||||
.btn-login {
|
||||
width: 100%;
|
||||
padding: 14px;
|
||||
background: linear-gradient(135deg, #2563eb, #7c3aed);
|
||||
color: #fff;
|
||||
border: none;
|
||||
border-radius: 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
font-family: 'Sora', sans-serif;
|
||||
cursor: pointer;
|
||||
display: flex; align-items: center; justify-content: center; gap: 8px;
|
||||
margin-top: 4px;
|
||||
box-shadow: 0 8px 24px rgba(37,99,235,0.35);
|
||||
transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(37,99,235,0.45); filter: brightness(1.05); }
|
||||
.btn-login:active { transform: translateY(0); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }
|
||||
|
||||
/* akun section */
|
||||
.akun-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin: 24px 0 14px;
|
||||
}
|
||||
.akun-line { flex: 1; height: 1px; background: var(--border); transition: background 0.4s; }
|
||||
.akun-text { font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; transition: color 0.4s; }
|
||||
|
||||
.akun-grid { display: flex; flex-direction: column; gap: 8px; }
|
||||
|
||||
.akun-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px 14px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.akun-item:hover {
|
||||
border-color: var(--accent);
|
||||
background: var(--tag-bg);
|
||||
}
|
||||
|
||||
.akun-left { display: flex; align-items: center; gap: 10px; }
|
||||
|
||||
.akun-icon {
|
||||
width: 32px; height: 32px;
|
||||
border-radius: 9px;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.ai-admin { background: rgba(37,99,235,0.15); color: #60a5fa; }
|
||||
.ai-wali { background: rgba(245,158,11,0.15); color: #fbbf24; }
|
||||
|
||||
[data-theme="light"] .ai-admin { background: #eff6ff; color: #2563eb; }
|
||||
[data-theme="light"] .ai-wali { background: #fffbeb; color: #d97706; }
|
||||
|
||||
.akun-info-name {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
transition: color 0.4s;
|
||||
}
|
||||
|
||||
.akun-info-pass {
|
||||
font-size: 11px;
|
||||
color: var(--muted);
|
||||
margin-top: 1px;
|
||||
transition: color 0.4s;
|
||||
}
|
||||
|
||||
.akun-badge {
|
||||
font-size: 10px;
|
||||
font-weight: 600;
|
||||
padding: 3px 10px;
|
||||
border-radius: 999px;
|
||||
letter-spacing: 0.03em;
|
||||
}
|
||||
|
||||
.ab-admin { background: rgba(37,99,235,0.15); color: #60a5fa; }
|
||||
.ab-wali { background: rgba(245,158,11,0.15); color: #fbbf24; }
|
||||
|
||||
[data-theme="light"] .ab-admin { background: #eff6ff; color: #1d4ed8; }
|
||||
[data-theme="light"] .ab-wali { background: #fffbeb; color: #b45309; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="orb orb1"></div>
|
||||
<div class="orb orb2"></div>
|
||||
<div class="orb orb3"></div>
|
||||
|
||||
<button class="theme-toggle" onclick="toggleTheme()" title="Toggle tema">
|
||||
<i class="fa-solid fa-sun" id="theme-icon"></i>
|
||||
</button>
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class="logo-wrap">
|
||||
<div class="logo-icon"><i class="fa-solid fa-map-location-dot"></i></div>
|
||||
<div class="logo-text">
|
||||
<h1>WebGIS Pontianak</h1>
|
||||
<p>Sistem Informasi Geografis Kota Pontianak</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="badge-live">
|
||||
<span class="dot-live"></span> Sistem Online
|
||||
</div>
|
||||
|
||||
<div class="heading">Selamat Datang</div>
|
||||
<div class="subheading">Masuk ke akun Anda untuk mengakses peta</div>
|
||||
|
||||
<div class="divider"></div>
|
||||
|
||||
<?php if ($error): ?>
|
||||
<div class="error-box">
|
||||
<i class="fa-solid fa-circle-exclamation"></i>
|
||||
<?= htmlspecialchars($error) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="POST">
|
||||
<div class="field">
|
||||
<label>Username</label>
|
||||
<div class="input-wrap">
|
||||
<i class="fa-solid fa-user ico"></i>
|
||||
<input type="text" name="username" placeholder="Masukkan username" required autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>Password</label>
|
||||
<div class="input-wrap">
|
||||
<i class="fa-solid fa-lock ico"></i>
|
||||
<input type="password" name="password" id="pw" placeholder="Masukkan password" required>
|
||||
<button type="button" class="eye-btn" onclick="togglePw()">
|
||||
<i class="fa-solid fa-eye" id="eye-icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn-login">
|
||||
<i class="fa-solid fa-right-to-bracket"></i> Masuk ke Sistem
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="akun-label">
|
||||
<div class="akun-line"></div>
|
||||
<span class="akun-text">Akun Tersedia</span>
|
||||
<div class="akun-line"></div>
|
||||
</div>
|
||||
|
||||
<div class="akun-grid">
|
||||
<div class="akun-item" onclick="fillLogin('admin','admin123')">
|
||||
<div class="akun-left">
|
||||
<div class="akun-icon ai-admin"><i class="fa-solid fa-shield-halved"></i></div>
|
||||
<div>
|
||||
<div class="akun-info-name">admin</div>
|
||||
<div class="akun-info-pass">admin123</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="akun-badge ab-admin">Administrator</span>
|
||||
</div>
|
||||
|
||||
<div class="akun-item" onclick="fillLogin('walikota','walikota123')">
|
||||
<div class="akun-left">
|
||||
<div class="akun-icon ai-wali"><i class="fa-solid fa-star"></i></div>
|
||||
<div>
|
||||
<div class="akun-info-name">walikota</div>
|
||||
<div class="akun-info-pass">walikota123</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="akun-badge ab-wali">Walikota</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleTheme() {
|
||||
const html = document.documentElement;
|
||||
const icon = document.getElementById('theme-icon');
|
||||
if (html.getAttribute('data-theme') === 'dark') {
|
||||
html.setAttribute('data-theme', 'light');
|
||||
icon.className = 'fa-solid fa-moon';
|
||||
} else {
|
||||
html.setAttribute('data-theme', 'dark');
|
||||
icon.className = 'fa-solid fa-sun';
|
||||
}
|
||||
}
|
||||
|
||||
function togglePw() {
|
||||
const pw = document.getElementById('pw');
|
||||
const icon = document.getElementById('eye-icon');
|
||||
if (pw.type === 'password') {
|
||||
pw.type = 'text';
|
||||
icon.className = 'fa-solid fa-eye-slash';
|
||||
} else {
|
||||
pw.type = 'password';
|
||||
icon.className = 'fa-solid fa-eye';
|
||||
}
|
||||
}
|
||||
|
||||
function fillLogin(user, pass) {
|
||||
document.querySelector('input[name="username"]').value = user;
|
||||
document.getElementById('pw').value = pass;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
session_destroy();
|
||||
header('Location: login.php');
|
||||
exit;
|
||||
?>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
|
||||
// Ambil data kiriman dari form edit_masjid.php
|
||||
$id = $_POST['id'];
|
||||
$nama_masjid = $_POST['nama_masjid'];
|
||||
$nama_pic = $_POST['nama_pic'];
|
||||
$radius_meter = $_POST['radius_meter'];
|
||||
|
||||
// Proteksi data sederhana agar aman dari bad character
|
||||
$id = mysqli_real_escape_string($conn, $id);
|
||||
$nama_masjid = mysqli_real_escape_string($conn, $nama_masjid);
|
||||
$nama_pic = mysqli_real_escape_string($conn, $nama_pic);
|
||||
$radius_meter = (int)$radius_meter;
|
||||
|
||||
// Query update data masjid berdasarkan ID
|
||||
$query = "UPDATE masjid SET
|
||||
nama_masjid='$nama_masjid',
|
||||
nama_pic='$nama_pic',
|
||||
radius_meter='$radius_meter'
|
||||
WHERE id='$id'";
|
||||
|
||||
$update = mysqli_query($conn, $query);
|
||||
|
||||
if ($update) {
|
||||
// Jika berhasil, langsung lempar balik secara otomatis ke index.php (Peta)
|
||||
echo "<script>
|
||||
alert('Data Masjid Berhasil Diperbarui!');
|
||||
window.location.href='index.php';
|
||||
</script>";
|
||||
} else {
|
||||
// Jika gagal, tampilkan pesan errornya biar ketahuan salahnya di mana
|
||||
echo "Gagal memperbarui data ke database: " . mysqli_error($conn);
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
|
||||
// Menangkap data dari form edit
|
||||
$id = $_POST['id'];
|
||||
$nama_kk = $_POST['nama_kk'];
|
||||
$alamat = $_POST['alamat'];
|
||||
$umur = (int)$_POST['umur'];
|
||||
$pendidikan_terakhir = $_POST['pendidikan_terakhir'];
|
||||
$latitude = $_POST['latitude'];
|
||||
$longitude = $_POST['longitude'];
|
||||
|
||||
// Solusi pengaman: Cek jika form mengirimkan 'anggota_keluarga' atau 'jumlah_keluarga'
|
||||
if (isset($_POST['anggota_keluarga'])) {
|
||||
$jumlah_keluarga = (int)$_POST['anggota_keluarga'];
|
||||
} elseif (isset($_POST['jumlah_keluarga'])) {
|
||||
$jumlah_keluarga = (int)$_POST['jumlah_keluarga'];
|
||||
} else {
|
||||
$jumlah_keluarga = 0; // Nilai default berupa angka agar tidak memicu fatal error database
|
||||
}
|
||||
|
||||
// Query Update Data ke Database
|
||||
$query = "UPDATE penduduk_miskin SET
|
||||
nama_kk = '$nama_kk',
|
||||
alamat = '$alamat',
|
||||
jumlah_keluarga = '$jumlah_keluarga',
|
||||
umur = '$umur',
|
||||
pendidikan_terakhir = '$pendidikan_terakhir',
|
||||
latitude = '$latitude',
|
||||
longitude = '$longitude'
|
||||
WHERE id = '$id'";
|
||||
|
||||
$n = mysqli_query($conn, $query);
|
||||
|
||||
if ($n) {
|
||||
echo "<script>alert('Data warga miskin berhasil diperbarui!'); window.location='index.php';</script>";
|
||||
} else {
|
||||
echo "Gagal memperbarui data: " . mysqli_error($conn);
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$id = mysqli_real_escape_string($conn, $_POST['id']);
|
||||
$nama_pelapor = mysqli_real_escape_string($conn, $_POST['nama_pelapor']);
|
||||
$kontak_pelapor = mysqli_real_escape_string($conn, $_POST['kontak_pelapor']);
|
||||
$deskripsi_laporan = mysqli_real_escape_string($conn, $_POST['deskripsi_laporan']);
|
||||
|
||||
$query = "UPDATE pengaduan_warga SET
|
||||
nama_pelapor = '$nama_pelapor',
|
||||
kontak_pelapor = '$kontak_pelapor',
|
||||
deskripsi_laporan = '$deskripsi_laporan'
|
||||
WHERE id = '$id'";
|
||||
|
||||
if (mysqli_query($conn, $query)) {
|
||||
echo "<script>
|
||||
alert('Laporan pengaduan berhasil diperbarui!');
|
||||
window.location.href='index.php';
|
||||
</script>";
|
||||
} else {
|
||||
echo "Gagal memperbarui data: " . mysqli_error($conn);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$nama = mysqli_real_escape_string($conn, $_POST['nama_pelapor'] ?? '');
|
||||
$kontak = mysqli_real_escape_string($conn, $_POST['kontak_pelapor'] ?? '');
|
||||
$kategori = mysqli_real_escape_string($conn, $_POST['kategori'] ?? 'Lainnya');
|
||||
$deskripsi= mysqli_real_escape_string($conn, $_POST['deskripsi_laporan'] ?? '');
|
||||
$lat = (float)($_POST['latitude'] ?? 0);
|
||||
$lng = (float)($_POST['longitude'] ?? 0);
|
||||
|
||||
$sql = "INSERT INTO laporan_cepat (nama_pelapor, kontak_pelapor, kategori, deskripsi, latitude, longitude)
|
||||
VALUES ('$nama','$kontak','$kategori','$deskripsi',$lat,$lng)";
|
||||
mysqli_query($conn, $sql);
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$nama_kk = mysqli_real_escape_string($conn, $_POST['nama_kk'] ?? '');
|
||||
$alamat = mysqli_real_escape_string($conn, $_POST['alamat'] ?? '');
|
||||
$anggota = (int)($_POST['anggota_keluarga'] ?? 0);
|
||||
$umur = (int)($_POST['umur'] ?? 0);
|
||||
$tanggal_lahir = mysqli_real_escape_string($conn, $_POST['tanggal_lahir'] ?? '');
|
||||
$pendidikan = mysqli_real_escape_string($conn, $_POST['pendidikan_terakhir'] ?? '');
|
||||
$riwayat_penyakit = mysqli_real_escape_string($conn, $_POST['riwayat_penyakit'] ?? '');
|
||||
$lat = (float)($_POST['latitude'] ?? 0);
|
||||
$lng = (float)($_POST['longitude'] ?? 0);
|
||||
|
||||
$sql = "INSERT INTO penduduk_miskin
|
||||
(nama_kk, alamat, anggota_keluarga, umur, tanggal_lahir, pendidikan_terakhir, riwayat_penyakit, latitude, longitude)
|
||||
VALUES ('$nama_kk','$alamat',$anggota,$umur,'$tanggal_lahir','$pendidikan','$riwayat_penyakit',$lat,$lng)";
|
||||
|
||||
mysqli_query($conn, $sql);
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$nama_pelapor = mysqli_real_escape_string($conn, $_POST['nama_pelapor']);
|
||||
$kontak_pelapor = mysqli_real_escape_string($conn, $_POST['kontak_pelapor']);
|
||||
$deskripsi_laporan = mysqli_real_escape_string($conn, $_POST['deskripsi_laporan']);
|
||||
$latitude = mysqli_real_escape_string($conn, $_POST['latitude']);
|
||||
$longitude = mysqli_real_escape_string($conn, $_POST['longitude']);
|
||||
|
||||
$query = "INSERT INTO pengaduan_warga (nama_pelapor, kontak_pelapor, deskripsi_laporan, latitude, longitude)
|
||||
VALUES ('$nama_pelapor', '$kontak_pelapor', '$deskripsi_laporan', '$latitude', '$longitude')";
|
||||
|
||||
if (mysqli_query($conn, $query)) {
|
||||
echo "<script>alert('Laporan Pengaduan berhasil dikirim!'); window.location.href='index.php';</script>";
|
||||
} else {
|
||||
echo "Error: " . mysqli_error($conn);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$nama_masjid = mysqli_real_escape_string($conn, $_POST['nama_masjid']);
|
||||
$nama_pic = mysqli_real_escape_string($conn, $_POST['nama_pic']);
|
||||
$lat = (float)$_POST['latitude'];
|
||||
$lng = (float)$_POST['longitude'];
|
||||
|
||||
$query = "INSERT INTO masjid (nama_masjid, nama_pic, latitude, longitude)
|
||||
VALUES ('$nama_masjid', '$nama_pic', '$lat', '$lng')";
|
||||
|
||||
if (mysqli_query($conn, $query)) {
|
||||
echo "<script>alert('Data Masjid berhasil disimpan!'); window.location='index.php';</script>";
|
||||
} else {
|
||||
echo "Gagal menyimpan: " . mysqli_error($conn);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$id = (int)$_POST['id'];
|
||||
$radius_baru = (int)$_POST['radius_baru'];
|
||||
|
||||
$query = "UPDATE masjid SET radius_meter = '$radius_baru' WHERE id = '$id'";
|
||||
|
||||
if (mysqli_query($conn, $query)) {
|
||||
echo "ok";
|
||||
} else {
|
||||
echo "Gagal: " . mysqli_error($conn);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include 'koneksi.php';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||
$id_warga = (int)$_POST['id_warga'];
|
||||
$radius_baru_warga = (int)$_POST['radius_baru_warga'];
|
||||
|
||||
$query = "UPDATE penduduk_miskin SET radius_warga = '$radius_baru_warga' WHERE id = '$id_warga'";
|
||||
|
||||
if (mysqli_query($conn, $query)) {
|
||||
echo "ok";
|
||||
} else {
|
||||
echo "Gagal: " . mysqli_error($conn);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user