text: -- phpMyAdmin SQL Dump
  -- version 5.0.4
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: May 26, 2021 at 03:51 PM
  -- Server version: 10.4.17-MariaDB
  -- PHP Version: 7.4.15
  
  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: `ci3_sipas`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `disposisi`
  --
  
  CREATE TABLE `disposisi` (
    `id` int(11) NOT NULL,
    `sm_id` int(11) NOT NULL,
    `jabatan_id` int(11) DEFAULT NULL,
    `isi` text NOT NULL,
    `batas_waktu` date NOT NULL,
    `sifat_id` int(11) DEFAULT NULL,
    `catatan` varchar(255) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `disposisi`
  --
  
  INSERT INTO `disposisi` (`id`, `sm_id`, `jabatan_id`, `isi`, `batas_waktu`, `sifat_id`, `catatan`) VALUES
  (4, 12, 1, 'Coba tambah data disposisi', '2021-05-17', 2, 'oke'),
  (7, 12, 2, 'tes ubah data', '2021-05-18', 3, 'ubah');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `jabatan`
  --
  
  CREATE TABLE `jabatan` (
    `id` int(11) NOT NULL,
    `nama` varchar(128) DEFAULT NULL COMMENT 'opsional',
    `jabatan` varchar(128) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `jabatan`
  --
  
  INSERT INTO `jabatan` (`id`, `nama`, `jabatan`) VALUES
  (1, '', 'Kepala Sekolah'),
  (2, '', 'Waka Kurikulum'),
  (3, '', 'Waka Kesiswaan'),
  (4, '', 'Waka Sarana & Prasarana'),
  (5, '', 'Waka Humas'),
  (6, '', 'Bendahara');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `sifat`
  --
  
  CREATE TABLE `sifat` (
    `id` int(11) NOT NULL,
    `sifat` varchar(128) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `sifat`
  --
  
  INSERT INTO `sifat` (`id`, `sifat`) VALUES
  (1, 'Segera'),
  (2, 'Sangat Segera'),
  (3, 'Rahasia');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `surat_keluar`
  --
  
  CREATE TABLE `surat_keluar` (
    `id` int(11) NOT NULL,
    `no_agenda` int(11) NOT NULL,
    `pengirim` varchar(128) NOT NULL,
    `no_surat` varchar(128) NOT NULL,
    `isi` text NOT NULL,
    `tgl_surat` date NOT NULL,
    `tgl_diterima` date NOT NULL,
    `keterangan` varchar(255) DEFAULT NULL,
    `file` varchar(128) DEFAULT NULL,
    `created_at` date NOT NULL,
    `user_id` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `surat_keluar`
  --
  
  INSERT INTO `surat_keluar` (`id`, `no_agenda`, `pengirim`, `no_surat`, `isi`, `tgl_surat`, `tgl_diterima`, `keterangan`, `file`, `created_at`, `user_id`) VALUES
  (12, 2, 'Skuy Ngoding', 'XVII.10', 'Tambah data surat keluar', '2021-05-01', '2021-05-02', '', '21ecadb60410aff85789914d3ad7ef14.pdf', '2021-05-11', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `surat_masuk`
  --
  
  CREATE TABLE `surat_masuk` (
    `id` int(11) NOT NULL,
    `no_agenda` int(11) DEFAULT NULL,
    `pengirim` varchar(128) DEFAULT NULL,
    `no_surat` varchar(128) DEFAULT NULL,
    `isi` text DEFAULT NULL,
    `tgl_surat` date DEFAULT NULL,
    `tgl_diterima` date DEFAULT NULL,
    `keterangan` varchar(255) DEFAULT NULL,
    `file` varchar(128) DEFAULT NULL,
    `created_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
    `user_id` int(11) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `surat_masuk`
  --
  
  INSERT INTO `surat_masuk` (`id`, `no_agenda`, `pengirim`, `no_surat`, `isi`, `tgl_surat`, `tgl_diterima`, `keterangan`, `file`, `created_at`, `user_id`) VALUES
  (11, 1, 'skuy service', 'ix', 'lorem ipsum. ', '2021-01-01', '2021-02-01', '', '78f6cc35280ff154691db5ba0a212bdc.pdf', '2021-05-16 12:47:08', 1),
  (12, 3, 'coba dua', 'ix', 'coba', '2021-02-10', '2021-02-11', '', 'bf194667d45be9caf3124fd5bb49f322.pdf', '2021-05-16 12:53:17', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `user`
  --
  
  CREATE TABLE `user` (
    `id` int(11) NOT NULL,
    `name` varchar(128) NOT NULL,
    `username` varchar(128) NOT NULL,
    `email` varchar(128) NOT NULL,
    `password` varchar(128) NOT NULL,
    `image` varchar(128) NOT NULL,
    `role_id` int(11) NOT NULL,
    `date_created` varchar(128) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data for table `user`
  --
  
  INSERT INTO `user` (`id`, `name`, `username`, `email`, `password`, `image`, `role_id`, `date_created`) VALUES
  (1, 'Akun Admin', 'admin123', 'admin@gmail.com', '$2y$10$w7390BXuXt7vh3QqMQ4n3urXcwanLliwSJGxb1WHTO1.ylY3m8Uci', 'img1.jpg', 1, '1595945906'),
  (3, 'Akun user', 'user1234', 'user@gmail.com', '$2y$10$kBSc9s3Ev/dfUyLgdsqe8uGMe2WWsixHbksKjYILHMhbKz.pDTbe.', 'default.svg', 2, '1600783192');
  
  -- --------------------------------------------------------
  
  --
  -- 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, 'Admin'),
  (2, 'User');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `user_token`
  --
  
  CREATE TABLE `user_token` (
    `id` int(11) NOT NULL,
    `email` varchar(128) NOT NULL,
    `token` varchar(128) NOT NULL,
    `date_created` varchar(128) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `disposisi`
  --
  ALTER TABLE `disposisi`
    ADD PRIMARY KEY (`id`),
    ADD KEY `sifat_id` (`sifat_id`),
    ADD KEY `jabatan_id` (`jabatan_id`),
    ADD KEY `disposisi_ibfk_1` (`sm_id`);
  
  --
  -- Indexes for table `jabatan`
  --
  ALTER TABLE `jabatan`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `sifat`
  --
  ALTER TABLE `sifat`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `surat_keluar`
  --
  ALTER TABLE `surat_keluar`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `surat_masuk`
  --
  ALTER TABLE `surat_masuk`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `user`
  --
  ALTER TABLE `user`
    ADD PRIMARY KEY (`id`),
    ADD KEY `role_id` (`role_id`);
  
  --
  -- Indexes for table `user_role`
  --
  ALTER TABLE `user_role`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `user_token`
  --
  ALTER TABLE `user_token`
    ADD PRIMARY KEY (`id`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `disposisi`
  --
  ALTER TABLE `disposisi`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
  
  --
  -- AUTO_INCREMENT for table `jabatan`
  --
  ALTER TABLE `jabatan`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
  
  --
  -- AUTO_INCREMENT for table `sifat`
  --
  ALTER TABLE `sifat`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
  
  --
  -- AUTO_INCREMENT for table `surat_keluar`
  --
  ALTER TABLE `surat_keluar`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
  
  --
  -- AUTO_INCREMENT for table `surat_masuk`
  --
  ALTER TABLE `surat_masuk`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
  
  --
  -- AUTO_INCREMENT for table `user`
  --
  ALTER TABLE `user`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
  
  --
  -- 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_token`
  --
  ALTER TABLE `user_token`
    MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `disposisi`
  --
  ALTER TABLE `disposisi`
    ADD CONSTRAINT `disposisi_ibfk_1` FOREIGN KEY (`sm_id`) REFERENCES `surat_masuk` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  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 */;
  