text: -- phpMyAdmin SQL Dump
  -- version 5.0.2
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Apr 14, 2020 at 09:35 PM
  -- Server version: 10.4.11-MariaDB
  -- PHP Version: 7.4.4
  
  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: `db_pengaduan`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `masyarakat`
  --
  
  CREATE TABLE `masyarakat` (
    `nik` char(16) COLLATE utf8mb4_unicode_ci NOT NULL,
    `id_user` bigint(20) NOT NULL,
    `nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `telp` varchar(13) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `masyarakat`
  --
  
  INSERT INTO `masyarakat` (`nik`, `id_user`, `nama`, `username`, `password`, `telp`, `created_at`, `updated_at`) VALUES
  ('1212345323126543', 3, 'oskar', 'oskar', '$2y$10$3zMm20r/feXxR2eg.tnbJemk2BMoQm.Dyo5KsQUty3e24OZHNwLqu', '123412345432', '2020-04-12 12:43:15', '2020-04-12 12:43:15'),
  ('3273122508020003', 4, 'Oskar Rahen Agusta', 'user', '$2y$10$nycTmcVv6ubQY/t41o7XLuLcKkAmLcHRyk8HyTBpyX0YBtbCh3Rmy', '088218814584', '2020-04-13 08:17:20', '2020-04-13 08:17:20');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `migrations`
  --
  
  CREATE TABLE `migrations` (
    `id` int(10) UNSIGNED NOT NULL,
    `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `batch` int(11) NOT NULL
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `migrations`
  --
  
  INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
  (1, '2020_04_06_041223_create_masyarakat_table', 1),
  (2, '2020_04_06_041447_create_pengaduan_table', 1),
  (3, '2020_04_06_041502_create_petugas_table', 1),
  (4, '2020_04_06_041516_create_tanggapan_table', 1),
  (5, '2020_04_06_054307_create_users_table', 2);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `pengaduan`
  --
  
  CREATE TABLE `pengaduan` (
    `id_pengaduan` int(11) NOT NULL,
    `tgl_pengaduan` date NOT NULL,
    `nik` char(16) COLLATE utf8mb4_unicode_ci NOT NULL,
    `isi_laporan` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `foto` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `status` enum('0','proses','selesai') COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `pengaduan`
  --
  
  INSERT INTO `pengaduan` (`id_pengaduan`, `tgl_pengaduan`, `nik`, `isi_laporan`, `foto`, `status`, `created_at`, `updated_at`) VALUES
  (7, '2020-04-12', '1212345323126543', 'test', '600px-Overture.png', 'selesai', '2020-04-12 12:43:41', '2020-04-12 12:44:12'),
  (8, '2020-04-13', '3273122508020003', 'test', '600px-Overture.png', 'selesai', '2020-04-13 09:13:03', '2020-04-13 12:33:43'),
  (10, '2020-04-13', '3273122508020003', 'Banjir Dijalan Jakarta', 'Sketchpad.png', 'selesai', '2020-04-13 11:55:20', '2020-04-13 15:09:33'),
  (11, '2020-04-13', '3273122508020003', 'Banjirrrrrr', 'lion-3317670__340.jpg', 'proses', '2020-04-13 15:04:11', '2020-04-13 15:09:23'),
  (12, '2020-04-13', '3273122508020003', 'Waladdolin Korona', 'Capture.PNG', 'proses', '2020-04-13 15:04:42', '2020-04-13 15:09:26');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `petugas`
  --
  
  CREATE TABLE `petugas` (
    `id_petugas` int(11) NOT NULL,
    `id_user` bigint(20) NOT NULL,
    `nama_petugas` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `telp` varchar(13) COLLATE utf8mb4_unicode_ci NOT NULL,
    `level` enum('admin','petugas') COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `petugas`
  --
  
  INSERT INTO `petugas` (`id_petugas`, `id_user`, `nama_petugas`, `username`, `password`, `telp`, `level`, `created_at`, `updated_at`) VALUES
  (1, 1, 'admin', 'admin', '$2y$10$frm8/tbLV7UC1HV/dZgMh.mhU1qxeG3rLVe6RMZvWaHO.jxe1ochS', '0', 'admin', '2020-04-12 02:26:16', '2020-04-12 02:26:16'),
  (6, 2, 'petugas', 'petugas', '$2y$10$JL.TZoFjEigR0Oy3KeCiKeP7Bn6H0mI2YB.McZ5WcIToXe6Cd5DCu', '098723457654', 'petugas', '2020-04-12 12:42:23', '2020-04-12 12:42:23');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tanggapan`
  --
  
  CREATE TABLE `tanggapan` (
    `id_tanggapan` int(11) NOT NULL,
    `id_pengaduan` int(11) NOT NULL,
    `tgl_tanggapan` date NOT NULL,
    `tanggapan` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `id_petugas` int(11) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `tanggapan`
  --
  
  INSERT INTO `tanggapan` (`id_tanggapan`, `id_pengaduan`, `tgl_tanggapan`, `tanggapan`, `id_petugas`, `created_at`, `updated_at`) VALUES
  (1, 7, '2020-04-13', 'Segera Dilaksanakan', 6, '2020-04-12 12:44:12', '2020-04-13 12:30:59'),
  (2, 8, '2020-04-13', 'Dilaksanakan', 6, '2020-04-13 12:33:43', '2020-04-13 12:33:43'),
  (3, 10, '2020-04-13', 'oke', 6, '2020-04-13 15:09:33', '2020-04-13 15:09:33'),
  (4, 10, '2020-04-13', 'oke', 6, '2020-04-13 15:09:34', '2020-04-13 15:09:34');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users`
  --
  
  CREATE TABLE `users` (
    `id` bigint(20) UNSIGNED NOT NULL,
    `username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
    `level` enum('admin','petugas','masyarakat') COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  --
  -- Dumping data for table `users`
  --
  
  INSERT INTO `users` (`id`, `username`, `password`, `level`, `created_at`, `updated_at`) VALUES
  (1, 'admin', '$2y$10$BIOy8wJ/.ykTuCnBOhbmsuUE08DGirmm2rn5XMVxra9HeD0YPp.Q6', 'admin', '2020-04-12 02:26:16', '2020-04-12 02:26:16'),
  (2, 'petugas', '$2y$10$JL.TZoFjEigR0Oy3KeCiKeP7Bn6H0mI2YB.McZ5WcIToXe6Cd5DCu', 'petugas', '2020-04-12 12:42:23', '2020-04-12 12:42:23'),
  (3, 'oskar', '$2y$10$3zMm20r/feXxR2eg.tnbJemk2BMoQm.Dyo5KsQUty3e24OZHNwLqu', 'masyarakat', '2020-04-12 12:43:15', '2020-04-12 12:43:15'),
  (4, 'user', '$2y$10$nycTmcVv6ubQY/t41o7XLuLcKkAmLcHRyk8HyTBpyX0YBtbCh3Rmy', 'masyarakat', '2020-04-13 08:17:20', '2020-04-13 08:17:20');
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `masyarakat`
  --
  ALTER TABLE `masyarakat`
    ADD PRIMARY KEY (`nik`);
  
  --
  -- Indexes for table `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `pengaduan`
  --
  ALTER TABLE `pengaduan`
    ADD PRIMARY KEY (`id_pengaduan`),
    ADD KEY `FK_NIK` (`nik`);
  
  --
  -- Indexes for table `petugas`
  --
  ALTER TABLE `petugas`
    ADD PRIMARY KEY (`id_petugas`);
  
  --
  -- Indexes for table `tanggapan`
  --
  ALTER TABLE `tanggapan`
    ADD PRIMARY KEY (`id_tanggapan`),
    ADD KEY `FK_PENGADUAN` (`id_pengaduan`),
    ADD KEY `FK_PETUGAS` (`id_petugas`);
  
  --
  -- Indexes for table `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
  
  --
  -- AUTO_INCREMENT for table `pengaduan`
  --
  ALTER TABLE `pengaduan`
    MODIFY `id_pengaduan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
  
  --
  -- AUTO_INCREMENT for table `petugas`
  --
  ALTER TABLE `petugas`
    MODIFY `id_petugas` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
  
  --
  -- AUTO_INCREMENT for table `tanggapan`
  --
  ALTER TABLE `tanggapan`
    MODIFY `id_tanggapan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  
  --
  -- AUTO_INCREMENT for table `users`
  --
  ALTER TABLE `users`
    MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `pengaduan`
  --
  ALTER TABLE `pengaduan`
    ADD CONSTRAINT `FK_NIK` FOREIGN KEY (`nik`) REFERENCES `masyarakat` (`nik`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `tanggapan`
  --
  ALTER TABLE `tanggapan`
    ADD CONSTRAINT `FK_PENGADUAN` FOREIGN KEY (`id_pengaduan`) REFERENCES `pengaduan` (`id_pengaduan`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `FK_PETUGAS` FOREIGN KEY (`id_petugas`) REFERENCES `petugas` (`id_petugas`) ON DELETE CASCADE ON UPDATE CASCADE;
  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 */;
  