text: -- phpMyAdmin SQL Dump
  -- version 5.0.2
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: Apr 15, 2021 at 10:41 AM
  -- Server version: 10.4.14-MariaDB
  -- PHP Version: 7.4.9
  
  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: `tokoline`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `cart`
  --
  
  CREATE TABLE `cart` (
    `idcart` int(11) NOT NULL,
    `orderid` varchar(100) NOT NULL,
    `userid` int(11) NOT NULL,
    `tglorder` timestamp NOT NULL DEFAULT current_timestamp(),
    `status` varchar(10) NOT NULL DEFAULT 'Cart'
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `cart`
  --
  
  INSERT INTO `cart` (`idcart`, `orderid`, `userid`, `tglorder`, `status`) VALUES
  (10, '15wKVT0nej25Y', 2, '2020-03-16 12:10:42', 'Selesai'),
  (11, '15Swf8Ye0Fm.M', 2, '2020-03-16 12:17:34', 'Confirmed'),
  (12, '15PzF03ejd8W2', 1, '2020-05-13 02:40:48', 'Confirmed'),
  (13, '16D4KjwrLE3Vg', 3, '2021-04-14 05:15:34', 'Confirmed'),
  (14, '16QjTGcUsxXJw', 1, '2021-04-14 07:44:19', 'Cart'),
  (15, '16uwojLNvn9Cg', 2, '2021-04-14 11:27:09', 'Confirmed'),
  (16, '16y0vLhm8UyJQ', 5, '2021-04-15 08:12:34', 'Confirmed');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `detailorder`
  --
  
  CREATE TABLE `detailorder` (
    `detailid` int(11) NOT NULL,
    `orderid` varchar(100) NOT NULL,
    `idproduk` int(11) NOT NULL,
    `qty` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `detailorder`
  --
  
  INSERT INTO `detailorder` (`detailid`, `orderid`, `idproduk`, `qty`) VALUES
  (21, '16uwojLNvn9Cg', 9, 10),
  (22, '16uwojLNvn9Cg', 4, 1),
  (23, '16y0vLhm8UyJQ', 9, 10);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `kategori`
  --
  
  CREATE TABLE `kategori` (
    `idkategori` int(11) NOT NULL,
    `namakategori` varchar(20) NOT NULL,
    `tgldibuat` timestamp NOT NULL DEFAULT current_timestamp()
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `kategori`
  --
  
  INSERT INTO `kategori` (`idkategori`, `namakategori`, `tgldibuat`) VALUES
  (4, 'Sepatu Merk', '2021-04-14 13:26:23'),
  (5, 'Sepatu Cwek', '2021-04-14 13:47:11'),
  (6, 'sepatu jordan', '2021-04-15 08:15:21');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `konfirmasi`
  --
  
  CREATE TABLE `konfirmasi` (
    `idkonfirmasi` int(11) NOT NULL,
    `orderid` varchar(100) NOT NULL,
    `userid` int(11) NOT NULL,
    `payment` varchar(10) NOT NULL,
    `namarekening` varchar(25) NOT NULL,
    `tglbayar` date NOT NULL,
    `tglsubmit` timestamp NOT NULL DEFAULT current_timestamp()
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `konfirmasi`
  --
  
  INSERT INTO `konfirmasi` (`idkonfirmasi`, `orderid`, `userid`, `payment`, `namarekening`, `tglbayar`, `tglsubmit`) VALUES
  (1, '15PzF03ejd8W2', 1, 'Bank BCA', 'Admin', '2020-05-16', '2020-05-13 02:41:51'),
  (2, '16D4KjwrLE3Vg', 3, 'Bank BCA', 'iksal', '2021-04-20', '2021-04-14 05:16:26'),
  (3, '15Swf8Ye0Fm.M', 2, 'Bank Mandi', 'iksal', '2021-04-09', '2021-04-14 11:26:50'),
  (4, '16uwojLNvn9Cg', 2, 'Bank Mandi', 'iksal', '2021-04-25', '2021-04-14 13:56:03'),
  (5, '16y0vLhm8UyJQ', 5, 'Bank BCA', 'angga', '2021-04-15', '2021-04-15 08:13:35');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `login`
  --
  
  CREATE TABLE `login` (
    `userid` int(11) NOT NULL,
    `namalengkap` varchar(50) NOT NULL,
    `email` varchar(50) NOT NULL,
    `password` varchar(150) NOT NULL,
    `notelp` varchar(15) NOT NULL,
    `alamat` varchar(100) NOT NULL,
    `tgljoin` timestamp NOT NULL DEFAULT current_timestamp(),
    `role` varchar(7) NOT NULL DEFAULT 'Member',
    `lastlogin` timestamp NULL DEFAULT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `login`
  --
  
  INSERT INTO `login` (`userid`, `namalengkap`, `email`, `password`, `notelp`, `alamat`, `tgljoin`, `role`, `lastlogin`) VALUES
  (1, 'Admin', 'admin', '$2y$10$GJVGd4ji3QE8ikTBzNyA0uLQhiGd6MirZeSJV1O6nUpjSVp1eaKzS', '01234567890', 'Indonesia', '2020-03-16 11:31:17', 'Admin', NULL),
  (2, 'Guest', 'guest', '$2y$10$xXEMgj5pMT9EE0QAx3QW8uEn155Je.FHH5SuIATxVheOt0Z4rhK6K', '01234567890', 'Indonesia', '2020-03-16 11:30:40', 'Member', NULL),
  (3, 'iksal', 'iksal', '$2y$10$N30AZyrwE3xayKdknRa09uaQv6BgH1IGZXKEFFy5eM3iLR5gBFniy', '01223454321', 'indonesia', '2021-04-14 05:01:26', 'Member', NULL),
  (4, 'rian', 'rian', '$2y$10$5qRIjvPj0bKaTCZGJDbT4eD6QNVX3419WP4UnVr2x2TURlT2siERG', '983727423', 'indo', '2021-04-14 13:57:15', 'Member', NULL),
  (5, 'angga', 'angga@gmail.com', '$2y$10$VGtjvJ923bwIvl93kKcx9Obaz7C/H.x1q8WC4q5tf8knyEh7u.Liu', '9078677855', 'indonesia', '2021-04-15 08:11:31', 'Member', NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `pembayaran`
  --
  
  CREATE TABLE `pembayaran` (
    `no` int(11) NOT NULL,
    `metode` varchar(25) NOT NULL,
    `norek` varchar(25) NOT NULL,
    `logo` text DEFAULT NULL,
    `an` varchar(20) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `pembayaran`
  --
  
  INSERT INTO `pembayaran` (`no`, `metode`, `norek`, `logo`, `an`) VALUES
  (1, 'Bank BCA', '13131231231', 'images/bca.jpg', 'Tokopekita'),
  (2, 'Bank Mandiri', '943248844843', 'images/mandiri.jpg', 'Tokopekita'),
  (3, 'DANA', '0882313132123', 'images/dana.png', 'Tokopekita');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `produk`
  --
  
  CREATE TABLE `produk` (
    `idproduk` int(11) NOT NULL,
    `idkategori` int(11) NOT NULL,
    `namaproduk` varchar(30) NOT NULL,
    `gambar` varchar(100) NOT NULL,
    `deskripsi` varchar(200) NOT NULL,
    `rate` int(11) NOT NULL,
    `hargabefore` int(11) NOT NULL,
    `hargaafter` int(11) NOT NULL,
    `tgldibuat` timestamp NOT NULL DEFAULT current_timestamp()
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  
  --
  -- Dumping data for table `produk`
  --
  
  INSERT INTO `produk` (`idproduk`, `idkategori`, `namaproduk`, `gambar`, `deskripsi`, `rate`, `hargabefore`, `hargaafter`, `tgldibuat`) VALUES
  (4, 4, 'Sepatu1', 'produk/16Z6qBfGz3P02.jpg', 'Sangat bagus', 5, 100, 50, '2021-04-14 13:28:37'),
  (5, 4, 'Sepatu2', 'produk/16.wtpwYf9XMU.jpg', 'Sangat bagus', 5, 50, 25, '2021-04-14 13:29:42'),
  (6, 5, 'Sepatu3', 'produk/16hEkjBwZUqFg.jpg', 'Sangat bagus', 5, 3000, 1000, '2021-04-14 13:47:49'),
  (7, 5, 'Sepatu4', 'produk/16iW9ILHlguhs.jpg', 'Sangat bagus', 5, 3000, 4998, '2021-04-14 13:48:40'),
  (8, 5, 'Sepatu5', 'produk/16a0wTpJk3EY..jpg', 'Sangat bagus', 5, 100000, 50000, '2021-04-14 13:53:11'),
  (9, 4, 'Sepatu6', 'produk/16qHcpNzXJKgM.jpg', 'Sangat bagus', 4, 1000000, 500000, '2021-04-14 13:53:53'),
  (10, 6, 'sepatu10', 'produk/16.7NS44Ekqrk.jpg', 'Sangat bagus', 5, 5000000, 1000000, '2021-04-15 08:16:57');
  
  --
  -- Indexes for dumped tables
  --
  
  --
  -- Indexes for table `cart`
  --
  ALTER TABLE `cart`
    ADD PRIMARY KEY (`idcart`),
    ADD UNIQUE KEY `orderid` (`orderid`),
    ADD KEY `orderid_2` (`orderid`);
  
  --
  -- Indexes for table `detailorder`
  --
  ALTER TABLE `detailorder`
    ADD PRIMARY KEY (`detailid`),
    ADD KEY `orderid` (`orderid`),
    ADD KEY `idproduk` (`idproduk`);
  
  --
  -- Indexes for table `kategori`
  --
  ALTER TABLE `kategori`
    ADD PRIMARY KEY (`idkategori`);
  
  --
  -- Indexes for table `konfirmasi`
  --
  ALTER TABLE `konfirmasi`
    ADD PRIMARY KEY (`idkonfirmasi`),
    ADD KEY `userid` (`userid`);
  
  --
  -- Indexes for table `login`
  --
  ALTER TABLE `login`
    ADD PRIMARY KEY (`userid`);
  
  --
  -- Indexes for table `pembayaran`
  --
  ALTER TABLE `pembayaran`
    ADD PRIMARY KEY (`no`);
  
  --
  -- Indexes for table `produk`
  --
  ALTER TABLE `produk`
    ADD PRIMARY KEY (`idproduk`),
    ADD KEY `idkategori` (`idkategori`);
  
  --
  -- AUTO_INCREMENT for dumped tables
  --
  
  --
  -- AUTO_INCREMENT for table `cart`
  --
  ALTER TABLE `cart`
    MODIFY `idcart` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
  
  --
  -- AUTO_INCREMENT for table `detailorder`
  --
  ALTER TABLE `detailorder`
    MODIFY `detailid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
  
  --
  -- AUTO_INCREMENT for table `kategori`
  --
  ALTER TABLE `kategori`
    MODIFY `idkategori` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
  
  --
  -- AUTO_INCREMENT for table `konfirmasi`
  --
  ALTER TABLE `konfirmasi`
    MODIFY `idkonfirmasi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
  
  --
  -- AUTO_INCREMENT for table `login`
  --
  ALTER TABLE `login`
    MODIFY `userid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
  
  --
  -- AUTO_INCREMENT for table `pembayaran`
  --
  ALTER TABLE `pembayaran`
    MODIFY `no` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
  
  --
  -- AUTO_INCREMENT for table `produk`
  --
  ALTER TABLE `produk`
    MODIFY `idproduk` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `detailorder`
  --
  ALTER TABLE `detailorder`
    ADD CONSTRAINT `idproduk` FOREIGN KEY (`idproduk`) REFERENCES `produk` (`idproduk`) ON DELETE CASCADE ON UPDATE CASCADE,
    ADD CONSTRAINT `orderid` FOREIGN KEY (`orderid`) REFERENCES `cart` (`orderid`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `konfirmasi`
  --
  ALTER TABLE `konfirmasi`
    ADD CONSTRAINT `userid` FOREIGN KEY (`userid`) REFERENCES `login` (`userid`) ON DELETE CASCADE ON UPDATE CASCADE;
  
  --
  -- Constraints for table `produk`
  --
  ALTER TABLE `produk`
    ADD CONSTRAINT `idkategori` FOREIGN KEY (`idkategori`) REFERENCES `kategori` (`idkategori`) 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 */;
  