text: -- phpMyAdmin SQL Dump
  -- version 4.9.1
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Oct 29, 2019 at 06:07 AM
  -- Server version: 10.4.8-MariaDB
  -- PHP Version: 7.3.10
  
  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: `sipsen`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `migrations`
  --
  
  CREATE TABLE `migrations` (
    `id` int(255) UNSIGNED NOT NULL,
    `version` varchar(255) NOT NULL,
    `class` text NOT NULL,
    `group` varchar(255) NOT NULL,
    `namespace` varchar(255) NOT NULL,
    `time` int(11) NOT NULL,
    `batch` int(11) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `migrations`
  --
  
  INSERT INTO `migrations` (`id`, `version`, `class`, `group`, `namespace`, `time`, `batch`) VALUES
  (55, '2019-10-20-114056', 'App\\Database\\Migrations\\AddJurusan', 'default', 'App', 1572009349, 1),
  (56, '2019-10-20-114150', 'App\\Database\\Migrations\\AddKelas', 'default', 'App', 1572009349, 1),
  (57, '2019-10-20-114358', 'App\\Database\\Migrations\\AddGuru', 'default', 'App', 1572009349, 1),
  (58, '2019-10-20-114439', 'App\\Database\\Migrations\\AddAdmin', 'default', 'App', 1572009350, 1),
  (59, '2019-10-20-114527', 'App\\Database\\Migrations\\AddWali', 'default', 'App', 1572009350, 1),
  (60, '2019-10-20-114616', 'App\\Database\\Migrations\\AddPerangkat', 'default', 'App', 1572009350, 1),
  (61, '2019-10-20-114726', 'App\\Database\\Migrations\\AddSiswa', 'default', 'App', 1572009350, 1),
  (62, '2019-10-20-115248', 'App\\Database\\Migrations\\AddKeluhan', 'default', 'App', 1572009351, 1),
  (63, '2019-10-20-115453', 'App\\Database\\Migrations\\AddJenisPresensi', 'default', 'App', 1572009351, 1),
  (64, '2019-10-20-115518', 'App\\Database\\Migrations\\AddPresensi', 'default', 'App', 1572009351, 1),
  (65, '2019-10-20-115758', 'App\\Database\\Migrations\\AddIzin', 'default', 'App', 1572009351, 1),
  (66, '2019-10-25-120250', 'App\\Database\\Migrations\\AddJam', 'default', 'App', 1572009352, 1);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tb_admin`
  --
  
  CREATE TABLE `tb_admin` (
    `username` varchar(50) NOT NULL,
    `password` varchar(255) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data for table `tb_admin`
  --
  
  INSERT INTO `tb_admin` (`username`, `password`) VALUES
  ('admin', '21232f297a57a5a743894a0e4a801fc3');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tb_guru`
  --
  
  CREATE TABLE `tb_guru` (
    `NUPTK` varchar(50) NOT NULL,
    `nama` varchar(50) NOT NULL,
    `alamat` varchar(50) NOT NULL,
    `no_hp` varchar(50) NOT NULL,
    `email` varchar(100) NOT NULL,
    `jk` varchar(5) NOT NULL,
    `status_bk` varchar(5) NOT NULL,
    `password` varchar(255) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tb_izin`
  --
  
  CREATE TABLE `tb_izin` (
    `id_izin` int(11) NOT NULL,
    `NIS` varchar(50) NOT NULL,
    `tgl_mulai` date NOT NULL,
    `tgl_selesai` date NOT NULL,
    `jenis_izin` varchar(3) NOT NULL,
    `bukti` varchar(255) NOT NULL,
    `keterangan` datetime DEFAULT NULL,
    `status` int(5) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tb_jam`
  --
  
  CREATE TABLE `tb_jam` (
    `id_jam` int(11) NOT NULL,
    `jam_masuk` time NOT NULL,
    `jam_pulang` time NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tb_jenis_presensi`
  --
  
  CREATE TABLE `tb_jenis_presensi` (
    `id_jenis_presensi` int(5) NOT NULL,
    `jenis_presensi` varchar(50) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tb_jurusan`
  --
  
  CREATE TABLE `tb_jurusan` (
    `id_jurusan` int(11) NOT NULL,
    `nama_jurusan` varchar(50) NOT NULL,
    `singkatan` varchar(10) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tb_kelas`
  --
  
  CREATE TABLE `tb_kelas` (
    `id_kelas` int(11) NOT NULL,
    `id_jurusan` int(11) NOT NULL,
    `tingkat` varchar(3) NOT NULL,
    `nama` varchar(3) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tb_keluhan`
  --
  
  CREATE TABLE `tb_keluhan` (
    `id_keluhan` int(11) NOT NULL,
    `NIS` varchar(50) NOT NULL,
    `NUPTK` varchar(50) NOT NULL,
    `keluhan` text DEFAULT NULL,
    `saran` text DEFAULT NULL,
    `tgl_kirim` datetime DEFAULT NULL,
    `tgl_balas` datetime DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tb_perangkat`
  --
  
  CREATE TABLE `tb_perangkat` (
    `id_perangkat` int(11) NOT NULL,
    `id_kelas` varchar(5) NOT NULL,
    `kode` varchar(50) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tb_presensi`
  --
  
  CREATE TABLE `tb_presensi` (
    `id_presensi` int(11) NOT NULL,
    `NIS` varchar(50) NOT NULL,
    `id_jenis_presensi` int(5) NOT NULL,
    `tanggal` date NOT NULL,
    `masuk` time NOT NULL,
    `keluar` time NOT NULL,
    `keterlambatan` varchar(15) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tb_siswa`
  --
  
  CREATE TABLE `tb_siswa` (
    `NIS` varchar(50) NOT NULL,
    `NISN` varchar(50) NOT NULL,
    `nama` varchar(50) NOT NULL,
    `jk` varchar(15) NOT NULL,
    `id_kelas` int(11) NOT NULL,
    `tgl_lahir` date NOT NULL,
    `no_hp` varchar(15) NOT NULL,
    `email` varchar(50) NOT NULL,
    `alamat` varchar(50) NOT NULL,
    `nama_ayah` varchar(50) NOT NULL,
    `nama_ibu` varchar(50) NOT NULL,
    `id_wali` int(11) NOT NULL,
    `id_fp` varchar(5) NOT NULL,
    `password` varchar(100) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tb_wali`
  --
  
  CREATE TABLE `tb_wali` (
    `id_wali` int(11) NOT NULL,
    `username` varchar(50) NOT NULL,
    `nama` varchar(50) NOT NULL,
    `email` varchar(50) NOT NULL,
    `password` varchar(255) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `migrations`
  --
  ALTER TABLE `migrations`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `tb_admin`
  --
  ALTER TABLE `tb_admin`
    ADD PRIMARY KEY (`username`);
  
  --
  -- Indexes for table `tb_guru`
  --
  ALTER TABLE `tb_guru`
    ADD PRIMARY KEY (`NUPTK`);
  
  --
  -- Indexes for table `tb_izin`
  --
  ALTER TABLE `tb_izin`
    ADD PRIMARY KEY (`id_izin`),
    ADD KEY `tb_izin_NIS_foreign` (`NIS`);
  
  --
  -- Indexes for table `tb_jam`
  --
  ALTER TABLE `tb_jam`
    ADD PRIMARY KEY (`id_jam`);
  
  --
  -- Indexes for table `tb_jenis_presensi`
  --
  ALTER TABLE `tb_jenis_presensi`
    ADD PRIMARY KEY (`id_jenis_presensi`);
  
  --
  -- Indexes for table `tb_jurusan`
  --
  ALTER TABLE `tb_jurusan`
    ADD PRIMARY KEY (`id_jurusan`);
  
  --
  -- Indexes for table `tb_kelas`
  --
  ALTER TABLE `tb_kelas`
    ADD PRIMARY KEY (`id_kelas`),
    ADD KEY `tb_kelas_id_jurusan_foreign` (`id_jurusan`);
  
  --
  -- Indexes for table `tb_keluhan`
  --
  ALTER TABLE `tb_keluhan`
    ADD PRIMARY KEY (`id_keluhan`),
    ADD KEY `tb_keluhan_NIS_foreign` (`NIS`),
    ADD KEY `tb_keluhan_NUPTK_foreign` (`NUPTK`);
  
  --
  -- Indexes for table `tb_perangkat`
  --
  ALTER TABLE `tb_perangkat`
    ADD PRIMARY KEY (`id_perangkat`);
  
  --
  -- Indexes for table `tb_presensi`
  --
  ALTER TABLE `tb_presensi`
    ADD PRIMARY KEY (`id_presensi`),
    ADD KEY `tb_presensi_NIS_foreign` (`NIS`),
    ADD KEY `tb_presensi_id_jenis_presensi_foreign` (`id_jenis_presensi`);
  
  --
  -- Indexes for table `tb_siswa`
  --
  ALTER TABLE `tb_siswa`
    ADD PRIMARY KEY (`NIS`),
    ADD KEY `tb_siswa_id_kelas_foreign` (`id_kelas`),
    ADD KEY `tb_siswa_id_wali_foreign` (`id_wali`);
  
  --
  -- Indexes for table `tb_wali`
  --
  ALTER TABLE `tb_wali`
    ADD PRIMARY KEY (`id_wali`),
    ADD UNIQUE KEY `id_wali` (`id_wali`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `migrations`
  --
  ALTER TABLE `migrations`
    MODIFY `id` int(255) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=67;
  
  --
  -- AUTO_INCREMENT for table `tb_izin`
  --
  ALTER TABLE `tb_izin`
    MODIFY `id_izin` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `tb_jam`
  --
  ALTER TABLE `tb_jam`
    MODIFY `id_jam` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `tb_jenis_presensi`
  --
  ALTER TABLE `tb_jenis_presensi`
    MODIFY `id_jenis_presensi` int(5) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `tb_jurusan`
  --
  ALTER TABLE `tb_jurusan`
    MODIFY `id_jurusan` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `tb_kelas`
  --
  ALTER TABLE `tb_kelas`
    MODIFY `id_kelas` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `tb_keluhan`
  --
  ALTER TABLE `tb_keluhan`
    MODIFY `id_keluhan` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `tb_perangkat`
  --
  ALTER TABLE `tb_perangkat`
    MODIFY `id_perangkat` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `tb_presensi`
  --
  ALTER TABLE `tb_presensi`
    MODIFY `id_presensi` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- AUTO_INCREMENT for table `tb_wali`
  --
  ALTER TABLE `tb_wali`
    MODIFY `id_wali` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `tb_izin`
  --
  ALTER TABLE `tb_izin`
    ADD CONSTRAINT `tb_izin_NIS_foreign` FOREIGN KEY (`NIS`) REFERENCES `tb_siswa` (`NIS`);
  
  --
  -- Constraints for table `tb_kelas`
  --
  ALTER TABLE `tb_kelas`
    ADD CONSTRAINT `tb_kelas_id_jurusan_foreign` FOREIGN KEY (`id_jurusan`) REFERENCES `tb_jurusan` (`id_jurusan`);
  
  --
  -- Constraints for table `tb_keluhan`
  --
  ALTER TABLE `tb_keluhan`
    ADD CONSTRAINT `tb_keluhan_NIS_foreign` FOREIGN KEY (`NIS`) REFERENCES `tb_siswa` (`NIS`),
    ADD CONSTRAINT `tb_keluhan_NUPTK_foreign` FOREIGN KEY (`NUPTK`) REFERENCES `tb_guru` (`NUPTK`);
  
  --
  -- Constraints for table `tb_presensi`
  --
  ALTER TABLE `tb_presensi`
    ADD CONSTRAINT `tb_presensi_NIS_foreign` FOREIGN KEY (`NIS`) REFERENCES `tb_siswa` (`NIS`),
    ADD CONSTRAINT `tb_presensi_id_jenis_presensi_foreign` FOREIGN KEY (`id_jenis_presensi`) REFERENCES `tb_jenis_presensi` (`id_jenis_presensi`);
  
  --
  -- Constraints for table `tb_siswa`
  --
  ALTER TABLE `tb_siswa`
    ADD CONSTRAINT `tb_siswa_id_kelas_foreign` FOREIGN KEY (`id_kelas`) REFERENCES `tb_kelas` (`id_kelas`),
    ADD CONSTRAINT `tb_siswa_id_wali_foreign` FOREIGN KEY (`id_wali`) REFERENCES `tb_wali` (`id_wali`);
  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 */;
  