-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 09, 2024 at 12:44 PM
-- Server version: 10.4.28-MariaDB
-- PHP Version: 8.0.28

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_koperasita`
--

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

--
-- Table structure for table `angsuran`
--

CREATE TABLE `angsuran` (
  `id` int(11) NOT NULL,
  `no_pinjaman` varchar(7) NOT NULL,
  `angsuran` int(3) NOT NULL,
  `jatuh_tempo` date NOT NULL,
  `tgl_bayar` date DEFAULT NULL,
  `bayar` int(10) NOT NULL,
  `sisa` int(10) NOT NULL,
  `denda` int(10) DEFAULT NULL,
  `jumlah` int(10) NOT NULL,
  `status` varchar(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `angsuran`
--

INSERT INTO `angsuran` (`id`, `no_pinjaman`, `angsuran`, `jatuh_tempo`, `tgl_bayar`, `bayar`, `sisa`, `denda`, `jumlah`, `status`) VALUES
(159, '1004', 1, '2024-07-11', '0000-00-00', 255000, 255000, 0, 255000, '2'),
(160, '1004', 2, '2024-08-11', '0000-00-00', 255000, 0, 0, 255000, '2'),
(161, '1005', 1, '2024-07-11', '0000-00-00', 127500, 127500, 0, 127500, '2'),
(162, '1005', 2, '2024-08-11', '0000-00-00', 127500, 0, 0, 127500, '2'),
(163, '1006', 1, '2024-07-15', '0000-00-00', 105000, 420000, 0, 105000, '2'),
(164, '1006', 2, '2024-08-15', '0000-00-00', 105000, 315000, 0, 105000, '2'),
(165, '1006', 3, '2024-09-15', '0000-00-00', 105000, 210000, 0, 105000, '2'),
(166, '1006', 4, '2024-10-15', '0000-00-00', 105000, 105000, 0, 105000, '2'),
(167, '1006', 5, '2024-11-15', '0000-00-00', 105000, 0, 0, 105000, '2'),
(168, '1007', 1, '2024-08-09', '0000-00-00', 260000, 780000, 0, 260000, '2'),
(169, '1007', 2, '2024-09-09', NULL, 260000, 520000, 0, 260000, '0'),
(170, '1007', 3, '2024-10-09', NULL, 260000, 260000, 0, 260000, '0'),
(171, '1007', 4, '2024-11-09', NULL, 260000, 0, 0, 260000, '0'),
(172, '1008', 1, '2024-08-09', NULL, 257500, 515000, 0, 257500, '0'),
(173, '1008', 2, '2024-09-09', NULL, 257500, 257500, 0, 257500, '0'),
(174, '1008', 3, '2024-10-09', NULL, 257500, 0, 0, 257500, '0');

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

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

CREATE TABLE `pinjaman` (
  `no_pinjaman` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `pinjaman_pokok` int(10) NOT NULL,
  `bunga` int(11) NOT NULL,
  `tgl_pinjaman` date DEFAULT NULL,
  `jangka_waktu` int(11) NOT NULL,
  `tgl_selesai` date NOT NULL,
  `angsuran` int(10) NOT NULL,
  `keterangan` int(1) NOT NULL DEFAULT 1,
  `status` int(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `pinjaman`
--

INSERT INTO `pinjaman` (`no_pinjaman`, `username`, `pinjaman_pokok`, `bunga`, `tgl_pinjaman`, `jangka_waktu`, `tgl_selesai`, `angsuran`, `keterangan`, `status`) VALUES
(1004, 'Nurhi123', 500000, 1, '2024-06-11', 2, '2024-08-11', 255000, 2, 1),
(1005, 'Nurhi123', 250000, 1, '2024-06-11', 2, '2024-08-11', 127500, 2, 1),
(1006, 'Ani', 500000, 1, '2024-06-15', 5, '2024-11-15', 105000, 2, 1),
(1007, 'Nurhi123', 1000000, 1, '2024-07-09', 4, '2024-11-09', 260000, 2, 0),
(1008, 'admin', 750000, 1, '2024-07-09', 3, '2024-10-09', 257500, 2, 0);

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

--
-- Table structure for table `simpanan`
--

CREATE TABLE `simpanan` (
  `no_simpanan` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `tgl_simpanan` date NOT NULL,
  `simpanan` int(11) DEFAULT NULL,
  `jenis_simpanan` varchar(20) DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `simpanan`
--

INSERT INTO `simpanan` (`no_simpanan`, `username`, `tgl_simpanan`, `simpanan`, `jenis_simpanan`, `status`) VALUES
(1009, 'Nurhi123', '2024-06-11', 2000000, 'Simpanan Pokok', 2),
(1013, 'Nurhi123', '2024-06-11', 1500000, 'Simpanan Wajib', 2),
(1014, 'Nurhi123', '2024-06-11', 500000, 'Simpanan Sukarela', 0),
(1015, 'admin', '2024-06-12', 2500000, 'Simpanan Sukarela', 2),
(1016, 'Ani', '2024-06-15', 2000000, 'Simpanan Pokok', 2);

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

--
-- Table structure for table `user`
--

CREATE TABLE `user` (
  `username` varchar(50) NOT NULL,
  `password` varchar(100) NOT NULL,
  `nama_lengkap` varchar(50) NOT NULL,
  `level` int(1) NOT NULL DEFAULT 1,
  `aktif` int(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user`
--

