-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 01, 2024 at 04:22 AM
-- Server version: 8.0.37-cll-lve
-- PHP Version: 8.1.29

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: `wsmifmyh_saricatering`
--

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

--
-- Table structure for table `chat`
--

CREATE TABLE `chat` (
  `id_chat` int NOT NULL,
  `id_admin` int NOT NULL,
  `id_pembeli` int NOT NULL,
  `pesan` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  `sender` varchar(10) COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Admin | Pembeli',
  `timestamp` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

--
-- Dumping data for table `chat`
--

INSERT INTO `chat` (`id_chat`, `id_admin`, `id_pembeli`, `pesan`, `sender`, `timestamp`) VALUES
(1, 1, 17, 'test', 'Admin', '2024-05-02 00:04:24'),
(2, 1, 18, 'test', 'Admin', '2024-05-02 00:04:43'),
(3, 1, 17, 'tester', 'Pembeli', '2024-05-02 00:04:55'),
(4, 1, 17, 'tester', 'Admin', '2024-05-06 13:51:02'),
(5, 1, 17, 'test', 'Admin', '2024-05-06 13:55:19'),
(6, 1, 17, 'testertester', 'Admin', '2024-05-06 13:57:20'),
(7, 1, 20, 'test', 'Pembeli', '2024-05-07 00:57:32'),
(8, 1, 21, 'hallo admin', 'Pembeli', '2024-05-07 02:47:42'),
(9, 1, 22, 'hallo admin saya ingin pesan makanan untum menu besok, apakah bisa?', 'Pembeli', '2024-05-15 17:43:48'),
(10, 1, 22, 'hallo, bisa ', 'Admin', '2024-05-15 22:25:17'),
(11, 1, 22, 'bisa kak', 'Admin', '2024-06-11 20:05:55');

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

--
-- Table structure for table `keranjang`
--

CREATE TABLE `keranjang` (
  `id_keranjang` int NOT NULL,
  `id_pembeli` int NOT NULL,
  `id_produk` int NOT NULL,
  `jumlah` int NOT NULL,
  `date` datetime NOT NULL,
  `harga` int NOT NULL,
  `subtotal` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `keranjang`
--

INSERT INTO `keranjang` (`id_keranjang`, `id_pembeli`, `id_produk`, `jumlah`, `date`, `harga`, `subtotal`) VALUES
(95, 25, 29, 1, '2024-06-22 00:05:00', 12000, 12000);

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

--
-- Table structure for table `menu_harian`
--

CREATE TABLE `menu_harian` (
  `id_menu` int NOT NULL,
  `id_produk` int DEFAULT NULL,
  `date_created` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `menu_harian`
--

INSERT INTO `menu_harian` (`id_menu`, `id_produk`, `date_created`) VALUES
(17, 32, '2024-06-11'),
(18, 38, '2024-06-11'),
(19, 39, '2024-06-11'),
(20, 40, '2024-06-11'),
(22, 42, '2024-06-11');

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

--
-- Table structure for table `pembeli`
--

CREATE TABLE `pembeli` (
  `id_pembeli` int NOT NULL,
  `nama_pembeli` varchar(50) NOT NULL,
  `alamat` varchar(100) NOT NULL,
  `kecamatan` varchar(255) NOT NULL,
  `email` varchar(125) NOT NULL,
  `no_hp` varchar(15) NOT NULL,
  `id_pengguna` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `pembeli`
--

INSERT INTO `pembeli` (`id_pembeli`, `nama_pembeli`, `alamat`, `kecamatan`, `email`, `no_hp`, `id_pengguna`) VALUES
(16, 'ayu', 'jember', '', 'ayu@gmail.com', '085236965234', 17),
(17, 'tes', 'dmn', '', 'tester@gmail.com', '0895671234', 18),
(18, 'tester2', 'dmn', '', 'tester@gmail.com', '324567891', 19),
(19, 'saya', 'prob', '', 'saya@gmail.com', '896536', 20),
(20, 'testertester', 'gatau', '', 'testertester@gmail.com', '8965326466979', 21),
(21, 'Ayu', 'Jember', '', 'ayuandini584@gmail.com', '08999310381', 22),
(22, 'Adinda', 'Lumajang', '', 'adindamaharani@gmail.com', '089993563485', 23),
(23, 'Nagita', 'Jakarta', '', 'nagitaslavina@gmail.com', '085234665231', 24),
(24, 'Rayyanza', 'Jakarta', '', 'rayyanzamalik@gmail.com', '081553695234', 25),
(25, 'gempita', 'Jl. Samudra Lima', 'Wonoasih', 'gempitha@gmail.com', '085234665234', 26),
(26, 'rendy', 'kanigaran', '', 'rendy@gmail.com', '085234665987', 27),
(27, 'Riska', 'Jrebenglor', '', 'ayuandini97x@gmail.com', '08999310381', 28),
(28, 'Andini', 'Jl. Sunan Giri', 'Wonoasih', 'andiniay@gmail.com', '089663523452', 29),
(29, 'Luli', 'Jl. Mawar ', 'Wonoasih', 'luli@gmail.com', '082332654352', 30),
(30, 'Azizah', 'Jl. Kalimas', 'Paiton', 'azizah@gmail.com', '089632552850', 31);

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

--
-- Table structure for table `pengguna`
--

CREATE TABLE `pengguna` (
  `id_pengguna` int NOT NULL,
  `nama_lengkap` varchar(50) NOT NULL,
  `nama_belakang` varchar(20) NOT NULL,
  `username` varchar(20) NOT NULL,
  `email` varchar(125) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` enum('Admin','Pembeli') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `pengguna`
--

INSERT INTO `pengguna` (`id_pengguna`, `nama_lengkap`, `nama_belakang`, `username`, `email`, `password`, `role`) VALUES
(1, 'admin', 'catering', 'admin', 'ayuandini584@gmail.com', '$2y$10$/n1nCTT0OF5lGyFoaHkZCuI6pibxP/UHNQmIx/eb8uSOjSPw6q08e', 'Admin'),
(17, 'ayu', 'ay', 'ayu', 'ayu@gmail.com', '$2y$10$p5yWUxJnV/dZ.wLYxELi/uVCnEcaAKzvD5aK5.oxcw8CKfVaxv8wK', 'Pembeli'),
(18, 'tes', 'ter', 'tester', 'tester@gmail.com', '$2y$10$TpRftardnGp.JAvksjNgNOwaurE2GzCnp3tymS7I4Rlzomj0RKu96', 'Pembeli'),
(19, 'tester2', '2', 'tester2', 'tester@gmail.com', '$2y$10$UolnkFvm.hlBxBcqvCgrHe/kbKCU8EqOh8wIHnxKNHaITLX8Hmbz2', 'Pembeli'),
(20, 'saya', 'aya', 'saya', 'saya@gmail.com', '$2y$10$.VEpjfenY1rKd71q0PL0v.uHzBNGMjM3PRq/x8iLekqnEywRXjolm', 'Pembeli'),
(21, 'tester', 'tester', 'testertester', 'testertester@gmail.com', '$2y$10$KVeBzPXI2.MqSGqK9Nko4O63RDi..QJlhwH74iFdJbJbEQ/dDfgbK', 'Pembeli'),
(22, 'Ayu', 'Andini', 'Ayu Andini', 'ayuandini584@gmail.com', '$2y$10$aJAWZ5aUnsxL.43Wx7TbOOj0ugBdcV5Jg1LLjNAwNtIfMDj6g76WS', 'Pembeli'),
(23, 'Adinda', 'Maharani', 'Adinda Maharani', 'adindamaharani@gmail.com', '$2y$10$a48PUNlczoq.ra22n2T/BeDNbueF0EGaVUihzfQ4kOnqRXFAUjaE.', 'Pembeli'),
(24, 'Nagita', 'Slavina', 'Nagita Slavina', 'nagitaslavina@gmail.com', '$2y$10$YnRUPslSGEIPGqlazLuXSuwOgKC3S4poHt1KBI5qmrfB0toRKvxIO', 'Pembeli'),
(25, 'Rayyanza', 'Malik Ahmad', 'Rayyanza Malik', 'rayyanzamalik@gmail.com', '$2y$10$E6r3ChoCLNUa1gFjBTDztu/dw5jsXDRPRDmJar5XYj/5fJXJ2v45i', 'Pembeli'),
(26, 'gempita', 'sharena', 'gempita', 'gempitha@gmail.com', '$2y$10$dZtC80mOmxPXbzGV1dcQ.ue1EivIwBOaYoPh.zxVKXs0DEVkgTpU2', 'Pembeli'),
(27, 'rendy', 'riyandika', 'rendy', 'rendy@gmail.com', '$2y$10$yvbo8U2JslP85i/O5f2pCeKjI0x.SvbdVy1TQUJdo7sjlwukD7MYm', 'Pembeli'),
(28, 'Riska', 'Andini', 'Riska', 'ayuandini97x@gmail.com', '$2y$10$RF4viXpJ3pC4kI5niV1mLeVNBlyk7HBvgNGl7UXpbwH8EypDoupYq', 'Pembeli'),
(29, 'Andini', 'Ayu', 'Andiniay', 'andiniay@gmail.com', '$2y$10$tJj2XHxXiiK1w0qRbqqT.OdLGspL2RuKrRUGYMk3sNDaeNRNUXx66', 'Pembeli'),
(30, 'Luli', 'Luli', 'luli', 'luli@gmail.com', '$2y$10$W7Gmn6ByVbKGqMbBIDLKEeLc5rerKTK71pI9Vy7cPz7pueQ93a7GS', 'Pembeli'),
(31, 'Azizah', 'Azizah', 'azizah', 'azizah@gmail.com', '$2y$10$adS9jbxcBhi1/MQg6uaOweP55.MsBAjZHVScCKf5RTktshlMy5xVa', 'Pembeli');

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

--
-- Table structure for table `penjualan`
--

CREATE TABLE `penjualan` (
  `id_penjualan` int NOT NULL,
  `no_invoice` varchar(255) NOT NULL,
  `tanggal` date NOT NULL,
  `tanggal_pembayaran` date NOT NULL,
  `id_pembeli` int NOT NULL,
  `total_ongkir` varchar(50) NOT NULL,
  `total` varchar(50) NOT NULL,
  `keterangan` varchar(100) NOT NULL,
  `status_pembayaran` int NOT NULL,
  `status_pesanan` varchar(50) NOT NULL,
  `bukti_pembayaran` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `penjualan`
--

INSERT INTO `penjualan` (`id_penjualan`, `no_invoice`, `tanggal`, `tanggal_pembayaran`, `id_pembeli`, `total_ongkir`, `total`, `keterangan`, `status_pembayaran`, `status_pesanan`, `bukti_pembayaran`) VALUES
(8, 'Catering1711341991928', '2024-03-25', '2024-03-25', 17, '20000', '110000', 'nanti saya pesan lagi kalo cocok', 1, 'selesai', '111386299_1711342185.jpg'),
(9, 'Catering1711342242200', '2024-03-25', '2024-03-25', 17, '20000', '170000', 'cocok', 1, 'batal', '1219564269_1711342770.jpg'),
(10, 'Catering1711342668584', '2024-03-25', '2024-03-25', 17, '20000', '170000', '', 1, 'batal', '930788392_1711342755.jpg'),
(11, 'Catering1711828872972', '2024-03-30', '2024-03-30', 17, '20000', '35000', 'y', 1, 'menunggu konfirmasi', '572056046_1711828976.jpg'),
(12, 'Catering1715811091670', '2024-05-15', '0000-00-00', 22, '12000', '27000', 'banyakin sambel', 0, 'menunggu pembayaran', ''),
(13, 'Catering1715811734524', '2024-05-15', '2024-05-15', 22, '15000', '60000', 'porsi banyak', 1, 'dikirim', ''),
(14, 'Catering1715812126629', '2024-05-15', '2024-05-15', 22, '15000', '45000', '', 1, 'selesai', ''),
(15, 'Catering1715878016638', '2024-05-16', '2024-05-16', 23, '10000', '160000', 'Banyakin Sambel', 1, 'selesai', ''),
(16, 'Catering1716148867684', '2024-05-19', '2024-05-19', 24, '12000', '102000', 'Pedas Gurih', 1, 'selesai', ''),
(17, 'Catering1716178757226', '2024-05-20', '2024-05-20', 24, '10000', '205000', '', 1, 'selesai', ''),
(18, 'Catering1718026622360', '2024-06-10', '2024-06-11', 25, '10000', '22000', '', 1, 'selesai', '1767687676_1718137153.jpg'),
(19, 'Catering1718027727028', '2024-06-10', '2024-06-11', 25, '5000', '17000', '', 1, 'selesai', '74133582_1718137178.jpg'),
(20, 'Catering1718027815435', '2024-06-10', '2024-06-11', 25, '5000', '17000', '', 1, 'selesai', '768854222_1718137071.jpg'),
(21, 'Catering1718028267327', '2024-06-10', '2024-06-10', 25, '10000', '22000', '', 1, 'selesai', ''),
(22, 'Catering1718096728235', '2024-06-11', '2024-06-11', 25, '10000', '22000', '', 1, 'selesai', '1953276058_1718096795.jpg'),
(23, 'Catering1718136194266', '2024-06-11', '2024-06-11', 25, '5000', '20000', '', 1, 'selesai', ''),
(24, 'Catering1718139064897', '2024-06-11', '2024-06-11', 25, '20000', '2710000', '', 1, 'selesai', '354285664_1718139149.jpg'),
(25, 'Catering1718142296600', '2024-06-11', '2024-06-11', 25, '20000', '35000', '', 1, 'selesai', '1889641733_1718142365.jpg'),
(26, 'Catering1718163753979', '2024-06-12', '2024-06-12', 27, '20000', '200000', '', 1, 'selesai', '818163168_1718163850.jpg'),
(27, 'Catering1718164343789', '2024-06-12', '2024-06-12', 25, '15000', '315000', '', 1, 'selesai', '710345264_1718164386.jpg'),
(28, 'Catering1718164535466', '2024-06-12', '2024-06-12', 25, '5000', '65000', '', 1, 'selesai', '904922135_1718164568.jpg'),
(29, 'Catering1718164984562', '2024-06-12', '2024-06-12', 25, '10000', '154000', '', 1, 'menunggu konfirmasi', '1841145001_1718165028.jpg'),
(30, 'Catering1718353532551', '2024-06-14', '0000-00-00', 25, '15000', '207000', '', 0, 'batal', ''),
(31, 'Catering1718901095194', '2024-06-20', '2024-06-20', 25, '15000', '27000', '', 1, 'menunggu konfirmasi', ''),
(32, 'Catering1719149533240', '2024-06-23', '0000-00-00', 29, '15000', '465000', '', 0, 'batal', ''),
(33, 'Catering1719149752467', '2024-06-23', '2024-06-23', 29, '15000', '135000', '', 1, 'selesai', '1786811235_1719149799.jpg'),
(34, 'Catering1719150844529', '2024-06-23', '2024-06-23', 29, '15000', '159000', '', 1, 'batal', '874916741_1719150885.jpg'),
(35, 'Catering1719150945289', '2024-06-23', '2024-06-23', 29, '15000', '27000', '', 1, 'menunggu konfirmasi', ''),
(36, 'Catering1719151016816', '2024-06-23', '0000-00-00', 29, '15000', '27000', '', 0, 'batal', ''),
(37, 'Catering1719273585814', '2024-06-25', '2024-06-25', 30, '20000', '236000', '', 1, 'selesai', '620981166_1719273678.jpg'),
(38, 'Catering1719273866410', '2024-06-25', '0000-00-00', 30, '20000', '32000', '', 0, 'batal', ''),
(39, 'Catering1719274379044', '2024-06-25', '2024-06-25', 30, '20000', '42000', '', 1, 'selesai', '636390119_1719274412.jpg'),
(40, 'Catering1719560753930', '2024-06-28', '0000-00-00', 29, '12000', '24000', '', 0, 'batal', '');

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

--
-- Table structure for table `penjualan_produk`
--

CREATE TABLE `penjualan_produk` (
  `id` int NOT NULL,
  `id_penjualan` int NOT NULL,
  `id_produk` int NOT NULL,
  `harga` varchar(50) NOT NULL,
  `date_pemesanan` datetime NOT NULL,
  `jumlah` varchar(50) NOT NULL,
  `subtotal` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `penjualan_produk`
--

INSERT INTO `penjualan_produk` (`id`, `id_penjualan`, `id_produk`, `harga`, `date_pemesanan`, `jumlah`, `subtotal`) VALUES
(19, 18, 29, '12000', '2024-06-11 17:36:00', '1', '12000'),
(20, 19, 30, '12000', '2024-06-12 20:49:00', '1', '12000'),
(21, 20, 29, '12000', '2024-06-10 20:56:00', '1', '12000'),
(22, 21, 29, '12000', '2024-06-10 20:58:00', '1', '12000'),
(23, 22, 29, '12000', '2024-06-11 16:03:00', '1', '12000'),
(24, 23, 32, '15000', '2024-06-22 06:45:00', '1', '15000'),
(25, 24, 38, '85000', '2024-06-12 08:30:00', '6', '510000'),
(26, 24, 39, '48000', '2024-06-12 07:00:00', '25', '1200000'),
(27, 24, 40, '35000', '2024-06-12 09:40:00', '1', '35000'),
(28, 24, 42, '27000', '2024-06-12 10:00:00', '35', '945000'),
(29, 25, 32, '15000', '2024-06-12 11:00:00', '1', '15000'),
(30, 26, 29, '12000', '2024-06-13 12:00:00', '15', '180000'),
(31, 27, 32, '15000', '2024-07-01 04:50:00', '20', '300000'),
(32, 28, 31, '10000', '2025-01-01 12:00:00', '6', '60000'),
(33, 29, 34, '12000', '2024-06-12 01:01:00', '12', '144000'),
(34, 30, 29, '12000', '2024-06-15 15:24:00', '16', '192000'),
(35, 31, 30, '12000', '2024-06-20 15:30:00', '1', '12000'),
(36, 32, 32, '15000', '2024-06-24 15:30:00', '30', '450000'),
(37, 33, 29, '12000', '2024-06-23 20:35:00', '10', '120000'),
(38, 34, 30, '12000', '2024-06-23 20:53:00', '12', '144000'),
(39, 35, 30, '12000', '2024-06-23 20:55:00', '1', '12000'),
(40, 36, 30, '12000', '2024-06-23 20:56:00', '1', '12000'),
(41, 37, 30, '12000', '2024-06-25 06:59:00', '18', '216000'),
(42, 38, 30, '12000', '2024-06-25 07:04:00', '1', '12000'),
(43, 39, 30, '12000', '2024-06-25 07:05:00', '1', '12000'),
(44, 39, 31, '10000', '2024-06-25 07:12:00', '1', '10000'),
(45, 40, 30, '12000', '2024-06-28 14:45:00', '1', '12000');

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

--
-- Table structure for table `produk`
--

CREATE TABLE `produk` (
  `id_produk` int NOT NULL,
  `nama_produk` varchar(50) NOT NULL,
  `kategori` varchar(50) NOT NULL,
  `harga` int NOT NULL,
  `deskripsi` varchar(255) NOT NULL,
  `jml_terjual` int NOT NULL,
  `foto` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `produk`
--

INSERT INTO `produk` (`id_produk`, `nama_produk`, `kategori`, `harga`, `deskripsi`, `jml_terjual`, `foto`) VALUES
(29, 'Ayam Geprek Sambal Matah', 'Ayam Geprek Sambal Matah', 12000, 'Jenis sambal mentah yang disajikan tanpa dimasak', 0, '753144337_1717952196.jpg'),
(30, 'Ayam Kremes', 'Ayam Kremes', 12000, 'Ayam kremes digoreng dengan baluran tepung terigu yang telah dibumbui, dan digoreng hingga matang kecoklatan', 0, '835496897_1717952919.jpg'),
(31, 'Ayam Bakar', 'Ayam Bakar', 10000, 'Daging ayam yang dimasak sebagai hidangan dengan cara dipanggang', 0, '960737964_1717953045.jpg'),
(32, 'Cumi Bakar', 'Cumi Bakar', 15000, 'Cumi-cuminya dilumuri sedikit minyak dan dimasak di atas panggangan panas sampai kulitnya berwarna coklat dan dagingnya putih dan empuk', 0, '516531138_1717953251.jpg'),
(33, 'Telor Balado', 'Telor Balado', 10000, 'Dimasak dengan cara menumis cabai bersama telur hingga meresap', 0, '981160879_1717953386.jpg'),
(34, 'Cumi Tumis Pete', 'Cumi Tumis Pete', 12000, 'Cumi tumis pete pedas manis', 0, '747603600_1717953626.jpg'),
(35, 'Tumis Teri Pari', 'Tumis Teri Pari', 5000, 'Irisan pari yang diolah dengan tumis teri', 0, '1399630269_1717953762.jpg'),
(36, 'Tumis Kangkung Pedas Manis', 'Tumis Kangkung Pedas Manis', 5000, 'Pedas Manis', 0, '940054463_1717953915.jpg'),
(37, 'Tumis Terong Kecap', 'Tumis Terong Kecap', 5000, 'Pedas Manis', 0, '1050289977_1717954008.jpg'),
(38, 'Ayam Kampung Bakar', 'Ayam Kampung Bakar', 85000, 'Daging ayam kampung dimasak sebagai hidangan dengan cara dipanggang', 0, '1204433791_1718138395.jpg'),
(39, 'Nasi Tumpeng Mini', 'Nasi Tumpeng Mini', 48000, 'Nasi tumpeng mini yang berukurang kecil yang biasa disajikan untuk 1 orang berbentuk nasi kotak', 0, '1347449658_1718138500.jpg'),
(40, 'Nila Bakar', 'Nila Bakar', 35000, 'Daging ikan lembut dan durinya termasuk sedikit', 0, '86155444_1718138633.jpg'),
(42, 'Paru Sapi', 'Paru Sapi', 27000, 'Daging yang empuk dan gurih', 0, '1260833182_1718138917.jpg'),
(49, 'ap', 'ap\n', 10000, 'ap', 0, '164574102_1719162407.jpg'),
(50, 'ap', 'ap\n', 10000, 'ap', 0, '153921137_1719162413.jpg'),
(51, 'gacoan', 'gacoan\n', 11000, 'gacoan', 0, '1756946662_1719162742.jpg'),
(52, 'gacoan', 'gacoan\n', 11000, 'gacoan', 0, '242882872_1719162747.jpg'),
(53, 'nasi', 'nasi\n', 5000, 'nasi', 0, '278143331_1719163237.jpg'),
(54, 'nasi', 'nasi\n', 5000, 'nasi', 0, '102367935_1719163243.jpg'),
(55, 'l', 'l', 1, 'l', 0, '979951292_1719164130.jpg');

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

--
-- Table structure for table `ulasan`
--

CREATE TABLE `ulasan` (
  `id_ulasan` int NOT NULL,
  `id_produk` int NOT NULL,
  `id_pembeli` int NOT NULL,
  `rating` int NOT NULL,
  `keterangan` varchar(255) NOT NULL,
  `foto_ulasan` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `date_created` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `ulasan`
--

INSERT INTO `ulasan` (`id_ulasan`, `id_produk`, `id_pembeli`, `rating`, `keterangan`, `foto_ulasan`, `date_created`) VALUES
(8, 32, 25, 5, 'Sangat baik', '', '2024-06-11 20:18:12'),
(9, 29, 25, 5, 'Sangat pedas', '', '2024-06-11 20:18:40'),
(10, 31, 25, 4, 'pedas gurih', '1256317491_1718896845.jpg', '2024-06-20 15:20:45'),
(11, 31, 25, 4, 'pedas gurih', '821413383_1718896855.jpg', '2024-06-20 15:20:55'),
(12, 31, 25, 5, 'Done gatuh', '1999126358_1718897491.jpg', '2024-06-20 15:31:31'),
(13, 31, 25, 5, 'Done gatuh', '796102501_1718897502.jpg', '2024-06-20 15:31:42'),
(14, 31, 25, 5, 'Done gatuh', '1163324618_1718897558.jpg', '2024-06-20 15:32:38'),
(15, 31, 25, 5, 'Done gatuh', '1795927843_1718897565.jpg', '2024-06-20 15:32:45'),
(16, 31, 25, 2, 'mantull', '1486341677_1718897680.jpg', '2024-06-20 15:34:40'),
(17, 31, 25, 2, 'mantull', '1286676025_1718897691.jpg', '2024-06-20 15:34:51'),
(18, 31, 25, 3, 'y', '1401798186_1718898466.jpg', '2024-06-20 15:47:46'),
(19, 31, 25, 3, 'y', '2024151376_1718898479.jpg', '2024-06-20 15:47:59'),
(20, 31, 25, 3, 'y', '713338685_1718898532.jpg', '2024-06-20 15:48:52'),
(21, 31, 25, 3, 'y', '1823303030_1718898543.jpg', '2024-06-20 15:49:03'),
(22, 31, 25, 2, 'Y', '633816696_1718899353.jpg', '2024-06-20 16:02:33'),
(23, 31, 25, 2, 'Y', '712312548_1718899359.jpg', '2024-06-20 16:02:39'),
(24, 31, 25, 4, 'sipp\n\n', '1982530709_1718900240.jpg', '2024-06-20 16:17:20'),
(25, 31, 25, 4, 'sipp\n\n', '1614007382_1718900249.jpg', '2024-06-20 16:17:29'),
(26, 29, 29, 4, 'oke', '511450366_1719149929.jpg', '2024-06-23 13:38:49'),
(27, 29, 29, 4, 'oke', '1102265321_1719149935.jpg', '2024-06-23 13:38:55'),
(28, 30, 30, 5, 'ya', '114150331_1719273952.jpg', '2024-06-25 00:05:52'),
(29, 30, 30, 5, 'oke', '1799877420_1719274081.jpg', '2024-06-25 00:08:01'),
(30, 30, 30, 5, 'oke', '419662980_1719274110.jpg', '2024-06-25 00:08:30'),
(31, 30, 30, 5, 'okeeee', '660075184_1719274328.jpg', '2024-06-25 00:12:08'),
(32, 30, 30, 5, 'sgt baik', '932669307_1719274490.jpg', '2024-06-25 00:14:50'),
(33, 30, 30, 5, 'terimakasih', '877777952_1719387357.jpg', '2024-06-26 07:35:57');

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

--
-- Table structure for table `user_token`
--

CREATE TABLE `user_token` (
  `id` int NOT NULL,
  `email` varchar(125) NOT NULL,
  `token` varchar(128) NOT NULL,
  `date_created` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `user_token`
--

INSERT INTO `user_token` (`id`, `email`, `token`, `date_created`) VALUES
(39, 'ridho.sid25@gmail.com', 'pgXz', 1711267029),
(40, 'ridho.sid25@gmail.com', 'c60x', 1711267186),
(41, 'ridho.sid25@gmail.com', 'NI/U', 1711267265),
(42, 'ridhoriyadihartomo@gmail.com', 'GkF2btU05bujyaccmo5sGduQgkbfJP8VixLoSx88xYU=', 1718026244);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `chat`
--
ALTER TABLE `chat`
  ADD PRIMARY KEY (`id_chat`),
  ADD KEY `id_admin` (`id_admin`),
  ADD KEY `id_pembeli` (`id_pembeli`);

--
-- Indexes for table `keranjang`
--
ALTER TABLE `keranjang`
  ADD PRIMARY KEY (`id_keranjang`),
  ADD KEY `id_pembeli` (`id_pembeli`),
  ADD KEY `id_produk` (`id_produk`);

--
-- Indexes for table `menu_harian`
--
ALTER TABLE `menu_harian`
  ADD PRIMARY KEY (`id_menu`),
  ADD KEY `id_produk` (`id_produk`) USING BTREE;

--
-- Indexes for table `pembeli`
--
ALTER TABLE `pembeli`
  ADD PRIMARY KEY (`id_pembeli`),
  ADD KEY `id_pengguna` (`id_pengguna`);

--
-- Indexes for table `pengguna`
--
ALTER TABLE `pengguna`
  ADD PRIMARY KEY (`id_pengguna`);

--
-- Indexes for table `penjualan`
--
ALTER TABLE `penjualan`
  ADD PRIMARY KEY (`id_penjualan`),
  ADD KEY `id_pembeli` (`id_pembeli`);

--
-- Indexes for table `penjualan_produk`
--
ALTER TABLE `penjualan_produk`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id_penjualan` (`id_penjualan`),
  ADD KEY `id_produk` (`id_produk`);

--
-- Indexes for table `produk`
--
ALTER TABLE `produk`
  ADD PRIMARY KEY (`id_produk`);

--
-- Indexes for table `ulasan`
--
ALTER TABLE `ulasan`
  ADD PRIMARY KEY (`id_ulasan`),
  ADD KEY `id_produk` (`id_produk`),
  ADD KEY `id_pembeli` (`id_pembeli`);

--
-- Indexes for table `user_token`
--
ALTER TABLE `user_token`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `chat`
--
ALTER TABLE `chat`
  MODIFY `id_chat` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- AUTO_INCREMENT for table `keranjang`
--
ALTER TABLE `keranjang`
  MODIFY `id_keranjang` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=106;

--
-- AUTO_INCREMENT for table `menu_harian`
--
ALTER TABLE `menu_harian`
  MODIFY `id_menu` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;

--
-- AUTO_INCREMENT for table `pembeli`
--
ALTER TABLE `pembeli`
  MODIFY `id_pembeli` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;

--
-- AUTO_INCREMENT for table `pengguna`
--
ALTER TABLE `pengguna`
  MODIFY `id_pengguna` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;

--
-- AUTO_INCREMENT for table `penjualan`
--
ALTER TABLE `penjualan`
  MODIFY `id_penjualan` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;

--
-- AUTO_INCREMENT for table `penjualan_produk`
--
ALTER TABLE `penjualan_produk`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46;

--
-- AUTO_INCREMENT for table `produk`
--
ALTER TABLE `produk`
  MODIFY `id_produk` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=56;

--
-- AUTO_INCREMENT for table `ulasan`
--
ALTER TABLE `ulasan`
  MODIFY `id_ulasan` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;

--
-- AUTO_INCREMENT for table `user_token`
--
ALTER TABLE `user_token`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=43;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `chat`
--
ALTER TABLE `chat`
  ADD CONSTRAINT `chat_ibfk_1` FOREIGN KEY (`id_admin`) REFERENCES `pengguna` (`id_pengguna`),
  ADD CONSTRAINT `chat_ibfk_2` FOREIGN KEY (`id_pembeli`) REFERENCES `pembeli` (`id_pembeli`);

--
-- Constraints for table `keranjang`
--
ALTER TABLE `keranjang`
  ADD CONSTRAINT `keranjang_ibfk_1` FOREIGN KEY (`id_pembeli`) REFERENCES `pembeli` (`id_pembeli`) ON DELETE CASCADE,
  ADD CONSTRAINT `keranjang_ibfk_2` FOREIGN KEY (`id_produk`) REFERENCES `produk` (`id_produk`) ON DELETE CASCADE;

--
-- Constraints for table `menu_harian`
--
ALTER TABLE `menu_harian`
  ADD CONSTRAINT `menu_harian_ibfk_1` FOREIGN KEY (`id_produk`) REFERENCES `produk` (`id_produk`) ON DELETE CASCADE;

--
-- Constraints for table `pembeli`
--
ALTER TABLE `pembeli`
  ADD CONSTRAINT `pembeli_ibfk_1` FOREIGN KEY (`id_pengguna`) REFERENCES `pengguna` (`id_pengguna`) ON DELETE CASCADE;

--
-- Constraints for table `penjualan`
--
ALTER TABLE `penjualan`
  ADD CONSTRAINT `id_pembeli` FOREIGN KEY (`id_pembeli`) REFERENCES `pembeli` (`id_pembeli`);

--
-- Constraints for table `penjualan_produk`
--
ALTER TABLE `penjualan_produk`
  ADD CONSTRAINT `id_penjualan` FOREIGN KEY (`id_penjualan`) REFERENCES `penjualan` (`id_penjualan`) ON DELETE CASCADE,
  ADD CONSTRAINT `id_produk` FOREIGN KEY (`id_produk`) REFERENCES `produk` (`id_produk`) ON DELETE CASCADE;

--
-- Constraints for table `ulasan`
--
ALTER TABLE `ulasan`
  ADD CONSTRAINT `ulasan_ibfk_1` FOREIGN KEY (`id_pembeli`) REFERENCES `pembeli` (`id_pembeli`) ON DELETE CASCADE,
  ADD CONSTRAINT `ulasan_ibfk_2` FOREIGN KEY (`id_produk`) REFERENCES `produk` (`id_produk`) ON DELETE 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 */;
