text: -- phpMyAdmin SQL Dump
  -- version 4.8.5
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Waktu pembuatan: 01 Sep 2020 pada 09.02
  -- Versi server: 10.1.38-MariaDB
  -- Versi PHP: 7.3.3
  
  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: `dbmail`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `groups`
  --
  
  CREATE TABLE `groups` (
    `id` mediumint(8) UNSIGNED NOT NULL,
    `name` varchar(20) NOT NULL,
    `description` varchar(100) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data untuk tabel `groups`
  --
  
  INSERT INTO `groups` (`id`, `name`, `description`) VALUES
  (1, 'admin', 'Administrator'),
  (2, 'members', 'General User'),
  (3, 'Pegawai', 'Pengguna surat'),
  (4, 'Manajemen', 'Manajemen');
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `groups_menu`
  --
  
  CREATE TABLE `groups_menu` (
    `id_groups` int(11) NOT NULL,
    `id_menu` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data untuk tabel `groups_menu`
  --
  
  INSERT INTO `groups_menu` (`id_groups`, `id_menu`) VALUES
  (1, 1),
  (2, 1),
  (1, 3),
  (2, 3),
  (1, 40),
  (1, 8),
  (1, 89),
  (1, 4),
  (1, 42),
  (1, 91),
  (4, 91),
  (1, 93),
  (1, 94),
  (1, 43),
  (1, 44);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `login_attempts`
  --
  
  CREATE TABLE `login_attempts` (
    `id` int(11) UNSIGNED NOT NULL,
    `ip_address` varchar(45) NOT NULL,
    `login` varchar(100) NOT NULL,
    `time` int(11) UNSIGNED DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data untuk tabel `login_attempts`
  --
  
  INSERT INTO `login_attempts` (`id`, `ip_address`, `login`, `time`) VALUES
  (1, '::1', 'bsadmin@banksampah.com', 1598933535),
  (3, '::1', 'bsadmin@banksampah.com', 1598933543);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `menu`
  --
  
  CREATE TABLE `menu` (
    `id_menu` int(11) NOT NULL,
    `sort` int(11) NOT NULL DEFAULT '99',
    `level` int(11) NOT NULL,
    `parent_id` int(11) NOT NULL DEFAULT '0',
    `icon` varchar(125) NOT NULL,
    `label` varchar(25) NOT NULL,
    `link` varchar(125) NOT NULL,
    `id` varchar(25) NOT NULL DEFAULT '#',
    `id_menu_type` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data untuk tabel `menu`
  --
  
  INSERT INTO `menu` (`id_menu`, `sort`, `level`, `parent_id`, `icon`, `label`, `link`, `id`, `id_menu_type`) VALUES
  (1, 0, 1, 0, 'empty', 'MAIN NAVIGATION', '#', '#', 1),
  (3, 1, 2, 1, 'fas fa-tachometer-alt', 'Dashboard', 'dashboard', '#', 1),
  (4, 13, 2, 40, 'fas fa-table', 'CRUD Generator', 'crudbuilder', '1', 1),
  (8, 11, 2, 40, 'fas fa-bars', 'Menu', 'cms/menu/side-menu', 'navMenu', 1),
  (40, 10, 1, 0, 'empty', 'DEV', '#', '#', 1),
  (42, 7, 2, 1, 'fas fa-users-cog', 'User', '#', '1', 1),
  (43, 8, 3, 42, 'fas fa-user-plus', 'Users', 'users', '1', 1),
  (44, 9, 3, 42, 'fas fa-users', 'Groups', 'groups', '2', 1),
  (89, 12, 2, 40, 'fas fa-th-list', 'Menu Type', 'menu_type', 'menu_type', 1);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `menu_type`
  --
  
  CREATE TABLE `menu_type` (
    `id_menu_type` int(11) NOT NULL,
    `type` varchar(125) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data untuk tabel `menu_type`
  --
  
  INSERT INTO `menu_type` (`id_menu_type`, `type`) VALUES
  (1, 'Side menu');
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `users`
  --
  
  CREATE TABLE `users` (
    `id` int(11) UNSIGNED NOT NULL,
    `ip_address` varchar(45) NOT NULL,
    `username` varchar(100) DEFAULT NULL,
    `password` varchar(255) NOT NULL,
    `salt` varchar(255) DEFAULT NULL,
    `email` varchar(254) NOT NULL,
    `activation_code` varchar(40) DEFAULT NULL,
    `forgotten_password_code` varchar(40) DEFAULT NULL,
    `forgotten_password_time` int(11) UNSIGNED DEFAULT NULL,
    `remember_code` varchar(40) DEFAULT NULL,
    `created_on` int(11) UNSIGNED NOT NULL,
    `last_login` int(11) UNSIGNED DEFAULT NULL,
    `active` tinyint(1) UNSIGNED DEFAULT NULL,
    `first_name` varchar(50) DEFAULT NULL,
    `last_name` varchar(50) DEFAULT NULL,
    `phone` varchar(20) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data untuk tabel `users`
  --
  
  INSERT INTO `users` (`id`, `ip_address`, `username`, `password`, `salt`, `email`, `activation_code`, `forgotten_password_code`, `forgotten_password_time`, `remember_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`, `phone`) VALUES
  (1, '127.0.0.1', 'administrator', '$2a$07$SeBknntpZror9uyftVopmu61qg0ms8Qv1yV6FG.kQOSM.9QhmTo36', '', 'admin@admin.com', '', 'm0vyKu2zW7L8PTG20bquF.707e055aeea8a30aca', 1541329145, 'WcHCQ5vcXwT1z99BvJUWnu', 1268889823, 1598940200, 1, 'Admin', 'istrator', '0'),
  (2, '::1', 'emay@poltekpos.ac.id', '$2y$08$DCwEdFZ6ZqZ.eSnjaYr8guIl/8mJsTv6yDqYzF0Ae2XTTJYQnwu02', NULL, 'emay@poltekpos.ac.id', NULL, NULL, NULL, NULL, 1575441345, NULL, 1, 'Emay', 'Marshanda', '089610448994');
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `users_groups`
  --
  
  CREATE TABLE `users_groups` (
    `id` int(11) UNSIGNED NOT NULL,
    `user_id` int(11) UNSIGNED NOT NULL,
    `group_id` mediumint(8) UNSIGNED NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  --
  -- Dumping data untuk tabel `users_groups`
  --
  
  INSERT INTO `users_groups` (`id`, `user_id`, `group_id`) VALUES
  (3, 1, 1),
  (4, 2, 2);
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indeks untuk tabel `groups`
  --
  ALTER TABLE `groups`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `login_attempts`
  --
  ALTER TABLE `login_attempts`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `menu`
  --
  ALTER TABLE `menu`
    ADD PRIMARY KEY (`id_menu`);
  
  --
  -- Indeks untuk tabel `menu_type`
  --
  ALTER TABLE `menu_type`
    ADD PRIMARY KEY (`id_menu_type`);
  
  --
  -- Indeks untuk tabel `users`
  --
  ALTER TABLE `users`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indeks untuk tabel `users_groups`
  --
  ALTER TABLE `users_groups`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `uc_users_groups` (`user_id`,`group_id`),
    ADD KEY `fk_users_groups_users1_idx` (`user_id`),
    ADD KEY `fk_users_groups_groups1_idx` (`group_id`);
  
  --
  -- AUTO_INCREMENT untuk tabel yang dibuang
  --
  
  --
  -- AUTO_INCREMENT untuk tabel `groups`
  --
  ALTER TABLE `groups`
    MODIFY `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  
  --
  -- AUTO_INCREMENT untuk tabel `login_attempts`
  --
  ALTER TABLE `login_attempts`
    MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- AUTO_INCREMENT untuk tabel `menu`
  --
  ALTER TABLE `menu`
    MODIFY `id_menu` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=115;
  
  --
  -- AUTO_INCREMENT untuk tabel `menu_type`
  --
  ALTER TABLE `menu_type`
    MODIFY `id_menu_type` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  
  --
  -- AUTO_INCREMENT untuk tabel `users`
  --
  ALTER TABLE `users`
    MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  
  --
  -- AUTO_INCREMENT untuk tabel `users_groups`
  --
  ALTER TABLE `users_groups`
    MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
  
  --
  -- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
  --
  
  --
  -- Ketidakleluasaan untuk tabel `users_groups`
  --
  ALTER TABLE `users_groups`
    ADD CONSTRAINT `fk_users_groups_groups1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,
    ADD CONSTRAINT `fk_users_groups_users1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
  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 */;
  