INSERT INTO `user` (`username`, `password`, `nama_lengkap`, `level`, `aktif`) VALUES
('Nurhi123', '$2y$10$vhqPpC/jCWm..CB/VUWQyeJdVttZ6eWB1UGVCdGCwFsW6DjoLHsmu', 'Nurhi', 1, 2),
('admin', '$2y$10$TNWLn10upvrazBB8HSpkDetiNE2RuBDrqeDSqgDHciXwJtaQw4F9W', 'Arif Nur Hidayat', 2, 2),
('Ani', '$2y$10$saKqPFWScixj3nQh1Sf/Qev.LAvo/rlt0KcmjX687ts0ILiX9gugC', 'Ghani Nur', 1, 2),
('admin1', '$2y$10$zhJnR6dXhwSRKD6fKkSUtOs5tzmG9id/1ahHttFGdXsMPExiP1UWe', 'Ghani Nur', 2, 2),
('admin2', '$2y$10$BXYt3QXGd2V0kkPHUUybFe12xJHiBfloK/C6wmqxHoYZGeH6KVO/y', 'Arif Nur', 2, 2);

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

--
-- Table structure for table `userdata`
--

CREATE TABLE `userdata` (
  `username` varchar(50) NOT NULL,
  `nama_lengkap` varchar(100) NOT NULL,
  `tempat_lahir` varchar(50) NOT NULL,
  `tanggal_lahir` date NOT NULL,
  `jenis_kelamin` varchar(11) NOT NULL,
  `alamat` varchar(200) NOT NULL,
  `no_hp` varchar(14) NOT NULL,
  `profil` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `userdata`
--

INSERT INTO `userdata` (`username`, `nama_lengkap`, `tempat_lahir`, `tanggal_lahir`, `jenis_kelamin`, `alamat`, `no_hp`, `profil`) VALUES
('Nurhi123', 'Nurhidayat', 'Tunggulrejo', '2003-02-05', 'Laki - Laki', 'Tunggulrejo', '085540512981', 'default3.jpg'),
('admin', 'Arif Nur Hidayat', 'Tunggulrejo', '2002-02-05', 'Laki - Laki', 'Tunggulrejo', '085540512981', 'default.jpg'),
('Ani', 'Ghani Nur', 'Ketawang', '1999-06-16', 'Perempuan', 'Ketawang', '085540512988', 'default.jpg'),
('admin1', 'Ghani Nur', 'Grabag', '1997-06-17', 'Laki - Laki', 'Grabag', '085540519953', 'default11.jpg'),
('admin2', 'Arif Nur', 'Ketawang', '2001-07-17', 'Laki - Laki', 'Ketawang', '085540516442', 'default5.jpg');

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

--
-- Table structure for table `user_access_menu`
--

CREATE TABLE `user_access_menu` (
  `id` int(11) NOT NULL,
  `role_id` int(11) NOT NULL,
  `menu_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_access_menu`
--

INSERT INTO `user_access_menu` (`id`, `role_id`, `menu_id`) VALUES
(1, 2, 1),
(2, 2, 2),
(3, 1, 1),
(4, 2, 3),
(5, 2, 4),
(6, 2, 6),
(7, 2, 7),
(8, 2, 8),
(9, 1, 3),
(10, 1, 5),
(11, 1, 6),
(12, 1, 8);

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

--
-- Table structure for table `user_menu`
--

CREATE TABLE `user_menu` (
  `id` int(11) NOT NULL,
  `menu` varchar(128) NOT NULL,
  `icon` varchar(128) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_menu`
--

INSERT INTO `user_menu` (`id`, `menu`, `icon`) VALUES
(1, 'Dashboard', 'flaticon-025-dashboard'),
(2, 'Pengguna & Pengurus', 'flaticon-381-user-9'),
(3, 'Pinjaman', 'flaticon-381-add-3'),
(4, 'Simpanan', 'flaticon-381-add-1'),
(5, 'Simpanan', 'flaticon-381-add-1'),
(6, 'SHU', 'flaticon-045-heart'),
(7, 'Laporan', 'flaticon-072-printer'),
(8, 'Simulasi Pinjaman', 'flaticon-381-calculator-1');

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

--
-- Table structure for table `user_sub_menu`
--

CREATE TABLE `user_sub_menu` (
  `id` int(11) NOT NULL,
  `menu_id` int(11) NOT NULL,
  `title` varchar(128) NOT NULL,
  `url` varchar(128) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_sub_menu`
--

INSERT INTO `user_sub_menu` (`id`, `menu_id`, `title`, `url`) VALUES
(1, 1, 'Dashboard', 'admin'),
(2, 3, 'Data Pinjaman', 'pinjaman'),
(3, 3, 'Tagihan Pinjaman', 'pinjaman/tagihan'),
(4, 4, 'Data Simpanan', 'simpanan');

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `pinjaman`
--
ALTER TABLE `pinjaman`
  ADD PRIMARY KEY (`no_pinjaman`);

--
-- Indexes for table `simpanan`
--
ALTER TABLE `simpanan`
  ADD PRIMARY KEY (`no_simpanan`);

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

--
-- AUTO_INCREMENT for table `simpanan`
--
ALTER TABLE `simpanan`
  MODIFY `no_simpanan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1017;

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

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

--
-- AUTO_INCREMENT for table `user_sub_menu`
--
ALTER TABLE `user_sub_menu`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
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 */;
