 -- Table structure for table `tb_user`
 --
 
-CREATE TABLE IF NOT EXISTS `tb_user` (
-  `id_user` int(11) NOT NULL AUTO_INCREMENT,
+DROP TABLE IF EXISTS `tb_user`;
+CREATE TABLE `tb_user` (
+  `id_user` int(11) NOT NULL,
   `email` varchar(255) NOT NULL,
   `password` varchar(255) NOT NULL,
   `nama` varchar(255) NOT NULL,
   `no_hp` varchar(20) DEFAULT NULL,
-  `bahasa` varchar(50) NOT NULL,
-  `floor` int(11) DEFAULT NULL,
+  `id_lantai` int(11) DEFAULT NULL,
+  `id_unit` int(11) DEFAULT NULL,
   `level` int(11) NOT NULL,
-  `status` int(11) NOT NULL,
-  PRIMARY KEY (`id_user`),
-  UNIQUE KEY `email` (`email`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
+  `status` int(11) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
 
 --
 -- Dumping data for table `tb_user`
 --
 
-INSERT INTO `tb_user` (`id_user`, `email`, `password`, `nama`, `no_hp`, `bahasa`, `floor`, `level`, `status`) VALUES
-(1, 'admin', 'admintingroom', 'admin', NULL, 'bahasa', NULL, 1, 1),
-(2, 'hafiz.rahmadi@gmail.com', 'asdasdasd', 'Moh. Hafiz Rahmadi', '081913596746', 'bahasa', NULL, 2, 1);
-
+INSERT INTO `tb_user` (`id_user`, `email`, `password`, `nama`, `no_hp`, `id_lantai`, `id_unit`, `level`, `status`) VALUES
+(1, 'admin', '$2y$10$C.wMwSG2iu9dRdL9MAILiuOlhQ0yRPl0xaTDy5X8mw7hnS0m1GvxC', 'admin', NULL, NULL, NULL, 1, 1),
+(2, 'hafiz.rahmadi@gmail.com', '$2y$10$lAliR428t1bCfy24x/nvxeki6fdewu1yRQ9nizN3AkKlFhYik4AAC', 'Moh. Hafiz Rahmadi', '081913596746', NULL, NULL, 3, 1),
+(3, 'sekretaris', '$2y$10$2.ZeIP2bwJMQnqlO9Z7kme0937vPzNgYRkWs.T84R2E6WGxPK2Wwa', 'Sekretaris', NULL, NULL, NULL, 2, 1);
+
+--
+-- Indexes for dumped tables
+--
+
+--
+-- Indexes for table `tb_booking`
+--
+ALTER TABLE `tb_booking`
+  ADD PRIMARY KEY (`id_booking`),
+  ADD KEY `fk_id_jadwal` (`id_jadwal`),
+  ADD KEY `fk_id_user` (`id_user`);
+
+--
+-- Indexes for table `tb_det_booking`
+--
+ALTER TABLE `tb_det_booking`
+  ADD KEY `fk_id_booking` (`id_booking`),
+  ADD KEY `fk_id_jadwal` (`id_jadwal`);
+
+--
+-- Indexes for table `tb_gedung`
+--
+ALTER TABLE `tb_gedung`
+  ADD PRIMARY KEY (`id_gedung`);
+
+--
+-- Indexes for table `tb_jadwal`
+--
+ALTER TABLE `tb_jadwal`
+  ADD PRIMARY KEY (`id_jadwal`),
+  ADD KEY `fk_id_room` (`id_ruangan`),
+  ADD KEY `fk_id_jam` (`jam_awal`);
+
+--
+-- Indexes for table `tb_lantai`
+--
+ALTER TABLE `tb_lantai`
+  ADD PRIMARY KEY (`id_lantai`),
+  ADD KEY `fk_id_gedung` (`id_gedung`);
+
+--
+-- Indexes for table `tb_ruangan`
+--
+ALTER TABLE `tb_ruangan`
+  ADD PRIMARY KEY (`id_ruangan`),
+  ADD KEY `fk_id_floor` (`id_lantai`);
+
+--
+-- Indexes for table `tb_unit`
+--
+ALTER TABLE `tb_unit`
+  ADD PRIMARY KEY (`id_unit`);
+
+--
+-- Indexes for table `tb_user`
+--
+ALTER TABLE `tb_user`
+  ADD PRIMARY KEY (`id_user`),
+  ADD UNIQUE KEY `email` (`email`),
+  ADD KEY `id_unit` (`id_unit`),
+  ADD KEY `id_lantai` (`id_lantai`);
+
+--
+-- AUTO_INCREMENT for dumped tables
+--
+
+--
+-- AUTO_INCREMENT for table `tb_booking`
+--
+ALTER TABLE `tb_booking`
+  MODIFY `id_booking` int(11) NOT NULL AUTO_INCREMENT;
+--
+-- AUTO_INCREMENT for table `tb_gedung`
+--
+ALTER TABLE `tb_gedung`
+  MODIFY `id_gedung` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
+--
+-- AUTO_INCREMENT for table `tb_jadwal`
+--
+ALTER TABLE `tb_jadwal`
+  MODIFY `id_jadwal` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
+--
+-- AUTO_INCREMENT for table `tb_lantai`
+--
+ALTER TABLE `tb_lantai`
+  MODIFY `id_lantai` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
+--
+-- AUTO_INCREMENT for table `tb_ruangan`
+--
+ALTER TABLE `tb_ruangan`
+  MODIFY `id_ruangan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
+--
+-- AUTO_INCREMENT for table `tb_unit`
+--
+ALTER TABLE `tb_unit`
+  MODIFY `id_unit` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
+--
+-- AUTO_INCREMENT for table `tb_user`
+--
+ALTER TABLE `tb_user`
+  MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
 --
 -- Constraints for dumped tables
 --

-- Table structure for table `tb_det_booking`
--

CREATE TABLE IF NOT EXISTS `tb_det_booking` (
  `id_det_booking` int(11) NOT NULL,
  `id_jadwal` int(11) NOT NULL,
  `id_booking` int(11) NOT NULL,
  KEY `fk_id_booking` (`id_booking`),
  KEY `fk_id_jadwal` (`id_jadwal`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

(11, 'sky eye', 1),
(12, 'sky eyes', 1),
(13, 'Lalalangsat Tower', 1),
(14, '', 1),
(15, '', 1),
(16, '', 1);

-- --------------------------------------------------------

