
-- phpMyAdmin SQL Dump
-- version 5.2.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Waktu pembuatan: 08 Apr 2025 pada 18.05
-- Versi server: 10.11.11-MariaDB-cll-lve
-- Versi PHP: 8.3.19

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: `prom2463_syekhant_db`
--
CREATE DATABASE IF NOT EXISTS `prom2463_syekhant_db` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE `prom2463_syekhant_db`;

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

--
-- Struktur dari tabel `sessions`
--

CREATE TABLE `sessions` (
  `phone` varchar(20) NOT NULL,
  `state` varchar(50) DEFAULT NULL,
  `data` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Struktur dari tabel `Transactions`
--

CREATE TABLE `Transactions` (
  `id` int(11) NOT NULL,
  `date` timestamp NULL DEFAULT current_timestamp(),
  `merchant_ref` varchar(50) NOT NULL,
  `username` varchar(50) NOT NULL,
  `status` enum('PENDING','PAID','FAILED') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data untuk tabel `Transactions`
--

INSERT INTO `Transactions` (`id`, `date`, `merchant_ref`, `username`, `status`) VALUES
(1, '2025-03-20 06:51:08', 'INV-1742440000', 'pel19-Rere', 'PAID'),
(2, '2025-04-04 06:52:08', 'INV-1743772598', 'pel13-Meydi', 'PAID'),
(3, '2025-04-08 06:53:08', 'INV-1744074892', 'pel25-Zionathan', 'PAID');

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

--
-- Struktur dari tabel `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `expire_date` date NOT NULL,
  `phone` varchar(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Struktur dari tabel `User_PPPoE`
--

CREATE TABLE `User_PPPoE` (
  `username` varchar(50) NOT NULL,
  `phone` varchar(20) NOT NULL,
  `expired_date` date NOT NULL,
  `diffDays` int(11) NOT NULL,
  `statusNotif` enum('Belum','Sudah') DEFAULT 'Belum',
  `statusBlokir` enum('Aktif','Diblokir') DEFAULT 'Aktif'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Indexes for dumped tables
--

ALTER TABLE `sessions`
  ADD PRIMARY KEY (`phone`);

ALTER TABLE `Transactions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `merchantRef` (`merchant_ref`);

ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`);

ALTER TABLE `User_PPPoE`
  ADD PRIMARY KEY (`username`);

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

--
-- AUTO_INCREMENT untuk tabel `Transactions`
--
ALTER TABLE `Transactions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT untuk tabel `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;

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 */;
