text: -- phpMyAdmin SQL Dump
  -- version 4.7.4
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: 27 Feb 2018 pada 20.29
  -- Versi Server: 10.1.26-MariaDB
  -- PHP Version: 7.1.9
  
  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: `db_travelukk`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `customer`
  --
  
  CREATE TABLE `customer` (
    `id` int(10) NOT NULL,
    `name` varchar(100) NOT NULL,
    `address` text NOT NULL,
    `phone` varchar(15) NOT NULL,
    `email` varchar(50) NOT NULL,
    `gender` enum('l','p','','') NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data untuk tabel `customer`
  --
  
  INSERT INTO `customer` (`id`, `name`, `address`, `phone`, `email`, `gender`) VALUES
  (229, 'sdfd', 'sdf', '324324', 'asdf', 'l'),
  (230, 'sdfsd', 'dsf', '3423', 'sdf', 'l'),
  (235, 'sdfd', 'sdf', '234', 'asdf', 'l'),
  (236, 's', 's', '234', 'dfs', 'l');
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `passengers`
  --
  
  CREATE TABLE `passengers` (
    `id` int(10) NOT NULL,
    `customer_id` int(10) DEFAULT NULL,
    `reservation_id` int(10) DEFAULT NULL,
    `seat` int(10) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data untuk tabel `passengers`
  --
  
  INSERT INTO `passengers` (`id`, `customer_id`, `reservation_id`, `seat`) VALUES
  (95, 229, NULL, 1),
  (96, 230, 99, 10),
  (97, 235, 102, 9);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `reservation`
  --
  
  CREATE TABLE `reservation` (
    `id` int(10) NOT NULL,
    `reservation_code` varchar(8) NOT NULL,
    `reservation_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `user_id` int(10) DEFAULT NULL,
    `rute_id` int(10) DEFAULT NULL,
    `status` int(1) NOT NULL DEFAULT '0',
    `proof_of_payment` varchar(222) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data untuk tabel `reservation`
  --
  
  INSERT INTO `reservation` (`id`, `reservation_code`, `reservation_date`, `user_id`, `rute_id`, `status`, `proof_of_payment`) VALUES
  (99, 'JO19825', '2018-02-25 12:53:20', 24, 8, 0, '2b3d9f5f8a5bae9802defb33a450db2257cfe58df6234ee44087debfc1fc1d60.jpg'),
  (102, 'JO42885', '2018-02-25 19:26:07', 24, 8, 0, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `rute`
  --
  
  CREATE TABLE `rute` (
    `id` int(10) NOT NULL,
    `depart` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `arrive` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
    `rute_from` varchar(50) NOT NULL,
    `rute_to` varchar(50) NOT NULL,
    `price` int(10) NOT NULL,
    `class` enum('First','Economy') NOT NULL,
    `transportation_id` int(10) DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data untuk tabel `rute`
  --
  
  INSERT INTO `rute` (`id`, `depart`, `arrive`, `rute_from`, `rute_to`, `price`, `class`, `transportation_id`) VALUES
  (8, '2018-02-24 16:43:40', '2018-02-26 21:27:00', 'Cilacap', 'Jakarta', 899999, 'First', 3),
  (10, '2018-02-26 06:08:14', '2018-02-28 12:05:53', 'Bumiayu', 'Cilacap', 56000, 'Economy', 3);
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `transportation`
  --
  
  CREATE TABLE `transportation` (
    `id` int(10) NOT NULL,
    `code` varchar(50) NOT NULL,
    `description` text NOT NULL,
    `seat_qty` varchar(10) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data untuk tabel `transportation`
  --
  
  INSERT INTO `transportation` (`id`, `code`, `description`, `seat_qty`) VALUES
  (3, 'JONAIR ', 'jonair', '15'),
  (6, 'APUAIR', 'APUAPU', '25');
  
  -- --------------------------------------------------------
  
  --
  -- Struktur dari tabel `user`
  --
  
  CREATE TABLE `user` (
    `id` int(10) NOT NULL,
    `username` varchar(255) NOT NULL,
    `password` varchar(255) NOT NULL,
    `level` int(3) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  --
  -- Dumping data untuk tabel `user`
  --
  
  INSERT INTO `user` (`id`, `username`, `password`, `level`) VALUES
  (24, 'jondes', '$2y$10$bJTtq6wZu3Y4mq9b1XwCI.pfgWWRW7Tt4iYnESowwpU0NDK9x2bSa', 1),
  (26, 'apuss', '$2y$10$5s4Si4nfvV9bXKhm4onbZe6jzhjfHgFpeKEXdVgU7wAtx8k29x6w.', 2),
  (27, 'jon', '$2y$10$VmGB16BMNkmtanAMICBc/OLXCRlRF6hzFkOyZRiOyfOyVupvPSkHW', 2);
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `customer`
  --
  ALTER TABLE `customer`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `passengers`
  --
  ALTER TABLE `passengers`
    ADD PRIMARY KEY (`id`),
    ADD KEY `customer_id` (`customer_id`),
    ADD KEY `passengers_ibfk_2` (`reservation_id`);
  
  --
  -- Indexes for table `reservation`
  --
  ALTER TABLE `reservation`
    ADD PRIMARY KEY (`id`),
    ADD KEY `rute_id` (`rute_id`),
    ADD KEY `user_id` (`user_id`);
  
  --
  -- Indexes for table `rute`
  --
  ALTER TABLE `rute`
    ADD PRIMARY KEY (`id`),
    ADD KEY `transportation_id` (`transportation_id`);
  
  --
  -- Indexes for table `transportation`
  --
  ALTER TABLE `transportation`
    ADD PRIMARY KEY (`id`);
  
  --
  -- Indexes for table `user`
  --
  ALTER TABLE `user`
    ADD PRIMARY KEY (`id`),
    ADD UNIQUE KEY `username` (`username`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `customer`
  --
  ALTER TABLE `customer`
    MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=237;
  
  --
  -- AUTO_INCREMENT for table `passengers`
  --
  ALTER TABLE `passengers`
    MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=98;
  
  --
  -- AUTO_INCREMENT for table `reservation`
  --
  ALTER TABLE `reservation`
    MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=103;
  
  --
  -- AUTO_INCREMENT for table `rute`
  --
  ALTER TABLE `rute`
    MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
  
  --
  -- AUTO_INCREMENT for table `transportation`
  --
  ALTER TABLE `transportation`
    MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
  
  --
  -- AUTO_INCREMENT for table `user`
  --
  ALTER TABLE `user`
    MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
  
  --
  -- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
  --
  
  --
  -- Ketidakleluasaan untuk tabel `passengers`
  --
  ALTER TABLE `passengers`
    ADD CONSTRAINT `passengers_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
    ADD CONSTRAINT `passengers_ibfk_2` FOREIGN KEY (`reservation_id`) REFERENCES `reservation` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;
  
  --
  -- Ketidakleluasaan untuk tabel `reservation`
  --
  ALTER TABLE `reservation`
    ADD CONSTRAINT `reservation_ibfk_1` FOREIGN KEY (`rute_id`) REFERENCES `rute` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
    ADD CONSTRAINT `reservation_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;
  
  --
  -- Ketidakleluasaan untuk tabel `rute`
  --
  ALTER TABLE `rute`
    ADD CONSTRAINT `rute_ibfk_1` FOREIGN KEY (`transportation_id`) REFERENCES `transportation` (`id`) ON DELETE SET NULL 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 */;
  