text: -- phpMyAdmin SQL Dump
  -- version 5.0.2
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Jan 31, 2022 at 05:52 AM
  -- Server version: 10.4.13-MariaDB
  -- PHP Version: 7.4.7
  
  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: `pembayaran_spp`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `kelas`
  --
  
  CREATE TABLE `kelas` (
    `id_kelas` int(11) NOT NULL,
    `nama_kelas` varchar(10) DEFAULT NULL,
    `kompetensi_keahlian` varchar(50) DEFAULT NULL,
    `status` int(2) DEFAULT NULL,
    `created_id` int(11) DEFAULT NULL,
    `update_id` int(11) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `kelas`
  --
  
  INSERT INTO `kelas` (`id_kelas`, `nama_kelas`, `kompetensi_keahlian`, `status`, `created_id`, `update_id`) VALUES
  (13, 'XIIRB', 'Rekayasa Perangkat Lunak', 0, 1, 1);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `pembayaran`
  --
  
  CREATE TABLE `pembayaran` (
    `id_pembayaran` int(11) NOT NULL,
    `id_petugas` int(11) DEFAULT NULL,
    `nisn` varchar(10) DEFAULT NULL,
    `tgl_pembayaran` date DEFAULT NULL,
    `bulan_dibayar` varchar(8) DEFAULT NULL,
    `tahun_dibayar` varchar(4) DEFAULT NULL,
    `id_spp` int(11) DEFAULT NULL,
    `jumlah_bayar` int(11) DEFAULT NULL,
    `status` int(1) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `pembayaran`
  --
  
  INSERT INTO `pembayaran` (`id_pembayaran`, `id_petugas`, `nisn`, `tgl_pembayaran`, `bulan_dibayar`, `tahun_dibayar`, `id_spp`, `jumlah_bayar`, `status`) VALUES
  (6, 1, '0046174033', '0000-00-00', '1', '2021', 21, 200000, 0);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `petugas`
  --
  
  CREATE TABLE `petugas` (
    `id_petugas` int(11) NOT NULL,
    `username` varchar(25) DEFAULT NULL,
    `password` varchar(50) DEFAULT NULL,
    `nama_petugas` varchar(50) DEFAULT NULL,
    `level` enum('admin','petugas') DEFAULT NULL,
    `status` int(2) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `petugas`
  --
  
  INSERT INTO `petugas` (`id_petugas`, `username`, `password`, `nama_petugas`, `level`, `status`) VALUES
  (1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'winarno', 'admin', 0),
  (2, 'petugas', 'afb91ef692fd08c445e8cb1bab2ccf9c', 'petugas', 'petugas', 0);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `siswa`
  --
  
  CREATE TABLE `siswa` (
    `nisn` char(10) NOT NULL,
    `nis` char(8) DEFAULT NULL,
    `nama` varchar(35) DEFAULT NULL,
    `id_kelas` int(11) DEFAULT NULL,
    `alamat` text DEFAULT NULL,
    `no_telp` varchar(13) DEFAULT NULL,
    `id_spp` int(11) DEFAULT NULL,
    `status` int(2) NOT NULL,
    `created_id` int(11) DEFAULT NULL,
    `update_id` int(11) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `siswa`
  --
  
  INSERT INTO `siswa` (`nisn`, `nis`, `nama`, `id_kelas`, `alamat`, `no_telp`, `id_spp`, `status`, `created_id`, `update_id`) VALUES
  ('0046174033', '7344', 'winarno', 13, 'kaliboto', '077', 21, 0, 1, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `spp`
  --
  
  CREATE TABLE `spp` (
    `id_spp` int(11) NOT NULL,
    `tahun` int(11) DEFAULT NULL,
    `nominal` int(11) DEFAULT NULL,
    `status` int(2) DEFAULT NULL,
    `created_id` int(11) DEFAULT NULL,
    `update_id` int(11) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `spp`
  --
  
  INSERT INTO `spp` (`id_spp`, `tahun`, `nominal`, `status`, `created_id`, `update_id`) VALUES
  (21, 2022, 200000, 0, 1, NULL);
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `kelas`
  --
  ALTER TABLE `kelas`
    ADD PRIMARY KEY (`id_kelas`);
  
  --
  -- Indexes for table `pembayaran`
  --
  ALTER TABLE `pembayaran`
    ADD PRIMARY KEY (`id_pembayaran`),
    ADD KEY `nisn` (`nisn`),
    ADD KEY `petugas` (`id_petugas`);
  
  --
  -- Indexes for table `petugas`
  --
  ALTER TABLE `petugas`
    ADD PRIMARY KEY (`id_petugas`);
  
  --
  -- Indexes for table `siswa`
  --
  ALTER TABLE `siswa`
    ADD PRIMARY KEY (`nisn`),
    ADD KEY `spp` (`id_spp`),
    ADD KEY `kelas` (`id_kelas`);
  
  --
  -- Indexes for table `spp`
  --
  ALTER TABLE `spp`
    ADD PRIMARY KEY (`id_spp`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `kelas`
  --
  ALTER TABLE `kelas`
    MODIFY `id_kelas` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
  
  --
  -- AUTO_INCREMENT for table `pembayaran`
  --
  ALTER TABLE `pembayaran`
    MODIFY `id_pembayaran` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
  
  --
  -- AUTO_INCREMENT for table `petugas`
  --
  ALTER TABLE `petugas`
    MODIFY `id_petugas` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- AUTO_INCREMENT for table `spp`
  --
  ALTER TABLE `spp`
    MODIFY `id_spp` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `pembayaran`
  --
  ALTER TABLE `pembayaran`
    ADD CONSTRAINT `nisn` FOREIGN KEY (`nisn`) REFERENCES `siswa` (`nisn`) ON DELETE SET NULL,
    ADD CONSTRAINT `petugas` FOREIGN KEY (`id_petugas`) REFERENCES `petugas` (`id_petugas`) ON DELETE SET NULL;
  
  --
  -- Constraints for table `siswa`
  --
  ALTER TABLE `siswa`
    ADD CONSTRAINT `kelas` FOREIGN KEY (`id_kelas`) REFERENCES `kelas` (`id_kelas`) ON DELETE SET NULL,
    ADD CONSTRAINT `spp` FOREIGN KEY (`id_spp`) REFERENCES `spp` (`id_spp`) 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 */;
  