Add WebGIS source code

This commit is contained in:
ocabacaa
2026-06-11 23:48:02 +07:00
parent ce48dbcddc
commit b212ca27fd
37 changed files with 5764 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
include '../config/koneksi.php';
$id = intval($_GET['id']);
$cek = mysqli_query(
$conn,
"SELECT * FROM laporan
WHERE id='$id'"
);
if(mysqli_num_rows($cek)==0){
die("Data laporan tidak ditemukan");
}
mysqli_query($conn,
"UPDATE laporan
SET status='disetujui'
WHERE id='$id'");
header("Location: validasi.php");
?>
+344
View File
@@ -0,0 +1,344 @@
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
include '../config/koneksi.php';
$id = intval($_GET['id']);
$laporan = mysqli_fetch_assoc(
mysqli_query($conn,
"SELECT * FROM laporan
WHERE id='$id'")
);
if(!$laporan){
die("Data laporan tidak ditemukan");
}
$rumah_ibadah = mysqli_query($conn,
"SELECT * FROM rumah_ibadah");
$cs = mysqli_query($conn,
"SELECT * FROM cs_rumah_ibadah");
$cek_bantuan = mysqli_query(
$conn,
"SELECT * FROM bantuan
WHERE laporan_id='$id'"
);
if(mysqli_num_rows($cek_bantuan)>0){
echo "
<script>
alert('Laporan sudah pernah diassign');
window.location='validasi.php';
</script>
";
exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Assign Bantuan</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
<?php include 'layout/style.php'; ?>
</head>
<body>
<?php include 'layout/navbar.php'; ?>
<?php include 'layout/sidebar.php'; ?>
<div class="content">
<div class="mb-6">
<h1 class="text-3xl font-bold text-gray-800">
Assign Bantuan
</h1>
<p class="text-gray-500 mt-2">
Tentukan rumah ibadah, CS penyalur, dan jenis bantuan untuk laporan yang telah disetujui.
</p>
</div>
<div class="grid lg:grid-cols-3 gap-6">
<!-- Informasi Warga -->
<div class="lg:col-span-1">
<div class="bg-white rounded-2xl shadow-lg overflow-hidden">
<div class="p-5 border-b bg-blue-50">
<h2 class="font-semibold text-lg flex items-center gap-2">
<i class="fas fa-user text-blue-600"></i>
Data Warga
</h2>
</div>
<div class="p-5">
<div class="mb-4">
<label class="text-gray-500 text-sm">
Nama Warga
</label>
<p class="font-semibold text-lg">
<?= htmlspecialchars($laporan['nama_warga']) ?>
</p>
</div>
<div class="mb-4">
<label class="text-gray-500 text-sm">
Alamat
</label>
<p>
<?= htmlspecialchars($laporan['alamat']) ?>
</p>
</div>
<div class="mb-4">
<label class="text-gray-500 text-sm">
Kondisi
</label>
<p>
<?= htmlspecialchars($laporan['kondisi']) ?>
</p>
</div>
<?php if(!empty($laporan['foto'])){ ?>
<img src="../assets/uploads/<?= htmlspecialchars($laporan['foto']) ?>"
class="w-full h-56 object-cover rounded-xl shadow">
<?php } ?>
</div>
</div>
</div>
<!-- Form Assign -->
<div class="lg:col-span-2">
<div class="bg-white rounded-2xl shadow-lg overflow-hidden">
<div class="p-5 border-b bg-gray-50">
<h2 class="font-semibold text-lg flex items-center gap-2">
<i class="fas fa-hand-holding-heart text-green-600"></i>
Form Penugasan Bantuan
</h2>
</div>
<form action="proses_assign.php" method="POST" class="p-6 space-y-5">
<input type="hidden" name="laporan_id" value="<?= $laporan['id'] ?>">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
Nama Warga
</label>
<input type="text" readonly value="<?= htmlspecialchars($laporan['nama_warga']) ?>"
class="w-full border rounded-xl p-3 bg-gray-100">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
Rumah Ibadah
</label>
<select name="rumah_ibadah_id" required
class="w-full border rounded-xl p-3 focus:ring-2 focus:ring-blue-500 focus:outline-none">
<option value="">
-- Pilih Rumah Ibadah --
</option>
<?php while($r = mysqli_fetch_assoc($rumah_ibadah)){ ?>
<option value="<?= $r['id'] ?>">
<?= htmlspecialchars($r['nama']) ?>
</option>
<?php } ?>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
CS Penyalur
</label>
<select name="cs_id" required
class="w-full border rounded-xl p-3 focus:ring-2 focus:ring-blue-500 focus:outline-none">
<option value="">
-- Pilih CS --
</option>
<?php while($c = mysqli_fetch_assoc($cs)){ ?>
<option value="<?= $c['id'] ?>">
<?= htmlspecialchars($c['nama']) ?>
</option>
<?php } ?>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
Jenis Bantuan
</label>
<select name="jenis_bantuan" required
class="w-full border rounded-xl p-3 focus:ring-2 focus:ring-blue-500 focus:outline-none">
<option value="">
-- Pilih Jenis Bantuan --
</option>
<option value="Sembako">
🍚 Sembako
</option>
<option value="Uang Tunai">
💵 Uang Tunai
</option>
<option value="Pendidikan">
🎓 Pendidikan
</option>
<option value="Kesehatan">
🏥 Kesehatan
</option>
<option value="Peralatan Sekolah">
🎒 Peralatan Sekolah
</option>
<option value="Perbaikan Rumah">
🏠 Perbaikan Rumah
</option>
<option value="Pakaian Layak">
👕 Pakaian Layak
</option>
<option value="Makanan Bergizi">
🍱 Makanan Bergizi
</option>
<option value="Modal Usaha">
💼 Modal Usaha
</option>
<option value="Lainnya">
📦 Lainnya
</option>
</select>
</div>
<div class="flex flex-wrap gap-3 pt-3">
<button type="submit"
class="px-6 py-3 bg-green-600 hover:bg-green-700 text-white rounded-xl shadow transition">
<i class="fas fa-check-circle mr-2"></i>
Assign Bantuan
</button>
<a href="validasi.php"
class="px-6 py-3 bg-gray-500 hover:bg-gray-600 text-white rounded-xl shadow transition">
<i class="fas fa-arrow-left mr-2"></i>
Kembali
</a>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
+391
View File
@@ -0,0 +1,391 @@
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
include '../config/koneksi.php';
/* TOTAL LAPORAN */
$total_laporan = mysqli_num_rows(
mysqli_query($conn,
"SELECT * FROM laporan")
);
/* PENDING */
$pending = mysqli_num_rows(
mysqli_query($conn,
"SELECT * FROM laporan
WHERE status='pending'")
);
/* DISETUJUI */
$disetujui = mysqli_num_rows(
mysqli_query($conn,
"SELECT * FROM laporan
WHERE status='disetujui'")
);
/* DITOLAK */
$ditolak = mysqli_num_rows(
mysqli_query($conn,
"SELECT * FROM laporan
WHERE status='ditolak'")
);
$total_bantuan = mysqli_num_rows(
mysqli_query($conn,
"SELECT * FROM bantuan")
);
$diproses = mysqli_num_rows(
mysqli_query($conn,
"SELECT * FROM laporan
WHERE status='diproses'")
);
$selesai = mysqli_num_rows(
mysqli_query($conn,
"SELECT * FROM laporan
WHERE status='selesai'")
);
$persentase = 0;
if($total_laporan > 0){
$persentase = round(
($selesai / $total_laporan) * 100
);
}
$cs_total = mysqli_num_rows(
mysqli_query(
$conn,
"SELECT * FROM cs_rumah_ibadah"
)
);
$rumah_ibadah_total = mysqli_num_rows(
mysqli_query(
$conn,
"SELECT * FROM rumah_ibadah"
)
);
?>
<!DOCTYPE html>
<html>
<head>
<title>Dashboard Admin</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
<?php include 'layout/style.php'; ?>
</head>
<body>
<?php include 'layout/navbar.php'; ?>
<?php include 'layout/sidebar.php'; ?>
<div class="content">
<div class="hero">
<h1 style="
font-size:32px;
margin-bottom:10px;
">
Dashboard Administrator
</h1>
<p>
Selamat datang,
<b><?= htmlspecialchars($_SESSION['nama']) ?></b>
</p>
<p style="
margin-top:10px;
opacity:.9;
">
Monitoring laporan kemiskinan,
validasi bantuan sosial,
dan distribusi bantuan.
</p>
<p style="
margin-top:15px;
font-size:14px;
">
<?= $total_laporan ?> laporan •
<?= $total_bantuan ?> bantuan •
<?= $persentase ?>% selesai
</p>
</div>
<div class="cards">
<div class="card">
<i class="fa-solid fa-file"></i>
<h3>Total Laporan</h3>
<h1><?= $total_laporan ?></h1>
</div>
<div class="card">
<i class="fa-solid fa-clock"></i>
<h3>Pending</h3>
<h1><?= $pending ?></h1>
</div>
<div class="card">
<i class="fa-solid fa-thumbs-up"></i>
<h3>Disetujui</h3>
<h1><?= $disetujui ?></h1>
</div>
<div class="card">
<i class="fa-solid fa-hand-holding-heart"></i>
<h3>Total Bantuan</h3>
<h1><?= $total_bantuan ?></h1>
</div>
<div class="card">
<i class="fa-solid fa-users"></i>
<h3>Total CS</h3>
<h1><?= $cs_total ?></h1>
</div>
<div class="card">
<i class="fa-solid fa-building"></i>
<h3>Rumah Ibadah</h3>
<h1><?= $rumah_ibadah_total ?></h1>
</div>
<div class="card">
<i class="fa-solid fa-spinner"></i>
<h3> Diproses</h3>
<h1><?= $diproses ?></h1>
</div>
<div class="card">
<i class="fa-solid fa-hand-holding-heart"></i>
<h3>Selesai</h3>
<h1><?= $selesai ?></h1>
</div>
<div class="card">
<i class="fa-solid fa-ban"></i>
<h3>Ditolak</h3>
<h1><?= $ditolak ?></h1>
</div>
</div>
<div class="box" style="margin-top:25px;">
<h3>
Progress Penyelesaian Bantuan
</h3>
<br>
<div style="
width:100%;
height:20px;
background:#e2e8f0;
border-radius:20px;
overflow:hidden;
">
<div style="
width:<?= $persentase ?>%;
height:100%;
background:#16a34a;
">
</div>
</div>
<p style="
margin-top:10px;
color:#64748b;
">
<?= $persentase ?>%
laporan telah selesai ditangani
</p>
</div>
<div class="box" style="margin-top:25px;">
<h3>Statistik Laporan</h3>
<br>
<div style="max-width:500px;margin:auto;">
<canvas id="myChart"></canvas>
</div>
</div>
<div class="box" style="margin-top:25px;">
<h3>Ringkasan Sistem</h3>
<br>
<p>
Total laporan masuk:
<b><?= $total_laporan ?></b>
</p>
<p>
Bantuan yang telah dibuat:
<b><?= $total_bantuan ?></b>
</p>
<p>
CS aktif:
<b><?= $cs_total ?></b>
</p>
<p>
Rumah ibadah terdaftar:
<b><?= $rumah_ibadah_total ?></b>
</p>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
const ctx = document.getElementById('myChart');
new Chart(ctx, {
type: 'doughnut',
data: {
labels: [
'Pending',
'Disetujui',
'Ditolak',
'Diproses',
'Selesai'
],
datasets: [{
label: 'Jumlah Laporan',
data: [
<?= $pending ?>,
<?= $disetujui ?>,
<?= $ditolak ?>,
<?= $diproses ?>,
<?= $selesai ?>
],
backgroundColor: [
'#f59e0b',
'#16a34a',
'#dc2626',
'#2563eb',
'#7c3aed'
]
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'bottom'
}
}
}
});
</script>
</body>
</html>
+300
View File
@@ -0,0 +1,300 @@
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
include '../config/koneksi.php';
$data = mysqli_query($conn,
"SELECT bantuan.*,
laporan.nama_warga,
rumah_ibadah.nama AS rumah_ibadah,
cs_rumah_ibadah.nama AS cs_nama
FROM bantuan
JOIN laporan
ON bantuan.laporan_id = laporan.id
JOIN rumah_ibadah
ON bantuan.rumah_ibadah_id = rumah_ibadah.id
JOIN cs_rumah_ibadah
ON bantuan.cs_id = cs_rumah_ibadah.id
ORDER BY bantuan.id DESC"
);
?>
<!DOCTYPE html>
<html>
<head>
<title>Data Bantuan</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
<?php include 'layout/style.php'; ?>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<?php include 'layout/navbar.php'; ?>
<?php include 'layout/sidebar.php'; ?>
<div class="content">
<div class="mb-6">
<h1 class="text-3xl font-bold text-gray-800">
Data Bantuan
</h1>
<p class="text-gray-500 mt-2">
Monitoring bantuan sosial yang sedang diproses dan telah selesai disalurkan.
</p>
</div>
<?php
$total = mysqli_num_rows($data);
mysqli_data_seek($data,0);
$proses = 0;
$selesai = 0;
while($r = mysqli_fetch_assoc($data)){
if($r['status']=='proses'){
$proses++;
}
if($r['status']=='selesai'){
$selesai++;
}
}
mysqli_data_seek($data,0);
?>
<div class="grid md:grid-cols-3 gap-5 mb-6">
<div class="bg-white rounded-2xl shadow p-5">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm">
Total Bantuan
</p>
<h2 class="text-3xl font-bold text-blue-600">
<?= $total ?>
</h2>
</div>
<i class="fas fa-hand-holding-heart text-4xl text-blue-500"></i>
</div>
</div>
<div class="bg-white rounded-2xl shadow p-5">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm">
Diproses
</p>
<h2 class="text-3xl font-bold text-orange-500">
<?= $proses ?>
</h2>
</div>
<i class="fas fa-spinner text-4xl text-orange-500"></i>
</div>
</div>
<div class="bg-white rounded-2xl shadow p-5">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm">
Selesai
</p>
<h2 class="text-3xl font-bold text-green-600">
<?= $selesai ?>
</h2>
</div>
<i class="fas fa-check-circle text-4xl text-green-600"></i>
</div>
</div>
</div>
<div class="bg-white rounded-2xl shadow overflow-hidden">
<div class="p-5 border-b">
<h2 class="font-semibold text-lg">
Daftar Bantuan
</h2>
</div>
<div class="overflow-x-auto">
<table class="min-w-full">
<thead class="bg-gray-100">
<tr>
<th class="px-4 py-3 text-left">No</th>
<th class="px-4 py-3 text-left">Nama Warga</th>
<th class="px-4 py-3 text-left">Rumah Ibadah</th>
<th class="px-4 py-3 text-left">CS Penyalur</th>
<th class="px-4 py-3 text-left">Jenis Bantuan</th>
<th class="px-4 py-3 text-center">Status</th>
<th class="px-4 py-3 text-center">Bukti</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
if(mysqli_num_rows($data) > 0){
while($row = mysqli_fetch_assoc($data)){
?>
<tr class="border-b hover:bg-gray-50 transition">
<td class="px-4 py-3">
<?= $no++ ?>
</td>
<td class="px-4 py-3 font-medium">
<?= htmlspecialchars($row['nama_warga']) ?>
</td>
<td class="px-4 py-3">
<?= htmlspecialchars($row['rumah_ibadah']) ?>
</td>
<td class="px-4 py-3">
<?= htmlspecialchars($row['cs_nama']) ?>
</td>
<td class="px-4 py-3">
<?= htmlspecialchars($row['jenis_bantuan']) ?>
</td>
<td class="px-4 py-3 text-center">
<?php if($row['status']=='proses'){ ?>
<span
class="px-3 py-1 rounded-full text-xs font-semibold bg-orange-100 text-orange-700">
Diproses
</span>
<?php } elseif($row['status']=='selesai'){ ?>
<span class="px-3 py-1 rounded-full text-xs font-semibold bg-green-100 text-green-700">
Selesai
</span>
<?php } ?>
</td>
<td class="px-4 py-3 text-center">
<?php if(!empty($row['bukti_foto'])){ ?>
<img src="../assets/uploads/<?= htmlspecialchars($row['bukti_foto']) ?>"
class="w-24 h-24 object-cover rounded-xl shadow mx-auto hover:scale-105 transition cursor-pointer">
<?php } else { ?>
<span class="text-gray-400 italic">
Belum Ada
</span>
<?php } ?>
</td>
</tr>
<?php } } else { ?>
<tr>
<td colspan="7" class="py-10 text-center text-gray-500">
<i class="fas fa-box-open text-4xl mb-3 block"></i>
Belum ada data bantuan
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>
+27
View File
@@ -0,0 +1,27 @@
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
include '../config/koneksi.php';
$id = intval($_GET['id']);
mysqli_query($conn,
"DELETE FROM laporan
WHERE id='$id'");
header("Location: validasi.php");
?>
+27
View File
@@ -0,0 +1,27 @@
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
include '../config/koneksi.php';
$id = intval($_GET['id']);
mysqli_query($conn,
"DELETE FROM rumah_ibadah
WHERE id='$id'");
header("Location: rumah_ibadah.php");
?>
View File
+29
View File
@@ -0,0 +1,29 @@
<div class="navbar">
<div class="logo-area">
<i class="fa-solid fa-map-location-dot"></i>
<div>
<h2>WEBGIS KEMISKINAN</h2>
<small>Sistem Pengentasan Kemiskinan</small>
</div>
</div>
<div class="admin-profile">
<div class="avatar">
<i class="fa-solid fa-user"></i>
</div>
<div>
<strong><?= htmlspecialchars($_SESSION['nama']); ?></strong>
<br>
<small>Administrator</small>
</div>
</div>
</div>
+45
View File
@@ -0,0 +1,45 @@
<div class="sidebar">
<div class="sidebar-title">
MENU ADMIN
</div>
<a class="<?php if(basename($_SERVER['PHP_SELF'])=='dashboard.php') echo 'active'; ?>" href="dashboard.php">
<i class="fa-solid fa-house"></i>
Dashboard
</a>
<a class="<?php if(basename($_SERVER['PHP_SELF'])=='peta.php') echo 'active'; ?>" href="peta.php">
<i class="fa-solid fa-map-location-dot"></i>
Peta GIS
</a>
<a class="<?php if(basename($_SERVER['PHP_SELF'])=='validasi.php') echo 'active'; ?>" href="validasi.php">
<i class="fa-solid fa-circle-check"></i>
Validasi Laporan
</a>
<a class="<?php if(basename($_SERVER['PHP_SELF'])=='data_bantuan.php') echo 'active'; ?>" href="data_bantuan.php">
<i class="fa-solid fa-hand-holding-heart"></i>
Data Bantuan
</a>
<a class="<?php if(basename($_SERVER['PHP_SELF'])=='rumah_ibadah.php') echo 'active'; ?>" href="rumah_ibadah.php">
<i class="fa-solid fa-building"></i>
Rumah Ibadah
</a>
<div class="sidebar-footer">
<a href="../logout.php" onclick="return confirm('Logout sekarang?')">
<i class="fa-solid fa-right-from-bracket"></i>
Logout
</a>
</div>
</div>
+379
View File
@@ -0,0 +1,379 @@
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: #f8fafc;
font-family: 'Segoe UI', sans-serif;
}
.content {
padding: 30px;
}
/* NAVBAR */
.navbar {
position: fixed;
top: 0;
left: 260px;
right: 0;
height: 70px;
background: white;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 30px;
box-shadow:
0 2px 15px rgba(0, 0, 0, .08);
z-index: 1000;
}
.logo-area {
display: flex;
align-items: center;
gap: 12px;
}
.logo-area i {
font-size: 28px;
color: #2563eb;
}
.logo-area h2 {
font-size: 18px;
margin: 0;
}
.logo-area small {
color: #64748b;
}
.admin-profile {
display: flex;
align-items: center;
gap: 12px;
}
.avatar {
width: 45px;
height: 45px;
border-radius: 50%;
background: #2563eb;
display: flex;
align-items: center;
justify-content: center;
color: white;
}
/* SIDEBAR */
.sidebar {
position: fixed;
left: 0;
top: 0;
width: 260px;
height: 100vh;
background: #1e293b;
padding-top: 20px;
display: flex;
flex-direction: column;
}
.sidebar-title {
color: #94a3b8;
font-size: 12px;
padding: 15px 25px;
}
.sidebar a {
color: #e2e8f0;
text-decoration: none;
padding: 15px 25px;
display: flex;
align-items: center;
gap: 12px;
transition: .3s;
}
.sidebar a:hover {
background: #334155;
}
.sidebar a.active {
background: #2563eb;
border-left: 4px solid white;
}
.sidebar-footer {
margin-top: auto;
border-top: 1px solid #334155;
padding-top: 10px;
}
/* CONTENT */
.content {
margin-left: 260px;
margin-top: 70px;
padding: 30px;
}
/* CARD */
.card {
background: white;
border-radius: 16px;
padding: 25px;
box-shadow:
0 4px 20px rgba(0, 0, 0, .08);
transition: .3s;
}
.card:hover {
transform: translateY(-5px);
}
/* TABLE */
table {
width: 100%;
border-collapse: collapse;
background: white;
border-radius: 15px;
overflow: hidden;
box-shadow:
0 4px 20px rgba(0, 0, 0, .08);
}
th {
background: #2563eb;
color: white;
}
th,
td {
padding: 14px;
border-bottom: 1px solid #eee;
}
/* BUTTON */
.btn {
padding: 10px 16px;
border-radius: 10px;
text-decoration: none;
color: white;
display: inline-block;
}
.approve {
background: #16a34a;
}
.reject {
background: #dc2626;
}
.delete {
background: #64748b;
}
.warning {
background: #f59e0b;
}
/* INPUT */
input,
select,
textarea {
width: 100%;
padding: 12px;
border: 1px solid #ddd;
border-radius: 10px;
margin-top: 8px;
}
/* BOX */
.box {
background: white;
padding: 25px;
border-radius: 20px;
box-shadow:
0 4px 20px rgba(0, 0, 0, .08);
}
.cards {
display: grid;
grid-template-columns:
repeat(auto-fit, minmax(220px, 1fr));
gap: 20px;
}
.card i {
font-size: 40px;
color: #2563eb;
margin-bottom: 15px;
}
.card h3 {
color: #64748b;
font-size: 14px;
}
.card h1 {
font-size: 35px;
margin-top: 10px;
}
.badge {
padding: 6px 12px;
border-radius: 30px;
color: white;
font-size: 13px;
}
.pending {
background: #f59e0b;
}
.approved {
background: #16a34a;
}
.rejected {
background: #dc2626;
}
.process {
background: #2563eb;
}
.done {
background: #7c3aed;
}
#legend {
position: absolute;
top: 20px;
right: 20px;
z-index: 1000;
background: white;
padding: 15px;
border-radius: 10px;
box-shadow:
0 2px 10px rgba(0, 0, 0, .2);
}
.photo {
width: 100px;
height: 100px;
object-fit: cover;
border-radius: 12px;
border: 3px solid white;
box-shadow:
0 2px 10px rgba(0, 0, 0, .2);
}
.hero {
background:
linear-gradient(135deg,
#2563eb,
#06b6d4);
color: white;
padding: 30px;
border-radius: 20px;
margin-bottom: 30px;
}
</style>
+380
View File
@@ -0,0 +1,380 @@
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
include '../config/koneksi.php';
$status = isset($_GET['status'])
? mysqli_real_escape_string($conn,$_GET['status'])
: '';
$query = "SELECT * FROM laporan";
if($status != ''){
$query .= " WHERE status='$status'";
}
$query .= " ORDER BY id DESC";
$data = mysqli_query($conn,$query);
if(!$data){
die("Query Error: " . mysqli_error($conn));
}
$total_data = mysqli_num_rows($data);
?>
<!DOCTYPE html>
<html>
<head>
<title>Peta Kemiskinan</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster/dist/MarkerCluster.css" />
<link rel="stylesheet" href="https://unpkg.com/leaflet.markercluster/dist/MarkerCluster.Default.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
<?php include 'layout/style.php'; ?>
<style>
#map {
height: 80vh;
width: 100%;
border-radius: 20px;
overflow: hidden;
box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
}
</style>
</head>
<body>
<?php include 'layout/navbar.php'; ?>
<?php include 'layout/sidebar.php'; ?>
<div class="content">
<div class="hero">
<h1>Peta Kemiskinan</h1>
<p style="margin-top:10px;">
Visualisasi lokasi laporan kemiskinan berdasarkan status laporan.
</p>
</div>
<div class="box">
<div style="
display:flex;
justify-content:space-between;
align-items:center;
flex-wrap:wrap;
gap:15px;
">
<div>
<h3>Total Data Ditampilkan</h3>
<h1 style="
color:#2563eb;
margin-top:5px;
">
<?= $total_data ?>
</h1>
</div>
<form method="GET">
<select name="status" style="
width:auto;
display:inline-block;
">
<option value="">
Semua Status
</option>
<option value="pending" <?= $status=='pending' ? 'selected' : '' ?>>
Pending
</option>
<option value="disetujui" <?= $status=='disetujui' ? 'selected' : '' ?>>
Disetujui
</option>
<option value="ditolak" <?= $status=='ditolak' ? 'selected' : '' ?>>
Ditolak
</option>
<option value="diproses" <?= $status=='diproses' ? 'selected' : '' ?>>
Diproses
</option>
<option value="selesai" <?= $status=='selesai' ? 'selected' : '' ?>>
Selesai
</option>
</select>
<button type="submit" class="btn approve">
Filter
</button>
<a href="peta.php" class="btn delete">
Reset
</a>
</form>
</div>
</div>
<br>
<div id="legend">
<b>Status Marker</b>
<hr style="margin:10px 0;">
🟡 Pending <br>
🟢 Disetujui <br>
🔴 Ditolak <br>
🔵 Diproses <br>
🟣 Selesai
</div>
<div id="map"></div>
</div>
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script src="https://unpkg.com/leaflet.markercluster/dist/leaflet.markercluster.js"></script>
<script>
var map = L.map('map').setView(
[-0.0263, 109.3425],
11
);
L.tileLayer(
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; OpenStreetMap'
}
).addTo(map);
var markers = L.markerClusterGroup();
<?php
mysqli_data_seek($data,0);
while($row = mysqli_fetch_assoc($data)){
if(
empty($row['latitude']) ||
empty($row['longitude'])
){
continue;
}
$warna = "orange";
if($row['status']=="disetujui"){
$warna = "green";
}
elseif($row['status']=="ditolak"){
$warna = "red";
}
elseif($row['status']=="diproses"){
$warna = "blue";
}
elseif($row['status']=="selesai"){
$warna = "purple";
}
$nama =
addslashes(
htmlspecialchars(
$row['nama_warga']
));
$alamat =
addslashes(
htmlspecialchars(
$row['alamat']
));
$kondisi =
addslashes(
htmlspecialchars(
$row['kondisi']
));
$foto =
addslashes(
htmlspecialchars(
$row['foto']
));
if(empty($row['foto'])){
$foto = 'no-image.png';
}
$statusBadge = '';
if($row['status']=='pending'){
$statusBadge = '🟡 Pending';
}
elseif($row['status']=='disetujui'){
$statusBadge = '🟢 Disetujui';
}
elseif($row['status']=='ditolak'){
$statusBadge = '🔴 Ditolak';
}
elseif($row['status']=='diproses'){
$statusBadge = '🔵 Diproses';
}
elseif($row['status']=='selesai'){
$statusBadge = '🟣 Selesai';
}
?>
L.circleMarker(
[
<?= $row['latitude'] ?>,
<?= $row['longitude'] ?>
], {
radius: 12,
weight: 2,
color: '<?= $warna ?>',
fillColor: '<?= $warna ?>',
fillOpacity: 0.8
}
)
.bindPopup(`
<div style="width:250px;">
<img
src="../assets/uploads/<?= $foto ?>"
onerror="this.src='../assets/uploads/no-image.png'"
style="
width:100%;
height:150px;
object-fit:cover;
border-radius:10px;
margin-bottom:10px;
">
<b style="
font-size:16px;
">
<?= $nama ?>
</b>
<hr style="margin:8px 0;">
<b>Alamat</b>
<br>
<?= $alamat ?>
<br><br>
<b>Kondisi</b>
<br>
<?= $kondisi ?>
<br><br>
<b>Status</b>
<br>
<?= $statusBadge ?>
<br><br>
<b>Tanggal</b>
<br>
<?= !empty($row['created_at'])
? date('d-m-Y H:i', strtotime($row['created_at']))
: '-' ?>
<br><br>
<a
href="https://www.google.com/maps?q=<?= $row['latitude'] ?>,<?= $row['longitude'] ?>"
target="_blank"
style="
display:inline-block;
background:#2563eb;
color:white;
padding:8px 12px;
border-radius:8px;
text-decoration:none;
">
📍 Buka Google Maps
</a>
</div>
`)
.addTo(markers);
<?php } ?>
map.addLayer(markers);
if (markers.getLayers().length > 0) {
map.fitBounds(
markers.getBounds()
);
}
</script>
</body>
</html>
+86
View File
@@ -0,0 +1,86 @@
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
include '../config/koneksi.php';
$laporan_id = intval($_POST['laporan_id']);
$rumah_ibadah_id = intval($_POST['rumah_ibadah_id']);
$cs_id = intval($_POST['cs_id']);
$jenis_bantuan =
mysqli_real_escape_string(
$conn,
$_POST['jenis_bantuan']
);
$cek = mysqli_query(
$conn,
"SELECT * FROM bantuan
WHERE laporan_id='$laporan_id'"
);
if(mysqli_num_rows($cek) > 0){
echo "
<script>
alert('Bantuan sudah pernah diassign');
window.location='validasi.php';
</script>
";
exit;
}
mysqli_query($conn,
"INSERT INTO bantuan
(laporan_id,rumah_ibadah_id,cs_id,jenis_bantuan,status)
VALUES
(
'$laporan_id',
'$rumah_ibadah_id',
'$cs_id',
'$jenis_bantuan',
'proses'
)"
);
$cek_laporan = mysqli_query(
$conn,
"SELECT * FROM laporan
WHERE id='$laporan_id'"
);
if(mysqli_num_rows($cek_laporan)==0){
die("Laporan tidak ditemukan");
}
/* UPDATE STATUS */
mysqli_query($conn,
"UPDATE laporan
SET status='diproses'
WHERE id='$laporan_id'"
);
header("Location: validasi.php");
?>
+38
View File
@@ -0,0 +1,38 @@
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
include '../config/koneksi.php';
$id = intval($_GET['id']);
$cek = mysqli_query(
$conn,
"SELECT * FROM laporan
WHERE id='$id'"
);
if(mysqli_num_rows($cek)==0){
die("Data laporan tidak ditemukan");
}
mysqli_query($conn,
"UPDATE laporan
SET status='ditolak'
WHERE id='$id'");
header("Location: validasi.php");
?>
+227
View File
@@ -0,0 +1,227 @@
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
include '../config/koneksi.php';
$data = mysqli_query($conn,
"SELECT * FROM rumah_ibadah");
?>
<!DOCTYPE html>
<html>
<head>
<title>Rumah Ibadah</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
<?php include 'layout/style.php'; ?>
</head>
<body>
<?php include 'layout/navbar.php'; ?>
<?php include 'layout/sidebar.php'; ?>
<div class="content">
<div class="flex flex-col md:flex-row md:items-center md:justify-between gap-4 mb-6">
<div>
<h1 class="text-3xl font-bold text-gray-800">
Data Rumah Ibadah
</h1>
<p class="text-gray-500 mt-2">
Kelola data rumah ibadah yang berpartisipasi dalam program bantuan sosial.
</p>
</div>
<a href="tambah_rumah_ibadah.php"
class="inline-flex items-center gap-2 px-5 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl shadow transition">
<i class="fas fa-plus"></i>
Tambah Rumah Ibadah
</a>
</div>
<?php
$total_rumah_ibadah = mysqli_num_rows($data);
mysqli_data_seek($data,0);
?>
<div class="grid md:grid-cols-3 gap-5 mb-6">
<div class="bg-white rounded-2xl shadow p-5">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm">
Total Rumah Ibadah
</p>
<h2 class="text-3xl font-bold text-blue-600">
<?= $total_rumah_ibadah ?>
</h2>
</div>
<i class="fas fa-place-of-worship text-4xl text-blue-500"></i>
</div>
</div>
</div>
<div class="bg-white rounded-2xl shadow overflow-hidden">
<div class="p-5 border-b">
<h2 class="font-semibold text-lg">
Daftar Rumah Ibadah
</h2>
</div>
<div class="overflow-x-auto">
<table class="min-w-full">
<thead class="bg-gray-100">
<tr>
<th class="px-4 py-3 text-left">No</th>
<th class="px-4 py-3 text-left">Nama</th>
<th class="px-4 py-3 text-left">Alamat</th>
<th class="px-4 py-3 text-left">Latitude</th>
<th class="px-4 py-3 text-left">Longitude</th>
<th class="px-4 py-3 text-center">Aksi</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
mysqli_data_seek($data,0);
if(mysqli_num_rows($data) > 0){
while($row = mysqli_fetch_assoc($data)){
?>
<tr class="border-b hover:bg-gray-50 transition">
<td class="px-4 py-3">
<?= $no++ ?>
</td>
<td class="px-4 py-3 font-medium">
<?= htmlspecialchars($row['nama']) ?>
</td>
<td class="px-4 py-3">
<?= htmlspecialchars($row['alamat']) ?>
</td>
<td class="px-4 py-3">
<?= htmlspecialchars($row['latitude']) ?>
</td>
<td class="px-4 py-3">
<?= htmlspecialchars($row['longitude']) ?>
</td>
<td class="px-4 py-3 text-center">
<div class="flex flex-wrap justify-center gap-2">
<a href="https://www.google.com/maps?q=<?= $row['latitude'] ?>,<?= $row['longitude'] ?>"
target="_blank"
class="px-3 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg transition">
<i class="fas fa-map-marker-alt"></i>
</a>
<a href="hapus_rumah_ibadah.php?id=<?= $row['id'] ?>"
onclick="return confirm('Yakin hapus data?')"
class="px-3 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg transition">
<i class="fas fa-trash"></i>
</a>
</div>
</td>
</tr>
<?php } } else { ?>
<tr>
<td colspan="6" class="py-10 text-center text-gray-500">
<i class="fas fa-place-of-worship text-4xl mb-3 block"></i>
Belum ada data rumah ibadah
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>
+47
View File
@@ -0,0 +1,47 @@
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
include '../config/koneksi.php';
$nama =
mysqli_real_escape_string(
$conn,
$_POST['nama']
);
$alamat =
mysqli_real_escape_string(
$conn,
$_POST['alamat']
);
$latitude = $_POST['latitude'];
$longitude = $_POST['longitude'];
mysqli_query($conn,
"INSERT INTO rumah_ibadah
(nama,alamat,latitude,longitude)
VALUES
('$nama','$alamat','$latitude','$longitude')"
);
header("Location: rumah_ibadah.php");
?>
+345
View File
@@ -0,0 +1,345 @@
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
?>
<!DOCTYPE html>
<html>
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Tambah Rumah Ibadah</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<?php include 'layout/style.php'; ?>
</head>
<body>
<?php include 'layout/navbar.php'; ?>
<?php include 'layout/sidebar.php'; ?>
<div class="content">
<div class="mb-6">
<h1 class="text-3xl font-bold text-gray-800">
Tambah Rumah Ibadah
</h1>
<p class="text-gray-500 mt-2">
Tambahkan data rumah ibadah yang akan menjadi mitra penyaluran bantuan sosial.
</p>
</div>
<div class="bg-white rounded-2xl shadow-lg overflow-hidden max-w-5xl">
<div class="p-5 border-b bg-gray-50">
<h2 class="font-semibold text-lg flex items-center gap-2">
<i class="fas fa-place-of-worship text-blue-600"></i>
Form Rumah Ibadah
</h2>
</div>
<form action="simpan_rumah_ibadah.php" method="POST" class="p-6 space-y-5">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
Nama Rumah Ibadah
</label>
<div class="relative">
<i class="fas fa-building absolute left-4 top-4 text-gray-400"></i>
<input type="text" name="nama" required placeholder="Masukkan nama rumah ibadah"
class="w-full border rounded-xl pl-11 pr-4 py-3 focus:ring-2 focus:ring-blue-500 focus:outline-none">
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
Alamat
</label>
<textarea id="alamat" name="alamat" required rows="4"
placeholder="Alamat akan terisi otomatis saat memilih lokasi"
class="w-full border rounded-xl p-3 focus:ring-2 focus:ring-blue-500 focus:outline-none"></textarea>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
Cari Lokasi
</label>
<input type="text" id="searchLocation" placeholder="Contoh: Masjid Raya Mujahidin Pontianak"
class="w-full border rounded-xl p-3">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
Pilih Lokasi di Peta
</label>
<div id="map" class="rounded-xl border" style="height:450px;">
</div>
</div>
<div class="grid md:grid-cols-2 gap-5">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
Latitude
</label>
<input type="text" id="latitude" name="latitude" readonly required
class="w-full border rounded-xl p-3 bg-gray-100">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">
Longitude
</label>
<input type="text" id="longitude" name="longitude" readonly required
class="w-full border rounded-xl p-3 bg-gray-100">
</div>
</div>
<div class="flex flex-wrap gap-3 pt-4">
<button type="submit"
class="px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white rounded-xl shadow transition">
<i class="fas fa-save mr-2"></i>
Simpan Data
</button>
<a href="rumah_ibadah.php"
class="px-6 py-3 bg-gray-500 hover:bg-gray-600 text-white rounded-xl shadow transition">
<i class="fas fa-arrow-left mr-2"></i>
Kembali
</a>
</div>
</form>
</div>
</div>
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script>
var map = L.map('map').setView(
[-0.0263, 109.3425],
11
);
L.tileLayer(
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; OpenStreetMap'
}
).addTo(map);
var marker = L.marker(
[-0.0263, 109.3425], {
draggable: true
}
).addTo(map);
function updateLatLng(lat, lng) {
document.getElementById('latitude').value =
lat.toFixed(6);
document.getElementById('longitude').value =
lng.toFixed(6);
}
updateLatLng(
marker.getLatLng().lat,
marker.getLatLng().lng
);
function updateAddress(lat, lng) {
fetch(
'https://nominatim.openstreetmap.org/reverse?format=json&lat=' +
lat +
'&lon=' +
lng
)
.then(response => response.json())
.then(data => {
if (data.display_name) {
document.getElementById('alamat').value =
data.display_name;
}
});
}
map.on('click', function(e) {
marker.setLatLng(e.latlng);
updateLatLng(
e.latlng.lat,
e.latlng.lng
);
updateAddress(
e.latlng.lat,
e.latlng.lng
);
});
marker.on('dragend', function() {
var pos = marker.getLatLng();
updateLatLng(
pos.lat,
pos.lng
);
updateAddress(
pos.lat,
pos.lng
);
});
document
.getElementById('searchLocation')
.addEventListener('keypress', async function(e) {
if (e.key !== 'Enter') {
return;
}
e.preventDefault();
let keyword = this.value;
let response = await fetch(
'https://nominatim.openstreetmap.org/search?format=json&q=' +
encodeURIComponent(keyword)
);
let data = await response.json();
if (data.length > 0) {
let lat = parseFloat(data[0].lat);
let lng = parseFloat(data[0].lon);
map.setView(
[lat, lng],
15
);
marker.setLatLng(
[lat, lng]
);
updateLatLng(
lat,
lng
);
updateAddress(
lat,
lng
);
} else {
alert('Lokasi tidak ditemukan');
}
});
setTimeout(function() {
map.invalidateSize();
}, 500);
</script>
</body>
</html>
</html>
+230
View File
@@ -0,0 +1,230 @@
<?php
session_start();
if(!isset($_SESSION['role'])){
header("Location: ../index.php");
exit;
}
if($_SESSION['role'] != 'admin'){
header("Location: ../index.php");
exit;
}
include '../config/koneksi.php';
$data = mysqli_query($conn,
"SELECT * FROM laporan");
if(!$data){
die(mysqli_error($conn));
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Validasi</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
<?php include 'layout/style.php'; ?>
</head>
<body>
<?php include 'layout/navbar.php'; ?>
<?php include 'layout/sidebar.php'; ?>
<div class="content">
<div class="mb-6">
<h1 class="text-3xl font-bold text-gray-800">
Validasi Laporan
</h1>
<p class="text-gray-500 mt-1">
Kelola laporan kemiskinan yang masuk dari masyarakat.
</p>
</div>
<div class="bg-white rounded-2xl shadow-lg overflow-hidden">
<div class="p-5 border-b bg-gray-50">
<h2 class="font-semibold text-lg">
Data Laporan
</h2>
</div>
<div class="overflow-x-auto">
<table class="min-w-full">
<thead class="bg-gray-100">
<tr>
<th class="px-4 py-3 text-left">No</th>
<th class="px-4 py-3 text-left">Nama</th>
<th class="px-4 py-3 text-left">Alamat</th>
<th class="px-4 py-3 text-left">Foto</th>
<th class="px-4 py-3 text-left">Status</th>
<th class="px-4 py-3 text-center">Aksi</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
while($row = mysqli_fetch_assoc($data)){
?>
<tr class="border-b hover:bg-gray-50 transition">
<td class="px-4 py-3">
<?= $no++ ?>
</td>
<td class="px-4 py-3 font-medium">
<?= $row['nama_warga'] ?>
</td>
<td class="px-4 py-3">
<?= $row['alamat'] ?>
</td>
<td class="px-4 py-3">
<?php if(!empty($row['foto'])){ ?>
<img src="../assets/uploads/<?= htmlspecialchars($row['foto']) ?>"
onerror="this.src='../assets/uploads/no-image.png'"
class="w-20 h-20 object-cover rounded-xl shadow">
<?php } else { ?>
<span class="text-gray-400 italic">
Tidak ada foto
</span>
<?php } ?>
</td>
<td class="px-4 py-3">
<?php
if($row['status']=='pending'){
echo '<span class="px-3 py-1 rounded-full text-xs font-semibold bg-yellow-100 text-yellow-700">
Pending
</span>';
}
elseif($row['status']=='disetujui'){
echo '<span class="px-3 py-1 rounded-full text-xs font-semibold bg-green-100 text-green-700">
Disetujui
</span>';
}
elseif($row['status']=='ditolak'){
echo '<span class="px-3 py-1 rounded-full text-xs font-semibold bg-red-100 text-red-700">
Ditolak
</span>';
}
elseif($row['status']=='diproses'){
echo '<span class="px-3 py-1 rounded-full text-xs font-semibold bg-blue-100 text-blue-700">
Diproses
</span>';
}
elseif($row['status']=='selesai'){
echo '<span class="px-3 py-1 rounded-full text-xs font-semibold bg-purple-100 text-purple-700">
Selesai
</span>';
}
?>
</td>
<td class="px-4 py-3">
<div class="flex flex-wrap gap-2 justify-center">
<?php if($row['status']=='pending'){ ?>
<a href="approve.php?id=<?= $row['id'] ?>"
onclick="return confirm('Setujui laporan ini?')"
class="px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm transition">
<i class="fas fa-check mr-1"></i>
Approve
</a>
<a href="reject.php?id=<?= $row['id'] ?>"
onclick="return confirm('Tolak laporan ini?')"
class="px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg text-sm transition">
<i class="fas fa-times mr-1"></i>
Reject
</a>
<?php } ?>
<?php if($row['status']=='disetujui'){ ?>
<a href="assign_bantuan.php?id=<?= $row['id'] ?>"
class="px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm transition">
<i class="fas fa-hand-holding-heart mr-1"></i>
Assign Bantuan
</a>
<?php } ?>
</div>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>