-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 26, 2026 at 04:56 AM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.0.30

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

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

--
-- Table structure for table `activity_logs`
--

CREATE TABLE `activity_logs` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `username` varchar(80) DEFAULT NULL,
  `action` varchar(120) NOT NULL,
  `details` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `activity_logs`
--

INSERT INTO `activity_logs` (`id`, `user_id`, `username`, `action`, `details`, `created_at`) VALUES
(1, 1, 'admin', 'Login', 'User logged in.', '2026-05-20 12:12:54'),
(2, 1, 'admin', 'Create Personnel Pass', 'Personnel 23124 was created. Ref: GP-20260520-A82870', '2026-05-20 12:38:12'),
(3, 1, 'admin', 'Create Visitor Pass', 'Visitor Kenneth was created. Ref: GP-20260520-B190C5', '2026-05-20 12:42:23'),
(4, 1, 'admin', 'Create Item Pass', 'Item pass was created. Ref: GP-20260520-BF7F36', '2026-05-20 12:45:04'),
(5, 1, 'admin', 'Create Food Pass', 'Food pass was created. Ref: GP-20260520-12D8BC', '2026-05-20 12:53:21'),
(6, 1, 'admin', 'Create Meal Break Pass', 'Meal break pass was created. Ref: GP-20260520-1D3EA4', '2026-05-20 12:53:45'),
(7, 1, 'admin', 'Create User', 'User kennethx23 was created.', '2026-05-20 12:55:17'),
(8, 1, 'admin', 'Logout', 'User logged out.', '2026-05-20 12:55:57'),
(9, 2, 'kennethx23', 'Login', 'User logged in.', '2026-05-20 12:56:41'),
(10, 2, 'kennethx23', 'Logout', 'User logged out.', '2026-05-20 12:57:40'),
(11, 1, 'admin', 'Login', 'User logged in.', '2026-05-20 12:57:46'),
(12, 1, 'admin', 'Logout', 'User logged out.', '2026-05-20 13:02:13'),
(13, 1, 'admin', 'Login', 'User logged in.', '2026-05-21 02:48:17'),
(14, 1, 'admin', 'Logout', 'User logged out.', '2026-05-21 03:02:29'),
(15, 1, 'admin', 'Login', 'User logged in.', '2026-05-21 03:02:34'),
(16, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:10:50'),
(17, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:10:54'),
(18, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:10:54'),
(19, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:10:54'),
(20, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:10:54'),
(21, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:10:59'),
(22, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:10:59'),
(23, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:00'),
(24, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:00'),
(25, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:00'),
(26, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:01'),
(27, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:01'),
(28, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:02'),
(29, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:02'),
(30, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:02'),
(31, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:02'),
(32, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:02'),
(33, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:03'),
(34, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:03'),
(35, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:03'),
(36, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:03'),
(37, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:03'),
(38, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:03'),
(39, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:03'),
(40, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:03'),
(41, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:04'),
(42, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:04'),
(43, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:04'),
(44, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:04'),
(45, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:04'),
(46, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:04'),
(47, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:04'),
(48, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:05'),
(49, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:05'),
(50, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:05'),
(51, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:05'),
(52, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:05'),
(53, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:06'),
(54, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:06'),
(55, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:06'),
(56, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:06'),
(57, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:07'),
(58, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:07'),
(59, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:07'),
(60, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:07'),
(61, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:07'),
(62, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:07'),
(63, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:08'),
(64, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:08'),
(65, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:08'),
(66, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:08'),
(67, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:08'),
(68, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:08'),
(69, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:08'),
(70, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:09'),
(71, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:09'),
(72, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:09'),
(73, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:10'),
(74, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:10'),
(75, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:10'),
(76, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:10'),
(77, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:10'),
(78, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:10'),
(79, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:10'),
(80, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:10'),
(81, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:11'),
(82, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260520-A82870 (Personnel Pass).', '2026-05-21 03:11:11'),
(83, NULL, NULL, 'Create Personnel Pass', 'Public personnel 23 was submitted. Ref: GP-20260521-6A6782', '2026-05-21 04:16:24'),
(84, 1, 'admin', 'Login', 'User logged in.', '2026-05-21 07:18:07'),
(85, 1, 'admin', 'Login', 'User logged in.', '2026-05-25 07:08:20'),
(86, NULL, NULL, 'Create Meal Break Pass', 'Public meal break pass was submitted. Ref: GP-20260525-59963F', '2026-05-25 07:12:28'),
(87, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260525-59963F (Meal Break Pass).', '2026-05-25 07:14:06'),
(88, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260525-59963F (Meal Break Pass).', '2026-05-25 07:14:06'),
(89, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260525-59963F (Meal Break Pass).', '2026-05-25 07:14:06'),
(90, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260525-59963F (Meal Break Pass).', '2026-05-25 07:14:07'),
(91, 1, 'admin', 'Scan Gatepass QR', 'Scanned GP-20260525-59963F (Meal Break Pass).', '2026-05-25 07:14:07'),
(92, 1, 'admin', 'Login', 'User logged in.', '2026-05-26 02:53:50');

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

--
-- Table structure for table `employee_passes`
--

CREATE TABLE `employee_passes` (
  `id` int(11) NOT NULL,
  `transaction_ref` varchar(50) NOT NULL,
  `section_name` varchar(150) NOT NULL,
  `id_number` varchar(50) NOT NULL,
  `name` varchar(150) NOT NULL,
  `signature` varchar(150) DEFAULT NULL,
  `pass_date` date NOT NULL,
  `pass_time` time NOT NULL,
  `reason` varchar(255) NOT NULL,
  `date_time_filed` datetime NOT NULL DEFAULT current_timestamp(),
  `status` enum('Pending','Approved','Released','Rejected') NOT NULL DEFAULT 'Pending',
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `employee_passes`
--

INSERT INTO `employee_passes` (`id`, `transaction_ref`, `section_name`, `id_number`, `name`, `signature`, `pass_date`, `pass_time`, `reason`, `date_time_filed`, `status`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'GP-20260520-A82870', '23', '23124', 'Kenneth Kahulugan', 'Kenneth Kahulugan', '2026-05-20', '20:38:00', 'asdasda', '2026-05-20 20:38:12', 'Pending', 1, '2026-05-20 12:38:12', '2026-05-20 12:38:12'),
(2, 'GP-20260521-6A6782', '123', '23', 'Kenneth', 'Kenneth Kahulugan', '2026-05-21', '12:16:00', 'Visit', '2026-05-21 12:16:24', 'Pending', NULL, '2026-05-21 04:16:24', '2026-05-21 04:16:24');

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

--
-- Table structure for table `food_passes`
--

CREATE TABLE `food_passes` (
  `id` int(11) NOT NULL,
  `transaction_ref` varchar(50) NOT NULL,
  `food_items` varchar(255) NOT NULL,
  `quantity_measurement` varchar(100) NOT NULL,
  `container_type` varchar(100) NOT NULL,
  `reason` varchar(255) NOT NULL,
  `status` enum('Pending','Approved','Released','Rejected') NOT NULL DEFAULT 'Pending',
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `item_passes`
--

CREATE TABLE `item_passes` (
  `id` int(11) NOT NULL,
  `transaction_ref` varchar(50) NOT NULL,
  `food_items` text NOT NULL,
  `quantity_measurement` varchar(150) NOT NULL,
  `container_type` varchar(150) NOT NULL,
  `reason` varchar(255) NOT NULL,
  `status` enum('Pending','Approved','Released','Rejected') NOT NULL DEFAULT 'Pending',
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `item_passes`
--

INSERT INTO `item_passes` (`id`, `transaction_ref`, `food_items`, `quantity_measurement`, `container_type`, `reason`, `status`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'GP-20260520-12D8BC', 'Ambers', '2', 'Box', 'No Food Inside', 'Pending', NULL, '2026-05-20 12:53:21', '2026-05-20 12:53:21');

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

--
-- Table structure for table `meal_break_passes`
--

CREATE TABLE `meal_break_passes` (
  `id` int(11) NOT NULL,
  `transaction_ref` varchar(50) NOT NULL,
  `name` varchar(150) NOT NULL,
  `line_section` varchar(150) NOT NULL,
  `time_out` time NOT NULL,
  `time_in` time NOT NULL,
  `purpose` varchar(255) NOT NULL,
  `status` enum('Pending','Approved','Released','Rejected') NOT NULL DEFAULT 'Pending',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `meal_break_passes`
--

INSERT INTO `meal_break_passes` (`id`, `transaction_ref`, `name`, `line_section`, `time_out`, `time_in`, `purpose`, `status`, `created_at`, `updated_at`) VALUES
(1, 'GP-20260520-1D3EA4', 'Kenneth Kahulugan', '25', '08:54:00', '08:54:00', 'Quick Break', 'Pending', '2026-05-20 12:53:45', '2026-05-20 12:53:45'),
(2, 'GP-20260525-59963F', 'Asda', 'Asda', '15:12:00', '07:12:00', 'Wsda', 'Pending', '2026-05-25 07:12:28', '2026-05-25 07:12:28');

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

--
-- Table structure for table `package_passes`
--

CREATE TABLE `package_passes` (
  `id` int(11) NOT NULL,
  `transaction_ref` varchar(50) NOT NULL,
  `description` text NOT NULL,
  `quantity` int(11) NOT NULL,
  `measurement` varchar(100) NOT NULL,
  `remarks` text DEFAULT NULL,
  `checked_out` varchar(150) DEFAULT NULL,
  `checked_in` varchar(150) DEFAULT NULL,
  `status` enum('Pending','Approved','Released','Rejected') NOT NULL DEFAULT 'Pending',
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `package_passes`
--

INSERT INTO `package_passes` (`id`, `transaction_ref`, `description`, `quantity`, `measurement`, `remarks`, `checked_out`, `checked_in`, `status`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'GP-20260520-BF7F36', 'Dyson', 1, 'box', 'Donotopen', '', '', 'Pending', NULL, '2026-05-20 12:45:04', '2026-05-20 12:45:04');

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

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

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `full_name` varchar(150) NOT NULL,
  `username` varchar(80) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` enum('Admin','Staff') NOT NULL DEFAULT 'Staff',
  `status` enum('Active','Inactive') NOT NULL DEFAULT 'Active',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `users` (`id`, `full_name`, `username`, `password`, `role`, `status`, `created_at`, `updated_at`) VALUES
(1, 'System Administrator', 'admin', '$2y$10$1jONxmvXui6EF8ZhGgPDdeD2fMffm7OsHI49IZc/sed/PqhMfVKKa', 'Admin', 'Active', '2026-05-20 12:12:30', '2026-05-20 12:12:30'),
(2, 'kenneth', 'kennethx23', '$2y$10$tlQncvhPe5n1jXUXtJsiaekDUmOL0KXkBhbte/Dd3Zc2yfWEEATb.', 'Staff', 'Active', '2026-05-20 12:55:17', '2026-05-20 12:55:17');

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

--
-- Table structure for table `visitor_passes`
--

CREATE TABLE `visitor_passes` (
  `id` int(11) NOT NULL,
  `transaction_ref` varchar(50) NOT NULL,
  `visitor_name` varchar(150) NOT NULL,
  `visit_date` date NOT NULL,
  `time_in` time NOT NULL,
  `time_out` time NOT NULL,
  `person_to_visit` varchar(150) NOT NULL,
  `section_name` varchar(150) NOT NULL,
  `purpose` varchar(100) NOT NULL,
  `other_purpose` varchar(255) DEFAULT NULL,
  `date_submitted` datetime NOT NULL DEFAULT current_timestamp(),
  `status` enum('Pending','Approved','Released','Rejected') NOT NULL DEFAULT 'Pending',
  `created_by` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `visitor_passes`
--

INSERT INTO `visitor_passes` (`id`, `transaction_ref`, `visitor_name`, `visit_date`, `time_in`, `time_out`, `person_to_visit`, `section_name`, `purpose`, `other_purpose`, `date_submitted`, `status`, `created_by`, `created_at`, `updated_at`) VALUES
(1, 'GP-20260520-B190C5', 'Kenneth', '2026-05-20', '20:42:00', '22:42:00', 'Joshua', '23', 'Meeting', '', '2026-05-20 20:42:23', 'Pending', 1, '2026-05-20 12:42:23', '2026-05-20 12:42:23');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `activity_logs`
--
ALTER TABLE `activity_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_log_user` (`user_id`);

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

--
-- AUTO_INCREMENT for table `food_passes`
--
ALTER TABLE `food_passes`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `activity_logs`
--
ALTER TABLE `activity_logs`
  ADD CONSTRAINT `fk_log_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;
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 */;
