-- phpMyAdmin SQL Dump
-- version 5.2.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 28, 2026 at 10:20 AM
-- Server version: 10.6.18-MariaDB-log
-- PHP Version: 8.5.1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `rtwa_clean`
--

-- --------------------------------------------------------

--
-- Table structure for table `angsuran_pinjaman`
--

CREATE TABLE `angsuran_pinjaman` (
  `id` int(11) NOT NULL,
  `pinjaman_id` int(11) NOT NULL,
  `angsuran_ke` int(11) NOT NULL,
  `tanggal_jatuh_tempo` date NOT NULL,
  `nominal_angsuran` decimal(12,2) NOT NULL,
  `denda` decimal(12,2) DEFAULT 0.00,
  `total_bayar` decimal(12,2) NOT NULL,
  `tanggal_bayar` date DEFAULT NULL,
  `status_bayar` enum('belum','dibayar','terlambat') DEFAULT 'belum',
  `metode_pembayaran` enum('tunai','transfer') DEFAULT 'tunai',
  `bukti_transfer` varchar(255) DEFAULT NULL,
  `keterangan` text DEFAULT NULL,
  `petugas_id` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `pengajuan_bayar_id` int(11) UNSIGNED DEFAULT NULL COMMENT 'Link ke pengajuan_bayar_angsuran'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `arisan`
--

CREATE TABLE `arisan` (
  `id` int(11) NOT NULL,
  `nama_arisan` varchar(100) NOT NULL,
  `nominal_iuran` decimal(15,2) NOT NULL,
  `periode` enum('mingguan','bulanan') NOT NULL DEFAULT 'bulanan',
  `mode_undian` enum('manual','otomatis') NOT NULL DEFAULT 'manual' COMMENT 'manual=kocokan sendiri, otomatis=sistem acak',
  `jumlah_pemenang_per_pertemuan` int(11) NOT NULL DEFAULT 1 COMMENT 'Berapa orang yang menang per pertemuan',
  `kas_id` int(11) DEFAULT NULL COMMENT 'Referensi ke master_kas untuk arisan ini',
  `tanggal_mulai` date NOT NULL,
  `status` enum('aktif','selesai','nonaktif') NOT NULL DEFAULT 'aktif',
  `keterangan` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `arisan`
--

INSERT INTO `arisan` (`id`, `nama_arisan`, `nominal_iuran`, `periode`, `mode_undian`, `jumlah_pemenang_per_pertemuan`, `kas_id`, `tanggal_mulai`, `status`, `keterangan`, `created_at`, `updated_at`) VALUES
(17, 'ARISAN BULANAN', 100000.00, 'bulanan', 'otomatis', 1, NULL, '2026-04-20', 'aktif', '', '2026-04-20 02:29:50', '2026-04-20 02:29:50');

-- --------------------------------------------------------

--
-- Table structure for table `arisan_iuran`
--

CREATE TABLE `arisan_iuran` (
  `id` int(11) NOT NULL,
  `pertemuan_id` int(11) NOT NULL,
  `peserta_id` int(11) NOT NULL,
  `warga_id` int(11) NOT NULL,
  `nominal_bayar` decimal(15,2) NOT NULL,
  `tanggal_bayar` date NOT NULL,
  `metode_pembayaran` enum('tunai','transfer') NOT NULL DEFAULT 'tunai',
  `kas_rt_id` int(11) DEFAULT NULL,
  `status_bayar` enum('belum','lunas') NOT NULL DEFAULT 'belum',
  `keterangan` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `arisan_pertemuan`
--

CREATE TABLE `arisan_pertemuan` (
  `id` int(11) NOT NULL,
  `arisan_id` int(11) NOT NULL,
  `pertemuan_ke` int(11) NOT NULL,
  `tanggal_pertemuan` date NOT NULL,
  `tempat_pertemuan` varchar(255) DEFAULT NULL,
  `warga_id_tuan_rumah` int(11) DEFAULT NULL,
  `pemenang_warga_id` int(11) DEFAULT NULL,
  `nomor_undian` int(11) DEFAULT NULL,
  `total_iuran` decimal(15,2) DEFAULT NULL,
  `status_pertemuan` enum('pending','terlaksana','batal') NOT NULL DEFAULT 'pending',
  `keterangan` text DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `updated_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `arisan_peserta`
--

CREATE TABLE `arisan_peserta` (
  `id` int(11) NOT NULL,
  `arisan_id` int(11) NOT NULL,
  `warga_id` int(11) NOT NULL,
  `nomor_urut` int(11) NOT NULL,
  `status_peserta` enum('aktif','keluar') NOT NULL DEFAULT 'aktif',
  `tanggal_daftar` date NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `arisan_peserta`
--

INSERT INTO `arisan_peserta` (`id`, `arisan_id`, `warga_id`, `nomor_urut`, `status_peserta`, `tanggal_daftar`, `created_at`) VALUES
(241, 17, 1091, 1, 'aktif', '2026-04-20', '2026-04-20 02:30:01'),
(242, 17, 1090, 2, 'aktif', '2026-04-20', '2026-04-20 02:30:01');

-- --------------------------------------------------------

--
-- Table structure for table `arisan_riwayat_pemenang`
--

CREATE TABLE `arisan_riwayat_pemenang` (
  `id` int(11) NOT NULL,
  `arisan_id` int(11) NOT NULL,
  `pertemuan_id` int(11) NOT NULL,
  `warga_id` int(11) NOT NULL,
  `nomor_undian` int(11) NOT NULL,
  `nominal_dapat` decimal(15,2) NOT NULL,
  `tanggal_dapat` date NOT NULL,
  `sudah_diterima` enum('ya','tidak') NOT NULL DEFAULT 'tidak',
  `tanggal_diterima` date DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `kas_rt_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `bansos`
--

CREATE TABLE `bansos` (
  `id` int(11) NOT NULL,
  `warga_id` int(11) NOT NULL COMMENT 'FK ke tabel warga',
  `jenis_bantuan` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT 'Array: ["blt","sembako","pkh",...]' CHECK (json_valid(`jenis_bantuan`)),
  `tahun` year(4) NOT NULL DEFAULT year(curdate()),
  `status` enum('aktif','nonaktif','ditinjau') NOT NULL DEFAULT 'aktif',
  `keterangan` text DEFAULT NULL,
  `undangan` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Array JSON catatan undangan pengambilan bantuan' CHECK (json_valid(`undangan`)),
  `dicatat_oleh` int(11) DEFAULT NULL COMMENT 'FK ke users (admin)',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `cicilan_iuran`
--

CREATE TABLE `cicilan_iuran` (
  `id` int(11) NOT NULL,
  `pembayaran_iuran_id` int(11) NOT NULL,
  `ke` tinyint(3) NOT NULL DEFAULT 1 COMMENT 'Cicilan ke-berapa',
  `nominal_cicilan` decimal(15,0) NOT NULL,
  `tanggal_bayar` date NOT NULL,
  `metode_pembayaran` varchar(50) DEFAULT 'tunai',
  `bukti_transfer` varchar(255) DEFAULT NULL,
  `master_kas_id` int(11) DEFAULT NULL,
  `keterangan` text DEFAULT NULL,
  `input_oleh` int(11) DEFAULT NULL,
  `diverifikasi_oleh` int(11) DEFAULT NULL,
  `status` enum('lunas','menunggu_verifikasi') DEFAULT 'lunas',
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `cicilan_iuran`
--

INSERT INTO `cicilan_iuran` (`id`, `pembayaran_iuran_id`, `ke`, `nominal_cicilan`, `tanggal_bayar`, `metode_pembayaran`, `bukti_transfer`, `master_kas_id`, `keterangan`, `input_oleh`, `diverifikasi_oleh`, `status`, `created_at`) VALUES
(1, 445, 1, 10000, '2026-04-11', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-11 16:37:24'),
(2, 445, 2, 500, '2026-04-11', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-11 17:01:27'),
(3, 445, 3, 2000, '2026-04-11', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-11 17:10:36'),
(4, 446, 1, 1000, '2026-04-11', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-11 17:17:43'),
(5, 447, 1, 1000, '2026-04-11', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-11 17:22:58'),
(6, 447, 2, 1000, '2026-04-11', 'tunai', NULL, NULL, '', 662, NULL, 'lunas', '2026-04-11 17:23:46'),
(7, 447, 3, 10000, '2026-04-11', 'tunai', NULL, 1, '', 662, 1, 'lunas', '2026-04-11 17:27:48'),
(8, 447, 3, 2000, '2026-04-11', 'tunai', 'cicil_447_ke3_1775928661.png', 2, '', 662, 1, 'lunas', '2026-04-11 17:31:01'),
(9, 450, 1, 10000, '2026-04-11', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-11 17:57:02'),
(10, 451, 1, 500, '2026-04-11', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-11 18:21:43'),
(11, 451, 2, 1500, '2026-04-11', 'tunai', 'cicil_451_ke2_1775931928.png', 1, '', 661, 1, 'lunas', '2026-04-11 18:25:28'),
(12, 450, 2, 20000, '2026-04-11', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-11 18:37:05'),
(13, 451, 3, 28000, '2026-04-11', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-11 18:37:32'),
(14, 453, 1, 1000, '2026-04-12', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-12 04:16:41'),
(15, 453, 2, 1000, '2026-04-12', 'tunai', 'cicil_453_ke2_1775967445.png', 1, '', 661, 1, 'lunas', '2026-04-12 04:17:25'),
(16, 455, 1, 100000, '2026-04-12', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-12 04:23:48'),
(17, 456, 1, 10000, '2026-04-12', 'Transfer Bank', 'cicil_456_ke1_1775968678.jpg', 1, '', 661, 1, 'lunas', '2026-04-12 04:37:58'),
(18, 453, 3, 23000, '2026-04-12', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-12 16:59:47'),
(19, 459, 1, 1000, '2026-04-14', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-14 14:24:28'),
(20, 459, 2, 3000, '2026-04-14', 'tunai', NULL, 1, '', 1, NULL, 'lunas', '2026-04-14 16:17:39');

-- --------------------------------------------------------

--
-- Table structure for table `inventaris`
--

CREATE TABLE `inventaris` (
  `id` int(11) NOT NULL,
  `kode_barang` varchar(50) DEFAULT NULL,
  `nama_barang` varchar(200) NOT NULL,
  `kategori` enum('elektronik','furniture','kendaraan','perlengkapan','lainnya') DEFAULT 'lainnya',
  `jumlah` int(11) DEFAULT 1,
  `satuan` varchar(50) DEFAULT NULL,
  `kondisi` enum('baik','rusak_ringan','rusak_berat','hilang') DEFAULT 'baik',
  `status` enum('aktif','tidak_aktif','dipinjam','maintenance') DEFAULT 'aktif',
  `lokasi` varchar(200) DEFAULT NULL,
  `tanggal_pembelian` date DEFAULT NULL,
  `harga_pembelian` decimal(15,2) DEFAULT NULL,
  `sumber_dana` enum('kas_rt','bantuan_pemerintah','sumbangan','lainnya') DEFAULT 'kas_rt',
  `keterangan` text DEFAULT NULL,
  `foto` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `inventaris`
--

INSERT INTO `inventaris` (`id`, `kode_barang`, `nama_barang`, `kategori`, `jumlah`, `satuan`, `kondisi`, `status`, `lokasi`, `tanggal_pembelian`, `harga_pembelian`, `sumber_dana`, `keterangan`, `foto`, `created_at`, `updated_at`) VALUES
(9, 'INV-2026-765', 'TIKAR', 'lainnya', 1, 'PCS', 'baik', 'aktif', '', '2026-04-08', 0.00, '', '', '11.jpg', '2026-04-28 05:37:19', '2026-04-28 05:37:19');

-- --------------------------------------------------------

--
-- Table structure for table `inventaris_gallery`
--

CREATE TABLE `inventaris_gallery` (
  `id` int(11) NOT NULL,
  `inventaris_id` int(11) DEFAULT NULL,
  `foto` varchar(255) DEFAULT NULL,
  `keterangan` varchar(200) DEFAULT NULL,
  `uploaded_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `jadwal_kegiatan`
--

CREATE TABLE `jadwal_kegiatan` (
  `id` int(11) NOT NULL,
  `nama_kegiatan` varchar(150) NOT NULL,
  `kategori` enum('ronda','kerja_bakti','poskamling','arisan','rapat','lainnya') DEFAULT 'lainnya',
  `deskripsi` text DEFAULT NULL,
  `tanggal_mulai` date DEFAULT NULL,
  `tanggal_selesai` date DEFAULT NULL,
  `waktu_mulai` time DEFAULT NULL,
  `waktu_selesai` time DEFAULT NULL,
  `hari` enum('senin','selasa','rabu','kamis','jumat','sabtu','minggu') DEFAULT NULL,
  `jenis_jadwal` enum('harian','mingguan','bulanan','tanggal_tentu','range_tanggal') DEFAULT 'harian',
  `lokasi` varchar(255) DEFAULT NULL,
  `penanggung_jawab_id` int(11) DEFAULT NULL COMMENT 'Warga yang bertanggung jawab',
  `status` enum('aktif','nonaktif','selesai') DEFAULT 'aktif',
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `jadwal_petugas`
--

CREATE TABLE `jadwal_petugas` (
  `id` int(11) NOT NULL,
  `jadwal_id` int(11) NOT NULL,
  `warga_id` int(11) NOT NULL,
  `kelompok` varchar(50) DEFAULT NULL COMMENT 'Nama kelompok/bagian',
  `urutan` int(11) DEFAULT 1,
  `tanggal_tugas` date DEFAULT NULL,
  `status` enum('aktif','diganti','selesai') DEFAULT 'aktif',
  `keterangan` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `jadwal_warga`
--

CREATE TABLE `jadwal_warga` (
  `id` int(11) NOT NULL,
  `warga_id` int(11) NOT NULL,
  `tanggal` date NOT NULL,
  `judul` varchar(150) NOT NULL,
  `deskripsi` text DEFAULT NULL,
  `warna` varchar(10) DEFAULT '#3b82f6',
  `waktu_mulai` time DEFAULT NULL,
  `waktu_selesai` time DEFAULT NULL,
  `is_selesai` tinyint(1) DEFAULT 0,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `jenis_iuran`
--

CREATE TABLE `jenis_iuran` (
  `id` int(11) NOT NULL,
  `nama_iuran` varchar(100) NOT NULL,
  `kode` varchar(20) DEFAULT NULL,
  `deskripsi` text DEFAULT NULL,
  `nominal` decimal(12,2) NOT NULL,
  `periode` enum('sekali','bulanan','tahunan') DEFAULT 'bulanan',
  `status` enum('aktif','nonaktif') DEFAULT 'aktif',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `jenis_iuran`
--

INSERT INTO `jenis_iuran` (`id`, `nama_iuran`, `kode`, `deskripsi`, `nominal`, `periode`, `status`, `created_at`) VALUES
(1, 'Iuran Kebersihan', 'IKB', 'Iuran untuk kebersihan lingkungan', 30000.00, 'bulanan', 'aktif', '2026-02-16 06:41:35'),
(2, 'Iuran Keamanan', 'IKA', 'Iuran untuk keamanan lingkungan', 20000.00, 'bulanan', 'aktif', '2026-02-16 06:41:35'),
(3, 'Iuran Sampah', 'ISM', 'Iuran pengelolaan sampah', 10000.00, 'bulanan', 'aktif', '2026-02-16 06:41:35'),
(6, 'WAQAF', 'WKF', '', 2500000.00, 'bulanan', 'aktif', '2026-04-12 04:22:38');

-- --------------------------------------------------------

--
-- Table structure for table `jenis_pinjaman`
--

CREATE TABLE `jenis_pinjaman` (
  `id` int(11) NOT NULL,
  `nama_pinjaman` varchar(100) NOT NULL,
  `kode` varchar(20) DEFAULT NULL,
  `bunga_persen` decimal(5,2) DEFAULT 0.00 COMMENT 'Bunga per bulan dalam persen',
  `tenor_max` int(11) DEFAULT 12 COMMENT 'Tenor maksimal dalam bulan',
  `plafon_max` decimal(12,2) DEFAULT 10000000.00 COMMENT 'Plafon maksimal',
  `denda_hari` int(11) DEFAULT 7 COMMENT 'Hari keterlambatan sebelum denda',
  `denda_persen` decimal(5,2) DEFAULT 1.00 COMMENT 'Denda keterlambatan per hari %',
  `syarat_ketentuan` text DEFAULT NULL,
  `status` enum('aktif','nonaktif') DEFAULT 'aktif',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `jenis_pinjaman`
--

INSERT INTO `jenis_pinjaman` (`id`, `nama_pinjaman`, `kode`, `bunga_persen`, `tenor_max`, `plafon_max`, `denda_hari`, `denda_persen`, `syarat_ketentuan`, `status`, `created_at`) VALUES
(1, 'Pinjaman Dana Darurat', 'PDD', 2.00, 3, 2000000.00, 7, 1.00, 'KTP asli, Surat keterangan tidak mampu', 'aktif', '2026-02-16 06:52:37'),
(2, 'Pinjaman Usaha', 'PUS', 1.50, 12, 10000000.00, 7, 1.00, 'KTP, KK, Proposal usaha, Jaminan sertifikat/BPKB', 'aktif', '2026-02-16 06:52:37'),
(4, 'Pinjaman Konsumtif', 'PKON', 2.50, 6, 3000000.00, 7, 1.00, 'KTP, KK, Slip gaji/bukti penghasilan', 'aktif', '2026-02-16 06:52:37');

-- --------------------------------------------------------

--
-- Table structure for table `jenis_surat`
--

CREATE TABLE `jenis_surat` (
  `id` int(11) NOT NULL,
  `kode_surat` varchar(20) NOT NULL,
  `nama_surat` varchar(100) NOT NULL,
  `template` text DEFAULT NULL,
  `persyaratan` text DEFAULT NULL,
  `status` enum('aktif','nonaktif') DEFAULT 'aktif',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `jenis_surat`
--

INSERT INTO `jenis_surat` (`id`, `kode_surat`, `nama_surat`, `template`, `persyaratan`, `status`, `created_at`) VALUES
(2, 'SKU', 'Keterangan Usaha', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Foto Tempat Usaha', 'aktif', '2026-02-16 06:41:35'),
(5, 'SKNUMPANGNIKAH', 'Keterangan Numpang Nikah', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW, Surat Pernyataan', 'aktif', '2026-02-18 15:59:57'),
(6, 'SKDISPENSASINIKAH', 'Keterangan Dispensasi Nikah', 'Yang bertanda tangan di bawah ini...', 'KTP Orang Tua, KK, Akta Kelahiran Anak', 'aktif', '2026-02-18 15:59:57'),
(7, 'SKSTATUSKAWIN', 'Keterangan Status Perkawinan', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Akta Nikah/Cerai', 'aktif', '2026-02-18 15:59:57'),
(8, 'SKSUDAHNIKAH', 'Keterangan Sudah Menikah', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Buku Nikah', 'aktif', '2026-02-18 15:59:57'),
(9, 'SKHUBKELUARGA', 'Keterangan Hubungan Keluarga', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(10, 'SKIKUTSUAMI', 'Keterangan Ikut Suami/Istri', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Buku Nikah, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(11, 'SKMASIHHIBUP', 'Keterangan Masih Hidup', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(12, 'SKASULUSUL', 'Keterangan Asal Usul', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(13, 'SKGANTINAMA', 'Keterangan Ganti Nama', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Penetapan Pengadilan Ganti Nama', 'aktif', '2026-02-18 15:59:57'),
(14, 'SKNUMPTINGGAL', 'Keterangan Numpang Tinggal', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Persetujuan Pemilik Rumah, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(15, 'SKWNI', 'Keterangan Warga Negara Indonesia', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Dokumen Kewarganegaraan', 'aktif', '2026-02-18 15:59:57'),
(16, 'SPKTP', 'Pengantar Pembuatan KTP', 'Yang bertanda tangan di bawah ini...', 'KK, Akta Kelahiran, Pas Foto 3x4', 'aktif', '2026-02-18 15:59:57'),
(17, 'SPKK', 'Pengantar Pembuatan Kartu Keluarga', 'Yang bertanda tangan di bawah ini...', 'KTP, Buku Nikah, Akta Kelahiran Anak', 'aktif', '2026-02-18 15:59:57'),
(18, 'SPAKTAKELAHIRAN', 'Pengantar Pembuatan Akta Kelahiran', 'Yang bertanda tangan di bawah ini...', 'KTP Orang Tua, KK, Surat Keterangan Lahir dari Bidan/RS', 'aktif', '2026-02-18 15:59:57'),
(19, 'SPAKTAKEMATIAN', 'Pengantar Pembuatan Akta Kematian', 'Yang bertanda tangan di bawah ini...', 'KTP Almarhum, KK, Surat Keterangan Kematian', 'aktif', '2026-02-18 15:59:57'),
(20, 'SPSKCK', 'Pengantar Pembuatan SKCK', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Pas Foto 4x6', 'aktif', '2026-02-18 15:59:57'),
(21, 'SPNPWP', 'Pengantar Pembuatan NPWP', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Keterangan Usaha/Kerja', 'aktif', '2026-02-18 15:59:57'),
(22, 'SPSERTIFTANAH', 'Pengantar Pengurusan Sertifikat Tanah', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Bukti Kepemilikan Tanah, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(23, 'SKDINSOS', 'Pengantar ke Dinas Sosial', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(24, 'SKPKH', 'Keterangan untuk PKH', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(25, 'SKKIP', 'Keterangan untuk KIP (Kartu Indonesia Pintar)', 'Yang bertanda tangan di bawah ini...', 'KTP Orang Tua, KK, Kartu Pelajar', 'aktif', '2026-02-18 15:59:57'),
(26, 'SKKUR', 'Keterangan untuk KUR (Kredit Usaha Rakyat)', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Foto Tempat Usaha, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(27, 'SKANAKYTM', 'Keterangan Anak Yatim/Piatu/Yatim Piatu', 'Yang bertanda tangan di bawah ini...', 'KTP Wali, KK, Akta Kematian Orang Tua', 'aktif', '2026-02-18 15:59:57'),
(28, 'SKLANJUTUSIA', 'Keterangan Lanjut Usia', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(29, 'SKDISABILITAS', 'Keterangan Penyandang Disabilitas', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Keterangan Dokter, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(30, 'SKSAKITKERAS', 'Keterangan Sakit Keras/Menahun', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Keterangan Dokter, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(31, 'SKBEROBATGRATIS', 'Keterangan untuk Berobat Gratis', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(32, 'SKRUJUKANRS', 'Pengantar Rujukan Rumah Sakit', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Keterangan Dokter Puskesmas', 'aktif', '2026-02-18 15:59:57'),
(33, 'SKTMBPJS', 'Keterangan Tidak Mampu untuk BPJS PBI', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW, Foto Rumah', 'aktif', '2026-02-18 15:59:57'),
(34, 'SKBKNPNS', 'Keterangan Bukan PNS/TNI/Polri', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(35, 'SKBELUMAKERJA', 'Keterangan Belum/Tidak Memiliki Pekerjaan', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(36, 'SKPENGHASLANORTU', 'Keterangan Penghasilan Orang Tua', 'Yang bertanda tangan di bawah ini...', 'KTP Orang Tua, KK, Slip Gaji/Keterangan Usaha', 'aktif', '2026-02-18 15:59:57'),
(37, 'SKTIDAKSENGKETA', 'Keterangan Tidak Sengketa Tanah', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Bukti Kepemilikan Tanah, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(38, 'SKHIBAHTANAH', 'Keterangan Hibah Tanah', 'Yang bertanda tangan di bawah ini...', 'KTP Pemberi & Penerima Hibah, KK, Bukti Kepemilikan Tanah, Saksi', 'aktif', '2026-02-18 15:59:57'),
(39, 'SKBELUMMILKIRUMAH', 'Keterangan Belum Memiliki Rumah', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(40, 'SKAHLIWARISNSIAK', 'Keterangan Ahli Waris Non SIAK', 'Yang bertanda tangan di bawah ini...', 'KTP Semua Ahli Waris, KK, Akta Kematian, Saksi 2 Orang', 'aktif', '2026-02-18 15:59:57'),
(41, 'SKKREDITBANK', 'Keterangan untuk Pengajuan Kredit Bank', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Slip Gaji/Keterangan Usaha, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(42, 'SKTEMPATTINGGAL', 'Keterangan Tempat Tinggal untuk Bank', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Rekening Listrik/Air, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(43, 'SKDAFTARTNIPOLRI', 'Keterangan untuk Pendaftaran TNI/Polri', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Akta Kelahiran, Ijazah, Pas Foto 4x6', 'aktif', '2026-02-18 15:59:57'),
(44, 'SKPERNYATAAN', 'Surat Pernyataan', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(45, 'SKKUASA', 'Surat Kuasa', 'Yang bertanda tangan di bawah ini...', 'KTP Pemberi & Penerima Kuasa, Materai 10000', 'aktif', '2026-02-18 15:59:57'),
(46, 'SKPERSETUJUANWARGA', 'Keterangan Persetujuan Warga', 'Yang bertanda tangan di bawah ini...', 'KTP Pemohon, Tanda Tangan Persetujuan Warga Sekitar', 'aktif', '2026-02-18 15:59:57'),
(47, 'SKLELANG', 'Keterangan untuk Keperluan Lelang', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Dokumen Barang yang Dilelang, Surat Pengantar RT/RW', 'aktif', '2026-02-18 15:59:57'),
(48, 'LEGAHLIWARIS', 'Legalisasi Pernyataan Ahli Waris', 'Yang bertanda tangan di bawah ini...', 'KTP Semua Ahli Waris, KK, Akta Kematian, Dokumen Pernyataan Ahli Waris, Materai 10000', 'aktif', '2026-02-18 16:02:32'),
(49, 'LEGTNIPOLRI', 'Legalisasi Persyaratan Pendaftaran TNI/POLRI', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Akta Kelahiran, Ijazah, Pas Foto 4x6', 'aktif', '2026-02-18 16:02:32'),
(50, 'LEGRELAAS', 'Legalisasi Relaas', 'Yang bertanda tangan di bawah ini...', 'KTP, Dokumen Relaas dari Pengadilan', 'aktif', '2026-02-18 16:02:32'),
(51, 'LEGMODELC', 'Legalisasi Model C Pensiunan', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Kartu Pensiun, Model C Pensiunan', 'aktif', '2026-02-18 16:02:32'),
(52, 'LEGHIBAH', 'Legalisasi Proposal Bantuan Hibah', 'Yang bertanda tangan di bawah ini...', 'KTP Ketua Lembaga, Proposal Bantuan Hibah, SK Pengurus Lembaga', 'aktif', '2026-02-18 16:02:32'),
(53, 'KONSULTASIWARIS', 'Konsultasi Waris, Pertanahan, dan Pencatatan Sipil', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Dokumen Terkait', 'aktif', '2026-02-18 16:02:32'),
(54, 'SKLURAHPENGURUS', 'SK Lurah Penetapan Pengurus RT/RW dan Lembaga Masyarakat', 'Yang bertanda tangan di bawah ini...', 'Berita Acara Pemilihan, Daftar Hadir, KTP Pengurus Terpilih', 'aktif', '2026-02-18 16:02:32'),
(55, 'PERMINTAANDATA', 'Permintaan Data Terkait Pemerintahan Kelurahan', 'Yang bertanda tangan di bawah ini...', 'KTP Pemohon, Surat Permohonan Resmi, Keterangan Keperluan Data', 'aktif', '2026-02-18 16:02:32'),
(56, 'MUSRENBANG', 'Penerimaan Usulan Musrenbang', 'Yang bertanda tangan di bawah ini...', 'Formulir Usulan Musrenbang, Berita Acara Musyawarah RT/RW', 'aktif', '2026-02-18 16:02:32'),
(57, 'PENGADUANMASY', 'Pengaduan Masyarakat', 'Yang bertanda tangan di bawah ini...', 'KTP Pelapor, Surat Pengaduan/Kronologi Kejadian', 'aktif', '2026-02-18 16:02:32'),
(58, 'PEMANTAUANBANTUAN', 'Pemantauan Pelaksanaan Pemberian Bantuan Pada Masyarakat', 'Yang bertanda tangan di bawah ini...', 'Data Penerima Bantuan, Formulir Pemantauan', 'aktif', '2026-02-18 16:02:32'),
(59, 'USULANBANTSOS', 'Usulan Data Penerima Bantuan Sosial Lansia Non Potensial', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Surat Pengantar RT/RW, Foto Kondisi Rumah', 'aktif', '2026-02-18 16:02:32'),
(60, 'SKPERMOHOANCERAI', 'Keterangan Permohonan Cerai', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Buku Nikah, Surat Pengantar RT/RW', 'aktif', '2026-02-18 16:02:32'),
(61, 'SKNOMORKESENIAN', 'Keterangan Pengajuan Nomor Induk Kesenian', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Profil Grup Kesenian, Surat Pengantar RT/RW', 'aktif', '2026-02-18 16:02:32'),
(62, 'SKPERSETUJUANLING', 'Keterangan Persyaratan Persetujuan Lingkungan', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Denah Lokasi, Tanda Tangan Persetujuan Warga, Surat Pengantar RT/RW', 'aktif', '2026-02-18 16:02:32'),
(63, 'SKANDALALIN', 'Keterangan Analisa Dampak Lalu Lintas', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Denah Lokasi, Surat Permohonan, Surat Pengantar RT/RW', 'aktif', '2026-02-18 16:02:32'),
(64, 'SKIPINJALANLAN', 'Keterangan Pengajuan Ijin Penutupan Jalan', 'Yang bertanda tangan di bawah ini...', 'KTP Pemohon, Surat Permohonan, Rencana Kegiatan, Persetujuan Warga Sekitar', 'aktif', '2026-02-18 16:02:32'),
(65, 'SKTUNJANGANANAK', 'Keterangan Persyaratan Tambahan Tunjangan Anak', 'Yang bertanda tangan di bawah ini...', 'KTP, KK, Akta Kelahiran Anak, Surat Keterangan Kerja, Surat Pengantar RT/RW', 'aktif', '2026-02-18 16:02:32');

-- --------------------------------------------------------

--
-- Table structure for table `kartu_keluarga`
--

CREATE TABLE `kartu_keluarga` (
  `id` int(11) NOT NULL,
  `no_kk` varchar(16) NOT NULL,
  `kepala_keluarga_id` int(11) DEFAULT NULL,
  `alamat` text DEFAULT NULL,
  `rt` varchar(3) DEFAULT NULL,
  `rw` varchar(3) DEFAULT NULL,
  `desa` varchar(100) DEFAULT NULL,
  `kecamatan` varchar(100) DEFAULT NULL,
  `kabupaten` varchar(100) DEFAULT NULL,
  `provinsi` varchar(100) DEFAULT NULL,
  `kode_pos` varchar(5) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `scan_kk` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `kartu_keluarga`
--

INSERT INTO `kartu_keluarga` (`id`, `no_kk`, `kepala_keluarga_id`, `alamat`, `rt`, `rw`, `desa`, `kecamatan`, `kabupaten`, `provinsi`, `kode_pos`, `created_at`, `updated_at`, `scan_kk`) VALUES
(391, '3201011234567890', 1086, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2026-04-11 10:20:36', '2026-04-24 11:49:37', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `kas_rt`
--

CREATE TABLE `kas_rt` (
  `id` int(11) NOT NULL,
  `tanggal` date NOT NULL,
  `jenis` enum('pemasukan','pengeluaran') NOT NULL,
  `kategori` varchar(50) NOT NULL,
  `master_kas_id` int(11) DEFAULT NULL COMMENT 'Referensi ke rekening/kas tujuan',
  `nominal` decimal(12,2) NOT NULL,
  `keterangan` text DEFAULT NULL,
  `bukti_dokumen` varchar(255) DEFAULT NULL,
  `input_oleh` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `kas_rt`
--

INSERT INTO `kas_rt` (`id`, `tanggal`, `jenis`, `kategori`, `master_kas_id`, `nominal`, `keterangan`, `bukti_dokumen`, `input_oleh`, `created_at`) VALUES
(208, '2026-04-28', 'pemasukan', 'Sumbangan', 3, 50000.00, '', NULL, 1, '2026-04-28 08:52:17'),
(209, '2026-04-28', 'pemasukan', 'Saldo Awal', 10, 500000.00, 'Saldo awal untuk kas ABCD', NULL, 1, '2026-04-28 08:51:54');

-- --------------------------------------------------------

--
-- Table structure for table `kegiatan`
--

CREATE TABLE `kegiatan` (
  `id` int(11) NOT NULL,
  `judul` varchar(200) NOT NULL,
  `slug` varchar(250) DEFAULT NULL,
  `isi` longtext NOT NULL,
  `kategori` enum('sosial','olahraga','kebersihan','keagamaan','pendidikan','kesehatan','budaya','lainnya') NOT NULL DEFAULT 'lainnya',
  `lokasi` varchar(200) DEFAULT NULL,
  `tanggal_mulai` date NOT NULL,
  `tanggal_selesai` date DEFAULT NULL,
  `thumbnail` varchar(255) DEFAULT NULL,
  `status` enum('draft','publish') NOT NULL DEFAULT 'draft',
  `dibuat_oleh` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `kegiatan_galeri`
--

CREATE TABLE `kegiatan_galeri` (
  `id` int(11) NOT NULL,
  `kegiatan_id` int(11) NOT NULL,
  `nama_file` varchar(255) NOT NULL,
  `keterangan` varchar(300) DEFAULT NULL,
  `urutan` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `kegiatan_rt`
--

CREATE TABLE `kegiatan_rt` (
  `id` int(11) NOT NULL,
  `tanggal` date NOT NULL,
  `judul` varchar(150) NOT NULL,
  `deskripsi` text DEFAULT NULL,
  `waktu_mulai` time DEFAULT NULL,
  `tempat` varchar(200) DEFAULT NULL,
  `untuk_semua` tinyint(1) DEFAULT 1,
  `created_by` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `kegiatan_rt`
--

INSERT INTO `kegiatan_rt` (`id`, `tanggal`, `judul`, `deskripsi`, `waktu_mulai`, `tempat`, `untuk_semua`, `created_by`, `created_at`) VALUES
(1, '2026-03-27', 'Rapat', 'sdadsa', '23:26:00', 'Masjid', 1, 1, '2026-03-03 23:26:42'),
(3, '2026-04-01', 'Halal bihalal', 'Jang lupa', '09:37:00', 'Balai RT', 1, 1, '2026-03-03 23:37:23');

-- --------------------------------------------------------

--
-- Table structure for table `log_aktivitas`
--

CREATE TABLE `log_aktivitas` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `aktivitas` text NOT NULL,
  `tipe` varchar(50) DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `log_aktivitas`
--

INSERT INTO `log_aktivitas` (`id`, `user_id`, `aktivitas`, `tipe`, `ip_address`, `user_agent`, `created_at`) VALUES
(478, 1, 'Membersihkan seluruh log aktivitas sistem', 'delete', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 03:37:53'),
(479, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:46:24'),
(480, 1, 'Upload scan KK: 3201011234567890', 'update', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:49:28'),
(481, 1, 'Menghapus dokumen KK: 3201011234567890', 'delete', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:49:37'),
(482, 1, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:54:30'),
(483, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:54:59'),
(484, 1, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:55:17'),
(485, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:55:31'),
(486, 1, 'Mereset password user: agus menjadi default (NIK)', 'reset_password', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:55:42'),
(487, 1, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:55:46'),
(488, 664, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:55:51'),
(489, 664, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:56:00'),
(490, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:56:05'),
(491, 1, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:56:37'),
(492, NULL, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:56:45'),
(493, NULL, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:56:47'),
(494, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:56:53'),
(495, 1, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:57:54'),
(496, 664, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 04:57:59'),
(497, 664, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 05:01:59'),
(498, 664, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 05:02:04'),
(499, 664, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 05:04:53'),
(500, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 05:09:29'),
(501, 1, 'Mengubah data anggota keluarga: agus di KK No: 3201011234567890', 'update', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 05:10:00'),
(502, 1, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 05:13:54'),
(503, 664, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 05:13:58'),
(504, 664, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 05:14:27'),
(505, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 05:14:33'),
(506, 1, 'Mengubah data anggota keluarga: agus di KK No: 3201011234567890', 'update', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 05:55:15'),
(507, 1, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 07:47:26'),
(508, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 07:56:03'),
(509, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 08:16:26'),
(510, 1, 'Menghapus Kartu Keluarga No: 1231313213213213', 'delete', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 08:47:06'),
(511, 1, 'Menghapus anggota keluarga: Siti Rahayu dari KK No: 3201011234567890', 'delete', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 08:47:13'),
(512, 1, 'Menghapus anggota keluarga: Andi Pratama dari KK No: 3201011234567890', 'delete', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 08:47:15'),
(513, 1, 'Menghapus anggota keluarga: Ardian Beni dari KK No: 3201011234567890', 'delete', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 08:47:18'),
(514, 1, 'Mengubah data anggota keluarga: Budi Santoso di KK No: 3201011234567890', 'update', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 08:47:26'),
(515, 1, 'Menambah pemasukan kas: Rp 10.000 (Iuran Warga)', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-24 08:57:15'),
(516, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 11:09:13'),
(517, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 11:12:52'),
(518, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 11:13:56'),
(519, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 11:52:11'),
(520, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 11:56:31'),
(521, 1, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 11:58:31'),
(522, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 11:58:40'),
(523, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 13:33:48'),
(524, 1, 'Mengubah data anggota keluarga: agus di KK No: 3201011234567890', 'update', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 13:37:02'),
(525, 1, 'Edit master pekerjaan: Ibu Rumah Tangga', 'update', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 13:49:24'),
(526, 1, 'Edit master pekerjaan: Pelajar / Mahasiswa', 'update', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 13:49:36'),
(527, 1, 'Generate massal iuran (ID Jenis: 1): Berhasil 2, Gagal 1', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 13:58:57'),
(528, 1, 'Generate massal iuran (ID Jenis: 2): Berhasil 3, Gagal 0', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 13:59:37'),
(529, 1, 'Generate massal iuran range periode: Berhasil 3, Gagal 0', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:08:45'),
(530, 1, 'Generate massal iuran range periode: Berhasil 1, Gagal 0', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:11:24'),
(531, 1, 'Generate massal iuran range periode: Berhasil 4, Gagal 0', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:11:44'),
(532, 1, 'Generate massal iuran range periode: Berhasil 4, Gagal 0', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:12:17'),
(533, 1, 'Membuat akun otomatis untuk warga: Achmad Deni ', 'buat_akun', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:12:47'),
(534, 1, 'Ubah role \'1212212121212222\' dari \'warga\' jadi \'warga\'', 'ubah_role', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:13:34'),
(535, 1, 'Menambah pemasukan kas: Rp 1.000.000 (Sumbangan)', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:19:23'),
(536, 1, 'Menghapus Jenis Iuran: sdadsa', 'delete', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:20:21'),
(537, 1, 'Menghapus Jenis Iuran: IPLdasd', 'delete', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:20:25'),
(538, 1, 'Generate massal iuran range periode: Berhasil 4, Gagal 0', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:21:58'),
(539, 1, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:44:56'),
(540, 664, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:45:03'),
(541, 664, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:47:30'),
(542, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:47:36'),
(543, 1, 'Generate massal iuran range periode: Berhasil 1, Gagal 0', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-25 14:51:20'),
(544, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-26 02:52:30'),
(545, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-27 13:02:43'),
(546, 1, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-27 15:19:39'),
(547, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-27 15:19:44'),
(548, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 05:35:10'),
(549, 1, 'User logout dari sistem', 'logout', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 06:07:41'),
(550, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 06:07:52'),
(551, 1, 'Menambah pemasukan kas: Rp 100.000 (Sumbangan)', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 06:31:27'),
(552, 1, 'Mengubah data Master Kas: Kas Tunai RT (TUNAI)', 'update', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 06:38:34'),
(553, 1, 'Mengubah data Master Kas: Rekening BRI (BRI)', 'update', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 06:39:06'),
(554, 1, 'Mengubah data Master Kas: Kas Tabungan Warga (TAB-BRI)', 'update', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 06:44:27'),
(555, 1, 'Menambah pemasukan kas: Rp 55.810.000 (Lainnya)', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 07:32:06'),
(556, 1, 'User login ke sistem', 'login', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 08:27:27'),
(557, 1, 'Mengubah transaksi pemasukan: Rp 6.581.000 (Lainnya)', 'update', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 08:27:43'),
(558, 1, 'Menghapus transaksi pemasukan: Rp 6.581.000 (Lainnya)', 'delete', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 08:50:09'),
(559, 1, 'Menghapus Master Kas: Kas Tabungan Warga', 'delete', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 08:51:27'),
(560, 1, 'Menghapus Master Kas: Kas Tunai RT', 'delete', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 08:51:29'),
(561, 1, 'Menghapus Master Kas: Rekening BRI', 'delete', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 08:51:31'),
(562, 1, 'Menambah Master Kas baru: ABCD (SDSAD)', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 08:51:54'),
(563, 1, 'Menambah pemasukan kas: Rp 50.000 (Sumbangan)', 'create', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36', '2026-04-28 08:52:17');

-- --------------------------------------------------------

--
-- Table structure for table `master_jabatan`
--

CREATE TABLE `master_jabatan` (
  `id` int(11) NOT NULL,
  `nama_jabatan` varchar(100) NOT NULL,
  `kategori` enum('pengurus','seksi') DEFAULT 'pengurus',
  `urutan` int(11) DEFAULT 0,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `master_jabatan`
--

INSERT INTO `master_jabatan` (`id`, `nama_jabatan`, `kategori`, `urutan`, `created_at`) VALUES
(1, 'Ketua RT', 'pengurus', 1, '2026-04-25 21:34:33'),
(2, 'Sekretaris', 'pengurus', 2, '2026-04-25 21:34:33'),
(3, 'Bendahara', 'pengurus', 3, '2026-04-25 21:34:33'),
(4, 'Seksi Keamanan', 'seksi', 4, '2026-04-25 21:34:33'),
(5, 'Seksi Kebersihan', 'seksi', 5, '2026-04-25 21:34:33'),
(6, 'Seksi Kerohanian', 'seksi', 6, '2026-04-25 21:34:33'),
(7, 'Wakil RT', 'pengurus', 2, '2026-04-25 21:42:12');

-- --------------------------------------------------------

--
-- Table structure for table `master_kas`
--

CREATE TABLE `master_kas` (
  `id` int(11) NOT NULL,
  `kode` varchar(20) NOT NULL COMMENT 'Kode unik kas, contoh: BRI, TUNAI, BCA',
  `nama` varchar(100) NOT NULL COMMENT 'Nama lengkap rekening/kas',
  `jenis` enum('bank','tunai','ewallet') NOT NULL DEFAULT 'tunai' COMMENT 'Jenis: bank=rekening bank, tunai=uang tunai, ewallet=dompet digital',
  `is_tabungan` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1 = kas penampung tabungan warga, 0 = kas operasional RT',
  `nomor_rekening` varchar(50) DEFAULT NULL COMMENT 'Nomor rekening (opsional untuk tunai)',
  `atas_nama` varchar(100) DEFAULT NULL COMMENT 'Nama pemilik rekening',
  `saldo_awal` decimal(15,2) NOT NULL DEFAULT 0.00 COMMENT 'Saldo awal saat rekening dibuat',
  `saldo_saat_ini` decimal(15,2) NOT NULL DEFAULT 0.00 COMMENT 'Saldo terkini (dihitung otomatis)',
  `warna` varchar(20) DEFAULT '#6c757d' COMMENT 'Warna badge di tampilan (hex color)',
  `icon` varchar(50) DEFAULT 'bi-wallet2' COMMENT 'Bootstrap icon class',
  `status` enum('aktif','nonaktif') NOT NULL DEFAULT 'aktif',
  `keterangan` text DEFAULT NULL,
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `master_kas`
--

INSERT INTO `master_kas` (`id`, `kode`, `nama`, `jenis`, `is_tabungan`, `nomor_rekening`, `atas_nama`, `saldo_awal`, `saldo_saat_ini`, `warna`, `icon`, `status`, `keterangan`, `created_by`, `created_at`, `updated_at`) VALUES
(3, 'BCA', 'Rekening BCA', 'bank', 0, '0987-6543-2100', 'RT 01 RW 05', 0.00, 50000.00, '#0d6efd', 'bi-bank', 'aktif', 'Bank Central Asia', NULL, '2026-02-17 03:53:50', '2026-04-28 08:52:17'),
(4, 'MANDIRI', 'Rekening Mandiri', 'bank', 0, '1111-2222-3333', 'RT 01 RW 05', 0.00, 0.00, '#0d6efd', 'bi-bank', 'aktif', 'Bank Mandiri', NULL, '2026-02-17 03:53:50', '2026-02-17 14:23:11'),
(6, 'DANA', 'DANA', 'ewallet', 0, '0812-XXXX-XXXX', 'Bendahara RT', 0.00, 0.00, '#0dcaf0', 'bi-phone-fill', 'aktif', 'Dompet digital DANA', NULL, '2026-02-17 03:53:50', '2026-04-24 13:16:04'),
(7, 'OVO', 'OVO', 'ewallet', 0, '0813-XXXX-XXXX', 'Bendahara RT', 0.00, 0.00, '#6f42c1', 'bi-phone-fill', 'nonaktif', 'Dompet digital OVO', NULL, '2026-02-17 03:53:50', '2026-02-17 03:53:50'),
(8, 'GOPAY', 'GoPay', 'ewallet', 0, '0814-XXXX-XXXX', 'Bendahara RT', 0.00, 0.00, '#198754', 'bi-phone-fill', 'nonaktif', 'Dompet digital GoPay', NULL, '2026-02-17 03:53:50', '2026-02-17 03:53:50'),
(10, 'SDSAD', 'ABCD', 'tunai', 0, '', '', 500000.00, 500000.00, '#0d6efd', 'bi-wallet2', 'aktif', '', 1, '2026-04-28 08:51:54', '2026-04-28 08:51:54');

-- --------------------------------------------------------

--
-- Table structure for table `master_pekerjaan`
--

CREATE TABLE `master_pekerjaan` (
  `id` int(11) NOT NULL,
  `nama` varchar(100) NOT NULL,
  `urutan` int(11) DEFAULT 0,
  `status` tinyint(1) DEFAULT 1,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `master_pekerjaan`
--

INSERT INTO `master_pekerjaan` (`id`, `nama`, `urutan`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Ibu Rumah Tangga', 3, 1, '2026-04-25 20:26:05', '2026-04-25 20:49:24'),
(2, 'Asisten Rumah Tangga', 2, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(3, 'Pelajar / Mahasiswa', 1, 1, '2026-04-25 20:26:05', '2026-04-25 20:49:36'),
(4, 'Anggota DPR-RI/DPR/DPD', 4, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(5, 'PNS/ASN', 5, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(6, 'Pegawai BUMD/BUMN', 6, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(7, 'Karyawan Honorer', 7, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(8, 'Karyawan Swasta', 8, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(9, 'Wirausaha', 9, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(10, 'Pensiunan', 10, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(11, 'Dokter', 11, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(12, 'Bidan', 12, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(13, 'Perawat', 13, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(14, 'Dosen', 14, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(15, 'Guru', 15, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(16, 'Polri', 16, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(17, 'TNI', 17, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(18, 'Driver/Sopir', 18, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(19, 'Tidak Bekerja', 19, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05');

-- --------------------------------------------------------

--
-- Table structure for table `master_pendidikan`
--

CREATE TABLE `master_pendidikan` (
  `id` int(11) NOT NULL,
  `nama` varchar(100) NOT NULL,
  `urutan` int(11) DEFAULT 0,
  `status` tinyint(1) DEFAULT 1,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `master_pendidikan`
--

INSERT INTO `master_pendidikan` (`id`, `nama`, `urutan`, `status`, `created_at`, `updated_at`) VALUES
(1, 'Belum Sekolah', 1, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(2, 'PAUD/TK', 2, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(3, 'SD', 3, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(4, 'SMP Sederajat', 4, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(5, 'SMA/SMK Sederajat', 5, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(6, 'D1', 6, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(7, 'D2', 7, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(8, 'D3', 8, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(9, 'D4/S1 Sederajat', 9, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(10, 'S2', 10, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(11, 'S3', 11, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05'),
(12, 'Tidak Sekolah', 12, 1, '2026-04-25 20:26:05', '2026-04-25 20:26:05');

-- --------------------------------------------------------

--
-- Table structure for table `menu_modules`
--

CREATE TABLE `menu_modules` (
  `id` int(11) NOT NULL,
  `parent_id` int(11) DEFAULT NULL COMMENT 'NULL = top-level, isi ID = submenu',
  `slug` varchar(80) NOT NULL COMMENT 'Cocok dengan segment URI CI (e.g. warga, kartu-keluarga)',
  `label` varchar(100) NOT NULL COMMENT 'Teks yang muncul di sidebar',
  `icon` varchar(60) NOT NULL DEFAULT 'bi bi-circle' COMMENT 'Bootstrap Icons class',
  `url` varchar(200) NOT NULL DEFAULT '' COMMENT 'base_url path e.g. warga/pemilih',
  `sort_order` smallint(5) NOT NULL DEFAULT 0,
  `is_active` tinyint(1) NOT NULL DEFAULT 1 COMMENT '0=disembunyikan dari semua role',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Daftar semua menu/modul sistem';

--
-- Dumping data for table `menu_modules`
--

INSERT INTO `menu_modules` (`id`, `parent_id`, `slug`, `label`, `icon`, `url`, `sort_order`, `is_active`, `created_at`, `updated_at`) VALUES
(1, NULL, 'dashboard', 'Dashboard', 'bi bi-speedometer2', 'dashboard', 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:53:29'),
(2, NULL, 'grp-kependudukan', 'Kependudukan', 'bi bi-people-fill', '', 2, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(3, NULL, 'grp-keuangan', 'Keuangan', 'bi bi-cash-stack', '', 3, 1, '2026-04-12 05:24:32', '2026-04-12 05:52:08'),
(4, NULL, 'grp-inventaris', 'Inventaris', 'bi bi-box-seam', '', 4, 1, '2026-04-12 05:24:32', '2026-04-11 22:37:35'),
(5, NULL, 'grp-layanan', 'Layanan Warga', 'bi bi-shop-window', '', 5, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(6, NULL, 'grp-kegiatan', 'Kegiatan & Info', 'bi bi-calendar3', '', 6, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(7, NULL, 'grp-aspirasi', 'Aspirasi & Partisipasi', 'bi bi-chat-dots-fill', '', 7, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(8, NULL, 'grp-pengaturan', 'Pengaturan', 'bi bi-gear-fill', '', 8, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(9, NULL, 'grp-master', 'Data Master', 'bi bi-database-fill-gear', '', 9, 1, '2026-04-25 13:46:21', '2026-04-25 13:46:21'),
(10, 2, 'warga', 'Data Warga', 'bi bi-people', 'warga', 1, 1, '2026-04-12 05:24:32', '2026-04-12 06:07:47'),
(11, 2, 'kartu-keluarga', 'Kartu Keluarga', 'bi bi-house-door', 'kartu-keluarga', 2, 1, '2026-04-12 05:24:32', '2026-04-12 06:07:48'),
(12, 2, 'warga/pemilih', 'Pemilih Pemilu', 'bi bi-person-vcard', 'warga/pemilih', 3, 1, '2026-04-12 05:24:32', '2026-04-11 23:08:27'),
(20, 3, 'iuran', 'Iuran Warga', 'bi bi-receipt', 'iuran', 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(21, 3, 'kas', 'Kas RT', 'bi bi-bank', 'kas', 2, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(22, 3, 'tabungan', 'Tabungan', 'bi bi-wallet2', 'tabungan', 3, 1, '2026-04-12 05:24:32', '2026-04-12 05:53:47'),
(23, 3, 'pinjaman', 'Pinjaman', 'bi bi-cash-coin', 'pinjaman', 4, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(24, 3, 'arisan', 'Arisan RT', 'bi bi-gift-fill', 'arisan', 5, 1, '2026-04-12 05:24:32', '2026-04-12 05:53:47'),
(30, 4, 'inventaris', 'Data Barang', 'bi bi-grid-3x3-gap', 'inventaris', 1, 1, '2026-04-12 05:24:32', '2026-04-11 22:37:36'),
(31, 4, 'peminjaman-inventaris', 'Peminjaman', 'bi bi-arrow-left-right', 'peminjaman-inventaris', 2, 1, '2026-04-12 05:24:32', '2026-04-11 22:37:37'),
(40, 5, 'umkm', 'UMKM', 'bi bi-shop', 'umkm', 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(41, 5, 'bansos', 'Bantuan Sosial', 'bi bi-heart-pulse-fill', 'bansos', 2, 1, '2026-04-12 05:24:32', '2026-04-12 05:53:53'),
(42, 5, 'tamu', 'E-Visitor', 'bi bi-person-badge-fill', 'tamu', 3, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(43, 5, 'surat', 'Surat Menyurat', 'bi bi-file-text-fill', 'surat', 4, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(50, 6, 'pengumuman', 'Pengumuman', 'bi bi-megaphone-fill', 'pengumuman', 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(51, 6, 'kalender', 'Kalender', 'bi bi-calendar3', 'kalender', 2, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(52, 6, 'jadwal', 'Jadwal Kegiatan', 'bi bi-calendar-check', 'jadwal', 3, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(53, 6, 'kegiatan', 'Kegiatan RT', 'bi bi-calendar-event-fill', 'kegiatan', 4, 1, '2026-04-12 05:24:32', '2026-04-12 05:53:57'),
(54, 6, 'notulen', 'Notulen Rapat', 'bi bi-journal-text', 'notulen', 5, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(55, 6, 'struktur-rt', 'Struktur RT', 'bi bi-diagram-3-fill', 'struktur-rt', 6, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(56, 6, 'video', 'Video', 'bi bi-camera-video-fill', 'video', 7, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(57, 6, 'berita', 'Berita', 'bi bi-newspaper', 'berita', 8, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(60, 7, 'saran', 'Saran & Kritik', 'bi bi-chat-dots-fill', 'saran', 0, 0, '2026-04-12 05:24:32', '2026-04-20 02:26:51'),
(61, 7, 'pengaduan', 'Pengaduan', 'bi bi-exclamation-circle-fill', 'pengaduan', 2, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(62, 7, 'polling', 'Polling Warga', 'bi bi-bar-chart-fill', 'polling', 3, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(70, 8, 'profil', 'Profil Saya', 'bi bi-person-circle', 'profil', 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(71, 8, 'pengaturan', 'Umum', 'bi bi-sliders', 'pengaturan', 2, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(72, 8, 'reset', 'Reset Data', 'bi bi-exclamation-triangle-fill', 'reset', 4, 1, '2026-04-12 05:24:32', '2026-04-24 10:13:42'),
(74, 8, 'log-activity', 'Log Aktivitas', 'bi bi-clock-history', 'log-activity', 3, 1, '2026-04-24 10:13:31', '2026-04-24 10:13:31'),
(75, 9, 'master-pendidikan', 'Master Pendidikan', 'bi bi-mortarboard-fill', 'master-pendidikan', 1, 1, '2026-04-25 13:42:18', '2026-04-25 13:46:21'),
(76, 9, 'master-pekerjaan', 'Master Pekerjaan', 'bi bi-briefcase-fill', 'master-pekerjaan', 2, 1, '2026-04-25 13:42:18', '2026-04-25 13:46:21');

-- --------------------------------------------------------

--
-- Table structure for table `menu_permissions`
--

CREATE TABLE `menu_permissions` (
  `id` int(11) NOT NULL,
  `module_id` int(11) NOT NULL,
  `role` enum('admin','ketua_rt','sekretaris','bendahara','warga') NOT NULL,
  `can_view` tinyint(1) NOT NULL DEFAULT 0,
  `can_create` tinyint(1) NOT NULL DEFAULT 0,
  `can_edit` tinyint(1) NOT NULL DEFAULT 0,
  `can_delete` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Hak akses per role per modul';

--
-- Dumping data for table `menu_permissions`
--

INSERT INTO `menu_permissions` (`id`, `module_id`, `role`, `can_view`, `can_create`, `can_edit`, `can_delete`, `created_at`, `updated_at`) VALUES
(1, 1, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 06:00:47'),
(2, 2, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 06:00:47'),
(3, 3, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-11 23:33:32'),
(4, 4, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(5, 5, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(6, 6, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(7, 7, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(8, 8, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(9, 10, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 06:08:31'),
(10, 11, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 06:11:45'),
(11, 12, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(12, 20, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-11 23:34:43'),
(13, 21, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(14, 22, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(15, 23, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 06:14:13'),
(16, 24, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(17, 30, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(18, 31, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(19, 40, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(20, 41, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(21, 42, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(22, 43, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(23, 50, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(24, 51, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(25, 52, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(26, 53, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(27, 54, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(28, 55, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(29, 56, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(30, 57, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(31, 60, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(32, 61, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(33, 62, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(34, 70, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(35, 71, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(36, 72, 'admin', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(64, 24, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(65, 41, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(66, 57, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(67, 1, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(68, 7, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(69, 4, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(70, 6, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(71, 2, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(72, 3, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(73, 5, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(74, 8, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(75, 30, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(76, 20, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(77, 52, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(78, 51, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(79, 11, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(80, 21, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(81, 53, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(82, 54, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(83, 31, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(84, 61, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(85, 71, 'ketua_rt', 1, 0, 0, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(86, 50, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(87, 23, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(88, 62, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(89, 70, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(90, 72, 'ketua_rt', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(91, 60, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(92, 55, 'ketua_rt', 1, 1, 1, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(93, 43, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(94, 22, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(95, 42, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(96, 40, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(97, 56, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(98, 10, 'ketua_rt', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(99, 12, 'ketua_rt', 1, 1, 1, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(127, 24, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(128, 41, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(129, 57, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(130, 1, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(131, 7, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(132, 4, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(133, 6, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(134, 2, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(135, 3, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(136, 5, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(137, 8, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(138, 30, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(139, 20, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(140, 52, 'sekretaris', 1, 1, 1, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(141, 51, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(142, 11, 'sekretaris', 1, 1, 1, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(143, 21, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(144, 53, 'sekretaris', 1, 1, 1, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(145, 54, 'sekretaris', 1, 1, 1, 0, '2026-04-12 05:24:32', '2026-04-11 22:39:29'),
(146, 31, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(147, 61, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(148, 71, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(149, 50, 'sekretaris', 1, 1, 1, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(150, 23, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(151, 62, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(152, 70, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(153, 72, 'sekretaris', 0, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(154, 60, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(155, 55, 'sekretaris', 1, 1, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(156, 43, 'sekretaris', 1, 1, 1, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(157, 22, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(158, 42, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(159, 40, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(160, 56, 'sekretaris', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(161, 10, 'sekretaris', 1, 1, 1, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(162, 12, 'sekretaris', 1, 1, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(190, 24, 'bendahara', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(191, 41, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(192, 57, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(193, 1, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(194, 7, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(195, 4, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(196, 6, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(197, 2, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(198, 3, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(199, 5, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(200, 8, 'bendahara', 0, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(201, 30, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(202, 20, 'bendahara', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(203, 52, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(204, 51, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(205, 11, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(206, 21, 'bendahara', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(207, 53, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(208, 54, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(209, 31, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(210, 61, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(211, 71, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(212, 50, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(213, 23, 'bendahara', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(214, 62, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(215, 70, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(216, 72, 'bendahara', 0, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(217, 60, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(218, 55, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(219, 43, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(220, 22, 'bendahara', 1, 1, 1, 1, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(221, 42, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(222, 40, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(223, 56, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(224, 10, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(225, 12, 'bendahara', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(253, 24, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(254, 41, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(255, 57, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(256, 1, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(257, 7, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(258, 4, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(259, 6, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(260, 2, 'warga', 0, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(261, 3, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(262, 5, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(263, 8, 'warga', 0, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(264, 30, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(265, 20, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(266, 52, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(267, 51, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(268, 11, 'warga', 0, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(269, 21, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(270, 53, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(271, 54, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(272, 31, 'warga', 1, 1, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(273, 61, 'warga', 1, 1, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(274, 71, 'warga', 0, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(275, 50, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(276, 23, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(277, 62, 'warga', 1, 1, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(278, 70, 'warga', 1, 1, 1, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(279, 72, 'warga', 0, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(280, 60, 'warga', 1, 1, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(281, 55, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(282, 43, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(283, 22, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(284, 42, 'warga', 1, 1, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(285, 40, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(286, 56, 'warga', 1, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(287, 10, 'warga', 0, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(288, 12, 'warga', 0, 0, 0, 0, '2026-04-12 05:24:32', '2026-04-12 05:24:32'),
(321, 74, 'admin', 1, 1, 1, 1, '2026-04-24 10:13:31', '2026-04-24 10:13:31'),
(322, 75, 'admin', 1, 1, 1, 1, '2026-04-25 13:42:54', '2026-04-25 13:42:54'),
(323, 76, 'admin', 1, 1, 1, 1, '2026-04-25 13:42:54', '2026-04-25 13:42:54');

-- --------------------------------------------------------

--
-- Table structure for table `notulen_peserta`
--

CREATE TABLE `notulen_peserta` (
  `id` int(11) UNSIGNED NOT NULL,
  `notulen_id` int(11) UNSIGNED NOT NULL,
  `nama` varchar(100) NOT NULL,
  `jabatan` varchar(100) DEFAULT NULL,
  `kehadiran` enum('hadir','tidak','izin') NOT NULL DEFAULT 'hadir',
  `urutan` tinyint(4) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `notulen_peserta`
--

INSERT INTO `notulen_peserta` (`id`, `notulen_id`, `nama`, `jabatan`, `kehadiran`, `urutan`) VALUES
(1, 1, 'Bapak Suharto', 'Ketua RT', 'hadir', 1),
(2, 1, 'Bapak Agus', 'Sekretaris', 'hadir', 2),
(3, 1, 'Ibu Dewi', 'Bendahara', 'hadir', 3),
(4, 1, 'Bapak Rudi', 'Warga', 'hadir', 4),
(5, 1, 'Ibu Sari', 'Warga', 'tidak', 5);

-- --------------------------------------------------------

--
-- Table structure for table `notulen_poin`
--

CREATE TABLE `notulen_poin` (
  `id` int(11) UNSIGNED NOT NULL,
  `notulen_id` int(11) UNSIGNED NOT NULL,
  `teks` text NOT NULL,
  `prioritas` enum('tinggi','sedang','rendah') NOT NULL DEFAULT 'sedang',
  `urutan` tinyint(4) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `notulen_poin`
--

INSERT INTO `notulen_poin` (`id`, `notulen_id`, `teks`, `prioritas`, `urutan`) VALUES
(1, 1, 'Evaluasi jadwal ronda malam bulan lalu', 'tinggi', 1),
(2, 1, 'Penambahan CCTV di ujung gang utama', 'tinggi', 2),
(3, 1, 'Koordinasi dengan Linmas kelurahan', 'sedang', 3),
(4, 1, 'Anggaran operasional pos ronda', 'sedang', 4),
(14, 6, 'asdsadsa', 'sedang', 1);

-- --------------------------------------------------------

--
-- Table structure for table `notulen_rapat`
--

CREATE TABLE `notulen_rapat` (
  `id` int(11) UNSIGNED NOT NULL,
  `judul_rapat` varchar(255) NOT NULL,
  `tanggal` date NOT NULL,
  `waktu_mulai` time DEFAULT NULL,
  `waktu_selesai` time DEFAULT NULL,
  `tempat` varchar(150) DEFAULT NULL,
  `tim` varchar(100) NOT NULL DEFAULT 'Umum',
  `moderator` varchar(100) NOT NULL,
  `notulis` varchar(100) NOT NULL,
  `catatan` text DEFAULT NULL,
  `status` enum('draft','menunggu','final') NOT NULL DEFAULT 'draft',
  `created_by` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `notulen_rapat`
--

INSERT INTO `notulen_rapat` (`id`, `judul_rapat`, `tanggal`, `waktu_mulai`, `waktu_selesai`, `tempat`, `tim`, `moderator`, `notulis`, `catatan`, `status`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'Rapat Evaluasi Keamanan Lingkungan RT 05', '2025-07-15', '19:30:00', '21:00:00', 'Balai Warga RT 05', 'Keamanan', 'Bapak Suharto', 'Ibu Dewi', 'Disepakati penambahan 2 titik pos ronda baru dan rotasi jadwal piket ronda setiap 2 minggu.', 'final', 1, '2026-03-04 11:20:28', '2026-03-04 11:20:28'),
(2, 'Rapat Persiapan Kerja Bakti HUT RI', '2025-07-10', '08:00:00', '09:30:00', 'Zoom Meeting', 'Kebersihan', 'Ibu Wulandari', 'Bapak Dani', 'Kerja bakti akan dilaksanakan 10 Agustus 2025 pukul 06.00 WIB.', 'final', 1, '2026-03-04 11:20:28', '2026-03-04 11:20:28'),
(3, 'Rapat Koordinasi Dana Sosial RT', '2025-07-05', '19:00:00', '20:30:00', 'Rumah Ketua RT', 'Sosial', 'Bapak Suharto', 'Ibu Dewi', 'Menunggu tanda tangan ketua RW untuk pengesahan penggunaan dana sosial.', 'final', 1, '2026-03-04 11:20:28', '2026-03-04 04:38:42'),
(6, 'asdsad', '2026-04-05', '19:07:00', '00:07:00', 'Balai Warga RT', 'Keamanan', 'asdasd', 'asdasd', 'asdasdsa', 'draft', 1, '2026-04-05 12:07:18', '2026-04-05 12:07:18');

-- --------------------------------------------------------

--
-- Table structure for table `pembayaran_iuran`
--

CREATE TABLE `pembayaran_iuran` (
  `id` int(11) NOT NULL,
  `warga_id` int(11) NOT NULL,
  `jenis_iuran_id` int(11) NOT NULL,
  `periode_bulan` int(11) DEFAULT NULL,
  `periode_tahun` int(11) DEFAULT NULL,
  `tanggal_jatuh_tempo` date DEFAULT NULL,
  `nominal` decimal(12,2) NOT NULL,
  `tanggal_bayar` date DEFAULT NULL,
  `metode_pembayaran` enum('tunai','transfer') DEFAULT 'tunai',
  `master_kas_id` int(11) DEFAULT NULL COMMENT 'Kas tujuan pembayaran iuran',
  `keterangan` text DEFAULT NULL,
  `bukti_transfer` varchar(255) DEFAULT NULL,
  `status` enum('pending','menunggu_verifikasi','cicil','lunas') NOT NULL DEFAULT 'pending',
  `tipe_bayar` enum('lunas','cicil') DEFAULT 'lunas',
  `total_terbayar` decimal(15,0) DEFAULT 0,
  `sisa_tagihan` decimal(15,0) DEFAULT 0,
  `jumlah_cicilan` tinyint(3) DEFAULT 0,
  `diverifikasi_oleh` int(11) DEFAULT NULL,
  `tanggal_verifikasi` datetime DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `pembayaran_pending`
--

CREATE TABLE `pembayaran_pending` (
  `id` int(11) UNSIGNED NOT NULL,
  `angsuran_id` int(11) NOT NULL,
  `warga_id` int(11) NOT NULL,
  `nominal_bayar` decimal(15,2) NOT NULL,
  `denda` decimal(15,2) DEFAULT 0.00,
  `total_bayar` decimal(15,2) NOT NULL,
  `metode` varchar(50) DEFAULT 'transfer',
  `bukti_transfer` varchar(255) DEFAULT NULL,
  `keterangan` text DEFAULT NULL,
  `status` enum('pending','verified','rejected') DEFAULT 'pending',
  `master_kas_id` int(11) DEFAULT NULL,
  `verified_by` int(11) DEFAULT NULL,
  `verified_at` datetime DEFAULT NULL,
  `alasan_reject` text DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `peminjaman_inventaris`
--

CREATE TABLE `peminjaman_inventaris` (
  `id` int(11) NOT NULL,
  `kode_pinjam` varchar(20) NOT NULL COMMENT 'e.g. PJM-20240001',
  `inventaris_id` int(11) NOT NULL,
  `warga_id` int(11) DEFAULT NULL,
  `nama_peminjam` varchar(100) NOT NULL,
  `no_hp_peminjam` varchar(20) DEFAULT NULL,
  `jumlah_pinjam` int(11) NOT NULL DEFAULT 1,
  `tanggal_pinjam` date NOT NULL,
  `tanggal_rencana_kembali` date NOT NULL,
  `tanggal_kembali` date DEFAULT NULL,
  `kondisi_awal` enum('baik','rusak_ringan','rusak_berat') NOT NULL DEFAULT 'baik',
  `kondisi_kembali` enum('baik','rusak_ringan','rusak_berat') DEFAULT NULL,
  `status` enum('dipinjam','dikembalikan','terlambat') NOT NULL DEFAULT 'dipinjam',
  `keperluan` text DEFAULT NULL,
  `catatan_kembali` text DEFAULT NULL,
  `approved_by` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `pengaduan`
--

CREATE TABLE `pengaduan` (
  `id` int(11) NOT NULL,
  `kode_tiket` varchar(20) DEFAULT NULL,
  `user_id` int(11) NOT NULL,
  `judul` varchar(200) NOT NULL,
  `kategori` enum('saran','kritik','pengaduan','permintaan') DEFAULT 'pengaduan',
  `isi` text NOT NULL,
  `lampiran` varchar(255) DEFAULT NULL,
  `status` enum('baru','diproses','selesai','ditolak') DEFAULT 'baru',
  `privasi` enum('publik','privat') DEFAULT 'privat',
  `dibalas_oleh` int(11) DEFAULT NULL,
  `balasan` text DEFAULT NULL,
  `tanggal_balasan` datetime DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pengaduan`
--

INSERT INTO `pengaduan` (`id`, `kode_tiket`, `user_id`, `judul`, `kategori`, `isi`, `lampiran`, `status`, `privasi`, `dibalas_oleh`, `balasan`, `tanggal_balasan`, `created_at`) VALUES
(3, 'TKT20260223001', 1, 'Bising', '', 'Kalo Malam banyak anak - ank lewat pakai motor berisik ', '', 'selesai', 'privat', 1, 'Ok ', '2026-03-04 15:04:39', '2026-02-23 15:04:04');

-- --------------------------------------------------------

--
-- Table structure for table `pengajuan_bayar_angsuran`
--

CREATE TABLE `pengajuan_bayar_angsuran` (
  `id` int(11) UNSIGNED NOT NULL,
  `kode_bayar` varchar(30) NOT NULL COMMENT 'Kode unik pengajuan',
  `pinjaman_id` int(11) UNSIGNED NOT NULL,
  `angsuran_id` int(11) UNSIGNED NOT NULL,
  `warga_id` int(11) UNSIGNED NOT NULL,
  `nominal_bayar` decimal(15,2) NOT NULL DEFAULT 0.00,
  `denda` decimal(15,2) DEFAULT 0.00,
  `metode_bayar` enum('tunai','transfer','qris') NOT NULL DEFAULT 'tunai',
  `tujuan_transfer` varchar(150) DEFAULT NULL COMMENT 'Bank/rekening tujuan transfer',
  `rekening_pengirim` varchar(150) DEFAULT NULL COMMENT 'No rek / nama pengirim',
  `catatan_warga` text DEFAULT NULL,
  `foto_bukti` varchar(255) DEFAULT NULL COMMENT 'Path file bukti bayar',
  `status` enum('pending','diverifikasi','ditolak') NOT NULL DEFAULT 'pending',
  `catatan_admin` text DEFAULT NULL,
  `verified_by` int(11) UNSIGNED DEFAULT NULL,
  `verified_at` datetime DEFAULT NULL,
  `master_kas_id` int(11) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='Pengajuan bayar angsuran dari warga';

-- --------------------------------------------------------

--
-- Table structure for table `pengajuan_pinjaman`
--

CREATE TABLE `pengajuan_pinjaman` (
  `id` int(11) NOT NULL,
  `kode_pengajuan` varchar(50) DEFAULT NULL,
  `warga_id` int(11) NOT NULL,
  `jenis_pinjaman_id` int(11) NOT NULL,
  `nominal_pengajuan` decimal(12,2) NOT NULL,
  `tenor` int(11) NOT NULL COMMENT 'Jumlah bulan angsuran',
  `bunga_persen` decimal(5,2) NOT NULL COMMENT 'Bunga yang disetujui',
  `total_pinjaman` decimal(12,2) NOT NULL COMMENT 'Nominal + Bunga',
  `angsuran_per_bulan` decimal(12,2) NOT NULL,
  `keperluan` text DEFAULT NULL,
  `jaminan` text DEFAULT NULL,
  `status_pengajuan` enum('pending','survey','disetujui','ditolak') DEFAULT 'pending',
  `disetujui_oleh` int(11) DEFAULT NULL,
  `tanggal_pengajuan` date DEFAULT curdate(),
  `tanggal_disetujui` date DEFAULT NULL,
  `keterangan_penolakan` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `pengaturan`
--

CREATE TABLE `pengaturan` (
  `id` int(11) NOT NULL,
  `nama_rt` varchar(20) DEFAULT 'RT 001',
  `nama_rw` varchar(20) DEFAULT 'RW 001',
  `sebutan_rt` varchar(50) DEFAULT 'RT',
  `sebutan_rw` varchar(50) DEFAULT 'RW',
  `sebutan_ketua_rt` varchar(50) DEFAULT 'Ketua RT',
  `sebutan_sekretaris` varchar(50) DEFAULT 'Sekretaris RT',
  `sebutan_bendahara` varchar(50) DEFAULT 'Bendahara RT',
  `sebutan_ketua_rw` varchar(50) DEFAULT 'Ketua RW',
  `sebutan_lurah` varchar(50) DEFAULT 'Lurah',
  `nama_kelurahan` varchar(100) DEFAULT NULL,
  `nama_kecamatan` varchar(100) DEFAULT NULL,
  `nama_kota` varchar(100) DEFAULT NULL,
  `nama_provinsi` varchar(100) DEFAULT NULL,
  `kode_pos` varchar(10) DEFAULT NULL,
  `no_telp` varchar(20) DEFAULT NULL,
  `alamat_sekretariat` varchar(255) DEFAULT NULL,
  `logo` varchar(255) DEFAULT NULL,
  `ketua_rt_warga_id` int(11) DEFAULT NULL,
  `sekretaris_rt_warga_id` int(11) DEFAULT NULL,
  `foto_sekretaris_rt` varchar(255) DEFAULT NULL,
  `bendahara_rt_warga_id` int(11) DEFAULT NULL,
  `foto_bendahara_rt` varchar(255) DEFAULT NULL,
  `nama_ketua_rt` varchar(100) DEFAULT NULL,
  `nik_ketua_rt` varchar(20) DEFAULT NULL,
  `foto_ketua_rt` varchar(255) DEFAULT NULL,
  `nama_ketua_rw` varchar(100) DEFAULT NULL,
  `nik_ketua_rw` varchar(16) DEFAULT NULL,
  `foto_ketua_rw` varchar(255) DEFAULT NULL,
  `nama_lurah` varchar(100) DEFAULT NULL,
  `jabatan_lurah` varchar(50) DEFAULT 'Lurah',
  `nip_lurah` varchar(30) DEFAULT NULL,
  `foto_lurah` varchar(255) DEFAULT NULL,
  `footer_surat` text DEFAULT NULL,
  `peraturan_rt` text DEFAULT NULL COMMENT 'Isi peraturan / tata tertib RT',
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `kode_bmkg` varchar(20) DEFAULT '33.15.13.1012',
  `cuaca_latitude` varchar(20) DEFAULT NULL,
  `cuaca_longitude` varchar(20) DEFAULT NULL,
  `cuaca_kota` varchar(100) DEFAULT NULL,
  `youtube_api_key` varchar(100) DEFAULT NULL,
  `api_key` varchar(64) DEFAULT NULL COMMENT 'API Key untuk integrasi aplikasi RW',
  `timezone` varchar(50) DEFAULT 'Asia/Jakarta',
  `waha_base_url` varchar(255) DEFAULT NULL,
  `waha_api_key` varchar(512) DEFAULT NULL,
  `waha_session` varchar(100) DEFAULT 'default',
  `waha_enabled` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `pengaturan`
--

INSERT INTO `pengaturan` (`id`, `nama_rt`, `nama_rw`, `sebutan_rt`, `sebutan_rw`, `sebutan_ketua_rt`, `sebutan_sekretaris`, `sebutan_bendahara`, `sebutan_ketua_rw`, `sebutan_lurah`, `nama_kelurahan`, `nama_kecamatan`, `nama_kota`, `nama_provinsi`, `kode_pos`, `no_telp`, `alamat_sekretariat`, `logo`, `ketua_rt_warga_id`, `sekretaris_rt_warga_id`, `foto_sekretaris_rt`, `bendahara_rt_warga_id`, `foto_bendahara_rt`, `nama_ketua_rt`, `nik_ketua_rt`, `foto_ketua_rt`, `nama_ketua_rw`, `nik_ketua_rw`, `foto_ketua_rw`, `nama_lurah`, `jabatan_lurah`, `nip_lurah`, `foto_lurah`, `footer_surat`, `peraturan_rt`, `updated_at`, `kode_bmkg`, `cuaca_latitude`, `cuaca_longitude`, `cuaca_kota`, `youtube_api_key`, `api_key`, `timezone`, `waha_base_url`, `waha_api_key`, `waha_session`, `waha_enabled`) VALUES
(1, 'RT 002', 'RW 002', 'RT', 'RW', 'Ketua RT', 'Sekretaris RT', 'Bendahara RT', 'Ketua RW', 'Gampong', 'Babelan', 'Purwodadi ', 'Kabupaten Grobogan', 'Jawa Tengah', '58211', '085876460356', 'Kemasan RT 05 RW 02 Purwodadi ', 'logo_rt_1771400829.png', NULL, NULL, 'foto_sekretaris_1773639407.jpg', NULL, 'foto_bendahara_1772458693.jpg', NULL, NULL, 'foto_ketua_rt_1772458708.jpg', 'SUNGKONO', '1231311132', NULL, '', 'Kepala Dusun', '581223115632', NULL, '', '<p><br></p><p class=\"ql-align-center\"><br></p><h1 class=\"ql-align-center\">PERATURAN TENTANG TATA TERTIB LINGKUNGAN</h1><p class=\"ql-align-center\"><strong>RT.05 RW.02 KELURAHAN KEMASAN KECAMATAN PURWODADI</strong></p><h2><strong>I. PENDAHULUAN</strong></h2><p>Bahwa untuk menunjang tercapainya tujuan adanya Keamanan, Kenyamanan, dan Ketertiban diperlukan seperangkat peraturan yang dibuat sendiri oleh warga. Oleh karena itu, peraturan ini merupakan <strong>Kesepakatan Bersama</strong> yang dilandasi semangat kekeluargaan. Karena sifatnya sebagai kesepakatan bersama, maka keberhasilan pelaksanaannya menjadi tanggung jawab seluruh warga.</p><p>Berdasarkan hal-hal tersebut, disusunlah <strong>PERATURAN TENTANG TATA TERTIB LINGKUNGAN RT.05 RW.02 Kelurahan Kemasan Kecamatan Purwodadi</strong>, selanjutnya disebut <strong>PERATURAN</strong>.</p><p><br></p><h2><strong>II. DEFINISI</strong></h2><ol><li><strong>Warga</strong>: orang atau badan hukum yang sah menempati atau memiliki tanah/bangunan di wilayah RT.05 RW.02 Kelurahan Kemasan Kecamatan Purwodadi.</li><li><strong>Lingkungan</strong>: seluruh fasilitas umum seperti jalan, bangunan umum, taman, dan ruang terbuka di wilayah RT.05 RW.02 Kelurahan Kemasan Kecamatan Purwodadi.</li><li><strong>Pertemuan Warga</strong>: pertemuan yang diselenggarakan oleh warga atau Pengurus RT.05 RW.02 Kelurahan Kemasan Kecamatan Purwodadi.</li></ol><h2><strong>III. PERATURAN UMUM</strong></h2><ol><li>Semua warga berhak mendapatkan pelayanan kebersihan, keamanan, dan surat-menyurat dari Pengurus RT.</li><li>Semua warga berhak memakai fasilitas lingkungan seperti jalan, taman, dan fasilitas umum lainnya.</li><li>Semua warga wajib menaati seluruh isi PERATURAN.</li><li>Warga wajib tanggap terhadap gangguan keamanan di sekitar rumah dan segera melapor kepada petugas keamanan atau Ketua RT.</li></ol><h2><strong>IV. PERATURAN TENTANG KETERTIBAN</strong></h2><ol><li>Warga dilarang melepas hewan peliharaan seperti kelinci, anjing, kucing, monyet, dan sebagainya yang dapat mengganggu atau membahayakan warga lainnya.</li><li>Warga dilarang menimbulkan kebisingan seperti suara kendaraan, klakson, musik keras, dan lainnya yang dapat mengganggu warga.</li><li>Warga dihimbau untuk tidak memarkir kendaraan di depan rumah warga lain tanpa izin.</li><li>Semua kendaraan yang masuk ke lingkungan RT.05 RW.02 wajib berjalan pelan.</li><li>Warga yang mengadakan acara dengan tamu berkendaraan wajib melapor kepada pengurus RT terlebih dahulu.</li><li>Warga yang merasa terganggu tidak diperkenankan bertindak sendiri, tetapi harus melapor kepada Ketua RT.</li></ol><h2><strong>V. PERATURAN TENTANG KEAMANAN</strong></h2><ol><li>Warga wajib memberikan data identitas diri dan keluarga kepada Ketua RT/pengurus.</li><li>Warga yang mempekerjakan tenaga kerja seperti ART, satpam pribadi, atau tukang bangunan wajib melapor dan memberikan data identitas pekerja tersebut kepada Ketua RT.</li><li>Warga yang meninggalkan rumah lebih dari 1×24 jam wajib melapor kepada Ketua RT/pengurus serta memastikan tidak ada bahan mudah terbakar atau sampah yang ditinggalkan.</li><li>Warga yang menerima tamu menginap lebih dari 1×24 jam wajib melapor kepada Ketua RT.</li><li>Warga wajib segera melaporkan kepada Seksi Keamanan jika terjadi pencurian, kebakaran, keributan, atau melihat orang asing mencurigakan.</li></ol><h2><strong>VI. PERATURAN TENTANG KEBERSIHAN</strong></h2><ol><li>Warga wajib menjaga rumah agar tetap bersih, rapi, dan tidak kumuh.</li><li>Sampah wajib dimasukkan ke dalam kantong plastik tertutup sebelum dibuang ke tempat sampah.</li><li>Warga dihimbau menghemat penggunaan air dan memastikan aktivitas seperti mencuci atau menyiram tidak menimbulkan genangan yang dapat merusak jalan.</li></ol><h2><strong>VIII. PERATURAN TENTANG PEMBIAYAAN</strong></h2><ol><li>Pengelolaan lingkungan dibiayai dari Iuran Warga yang masuk ke Kas RT.</li><li>Iuran warga bersifat wajib bagi setiap warga RT.05 RW.02.</li><li>Pengurus RT dapat mencari sumber dana lain sepanjang tidak melanggar ketentuan yang berlaku.</li><li>Pengeluaran Kas RT dilaksanakan berdasarkan Rencana Kerja dan Anggaran Tahunan.</li><li>Pengurus wajib melaporkan penggunaan Kas RT setidaknya sekali dalam setahun.</li><li>Besaran iuran warga ditetapkan melalui Musyawarah Warga.</li><li>Pengurus wajib memberikan laporan pertanggungjawaban pada akhir masa kepengurusan.</li></ol><h2><strong>IX. PERATURAN PERALIHAN / PENUTUP</strong></h2><p>Segala hal yang belum diatur atau perlu diubah akan dimasukkan dalam <strong>Peraturan Tambahan</strong>, yang menjadi bagian tidak terpisahkan dari PERATURAN ini dan berlaku setelah disahkan dalam Musyawarah Warga RT.05 RW.02 Kelurahan Kemasan Kecamatan Purwodadi.</p><p><br></p><p><br></p>', '2026-04-28 17:17:43', NULL, '-7.0868', '110.9158', 'Purwodadi, Kabupaten Grobogan, Provinsi Jawa Tengah', 'AIzaSyACu3oke-AXmousSVY7Llq1tgdIzb4BCUM', '7c162484d81081f9a9594fc1cdd1bf9a', 'Asia/Jakarta', 'https://waha-ekypjbomntgm.bakpau.sumopod.my.id', 'key_mY8433ywFw4RwmHq7p4IbLqTCcvWZ6EG', 'session_01kpzytw122t1fvz9005tdrekq', 1);

-- --------------------------------------------------------

--
-- Table structure for table `pengumuman`
--

CREATE TABLE `pengumuman` (
  `id` int(11) NOT NULL,
  `judul` varchar(200) NOT NULL,
  `isi` text NOT NULL,
  `kategori` enum('umum','kegiatan','darurat','pembayaran') DEFAULT 'umum',
  `untuk_role` enum('semua','warga','rt','admin') DEFAULT 'semua',
  `lampiran` varchar(255) DEFAULT NULL,
  `tanggal_publish` date NOT NULL,
  `tanggal_expired` date DEFAULT NULL,
  `status` enum('draft','publish','arsip') DEFAULT 'draft',
  `dibuat_oleh` int(11) NOT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `pengumuman`
--

INSERT INTO `pengumuman` (`id`, `judul`, `isi`, `kategori`, `untuk_role`, `lampiran`, `tanggal_publish`, `tanggal_expired`, `status`, `dibuat_oleh`, `created_at`, `updated_at`) VALUES
(11, 'KERJA BAKTI', '<p>hari Minggu Kerja Bakti</p>', 'umum', 'semua', '', '2026-04-24', '2026-04-26', 'publish', 1, '2026-04-24 16:00:22', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `pengumuman_backup`
--

CREATE TABLE `pengumuman_backup` (
  `id` int(11) NOT NULL DEFAULT 0,
  `judul` varchar(200) NOT NULL,
  `isi` text NOT NULL,
  `kategori` enum('umum','kegiatan','darurat','pembayaran') DEFAULT 'umum',
  `untuk_role` enum('semua','ketua_rt','sekretaris','bendahara','warga') DEFAULT 'semua',
  `lampiran` varchar(255) DEFAULT NULL,
  `tanggal_publish` date DEFAULT NULL,
  `tanggal_expired` date DEFAULT NULL,
  `status` enum('draft','publish','arsip') DEFAULT 'draft',
  `dibuat_oleh` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `permohonan_surat`
--

CREATE TABLE `permohonan_surat` (
  `id` int(11) NOT NULL,
  `warga_id` int(11) NOT NULL,
  `jenis_surat_id` int(11) NOT NULL,
  `keperluan` text NOT NULL,
  `status` enum('pending','diproses','selesai','ditolak') DEFAULT 'pending',
  `nomor_surat` varchar(50) DEFAULT NULL,
  `tanggal_permohonan` date DEFAULT curdate(),
  `tanggal_selesai` date DEFAULT NULL,
  `keterangan_penolakan` text DEFAULT NULL,
  `file_surat` varchar(255) DEFAULT NULL,
  `diproses_oleh` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `pinjaman`
--

CREATE TABLE `pinjaman` (
  `id` int(11) NOT NULL,
  `kode_pinjaman` varchar(50) DEFAULT NULL,
  `pengajuan_id` int(11) NOT NULL,
  `warga_id` int(11) NOT NULL,
  `nominal_disetujui` decimal(12,2) NOT NULL,
  `bunga_total` decimal(12,2) NOT NULL,
  `total_pinjaman` decimal(12,2) NOT NULL,
  `tenor` int(11) NOT NULL,
  `angsuran_per_bulan` decimal(12,2) NOT NULL,
  `sudah_diterima` enum('ya','tidak') DEFAULT 'tidak',
  `tanggal_pencairan` date DEFAULT NULL,
  `kas_tabungan_id` int(11) DEFAULT NULL COMMENT 'Master kas tabungan yang dipakai (jika ada)',
  `nominal_dari_tabungan` decimal(12,2) DEFAULT 0.00 COMMENT 'Jumlah yang diambil dari kas tabungan',
  `kas_rt_id` int(11) DEFAULT NULL COMMENT 'Master kas RT non-tabungan (cadangan)',
  `nominal_dari_kas_rt` decimal(12,2) DEFAULT 0.00 COMMENT 'Jumlah yang diambil dari kas RT',
  `tanggal_jatuh_tempo_per_bulan` int(11) DEFAULT 5 COMMENT 'Tanggal jatuh tempo setiap bulan',
  `status_pinjaman` enum('aktif','lunas','macet') DEFAULT 'aktif',
  `sisa_pinjaman` decimal(12,2) NOT NULL,
  `sisa_tenor` int(11) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `polling`
--

CREATE TABLE `polling` (
  `id` int(10) UNSIGNED NOT NULL,
  `judul` varchar(255) NOT NULL,
  `deskripsi` text DEFAULT NULL,
  `opsi_json` longtext NOT NULL COMMENT 'JSON array: [{teks,suara}]',
  `status` enum('aktif','selesai','ditutup') NOT NULL DEFAULT 'aktif',
  `hasil_realtime` tinyint(1) NOT NULL DEFAULT 1,
  `izin_ganti` tinyint(1) NOT NULL DEFAULT 0,
  `anonim` tinyint(1) NOT NULL DEFAULT 0,
  `tanggal_mulai` date NOT NULL,
  `tanggal_selesai` date DEFAULT NULL,
  `dibuat_oleh` int(10) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `polling`
--

INSERT INTO `polling` (`id`, `judul`, `deskripsi`, `opsi_json`, `status`, `hasil_realtime`, `izin_ganti`, `anonim`, `tanggal_mulai`, `tanggal_selesai`, `dibuat_oleh`, `created_at`, `updated_at`) VALUES
(1, 'Pembelian Karpet', 'Ada wacana pembelian karpet kira2 setuju tidak', '[{\"teks\":\"Setuju\",\"suara\":2},{\"teks\":\"Tidak\",\"suara\":1},{\"teks\":\"Golputt\",\"suara\":0}]', 'aktif', 1, 1, 0, '2026-02-23', '2026-03-14', 1, '2026-02-23 13:43:52', '2026-02-23 13:50:32');

-- --------------------------------------------------------

--
-- Table structure for table `polling_votes`
--

CREATE TABLE `polling_votes` (
  `id` int(10) UNSIGNED NOT NULL,
  `polling_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `nama` varchar(150) NOT NULL,
  `pilihan` varchar(255) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `polling_votes`
--

INSERT INTO `polling_votes` (`id`, `polling_id`, `user_id`, `nama`, `pilihan`, `created_at`, `updated_at`) VALUES
(1, 1, 236, 'Agus Wijaya', 'Setuju', '2026-02-23 13:48:20', '2026-02-23 13:48:20'),
(2, 1, 183, 'Ayu Wandira', 'Tidak', '2026-02-23 13:49:41', '2026-02-23 13:49:41'),
(3, 1, 178, 'Teguh Prabowo', 'Setuju', '2026-02-23 13:50:32', '2026-02-23 13:50:32');

-- --------------------------------------------------------

--
-- Table structure for table `rencana_pembelian`
--

CREATE TABLE `rencana_pembelian` (
  `id` int(11) NOT NULL,
  `kode_rencana` varchar(20) DEFAULT NULL,
  `nama_barang` varchar(200) NOT NULL,
  `kategori` enum('elektronik','furniture','kendaraan','perlengkapan','lainnya') DEFAULT 'lainnya',
  `jumlah` int(11) DEFAULT 1,
  `satuan` varchar(30) DEFAULT 'unit',
  `estimasi_harga` decimal(15,2) DEFAULT NULL,
  `sumber_dana` varchar(100) DEFAULT NULL,
  `prioritas` enum('tinggi','sedang','rendah') DEFAULT 'sedang',
  `keterangan` text DEFAULT NULL,
  `status` enum('direncanakan','disetujui','terbeli','hibah','dibatalkan') NOT NULL DEFAULT 'direncanakan',
  `foto_referensi` varchar(255) DEFAULT NULL,
  `diajukan_oleh` int(11) DEFAULT NULL,
  `disetujui_oleh` int(11) DEFAULT NULL,
  `tanggal_rencana` date DEFAULT NULL,
  `tanggal_realisasi` date DEFAULT NULL,
  `harga_realisasi` decimal(15,2) DEFAULT NULL,
  `pemberi_hibah` varchar(150) DEFAULT NULL,
  `master_kas_id` int(11) DEFAULT NULL,
  `kas_id` int(11) DEFAULT NULL,
  `inventaris_id` int(11) DEFAULT NULL,
  `catatan_keputusan` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rencana_pembelian`
--

INSERT INTO `rencana_pembelian` (`id`, `kode_rencana`, `nama_barang`, `kategori`, `jumlah`, `satuan`, `estimasi_harga`, `sumber_dana`, `prioritas`, `keterangan`, `status`, `foto_referensi`, `diajukan_oleh`, `disetujui_oleh`, `tanggal_rencana`, `tanggal_realisasi`, `harga_realisasi`, `pemberi_hibah`, `master_kas_id`, `kas_id`, `inventaris_id`, `catatan_keputusan`, `created_at`, `updated_at`) VALUES
(1, 'RP2026030001', 'TANGGA', 'elektronik', 1, 'unit', 150000.00, '', 'sedang', 'DS', 'terbeli', NULL, 1, 1, '2026-03-04', '2026-03-04', 145000.00, NULL, 1, 0, 7, NULL, '2026-03-04 16:06:19', '2026-03-04 16:19:11');

-- --------------------------------------------------------

--
-- Table structure for table `riwayat_pembayaran_pinjaman`
--

CREATE TABLE `riwayat_pembayaran_pinjaman` (
  `id` int(11) NOT NULL,
  `angsuran_id` int(11) NOT NULL,
  `pinjaman_id` int(11) NOT NULL,
  `nominal_bayar` decimal(12,2) NOT NULL,
  `tanggal_bayar` datetime DEFAULT current_timestamp(),
  `metode` enum('tunai','transfer') DEFAULT 'tunai',
  `petugas_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `struktur_organisasi`
--

CREATE TABLE `struktur_organisasi` (
  `id` int(11) NOT NULL,
  `jabatan_id` int(11) NOT NULL,
  `warga_id` int(11) DEFAULT NULL,
  `nama_manual` varchar(255) DEFAULT NULL,
  `nik_manual` varchar(20) DEFAULT NULL,
  `foto` varchar(255) DEFAULT NULL,
  `urutan` int(11) DEFAULT 0,
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `struktur_organisasi`
--

INSERT INTO `struktur_organisasi` (`id`, `jabatan_id`, `warga_id`, `nama_manual`, `nik_manual`, `foto`, `urutan`, `updated_at`) VALUES
(1, 1, 1091, '', '', 'pengurus_1777127927.jpeg', 0, '2026-04-25 21:38:47'),
(2, 2, 1090, '', '', 'pengurus_1777127970.png', 2, '2026-04-25 21:39:30'),
(3, 3, 1086, '', '', 'pengurus_1777128025.png', 0, '2026-04-25 21:40:25'),
(4, 4, NULL, 'BENI', '1231313131232', 'pengurus_1777128066.jpg', 0, '2026-04-25 21:41:06'),
(5, 7, NULL, 'SUGI', '1231313132', 'pengurus_1777128164.png', 2, '2026-04-25 21:42:45');

-- --------------------------------------------------------

--
-- Table structure for table `tabungan`
--

CREATE TABLE `tabungan` (
  `id` int(11) NOT NULL,
  `warga_id` int(11) NOT NULL,
  `jenis_tabungan` enum('sukarela','wajib','arisan') DEFAULT 'sukarela',
  `saldo` decimal(12,2) DEFAULT 0.00,
  `status` enum('aktif','nonaktif') DEFAULT 'aktif',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `tamu`
--

CREATE TABLE `tamu` (
  `id` int(11) NOT NULL,
  `kode_tamu` varchar(20) DEFAULT NULL COMMENT 'Kode unik: TM-YYYYMMDD-XXXX',
  `nama_tamu` varchar(150) NOT NULL,
  `nik_tamu` varchar(20) DEFAULT NULL,
  `no_hp` varchar(20) DEFAULT NULL,
  `no_kendaraan` varchar(20) DEFAULT NULL,
  `jenis_kendaraan` varchar(50) DEFAULT NULL COMMENT 'Motor, Mobil, Sepeda, dll',
  `tujuan_blok` varchar(100) DEFAULT NULL COMMENT 'Blok / No rumah yang dikunjungi',
  `nama_tuan_rumah` varchar(150) DEFAULT NULL COMMENT 'Nama pemilik rumah yg dikunjungi',
  `keperluan` enum('kunjungan','antar_paket','tamu_menginap','kerja','lainnya') NOT NULL DEFAULT 'kunjungan',
  `keperluan_detail` varchar(255) DEFAULT NULL COMMENT 'Detail keperluan bebas isi',
  `tipe_kunjungan` enum('singkat','menginap') NOT NULL DEFAULT 'singkat',
  `checkin_at` datetime NOT NULL,
  `checkout_at` datetime DEFAULT NULL,
  `rencana_checkout` date DEFAULT NULL COMMENT 'Rencana selesai menginap (jika menginap)',
  `status` enum('checkin','checkout') NOT NULL DEFAULT 'checkin',
  `foto_tamu` varchar(255) DEFAULT NULL,
  `catatan` text DEFAULT NULL,
  `dicatat_oleh` int(11) DEFAULT NULL COMMENT 'FK users.id',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tamu`
--

INSERT INTO `tamu` (`id`, `kode_tamu`, `nama_tamu`, `nik_tamu`, `no_hp`, `no_kendaraan`, `jenis_kendaraan`, `tujuan_blok`, `nama_tuan_rumah`, `keperluan`, `keperluan_detail`, `tipe_kunjungan`, `checkin_at`, `checkout_at`, `rencana_checkout`, `status`, `foto_tamu`, `catatan`, `dicatat_oleh`, `created_at`, `updated_at`) VALUES
(10, 'TM-20260316-C33A', 'ARIP', NULL, '085876460356', 'K 3257 YF', 'Motor', 'BLOK A ', NULL, 'kunjungan', 'ANTAR PAKET', 'singkat', '2026-03-16 13:00:00', '2026-03-16 13:01:53', NULL, 'checkout', NULL, NULL, 1, '2026-03-15 23:01:04', '2026-03-16 06:01:53');

-- --------------------------------------------------------

--
-- Table structure for table `tamu_foto`
--

CREATE TABLE `tamu_foto` (
  `id` int(11) NOT NULL,
  `tamu_id` int(11) NOT NULL,
  `nama_file` varchar(255) NOT NULL,
  `label` varchar(100) DEFAULT NULL,
  `urutan` int(11) DEFAULT 0,
  `ukuran_byte` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `transaksi_tabungan`
--

CREATE TABLE `transaksi_tabungan` (
  `id` int(11) NOT NULL,
  `tabungan_id` int(11) NOT NULL,
  `jenis_transaksi` enum('setor','tarik') NOT NULL,
  `nominal` decimal(12,2) NOT NULL,
  `saldo_sebelum` decimal(12,2) DEFAULT NULL,
  `saldo_sesudah` decimal(12,2) DEFAULT NULL,
  `keterangan` text DEFAULT NULL,
  `petugas_id` int(11) DEFAULT NULL,
  `tanggal_transaksi` datetime DEFAULT current_timestamp(),
  `status` enum('pending','disetujui','ditolak') DEFAULT 'pending',
  `bukti_transfer` varchar(255) DEFAULT NULL,
  `master_kas_id` int(11) DEFAULT NULL COMMENT 'Kas tujuan setoran (hanya untuk jenis_transaksi=setor)',
  `tanggal_pengajuan` datetime DEFAULT current_timestamp(),
  `tanggal_verifikasi` datetime DEFAULT NULL,
  `admin_id` int(11) DEFAULT NULL,
  `catatan_admin` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `transfer_kas`
--

CREATE TABLE `transfer_kas` (
  `id` int(11) UNSIGNED NOT NULL,
  `dari_kas_id` int(11) NOT NULL,
  `ke_kas_id` int(11) NOT NULL,
  `nominal` decimal(15,2) NOT NULL DEFAULT 0.00,
  `tanggal` date NOT NULL,
  `keterangan` text DEFAULT NULL,
  `input_oleh` int(11) DEFAULT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `transfer_kas`
--

INSERT INTO `transfer_kas` (`id`, `dari_kas_id`, `ke_kas_id`, `nominal`, `tanggal`, `keterangan`, `input_oleh`, `created_at`) VALUES
(4, 6, 2, 10000.00, '2026-04-20', '', 1, '2026-04-20 02:29:08');

-- --------------------------------------------------------

--
-- Table structure for table `umkm`
--

CREATE TABLE `umkm` (
  `id` int(11) NOT NULL,
  `warga_id` int(11) DEFAULT NULL COMMENT 'FK ke tabel warga (pemilik usaha)',
  `user_id` int(11) DEFAULT NULL COMMENT 'FK ke tabel users jika tidak punya warga_id',
  `nama_usaha` varchar(150) NOT NULL,
  `kategori` enum('kuliner','fashion','jasa','pertanian','kerajinan','teknologi','kesehatan','pendidikan','lainnya') NOT NULL DEFAULT 'lainnya',
  `deskripsi` text DEFAULT NULL,
  `produk_layanan` text DEFAULT NULL COMMENT 'Deskripsi produk/layanan yang ditawarkan',
  `alamat` varchar(255) DEFAULT NULL,
  `jam_operasional` varchar(100) DEFAULT NULL COMMENT 'Contoh: Sen-Sab 08.00-17.00',
  `no_telp` varchar(20) DEFAULT NULL,
  `instagram` varchar(80) DEFAULT NULL COMMENT 'Username Instagram tanpa @',
  `whatsapp` varchar(20) DEFAULT NULL,
  `foto` varchar(255) DEFAULT NULL COMMENT 'Path file foto usaha',
  `status` enum('aktif','nonaktif','pending') NOT NULL DEFAULT 'pending',
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `umkm`
--

INSERT INTO `umkm` (`id`, `warga_id`, `user_id`, `nama_usaha`, `kategori`, `deskripsi`, `produk_layanan`, `alamat`, `jam_operasional`, `no_telp`, `instagram`, `whatsapp`, `foto`, `status`, `created_at`, `updated_at`) VALUES
(1, NULL, 1, 'DEVI Kuliner', 'kuliner', 'Usaha sddas asdasd asdas', 'Seblak, Bakaran', 'Kemasan', 'setaip hari ', '0858546465', '', '08513123132', NULL, 'aktif', '2026-02-23 21:22:54', '2026-02-23 21:24:02');

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `warga_id` int(11) DEFAULT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL,
  `nama_lengkap` varchar(100) NOT NULL,
  `email` varchar(100) DEFAULT NULL,
  `no_hp` varchar(20) DEFAULT NULL,
  `foto` varchar(255) DEFAULT NULL,
  `role` enum('admin','ketua_rt','sekretaris','bendahara','warga') DEFAULT 'warga',
  `rt` varchar(5) DEFAULT NULL,
  `rw` varchar(5) DEFAULT NULL,
  `alamat` text DEFAULT NULL,
  `status` enum('aktif','nonaktif') DEFAULT 'aktif',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `warga_id`, `username`, `password`, `nama_lengkap`, `email`, `no_hp`, `foto`, `role`, `rt`, `rw`, `alamat`, `status`, `created_at`, `updated_at`) VALUES
(1, NULL, 'admin', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'Administrator', 'admin@rt.com', '', '39bea6dca7323369e213cd1228279115.png', 'admin', NULL, NULL, NULL, 'aktif', '2026-02-16 06:41:35', '2026-03-15 22:33:15'),
(2, NULL, 'ketua', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'Ketua RT', 'ketua@rt.com', NULL, NULL, 'ketua_rt', NULL, NULL, NULL, 'aktif', '2026-02-16 06:41:35', '2026-02-16 06:41:35'),
(661, 1086, 'budi.santoso', '$2y$12$muTbjsmhSzFZBAEPSd/qI.e707755fJ6s8x.B.Epe0TFiYGb0YL8G', 'Budi Santoso', 'budi@email.com', '085876460356', NULL, 'warga', NULL, NULL, NULL, 'aktif', '2026-04-11 10:20:36', '2026-04-24 15:47:26'),
(664, 1090, 'agus', '$2y$12$XX5bnBqsd/hzei8ndYg6Kec5fxxAWXNCpsJfH6ch4Mhww.gGsrTj6', 'agus', '', '085803029290', NULL, 'warga', NULL, NULL, NULL, 'aktif', '2026-04-13 14:37:08', '2026-04-24 12:55:15'),
(666, 1091, '1212212121212222', '$2y$12$W1M3ASf81m5lARuc5BsrMukj6UoQ1vA422qAgYvJYA9HUsBMaJp66', 'Achmad Deni ', NULL, NULL, NULL, 'warga', NULL, NULL, NULL, 'aktif', '2026-04-25 14:12:47', '2026-04-25 14:13:34');

-- --------------------------------------------------------

--
-- Table structure for table `warga`
--

CREATE TABLE `warga` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `kk_id` int(11) DEFAULT NULL,
  `nik` varchar(16) DEFAULT NULL,
  `nama_lengkap` varchar(100) DEFAULT NULL,
  `no_kk` varchar(16) DEFAULT NULL,
  `tempat_lahir` varchar(50) DEFAULT NULL,
  `tanggal_lahir` date DEFAULT NULL,
  `jenis_kelamin` enum('L','P') DEFAULT NULL,
  `status_perkawinan` enum('belum_kawin','kawin','cerai_hidup','cerai_mati') DEFAULT NULL,
  `pekerjaan` varchar(50) DEFAULT NULL,
  `pendidikan` varchar(100) DEFAULT NULL,
  `no_hp` varchar(20) DEFAULT NULL,
  `agama` varchar(20) DEFAULT NULL,
  `kewarganegaraan` varchar(20) DEFAULT 'WNI',
  `foto_ktp` varchar(255) DEFAULT NULL,
  `status_domisili` enum('tetap','kost','kontrak','pendatang','sementara') DEFAULT 'tetap',
  `status_hubungan` enum('kepala_keluarga','istri','anak','cucu','orang_tua','mertua','famili_lain','pembantu','lainnya') DEFAULT 'lainnya',
  `keterangan_domisili` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `status_meninggal` tinyint(1) DEFAULT 0,
  `tanggal_meninggal` date DEFAULT NULL,
  `keterangan_meninggal` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `warga`
--

INSERT INTO `warga` (`id`, `user_id`, `kk_id`, `nik`, `nama_lengkap`, `no_kk`, `tempat_lahir`, `tanggal_lahir`, `jenis_kelamin`, `status_perkawinan`, `pekerjaan`, `pendidikan`, `no_hp`, `agama`, `kewarganegaraan`, `foto_ktp`, `status_domisili`, `status_hubungan`, `keterangan_domisili`, `created_at`, `status_meninggal`, `tanggal_meninggal`, `keterangan_meninggal`) VALUES
(1086, 661, 391, '3201010101010001', 'Budi Santoso', '3201011234567890', 'Bandung', '1985-05-15', 'L', 'kawin', 'Wiraswasta', NULL, '085876460356', 'Islam', 'WNI', NULL, 'tetap', 'kepala_keluarga', '', '2026-04-11 10:20:36', 0, NULL, NULL),
(1090, 664, 391, '123', 'agus', '3201011234567890', 'GROBOGAN', '1985-04-24', 'L', 'belum_kawin', 'Guru', 'SMA/SMK Sederajat', '085803029290', 'Islam', 'WNI', NULL, 'tetap', 'lainnya', '', '2026-04-13 14:37:07', 0, NULL, NULL),
(1091, 666, NULL, '1212212121212222', 'Achmad Deni ', NULL, NULL, '2009-01-14', '', NULL, NULL, NULL, '085876460356', NULL, 'WNI', 'KTP_1091_1777007207.jpg', 'tetap', 'kepala_keluarga', NULL, '2026-04-14 08:14:31', 0, NULL, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `warga_kurang_mampu`
--

CREATE TABLE `warga_kurang_mampu` (
  `id` int(11) NOT NULL,
  `warga_id` int(11) NOT NULL,
  `penghasilan_bulan` decimal(12,2) NOT NULL DEFAULT 0.00,
  `pekerjaan` varchar(100) DEFAULT NULL,
  `jml_tanggungan` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `status_rumah` enum('milik_sendiri','sewa','numpang','dinas','lainnya') NOT NULL DEFAULT 'milik_sendiri',
  `kondisi_rumah` enum('baik','sedang','buruk','sangat_buruk') NOT NULL DEFAULT 'sedang',
  `alasan_pengajuan` text NOT NULL,
  `keterangan_tambahan` text DEFAULT NULL,
  `foto_rumah` text DEFAULT NULL COMMENT 'JSON array nama file foto rumah',
  `status_pengajuan` enum('menunggu','diverifikasi','disetujui','ditolak') NOT NULL DEFAULT 'menunggu',
  `catatan_verifikasi` text DEFAULT NULL,
  `tgl_pengajuan` date NOT NULL,
  `tgl_verifikasi` date DEFAULT NULL,
  `diajukan_oleh` int(11) DEFAULT NULL,
  `diverifikasi_oleh` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Data pengajuan warga kurang mampu';

--
-- Indexes for dumped tables
--

--
-- Indexes for table `angsuran_pinjaman`
--
ALTER TABLE `angsuran_pinjaman`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pinjaman_id` (`pinjaman_id`),
  ADD KEY `petugas_id` (`petugas_id`);

--
-- Indexes for table `arisan`
--
ALTER TABLE `arisan`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `arisan_iuran`
--
ALTER TABLE `arisan_iuran`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pertemuan_id` (`pertemuan_id`),
  ADD KEY `peserta_id` (`peserta_id`),
  ADD KEY `warga_id` (`warga_id`);

--
-- Indexes for table `arisan_pertemuan`
--
ALTER TABLE `arisan_pertemuan`
  ADD PRIMARY KEY (`id`),
  ADD KEY `arisan_id` (`arisan_id`),
  ADD KEY `warga_id_tuan_rumah` (`warga_id_tuan_rumah`),
  ADD KEY `pemenang_warga_id` (`pemenang_warga_id`);

--
-- Indexes for table `arisan_peserta`
--
ALTER TABLE `arisan_peserta`
  ADD PRIMARY KEY (`id`),
  ADD KEY `arisan_id` (`arisan_id`),
  ADD KEY `warga_id` (`warga_id`);

--
-- Indexes for table `arisan_riwayat_pemenang`
--
ALTER TABLE `arisan_riwayat_pemenang`
  ADD PRIMARY KEY (`id`),
  ADD KEY `arisan_id` (`arisan_id`),
  ADD KEY `pertemuan_id` (`pertemuan_id`),
  ADD KEY `warga_id` (`warga_id`);

--
-- Indexes for table `bansos`
--
ALTER TABLE `bansos`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_bansos_warga_tahun` (`warga_id`,`tahun`) COMMENT 'Satu warga satu record per tahun',
  ADD KEY `idx_bansos_tahun` (`tahun`),
  ADD KEY `idx_bansos_status` (`status`),
  ADD KEY `idx_bansos_warga` (`warga_id`);

--
-- Indexes for table `cicilan_iuran`
--
ALTER TABLE `cicilan_iuran`
  ADD PRIMARY KEY (`id`),
  ADD KEY `pembayaran_iuran_id` (`pembayaran_iuran_id`);

--
-- Indexes for table `inventaris`
--
ALTER TABLE `inventaris`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `kode_barang` (`kode_barang`);

--
-- Indexes for table `inventaris_gallery`
--
ALTER TABLE `inventaris_gallery`
  ADD PRIMARY KEY (`id`),
  ADD KEY `inventaris_id` (`inventaris_id`);

--
-- Indexes for table `jadwal_kegiatan`
--
ALTER TABLE `jadwal_kegiatan`
  ADD PRIMARY KEY (`id`),
  ADD KEY `penanggung_jawab_id` (`penanggung_jawab_id`),
  ADD KEY `created_by` (`created_by`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_tanggal` (`tanggal_mulai`);

--
-- Indexes for table `jadwal_petugas`
--
ALTER TABLE `jadwal_petugas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jadwal_id` (`jadwal_id`),
  ADD KEY `warga_id` (`warga_id`);

--
-- Indexes for table `jadwal_warga`
--
ALTER TABLE `jadwal_warga`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_warga_tgl` (`warga_id`,`tanggal`);

--
-- Indexes for table `jenis_iuran`
--
ALTER TABLE `jenis_iuran`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `kode` (`kode`);

--
-- Indexes for table `jenis_pinjaman`
--
ALTER TABLE `jenis_pinjaman`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `kode` (`kode`);

--
-- Indexes for table `jenis_surat`
--
ALTER TABLE `jenis_surat`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `kode_surat` (`kode_surat`);

--
-- Indexes for table `kartu_keluarga`
--
ALTER TABLE `kartu_keluarga`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `no_kk` (`no_kk`),
  ADD KEY `kepala_keluarga_id` (`kepala_keluarga_id`);

--
-- Indexes for table `kas_rt`
--
ALTER TABLE `kas_rt`
  ADD PRIMARY KEY (`id`),
  ADD KEY `input_oleh` (`input_oleh`),
  ADD KEY `idx_tanggal_kas` (`tanggal`),
  ADD KEY `idx_jenis_kas` (`jenis`),
  ADD KEY `fk_kas_rt_master_kas` (`master_kas_id`);

--
-- Indexes for table `kegiatan`
--
ALTER TABLE `kegiatan`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_kategori` (`kategori`),
  ADD KEY `idx_tanggal_mulai` (`tanggal_mulai`),
  ADD KEY `fk_kegiatan_user` (`dibuat_oleh`);

--
-- Indexes for table `kegiatan_galeri`
--
ALTER TABLE `kegiatan_galeri`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_kegiatan_id` (`kegiatan_id`);

--
-- Indexes for table `kegiatan_rt`
--
ALTER TABLE `kegiatan_rt`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_tgl` (`tanggal`);

--
-- Indexes for table `log_aktivitas`
--
ALTER TABLE `log_aktivitas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `master_jabatan`
--
ALTER TABLE `master_jabatan`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `master_kas`
--
ALTER TABLE `master_kas`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `kode` (`kode`),
  ADD KEY `fk_master_kas_user` (`created_by`);

--
-- Indexes for table `master_pekerjaan`
--
ALTER TABLE `master_pekerjaan`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `master_pendidikan`
--
ALTER TABLE `master_pendidikan`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `menu_modules`
--
ALTER TABLE `menu_modules`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `slug` (`slug`),
  ADD KEY `idx_parent` (`parent_id`),
  ADD KEY `idx_slug` (`slug`);

--
-- Indexes for table `menu_permissions`
--
ALTER TABLE `menu_permissions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_module_role` (`module_id`,`role`);

--
-- Indexes for table `notulen_peserta`
--
ALTER TABLE `notulen_peserta`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_notulen_peserta` (`notulen_id`);

--
-- Indexes for table `notulen_poin`
--
ALTER TABLE `notulen_poin`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_notulen_poin` (`notulen_id`);

--
-- Indexes for table `notulen_rapat`
--
ALTER TABLE `notulen_rapat`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_tanggal` (`tanggal`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_tim` (`tim`),
  ADD KEY `fk_notulen_user` (`created_by`);

--
-- Indexes for table `pembayaran_iuran`
--
ALTER TABLE `pembayaran_iuran`
  ADD PRIMARY KEY (`id`),
  ADD KEY `warga_id` (`warga_id`),
  ADD KEY `jenis_iuran_id` (`jenis_iuran_id`),
  ADD KEY `diverifikasi_oleh` (`diverifikasi_oleh`),
  ADD KEY `idx_warga_id_iuran` (`warga_id`),
  ADD KEY `idx_status_iuran` (`status`),
  ADD KEY `idx_periode` (`periode_tahun`,`periode_bulan`),
  ADD KEY `fk_bayar_iuran_master_kas` (`master_kas_id`);

--
-- Indexes for table `pembayaran_pending`
--
ALTER TABLE `pembayaran_pending`
  ADD PRIMARY KEY (`id`),
  ADD KEY `angsuran_id` (`angsuran_id`),
  ADD KEY `warga_id` (`warga_id`);

--
-- Indexes for table `peminjaman_inventaris`
--
ALTER TABLE `peminjaman_inventaris`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `kode_pinjam` (`kode_pinjam`),
  ADD KEY `inventaris_id` (`inventaris_id`),
  ADD KEY `warga_id` (`warga_id`),
  ADD KEY `status` (`status`);

--
-- Indexes for table `pengaduan`
--
ALTER TABLE `pengaduan`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `kode_tiket` (`kode_tiket`);

--
-- Indexes for table `pengajuan_bayar_angsuran`
--
ALTER TABLE `pengajuan_bayar_angsuran`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `kode_bayar` (`kode_bayar`),
  ADD KEY `idx_pinjaman` (`pinjaman_id`),
  ADD KEY `idx_angsuran` (`angsuran_id`),
  ADD KEY `idx_warga` (`warga_id`),
  ADD KEY `idx_status` (`status`);

--
-- Indexes for table `pengajuan_pinjaman`
--
ALTER TABLE `pengajuan_pinjaman`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `kode_pengajuan` (`kode_pengajuan`),
  ADD KEY `warga_id` (`warga_id`),
  ADD KEY `jenis_pinjaman_id` (`jenis_pinjaman_id`),
  ADD KEY `disetujui_oleh` (`disetujui_oleh`);

--
-- Indexes for table `pengaturan`
--
ALTER TABLE `pengaturan`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `pengumuman`
--
ALTER TABLE `pengumuman`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_dibuat_oleh` (`dibuat_oleh`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_tanggal_publish` (`tanggal_publish`),
  ADD KEY `idx_kategori` (`kategori`),
  ADD KEY `idx_untuk_role` (`untuk_role`);

--
-- Indexes for table `permohonan_surat`
--
ALTER TABLE `permohonan_surat`
  ADD PRIMARY KEY (`id`),
  ADD KEY `warga_id` (`warga_id`),
  ADD KEY `jenis_surat_id` (`jenis_surat_id`),
  ADD KEY `diproses_oleh` (`diproses_oleh`),
  ADD KEY `idx_warga_id` (`warga_id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_tanggal_permohonan` (`tanggal_permohonan`);

--
-- Indexes for table `pinjaman`
--
ALTER TABLE `pinjaman`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `kode_pinjaman` (`kode_pinjaman`),
  ADD KEY `pengajuan_id` (`pengajuan_id`),
  ADD KEY `warga_id` (`warga_id`),
  ADD KEY `fk_pinjaman_kas_tabungan` (`kas_tabungan_id`),
  ADD KEY `fk_pinjaman_kas_rt` (`kas_rt_id`);

--
-- Indexes for table `polling`
--
ALTER TABLE `polling`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_tanggal` (`tanggal_mulai`,`tanggal_selesai`);

--
-- Indexes for table `polling_votes`
--
ALTER TABLE `polling_votes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_user_poll` (`polling_id`,`user_id`),
  ADD KEY `idx_polling` (`polling_id`);

--
-- Indexes for table `rencana_pembelian`
--
ALTER TABLE `rencana_pembelian`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_kode_rencana` (`kode_rencana`);

--
-- Indexes for table `riwayat_pembayaran_pinjaman`
--
ALTER TABLE `riwayat_pembayaran_pinjaman`
  ADD PRIMARY KEY (`id`),
  ADD KEY `angsuran_id` (`angsuran_id`),
  ADD KEY `pinjaman_id` (`pinjaman_id`),
  ADD KEY `petugas_id` (`petugas_id`);

--
-- Indexes for table `struktur_organisasi`
--
ALTER TABLE `struktur_organisasi`
  ADD PRIMARY KEY (`id`),
  ADD KEY `jabatan_id` (`jabatan_id`);

--
-- Indexes for table `tabungan`
--
ALTER TABLE `tabungan`
  ADD PRIMARY KEY (`id`),
  ADD KEY `warga_id` (`warga_id`);

--
-- Indexes for table `tamu`
--
ALTER TABLE `tamu`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_checkin` (`checkin_at`),
  ADD KEY `idx_kode` (`kode_tamu`);

--
-- Indexes for table `tamu_foto`
--
ALTER TABLE `tamu_foto`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_tamu_id` (`tamu_id`);

--
-- Indexes for table `transaksi_tabungan`
--
ALTER TABLE `transaksi_tabungan`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tabungan_id` (`tabungan_id`),
  ADD KEY `petugas_id` (`petugas_id`),
  ADD KEY `fk_transaksi_tabungan_master_kas` (`master_kas_id`);

--
-- Indexes for table `transfer_kas`
--
ALTER TABLE `transfer_kas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_dari` (`dari_kas_id`),
  ADD KEY `idx_ke` (`ke_kas_id`),
  ADD KEY `idx_tgl` (`tanggal`);

--
-- Indexes for table `umkm`
--
ALTER TABLE `umkm`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_umkm_kategori` (`kategori`),
  ADD KEY `idx_umkm_status` (`status`),
  ADD KEY `idx_umkm_warga` (`warga_id`),
  ADD KEY `idx_umkm_user` (`user_id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`),
  ADD KEY `fk_user_warga` (`warga_id`);

--
-- Indexes for table `warga`
--
ALTER TABLE `warga`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `nik` (`nik`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `idx_user_id_warga` (`user_id`),
  ADD KEY `kk_id` (`kk_id`);

--
-- Indexes for table `warga_kurang_mampu`
--
ALTER TABLE `warga_kurang_mampu`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_warga_id` (`warga_id`),
  ADD KEY `idx_status_pengajuan` (`status_pengajuan`),
  ADD KEY `idx_tgl_pengajuan` (`tgl_pengajuan`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `angsuran_pinjaman`
--
ALTER TABLE `angsuran_pinjaman`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;

--
-- AUTO_INCREMENT for table `arisan`
--
ALTER TABLE `arisan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;

--
-- AUTO_INCREMENT for table `arisan_iuran`
--
ALTER TABLE `arisan_iuran`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=241;

--
-- AUTO_INCREMENT for table `arisan_pertemuan`
--
ALTER TABLE `arisan_pertemuan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

--
-- AUTO_INCREMENT for table `arisan_peserta`
--
ALTER TABLE `arisan_peserta`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=244;

--
-- AUTO_INCREMENT for table `arisan_riwayat_pemenang`
--
ALTER TABLE `arisan_riwayat_pemenang`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `bansos`
--
ALTER TABLE `bansos`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `cicilan_iuran`
--
ALTER TABLE `cicilan_iuran`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `inventaris`
--
ALTER TABLE `inventaris`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `inventaris_gallery`
--
ALTER TABLE `inventaris_gallery`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;

--
-- AUTO_INCREMENT for table `jadwal_kegiatan`
--
ALTER TABLE `jadwal_kegiatan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `jadwal_petugas`
--
ALTER TABLE `jadwal_petugas`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `jadwal_warga`
--
ALTER TABLE `jadwal_warga`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `jenis_iuran`
--
ALTER TABLE `jenis_iuran`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `jenis_pinjaman`
--
ALTER TABLE `jenis_pinjaman`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `jenis_surat`
--
ALTER TABLE `jenis_surat`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=66;

--
-- AUTO_INCREMENT for table `kartu_keluarga`
--
ALTER TABLE `kartu_keluarga`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=393;

--
-- AUTO_INCREMENT for table `kas_rt`
--
ALTER TABLE `kas_rt`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=210;

--
-- AUTO_INCREMENT for table `kegiatan`
--
ALTER TABLE `kegiatan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `kegiatan_galeri`
--
ALTER TABLE `kegiatan_galeri`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `kegiatan_rt`
--
ALTER TABLE `kegiatan_rt`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `log_aktivitas`
--
ALTER TABLE `log_aktivitas`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=564;

--
-- AUTO_INCREMENT for table `master_jabatan`
--
ALTER TABLE `master_jabatan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `master_kas`
--
ALTER TABLE `master_kas`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `master_pekerjaan`
--
ALTER TABLE `master_pekerjaan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `master_pendidikan`
--
ALTER TABLE `master_pendidikan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `menu_modules`
--
ALTER TABLE `menu_modules`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=77;

--
-- AUTO_INCREMENT for table `menu_permissions`
--
ALTER TABLE `menu_permissions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=324;

--
-- AUTO_INCREMENT for table `notulen_peserta`
--
ALTER TABLE `notulen_peserta`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `notulen_poin`
--
ALTER TABLE `notulen_poin`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `notulen_rapat`
--
ALTER TABLE `notulen_rapat`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `pembayaran_iuran`
--
ALTER TABLE `pembayaran_iuran`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=507;

--
-- AUTO_INCREMENT for table `pembayaran_pending`
--
ALTER TABLE `pembayaran_pending`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `peminjaman_inventaris`
--
ALTER TABLE `peminjaman_inventaris`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `pengaduan`
--
ALTER TABLE `pengaduan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `pengajuan_bayar_angsuran`
--
ALTER TABLE `pengajuan_bayar_angsuran`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `pengajuan_pinjaman`
--
ALTER TABLE `pengajuan_pinjaman`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `pengaturan`
--
ALTER TABLE `pengaturan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `pengumuman`
--
ALTER TABLE `pengumuman`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `permohonan_surat`
--
ALTER TABLE `permohonan_surat`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `pinjaman`
--
ALTER TABLE `pinjaman`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `polling`
--
ALTER TABLE `polling`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `polling_votes`
--
ALTER TABLE `polling_votes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `rencana_pembelian`
--
ALTER TABLE `rencana_pembelian`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `riwayat_pembayaran_pinjaman`
--
ALTER TABLE `riwayat_pembayaran_pinjaman`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `struktur_organisasi`
--
ALTER TABLE `struktur_organisasi`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `tabungan`
--
ALTER TABLE `tabungan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `tamu`
--
ALTER TABLE `tamu`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `tamu_foto`
--
ALTER TABLE `tamu_foto`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `transaksi_tabungan`
--
ALTER TABLE `transaksi_tabungan`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;

--
-- AUTO_INCREMENT for table `transfer_kas`
--
ALTER TABLE `transfer_kas`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `umkm`
--
ALTER TABLE `umkm`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=667;

--
-- AUTO_INCREMENT for table `warga`
--
ALTER TABLE `warga`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1092;

--
-- AUTO_INCREMENT for table `warga_kurang_mampu`
--
ALTER TABLE `warga_kurang_mampu`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `angsuran_pinjaman`
--
ALTER TABLE `angsuran_pinjaman`
  ADD CONSTRAINT `angsuran_pinjaman_ibfk_1` FOREIGN KEY (`pinjaman_id`) REFERENCES `pinjaman` (`id`),
  ADD CONSTRAINT `angsuran_pinjaman_ibfk_2` FOREIGN KEY (`petugas_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `arisan_iuran`
--
ALTER TABLE `arisan_iuran`
  ADD CONSTRAINT `arisan_iuran_ibfk_1` FOREIGN KEY (`pertemuan_id`) REFERENCES `arisan_pertemuan` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `arisan_iuran_ibfk_2` FOREIGN KEY (`peserta_id`) REFERENCES `arisan_peserta` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `arisan_iuran_ibfk_3` FOREIGN KEY (`warga_id`) REFERENCES `warga` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `arisan_pertemuan`
--
ALTER TABLE `arisan_pertemuan`
  ADD CONSTRAINT `arisan_pertemuan_ibfk_1` FOREIGN KEY (`arisan_id`) REFERENCES `arisan` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `arisan_pertemuan_ibfk_2` FOREIGN KEY (`warga_id_tuan_rumah`) REFERENCES `warga` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `arisan_pertemuan_ibfk_3` FOREIGN KEY (`pemenang_warga_id`) REFERENCES `warga` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `arisan_peserta`
--
ALTER TABLE `arisan_peserta`
  ADD CONSTRAINT `arisan_peserta_ibfk_1` FOREIGN KEY (`arisan_id`) REFERENCES `arisan` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `arisan_peserta_ibfk_2` FOREIGN KEY (`warga_id`) REFERENCES `warga` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `arisan_riwayat_pemenang`
--
ALTER TABLE `arisan_riwayat_pemenang`
  ADD CONSTRAINT `arisan_riwayat_pemenang_ibfk_1` FOREIGN KEY (`arisan_id`) REFERENCES `arisan` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `arisan_riwayat_pemenang_ibfk_2` FOREIGN KEY (`pertemuan_id`) REFERENCES `arisan_pertemuan` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `arisan_riwayat_pemenang_ibfk_3` FOREIGN KEY (`warga_id`) REFERENCES `warga` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `inventaris_gallery`
--
ALTER TABLE `inventaris_gallery`
  ADD CONSTRAINT `inventaris_gallery_ibfk_1` FOREIGN KEY (`inventaris_id`) REFERENCES `inventaris` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `jadwal_kegiatan`
--
ALTER TABLE `jadwal_kegiatan`
  ADD CONSTRAINT `jadwal_kegiatan_ibfk_1` FOREIGN KEY (`penanggung_jawab_id`) REFERENCES `warga` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `jadwal_kegiatan_ibfk_2` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `jadwal_petugas`
--
ALTER TABLE `jadwal_petugas`
  ADD CONSTRAINT `jadwal_petugas_ibfk_1` FOREIGN KEY (`jadwal_id`) REFERENCES `jadwal_kegiatan` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `jadwal_petugas_ibfk_2` FOREIGN KEY (`warga_id`) REFERENCES `warga` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `jadwal_warga`
--
ALTER TABLE `jadwal_warga`
  ADD CONSTRAINT `jadwal_warga_ibfk_1` FOREIGN KEY (`warga_id`) REFERENCES `warga` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `kartu_keluarga`
--
ALTER TABLE `kartu_keluarga`
  ADD CONSTRAINT `kartu_keluarga_ibfk_1` FOREIGN KEY (`kepala_keluarga_id`) REFERENCES `warga` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `kas_rt`
--
ALTER TABLE `kas_rt`
  ADD CONSTRAINT `fk_kas_rt_master_kas` FOREIGN KEY (`master_kas_id`) REFERENCES `master_kas` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `kas_rt_ibfk_1` FOREIGN KEY (`input_oleh`) REFERENCES `users` (`id`);

--
-- Constraints for table `kegiatan`
--
ALTER TABLE `kegiatan`
  ADD CONSTRAINT `fk_kegiatan_user` FOREIGN KEY (`dibuat_oleh`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `kegiatan_galeri`
--
ALTER TABLE `kegiatan_galeri`
  ADD CONSTRAINT `fk_galeri_kegiatan` FOREIGN KEY (`kegiatan_id`) REFERENCES `kegiatan` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `log_aktivitas`
--
ALTER TABLE `log_aktivitas`
  ADD CONSTRAINT `log_aktivitas_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `master_kas`
--
ALTER TABLE `master_kas`
  ADD CONSTRAINT `fk_master_kas_user` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `menu_permissions`
--
ALTER TABLE `menu_permissions`
  ADD CONSTRAINT `fk_mp_module` FOREIGN KEY (`module_id`) REFERENCES `menu_modules` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `notulen_peserta`
--
ALTER TABLE `notulen_peserta`
  ADD CONSTRAINT `fk_peserta_notulen` FOREIGN KEY (`notulen_id`) REFERENCES `notulen_rapat` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `notulen_poin`
--
ALTER TABLE `notulen_poin`
  ADD CONSTRAINT `fk_poin_notulen` FOREIGN KEY (`notulen_id`) REFERENCES `notulen_rapat` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `pembayaran_iuran`
--
ALTER TABLE `pembayaran_iuran`
  ADD CONSTRAINT `fk_bayar_iuran_master_kas` FOREIGN KEY (`master_kas_id`) REFERENCES `master_kas` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `pembayaran_iuran_ibfk_1` FOREIGN KEY (`warga_id`) REFERENCES `warga` (`id`),
  ADD CONSTRAINT `pembayaran_iuran_ibfk_2` FOREIGN KEY (`jenis_iuran_id`) REFERENCES `jenis_iuran` (`id`),
  ADD CONSTRAINT `pembayaran_iuran_ibfk_3` FOREIGN KEY (`diverifikasi_oleh`) REFERENCES `users` (`id`);

--
-- Constraints for table `pengajuan_pinjaman`
--
ALTER TABLE `pengajuan_pinjaman`
  ADD CONSTRAINT `pengajuan_pinjaman_ibfk_1` FOREIGN KEY (`warga_id`) REFERENCES `warga` (`id`),
  ADD CONSTRAINT `pengajuan_pinjaman_ibfk_2` FOREIGN KEY (`jenis_pinjaman_id`) REFERENCES `jenis_pinjaman` (`id`),
  ADD CONSTRAINT `pengajuan_pinjaman_ibfk_3` FOREIGN KEY (`disetujui_oleh`) REFERENCES `users` (`id`);

--
-- Constraints for table `pengumuman`
--
ALTER TABLE `pengumuman`
  ADD CONSTRAINT `fk_pengumuman_user` FOREIGN KEY (`dibuat_oleh`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `permohonan_surat`
--
ALTER TABLE `permohonan_surat`
  ADD CONSTRAINT `permohonan_surat_ibfk_1` FOREIGN KEY (`warga_id`) REFERENCES `warga` (`id`),
  ADD CONSTRAINT `permohonan_surat_ibfk_2` FOREIGN KEY (`jenis_surat_id`) REFERENCES `jenis_surat` (`id`),
  ADD CONSTRAINT `permohonan_surat_ibfk_3` FOREIGN KEY (`diproses_oleh`) REFERENCES `users` (`id`);

--
-- Constraints for table `pinjaman`
--
ALTER TABLE `pinjaman`
  ADD CONSTRAINT `fk_pinjaman_kas_rt` FOREIGN KEY (`kas_rt_id`) REFERENCES `master_kas` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `fk_pinjaman_kas_tabungan` FOREIGN KEY (`kas_tabungan_id`) REFERENCES `master_kas` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `pinjaman_ibfk_1` FOREIGN KEY (`pengajuan_id`) REFERENCES `pengajuan_pinjaman` (`id`),
  ADD CONSTRAINT `pinjaman_ibfk_2` FOREIGN KEY (`warga_id`) REFERENCES `warga` (`id`);

--
-- Constraints for table `polling_votes`
--
ALTER TABLE `polling_votes`
  ADD CONSTRAINT `fk_vote_polling` FOREIGN KEY (`polling_id`) REFERENCES `polling` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `riwayat_pembayaran_pinjaman`
--
ALTER TABLE `riwayat_pembayaran_pinjaman`
  ADD CONSTRAINT `riwayat_pembayaran_pinjaman_ibfk_1` FOREIGN KEY (`angsuran_id`) REFERENCES `angsuran_pinjaman` (`id`),
  ADD CONSTRAINT `riwayat_pembayaran_pinjaman_ibfk_2` FOREIGN KEY (`pinjaman_id`) REFERENCES `pinjaman` (`id`),
  ADD CONSTRAINT `riwayat_pembayaran_pinjaman_ibfk_3` FOREIGN KEY (`petugas_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `struktur_organisasi`
--
ALTER TABLE `struktur_organisasi`
  ADD CONSTRAINT `struktur_organisasi_ibfk_1` FOREIGN KEY (`jabatan_id`) REFERENCES `master_jabatan` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `tabungan`
--
ALTER TABLE `tabungan`
  ADD CONSTRAINT `tabungan_ibfk_1` FOREIGN KEY (`warga_id`) REFERENCES `warga` (`id`);

--
-- Constraints for table `transaksi_tabungan`
--
ALTER TABLE `transaksi_tabungan`
  ADD CONSTRAINT `fk_transaksi_tabungan_master_kas` FOREIGN KEY (`master_kas_id`) REFERENCES `master_kas` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `transaksi_tabungan_ibfk_1` FOREIGN KEY (`tabungan_id`) REFERENCES `tabungan` (`id`),
  ADD CONSTRAINT `transaksi_tabungan_ibfk_2` FOREIGN KEY (`petugas_id`) REFERENCES `users` (`id`);

--
-- Constraints for table `warga`
--
ALTER TABLE `warga`
  ADD CONSTRAINT `warga_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `warga_ibfk_2` FOREIGN KEY (`kk_id`) REFERENCES `kartu_keluarga` (`id`) ON DELETE SET NULL;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
