text: -- phpMyAdmin SQL Dump
  -- version 4.8.5
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Dec 14, 2020 at 07:30 PM
  -- Server version: 10.1.38-MariaDB
  -- PHP Version: 7.3.4
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  SET AUTOCOMMIT = 0;
  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: `perpus`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `buku`
  --
  
  CREATE TABLE `buku` (
    `id` int(11) NOT NULL,
    `kategori_id` int(11) NOT NULL,
    `judul` varchar(128) NOT NULL,
    `penulis` varchar(128) NOT NULL,
    `penerbit` varchar(128) NOT NULL,
    `kode_buku` varchar(128) NOT NULL,
    `tahun` varchar(128) NOT NULL,
    `stok` varchar(128) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `buku`
  --
  
  INSERT INTO `buku` (`id`, `kategori_id`, `judul`, `penulis`, `penerbit`, `kode_buku`, `tahun`, `stok`) VALUES
  (8, 2, 'Belajar CodeIgniter dengan mudah', 'akbar', 'penerbitbuku.com', 'BKU-BA8PPV', '2020', '3'),
  (9, 4, 'Cara menghitung dengan Baik dengan aritmatika', 'edi supono', 'penerbitbuku.com', 'BKU-C6U3FC', '2010', '10'),
  (10, 6, 'Cara Belajar IQRA dengan baik ', 'ustadz endam  ', 'penerbitbuku.com', 'BKU-CF6FZ4', '2020', '10');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `kategori`
  --
  
  CREATE TABLE `kategori` (
    `id` int(11) NOT NULL,
    `nama` varchar(128) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `kategori`
  --
  
  INSERT INTO `kategori` (`id`, `nama`) VALUES
  (2, 'Pemograman'),
  (4, 'Matematika'),
  (5, 'Ilmu Pengetahuan Alam'),
  (6, 'Pengetahuan Agama Islam'),
  (7, 'Ilmiah');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `peminjam`
  --
  
  CREATE TABLE `peminjam` (
    `id` int(11) NOT NULL,
    `nama` varchar(128) NOT NULL,
    `nim` varchar(128) NOT NULL,
    `buku_id` int(11) NOT NULL,
    `no_hp` varchar(128) NOT NULL,
    `tanggal_pinjam` date NOT NULL,
    `tanggal_kembali` date NOT NULL,
    `status` enum('Dipinjam','Kembali') NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `peminjam`
  --
  
  INSERT INTO `peminjam` (`id`, `nama`, `nim`, `buku_id`, `no_hp`, `tanggal_pinjam`, `tanggal_kembali`, `status`) VALUES
  (7, 'galih', '12191632', 8, '0857165220', '2020-12-15', '2020-12-14', 'Kembali'),
  (8, 'Geri Geraldi', '12191633', 10, '085714393241', '2020-12-15', '2020-12-26', 'Dipinjam');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `user`
  --
  
  CREATE TABLE `user` (
    `id` int(11) NOT NULL,
    `name` varchar(128) NOT NULL,
    `email` varchar(128) NOT NULL,
    `image` varchar(128) NOT NULL,
    `password` varchar(256) NOT NULL,
    `role_id` int(11) NOT NULL,
    `is_active` int(1) NOT NULL,
    `date_created` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `user`
  --
  
  INSERT INTO `user` (`id`, `name`, `email`, `image`, `password`, `role_id`, `is_active`, `date_created`) VALUES
  (2, 'petugas', 'petugas@gmail.com', 'default.jpg', '$2y$10$/9VRLZKnTQucKlJS3fNy9uQVFrd00Juo90Cewik/uqaGbMTPJtO6O', 2, 1, 1607275901),
  (3, 'admin', 'admin@gmail.com', 'book.png', '$2y$10$R8iI1P4h75SeQZiGUuXvr.1biOBNnMZ0NeV6r3Qd8YSHt070QvypG', 1, 1, 1607667918);
  
  -- --------------------------------------------------------
  
  --
  -- 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=latin1;
  
  --
  -- Dumping data for table `user_access_menu`
  --
  
  INSERT INTO `user_access_menu` (`id`, `role_id`, `menu_id`) VALUES
  (1, 1, 1),
  (2, 1, 2),
  (3, 2, 2),
  (5, 1, 3),
  (13, 4, 3),
  (14, 3, 3),
  (15, 3, 2);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `user_menu`
  --
  
  CREATE TABLE `user_menu` (
    `id` int(11) NOT NULL,
    `menu` varchar(128) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `user_menu`
  --
  
  INSERT INTO `user_menu` (`id`, `menu`) VALUES
  (1, 'Admin'),
  (2, 'User'),
  (3, 'Menu');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `user_role`
  --
  
  CREATE TABLE `user_role` (
    `id` int(11) NOT NULL,
    `role` varchar(128) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `user_role`
  --
  
  INSERT INTO `user_role` (`id`, `role`) VALUES
  (1, 'Administrator'),
  (2, 'Member');
  
  -- --------------------------------------------------------
  
  --
  -- 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,
    `icon` varchar(128) NOT NULL,
    `is_active` int(1) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `user_sub_menu`
  --
  
  INSERT INTO `user_sub_menu` (`id`, `menu_id`, `title`, `url`, `icon`, `is_active`) VALUES
  (1, 1, 'Dashboard', 'admin', 'fas fa-fw fa-tachometer-alt', 1),
  (2, 2, 'My Profile', 'user', 'fas fa-fw fa-user', 1),
  (3, 2, 'Edit Profile', 'user/edit', 'fas fa-fw fa-user-edit', 1),
  (4, 3, 'Menu Management', 'menu/index', 'fas fa-fw fa-folder', 1),
  (5, 3, 'Submenu Management', 'menu/submenu', 'fas fa-fw fa-folder-open', 1),
  (6, 1, 'Role', 'admin/role', 'fas fa-fw fa-user-tie', 1),
  (7, 2, 'Change Password', 'User/changepassword', 'fas fa-fw fa-key', 1),
  (8, 2, 'Daftar Buku', 'buku', 'fas fa-fw fa-book', 1),
  (11, 2, 'Kategori Buku', 'buku/kategori', 'fa fa-fw fa-circle', 1),
  (13, 2, 'Transaksi Pinjam', 'peminjam', 'fa fa-fw fa-credit-card', 1);
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `buku`
  --
  ALTER TABLE `buku`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `kategori`
  --
  ALTER TABLE `kategori`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `peminjam`
  --
  ALTER TABLE `peminjam`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `user`
  --
  ALTER TABLE `user`
    ADD PRIMARY KEY (`id`);
  
  --
  -- 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_role`
  --
  ALTER TABLE `user_role`
    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 `buku`
  --
  ALTER TABLE `buku`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
  
  --
  -- AUTO_INCREMENT for table `kategori`
  --
  ALTER TABLE `kategori`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
  
  --
  -- AUTO_INCREMENT for table `peminjam`
  --
  ALTER TABLE `peminjam`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
  
  --
  -- AUTO_INCREMENT for table `user`
  --
  ALTER TABLE `user`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- AUTO_INCREMENT for table `user_access_menu`
  --
  ALTER TABLE `user_access_menu`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
  
  --
  -- AUTO_INCREMENT for table `user_menu`
  --
  ALTER TABLE `user_menu`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  
  --
  -- AUTO_INCREMENT for table `user_role`
  --
  ALTER TABLE `user_role`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- AUTO_INCREMENT for table `user_sub_menu`
  --
  ALTER TABLE `user_sub_menu`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
  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 */;
  