text: -- phpMyAdmin SQL Dump
  -- version 5.0.2
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Jan 04, 2021 at 07:40 AM
  -- Server version: 10.4.14-MariaDB
  -- PHP Version: 7.2.33
  
  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: `perpus`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `admin`
  --
  
  CREATE TABLE `admin` (
    `id_admin` int(5) NOT NULL,
    `nama_admin` varchar(25) NOT NULL,
    `username` varchar(25) NOT NULL,
    `password` varchar(35) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `admin`
  --
  
  INSERT INTO `admin` (`id_admin`, `nama_admin`, `username`, `password`) VALUES
  (1, 'aflan', 'anaknakal', 'b6af3f19458ec8e6faff8ee1e0440ecb');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `anggota`
  --
  
  CREATE TABLE `anggota` (
    `id_anggota` int(5) NOT NULL,
    `nama_anggota` varchar(45) NOT NULL,
    `gender` enum('Laki-Laki','Perempuan') NOT NULL,
    `no_telp` varchar(15) NOT NULL,
    `alamat` varchar(50) NOT NULL,
    `email` varchar(30) NOT NULL,
    `username` varchar(30) NOT NULL,
    `password` varchar(35) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `anggota`
  --
  
  INSERT INTO `anggota` (`id_anggota`, `nama_anggota`, `gender`, `no_telp`, `alamat`, `email`, `username`, `password`) VALUES
  (6, 'Suhut Irawan', 'Laki-Laki', '081354267890', 'komp.sbs harapan jaya', 'suhutirwan34@gmail.com', 'anaknakal', '246810'),
  (7, 'Edwin Manasa ', 'Laki-Laki', '085732107632', 'kebon nanas utara II', 'edwinmanasa13@gmail.com', 'anaknakal', '246810'),
  (8, 'Moh Riyansyah', 'Laki-Laki', '081089763210', 'kamp.sawah ', 'mohriyanc25@gmail.com', 'anaknakal', '246810'),
  (9, 'Ashabu', 'Laki-Laki', '081089763210', 'kamp.sawah ', 'ashabul672@gmail.com', 'anaknakal', '246810'),
  (10, 'Kafri', 'Laki-Laki', '085732107632', 'kebon nanas selatan', 'kafri137@gmail.com', 'anaknakal', '246810');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `buku`
  --
  
  CREATE TABLE `buku` (
    `id_buku` int(5) NOT NULL,
    `id_kategori` int(5) NOT NULL,
    `judul_buku` varchar(50) NOT NULL,
    `pengarang` varchar(35) NOT NULL,
    `thn_terbit` date NOT NULL,
    `penerbit` varchar(50) NOT NULL,
    `isbn` varchar(25) NOT NULL,
    `jumlah_buku` int(3) NOT NULL,
    `lokasi` enum('Rak 1','Rak 2','Rak 3') NOT NULL,
    `gambar` varchar(255) NOT NULL,
    `tgl_input` date NOT NULL,
    `status_buku` enum('1','0') NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `buku`
  --
  
  INSERT INTO `buku` (`id_buku`, `id_kategori`, `judul_buku`, `pengarang`, `thn_terbit`, `penerbit`, `isbn`, `jumlah_buku`, `lokasi`, `gambar`, `tgl_input`, `status_buku`) VALUES
  (10, 4, 'Robotika Sederhana', 'Siswoyo Utomo', '2013-01-01', 'Wacana Ria', '34354422', 10, 'Rak 3', 'gambar1603880564.jpg', '2021-01-04', '0'),
  (11, 4, 'Mahir Dengan PHP', 'Adri Kusuma', '2011-02-02', 'Pustaka Bangsa', '654123fe', 10, 'Rak 2', 'gambar1603880547.jpg', '2020-11-18', '0'),
  (12, 4, 'Mahir Mewarnai', 'Achmad Rahmat', '2014-03-03', 'CV. Indo Kreasi', '76234hw342', 10, 'Rak 3', 'gambar1603880663.jpg', '2020-10-28', '0'),
  (13, 4, 'Hukum Fisika', 'Kurnia Sandi', '2013-04-04', 'Wacana Ria', '233214414', 10, 'Rak 2', 'gambar1603880742.jpg', '2020-10-28', '0'),
  (14, 4, 'Mahir Bahasa Inggris', 'Aliuddin', '2013-05-05', 'CV. Indo Kreasi ', '3553234454', 10, 'Rak 1', 'gambar1603880851.jpg', '2020-10-28', '1'),
  (15, 4, 'Public Speaking', 'Pambudi Prasetyo ', '2015-06-06', 'Aldi Pustaka', '843594759', 10, 'Rak 2', 'gambar1603881067.jpg', '2020-10-28', '1'),
  (16, 4, 'Trik SQL', 'Ahdim Makaren', '2014-07-07', 'Wacana Ria', '54234762', 10, 'Rak 1', 'gambar1603881152.jpg', '2020-10-28', '1');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `detail_pinjam`
  --
  
  CREATE TABLE `detail_pinjam` (
    `id_pinjam` int(5) NOT NULL,
    `id_buku` int(5) NOT NULL,
    `tgl_pengambilan` date NOT NULL,
    `denda` double NOT NULL,
    `status_kembali` enum('0','1') NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `kategori`
  --
  
  CREATE TABLE `kategori` (
    `id_kategori` int(5) NOT NULL,
    `nama_kategori` varchar(45) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `kategori`
  --
  
  INSERT INTO `kategori` (`id_kategori`, `nama_kategori`) VALUES
  (3, 'novel'),
  (4, 'pendidikan ');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `peminjaman`
  --
  
  CREATE TABLE `peminjaman` (
    `id-pinjam` int(5) NOT NULL,
    `tanggal` date NOT NULL,
    `id_anggota` int(5) NOT NULL,
    `tgl_pinjam` date NOT NULL,
    `tgl_kembali` date NOT NULL,
    `total_denda` varchar(255) NOT NULL,
    `status_pinjaman` varchar(255) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `transaksi`
  --
  
  CREATE TABLE `transaksi` (
    `id_pinjam` int(11) NOT NULL,
    `tgl_pencatatan` datetime NOT NULL,
    `id_anggota` int(4) NOT NULL,
    `id_buku` int(4) NOT NULL,
    `tgl_pinjam` date NOT NULL,
    `tgl_kembali` date NOT NULL,
    `denda` double NOT NULL,
    `tgl_pengembalian` date NOT NULL,
    `total_denda` double NOT NULL,
    `status_pengembalian` varchar(15) NOT NULL,
    `status_peminjaman` varchar(25) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `transaksi`
  --
  
  INSERT INTO `transaksi` (`id_pinjam`, `tgl_pencatatan`, `id_anggota`, `id_buku`, `tgl_pinjam`, `tgl_kembali`, `denda`, `tgl_pengembalian`, `total_denda`, `status_pengembalian`, `status_peminjaman`) VALUES
  (5, '2021-01-04 13:37:42', 7, 10, '2012-12-12', '2013-12-01', 10000, '0000-00-00', 0, '0', '0');
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `admin`
  --
  ALTER TABLE `admin`
    ADD PRIMARY KEY (`id_admin`);
  
  --
  -- Indexes for table `anggota`
  --
  ALTER TABLE `anggota`
    ADD PRIMARY KEY (`id_anggota`);
  
  --
  -- Indexes for table `buku`
  --
  ALTER TABLE `buku`
    ADD PRIMARY KEY (`id_buku`);
  
  --
  -- Indexes for table `kategori`
  --
  ALTER TABLE `kategori`
    ADD PRIMARY KEY (`id_kategori`);
  
  --
  -- Indexes for table `peminjaman`
  --
  ALTER TABLE `peminjaman`
    ADD PRIMARY KEY (`id-pinjam`);
  
  --
  -- Indexes for table `transaksi`
  --
  ALTER TABLE `transaksi`
    ADD PRIMARY KEY (`id_pinjam`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `admin`
  --
  ALTER TABLE `admin`
    MODIFY `id_admin` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
  
  --
  -- AUTO_INCREMENT for table `anggota`
  --
  ALTER TABLE `anggota`
    MODIFY `id_anggota` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
  
  --
  -- AUTO_INCREMENT for table `buku`
  --
  ALTER TABLE `buku`
    MODIFY `id_buku` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
  
  --
  -- AUTO_INCREMENT for table `kategori`
  --
  ALTER TABLE `kategori`
    MODIFY `id_kategori` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  
  --
  -- AUTO_INCREMENT for table `peminjaman`
  --
  ALTER TABLE `peminjaman`
    MODIFY `id-pinjam` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT for table `transaksi`
  --
  ALTER TABLE `transaksi`
    MODIFY `id_pinjam` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
  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 */;
  