-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Jun 24, 2025 at 03:38 PM
-- Server version: 8.0.40
-- PHP Version: 8.3.14

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

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

--
-- Table structure for table `dafdir_absensi`
--

CREATE TABLE `dafdir_absensi` (
  `id_absensi` int NOT NULL,
  `id_event` int DEFAULT NULL,
  `nama_lengkap` varchar(100) NOT NULL,
  `jabatan` varchar(100) DEFAULT NULL,
  `tanda_tangan` text,
  `waktu_isi` datetime DEFAULT CURRENT_TIMESTAMP,
  `sequence` int DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `dafdir_admin`
--

CREATE TABLE `dafdir_admin` (
  `id` int NOT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `dafdir_admin`
--

INSERT INTO `dafdir_admin` (`id`, `username`, `password`) VALUES
(1, 'smansab', '$2y$10$mSghpwHIEg6YjTy23mLhsulANyUODjg6i5AjTBunPCt4RQk.2Mt22');

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

--
-- Table structure for table `dafdir_event`
--

CREATE TABLE `dafdir_event` (
  `id_event` int NOT NULL,
  `nama_event` varchar(100) NOT NULL,
  `tanggal_event` date NOT NULL,
  `pengesah` varchar(100) DEFAULT NULL,
  `status` enum('aktif','nonaktif') DEFAULT 'nonaktif',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `dafdir_absensi`
--
ALTER TABLE `dafdir_absensi`
  ADD PRIMARY KEY (`id_absensi`),
  ADD KEY `id_event` (`id_event`);

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

--
-- Indexes for table `dafdir_event`
--
ALTER TABLE `dafdir_event`
  ADD PRIMARY KEY (`id_event`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `dafdir_absensi`
--
ALTER TABLE `dafdir_absensi`
  MODIFY `id_absensi` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=50;

--
-- AUTO_INCREMENT for table `dafdir_admin`
--
ALTER TABLE `dafdir_admin`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `dafdir_event`
--
ALTER TABLE `dafdir_event`
  MODIFY `id_event` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `dafdir_absensi`
--
ALTER TABLE `dafdir_absensi`
  ADD CONSTRAINT `dafdir_absensi_ibfk_1` FOREIGN KEY (`id_event`) REFERENCES `dafdir_event` (`id_event`);
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 */;
