-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Oct 16, 2025 at 09:34 AM
-- Server version: 11.8.3-MariaDB-log
-- PHP Version: 7.2.34

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

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

--
-- Table structure for table `admin_log`
--

CREATE TABLE `admin_log` (
  `id` int(11) NOT NULL,
  `admin` varchar(100) NOT NULL,
  `aksi` varchar(50) NOT NULL,
  `waktu` datetime NOT NULL,
  `keterangan` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `admin_log`
--

INSERT INTO `admin_log` (`id`, `admin`, `aksi`, `waktu`, `keterangan`) VALUES
(1, 'admin@admin.com', 'hapus', '2025-10-15 04:47:19', 'Menghapus barang: Laptop Asus'),
(2, 'admin@admin.com', 'hapus', '2025-10-15 06:04:27', 'Menghapus barang: Laptop Acer'),
(3, '', 'Pulihkan Semua', '2025-10-15 07:06:40', 'Admin memulihkan semua barang dari recycle bin'),
(4, '', 'Hapus Barang', '2025-10-15 07:20:55', 'Admin menghapus barang: Laptop Acer'),
(5, '', 'Pulihkan Barang', '2025-10-15 07:21:30', 'Admin memulihkan barang: Laptop Acer'),
(6, '', 'Hapus Barang', '2025-10-15 07:25:48', 'Admin menghapus barang mengandung kata: laptop'),
(7, '', 'Pulihkan Barang', '2025-10-15 07:26:18', 'Admin memulihkan barang: Laptop IBM ThinkPad 300'),
(8, '', 'Hapus Barang', '2025-10-15 07:29:19', 'Admin menghapus barang mengandung kata: hape'),
(9, '', 'Pulihkan Barang', '2025-10-15 07:29:34', 'Admin memulihkan barang: Hape Poco F2'),
(10, '', 'Hapus Barang', '2025-10-15 07:36:23', 'Admin menghapus barang mengandung kata: poco'),
(11, '', 'Pulihkan Barang', '2025-10-15 07:49:09', 'Admin memulihkan barang: Hape Poco F2'),
(12, '', 'Hapus Barang', '2025-10-15 07:50:32', 'Admin menghapus barang mengandung kata: laptop ibm'),
(13, '', 'Pulihkan Barang', '2025-10-15 07:51:23', 'Admin memulihkan barang: Laptop IBM ThinkPad 300'),
(14, '', 'Hapus Barang', '2025-10-15 17:40:16', 'Admin menghapus barang yang mengandung kata: laptop'),
(15, '', 'Pulihkan Semua', '2025-10-15 17:40:40', 'Admin memulihkan semua barang dari recycle bin'),
(16, '', 'Hapus Barang', '2025-10-15 17:42:10', 'Admin menghapus barang: Laptop Asus'),
(17, '', 'Pulihkan Barang', '2025-10-15 17:42:21', 'Admin memulihkan barang: Laptop Asus'),
(18, '', 'Hapus Barang', '2025-10-15 18:08:14', 'Admin menghapus barang: Hape Samsung Galaxy');

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

--
-- Table structure for table `barang`
--

CREATE TABLE `barang` (
  `no_id` int(20) NOT NULL,
  `Nama_barang` varchar(50) NOT NULL,
  `Harga` int(20) NOT NULL,
  `Stok` int(30) NOT NULL,
  `Diskon` int(30) NOT NULL,
  `Gbr_brg` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `barang`
--

INSERT INTO `barang` (`no_id`, `Nama_barang`, `Harga`, `Stok`, `Diskon`, `Gbr_brg`) VALUES
(49, 'Hape Poco F2', 3000000, 4, 0, 'hape_POCO_f2.jpg'),
(51, 'Hape Poco X3', 3500000, 5, 5, 'poco_x3.jpg'),
(55, 'Kopi Kapal Api Sachet', 1500, 845, 5, 'secangkir-kopi.jpg'),
(56, 'Laptop IBM ThinkPad 300', 20000000, 10, 0, 'Laptop_Ibm_thinkpad_300.jpg'),
(58, 'Laptop Acer', 15000000, 5, 0, 'laptop_acer.jpg'),
(59, 'Laptop Asus', 17000000, 12, 0, 'Laptop_Asus.jpg');

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

--
-- Table structure for table `barang_deleted`
--

CREATE TABLE `barang_deleted` (
  `Nama_barang` varchar(50) NOT NULL,
  `Harga` int(20) NOT NULL,
  `Stok` int(30) NOT NULL,
  `Diskon` int(30) NOT NULL,
  `Gbr_brg` varchar(50) NOT NULL,
  `Tanggal_dihapus` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `barang_deleted`
--

INSERT INTO `barang_deleted` (`Nama_barang`, `Harga`, `Stok`, `Diskon`, `Gbr_brg`, `Tanggal_dihapus`) VALUES
('Hape Samsung Galaxy', 5000000, 16, 0, 'Hape_Samsung_galaxy.jpg', '2025-10-15 18:08:14');

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

--
-- Table structure for table `bukti`
--

CREATE TABLE `bukti` (
  `id` int(11) NOT NULL,
  `Email_bukti` varchar(150) NOT NULL,
  `Updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

--
-- Dumping data for table `bukti`
--

INSERT INTO `bukti` (`id`, `Email_bukti`, `Updated_at`) VALUES
(1, 'gembus@gembus.com', '2025-10-16 02:45:17');

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

--
-- Table structure for table `kirim`
--

CREATE TABLE `kirim` (
  `Ongkos` int(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `kirim`
--

INSERT INTO `kirim` (`Ongkos`) VALUES
(30000);

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

--
-- Table structure for table `logo`
--

CREATE TABLE `logo` (
  `Nama_toko` varchar(50) DEFAULT NULL,
  `Gambar_logo` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `logo`
--

INSERT INTO `logo` (`Nama_toko`, `Gambar_logo`) VALUES
('Toko Maju Jaya', 'logo_maju_jaya.png');

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

--
-- Table structure for table `pelanggan`
--

CREATE TABLE `pelanggan` (
  `no_id` int(20) NOT NULL,
  `Nama` varchar(100) NOT NULL,
  `Alamat` varchar(100) NOT NULL,
  `Email` varchar(50) NOT NULL,
  `No_hape` varchar(30) NOT NULL,
  `Gbr_plg` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pelanggan`
--

INSERT INTO `pelanggan` (`no_id`, `Nama`, `Alamat`, `Email`, `No_hape`, `Gbr_plg`) VALUES
(32, 'Edi Sudrajat', 'Cakung, Bekasi, Jawa Barat', 'telo@gmail.com', '0858374794', 'foto_profil_channel_yutup.png'),
(33, 'Jati Kusuma', 'Perak BPM 10, Klaten', 'jatipemuda@gmail.com', '085292193434', 'jati04.jpg'),
(34, 'Edi Seno Adji, Drs', 'Buntalan, RT.003/RW.006, Buntalan, Klaten Tengah, Klaten', 'ediseno@gmail.com', '0859389487', '1-set-ringkasan-shahih-bukhari.png'),
(35, 'Muhammad Firas Zahid Suryaatmaja', 'Gang Kenari 232, Jalan Nologaten, CT, Depok, Sleman, Yogyakarta', 'firas@gmail.com', '085348938', 'logo_firas_rock.jpg');

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

--
-- Table structure for table `pelanggan_deleted`
--

CREATE TABLE `pelanggan_deleted` (
  `id` int(11) NOT NULL,
  `Nama` varchar(100) DEFAULT NULL,
  `Alamat` varchar(255) DEFAULT NULL,
  `Email` varchar(100) DEFAULT NULL,
  `No_hape` varchar(50) DEFAULT NULL,
  `Gbr_plg` varchar(50) NOT NULL,
  `Tanggal_dihapus` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `rekening`
--

CREATE TABLE `rekening` (
  `id` int(11) NOT NULL,
  `Nama_bank` varchar(100) NOT NULL,
  `No_rek` varchar(50) NOT NULL,
  `Atas_nama` varchar(100) NOT NULL,
  `Updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

--
-- Dumping data for table `rekening`
--

INSERT INTO `rekening` (`id`, `Nama_bank`, `No_rek`, `Atas_nama`, `Updated_at`) VALUES
(1, 'BCA', '5948954897', 'Heru Suparto', '2025-10-16 02:19:31');

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

--
-- Table structure for table `transaksi`
--

CREATE TABLE `transaksi` (
  `no_id` int(20) NOT NULL,
  `Tanggal` date NOT NULL DEFAULT curdate(),
  `no_brg` int(20) NOT NULL,
  `no_plg` int(20) NOT NULL,
  `Jumlah_beli` int(11) NOT NULL CHECK (`Jumlah_beli` > 0),
  `Invoice` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `transaksi`
--

INSERT INTO `transaksi` (`no_id`, `Tanggal`, `no_brg`, `no_plg`, `Jumlah_beli`, `Invoice`) VALUES
(1, '2025-10-16', 55, 35, 10, 'INV202510161631'),
(2, '2025-10-16', 59, 35, 1, 'INV202510161631');

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(50) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `remember_token` varchar(64) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `username`, `password`, `remember_token`) VALUES
(30, 'admin@admin.com', '$2y$10$SIkjJfZU1Z07Zpoi2sZYL.Z6pJVLCVOESrSolut1Y.ojIV41zgWl.', NULL),
(31, 'telo@gmail.com', '$2y$10$WBjPx2aDiftVUN71LhEbmuZCkSCeJIe7.BEKwTQPqBSeUc7QMoT.K', NULL),
(33, 'ediseno@gmail.com', '$2y$10$MRfDUsIYELFEUepDlbmXQuIZak.jUNQCyLreZ.TspsNJOEL3gqSye', NULL),
(34, 'firas@gmail.com', '$2y$10$iiNFBIVFWqBdC/WNNkQeX.xuoVnViLz7gzPgxw8DM5AQnNm/36UbC', NULL);

--
-- Indexes for dumped tables
--

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

--
-- Indexes for table `barang`
--
ALTER TABLE `barang`
  ADD PRIMARY KEY (`no_id`);

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

--
-- Indexes for table `pelanggan`
--
ALTER TABLE `pelanggan`
  ADD PRIMARY KEY (`no_id`);

--
-- Indexes for table `pelanggan_deleted`
--
ALTER TABLE `pelanggan_deleted`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `Email` (`Email`);

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

--
-- Indexes for table `transaksi`
--
ALTER TABLE `transaksi`
  ADD PRIMARY KEY (`no_id`),
  ADD KEY `idx_invoice` (`Invoice`),
  ADD KEY `idx_plg` (`no_plg`),
  ADD KEY `idx_brg` (`no_brg`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `admin_log`
--
ALTER TABLE `admin_log`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT for table `barang`
--
ALTER TABLE `barang`
  MODIFY `no_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=60;

--
-- AUTO_INCREMENT for table `bukti`
--
ALTER TABLE `bukti`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `pelanggan`
--
ALTER TABLE `pelanggan`
  MODIFY `no_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=36;

--
-- AUTO_INCREMENT for table `pelanggan_deleted`
--
ALTER TABLE `pelanggan_deleted`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `rekening`
--
ALTER TABLE `rekening`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `transaksi`
--
ALTER TABLE `transaksi`
  MODIFY `no_id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=35;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `transaksi`
--
ALTER TABLE `transaksi`
  ADD CONSTRAINT `fk_transaksi_barang` FOREIGN KEY (`no_brg`) REFERENCES `barang` (`no_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_transaksi_pelanggan` FOREIGN KEY (`no_plg`) REFERENCES `pelanggan` (`no_id`) 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 */;
