-- Table structure for table `attendance_test`
--

CREATE TABLE `attendance_test` (
  `id` int(11) NOT NULL,
  `employee_id` int(11) NOT NULL,
  `date` date NOT NULL,
  `time_in_morning` time DEFAULT NULL,
  `time_out_morning` time DEFAULT NULL,
  `time_in_afternoon` time DEFAULT NULL,
  `time_out_afternoon` time DEFAULT NULL,
  `late_minutes` int(11) DEFAULT 0,
  `early_out_minutes` int(11) DEFAULT 0,
  `late_decimal_value` decimal(5,2) DEFAULT 0.00,
  `early_out_decimal_value` decimal(5,2) DEFAULT 0.00,
  `total_decimal_value` decimal(5,2) DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `attendance_test`
--

INSERT INTO `attendance_test` (`id`, `employee_id`, `date`, `time_in_morning`, `time_out_morning`, `time_in_afternoon`, `time_out_afternoon`, `late_minutes`, `early_out_minutes`, `late_decimal_value`, `early_out_decimal_value`, `total_decimal_value`) VALUES
(1, 1, '2023-10-01', '09:10:00', '12:00:00', '13:00:00', '18:11:00', NULL, 0, NULL, 0.00, NULL),
(234, 234, '2025-03-12', '14:04:47', '14:04:47', '14:04:47', '14:04:47', NULL, NULL, NULL, NULL, NULL),
(9234, 23674, '2025-03-12', '14:04:47', '14:04:47', '14:04:47', '14:04:47', 67, NULL, NULL, NULL, NULL);

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

--
-- Table structure for table `base_salary`
--

CREATE TABLE `base_salary` (
  `base_salary_id` int(11) NOT NULL,
  `employee_id` varchar(150) NOT NULL,
  `first_name` varchar(50) NOT NULL,
  `middle_name` varchar(50) DEFAULT NULL,
  `last_name` varchar(50) NOT NULL,
  `basic_salary` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `base_salary`
--

INSERT INTO `base_salary` (`base_salary_id`, `employee_id`, `first_name`, `middle_name`, `last_name`, `basic_salary`) VALUES
(82, 'CJIS-2025-0001', 'Ragheil', 'Lagat ', 'Atacador ', 576.92),
(84, 'CJIS-2025-0002', 'Alan', 'Tumulak', 'Ang', 500.00),
(117, 'CJIS-2025-0019', 'Ivan Jay', 'Orcajada', 'Daigdigan', 423.00),
(120, 'CJIS-2025-0020', 'Ailyn May', 'Morcilla', 'Tongol ', 400.00),
(124, 'CJIS-2025-0022', 'Louis Gio', '', 'Noval', 430.00),
(128, 'CJIS-2025-0024', 'ricardo', '', 'Rimando', 500.00),
(132, 'CJIS-2025-0025', 'Sarfeil', '', 'Curran', 430.00),
(137, 'CJIS-2025-0028', 'Mark ', '', 'Busbus', 423.00),
(138, 'CJIS-2025-0029', 'Quennie Reyn', '', 'Reyes', 480.00),
(139, 'CJIS-2025-0030', 'Gerome', 'Tangara', 'Hapson', 430.00),
(140, 'CJIS-2025-0031', 'Joric', 'A.', 'Labrador Jr.', 384.62),
(142, 'CJIS-2025-0033', 'Jasper', '', 'Perote', 423.00),
(143, 'CJIS-2025-0034', 'dummy', '', 'test', 0.00),
(146, 'CJIS-2025-0035', 'asd', '', 'asd', 0.00),
(147, 'CJIS-2025-0036', 'Yes', 'No', 'Yes', 0.00),
(148, 'CJIS-2025-0037', 'Yes ', '', 'No', 0.00),
(155, 'CJIS-2025-0038', 'test', '', 'test', 0.00),
(156, 'CJIS-2025-0039', 'tesg', '', 'aras', 0.00),
(157, 'CJIS-2025-0040', 'Jeribrunne', '', 'Cabrera', 423.00),
(158, 'CJIS-2025-0041', 'Aaron', 'Magasin', 'Cordova', 400.00),
(160, 'CJIS-2025-0042', 'this is my test account', '', 'asd', 0.00),
(161, 'CJIS-2025-0043', 'asd', '', 'asd', 0.00),
(162, 'CJIS-2025-0044', 'this ', 'is ', 'test account', 0.00),
(164, 'CJIS-2025-0045', 'HAHA', '', 'HEHEHE', 0.00);

--
-- Triggers `base_salary`
--
DELIMITER $$
CREATE TRIGGER `payroll_update` AFTER UPDATE ON `base_salary` FOR EACH ROW BEGIN
    -- Update the basic salary in the payroll table
    UPDATE payroll
    SET basic_salary = NEW.basic_salary
    WHERE employee_id = NEW.employee_id;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `update_salary_for_employee_after_base_salary_change` AFTER UPDATE ON `base_salary` FOR EACH ROW BEGIN
    -- Force recalculation only for those using base_salary as basis
    UPDATE salary_for_employee 
    SET step = step  -- triggers the BEFORE UPDATE recalculation
    WHERE employee_id = NEW.employee_id AND use_base_salary = TRUE;
END
$$
DELIMITER ;

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

--
-- Table structure for table `branches`
--

CREATE TABLE `branches` (
  `branch_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `address` varchar(255) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `assigned_employee_id` varchar(15) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `branches`
--

INSERT INTO `branches` (`branch_id`, `name`, `address`, `phone`, `description`, `assigned_employee_id`, `created_at`, `updated_at`) VALUES
(1, 'PABAYO', 'asd', '0949494949', 'asd', 'CJIS-2025-0001', '2025-10-13 09:11:50', '2025-10-18 10:44:01'),
(2, 'TEST', 'iponan', '123', 'hehe', NULL, '2025-10-13 10:26:58', '2025-10-13 10:26:58'),
(3, 'LAPASAN', 'asd', '1234tth', '', NULL, '2025-10-13 10:38:25', '2025-10-18 13:05:20');

--
-- Triggers `branches`
--
DELIMITER $$
CREATE TRIGGER `trg_branches_after_delete` AFTER DELETE ON `branches` FOR EACH ROW BEGIN
  UPDATE employees
    SET branch_id = NULL, branch_name = NULL
    WHERE branch_id = OLD.branch_id;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trg_branches_after_update` AFTER UPDATE ON `branches` FOR EACH ROW BEGIN
  -- Only do work if the name actually changed (avoid unnecessary updates)
  IF (OLD.name IS NULL AND NEW.name IS NOT NULL) OR (OLD.name IS NOT NULL AND NEW.name IS NULL) OR (OLD.name <> NEW.name) THEN
    -- Update employees who were assigned to the branch being changed
    UPDATE employees
      SET branch_name = NEW.name
      WHERE branch_id = OLD.branch_id;
  END IF;
END
$$
DELIMITER ;

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

--
-- Table structure for table `break_time`
--

CREATE TABLE `break_time` (
  `id` int(11) NOT NULL,
  `work_time_id` int(11) DEFAULT NULL,
  `break_name` varchar(100) NOT NULL,
  `break_start` time NOT NULL,
  `break_end` time NOT NULL,
  `valid_break_in_start` time NOT NULL,
  `valid_break_in_end` time NOT NULL,
  `valid_break_out_start` time NOT NULL,
  `valid_break_out_end` time NOT NULL,
  `break_minutes` int(11) GENERATED ALWAYS AS (time_to_sec(timediff(`break_end`,`break_start`)) / 60) STORED,
  `is_shift_split` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1=major split separating shift blocks'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `break_time`
--

INSERT INTO `break_time` (`id`, `work_time_id`, `break_name`, `break_start`, `break_end`, `valid_break_in_start`, `valid_break_in_end`, `valid_break_out_start`, `valid_break_out_end`, `is_shift_split`) VALUES
(1, NULL, 'Lunch break', '12:00:00', '13:00:00', '12:30:00', '12:59:00', '11:59:00', '12:29:00', 1),
(2, NULL, '3pm to 3:59pm break', '15:00:00', '16:00:00', '15:30:00', '16:00:00', '15:00:00', '15:29:00', 1);

--
-- Triggers `break_time`
--
DELIMITER $$
CREATE TRIGGER `after_insert_break_time_auto_map` AFTER INSERT ON `break_time` FOR EACH ROW BEGIN
    IF NEW.work_time_id IS NOT NULL THEN
        -- avoid duplicate mapping just in case
        IF NOT EXISTS (
            SELECT 1 FROM work_time_break
            WHERE work_time_id = NEW.work_time_id AND break_id = NEW.id
        ) THEN
            INSERT INTO work_time_break (work_time_id, break_id)
            VALUES (NEW.work_time_id, NEW.id);
        END IF;
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `before_insert_break_time_validations` BEFORE INSERT ON `break_time` FOR EACH ROW BEGIN
    DECLARE shift_minutes INT DEFAULT 0;

    -- basic validations
    IF NEW.break_start >= NEW.break_end THEN
        SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid break: break_start must be earlier than break_end';
    END IF;

    IF NEW.valid_break_in_start > NEW.valid_break_in_end THEN
        SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid break: valid_break_in_start must be <= valid_break_in_end';
    END IF;

    IF NEW.valid_break_out_start > NEW.valid_break_out_end THEN
        SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid break: valid_break_out_start must be <= valid_break_out_end';
    END IF;

    -- If tied to a shift, ensure break_minutes <= shift total
    IF NEW.work_time_id IS NOT NULL THEN
        SELECT total_minutes INTO shift_minutes
        FROM work_time
        WHERE id = NEW.work_time_id
        LIMIT 1;

        IF shift_minutes IS NULL THEN
            SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid break: linked work_time not found';
        END IF;

        IF NEW.break_minutes > shift_minutes THEN
            SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid break: break_minutes exceeds total shift duration';
        END IF;

        -- Simple overlap check vs other breaks for the same shift (prevents overlapping breaks)
        IF EXISTS (
            SELECT 1 FROM break_time b
            WHERE b.work_time_id = NEW.work_time_id
              AND NOT (NEW.break_end <= b.break_start OR NEW.break_start >= b.break_end)
        ) THEN
            SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid break: overlaps an existing break in this shift';
        END IF;
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `before_update_break_time_protection` BEFORE UPDATE ON `break_time` FOR EACH ROW BEGIN
    DECLARE shift_minutes INT DEFAULT 0;

    IF NEW.break_start >= NEW.break_end THEN
        SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid update: break_start must be earlier than break_end';
    END IF;

    IF NEW.valid_break_in_start > NEW.valid_break_in_end THEN
        SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid update: valid_break_in_start must be <= valid_break_in_end';
    END IF;

    IF NEW.valid_break_out_start > NEW.valid_break_out_end THEN
        SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid update: valid_break_out_start must be <= valid_break_out_end';
    END IF;

    IF NEW.work_time_id IS NOT NULL THEN
        SELECT total_minutes INTO shift_minutes
        FROM work_time
        WHERE id = NEW.work_time_id
        LIMIT 1;

        IF shift_minutes IS NULL THEN
            SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid update: linked work_time not found';
        END IF;

        IF NEW.break_minutes > shift_minutes THEN
            SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid update: break_minutes exceeds total shift duration';
        END IF;

        -- Prevent overlap with other breaks in the same shift (exclude itself)
        IF EXISTS (
            SELECT 1 FROM break_time b
            WHERE b.id <> OLD.id
              AND b.work_time_id = NEW.work_time_id
              AND NOT (NEW.break_end <= b.break_start OR NEW.break_start >= b.break_end)
        ) THEN
            SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Invalid update: break overlaps with another break in same shift';
        END IF;
    END IF;
END
$$
DELIMITER ;

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

--
-- Table structure for table `deduction`
--

CREATE TABLE `deduction` (
  `deduction_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `attendance_date` date NOT NULL,
  `minutes_late` int(11) NOT NULL DEFAULT 0,
  `deduction_rate` decimal(10,2) NOT NULL DEFAULT 0.00,
  `description` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `deduction_table`
--

CREATE TABLE `deduction_table` (
  `id` int(11) NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `deduction` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `deduction_table`
--

INSERT INTO `deduction_table` (`id`, `start_time`, `end_time`, `deduction`) VALUES
(1, '09:06:00', '09:10:00', 0.03),
(2, '09:11:00', '09:15:00', 0.09),
(3, '09:16:00', '09:59:00', 0.25),
(4, '10:00:00', '12:00:00', 0.50),
(6, '13:06:00', '13:10:00', 0.03),
(7, '13:11:00', '13:15:00', 0.09),
(8, '13:16:00', '13:59:00', 0.25),
(10, '14:00:00', '16:00:00', 0.50),
(22, '00:00:00', '00:00:00', 0.50),
(24, '16:01:00', '17:00:00', 0.00);

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

--
-- Table structure for table `departments`
--

CREATE TABLE `departments` (
  `department_id` varchar(11) NOT NULL,
  `department_name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `departments`
--

INSERT INTO `departments` (`department_id`, `department_name`) VALUES
('002', 'SALES-1'),
('Admin-001', 'Admin Department'),
('DEP-001', 'IT DEPARTMENT'),
('DEP-002', 'wow0'),
('DEP-003', 'test'),
('DEP-007', 'SALAMAT'),
('hD2', 'hadkD'),
('tech -1', 'Technician ');

--
-- Triggers `departments`
--
DELIMITER $$
CREATE TRIGGER `update_salary_department_name` AFTER UPDATE ON `departments` FOR EACH ROW BEGIN
    UPDATE salary_for_employee
    SET department_name = NEW.department_name
    WHERE department_name = OLD.department_name;
END
$$
DELIMITER ;

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

--
-- Table structure for table `email_settings`
--

CREATE TABLE `email_settings` (
  `id` int(11) NOT NULL,
  `hr_email` varchar(150) NOT NULL,
  `label` varchar(100) DEFAULT 'HR Main Email',
  `is_active` varchar(10) NOT NULL DEFAULT 'active',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `email_settings`
--

INSERT INTO `email_settings` (`id`, `hr_email`, `label`, `is_active`, `created_at`) VALUES
(3, 'atacadorragheil@gmail.com', 'he 2', 'inactive', '2025-09-05 02:29:33'),
(4, 'ricardorimando22@gmail.com', 'HR Email', 'active', '2025-09-05 02:35:41'),
(6, 'rimando.ricardomanagaytay@gmail.com', 'hr demo', 'active', '2025-09-08 03:51:31'),
(7, 'centraljuan.net@gmail.com', 'ADMIN EMAIL', 'inactive', '2025-09-12 03:46:48'),
(13, 'ragheil123@gmail.com', 'URAAA', 'active', '2025-09-23 02:24:15'),
(14, 'reyesquenniereyn@gmail.com', 'MAAM HR', 'active', '2025-09-23 03:20:57'),
(15, 'hr.centraljuan.net@gmail.com', 'HR EMAIL', 'active', '2025-09-26 02:14:00');

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

--
-- Table structure for table `employees`
--

CREATE TABLE `employees` (
  `employee_id` varchar(15) NOT NULL,
  `first_name` varchar(50) NOT NULL,
  `middle_name` varchar(50) DEFAULT NULL,
  `last_name` varchar(50) NOT NULL,
  `email` varchar(100) DEFAULT NULL,
  `contact_number` varchar(20) DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `department_id` varchar(11) DEFAULT NULL,
  `position_id` varchar(50) DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `status` enum('active','inactive') NOT NULL DEFAULT 'active',
  `description` varchar(255) DEFAULT NULL,
  `image` varchar(255) DEFAULT NULL,
  `base_salary` decimal(10,2) NOT NULL DEFAULT 0.00,
  `salary_type` enum('daily','monthly') DEFAULT 'daily',
  `monthly_rate` decimal(10,2) DEFAULT 0.00,
  `hourly_rate` decimal(10,2) DEFAULT 0.00,
  `reset_code` varchar(10) DEFAULT NULL,
  `employee_type` enum('Regular','Part-time','OJT','Contractual','Project-Based') DEFAULT 'Regular',
  `branch_id` int(11) DEFAULT NULL,
  `branch_name` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;



--
-- Triggers `employees`
--
DELIMITER $$
CREATE TRIGGER `after_employee_insert` AFTER INSERT ON `employees` FOR EACH ROW BEGIN
    DECLARE full_name VARCHAR(150);
    DECLARE dept_name VARCHAR(100);
    DECLARE pos_name VARCHAR(100);

    -- Merge first_name, middle_name, and last_name into full_name
    SET full_name = CONCAT(
        NEW.first_name, 
        IF(NEW.middle_name IS NOT NULL AND NEW.middle_name != '', CONCAT(' ', NEW.middle_name), ''), 
        ' ', 
        NEW.last_name
    );

    -- Get department name from departments table
    SELECT department_name INTO dept_name 
    FROM departments 
    WHERE department_id = NEW.department_id;

    -- Get position name from positions table using the position_id from employees table
    SELECT position_name INTO pos_name 
    FROM positions 
    WHERE position_id = NEW.position_id;

    -- Insert the data into salary_for_employee with default values for position_level and step
    INSERT INTO salary_for_employee (
        employee_id, 
        employee_name, 
        department_name, 
        position_name, 
        position_level, 
        step
    ) VALUES (
        NEW.employee_id, 
        full_name, 
        IFNULL(dept_name, 'Unknown'), 
        IFNULL(pos_name, 'Unknown'),  -- Use the fetched position name or 'Unknown' if not found
        1, -- Default Position Level
        1  -- Default Step
    );
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `after_employee_name_update` AFTER UPDATE ON `employees` FOR EACH ROW BEGIN
    DECLARE full_name VARCHAR(150);

    -- Merge first_name, middle_name, and last_name into full_name
    SET full_name = CONCAT(
        NEW.first_name, 
        IF(NEW.middle_name IS NOT NULL AND NEW.middle_name != '', CONCAT(' ', NEW.middle_name), ''), 
        ' ', 
        NEW.last_name
    );

    -- Update the employee_name in salary_for_employee table
    UPDATE salary_for_employee 
    SET employee_name = full_name
    WHERE employee_id = NEW.employee_id;

END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `after_insert_employee` AFTER INSERT ON `employees` FOR EACH ROW BEGIN
    -- Insert a default attendance record for the new employee
    INSERT INTO attendance (employee_id, employee_name, attendance_date)
    VALUES (NEW.employee_id, CONCAT_WS(' ', NEW.first_name, NEW.middle_name, NEW.last_name), CURDATE());
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `after_update_employee` AFTER UPDATE ON `employees` FOR EACH ROW BEGIN
    -- Update the employee_name in the attendance table
    UPDATE attendance
    SET employee_name = CONCAT_WS(' ', NEW.first_name, NEW.middle_name, NEW.last_name)
    WHERE employee_id = NEW.employee_id;
END
$$
DELIMITER ;
DELIMITER $$

  END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `employee_update` AFTER UPDATE ON `employees` FOR EACH ROW BEGIN
    -- Update the record in the base_salary table when an existing employee is updated
    UPDATE base_salary
    SET first_name = NEW.first_name,
        middle_name = NEW.middle_name,
        last_name = NEW.last_name
    WHERE employee_id = NEW.employee_id;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `insert_user_after_employee_password` AFTER INSERT ON `employees` FOR EACH ROW BEGIN
  -- Check if the username already exists in the users table
  IF NOT EXISTS (SELECT 1 FROM users WHERE username = NEW.employee_id) THEN
    -- Insert the new user into the users table
    INSERT INTO users (username, password, role)
    VALUES (
      NEW.employee_id,                         -- Use employee_id as username
      SHA2(NEW.password, 256),                 -- Hash the password using SHA-256
      'employee'                               -- Set the role to 'employee'
    );
  END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `new_after_employee_insert` AFTER INSERT ON `employees` FOR EACH ROW BEGIN
    INSERT INTO payroll (employee_id, name)
    VALUES (NEW.employee_id, CONCAT(NEW.first_name, ' ', COALESCE(NEW.middle_name, ''), ' ', NEW.last_name));
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `new_employee_payroll_update` AFTER UPDATE ON `employees` FOR EACH ROW BEGIN
    -- Ensure it updates the existing record instead of inserting a new one
    UPDATE payroll
    SET name = CONCAT(NEW.first_name, ' ', COALESCE(NEW.middle_name, ''), ' ', NEW.last_name)
    WHERE employee_id = NEW.employee_id;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `sync_user_status_with_employee` AFTER UPDATE ON `employees` FOR EACH ROW BEGIN
  IF NEW.status = 'inactive' THEN
    UPDATE users
    SET status = 'disabled'
    WHERE username = NEW.employee_id;
  ELSEIF NEW.status = 'active' THEN
    UPDATE users
    SET status = 'active'
    WHERE username = NEW.employee_id;
  END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trg_employees_before_insert` BEFORE INSERT ON `employees` FOR EACH ROW BEGIN
  DECLARE v_name VARCHAR(255);

  IF NEW.branch_id IS NULL THEN
    SET NEW.branch_name = NULL;
  ELSE
    SELECT name INTO v_name FROM branches WHERE branch_id = NEW.branch_id LIMIT 1;
    SET NEW.branch_name = v_name;
  END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trg_employees_before_update` BEFORE UPDATE ON `employees` FOR EACH ROW BEGIN
  DECLARE v_name2 VARCHAR(255);

  -- only update branch_name when branch_id actually changes
  IF NOT (OLD.branch_id <=> NEW.branch_id) THEN
    IF NEW.branch_id IS NULL THEN
      SET NEW.branch_name = NULL;
    ELSE
      SELECT name INTO v_name2 FROM branches WHERE branch_id = NEW.branch_id LIMIT 1;
      SET NEW.branch_name = v_name2;
    END IF;
  END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trg_insert_base_salary` AFTER INSERT ON `employees` FOR EACH ROW BEGIN
  INSERT INTO base_salary (
    employee_id,
    first_name,
    middle_name,
    last_name,
    basic_salary
  ) VALUES (
    NEW.employee_id,
    NEW.first_name,
    NEW.middle_name,
    NEW.last_name,
    NEW.base_salary
  );
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trg_update_base_salary` AFTER UPDATE ON `employees` FOR EACH ROW BEGIN
  IF NEW.base_salary != OLD.base_salary THEN
    UPDATE base_salary
    SET basic_salary = NEW.base_salary
    WHERE employee_id = NEW.employee_id;
  END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `update_department_name` AFTER UPDATE ON `employees` FOR EACH ROW BEGIN
    DECLARE dept_name VARCHAR(100);
    
    -- Fetch the new department name based on the new department_id
    SELECT department_name INTO dept_name FROM departments WHERE department_id = NEW.department_id;

    -- Update the salary_for_employee table with the new department name
    UPDATE salary_for_employee
    SET department_name = dept_name
    WHERE employee_id = NEW.employee_id;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `update_employee_name` AFTER UPDATE ON `employees` FOR EACH ROW BEGIN
    UPDATE attendance
    SET employee_name = CONCAT(NEW.first_name, ' ', COALESCE(NEW.middle_name, ''), ' ', NEW.last_name)
    WHERE employee_id = NEW.employee_id;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `update_position_name` AFTER UPDATE ON `employees` FOR EACH ROW BEGIN
    DECLARE pos_name VARCHAR(100);
    
    -- Fetch the new position name based on the new position_id
    SELECT position_name INTO pos_name FROM positions WHERE position_id = NEW.position_id;

    -- Update the salary_for_employee table with the new position name
    UPDATE salary_for_employee
    SET position_name = pos_name
    WHERE employee_id = NEW.employee_id;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `update_salary_when_employee_updates` AFTER UPDATE ON `employees` FOR EACH ROW BEGIN
    UPDATE salary_for_employee sfe
    JOIN salary_grades sg ON sfe.position_level = sg.GradeID
    SET sfe.salary = CASE sfe.step
        WHEN 1 THEN sg.Step1
        WHEN 2 THEN sg.Step2
        WHEN 3 THEN sg.Step3
        ELSE sfe.salary
    END
    WHERE sfe.employee_id = NEW.employee_id;
END
$$
DELIMITER ;
DELIMITER $$

  END IF;
END
$$
DELIMITER ;

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

--
-- Table structure for table `employee_allowance`
--

CREATE TABLE `employee_allowance` (
  `allowance_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `allowance_name` varchar(100) NOT NULL,
  `amount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `amount_type` enum('fixed','percent') NOT NULL DEFAULT 'fixed',
  `percent_of` varchar(50) DEFAULT 'basic_salary',
  `frequency` enum('monthly','semi-monthly') NOT NULL DEFAULT 'monthly',
  `prorate_if_partial` tinyint(1) NOT NULL DEFAULT 1,
  `start_date` date DEFAULT NULL,
  `end_date` date DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `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_general_ci;

--
-- Dumping data for table `employee_allowance`
--

INSERT INTO `employee_allowance` (`allowance_id`, `employee_id`, `allowance_name`, `amount`, `amount_type`, `percent_of`, `frequency`, `prorate_if_partial`, `start_date`, `end_date`, `active`, `created_at`, `updated_at`) VALUES
(1, 'CJIS-2025-0002', 'test', 100.00, 'fixed', 'basic_salary', 'semi-monthly', 1, '2025-10-14', NULL, 1, '2025-10-26 07:47:44', '2025-10-26 07:47:44'),
(2, 'CJIS-2025-0044', 'test', 1000.00, 'fixed', 'basic_salary', 'monthly', 1, '2025-10-28', '2025-10-28', 0, '2025-10-30 05:08:03', '2025-10-30 05:10:27'),
(3, 'CJIS-2025-0044', 'test', 100.00, 'fixed', 'basic_salary', 'semi-monthly', 1, '2025-10-15', '2025-10-16', 1, '2025-10-30 05:10:53', '2025-10-30 05:10:53');

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

--
-- Table structure for table `employee_leaves`
--

CREATE TABLE `employee_leaves` (
  `leave_id` int(11) NOT NULL,
  `employee_id` varchar(50) NOT NULL,
  `leave_type_id` int(11) NOT NULL,
  `date_from` date NOT NULL,
  `date_until` date NOT NULL,
  `total_days` decimal(5,2) NOT NULL,
  `reason` text DEFAULT NULL,
  `status` enum('pending','approved','rejected','cancelled') 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_general_ci;

--
-- Dumping data for table `employee_leaves`
--

INSERT INTO `employee_leaves` (`leave_id`, `employee_id`, `leave_type_id`, `date_from`, `date_until`, `total_days`, `reason`, `status`, `created_at`, `updated_at`) VALUES
(3, 'CJIS-2025-0037', 7, '2025-08-18', '2025-08-20', 3.00, 'test ', 'approved', '2025-08-15 07:05:19', '2025-08-15 07:05:19'),
(4, 'CJIS-2025-0001', 7, '2025-11-03', '2025-11-05', 3.00, 'sdf', 'approved', '2025-11-04 03:50:37', '2025-11-04 03:50:37');

--
-- Triggers `employee_leaves`
--
DELIMITER $$
CREATE TRIGGER `after_employee_leave_approved` AFTER UPDATE ON `employee_leaves` FOR EACH ROW BEGIN
    DECLARE yr INT;
    DECLARE cnt INT DEFAULT 0;
    SET yr = YEAR(NEW.date_from);

    -- Ensure balance row exists
    SELECT COUNT(*) INTO cnt
    FROM employee_leave_balances b
    WHERE b.employee_id   = NEW.employee_id
      AND b.leave_type_id = NEW.leave_type_id
      AND b.year          = yr;

    IF cnt = 0 THEN
        INSERT INTO employee_leave_balances (employee_id, leave_type_id, year, leave_limit, leave_used)
        VALUES (NEW.employee_id, NEW.leave_type_id, yr, 0, 0);
    END IF;

    -- Deduct only when status changes from non-approved to approved
    IF NEW.status = 'approved' AND OLD.status <> 'approved' THEN
        UPDATE employee_leave_balances
           SET leave_used = leave_used + NEW.total_days
         WHERE employee_id   = NEW.employee_id
           AND leave_type_id = NEW.leave_type_id
           AND year          = yr;

        INSERT INTO leave_deduction_logs (employee_id, leave_type_id, leave_id, deducted_days)
        VALUES (NEW.employee_id, NEW.leave_type_id, NEW.leave_id, NEW.total_days);
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `after_employee_leave_cancelled` AFTER UPDATE ON `employee_leaves` FOR EACH ROW BEGIN
    DECLARE yr INT;
    DECLARE cnt INT DEFAULT 0;
    SET yr = YEAR(OLD.date_from);

    -- Ensure balance row exists (defensive; handles rare edge cases)
    SELECT COUNT(*) INTO cnt
    FROM employee_leave_balances b
    WHERE b.employee_id   = OLD.employee_id
      AND b.leave_type_id = OLD.leave_type_id
      AND b.year          = yr;

    IF cnt = 0 THEN
        INSERT INTO employee_leave_balances (employee_id, leave_type_id, year, leave_limit, leave_used)
        VALUES (OLD.employee_id, OLD.leave_type_id, yr, 0, 0);
    END IF;

    -- Restore only when moving from approved to cancelled
    IF OLD.status = 'approved' AND NEW.status = 'cancelled' THEN
        UPDATE employee_leave_balances
           SET leave_used = leave_used - OLD.total_days
         WHERE employee_id   = OLD.employee_id
           AND leave_type_id = OLD.leave_type_id
           AND year          = yr;

        INSERT INTO leave_deduction_logs (employee_id, leave_type_id, leave_id, deducted_days)
        VALUES (OLD.employee_id, OLD.leave_type_id, OLD.leave_id, -OLD.total_days);
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `after_employee_leave_insert_balance` AFTER INSERT ON `employee_leaves` FOR EACH ROW BEGIN
    DECLARE yr INT;
    DECLARE cnt INT DEFAULT 0;
    SET yr = YEAR(NEW.date_from);

    -- Make sure a balance row exists for this employee/leave_type/year
    SELECT COUNT(*) INTO cnt
    FROM employee_leave_balances b
    WHERE b.employee_id   = NEW.employee_id
      AND b.leave_type_id = NEW.leave_type_id
      AND b.year          = yr;

    IF cnt = 0 THEN
        INSERT INTO employee_leave_balances (employee_id, leave_type_id, year, leave_limit, leave_used)
        VALUES (NEW.employee_id, NEW.leave_type_id, yr, 0, 0);
    END IF;

    -- If the record is inserted already approved, deduct immediately
    IF NEW.status = 'approved' THEN
        UPDATE employee_leave_balances
           SET leave_used = leave_used + NEW.total_days
         WHERE employee_id   = NEW.employee_id
           AND leave_type_id = NEW.leave_type_id
           AND year          = yr;

        INSERT INTO leave_deduction_logs (employee_id, leave_type_id, leave_id, deducted_days)
        VALUES (NEW.employee_id, NEW.leave_type_id, NEW.leave_id, NEW.total_days);
    END IF;
END
$$
DELIMITER ;

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

--
-- Table structure for table `employee_leave_balances`
--

CREATE TABLE `employee_leave_balances` (
  `id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `leave_type_id` int(11) NOT NULL,
  `year` year(4) NOT NULL,
  `leave_limit` decimal(5,2) DEFAULT 0.00,
  `leave_used` decimal(5,2) DEFAULT 0.00,
  `leave_balance` decimal(5,2) GENERATED ALWAYS AS (`leave_limit` - `leave_used`) STORED
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `employee_leave_balances`
--

INSERT INTO `employee_leave_balances` (`id`, `employee_id`, `leave_type_id`, `year`, `leave_limit`, `leave_used`) VALUES
(108, 'CJIS-2025-0020', 7, '2025', 100.00, 0.00),
(109, 'CJIS-2025-0022', 7, '2025', 100.00, 0.00),
(110, 'CJIS-2025-0025', 7, '2025', 100.00, 0.00),
(111, 'CJIS-2025-0035', 7, '2025', 100.00, 0.00),
(112, 'CJIS-2025-0036', 7, '2025', 100.00, 0.00),
(113, 'CJIS-2025-0040', 7, '2025', 100.00, 0.00),
(114, 'CJIS-2025-0019', 7, '2025', 100.00, 0.00),
(115, 'CJIS-2025-0029', 7, '2025', 100.00, 0.00),
(116, 'CJIS-2025-0034', 7, '2025', 100.00, 0.00),
(117, 'CJIS-2025-0037', 7, '2025', 100.00, 3.00),
(118, 'CJIS-2025-0038', 7, '2025', 100.00, 0.00),
(119, 'CJIS-2025-0039', 7, '2025', 100.00, 0.00),
(120, 'CJIS-2025-0001', 7, '2025', 100.00, 3.00),
(121, 'CJIS-2025-0002', 7, '2025', 100.00, 0.00),
(122, 'CJIS-2025-0024', 7, '2025', 100.00, 0.00),
(123, 'CJIS-2025-0031', 7, '2025', 100.00, 0.00),
(124, 'CJIS-2025-0028', 7, '2025', 100.00, 0.00),
(125, 'CJIS-2025-0030', 7, '2025', 100.00, 0.00),
(126, 'CJIS-2025-0033', 7, '2025', 100.00, 0.00);

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

--
-- Table structure for table `employee_overtime_request`
--

CREATE TABLE `employee_overtime_request` (
  `request_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `employee_name` varchar(100) NOT NULL,
  `position` varchar(100) DEFAULT NULL,
  `department` varchar(100) DEFAULT NULL,
  `date_requested` date NOT NULL,
  `time_start` time NOT NULL,
  `end_time` time NOT NULL,
  `hours_requested` decimal(10,2) NOT NULL,
  `reason` text DEFAULT NULL,
  `status` enum('Pending','Approved','Rejected') DEFAULT 'Pending',
  `approved_by` varchar(100) DEFAULT NULL,
  `overtime_type_id` int(11) DEFAULT NULL,
  `multiplier` decimal(4,2) DEFAULT 1.00,
  `minutes_requested` int(11) DEFAULT 0,
  `holiday_id` int(11) DEFAULT NULL,
  `multiplier_used` decimal(4,2) DEFAULT 1.00
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `employee_overtime_request`
--

INSERT INTO `employee_overtime_request` (`request_id`, `employee_id`, `employee_name`, `position`, `department`, `date_requested`, `time_start`, `end_time`, `hours_requested`, `reason`, `status`, `approved_by`, `overtime_type_id`, `multiplier`, `minutes_requested`, `holiday_id`, `multiplier_used`) VALUES
(27, 'CJIS-2025-0031', 'Joric  Labrador', NULL, NULL, '2025-06-18', '18:30:00', '19:10:00', 0.67, 'Waiting customer of laptop 5s development Corp.', 'Approved', 'Admin', NULL, 1.00, 0, NULL, 1.00),
(31, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', NULL, NULL, '2025-06-21', '18:30:00', '19:10:00', 0.67, 'Waiting for customer sales 4152', 'Approved', 'Admin', NULL, 1.00, 0, NULL, 1.00),
(36, 'CJIS-2025-0022', 'Louis Gio  Noval', NULL, NULL, '2025-06-18', '18:30:00', '19:15:00', 0.09, 'Reason', 'Approved', NULL, NULL, 1.00, 45, NULL, 1.00),
(37, 'CJIS-2025-0022', 'Louis Gio  Noval', NULL, NULL, '2025-06-19', '18:30:00', '19:46:00', 0.16, 'reason', 'Approved', NULL, NULL, 1.00, 76, NULL, 1.00),
(38, 'CJIS-2025-0022', 'Louis Gio  Noval', NULL, NULL, '2025-06-21', '18:30:00', '19:05:00', 0.07, 'reason', 'Approved', NULL, NULL, 1.00, 35, NULL, 1.00),
(39, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', NULL, NULL, '2025-07-07', '18:30:00', '02:30:00', 1.00, 'Nag sugod sa 9:30 pm to 2:30 am overtime sa field work of bz centrio', 'Rejected', 'Not approved yet', NULL, 1.00, 480, NULL, 1.00),
(40, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', NULL, NULL, '2025-07-05', '21:30:00', '02:30:00', 0.63, 'Boyzugba centrio cctv installation', 'Approved', 'Admin', NULL, 1.00, 300, NULL, 1.00),
(41, 'CJIS-2025-0033', 'Jasper  Perote', NULL, NULL, '2025-07-05', '21:30:00', '02:30:00', 0.63, '0', 'Approved', 'Admin', NULL, 1.00, 300, NULL, 1.00),
(42, 'CJIS-2025-0028', 'Mark   Busbus', NULL, NULL, '2025-07-05', '21:30:00', '02:30:00', 0.63, 'CCTV installation/repair at Boy Zugba Centrio', 'Approved', 'Admin', NULL, 1.00, 300, NULL, 1.00),
(43, 'CJIS-2025-0030', 'Gerome Tangara Hapson', NULL, NULL, '2025-07-05', '21:30:00', '02:30:00', 0.63, 'OT', 'Approved', 'Admin', NULL, 1.00, 300, NULL, 1.00),
(44, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', NULL, NULL, '2025-07-15', '18:30:00', '18:32:00', 0.00, 'Cleaning toilet.', 'Approved', 'Admin', NULL, 1.00, 2, NULL, 1.00),
(45, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', NULL, NULL, '2025-07-22', '18:30:00', '21:00:00', 0.31, 'Vst HPE & HPI seminar', 'Approved', 'Admin', NULL, 1.00, 150, NULL, 1.00),
(46, 'CJIS-2025-0033', 'Jasper  Perote', NULL, NULL, '2025-07-22', '18:30:00', '21:00:00', 0.31, 'Seminar in the Luxe Hotel about HPI AND HPE', 'Approved', 'Admin', NULL, 1.00, 150, NULL, 1.00),
(47, 'CJIS-2025-0033', 'Jasper  Perote', NULL, NULL, '2025-08-12', '00:00:00', '06:00:00', 0.75, '24 chicken', 'Approved', 'Admin', NULL, 1.00, 360, NULL, 1.00),
(48, 'CJIS-2025-0030', 'Gerome Tangara Hapson', NULL, NULL, '2025-08-12', '00:00:00', '06:00:00', 0.75, '24 chicken', 'Approved', 'Admin', NULL, 1.00, 360, NULL, 1.00),
(49, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', NULL, NULL, '2025-07-26', '18:30:00', '19:05:00', 0.07, 'Waiting for Mark to get the key for pabayo para e hatag nako kang sir', 'Approved', 'Admin', NULL, 1.00, 35, NULL, 1.00),
(50, 'CJIS-2025-0033', 'Jasper  Perote', NULL, NULL, '2025-08-06', '18:30:00', '21:30:00', 0.38, 'Attend appreciation night at Lapasan', 'Approved', 'Admin', NULL, 1.00, 180, NULL, 1.00),
(51, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', NULL, NULL, '2025-08-06', '18:30:00', '21:30:00', 0.38, 'Me and Jasper attend\'s the Stakeholders Appreciation Night of Lapasan ', 'Approved', 'Admin', NULL, 1.00, 180, NULL, 1.00),
(52, 'CJIS-2025-0028', 'Mark   Busbus', NULL, NULL, '2025-07-26', '18:30:00', '19:05:00', 0.07, 'naghatod og key para ihatag kay joric, nagsabay mig time out 7:05pm', 'Approved', 'Admin', NULL, 1.00, 35, NULL, 1.00),
(53, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', NULL, NULL, '2025-09-02', '18:30:00', '19:13:00', 0.09, 'Making sales report late due to setuping printer to customer ', 'Approved', 'Admin', NULL, 1.00, 43, NULL, 1.00),
(54, 'CJIS-2025-0041', 'Aaron Magasin Cordova', NULL, NULL, '2025-09-02', '18:30:00', '19:13:00', 0.09, 'Making sales report late due to setuping printer to customer ', 'Rejected', 'Not approved yet', NULL, 1.00, 43, NULL, 1.00),
(55, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', NULL, NULL, '2025-09-04', '18:30:00', '18:41:00', 0.02, 'Setup laptop', 'Approved', 'Admin', NULL, 1.00, 11, NULL, 1.00),
(56, 'CJIS-2025-0033', 'Jasper  Perote', NULL, NULL, '2025-09-11', '18:30:00', '21:30:00', 0.38, 'Seminar in Banbros', 'Approved', 'Admin', NULL, 1.00, 180, NULL, 1.00),
(57, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', NULL, NULL, '2025-09-11', '18:30:00', '21:30:00', 0.38, 'Attended Banbros Event the Tech Fusion ', 'Approved', 'Admin', NULL, 1.00, 180, NULL, 1.00),
(58, 'CJIS-2025-0033', 'Jasper  Perote', NULL, NULL, '2025-09-12', '21:30:00', '01:00:00', 0.44, 'BZ centrio CCTV installation for fire exit outside', 'Approved', 'Admin', NULL, 1.00, 210, NULL, 1.00),
(59, 'CJIS-2025-0030', 'Gerome Tangara Hapson', NULL, NULL, '2025-09-12', '21:30:00', '01:00:00', 0.44, 'Boy Zugba cctv installation', 'Approved', 'Admin', NULL, 1.00, 210, NULL, 1.00),
(61, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', NULL, NULL, '2025-09-24', '18:30:00', '21:13:00', 0.34, 'Guarding workers', 'Approved', 'Admin', NULL, 1.00, 163, NULL, 1.00),
(62, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', NULL, NULL, '2025-10-14', '18:30:00', '20:05:00', 0.20, 'Rakiyata Centrio POS issue. Onsite visit', 'Approved', 'Admin', NULL, 1.00, 95, NULL, 1.00),
(64, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador ', NULL, NULL, '2025-10-27', '18:30:00', '09:30:00', 1.00, 'sdfsfsf', 'Approved', NULL, NULL, 1.00, 900, NULL, 1.00),
(65, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador ', NULL, NULL, '2025-10-24', '18:03:00', '22:00:00', 0.49, 'test', 'Approved', NULL, NULL, 1.00, 237, NULL, 1.00),
(66, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador ', NULL, NULL, '2025-11-01', '18:30:00', '22:35:00', 0.51, 'ghj', 'Approved', NULL, NULL, 1.00, 245, NULL, 1.00);

--
-- Triggers `employee_overtime_request`
--
DELIMITER $$
CREATE TRIGGER `after_overtime_request_approved` AFTER UPDATE ON `employee_overtime_request` FOR EACH ROW BEGIN
  IF NEW.status = 'Approved' THEN

    -- Ensure the attendance row exists (insert if not)
    INSERT IGNORE INTO attendance (employee_id, employee_name, attendance_date)
    VALUES (NEW.employee_id, NEW.employee_name, NEW.date_requested);

    -- Update overtime_request field
    UPDATE attendance
    SET overtime_request = NEW.hours_requested
    WHERE employee_id = NEW.employee_id
      AND attendance_date = NEW.date_requested;

  END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `after_overtime_request_insert` AFTER INSERT ON `employee_overtime_request` FOR EACH ROW BEGIN
  IF NEW.status = 'Approved' THEN
    INSERT IGNORE INTO attendance (employee_id, employee_name, attendance_date)
    VALUES (NEW.employee_id, NEW.employee_name, NEW.date_requested);

    UPDATE attendance
    SET overtime_request = NEW.hours_requested
    WHERE employee_id = NEW.employee_id
      AND attendance_date = NEW.date_requested;
  END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `after_overtime_request_rejected` AFTER UPDATE ON `employee_overtime_request` FOR EACH ROW BEGIN
  IF NEW.status = 'Rejected' THEN
    UPDATE attendance
    SET overtime_request = 0.00
    WHERE employee_id = NEW.employee_id
      AND attendance_date = NEW.date_requested;
  END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `calculate_hours_requested` BEFORE INSERT ON `employee_overtime_request` FOR EACH ROW BEGIN
  DECLARE mins INT;
  SET mins = TIMESTAMPDIFF(MINUTE, NEW.time_start, NEW.end_time);

  -- Fix negative values when end_time is next day
  IF mins < 0 THEN
    SET mins = TIMESTAMPDIFF(MINUTE, NEW.time_start, ADDTIME(NEW.end_time, '24:00:00'));
  END IF;

  SET NEW.minutes_requested = mins;

  -- Credit system: 1.00 credit = 8 hours (480 mins), capped to 1.00 max
  SET NEW.hours_requested = LEAST((mins / 480), 1.00);
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `calculate_hours_requested_before_update` BEFORE UPDATE ON `employee_overtime_request` FOR EACH ROW BEGIN
  DECLARE mins INT;
  SET mins = TIMESTAMPDIFF(MINUTE, NEW.time_start, NEW.end_time);

  IF mins < 0 THEN
    SET mins = TIMESTAMPDIFF(MINUTE, NEW.time_start, ADDTIME(NEW.end_time, '24:00:00'));
  END IF;

  SET NEW.minutes_requested = mins;
  SET NEW.hours_requested = LEAST((mins / 480), 1.00);
END
$$
DELIMITER ;

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

--
-- Table structure for table `employee_shift_schedule`
--

CREATE TABLE `employee_shift_schedule` (
  `schedule_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `work_time_id` int(11) NOT NULL,
  `effective_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `recurrence_type` enum('none','daily','weekly','monthly') DEFAULT 'none',
  `recurrence_interval` int(11) DEFAULT 1,
  `days_of_week` set('Mon','Tue','Wed','Thu','Fri','Sat','Sun') DEFAULT NULL,
  `occurrence_limit` int(11) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `priority` int(11) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `employee_shift_schedule`
--

INSERT INTO `employee_shift_schedule` (`schedule_id`, `employee_id`, `work_time_id`, `effective_date`, `end_date`, `recurrence_type`, `recurrence_interval`, `days_of_week`, `occurrence_limit`, `is_active`, `created_at`, `priority`) VALUES
(35, 'CJIS-2025-0001', 5, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, '2025-11-09 13:47:17', 1),
(36, 'CJIS-2025-0024', 5, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, '2025-11-09 13:49:05', 1),
(39, 'CJIS-2025-0024', 2, '2025-11-03', '2025-11-03', 'none', 1, NULL, NULL, 1, '2025-11-09 13:52:18', 1),
(40, 'CJIS-2025-0024', 2, '2025-11-04', '2025-11-04', 'none', 1, NULL, NULL, 1, '2025-11-09 13:52:18', 1),
(41, 'CJIS-2025-0001', 2, '2025-11-04', '2025-11-04', 'none', 1, NULL, NULL, 1, '2025-11-09 13:52:18', 1),
(43, 'CJIS-2025-0024', 2, '2025-11-01', '2025-11-01', 'none', 1, NULL, NULL, 1, '2025-11-09 13:52:18', 1),
(44, 'CJIS-2025-0001', 2, '2025-11-01', '2025-11-01', 'none', 1, NULL, NULL, 1, '2025-11-09 13:52:18', 1),
(45, 'CJIS-2025-0001', 5, '2025-11-09', '2025-11-09', 'none', 1, NULL, NULL, 1, '2025-11-09 13:57:50', 1),
(46, 'CJIS-2025-0024', 5, '2025-11-09', '2025-11-09', 'none', 1, NULL, NULL, 1, '2025-11-09 13:57:50', 1),
(47, 'CJIS-2025-0001', 2, '2025-11-03', '2025-11-03', 'none', 1, NULL, NULL, 1, '2025-11-09 14:29:44', 1),
(48, 'CJIS-2025-0024', 5, '2025-11-05', '2025-11-05', 'none', 1, NULL, NULL, 1, '2025-11-09 17:11:18', 1),
(49, 'CJIS-2025-0001', 5, '2025-11-05', '2025-11-05', 'none', 1, NULL, NULL, 1, '2025-11-09 17:11:18', 1);

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

--
-- Table structure for table `fetch_log`
--

CREATE TABLE `fetch_log` (
  `id` int(11) NOT NULL,
  `last_fetch_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `fetch_log`
--

INSERT INTO `fetch_log` (`id`, `last_fetch_date`) VALUES
(1, '2025-03-10');

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

--
-- Table structure for table `holidays`
--

CREATE TABLE `holidays` (
  `holiday_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `holiday_date` date NOT NULL,
  `is_recurring` tinyint(1) DEFAULT 0,
  `default_multiplier` decimal(4,2) DEFAULT 1.00,
  `ot_multiplier` decimal(4,2) DEFAULT NULL,
  `apply_multiplier` tinyint(1) DEFAULT 1,
  `extended_until` date DEFAULT NULL,
  `holiday_type` enum('Regular','Special','Custom') DEFAULT 'Regular'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `holidays`
--

INSERT INTO `holidays` (`holiday_id`, `name`, `holiday_date`, `is_recurring`, `default_multiplier`, `ot_multiplier`, `apply_multiplier`, `extended_until`, `holiday_type`) VALUES
(1, 'Holday', '2025-09-08', 1, 1.00, 1.00, 1, '0000-00-00', 'Regular');

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

--
-- Table structure for table `inactive_employees`
--

CREATE TABLE `inactive_employees` (
  `employee_id` varchar(15) NOT NULL,
  `first_name` varchar(50) NOT NULL,
  `middle_name` varchar(50) DEFAULT NULL,
  `last_name` varchar(50) NOT NULL,
  `email` varchar(100) DEFAULT NULL,
  `contact_number` varchar(20) DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `department_id` varchar(11) DEFAULT NULL,
  `position_id` varchar(50) DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `inactive_date` datetime DEFAULT current_timestamp(),
  `description` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `incentives`
--

CREATE TABLE `incentives` (
  `incentives_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `position_id` varchar(50) DEFAULT NULL,
  `date_received` date NOT NULL,
  `date_released` date NOT NULL,
  `customer_name` varchar(255) NOT NULL,
  `invoice` varchar(50) NOT NULL,
  `job_number` varchar(50) NOT NULL,
  `labor` decimal(10,2) NOT NULL,
  `compay` decimal(10,2) NOT NULL,
  `tech` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `issued_items`
--

CREATE TABLE `issued_items` (
  `item_id` int(11) NOT NULL,
  `sku` varchar(100) DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `unit_cost` decimal(12,2) DEFAULT 0.00,
  `stock` int(11) DEFAULT 0,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `lateness_rules`
--

CREATE TABLE `lateness_rules` (
  `id` int(11) NOT NULL,
  `session_name` varchar(20) NOT NULL,
  `start_time` time NOT NULL,
  `grace_period` time NOT NULL,
  `required_end_time` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `lateness_rules`
--

INSERT INTO `lateness_rules` (`id`, `session_name`, `start_time`, `grace_period`, `required_end_time`) VALUES
(1, 'Morning', '09:00:00', '09:05:00', '12:00:00'),
(2, 'Afternoon', '13:00:00', '13:05:00', '18:00:00');

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

--
-- Table structure for table `late_attendance_requests`
--

CREATE TABLE `late_attendance_requests` (
  `request_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `employee_name` varchar(100) DEFAULT NULL,
  `attendance_date` date NOT NULL,
  `requested_time_in_morning` time DEFAULT NULL,
  `requested_time_out_morning` time DEFAULT NULL,
  `requested_time_in_afternoon` time DEFAULT NULL,
  `requested_time_out_afternoon` time DEFAULT NULL,
  `work_time_id` int(11) DEFAULT NULL,
  `schedule_id` int(11) DEFAULT NULL,
  `reason` text DEFAULT NULL,
  `status` enum('pending','approved','rejected') DEFAULT 'pending',
  `requested_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `reviewed_at` timestamp NULL DEFAULT NULL,
  `reviewed_by` varchar(50) DEFAULT NULL,
  `original_time_in_morning` time DEFAULT NULL,
  `original_time_out_morning` time DEFAULT NULL,
  `original_time_in_afternoon` time DEFAULT NULL,
  `original_time_out_afternoon` time DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `late_attendance_requests`
--

INSERT INTO `late_attendance_requests` (`request_id`, `employee_id`, `employee_name`, `attendance_date`, `requested_time_in_morning`, `requested_time_out_morning`, `requested_time_in_afternoon`, `requested_time_out_afternoon`, `work_time_id`, `schedule_id`, `reason`, `status`, `requested_at`, `reviewed_at`, `reviewed_by`, `original_time_in_morning`, `original_time_out_morning`, `original_time_in_afternoon`, `original_time_out_afternoon`) VALUES
(67, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-05-27', '09:05:56', '00:00:00', '00:00:00', '18:00:00', NULL, NULL, 'bug', 'approved', '2025-05-27 10:01:05', NULL, 'Admin', '09:05:56', '12:00:00', '13:00:00', '18:00:00'),
(68, 'CJIS-2025-0025', 'Sarfeil  Curran', '2025-05-27', '09:04:26', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Damn', 'approved', '2025-05-27 10:01:16', NULL, 'Admin', '09:04:26', '00:00:00', '00:00:00', '00:00:00'),
(69, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-05-29', '09:14:07', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'wala ka time in sa hapon sa portal', 'approved', '2025-05-29 10:02:13', NULL, 'Admin', '09:14:07', '00:00:00', '00:00:00', '00:00:00'),
(70, 'CJIS-2025-0019', 'Ivan Jay  Daigdigan', '2025-05-30', '08:49:37', '00:00:00', '13:58:57', '15:00:00', NULL, NULL, 'Emergency', 'approved', '2025-05-30 06:59:33', NULL, 'Admin', '08:49:37', '12:00:00', '13:58:57', '15:00:00'),
(71, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-05-31', '09:28:26', '12:01:00', '01:13:00', '18:01:00', NULL, NULL, 'wala ka time in sa udto', 'approved', '2025-05-31 10:01:48', NULL, 'Admin', '09:28:26', '00:00:00', '00:00:00', '00:00:00'),
(72, 'CJIS-2025-0019', 'Ivan Jay  Daigdigan', '2025-06-02', '08:46:36', '12:55:00', '00:00:00', '00:00:00', NULL, NULL, 'Forgot', 'approved', '2025-06-02 04:55:16', NULL, 'Admin', '08:46:36', '00:00:00', '12:55:22', '18:00:04'),
(73, 'CJIS-2025-0019', 'Ivan Jay  Daigdigan', '2025-06-03', '08:56:25', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Forgot', 'approved', '2025-06-03 06:30:59', NULL, 'Admin', '08:56:25', '00:00:00', '00:00:00', '00:00:00'),
(74, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-03', '09:07:00', '12:00:00', '13:00:00', '16:30:00', NULL, NULL, 'Asking permission to early out for my study cisco network defense course. ', 'approved', '2025-06-03 08:17:34', NULL, 'Admin', NULL, NULL, NULL, NULL),
(75, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-02', '09:04:38', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Wala ka time out sa portal', 'approved', '2025-06-03 08:33:30', NULL, 'Admin', '09:04:38', '00:00:00', '00:00:00', '00:00:00'),
(76, 'CJIS-2025-0019', 'Ivan Jay  Daigdigan', '2025-06-03', '08:56:25', '12:01:00', '13:01:00', '18:01:00', NULL, NULL, 'Time out', 'approved', '2025-06-03 10:01:50', NULL, 'Admin', '08:56:25', '12:00:00', '13:00:00', '00:00:00'),
(77, 'CJIS-2025-0019', 'Ivan Jay  Daigdigan', '2025-06-04', '08:59:01', '12:16:39', '12:33:35', '18:04:00', NULL, NULL, 'Time out', 'approved', '2025-06-04 10:04:31', NULL, 'Admin', '08:59:01', '12:16:39', '12:33:35', '00:00:00'),
(78, 'CJIS-2025-0019', 'Ivan Jay  Daigdigan', '2025-06-05', '08:50:07', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Forgot to time out and time in', 'approved', '2025-06-05 06:22:26', NULL, 'Admin', '08:50:07', '00:00:00', '00:00:00', '00:00:00'),
(79, 'CJIS-2025-0019', 'Ivan Jay  Daigdigan', '2025-06-05', '08:50:07', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Time out', 'approved', '2025-06-05 10:02:19', NULL, 'Admin', '08:50:07', '12:00:00', '13:00:00', '00:00:00'),
(80, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-05', '08:43:00', '12:00:00', '13:00:00', '18:21:00', NULL, NULL, 'Wala naka time in sa portal', 'approved', '2025-06-07 01:44:25', NULL, 'Admin', NULL, NULL, NULL, NULL),
(81, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-04', '09:40:00', '12:00:00', '12:00:00', '18:10:00', NULL, NULL, 'Wala naka time-in sa portal', 'approved', '2025-06-07 01:45:13', NULL, 'Admin', NULL, NULL, NULL, NULL),
(82, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-03', '09:18:54', '12:00:00', '13:00:00', '18:09:00', NULL, NULL, 'Wala naka time out sa portal', 'approved', '2025-06-07 01:45:56', NULL, 'Admin', '09:18:54', '00:00:00', '00:00:00', '00:00:00'),
(83, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-02', '09:04:38', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Wala naka time out sa portal', 'approved', '2025-06-07 01:46:40', NULL, 'Admin', '09:04:38', '12:00:00', '13:00:00', '18:00:00'),
(84, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-07', '09:32:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Forgot', 'approved', '2025-06-07 02:13:43', NULL, 'Admin', NULL, NULL, NULL, NULL),
(85, 'CJIS-2025-0019', 'Ivan Jay  Daigdigan', '2025-06-07', '00:00:00', '00:00:00', '12:30:00', '00:00:00', NULL, NULL, 'Forog5', 'approved', '2025-06-07 06:42:39', NULL, 'Admin', NULL, NULL, NULL, NULL),
(86, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-07', '09:37:48', '12:00:29', '13:00:00', '18:00:00', NULL, NULL, 'Nalimot time in sa hapon', 'approved', '2025-06-07 10:00:49', NULL, 'Admin', '09:37:48', '12:00:29', '00:00:00', '00:00:00'),
(88, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-09', '09:12:39', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Late request', 'approved', '2025-06-09 10:25:02', NULL, 'Admin', '09:12:39', '00:00:00', '00:00:00', '00:00:00'),
(90, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-10', '09:15:44', '12:00:00', '12:30:00', '00:00:00', NULL, NULL, 'Late time out', 'approved', '2025-06-10 04:33:04', NULL, 'Admin', '09:15:44', '00:00:00', '00:00:00', '00:00:00'),
(93, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-06-10', '09:00:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'test\n', 'approved', '2025-06-10 06:25:27', NULL, 'Admin', NULL, NULL, NULL, NULL),
(97, 'CJIS-2025-0033', 'Jasper  Perote', '2025-06-11', '09:02:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Cant login. Invalid credentials', 'approved', '2025-06-11 02:02:05', NULL, 'Admin', '10:00:39', '00:00:00', '00:00:00', '00:00:00'),
(98, 'CJIS-2025-0033', 'Jasper  Perote', '2025-06-11', '09:02:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Cant login. Invalid credentials', 'approved', '2025-06-11 02:02:08', NULL, 'Admin', '09:02:00', '00:00:00', '00:00:00', '00:00:00'),
(99, 'CJIS-2025-0031', 'Joric  Labrador', '2025-06-11', '08:55:00', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Bug attendance\n', 'approved', '2025-06-11 05:14:04', NULL, 'Admin', '00:00:00', '00:00:00', '00:00:00', '00:00:00'),
(107, 'CJIS-2025-0028', 'Mark   Busbus', '2025-06-11', '09:13:00', '12:02:06', '13:00:00', '18:00:00', NULL, NULL, 'Nalimtan og time-in sa Morning', 'approved', '2025-06-11 10:01:24', NULL, 'Admin', '09:16:17', '12:02:06', '00:00:00', '00:00:00'),
(110, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-11', '09:21:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Wala ka time out sa udto', 'approved', '2025-06-11 10:03:50', NULL, 'Admin', '09:22:23', '00:00:00', '00:00:00', '00:00:00'),
(112, 'CJIS-2025-0030', 'Gerome  Hapson', '2025-06-11', '09:49:00', '12:00:00', '13:01:00', '18:07:00', NULL, NULL, 'Geo Gad cctv repair', 'approved', '2025-06-11 10:08:27', NULL, 'Admin', '09:49:00', '00:00:00', '00:00:00', '00:00:00'),
(116, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-12', '09:17:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'No network', 'approved', '2025-06-12 01:19:51', NULL, 'Admin', NULL, NULL, NULL, NULL),
(118, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-06-12', '08:58:35', '12:12:11', '13:00:00', '00:00:00', NULL, NULL, 'Forgot', 'approved', '2025-06-12 06:29:13', NULL, 'Admin', '08:58:35', '12:12:11', '00:00:00', '00:00:00'),
(119, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-12', '09:17:00', '12:11:52', '13:00:00', '00:00:00', NULL, NULL, 'Late', 'approved', '2025-06-12 06:30:30', NULL, 'Admin', '09:17:00', '12:11:52', '00:00:00', '00:00:00'),
(120, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-13', '09:07:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Nag bug ang web application', 'approved', '2025-06-13 01:15:52', NULL, 'Admin', NULL, NULL, NULL, NULL),
(121, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-13', '09:12:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Late time In HRIS', 'approved', '2025-06-13 01:16:50', NULL, 'Admin', NULL, NULL, NULL, NULL),
(122, 'CJIS-2025-0030', 'Gerome  Hapson', '2025-06-13', '09:23:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Late update', 'approved', '2025-06-13 01:35:44', NULL, 'Admin', '09:34:17', '00:00:00', '00:00:00', '00:00:00'),
(123, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-05-28', '09:06:03', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Late request', 'approved', '2025-06-13 07:31:51', NULL, 'Admin', '09:06:03', '00:00:00', '00:00:00', '00:00:00'),
(124, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-05-29', '20:51:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Late attendance', 'rejected', '2025-06-13 07:32:59', NULL, 'Admin', NULL, NULL, NULL, NULL),
(125, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-05-30', '09:02:19', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Late attendance', 'approved', '2025-06-13 07:33:23', NULL, 'Admin', '09:02:19', '00:00:00', '00:00:00', '00:00:00'),
(126, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-05-31', '21:01:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Late attendance', 'rejected', '2025-06-13 07:34:42', NULL, 'Admin', NULL, NULL, NULL, NULL),
(127, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-02', '09:02:00', '12:00:00', '13:00:00', '16:57:00', NULL, NULL, 'Late attendance', 'approved', '2025-06-13 07:36:09', NULL, 'Admin', NULL, NULL, NULL, NULL),
(128, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-03', '09:07:00', '12:00:00', '13:00:00', '16:30:00', NULL, NULL, 'Early out for my network defense training', 'approved', '2025-06-13 07:36:38', NULL, 'Admin', '09:07:00', '12:00:00', '13:00:00', '16:30:00'),
(129, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-05', '09:12:00', '12:00:00', '13:00:00', '17:00:00', NULL, NULL, 'Early out for my training Network defence', 'approved', '2025-06-13 07:44:07', NULL, 'Admin', NULL, NULL, NULL, NULL),
(130, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-07', '09:32:00', '12:01:19', '13:00:00', '18:00:00', NULL, NULL, 'Late attendance', 'approved', '2025-06-13 07:44:50', NULL, 'Admin', '09:32:00', '12:01:19', '13:00:00', '00:00:00'),
(131, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-09', '09:11:00', '12:00:00', '13:00:00', '18:02:00', NULL, NULL, 'Late attendance', 'approved', '2025-06-13 07:45:52', NULL, 'Admin', '09:12:39', '12:00:00', '13:00:00', '18:00:00'),
(132, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-10', '09:13:00', '12:00:00', '12:30:00', '18:01:00', NULL, NULL, 'Late attendance', 'approved', '2025-06-13 07:46:58', NULL, 'Admin', '09:15:44', '12:00:00', '12:30:00', '18:02:51'),
(133, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-11', '00:00:00', '00:00:00', '13:02:00', '18:01:00', NULL, NULL, 'Late attendance', 'approved', '2025-06-13 07:47:36', NULL, 'Admin', '00:00:00', '00:00:00', '13:03:38', '00:00:00'),
(134, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-13', '09:13:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Late attendance', 'approved', '2025-06-13 07:49:04', NULL, 'Admin', '09:12:00', '00:00:00', '00:00:00', '00:00:00'),
(135, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-05-31', '09:01:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Late requst', 'approved', '2025-06-13 08:03:37', NULL, 'Admin', NULL, NULL, NULL, NULL),
(136, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-11', '00:00:00', '00:00:00', '13:02:00', '18:01:00', NULL, NULL, 'Late request', 'approved', '2025-06-13 08:56:14', NULL, 'Admin', NULL, NULL, NULL, NULL),
(137, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-13', '09:07:00', '12:00:00', '13:14:00', '18:05:00', NULL, NULL, 'Wala ka time out sa udto', 'approved', '2025-06-13 10:05:37', NULL, 'Admin', '09:07:00', '00:00:00', '00:00:00', '00:00:00'),
(138, 'CJIS-2025-0030', 'Gerome  Hapson', '2025-06-13', '09:23:00', '12:00:00', '13:24:00', '18:06:00', NULL, NULL, 'Dli mka login', 'approved', '2025-06-13 10:07:05', NULL, 'Admin', '09:23:00', '00:00:00', '00:00:00', '00:00:00'),
(139, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-14', '09:23:10', '12:00:00', '13:00:00', '18:08:00', NULL, NULL, 'Wala ka time out/time in sa usto', 'approved', '2025-06-14 10:09:01', NULL, 'Admin', '09:23:10', '00:00:00', '00:00:00', '00:00:00'),
(140, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-16', '09:11:16', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Wala ka time in sa udto', 'approved', '2025-06-17 01:21:23', NULL, 'Admin', '09:11:16', '00:00:00', '00:00:00', '00:00:00'),
(141, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-06-17', '08:55:27', '12:00:00', '12:54:39', '00:00:00', NULL, NULL, 'Forgot', 'approved', '2025-06-17 04:55:06', NULL, 'Admin', '08:55:27', '00:00:00', '12:54:39', '00:00:00'),
(142, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-17', '09:04:45', '12:00:00', '13:00:00', '16:30:00', NULL, NULL, 'request early because of my headache', 'approved', '2025-06-17 08:12:54', NULL, 'Admin', '09:04:45', '00:00:00', '00:00:00', '00:00:00'),
(143, 'CJIS-2025-0031', 'Joric  Labrador', '2025-06-17', '09:10:00', '12:23:30', '13:00:00', '18:00:00', NULL, NULL, 'Limtan sir kay nag field sa zubaibai po', 'approved', '2025-06-17 10:00:10', NULL, 'Admin', '09:13:07', '12:23:30', '00:00:00', '00:00:00'),
(144, 'CJIS-2025-0028', 'Mark   Busbus', '2025-06-17', '08:58:41', '12:01:51', '13:00:00', '18:00:00', NULL, NULL, 'Nakalimot og time in sa hapon kay nag site visit', 'approved', '2025-06-17 10:01:16', NULL, 'Admin', '08:58:41', '12:01:51', '00:00:00', '00:00:00'),
(145, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-06-17', '08:59:41', '12:02:15', '13:00:08', '18:00:00', NULL, NULL, 'Forgot to time out ', 'approved', '2025-06-18 01:00:25', NULL, 'Admin', '08:59:41', '12:02:15', '13:00:08', '00:00:00'),
(146, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-18', '09:11:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'forgot time In Am ', 'approved', '2025-06-18 01:37:08', NULL, 'Admin', NULL, NULL, NULL, NULL),
(147, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-06-18', '09:28:18', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Forgot', 'approved', '2025-06-18 06:02:00', NULL, 'Admin', '09:28:18', '00:00:00', '00:00:00', '00:00:00'),
(148, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-18', '09:22:26', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Wala ka time out sa udto', 'approved', '2025-06-18 10:17:14', NULL, 'Admin', '09:22:26', '00:00:00', '00:00:00', '00:00:00'),
(149, 'CJIS-2025-0028', 'Mark   Busbus', '2025-06-18', '09:01:00', '12:00:00', '13:01:00', '19:12:00', NULL, NULL, 'Wait customer of Laptop (5S Development Corporation)', 'approved', '2025-06-18 11:13:11', NULL, 'Admin', '09:01:00', '12:00:00', '13:01:00', '18:12:13'),
(150, 'CJIS-2025-0033', 'Jasper  Perote', '2025-06-18', '09:00:00', '12:00:00', '13:00:57', '19:13:00', NULL, NULL, 'Wait customer of laptop (5S Development Corporation)', 'approved', '2025-06-18 11:13:12', NULL, 'Admin', '09:00:00', '12:00:00', '13:00:57', '00:00:00'),
(151, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-06-19', '00:00:00', '00:00:00', '00:00:00', '18:02:00', NULL, NULL, 'Bbbbj', 'rejected', '2025-06-19 04:05:40', NULL, 'Admin', NULL, NULL, NULL, NULL),
(152, 'CJIS-2025-0031', 'Joric  Labrador', '2025-06-11', '08:55:00', '12:00:00', '13:00:00', '18:00:30', NULL, NULL, 'Limtan og time in sa afternoon 1:00', 'approved', '2025-06-19 04:07:33', NULL, 'Admin', '08:55:00', '12:00:00', '13:26:24', '18:00:30'),
(153, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-19', '09:11:23', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Wala ka time out sa udto', 'approved', '2025-06-19 10:02:40', NULL, 'Admin', '09:11:23', '00:00:00', '00:00:00', '00:00:00'),
(154, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-06-19', '09:00:01', '12:00:00', '13:00:00', '18:12:00', NULL, NULL, 'Forgot', 'approved', '2025-06-19 10:12:15', NULL, 'Admin', '09:00:01', '00:00:00', '00:00:00', '00:00:00'),
(155, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-06-20', '00:00:00', '00:00:00', '13:24:00', '00:00:00', NULL, NULL, 'Time in late', 'approved', '2025-06-20 05:51:42', NULL, 'Admin', NULL, NULL, NULL, NULL),
(156, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-20', '09:33:52', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Late time in', 'approved', '2025-06-20 06:26:50', NULL, 'Admin', '09:33:52', '00:00:00', '00:00:00', '00:00:00'),
(157, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-06-20', '22:08:00', '12:05:00', '13:20:00', '18:02:00', NULL, NULL, 'Update attendance', 'approved', '2025-06-20 10:08:26', NULL, 'Admin', NULL, NULL, NULL, NULL),
(158, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-06-21', '00:00:00', '00:00:00', '00:00:00', '18:05:00', NULL, NULL, 'Updated timeout', 'approved', '2025-06-21 02:06:16', NULL, 'Admin', NULL, NULL, NULL, NULL),
(159, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-21', '09:33:22', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Wala ka time out sa hapon', 'approved', '2025-06-21 11:09:04', NULL, 'Admin', '09:33:22', '00:00:00', '00:00:00', '00:00:00'),
(160, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-06-21', '09:19:40', '12:00:00', '13:00:00', '19:10:00', NULL, NULL, 'Forgot and overtime', 'approved', '2025-06-21 11:10:55', NULL, 'Admin', '09:19:40', '00:00:00', '00:00:00', '00:00:00'),
(161, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-23', '09:08:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Late input', 'approved', '2025-06-23 01:18:30', NULL, 'Admin', NULL, NULL, NULL, NULL),
(162, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-06-23', '09:10:00', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Forgot', 'approved', '2025-06-23 01:51:20', NULL, 'Admin', '00:00:00', '00:00:00', '12:39:00', '18:08:04'),
(163, 'CJIS-2025-0033', 'Jasper  Perote', '2025-06-23', '09:02:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Forgot to time in afternoon', 'approved', '2025-06-23 05:36:27', NULL, 'Admin', '09:02:00', '12:00:00', '13:30:00', '18:00:29'),
(164, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-23', '09:10:48', '12:00:00', '13:00:00', '18:15:00', NULL, NULL, 'Wala ka time out sa udto', 'approved', '2025-06-23 10:15:59', NULL, 'Admin', '09:10:48', '00:00:00', '00:00:00', '00:00:00'),
(165, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-24', '09:26:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'late time in \n\n', 'approved', '2025-06-24 01:32:30', NULL, 'Admin', NULL, NULL, NULL, NULL),
(166, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-06-24', '08:57:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Na late og time in sa HRIS ', 'approved', '2025-06-24 05:09:58', NULL, 'Admin', '08:57:00', '12:00:00', '13:08:13', '00:00:00'),
(167, 'CJIS-2025-0028', 'Mark   Busbus', '2025-06-24', '09:03:00', '12:00:58', '13:00:00', '18:01:00', NULL, NULL, 'Nakalimot og time in kay nag general cleaning, nayabo ang ink sa salog', 'approved', '2025-06-24 10:04:14', NULL, 'Admin', '09:03:00', '12:00:58', '00:00:00', '00:00:00'),
(168, 'CJIS-2025-0033', 'Jasper  Perote', '2025-06-23', '09:02:00', '12:00:00', '13:00:00', '18:04:00', NULL, NULL, 'Cant log out', 'approved', '2025-06-24 10:09:27', NULL, 'Admin', '09:02:00', '12:00:00', '13:00:00', '00:00:00'),
(169, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-25', '09:05:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'late attendance\n', 'approved', '2025-06-25 01:10:41', NULL, 'Admin', NULL, NULL, NULL, NULL),
(170, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-18', '09:11:00', '12:00:00', '13:00:00', '16:20:00', NULL, NULL, 'late time out ', 'approved', '2025-06-25 02:08:25', NULL, 'Admin', '09:11:00', '00:00:00', '00:00:00', '00:00:00'),
(171, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-06-25', '09:00:00', '12:00:00', '13:01:00', '00:00:00', NULL, NULL, 'Forgot', 'approved', '2025-06-25 05:01:24', NULL, 'Admin', '09:00:00', '00:00:00', '13:01:00', '00:00:00'),
(172, 'CJIS-2025-0028', 'Mark   Busbus', '2025-06-25', '09:02:00', '12:02:20', '13:00:00', '18:01:00', NULL, NULL, 'Nakalimot kog time in sa hapon', 'approved', '2025-06-25 10:02:48', NULL, 'Admin', '09:02:00', '12:02:20', '00:00:00', '00:00:00'),
(173, 'CJIS-2025-0031', 'Joric  Labrador', '2025-06-25', '09:11:00', '12:06:03', '13:00:00', '18:02:00', NULL, NULL, 'Sorry wala ka time in sa afternoon po', 'approved', '2025-06-25 10:03:15', NULL, 'Admin', '09:11:00', '12:06:03', '00:00:00', '00:00:00'),
(174, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-06-25', '09:00:00', '12:00:00', '13:01:00', '18:00:00', NULL, NULL, 'Attending Lenovo training session event.', 'approved', '2025-06-25 12:47:14', NULL, 'Admin', '09:00:00', '12:00:00', '13:01:00', '00:00:00'),
(175, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-06-26', '09:18:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Forgot to time in', 'approved', '2025-06-26 01:54:57', NULL, 'Admin', NULL, NULL, NULL, NULL),
(176, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-25', '09:12:00', '12:01:00', '13:00:39', '18:10:00', NULL, NULL, 'Wala ka time out sa hapon', 'approved', '2025-06-26 03:13:47', NULL, 'Admin', '09:12:00', '12:01:00', '13:00:39', '00:00:00'),
(177, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-21', '09:33:22', '12:00:00', '13:00:00', '19:05:00', NULL, NULL, 'overtime', 'approved', '2025-06-26 03:18:00', NULL, 'Admin', '09:33:22', '12:00:00', '13:00:00', '00:00:00'),
(178, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-18', '09:22:26', '12:00:00', '13:00:00', '19:15:00', NULL, NULL, 'overtime', 'approved', '2025-06-26 03:18:47', NULL, 'Admin', '09:22:26', '12:00:00', '13:00:00', '00:00:00'),
(179, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-19', '09:11:23', '12:00:00', '13:00:00', '19:46:00', NULL, NULL, 'overtime', 'approved', '2025-06-26 03:19:23', NULL, 'Admin', '09:11:23', '12:00:00', '13:00:00', '00:00:00'),
(180, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-20', '09:32:00', '12:00:21', '13:00:00', '18:16:00', NULL, NULL, 'wala ka time in sa hapon', 'approved', '2025-06-26 03:20:28', NULL, 'Admin', '09:32:00', '12:00:21', '00:00:00', '00:00:00'),
(181, 'CJIS-2025-0031', 'Joric  Labrador', '2025-06-26', '09:06:34', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Sorry wala ka time out sa morning ', 'approved', '2025-06-26 04:43:00', NULL, 'Admin', '09:06:00', '00:00:00', '13:00:00', '18:01:44'),
(182, 'CJIS-2025-0031', 'Joric  Labrador', '2025-06-24', '08:57:00', '12:00:00', '13:08:25', '18:10:00', NULL, NULL, 'Sorry wala na submit ang pag out po', 'approved', '2025-06-26 04:52:44', NULL, 'Admin', '08:57:00', '12:00:00', '13:08:25', '00:00:00'),
(183, 'CJIS-2025-0031', 'Joric  Labrador', '2025-06-18', '09:08:00', '12:21:00', '13:13:06', '19:13:00', NULL, NULL, 'June 18 wala ko ka timeout kay nag hulat mi ato mag received sa thunderobot na laptop po ', 'approved', '2025-06-26 04:54:56', NULL, 'Admin', '09:08:00', '12:21:00', '13:13:06', '00:00:00'),
(184, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-06-27', '00:00:00', '00:00:00', '13:30:00', '00:00:00', NULL, NULL, 'Invalid time', 'rejected', '2025-06-27 02:55:23', NULL, 'Admin', NULL, NULL, NULL, NULL),
(185, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-06-26', '09:02:00', '12:00:00', '13:00:02', '18:07:00', NULL, NULL, 'Sorry sir nalimot og time out ani na day 😭 after send sa sales report wala na ka time out kay nagdali uli kay naghulat akong ate sa Gaisano', 'approved', '2025-06-27 05:51:17', NULL, 'Admin', '09:02:00', '12:00:00', '13:00:02', '00:00:00'),
(186, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-06-27', '09:27:00', '12:05:30', '13:00:00', '18:00:00', NULL, NULL, 'Forgot to time in and time out', 'approved', '2025-06-27 10:00:26', NULL, 'Admin', '09:27:00', '12:05:30', '00:00:00', '00:00:00'),
(187, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-06-27', '00:00:00', '00:00:00', '00:00:00', '18:02:00', NULL, NULL, 'Invalid time', 'rejected', '2025-06-27 10:03:19', NULL, 'Admin', NULL, NULL, NULL, NULL),
(188, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-06-27', '08:57:00', '12:00:00', '13:00:05', '06:07:00', NULL, NULL, 'Sir pa request sir nalimtan og out gahapon nagsalig sa out sa viber sorry sir', 'approved', '2025-06-27 16:03:31', NULL, 'Admin', '08:57:00', '12:00:00', '13:00:05', '00:00:00'),
(189, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-27', '09:20:00', '12:05:00', '13:00:53', '18:05:00', NULL, NULL, 'wala naka time out ', 'approved', '2025-06-28 01:30:00', NULL, 'Admin', '09:20:00', '12:05:00', '13:00:53', '00:00:00'),
(190, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-14', '09:07:10', '12:00:00', '13:00:00', '18:08:00', NULL, NULL, 'wala naka time out', 'approved', '2025-06-28 01:30:48', NULL, 'Admin', '09:07:10', '12:00:00', '13:00:00', '00:00:00'),
(191, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-06-27', '10:50:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'late time in', 'approved', '2025-06-28 01:53:17', NULL, 'Admin', NULL, NULL, NULL, NULL),
(192, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-06-27', '08:57:00', '12:00:00', '13:00:05', '18:07:00', NULL, NULL, 'sorry sir namali ang request naka AM instead of PM 😭', 'approved', '2025-06-28 03:33:32', NULL, 'Admin', '08:57:00', '12:00:00', '13:00:05', '06:07:00'),
(193, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-06-28', '09:44:00', '12:00:53', '13:00:00', '00:00:00', NULL, NULL, 'Forgot', 'approved', '2025-06-28 07:12:30', NULL, 'Admin', '09:44:00', '12:00:53', '00:00:00', '00:00:00'),
(194, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-06-28', '09:07:00', '12:00:00', '13:00:25', '16:01:00', NULL, NULL, 'Dili maka time out. Nag request late nalang ko sa akoa timeout 4:00pm . Thank you', 'approved', '2025-06-28 08:02:39', NULL, 'Admin', '09:07:00', '12:00:00', '13:00:25', '00:00:00'),
(195, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-06-28', '09:25:00', '12:00:42', '13:00:00', '18:00:00', NULL, NULL, 'Late and test', 'approved', '2025-06-30 03:08:08', NULL, 'Admin', '09:25:00', '12:00:42', '00:00:00', '00:00:00'),
(196, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-06-30', '09:37:00', '12:00:00', '13:12:37', '00:00:00', NULL, NULL, 'Update', 'approved', '2025-06-30 05:14:31', NULL, 'Admin', '09:37:00', '00:00:00', '13:12:37', '00:00:00'),
(197, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-06-30', '09:37:00', '12:00:00', '13:12:00', '17:55:00', NULL, NULL, 'Time update ', 'approved', '2025-06-30 10:37:32', NULL, 'Admin', '09:37:00', '12:00:00', '13:12:00', '00:00:00'),
(198, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-01', '08:59:20', '12:00:00', '13:00:00', '17:11:00', NULL, NULL, 'Forgot and early out', 'approved', '2025-07-01 05:06:23', NULL, 'Admin', '09:21:00', '12:00:00', '13:00:00', '18:00:00'),
(199, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-07-01', '09:21:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'tets\n', 'approved', '2025-07-01 07:45:21', NULL, 'Admin', '09:21:00', '12:00:00', '13:00:00', '18:00:26'),
(200, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-06-30', '09:16:00', '12:00:00', '13:12:00', '18:27:00', NULL, NULL, 'bug', 'approved', '2025-07-01 09:50:57', NULL, 'Admin', '09:37:00', '12:00:00', '13:12:00', '17:55:00'),
(201, 'CJIS-2025-0028', 'Mark   Busbus', '2025-06-30', '09:00:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Nag bug ang hris', 'approved', '2025-07-01 09:56:08', NULL, 'Admin', '09:16:00', '12:00:00', '13:12:00', '18:27:00'),
(202, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-06-26', '09:06:34', '12:00:00', '13:02:00', '18:05:00', NULL, NULL, 'Error/Bug: nawala ang time in time out sa afternoon', 'approved', '2025-07-01 09:56:24', NULL, 'Admin', '09:06:34', '12:00:00', '00:00:00', '00:00:00'),
(203, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-07-01', '09:06:00', '12:00:00', '13:00:00', '18:08:00', NULL, NULL, 'bug', 'approved', '2025-07-02 03:34:17', NULL, 'Admin', '08:59:00', '12:00:00', '13:00:00', '17:11:00'),
(204, 'CJIS-2025-0033', 'Jasper  Perote', '2025-07-01', '09:03:00', '12:00:00', '13:00:00', '18:10:00', NULL, NULL, 'System bug', 'approved', '2025-07-02 03:34:23', NULL, 'Admin', '08:59:00', '12:00:00', '13:00:00', '17:11:00'),
(205, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-07-01', '08:55:00', '12:00:00', '13:00:00', '18:10:00', NULL, NULL, 'BUG', 'approved', '2025-07-02 03:38:35', NULL, 'Admin', '08:59:00', '12:00:00', '13:00:00', '17:11:00'),
(206, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-02', '09:09:00', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Wala na input ', 'approved', '2025-07-02 04:02:13', NULL, 'Admin', '09:10:10', '00:00:00', '00:00:00', '00:00:00'),
(207, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-07-02', '09:00:26', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Bug', 'approved', '2025-07-02 04:02:18', NULL, 'Admin', '09:00:00', '00:00:00', '13:00:00', '00:00:00'),
(208, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-01', '08:59:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Nag bug', 'approved', '2025-07-02 04:03:47', NULL, 'Admin', '08:59:00', '12:00:00', '13:00:00', '17:11:00'),
(209, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-01', '08:59:00', '12:00:00', '13:00:00', '18:04:00', NULL, NULL, 'System Bug/error: wala ko nag early out (5:11) ani na day nag out ko 6:00', 'approved', '2025-07-02 04:05:53', NULL, 'Admin', '08:59:00', '12:00:00', '13:00:00', '17:11:00'),
(210, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-07-02', '09:00:26', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'ni try kug request late gahapon pero ga bug dili magpa edit ang time out sa afternoon 😓', 'approved', '2025-07-03 00:57:55', NULL, 'Admin', '09:00:26', '12:00:00', '00:00:00', '00:00:00'),
(211, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-03', '00:00:00', '00:00:00', '12:41:00', '00:00:00', NULL, NULL, 'Time-in afternoon duty: due to stomach ache', 'approved', '2025-07-03 04:43:03', NULL, 'Admin', '00:00:00', '00:00:00', '00:00:00', '00:00:00'),
(212, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-07-03', '09:19:00', '12:02:00', '13:00:00', '00:00:00', NULL, NULL, 'Bug Time In afternoon', 'approved', '2025-07-03 05:09:09', NULL, 'Admin', '09:19:00', '12:02:00', '00:00:00', '00:00:00'),
(213, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-07-02', '09:02:00', '12:00:00', '13:00:00', '18:10:00', NULL, NULL, 'nag bug', 'approved', '2025-07-03 10:02:31', NULL, 'Admin', '09:02:00', '12:00:00', '13:00:00', '00:00:00'),
(214, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-04', '09:13:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Late request am In', 'approved', '2025-07-04 03:54:55', NULL, 'Admin', '11:53:52', '00:00:00', '00:00:00', '00:00:00'),
(215, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-07-04', '09:38:50', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Bug clock am out', 'approved', '2025-07-04 04:59:03', NULL, 'Admin', '09:38:50', '00:00:00', '00:00:00', '00:00:00'),
(216, 'CJIS-2025-0033', 'Jasper  Perote', '2025-07-04', '09:08:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Can\'t time out morning, automatically time in afternoon', 'approved', '2025-07-04 05:22:54', NULL, 'Admin', '09:08:00', '00:00:00', '12:12:00', '18:04:00'),
(217, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-07-04', '08:38:00', '12:03:00', '13:01:00', '00:00:00', NULL, NULL, 'Bugs', 'approved', '2025-07-04 10:03:29', NULL, 'Admin', '08:38:00', '12:03:00', '00:00:00', '00:00:00'),
(218, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-04', '08:57:00', '12:02:00', '13:00:00', '18:04:00', NULL, NULL, 'System error/bug: dili maka time in sa afternoon og sa late request dili maka select sa timeout', 'approved', '2025-07-04 10:05:43', NULL, 'Admin', '08:57:00', '12:02:00', '13:12:00', '18:04:00'),
(219, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-04', '09:03:00', '12:02:00', '01:00:00', '06:00:00', NULL, NULL, 'Nag bug ang hris', 'rejected', '2025-07-05 01:08:39', NULL, 'Admin', '09:03:00', '12:02:00', '00:00:00', '00:00:00'),
(220, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-07-05', '09:30:00', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'test and late time In Am', 'approved', '2025-07-05 04:32:52', NULL, 'Admin', NULL, NULL, NULL, NULL),
(221, 'CJIS-2025-0033', 'Jasper  Perote', '2025-07-04', '09:08:00', '12:00:00', '13:00:00', '18:08:00', NULL, NULL, 'No timeout afternoon reflect', 'approved', '2025-07-05 04:38:57', NULL, 'Admin', '09:08:00', '12:00:00', '13:00:00', '00:00:00'),
(222, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-04', '09:03:00', '12:02:00', '13:00:00', '18:00:00', NULL, NULL, 'nag bug ang hris', 'approved', '2025-07-05 05:00:55', NULL, 'Admin', '09:03:00', '12:02:00', '00:00:00', '00:00:00'),
(223, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-05', '09:02:00', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'late time in', 'approved', '2025-07-05 05:08:02', NULL, 'Admin', '09:02:00', '12:00:00', '13:08:00', '00:00:00'),
(224, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-05', '09:04:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'gisugo ko ni ricardo', 'approved', '2025-07-05 05:11:22', NULL, 'Admin', '09:04:00', '12:00:00', '00:00:00', '00:00:00'),
(225, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-05', '09:02:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'late time in', 'approved', '2025-07-05 05:22:44', NULL, 'Admin', '09:02:00', '12:00:00', '00:00:00', '00:00:00'),
(226, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-01', '08:59:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'bug', 'approved', '2025-07-05 05:32:39', NULL, 'Admin', '08:59:00', '12:00:00', '13:00:00', '17:11:00'),
(227, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-07-05', '09:01:00', '12:00:00', '13:00:00', '18:25:00', NULL, NULL, 'phone glitched pag time out ', 'approved', '2025-07-05 10:50:57', NULL, 'Admin', '09:01:00', '12:00:00', '13:00:00', '00:00:00'),
(228, 'CJIS-2025-0002', 'Alan Tumulak Ang', '2025-07-07', '09:04:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Timing in from another country with different time zone. Test only', 'approved', '2025-07-07 01:05:19', NULL, 'Admin', NULL, NULL, NULL, NULL),
(229, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-05', '09:15:00', '12:01:00', '13:00:00', '18:00:00', NULL, NULL, 'System bug: Naka clock out ko 6:00pm atung Saturday last week karun pag check nako na wala', 'approved', '2025-07-07 05:24:45', NULL, 'Admin', '09:15:00', '12:01:00', '13:00:00', '00:00:00'),
(230, 'CJIS-2025-0002', 'Alan Tumulak Ang', '2025-07-08', '09:44:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Time Zone Difference', 'approved', '2025-07-08 00:45:25', NULL, 'Admin', NULL, NULL, NULL, NULL),
(231, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-07-07', '09:00:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Test', 'rejected', '2025-07-08 00:55:33', NULL, 'Admin', NULL, NULL, NULL, NULL),
(232, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-07-07', '09:00:17', '12:00:00', '13:00:00', '18:15:00', NULL, NULL, 'Good Day, pa request ko sir kay murag nag bug kay nag clock in and clock out ko gahapon pero wala ni reflect 🥲', 'approved', '2025-07-08 01:09:09', NULL, 'Admin', '09:00:17', '00:00:00', '00:00:00', '00:00:00'),
(233, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-08', '09:20:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Forgot', 'approved', '2025-07-08 01:54:22', NULL, 'Admin', NULL, NULL, NULL, NULL),
(234, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-08', '08:56:00', '12:06:00', '13:00:00', '00:00:00', NULL, NULL, 'Forgot to time in', 'approved', '2025-07-08 05:53:56', NULL, 'Admin', '08:56:00', '12:06:00', '13:06:00', '00:00:00'),
(235, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-05', '09:13:00', '12:01:00', '13:00:00', '18:00:00', NULL, NULL, 'Time adjust accordingly to viber time in', 'approved', '2025-07-08 08:15:14', NULL, 'Admin', '09:15:00', '12:01:00', '13:00:00', '18:00:00'),
(236, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-08', '08:59:00', '12:06:00', '13:00:00', '18:03:00', NULL, NULL, 'Debug', 'approved', '2025-07-08 08:43:25', NULL, 'Admin', '09:03:00', '12:06:00', '13:06:00', '18:03:00'),
(237, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-07', '09:00:00', '12:12:00', '13:00:00', '06:00:00', NULL, NULL, 'wala naka time out sa hapon', 'approved', '2025-07-09 01:08:37', NULL, 'Admin', '09:00:00', '12:12:00', '13:00:00', '00:00:00'),
(238, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-07-09', '09:08:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Server Error. Am time In', 'approved', '2025-07-09 01:23:53', NULL, 'Admin', NULL, NULL, NULL, NULL),
(239, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-07-09', '08:58:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'server error, wala ka time in', 'approved', '2025-07-09 01:26:20', NULL, 'Admin', '09:11:01', '00:00:00', '00:00:00', '00:00:00'),
(240, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-09', '08:59:00', '12:06:00', '13:00:00', '18:05:00', NULL, NULL, 'Morning time in late because nag down down ang server, pabayo ko ato nag time in ni ingon ang dev na nag down daw server. Afternoon time out na wala I don\'t know why pero naka time out ko ato gabie system bug', 'approved', '2025-07-10 01:20:34', NULL, 'Admin', '09:44:00', '12:06:00', '13:00:00', '00:00:00'),
(241, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-07-10', '00:00:00', '12:17:00', '00:00:00', '00:00:00', NULL, NULL, 'Nkalimot ug out', 'approved', '2025-07-10 04:54:41', NULL, 'Admin', '10:21:00', '12:00:00', '13:06:00', '18:01:00'),
(242, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-10', '09:18:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Sorry na limtan clockout 6pm ayha pa na dumdum naka sakay nag motor', 'approved', '2025-07-10 10:33:20', NULL, 'Admin', '09:18:00', '12:00:00', '13:00:00', '00:00:00'),
(243, 'CJIS-2025-0033', 'Jasper  Perote', '2025-07-10', '09:03:00', '12:03:00', '13:00:00', '18:03:00', NULL, NULL, 'Forgot to timeout', 'approved', '2025-07-11 01:03:23', NULL, 'Admin', '09:03:00', '12:03:00', '13:00:00', '00:00:00'),
(244, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-09', '09:07:00', '12:01:00', '13:00:00', '18:04:00', NULL, NULL, 'Nakalimot og time out sa hapon', 'approved', '2025-07-11 01:04:46', NULL, 'Admin', '09:07:00', '12:01:00', '13:00:00', '00:00:00'),
(245, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-07', '09:00:00', '12:12:00', '13:00:00', '18:00:00', NULL, NULL, 'Naay mali pag time sa hapon, instead PM, AM ang nireflect', 'approved', '2025-07-11 01:05:50', NULL, 'Admin', '09:00:00', '12:12:00', '13:00:00', '06:00:00'),
(246, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-10', '00:00:00', '00:00:00', '12:48:11', '06:00:00', NULL, NULL, 'Nakalimot og time in sa hapon', 'approved', '2025-07-11 01:06:13', NULL, 'Admin', '00:00:00', '00:00:00', '12:48:11', '00:00:00'),
(247, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-07-10', '09:11:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Server Error late Time In PM ', 'approved', '2025-07-11 01:21:21', NULL, 'Admin', NULL, NULL, NULL, NULL),
(248, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-07-11', '09:10:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'server Error Late Time In AM', 'approved', '2025-07-11 01:22:08', NULL, 'Admin', NULL, NULL, NULL, NULL),
(249, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-10', '00:00:00', '00:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Instead of PM, AM ni reflect', 'approved', '2025-07-11 04:05:06', NULL, 'Admin', '00:00:00', '00:00:00', '13:00:00', '06:00:00'),
(250, 'CJIS-2025-0022', 'Louis Gio  Noval', '2025-07-11', '09:00:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'walay network, gi configure', 'approved', '2025-07-11 05:07:04', NULL, 'Admin', '09:00:00', '12:00:00', '00:00:00', '00:00:00'),
(251, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-12', '09:05:00', '12:00:00', '13:00:00', '16:00:00', NULL, NULL, 'Forgot to time in and time out pm', 'approved', '2025-07-12 08:08:15', NULL, 'Admin', '09:05:00', '12:00:00', '00:00:00', '00:00:00'),
(252, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-03', '09:08:35', '13:00:33', '13:00:00', '18:00:00', NULL, NULL, 'Time adjust ', 'approved', '2025-07-15 01:31:27', NULL, 'Admin', '09:08:35', '13:00:33', '13:00:40', '00:00:00'),
(253, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-07', '00:00:00', '00:00:00', '12:38:22', '06:00:00', NULL, NULL, 'Forgot to time out', 'approved', '2025-07-15 01:32:03', NULL, 'Admin', '00:00:00', '00:00:00', '12:38:22', '00:00:00'),
(254, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-09', '09:04:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Forgot to timeout ', 'approved', '2025-07-15 01:32:27', NULL, 'Admin', '09:04:00', '00:00:00', '13:00:00', '18:00:00'),
(255, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-06-30', '09:17:00', '12:07:00', '13:13:00', '18:17:00', NULL, NULL, 'Forgot time in time out', 'approved', '2025-07-15 02:21:34', NULL, 'Admin', NULL, NULL, NULL, NULL),
(256, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-07-15', '00:00:00', '12:15:00', '00:00:00', '00:00:00', NULL, NULL, 'Dli mkalogin', 'approved', '2025-07-15 05:46:51', NULL, 'Admin', '08:33:00', '00:00:00', '13:28:00', '00:00:00'),
(257, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-15', '09:00:26', '12:01:00', '13:01:00', '00:00:00', NULL, NULL, 'Nakalimot kog time out sa udto, nabusy og disassemble sa printer ', 'approved', '2025-07-15 10:02:33', NULL, 'Admin', '09:00:26', '00:00:00', '00:00:00', '00:00:00'),
(258, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-07-15', '08:33:00', '12:15:00', '13:05:00', '00:00:00', NULL, NULL, 'Dli ko ka login ganiha', 'approved', '2025-07-15 10:07:07', NULL, 'Admin', '00:00:00', '12:15:00', '00:00:00', '00:00:00'),
(259, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-15', '09:13:00', '12:01:00', '13:00:00', '18:33:00', NULL, NULL, 'Overtime ', 'approved', '2025-07-15 10:33:14', NULL, 'Admin', '09:13:00', '12:01:00', '13:00:00', '00:00:00'),
(260, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-16', '08:53:14', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Forgot', 'approved', '2025-07-16 05:41:30', NULL, 'Admin', '08:53:14', '00:00:00', '00:00:00', '00:00:00'),
(261, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-07-16', '09:07:00', '12:00:00', '13:00:00', '18:02:00', NULL, NULL, 'Test deduction', 'approved', '2025-07-16 10:03:09', NULL, 'Admin', '09:07:00', '12:10:00', '13:00:00', '18:02:00'),
(262, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-07-16', '09:00:00', '12:02:00', '13:00:00', '18:00:00', NULL, NULL, 'Forgot to time out 🥲', 'approved', '2025-07-17 04:01:30', NULL, 'Admin', '09:00:00', '12:02:00', '13:00:00', '00:00:00'),
(263, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-07-17', '09:03:00', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Server error', 'approved', '2025-07-17 04:03:05', NULL, 'Admin', NULL, NULL, NULL, NULL),
(264, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-15', '09:00:00', '12:01:00', '13:00:00', '18:00:00', NULL, NULL, 'Wala naka time out sa hapon', 'approved', '2025-07-18 01:27:17', NULL, 'Admin', '09:00:00', '12:01:00', '13:00:00', '00:00:00'),
(265, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-16', '09:03:00', '12:00:00', '13:00:00', '06:00:00', NULL, NULL, 'Wala naka time out sa hapon', 'approved', '2025-07-18 01:27:34', NULL, 'Admin', '09:03:00', '12:00:00', '13:00:00', '00:00:00'),
(266, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-18', '09:05:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Nakalimot og time in ', 'approved', '2025-07-18 01:27:50', NULL, 'Admin', NULL, NULL, NULL, NULL),
(267, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-16', '09:03:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'AM akong na tuplok, dili PM', 'approved', '2025-07-18 04:01:21', NULL, 'Admin', '09:03:00', '12:00:00', '13:00:00', '06:00:00'),
(268, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-18', '09:03:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Late time in and out', 'rejected', '2025-07-18 05:17:15', NULL, 'Admin', NULL, NULL, NULL, NULL),
(269, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-18', '09:03:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Late time in', 'approved', '2025-07-18 09:16:25', NULL, 'Admin', '09:03:00', '12:00:00', '00:00:00', '00:00:00'),
(270, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-19', '08:53:44', '12:30:00', '13:00:00', '00:00:00', NULL, NULL, 'Forgot ', 'approved', '2025-07-19 04:31:04', NULL, 'Admin', '08:53:44', '00:00:00', '00:00:00', '00:00:00'),
(271, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-19', '08:58:29', '12:32:00', '00:00:00', '00:00:00', NULL, NULL, 'Dili ma maka time out 12:30 wala ka timeout kay naa customer ge entertain', 'approved', '2025-07-19 04:34:49', NULL, 'Admin', '08:58:00', '00:00:00', '13:10:00', '18:14:00'),
(272, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-17', '08:59:00', '12:01:00', '13:00:00', '18:00:00', NULL, NULL, 'Wala ko ka remember kung naka time out sorry po but last day to ni Gio ako nag kuha yabi sa pabayo og nag dungan mi out mga 6:30pm to. ', 'approved', '2025-07-19 04:44:26', NULL, 'Admin', '08:59:00', '12:01:00', '13:00:00', '00:00:00'),
(273, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-18', '09:05:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Nakalimot og time in sa hapon', 'approved', '2025-07-19 05:02:14', NULL, 'Admin', '09:05:00', '12:00:00', '00:00:00', '00:00:00'),
(274, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-19', '21:04:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Nakalimot og time in morning', 'approved', '2025-07-19 05:02:46', NULL, 'Admin', '00:00:00', '00:00:00', '13:00:00', '18:03:00'),
(275, 'CJIS-2025-0033', 'Jasper  Perote', '2025-07-19', '09:05:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Forgot to timeout afternoon', 'approved', '2025-07-19 13:52:27', NULL, 'Admin', '09:05:00', '12:00:00', '13:00:00', '00:00:00'),
(276, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-19', '21:04:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Nakalimot og time out sa hapon', 'approved', '2025-07-21 05:09:13', NULL, 'Admin', '21:04:00', '12:00:00', '13:00:00', '00:00:00'),
(277, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-07-18', '09:00:00', '12:01:00', '13:00:00', '18:00:00', NULL, NULL, 'Pa edit ko sa out nako ani na date sir, wala ko kabalo nganong wala na record akong out.', 'approved', '2025-07-21 10:02:33', NULL, 'Admin', '09:00:00', '12:01:00', '13:00:00', '00:00:00'),
(278, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-19', '08:58:00', '12:32:00', '13:00:00', '18:20:00', NULL, NULL, 'Na wala akoa afternoon clock in og clock out', 'approved', '2025-07-21 10:20:15', NULL, 'Admin', '08:58:00', '12:32:00', '00:00:00', '00:00:00'),
(279, 'CJIS-2025-0033', 'Jasper  Perote', '2025-07-21', '09:00:00', '12:00:00', '13:00:00', '18:05:00', NULL, NULL, 'Can\'t timeout afternoon due to forgotten timeout at morning', 'approved', '2025-07-21 14:57:12', NULL, 'Admin', '09:00:00', '00:00:00', '13:00:00', '00:00:00'),
(280, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-07-22', '08:59:00', '12:00:00', '13:00:00', '18:13:00', NULL, NULL, 'Nag time out ko ani sir, wala japun na record naa rako sa Lapasan ga Lunch 😭', 'approved', '2025-07-22 11:17:16', NULL, 'Admin', '08:59:00', '00:00:00', '13:00:00', '18:13:00'),
(281, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-22', '09:05:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Forgot to time out', 'approved', '2025-07-23 01:10:39', NULL, 'Admin', '09:05:00', '12:00:00', '13:00:00', '00:00:00'),
(282, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-19', '08:53:00', '12:30:00', '13:00:00', '18:00:00', NULL, NULL, 'Forgot', 'approved', '2025-07-23 04:05:38', NULL, 'Admin', '08:53:00', '12:30:00', '13:00:00', '00:00:00'),
(283, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-18', '08:57:00', '12:00:00', '13:00:00', '18:10:00', NULL, NULL, 'Forgot', 'approved', '2025-07-23 04:06:13', NULL, 'Admin', '08:57:00', '00:00:00', '13:00:00', '18:10:00'),
(284, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-22', '09:01:00', '12:08:00', '13:00:00', '18:00:00', NULL, NULL, 'Nakalimot og time out', 'approved', '2025-07-23 05:01:05', NULL, 'Admin', '09:01:00', '12:08:00', '13:00:00', '00:00:00'),
(285, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-21', '09:04:00', '12:04:00', '13:01:00', '18:00:00', NULL, NULL, 'Nakalimot og timein sa hapon', 'approved', '2025-07-23 05:01:23', NULL, 'Admin', '09:04:00', '12:04:00', '00:00:00', '00:00:00'),
(286, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-19', '09:04:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, '0', 'approved', '2025-07-23 05:01:49', NULL, 'Admin', '21:04:00', '12:00:00', '13:00:00', '18:00:00'),
(287, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-24', '08:59:13', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Forgot ', 'approved', '2025-07-24 04:50:15', NULL, 'Admin', '08:59:00', '00:00:00', '13:00:00', '00:00:00'),
(288, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-23', '09:06:00', '12:04:00', '13:00:00', '18:00:00', NULL, NULL, 'Nakalimot og timeout', 'approved', '2025-07-24 05:00:44', NULL, 'Admin', '09:06:00', '12:04:00', '13:00:00', '00:00:00'),
(289, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-24', '08:59:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Time out', 'approved', '2025-07-24 10:01:49', NULL, 'Admin', '08:59:00', '12:00:00', '00:00:00', '00:00:00'),
(290, 'CJIS-2025-0033', 'Jasper  Perote', '2025-07-24', '09:05:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Cant time out due to have customer inquiry during lunchbreak', 'approved', '2025-07-24 10:09:43', NULL, 'Admin', '09:05:00', '00:00:00', '13:00:00', '18:00:00');
INSERT INTO `late_attendance_requests` (`request_id`, `employee_id`, `employee_name`, `attendance_date`, `requested_time_in_morning`, `requested_time_out_morning`, `requested_time_in_afternoon`, `requested_time_out_afternoon`, `work_time_id`, `schedule_id`, `reason`, `status`, `requested_at`, `reviewed_at`, `reviewed_by`, `original_time_in_morning`, `original_time_out_morning`, `original_time_in_afternoon`, `original_time_out_afternoon`) VALUES
(291, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-07-24', '08:59:00', '12:01:00', '13:00:00', '18:05:00', NULL, NULL, 'Parequest sir nalimtan nasad time out, naay reference sa Admin group unsa oras among time out thankyouu', 'approved', '2025-07-24 10:35:47', NULL, 'Admin', '08:59:00', '12:01:00', '13:00:00', '00:00:00'),
(292, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-25', '08:46:00', '12:00:00', '13:00:00', '18:01:00', NULL, NULL, 'Waka ka clock out during lunch po', 'approved', '2025-07-25 10:02:12', NULL, 'Admin', '08:46:00', '00:00:00', '13:00:00', '18:01:00'),
(293, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-25', '09:04:00', '12:00:00', '13:00:00', '18:02:00', NULL, NULL, 'Forgot to time out at 12pm', 'approved', '2025-07-25 14:52:42', NULL, 'Admin', '09:04:00', '00:00:00', '13:00:00', '18:02:00'),
(294, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-24', '08:59:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Forgot to timeout', 'approved', '2025-07-28 01:52:50', NULL, 'Admin', '08:59:00', '12:00:00', '13:00:00', '00:00:00'),
(295, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-24', '08:57:00', '12:04:00', '13:00:00', '18:00:00', NULL, NULL, 'Nakalimot og time out', 'approved', '2025-07-28 02:14:53', NULL, 'Admin', '08:57:00', '12:04:00', '13:00:00', '00:00:00'),
(296, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-25', '08:59:52', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Nakalimot both time out morning, time in and out sa hapon', 'approved', '2025-07-28 02:15:49', NULL, 'Admin', '08:59:52', '00:00:00', '00:00:00', '00:00:00'),
(297, 'CJIS-2025-0028', 'Mark   Busbus', '2025-07-26', '08:57:05', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Nakalimot og time out morning, time in & out sa hapon', 'approved', '2025-07-28 02:16:41', NULL, 'Admin', '08:57:05', '00:00:00', '00:00:00', '00:00:00'),
(298, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-26', '09:19:00', '12:25:00', '13:00:00', '07:05:00', NULL, NULL, 'For some reason dili nako ma click ang afternoon time out na pane naka indicate siya as red at that time. Nag request time ko ato kay 7pm na dili nako ka clock out kay nag hulat ko kang Mark sa yabi sa pabayo po', 'approved', '2025-07-28 02:17:24', NULL, 'Admin', '09:19:00', '12:25:00', '13:00:00', '00:00:00'),
(299, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-28', '08:58:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Forgot time out 12pm', 'approved', '2025-07-28 05:03:21', NULL, 'Admin', '08:58:00', '00:00:00', '13:00:00', '18:05:00'),
(300, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-30', '09:04:00', '12:01:00', '13:00:00', '00:00:00', NULL, NULL, 'Forgot to time in at 1pm', 'rejected', '2025-07-30 05:09:10', NULL, 'Admin', NULL, NULL, NULL, NULL),
(301, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-30', '09:06:00', '12:34:00', '13:00:00', '18:25:00', NULL, NULL, 'Wla ko ka clock out morning po kay na busy atiman sa mga calls og inquiries', 'approved', '2025-07-30 10:26:20', NULL, 'Admin', '09:06:00', '00:00:00', '13:00:00', '18:25:00'),
(302, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-28', '08:50:28', '00:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Forgot', 'approved', '2025-07-31 01:28:10', NULL, 'Admin', '08:50:28', '00:00:00', '00:00:00', '00:00:00'),
(303, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-29', '08:45:00', '12:00:00', '13:00:00', '18:07:00', NULL, NULL, 'Forgot', 'approved', '2025-07-31 01:28:41', NULL, 'Admin', '08:45:00', '00:00:00', '13:00:00', '18:07:00'),
(304, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-30', '09:00:00', '12:00:00', '13:08:00', '18:21:00', NULL, NULL, 'Forgot', 'approved', '2025-07-31 01:28:51', NULL, 'Admin', '09:00:00', '00:00:00', '13:08:00', '18:21:00'),
(305, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-26', '09:19:00', '12:25:00', '13:00:00', '19:05:00', NULL, NULL, 'Change 7:05 AM to PM po', 'approved', '2025-07-31 05:07:34', NULL, 'Admin', '09:19:00', '12:25:00', '13:00:00', '07:05:00'),
(306, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-07-31', '09:05:35', '12:04:00', '13:30:00', '00:00:00', NULL, NULL, 'Forgot ', 'approved', '2025-07-31 10:05:19', NULL, 'Admin', '09:05:35', '00:00:00', '00:00:00', '00:00:00'),
(307, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-31', '09:06:00', '12:01:00', '13:00:00', '00:00:00', NULL, NULL, 'Sorry po na limtan time in sa afternoon og dili nako ma apil pud ang time out 6:00pm today (7/31/2025) dili siya green naka red', 'approved', '2025-07-31 10:16:05', NULL, 'Admin', '09:06:00', '12:01:00', '00:00:00', '00:00:00'),
(308, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-08-01', '09:09:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'bug capcha', 'approved', '2025-08-01 01:13:03', NULL, 'Admin', NULL, NULL, NULL, NULL),
(309, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-28', '08:58:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Forgot time out', 'approved', '2025-08-01 03:41:31', NULL, 'Admin', '08:58:00', '12:00:00', '13:00:00', '00:00:00'),
(310, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-07-30', '09:04:00', '12:01:00', '13:00:00', '18:04:00', NULL, NULL, 'Forgot to time in due to entertaining customer', 'approved', '2025-08-01 03:44:03', NULL, 'Admin', '09:04:00', '12:01:00', '13:08:00', '18:04:00'),
(311, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-28', '08:50:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-08-01 04:23:48', NULL, 'Admin', '08:50:00', '00:00:00', '13:00:00', '18:00:00'),
(312, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-07-31', '08:48:49', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-08-01 04:25:00', NULL, 'Admin', '08:48:49', '00:00:00', '00:00:00', '00:00:00'),
(313, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-07-31', '09:06:00', '12:01:00', '13:00:00', '18:04:00', NULL, NULL, 'Wala naka clock out afternoon kay wala ko ka clock in sa afternoon', 'approved', '2025-08-02 01:54:42', NULL, 'Admin', '09:06:00', '12:01:00', '13:00:00', '00:00:00'),
(314, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-08-02', '09:04:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Dugay naka clock in po sorry pero ni abot ko 9:04.', 'approved', '2025-08-02 02:12:47', NULL, 'Admin', '09:21:38', '00:00:00', '00:00:00', '00:00:00'),
(315, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-02', '00:00:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Lunch bteak', 'rejected', '2025-08-02 03:58:09', NULL, 'Admin', NULL, NULL, NULL, NULL),
(316, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-08-02', '08:52:38', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-08-02 05:00:51', NULL, 'Admin', '08:52:38', '00:00:00', '00:00:00', '00:00:00'),
(317, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-04', '21:46:00', '12:02:00', '00:00:00', '00:00:00', NULL, NULL, 'Update in/out morning', 'approved', '2025-08-04 04:03:24', NULL, 'Admin', '00:00:00', '00:00:00', '13:00:00', '18:05:00'),
(318, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-08-05', '09:13:00', '12:05:00', '13:00:00', '18:05:00', NULL, NULL, 'Wala ka clock in og clock out during seminar gahapon', 'approved', '2025-08-05 10:01:51', NULL, 'Admin', '09:13:00', '12:05:00', '00:00:00', '00:00:00'),
(319, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-05', '09:15:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, '1001 nights hotel', 'approved', '2025-08-05 10:05:45', NULL, 'Admin', NULL, NULL, NULL, NULL),
(320, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-08-04', '09:35:07', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-08-06 04:13:39', NULL, 'Admin', '09:35:07', '00:00:00', '00:00:00', '00:00:00'),
(321, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-08-05', '08:59:19', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-08-06 04:14:01', NULL, 'Admin', '08:59:19', '00:00:00', '00:00:00', '00:00:00'),
(322, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-08-06', '09:05:00', '12:01:00', '13:00:00', '18:00:00', NULL, NULL, 'Wala ka time out morning sorry po', 'approved', '2025-08-06 04:34:23', NULL, 'Admin', '09:05:00', '00:00:00', '13:00:00', '18:00:00'),
(323, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-06', '21:58:00', '12:01:00', '13:33:00', '18:02:00', NULL, NULL, 'Updated time', 'approved', '2025-08-06 10:00:16', NULL, 'Admin', NULL, NULL, NULL, NULL),
(324, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '2025-08-07', '09:02:21', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Forgot to time in and out on August 7 2025', 'approved', '2025-08-07 11:07:46', NULL, 'Admin', '09:02:21', '00:00:00', '00:00:00', '00:00:00'),
(325, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-02', '08:58:21', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Nakalimot og time out', 'approved', '2025-08-09 05:22:18', NULL, 'Admin', '08:58:21', '00:00:00', '00:00:00', '00:00:00'),
(326, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-05', '09:10:29', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Nakalimot og time in/out', 'approved', '2025-08-09 05:23:09', NULL, 'Admin', '09:10:29', '00:00:00', '00:00:00', '00:00:00'),
(327, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-06', '08:59:07', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Nakalimot og time in/out', 'approved', '2025-08-09 05:23:36', NULL, 'Admin', '08:59:07', '00:00:00', '00:00:00', '00:00:00'),
(328, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-07', '08:59:00', '12:01:00', '13:00:00', '18:00:00', NULL, NULL, 'Nakalimot og time out', 'approved', '2025-08-09 05:23:57', NULL, 'Admin', '08:59:00', '12:01:00', '13:00:00', '00:00:00'),
(329, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-08', '09:01:38', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Nakalimot og time in/out', 'approved', '2025-08-09 05:24:24', NULL, 'Admin', '09:01:38', '00:00:00', '00:00:00', '00:00:00'),
(330, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-08-07', '09:05:44', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-08-11 02:02:10', NULL, 'Admin', '09:05:44', '00:00:00', '00:00:00', '00:00:00'),
(331, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-08-08', '08:35:00', '12:00:00', '13:00:00', '18:12:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-08-11 02:10:39', NULL, 'Admin', '08:35:00', '00:00:00', '13:00:00', '18:12:00'),
(332, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-11', '09:45:00', '00:18:00', '00:00:00', '00:00:00', NULL, NULL, 'Late update', 'approved', '2025-08-11 04:14:54', NULL, 'Admin', NULL, NULL, NULL, NULL),
(333, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-08-11', '09:00:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-08-11 05:00:33', NULL, 'Admin', '09:00:00', '00:00:00', '13:00:00', '18:00:00'),
(334, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-08-13', '09:25:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Invalid log in \n', 'approved', '2025-08-13 01:34:25', NULL, 'Admin', NULL, NULL, NULL, NULL),
(335, 'CJIS-2025-0033', 'Jasper  Perote', '2025-08-12', '09:01:00', '12:10:00', '13:00:00', '14:30:00', NULL, NULL, 'Early out, Need sleep because of 24chicken work', 'approved', '2025-08-13 03:56:45', NULL, 'Admin', '09:01:00', '12:10:00', '13:00:00', '00:00:00'),
(336, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-08-13', '09:25:00', '12:09:00', '13:00:00', '00:00:00', NULL, NULL, 'Server error forgot time in 1pm ', 'approved', '2025-08-13 10:01:13', NULL, 'Admin', '09:25:00', '12:09:00', '00:00:00', '00:00:00'),
(337, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-09', '00:00:00', '00:00:00', '13:21:32', '18:00:00', NULL, NULL, 'nakalimot kog time out', 'approved', '2025-08-14 02:20:14', NULL, 'Admin', '00:00:00', '00:00:00', '13:21:32', '00:00:00'),
(338, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-11', '08:58:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'nakalimot og time out', 'approved', '2025-08-14 02:20:30', NULL, 'Admin', '08:58:00', '12:00:00', '13:00:00', '00:00:00'),
(339, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-12', '08:56:00', '12:10:00', '13:00:00', '18:00:00', NULL, NULL, 'nakalimot og time in/out', 'approved', '2025-08-14 02:21:02', NULL, 'Admin', '08:56:00', '12:10:00', '00:00:00', '00:00:00'),
(340, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-01', '09:18:00', '12:06:00', '01:45:00', '06:04:00', NULL, NULL, 'Updated att. thru viber', 'rejected', '2025-08-14 02:41:24', NULL, 'Admin', NULL, NULL, NULL, NULL),
(341, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-02', '10:08:00', '00:05:00', '01:43:00', '06:05:00', NULL, NULL, 'Updated att. thru viber', 'rejected', '2025-08-14 02:45:38', NULL, 'Admin', NULL, NULL, NULL, NULL),
(342, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-04', '21:46:00', '12:02:00', '01:00:00', '18:10:00', NULL, NULL, 'Updated att. Thru viber', 'rejected', '2025-08-14 02:47:29', NULL, 'Admin', NULL, NULL, NULL, NULL),
(343, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-05', '09:15:00', '12:00:00', '13:00:00', '06:00:00', NULL, NULL, 'Updated att\n Thru viber', 'approved', '2025-08-14 02:49:02', NULL, 'Admin', '09:15:00', '12:00:00', '13:00:00', '00:00:00'),
(344, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-07', '09:17:48', '00:00:00', '01:00:00', '06:00:00', NULL, NULL, 'Updated att. Thru viber ', 'rejected', '2025-08-14 03:02:44', NULL, 'Admin', NULL, NULL, NULL, NULL),
(345, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-08', '09:40:00', '00:00:00', '01:00:00', '06:00:00', NULL, NULL, 'Updated att thru viber', 'rejected', '2025-08-14 03:11:59', NULL, 'Admin', NULL, NULL, NULL, NULL),
(346, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-09', '09:30:00', '00:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Updated att thru viber', 'approved', '2025-08-14 03:14:28', NULL, 'Admin', NULL, NULL, NULL, NULL),
(347, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-11', '09:45:00', '00:18:00', '01:00:00', '06:10:00', NULL, NULL, 'Updated att thru viber', 'rejected', '2025-08-14 03:15:51', NULL, 'Admin', NULL, NULL, NULL, NULL),
(348, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-13', '09:42:00', '00:00:00', '01:00:00', '06:00:00', NULL, NULL, 'Updated att.thru viber ', 'rejected', '2025-08-14 03:18:05', NULL, 'Admin', NULL, NULL, NULL, NULL),
(349, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-08-14', '09:32:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Update att', 'rejected', '2025-08-14 03:19:08', NULL, 'Admin', NULL, NULL, NULL, NULL),
(350, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-14', '09:03:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'nakalimot og time out', 'approved', '2025-08-14 05:00:47', NULL, 'Admin', '09:03:00', '00:00:00', '13:00:00', '00:00:00'),
(351, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-08-14', '09:21:00', '12:00:00', '13:00:00', '18:13:00', NULL, NULL, 'Busy Entertain Customer', 'approved', '2025-08-15 01:25:32', NULL, 'Admin', '09:21:00', '00:00:00', '13:00:00', '18:13:00'),
(352, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-08-15', '09:17:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Server error failure to time in', 'approved', '2025-08-15 01:27:48', NULL, 'Admin', NULL, NULL, NULL, NULL),
(353, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-08-16', '09:37:00', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'No Internet. Meeting with sir alan and failed to time In morning', 'approved', '2025-08-16 03:54:22', NULL, 'Admin', NULL, NULL, NULL, NULL),
(354, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-16', '09:04:00', '12:14:00', '13:00:00', '00:00:00', NULL, NULL, 'nakalimot kog time in', 'approved', '2025-08-16 09:00:35', NULL, 'Admin', '09:04:00', '12:14:00', '00:00:00', '00:00:00'),
(355, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-15', '08:55:43', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'nakalimot og time in/out', 'approved', '2025-08-16 09:01:06', NULL, 'Admin', '08:55:43', '00:00:00', '00:00:00', '00:00:00'),
(356, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-08-16', '09:37:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Server error failed to time in pm', 'approved', '2025-08-16 10:01:18', NULL, 'Admin', '09:37:00', '12:00:00', '00:00:00', '00:00:00'),
(357, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-08-16', '09:22:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-08-18 01:14:24', NULL, 'Admin', '09:22:00', '12:00:00', '00:00:00', '00:00:00'),
(358, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-08-18', '08:32:00', '12:01:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-08-19 04:01:54', NULL, 'Admin', '08:32:00', '12:01:00', '00:00:00', '00:00:00'),
(359, 'CJIS-2025-0041', 'Aaron  Cordova', '2025-08-19', '09:59:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'New employee', 'approved', '2025-08-19 04:56:27', NULL, 'Admin', '00:00:00', '00:00:00', '13:00:00', '00:00:00'),
(360, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-08-19', '09:04:00', '12:08:00', '13:01:00', '00:00:00', NULL, NULL, 'Sorry na limtan time in kay na busy build pc ayha pa na ka huna na wala pa diay ka time in sa afternoon.', 'approved', '2025-08-19 08:13:27', NULL, 'Admin', '09:04:00', '12:08:00', '00:00:00', '00:00:00'),
(361, 'CJIS-2025-0041', 'Aaron  Cordova', '2025-08-20', '09:02:00', '12:02:00', '12:52:00', '00:00:00', NULL, NULL, 'New employee ', 'approved', '2025-08-20 01:04:20', NULL, 'Admin', '09:04:01', '00:00:00', '00:00:00', '00:00:00'),
(362, 'CJIS-2025-0041', 'Aaron  Cordova', '2025-08-20', '09:02:00', '12:02:00', '13:00:00', '18:09:00', NULL, NULL, 'New employee ', 'rejected', '2025-08-20 10:09:49', NULL, 'Admin', NULL, NULL, NULL, NULL),
(363, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-08-20', '08:53:00', '12:00:00', '13:00:00', '18:15:00', NULL, NULL, 'Busy entertain customer.', 'approved', '2025-08-21 01:23:56', NULL, 'Admin', '08:53:00', '00:00:00', '13:00:00', '18:15:00'),
(364, 'CJIS-2025-0041', 'Aaron  Cordova', '2025-08-22', '09:15:00', '12:01:00', '13:00:00', '00:00:00', NULL, NULL, 'New Employee', 'approved', '2025-08-22 01:33:09', NULL, 'Admin', '09:32:00', '00:00:00', '13:00:00', '18:03:00'),
(365, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-08-22', '09:10:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Late time in pm', 'approved', '2025-08-22 09:04:57', NULL, 'Admin', '09:10:00', '12:00:00', '00:00:00', '00:00:00'),
(366, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-08-23', '09:40:46', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Good morning sir sorry na late ko because of financial problem po sir🙏', 'approved', '2025-08-23 01:41:13', NULL, 'Admin', '09:40:00', '12:00:00', '13:00:00', '18:09:00'),
(367, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-08-23', '09:15:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Sorry limtan time out during lunch', 'approved', '2025-08-23 04:58:58', NULL, 'Admin', '09:15:00', '00:00:00', '13:00:00', '18:00:00'),
(368, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-08-25', '09:30:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Good morning sir sorry sa late sir financial problem lang jud kayo this week sir igo2 lang akong nahulam sakong ante pang plete lang po🙏', 'approved', '2025-08-25 01:43:22', NULL, 'Admin', '09:43:00', '12:00:00', '00:00:00', '00:00:00'),
(369, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-08-22', '09:10:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Server error late time out pm', 'approved', '2025-08-25 04:02:50', NULL, 'Admin', '09:10:00', '12:00:00', '13:00:00', '00:00:00'),
(370, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-08-25', '09:10:00', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Server Error fail to time in and out in am', 'approved', '2025-08-25 04:04:58', NULL, 'Admin', NULL, NULL, NULL, NULL),
(371, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-08-25', '09:12:00', '12:00:00', '13:00:00', '18:31:00', NULL, NULL, 'Forgot', 'approved', '2025-08-25 10:31:58', NULL, 'Admin', '09:12:00', '12:00:00', '13:00:00', '00:00:00'),
(372, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-08-25', '09:25:00', '12:00:00', '13:00:00', '18:33:00', NULL, NULL, 'New employee ', 'approved', '2025-08-25 10:33:08', NULL, 'Admin', '09:30:00', '00:00:00', '13:00:00', '00:00:00'),
(373, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-08-23', '09:15:00', '12:00:00', '13:00:00', '18:02:00', NULL, NULL, 'Na wala akoa time out sa afternoon', 'approved', '2025-08-26 00:57:44', NULL, 'Admin', '09:15:00', '12:00:00', '13:00:00', '00:00:00'),
(374, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-08-26', '09:25:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'New employee ', 'approved', '2025-08-26 01:44:07', NULL, 'Admin', NULL, NULL, NULL, NULL),
(375, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-08-26', '09:25:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customers', 'approved', '2025-08-26 04:32:08', NULL, 'Admin', '09:25:00', '00:00:00', '00:00:00', '00:00:00'),
(376, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-08-26', '09:00:00', '12:00:00', '13:00:00', '18:17:00', NULL, NULL, 'Busy entertain customer ', 'approved', '2025-08-27 02:15:51', NULL, 'Admin', '09:00:00', '00:00:00', '13:00:00', '18:17:00'),
(377, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-08-27', '08:59:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Busy entertain customers', 'approved', '2025-08-27 02:16:04', NULL, 'Admin', NULL, NULL, NULL, NULL),
(378, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-08-19', '09:59:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customers', 'approved', '2025-08-27 02:28:58', NULL, 'Admin', '09:59:00', '12:00:00', '13:00:00', '00:00:00'),
(379, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-08-22', '09:15:00', '12:01:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customers', 'approved', '2025-08-27 02:29:30', NULL, 'Admin', '09:15:00', '12:01:00', '13:00:00', '00:00:00'),
(380, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-08-23', '09:40:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customers', 'approved', '2025-08-27 02:30:00', NULL, 'Admin', '09:40:00', '00:00:00', '00:00:00', '00:00:00'),
(381, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-08-27', '10:22:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Special circumstances late due to Parade already approved by sir Alan thank you.', 'rejected', '2025-08-27 03:13:56', NULL, 'Admin', NULL, NULL, NULL, NULL),
(382, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-08-27', '09:04:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Late and traffic', 'approved', '2025-08-27 03:26:52', NULL, 'Admin', '09:44:39', '00:00:00', '00:00:00', '00:00:00'),
(383, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-08-27', '09:00:00', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Special circumstances due to traffic parade already approved by sir Alan', 'approved', '2025-08-27 03:35:08', NULL, 'Admin', NULL, NULL, NULL, NULL),
(384, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-08-27', '09:02:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Late pag fill up sir alan🙏', 'approved', '2025-08-27 05:15:05', NULL, 'Admin', '08:59:00', '00:00:00', '13:15:00', '18:00:00'),
(385, 'CJIS-2025-0033', 'Jasper  Perote', '2025-08-28', '08:31:19', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Brother service training: 8:30am - 5:30pm', 'approved', '2025-08-28 11:56:50', NULL, 'Admin', '08:31:19', '00:00:00', '00:00:00', '00:00:00'),
(386, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-08-28', '09:30:00', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Meeting sa ilang Sir ', 'approved', '2025-08-28 15:37:22', NULL, 'Admin', NULL, NULL, NULL, NULL),
(387, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-08-28', '08:31:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Day 1: Brother Training', 'approved', '2025-08-29 00:28:48', NULL, 'Admin', '08:31:00', '00:00:00', '13:00:00', '00:00:00'),
(388, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-16', '09:04:00', '12:14:00', '13:00:00', '18:01:00', NULL, NULL, '0', 'approved', '2025-08-29 04:05:05', NULL, 'Admin', '09:04:00', '12:14:00', '13:00:00', '00:00:00'),
(389, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-08-29', '00:00:00', '00:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Down server ', 'approved', '2025-08-29 05:06:26', NULL, 'Admin', '08:34:00', '12:00:00', '00:00:00', '00:00:00'),
(390, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-29', '09:07:00', '12:04:00', '13:00:00', '00:00:00', NULL, NULL, 'down ang server', 'approved', '2025-08-29 05:07:34', NULL, 'Admin', '09:07:00', '12:04:00', '00:00:00', '00:00:00'),
(391, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-08-29', '08:30:00', '12:02:00', '13:00:00', '00:00:00', NULL, NULL, 'Server down', 'approved', '2025-08-29 05:09:01', NULL, 'Admin', '08:30:00', '12:02:00', '13:08:00', '00:00:00'),
(392, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-08-29', '09:00:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Di maka log in ganina kay ga log-in error ', 'approved', '2025-08-29 06:07:59', NULL, 'Admin', '09:00:00', '12:00:00', '00:00:00', '00:00:00'),
(393, 'CJIS-2025-0033', 'Jasper  Perote', '2025-08-29', '08:30:00', '12:01:00', '13:00:00', '18:00:00', NULL, NULL, 'Cannot time in on time on the afternoon due to server down. Day 2 technical training brother 8:30am-5:30pm', 'approved', '2025-08-29 11:11:11', NULL, 'Admin', '08:30:00', '12:01:00', '13:08:00', '18:20:00'),
(394, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-08-29', '09:00:00', '12:00:00', '13:00:00', '06:00:00', NULL, NULL, 'Nalimtan og time out kay nagdali ug uli kay mukusog ang ulan, hoping for your kind consideration', 'approved', '2025-08-30 01:00:09', NULL, 'Admin', '09:00:00', '12:00:00', '13:00:00', '00:00:00'),
(395, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-08-30', '09:04:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Server error', 'approved', '2025-08-30 01:07:20', NULL, 'Admin', NULL, NULL, NULL, NULL),
(396, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-08-30', '09:30:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Late because of financial problem', 'approved', '2025-08-30 02:01:21', NULL, 'Admin', NULL, NULL, NULL, NULL),
(397, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-08-29', '09:00:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Pa confirm ko balik sir, AM akong na set 😭🤧', 'approved', '2025-08-30 03:57:54', NULL, 'Admin', '09:00:00', '12:00:00', '13:00:00', '06:00:00'),
(398, 'CJIS-2025-0028', 'Mark   Busbus', '2025-08-29', '09:07:00', '12:04:00', '13:00:00', '18:00:00', NULL, NULL, '0', 'approved', '2025-08-30 04:00:41', NULL, 'Admin', '09:07:00', '12:04:00', '13:00:00', '00:00:00'),
(399, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-09-01', '09:24:00', '12:00:00', '14:12:00', '18:10:00', NULL, NULL, 'Updated request', 'approved', '2025-09-01 11:17:41', NULL, 'Admin', '09:24:00', '12:00:00', '00:00:00', '00:00:00'),
(400, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-09-02', '09:28:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Server error', 'approved', '2025-09-02 04:02:22', NULL, 'Admin', NULL, NULL, NULL, NULL),
(401, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-09-02', '08:34:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Busy entertain customer ', 'approved', '2025-09-02 05:01:05', NULL, 'Admin', '08:34:00', '00:00:00', '13:00:00', '00:00:00'),
(402, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-09-02', '08:54:00', '12:50:00', '14:00:00', '00:00:00', NULL, NULL, 'Good afternoon sir sorry sir now lang ko naka balik sir kay nagkalibang jud ko sir nag inom nako tambal now sir sorry kaayo sir permission to apply request late attendance sir🙏', 'approved', '2025-09-02 06:13:14', NULL, 'Admin', '08:54:00', '12:00:00', '00:00:00', '00:00:00'),
(403, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-09-03', '09:05:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Employee', 'approved', '2025-09-03 01:21:37', NULL, 'Admin', '09:21:07', '00:00:00', '00:00:00', '00:00:00'),
(404, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-09-03', '08:51:00', '12:00:00', '13:00:00', '18:01:00', NULL, NULL, 'Sorry sir abi nako naka clock out nako na lipat ko', 'approved', '2025-09-03 10:32:21', NULL, 'Admin', '08:51:00', '12:00:00', '13:00:00', '00:00:00'),
(405, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-09-05', '11:05:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Sorry im late nag bayad ko og kurente og tubig maam and sir alan🙏', 'approved', '2025-09-05 03:16:30', NULL, 'Admin', '00:00:00', '00:00:00', '13:00:00', '00:00:00'),
(406, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-09-04', '08:50:00', '12:12:00', '13:00:00', '18:41:00', NULL, NULL, 'Setuping laptop to customer', 'approved', '2025-09-05 04:01:47', NULL, 'Admin', '08:50:00', '12:12:00', '13:00:00', '00:00:00'),
(407, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-09-05', '08:54:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Busy entertain customer.', 'approved', '2025-09-05 07:20:54', NULL, 'Admin', '08:54:00', '12:00:00', '00:00:00', '00:00:00'),
(408, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-09-06', '10:58:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Late', 'approved', '2025-09-06 02:03:22', NULL, 'Admin', NULL, NULL, NULL, NULL),
(409, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-09-08', '10:20:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Late ko sir kay naay gi lakaw ganina', 'approved', '2025-09-08 02:56:40', '2025-09-08 04:09:27', 'Admin', NULL, NULL, NULL, NULL),
(410, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-09-08', '09:00:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Errro', 'approved', '2025-09-08 04:04:55', '2025-09-08 04:09:25', 'Admin', NULL, NULL, NULL, NULL),
(411, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-08-01', '12:08:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Gig', 'rejected', '2025-09-08 04:08:25', '2025-09-09 08:13:53', 'Admin', NULL, NULL, NULL, NULL),
(412, 'CJIS-2025-0028', 'Mark   Busbus', '2025-09-09', '09:14:23', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'nakalimot og time in/out kay nag site visit', 'approved', '2025-09-09 08:12:24', '2025-09-09 08:13:37', 'Admin', '09:14:23', '00:00:00', '00:00:00', '00:00:00'),
(413, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-09-09', '09:06:04', '12:00:00', '13:00:00', '18:01:00', NULL, NULL, 'Sorry na limtan gyud clock in og clock out ganiha kay na busy sa survey sa network ', 'approved', '2025-09-09 10:33:24', '2025-09-10 03:01:35', 'Admin', '09:06:04', '00:00:00', '00:00:00', '00:00:00'),
(414, 'CJIS-2025-0028', 'Mark   Busbus', '2025-09-10', '09:00:00', '12:16:00', '13:00:00', '18:00:00', NULL, NULL, 'nakalimot og time out', 'approved', '2025-09-11 01:00:51', '2025-09-11 02:02:02', 'Admin', '09:00:00', '12:16:00', '13:00:00', '00:00:00'),
(415, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-09-05', '11:05:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Down server', 'approved', '2025-09-11 03:00:15', '2025-09-11 03:01:04', 'Admin', '11:05:00', '00:00:00', '00:00:00', '00:00:00'),
(416, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-09-11', '09:09:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-09-11 05:01:12', '2025-09-11 05:01:23', 'Admin', '09:09:00', '00:00:00', '13:00:00', '00:00:00'),
(417, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-09-02', '08:34:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Forgot', 'approved', '2025-09-12 03:49:49', '2025-09-12 11:17:34', 'Admin', '08:34:00', '12:00:00', '13:00:00', '00:00:00'),
(418, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-09-12', '09:12:11', '12:01:00', '13:00:00', '00:00:00', NULL, NULL, 'Nag field ko gikan na limtan time in sorry', 'approved', '2025-09-12 09:46:11', '2025-09-12 11:17:42', 'Admin', '09:12:11', '12:00:00', '13:00:00', '18:00:00'),
(419, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-09-12', '09:12:11', '12:01:00', '13:00:00', '18:01:00', NULL, NULL, 'Na wala ang time out sa gabie ato na accept ang request nako', 'approved', '2025-09-12 17:13:29', '2025-09-13 01:13:45', 'Admin', '09:12:11', '12:01:00', '13:00:00', '00:00:00'),
(420, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-09-13', '08:54:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Busy entertain customer ', 'approved', '2025-09-13 04:58:59', '2025-09-13 04:59:07', 'Admin', '08:54:00', '00:00:00', '13:00:00', '00:00:00'),
(421, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-07-01', '16:30:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Test request, i enhance pa nako ang UI sa email ', 'rejected', '2025-09-14 08:31:17', '2025-09-22 00:46:42', 'Admin', NULL, NULL, NULL, NULL),
(422, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-09-17', '09:28:00', '12:16:00', '13:15:00', '00:00:00', NULL, NULL, 'Nkalimot ko ug time in sa hspon', 'approved', '2025-09-17 09:34:25', '2025-09-23 04:40:06', 'Admin', '09:28:00', '12:16:00', '00:00:00', '00:00:00'),
(423, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-09-22', '08:30:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Wala ka time out kay server down during update ', 'approved', '2025-09-23 00:01:18', '2025-09-23 04:40:20', 'Admin', '08:30:00', '12:00:00', '13:00:00', '00:00:00'),
(424, 'CJIS-2025-0028', 'Mark   Busbus', '2025-09-22', '08:44:00', '12:13:00', '13:00:00', '18:00:00', NULL, NULL, 'maintenance HRIS', 'approved', '2025-09-23 00:54:04', '2025-09-23 04:40:18', 'Admin', '08:44:00', '12:13:00', '13:00:00', '00:00:00'),
(425, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-09-22', '09:02:00', '12:00:00', '13:00:00', '06:00:00', NULL, NULL, 'Cant time out bcoz ga update ang system', 'approved', '2025-09-23 00:56:28', '2025-09-23 04:40:12', 'Admin', '09:02:00', '12:00:00', '13:00:00', '00:00:00'),
(426, 'CJIS-2025-0033', 'Jasper  Perote', '2025-09-22', '09:01:00', '12:13:00', '13:00:00', '18:02:00', NULL, NULL, 'Server is updating', 'approved', '2025-09-23 01:01:53', '2025-09-23 04:40:15', 'Admin', '09:01:00', '12:13:00', '13:00:00', '00:00:00'),
(427, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-09-22', '09:06:00', '12:01:00', '13:00:00', '18:02:00', NULL, NULL, 'Nag update ang HRIS gahapon wala ko ka time out', 'approved', '2025-09-23 01:15:41', '2025-09-23 04:40:10', 'Admin', '09:06:00', '12:01:00', '13:00:00', '00:00:00'),
(428, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-09-22', '09:25:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Error server', 'approved', '2025-09-23 04:40:06', '2025-09-23 04:40:08', 'Admin', '09:25:00', '12:00:00', '13:00:00', '00:00:00'),
(429, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-09-23', '09:00:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Error server', 'approved', '2025-09-23 04:40:24', '2025-09-25 09:54:49', 'Admin', '09:00:00', '12:00:00', '13:00:00', '00:00:00'),
(430, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-09-23', '08:55:36', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Cant update in and out Unauthorized Access', 'approved', '2025-09-23 08:00:58', '2025-09-25 09:54:46', 'Admin', '08:55:36', '00:00:00', '00:00:00', '00:00:00'),
(431, 'CJIS-2025-0033', 'Jasper  Perote', '2025-09-23', '09:00:48', '00:00:00', '13:00:00', '18:02:00', NULL, NULL, 'Server down and update. Unauthorized access if login.', 'approved', '2025-09-23 10:44:10', '2025-09-25 09:54:43', 'Admin', '09:00:48', '00:00:00', '00:00:00', '00:00:00'),
(432, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-09-22', '09:02:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Pa request po ulit, wala nasad na PM 😭✌🏻', 'approved', '2025-09-24 01:03:30', '2025-09-25 09:54:40', 'Admin', '09:02:00', '12:00:00', '13:00:00', '06:00:00'),
(433, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-09-24', '09:08:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Server error', 'approved', '2025-09-24 01:46:33', '2025-09-24 01:47:06', 'Admin', NULL, NULL, NULL, NULL),
(434, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-07-01', '04:49:00', '04:49:00', '16:49:00', '16:49:00', NULL, NULL, 'way logo dioha hostinger?\n\n', 'rejected', '2025-09-24 08:46:16', '2025-09-24 08:49:54', 'Admin', NULL, NULL, NULL, NULL),
(435, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-07-02', '16:47:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'hehehe 1 date 1 time', 'rejected', '2025-09-24 08:47:50', '2025-09-24 08:49:58', 'Admin', NULL, NULL, NULL, NULL),
(436, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-06-01', '16:51:00', '16:51:00', '16:52:00', '16:52:00', NULL, NULL, 'hehehehe', 'rejected', '2025-09-24 08:52:06', '2025-09-24 08:53:44', 'Admin', NULL, NULL, NULL, NULL),
(437, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-06-02', '16:52:00', '00:00:00', '00:00:00', '19:08:00', NULL, NULL, 'this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test this is test ', 'rejected', '2025-09-24 08:53:06', '2025-09-24 08:53:47', 'Admin', NULL, NULL, NULL, NULL),
(438, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-01-01', '16:55:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'UI update test ', 'rejected', '2025-09-24 08:58:43', '2025-09-24 08:59:34', 'Admin', NULL, NULL, NULL, NULL),
(439, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-09-24', '21:35:00', '12:00:00', '13:20:00', '00:00:00', NULL, NULL, 'Unauthorized error ang HRIS pag log in', 'approved', '2025-09-24 10:02:01', '2025-09-25 09:54:51', 'Admin', NULL, NULL, NULL, NULL),
(440, 'CJIS-2025-0033', 'Jasper  Perote', '2025-09-25', '09:05:00', '12:00:00', '13:00:00', '18:02:00', NULL, NULL, 'Server maintenance cant time out pm', 'approved', '2025-09-25 15:23:36', '2025-09-26 10:01:53', 'Admin', '09:05:00', '12:00:00', '13:00:00', '00:00:00'),
(441, 'CJIS-2025-0033', 'Jasper  Perote', '2025-09-23', '09:00:48', '12:00:00', '13:00:00', '18:02:00', NULL, NULL, 'Not completed request time out morning. Server down.', 'approved', '2025-09-25 15:24:25', '2025-09-26 10:01:28', 'Admin', '09:00:48', '00:00:00', '13:00:00', '18:02:00'),
(442, 'CJIS-2025-0028', 'Mark   Busbus', '2025-09-25', '08:36:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'under maintenance', 'approved', '2025-09-26 01:01:37', '2025-09-26 10:01:50', 'Admin', '08:36:00', '12:00:00', '13:00:00', '00:00:00'),
(443, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-09-25', '08:53:00', '12:01:00', '13:00:00', '18:04:00', NULL, NULL, 'Server down', 'approved', '2025-09-26 01:13:12', '2025-09-26 10:01:45', 'Admin', '08:53:00', '12:01:00', '13:00:00', '00:00:00'),
(444, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-09-25', '09:45:00', '00:07:00', '13:00:00', '06:03:00', NULL, NULL, 'HRIS Unauthorized login error', 'approved', '2025-09-26 02:04:46', '2025-09-27 01:02:23', 'Admin', '00:00:00', '00:00:00', '13:00:00', '00:00:00'),
(445, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-09-26', '09:34:00', '12:06:00', '13:15:00', '13:06:00', NULL, NULL, 'Na reset akung time in', 'approved', '2025-09-26 10:07:39', '2025-09-27 01:02:37', 'Admin', '09:34:00', '12:06:00', '00:00:00', '00:00:00'),
(446, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-09-25', '08:51:00', '12:01:00', '13:00:00', '18:00:00', NULL, NULL, 'Nag time-out ko ani nga time, wala diay na record 😭', 'approved', '2025-09-27 01:02:27', '2025-09-27 01:02:52', 'Admin', '08:51:00', '12:01:00', '13:00:00', '00:00:00'),
(447, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-09-27', '09:22:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-09-27 05:00:57', '2025-09-27 06:57:20', 'Admin', '09:22:00', '00:00:00', '13:00:00', '00:00:00'),
(448, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-09-29', '09:23:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Late', 'approved', '2025-09-29 01:48:22', '2025-09-29 03:54:30', 'Admin', NULL, NULL, NULL, NULL),
(449, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-09-30', '09:26:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Nag bayad ko bill sa wifi', 'approved', '2025-09-30 01:32:17', '2025-09-30 09:57:46', 'Admin', '00:00:00', '00:00:00', '13:15:18', '00:00:00'),
(450, 'CJIS-2025-0028', 'Mark   Busbus', '2025-09-29', '08:57:54', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'under maintenance hostinger', 'approved', '2025-09-30 09:54:39', '2025-09-30 09:55:21', 'Admin', '08:57:54', '00:00:00', '00:00:00', '00:00:00'),
(451, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-09-30', '08:59:42', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Server Maintenance', 'approved', '2025-09-30 09:54:42', '2025-09-30 09:57:41', 'Admin', '08:59:42', '00:00:00', '00:00:00', '00:00:00'),
(452, 'CJIS-2025-0028', 'Mark   Busbus', '2025-09-30', '00:00:00', '00:00:00', '13:00:00', '00:00:00', NULL, NULL, 'under maintenance HRIS', 'approved', '2025-09-30 09:55:32', '2025-09-30 09:57:31', 'Admin', NULL, NULL, NULL, NULL),
(453, 'CJIS-2025-0033', 'Jasper  Perote', '2025-09-30', '09:02:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Server maintenance', 'approved', '2025-09-30 09:56:02', '2025-09-30 09:57:21', 'Admin', '09:02:00', '00:00:00', '13:00:00', '00:00:00'),
(454, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-09-30', '09:00:57', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Server maintenance ', 'approved', '2025-09-30 09:56:19', '2025-09-30 09:57:18', 'Admin', '09:00:57', '00:00:00', '00:00:00', '00:00:00'),
(455, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '2025-09-30', '09:31:05', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'HRIS maintenance', 'approved', '2025-09-30 09:58:15', '2025-10-01 01:19:34', 'Admin', '09:31:05', '00:00:00', '00:00:00', '00:00:00'),
(456, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-10-01', '09:04:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Late naka time in kay ingon sa app his maintenance nag try ko time in gamit google naka time in ra', 'approved', '2025-10-01 01:14:50', '2025-10-01 01:19:26', 'Admin', '09:06:02', '00:00:00', '00:00:00', '00:00:00'),
(457, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-10-01', '09:17:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Kalimot og time in', 'approved', '2025-10-01 01:26:03', '2025-10-01 04:01:06', 'Admin', NULL, NULL, NULL, NULL),
(458, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-09-30', '09:00:57', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Nag time out pero unsuccessful, system maintenance daw so wala na record akong time out :\'<', 'approved', '2025-10-01 09:25:28', '2025-10-01 09:28:21', 'Admin', '09:00:57', '12:00:00', '13:00:00', '00:00:00'),
(459, 'CJIS-2025-0028', 'Mark   Busbus', '2025-10-01', '08:54:00', '12:00:00', '13:00:00', NULL, NULL, NULL, 'site visit to G-Galyx', 'approved', '2025-10-01 09:48:57', '2025-10-01 09:50:30', 'Admin', '08:54:00', '12:00:00', NULL, NULL),
(460, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-10-01', '09:00:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'server is up pa accept po ng request hehe', 'approved', '2025-10-01 10:53:51', '2025-10-02 00:59:50', 'Admin', '09:00:00', '12:00:00', '13:00:00', NULL),
(461, 'CJIS-2025-0033', 'Jasper  Perote', '2025-10-01', '09:00:00', '12:00:00', '13:00:00', '18:03:00', NULL, NULL, 'Server update', 'approved', '2025-10-01 10:57:59', '2025-10-02 00:59:47', 'Admin', '09:00:00', '12:00:00', '13:00:00', NULL),
(462, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-10-01', '09:04:00', '12:00:00', '13:00:00', '18:04:00', NULL, NULL, 'Server maintenance', 'approved', '2025-10-01 11:36:16', '2025-10-02 00:59:44', 'Admin', '09:04:00', '12:00:00', '13:00:00', NULL),
(463, 'CJIS-2025-0044', 'this  is  test account', '2025-10-01', '09:00:00', '12:00:00', '00:00:00', '00:00:00', NULL, NULL, 'dsa', 'rejected', '2025-10-02 03:36:02', '2025-10-02 05:04:13', 'Admin', NULL, NULL, NULL, NULL),
(464, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-10-03', '08:59:12', '12:00:00', '13:00:00', '18:35:00', NULL, NULL, 'Sorry na dugay himo sales report', 'approved', '2025-10-03 10:35:51', '2025-10-03 22:18:07', 'Admin', '08:59:12', '12:00:00', '13:00:00', NULL),
(465, 'CJIS-2025-0028', 'Mark   Busbus', '2025-10-01', '08:54:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'maintenance HRIS', 'approved', '2025-10-04 04:29:56', '2025-10-04 04:30:51', 'Admin', '08:54:00', '12:00:00', '13:00:00', NULL),
(466, 'CJIS-2025-0033', 'Jasper  Perote', '2025-10-04', '08:41:00', '12:00:00', '13:00:00', '18:00:00', 2, NULL, 'Test', 'approved', '2025-10-04 13:15:09', '2025-10-06 05:42:54', 'Admin', '08:56:00', '12:00:00', '13:00:00', NULL),
(467, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-10-04', '08:41:00', '12:00:00', '13:00:00', '18:00:00', 2, NULL, 'Test', 'approved', '2025-10-04 14:50:17', '2025-10-06 05:42:51', 'Admin', '08:41:00', '12:00:00', '13:00:00', '18:00:00'),
(468, 'CJIS-2025-0028', 'Mark   Busbus', '2025-10-04', '09:00:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'maintenance HRIS', 'approved', '2025-10-06 04:28:20', '2025-10-06 05:42:49', 'Admin', '09:00:00', '12:00:00', '13:00:00', '18:00:21'),
(469, 'CJIS-2025-0033', 'Jasper  Perote', '2025-10-06', '09:04:00', '12:00:00', '13:00:00', NULL, NULL, NULL, 'Server down', 'approved', '2025-10-06 05:01:02', '2025-10-06 05:42:58', 'Admin', '09:04:00', NULL, '13:00:00', NULL),
(470, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-10-04', '08:59:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'server down ani na time 🥲', 'approved', '2025-10-06 05:12:14', '2025-10-06 05:42:46', 'Admin', '08:59:00', '12:00:00', '13:00:00', NULL),
(471, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-10-06', '09:02:00', '12:00:00', '13:00:00', NULL, NULL, NULL, 'Request', 'approved', '2025-10-06 09:47:51', '2025-10-06 09:48:20', 'Admin', '09:02:00', '12:00:00', NULL, NULL),
(472, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-10-06', '21:21:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'Server down', 'approved', '2025-10-06 09:53:33', '2025-10-06 09:54:26', 'Admin', NULL, NULL, NULL, NULL),
(473, 'CJIS-2025-0033', 'Jasper  Perote', '2025-10-06', '09:04:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Server down / Can\'t log in', 'approved', '2025-10-06 13:30:52', '2025-10-07 02:16:33', 'Admin', '09:04:00', '12:00:00', '13:00:00', NULL),
(474, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-10-06', '09:00:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'wala na record akong time out ani na time ', 'approved', '2025-10-07 04:01:23', '2025-10-07 05:11:25', 'Admin', '09:00:00', '12:00:00', '13:00:00', NULL),
(475, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-10-07', '09:21:00', '12:00:00', NULL, NULL, NULL, NULL, 'Late attendance ', 'approved', '2025-10-07 04:14:34', '2025-10-07 05:11:33', 'Admin', '09:22:00', NULL, '13:00:00', NULL),
(476, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-10-07', '09:21:00', '12:00:00', NULL, NULL, NULL, NULL, 'Late time in and time out', 'approved', '2025-10-07 10:11:15', '2025-10-07 11:02:36', 'Admin', '09:21:00', '12:00:00', NULL, NULL),
(477, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-10-07', '09:21:00', '12:00:00', '13:00:00', '18:25:00', NULL, NULL, 'Late time in and time out', 'approved', '2025-10-07 11:21:17', '2025-10-07 11:37:11', 'Admin', '09:21:00', '12:00:00', NULL, NULL),
(478, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-10-08', '09:22:25', '12:00:00', '13:00:00', NULL, NULL, NULL, 'Busy entertain customer', 'approved', '2025-10-08 08:15:39', '2025-10-08 08:44:23', 'Admin', '09:22:25', NULL, NULL, NULL),
(479, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-10-08', '09:04:00', '12:00:00', '13:00:00', NULL, NULL, NULL, 'Busy bigbys and discussion namo ni sir Alan', 'approved', '2025-10-08 08:16:16', '2025-10-08 08:44:20', 'Admin', '09:04:00', '12:00:00', NULL, NULL),
(480, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-10-09', '09:08:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-10-09 10:10:39', '2025-10-09 10:11:07', 'Admin', '09:08:00', '12:00:00', NULL, NULL),
(481, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-10-11', '09:00:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Hinay ang bus', 'approved', '2025-10-11 02:14:54', '2025-10-11 02:16:01', 'Admin', NULL, NULL, NULL, NULL),
(482, 'CJIS-2025-0024', 'ricardo  Rimando', '2025-10-11', '09:00:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'No internet', 'approved', '2025-10-11 03:00:03', '2025-10-11 04:38:14', 'Admin', NULL, NULL, NULL, NULL),
(483, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-10-14', '08:51:00', '12:01:00', '13:00:00', NULL, NULL, NULL, 'Request for time out morning', 'approved', '2025-10-14 05:04:13', '2025-10-14 05:04:52', 'Admin', '08:51:00', NULL, '13:00:00', NULL),
(484, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-10-14', '09:25:19', '12:00:00', '13:00:00', NULL, NULL, NULL, 'Busy entertain customer', 'approved', '2025-10-14 09:18:25', '2025-10-14 09:22:46', 'Admin', '09:25:19', NULL, NULL, NULL);
INSERT INTO `late_attendance_requests` (`request_id`, `employee_id`, `employee_name`, `attendance_date`, `requested_time_in_morning`, `requested_time_out_morning`, `requested_time_in_afternoon`, `requested_time_out_afternoon`, `work_time_id`, `schedule_id`, `reason`, `status`, `requested_at`, `reviewed_at`, `reviewed_by`, `original_time_in_morning`, `original_time_out_morning`, `original_time_in_afternoon`, `original_time_out_afternoon`) VALUES
(485, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-10-15', '09:08:00', '12:00:00', '13:00:00', NULL, NULL, NULL, 'Busy entertain customer.', 'approved', '2025-10-15 04:36:32', '2025-10-15 05:51:49', 'Admin', '09:08:00', NULL, '13:00:00', NULL),
(486, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-10-15', '09:11:00', '12:00:00', '13:00:00', NULL, NULL, NULL, 'Wala ka time in hapon kay nag field sa rakiyata centrio pa accept admin po', 'approved', '2025-10-15 08:51:45', '2025-10-15 08:57:38', 'Admin', '09:11:00', '12:00:00', NULL, NULL),
(487, 'CJIS-2025-0028', 'Mark   Busbus', '2025-10-16', '09:02:00', '12:00:00', '13:00:00', '00:00:00', NULL, NULL, 'maintenance HRIS', 'approved', '2025-10-16 07:19:16', '2025-10-16 07:19:30', 'Admin', NULL, NULL, NULL, NULL),
(488, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-10-16', '09:25:00', '12:00:00', '13:00:00', NULL, NULL, NULL, 'Server down', 'approved', '2025-10-16 07:22:58', '2025-10-16 07:23:16', 'Admin', '09:28:07', NULL, NULL, NULL),
(489, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador', '2025-10-16', '08:32:32', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Cleaning my laptop and fixing my internet ', 'approved', '2025-10-16 10:06:14', '2025-10-17 10:03:43', 'Admin', '08:32:32', NULL, NULL, NULL),
(490, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-10-17', '08:51:00', '12:00:00', '13:00:00', NULL, NULL, NULL, 'Busy entertain customer', 'approved', '2025-10-17 04:33:50', '2025-10-17 10:03:49', 'Admin', '08:51:00', NULL, '13:00:00', '18:01:36'),
(491, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '2025-10-18', '09:39:00', '00:00:00', '00:00:00', '00:00:00', NULL, NULL, 'Late', 'approved', '2025-10-18 01:43:13', '2025-10-18 02:16:41', 'Admin', NULL, NULL, NULL, NULL),
(492, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-10-17', '08:51:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-10-18 03:55:55', '2025-10-18 10:02:24', 'Admin', '08:51:00', '12:00:00', '13:00:00', NULL),
(493, 'CJIS-2025-0028', 'Mark   Busbus', '2025-10-17', '08:42:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'nabusy og repair gahapon', 'approved', '2025-10-18 04:56:00', '2025-10-18 10:02:22', 'Admin', '08:42:00', '12:00:00', NULL, NULL),
(494, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-10-18', '09:36:00', '12:00:00', '13:00:00', NULL, NULL, NULL, 'Busy Entertain customer ', 'approved', '2025-10-18 10:00:42', '2025-10-18 10:02:26', 'Admin', '09:36:00', '12:00:00', NULL, NULL),
(495, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-10-20', '08:57:00', '12:00:00', '13:00:00', NULL, NULL, NULL, 'Request admin, time out for lunch kay na busy kadjut', 'approved', '2025-10-20 04:52:29', '2025-10-20 04:53:31', 'Admin', '08:57:00', NULL, '13:00:00', NULL),
(496, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-10-21', '08:59:00', '12:00:00', '13:00:00', NULL, NULL, NULL, 'Pa request admin wala ka time in kay na busy sa call', 'approved', '2025-10-21 09:58:52', '2025-10-21 10:05:54', 'Admin', '08:59:00', '12:00:00', '13:13:00', '18:02:56'),
(497, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-10-22', '09:04:00', NULL, NULL, NULL, NULL, NULL, 'Wala koy load hinay kaayo akoa phone wifi diri gawas store dugay nag load ang hris sa akoa', 'approved', '2025-10-22 01:10:04', '2025-10-22 09:38:21', 'Admin', '09:08:00', '12:00:00', '13:00:00', NULL),
(498, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '2025-10-22', '09:04:00', '12:00:00', '13:00:00', '18:13:00', NULL, NULL, 'Pa request admin na wala akoa time out sa morning and time in/out sa afternoon', 'approved', '2025-10-22 11:33:10', '2025-10-23 02:15:54', 'Admin', '09:04:00', NULL, NULL, NULL),
(499, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-10-23', '09:22:00', '12:00:00', '13:00:00', '18:20:00', NULL, NULL, 'Busy entertain customer l', 'approved', '2025-10-23 10:20:41', '2025-10-23 10:23:34', 'Admin', '09:22:00', '12:00:00', NULL, NULL),
(500, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', '2025-10-21', '09:00:00', '12:00:00', '13:00:00', '18:05:16', NULL, NULL, 'Good morning po, wala ko kabalo na wala na time out naa rami always sa office ga lunch sir pa approve po 😭', 'approved', '2025-10-27 01:31:55', '2025-10-27 04:41:11', 'Admin', '09:00:00', NULL, '13:00:00', '18:05:16'),
(501, 'CJIS-2025-0033', 'Jasper  Perote', '2025-10-29', '08:54:00', '12:00:00', '13:00:00', '18:02:00', NULL, NULL, 'Cant time in afternoon, Busy for onsite visit CCTV retrieval in Bigbys Premier', 'approved', '2025-10-29 10:02:51', '2025-10-29 10:28:59', 'Admin', '08:54:00', '12:00:00', '13:15:00', '18:02:00'),
(502, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '2025-10-29', '09:05:00', '12:00:00', '13:00:00', '18:00:00', NULL, NULL, 'Busy entertain customer', 'approved', '2025-10-29 10:06:31', '2025-10-29 10:28:54', 'Admin', '09:05:00', '12:00:00', NULL, NULL);

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

--
-- Table structure for table `late_deduction`
--

CREATE TABLE `late_deduction` (
  `id` int(11) NOT NULL,
  `tier_id` int(11) NOT NULL,
  `min_minutes` int(11) NOT NULL,
  `max_minutes` int(11) DEFAULT NULL,
  `deduction_type` enum('credit','fixed','percent') NOT NULL DEFAULT 'credit',
  `deduction_value` decimal(10,4) NOT NULL,
  `description` varchar(255) 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_general_ci;

--
-- Dumping data for table `late_deduction`
--

INSERT INTO `late_deduction` (`id`, `tier_id`, `min_minutes`, `max_minutes`, `deduction_type`, `deduction_value`, `description`, `created_at`, `updated_at`) VALUES
(1, 1, 0, 5, 'credit', 0.1000, 's', '2025-09-17 03:05:11', '2025-10-01 04:04:59'),
(2, 3, 6, 10, 'credit', 0.0300, '5min late', '2025-09-18 07:54:09', '2025-10-13 02:06:03'),
(3, 5, 4, 5, 'credit', 0.1000, 'tes', '2025-09-22 03:38:22', '2025-09-22 03:38:22'),
(4, 2, 6, 10, 'credit', 0.0300, 'ds', '2025-09-24 03:38:25', '2025-10-01 05:36:49'),
(5, 3, 11, 15, 'credit', 0.0900, '11 mins late', '2025-09-24 06:18:48', '2025-10-01 09:51:55'),
(6, 2, 11, 15, 'credit', 0.0900, 's', '2025-09-24 07:37:27', '2025-10-01 05:37:44'),
(8, 3, 16, 60, 'credit', 0.2500, 'asd', '2025-09-29 09:54:37', '2025-10-01 09:52:36');

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

--
-- Table structure for table `late_deduction_tier`
--

CREATE TABLE `late_deduction_tier` (
  `id` int(11) NOT NULL,
  `tier_name` varchar(100) NOT NULL,
  `description` varchar(255) 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_general_ci;

--
-- Dumping data for table `late_deduction_tier`
--

INSERT INTO `late_deduction_tier` (`id`, `tier_name`, `description`, `created_at`, `updated_at`) VALUES
(1, 's', 'as', '2025-09-17 02:55:26', '2025-09-17 02:55:26'),
(2, 'tes', 'a', '2025-09-17 02:55:26', '2025-09-17 02:55:26'),
(3, 'Default late tier', '', '2025-09-18 07:53:42', '2025-10-01 09:49:46'),
(4, '15', '', '2025-09-18 09:03:58', '2025-09-18 09:03:58'),
(5, 'h', '.', '2025-09-22 03:38:01', '2025-09-22 03:38:01');

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

--
-- Table structure for table `leave_deduction_logs`
--

CREATE TABLE `leave_deduction_logs` (
  `log_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `leave_type_id` int(11) NOT NULL,
  `leave_id` int(11) NOT NULL,
  `deducted_days` decimal(5,2) NOT NULL,
  `deducted_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `leave_deduction_logs`
--

INSERT INTO `leave_deduction_logs` (`log_id`, `employee_id`, `leave_type_id`, `leave_id`, `deducted_days`, `deducted_at`) VALUES
(3, 'CJIS-2025-0037', 7, 3, 3.00, '2025-08-15 07:05:19'),
(4, 'CJIS-2025-0001', 7, 4, 3.00, '2025-11-04 03:50:37');

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

--
-- Table structure for table `leave_requests`
--

CREATE TABLE `leave_requests` (
  `leave_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `leave_type_id` int(11) NOT NULL,
  `date_from` date NOT NULL,
  `date_until` date NOT NULL,
  `total_days` decimal(5,2) DEFAULT 1.00,
  `reason` text DEFAULT NULL,
  `status` enum('pending','approved','rejected') DEFAULT 'pending',
  `approver_id` varchar(15) DEFAULT NULL,
  `approval_remarks` text DEFAULT NULL,
  `attachment_url` varchar(255) 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_general_ci;

--
-- Dumping data for table `leave_requests`
--

INSERT INTO `leave_requests` (`leave_id`, `employee_id`, `leave_type_id`, `date_from`, `date_until`, `total_days`, `reason`, `status`, `approver_id`, `approval_remarks`, `attachment_url`, `created_at`, `updated_at`) VALUES
(15, 'CJIS-2025-0037', 7, '2025-08-18', '2025-08-20', 3.00, 'test ', 'approved', 'admin', 'Manually added by admin', NULL, '2025-08-15 07:05:19', '2025-08-15 07:05:19'),
(16, 'CJIS-2025-0024', 7, '2025-08-18', '2025-08-19', 2.00, 'test', 'pending', NULL, NULL, NULL, '2025-08-15 07:06:31', '2025-08-15 07:06:31');

--
-- Triggers `leave_requests`
--
DELIMITER $$
CREATE TRIGGER `after_leave_request_status_update` AFTER UPDATE ON `leave_requests` FOR EACH ROW BEGIN
    -- If approved and was not approved before
    IF NEW.status = 'approved' AND OLD.status <> 'approved' THEN
        INSERT INTO employee_leaves (
            employee_id,
            leave_type_id,
            date_from,
            date_until,
            total_days,
            reason,
            status,
            created_at,
            updated_at
        )
        VALUES (
            NEW.employee_id,
            NEW.leave_type_id,
            NEW.date_from,
            NEW.date_until,
            COALESCE(NEW.total_days, 1),
            NEW.reason,
            'approved',
            NOW(),
            NOW()
        );
    END IF;

    -- If rejected and was not rejected before
    IF NEW.status = 'rejected' AND OLD.status <> 'rejected' THEN
        INSERT INTO leave_deduction_logs (
            employee_id,
            leave_type_id,
            leave_id,
            deducted_days
        )
        VALUES (
            NEW.employee_id,
            NEW.leave_type_id,
            NEW.leave_id,
            0
        );
    END IF;
END
$$
DELIMITER ;

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

--
-- Table structure for table `leave_types`
--

CREATE TABLE `leave_types` (
  `leave_type_id` int(11) NOT NULL,
  `leave_name` varchar(50) NOT NULL,
  `is_paid` tinyint(1) DEFAULT 1,
  `leave_limit` decimal(10,2) DEFAULT 0.00,
  `default_days` decimal(5,2) DEFAULT 1.00,
  `description` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `leave_types`
--

INSERT INTO `leave_types` (`leave_type_id`, `leave_name`, `is_paid`, `leave_limit`, `default_days`, `description`) VALUES
(7, 'Unpaid Leave', 0, 100.00, 1.00, 'test');

--
-- Triggers `leave_types`
--
DELIMITER $$
CREATE TRIGGER `after_leave_type_delete` AFTER DELETE ON `leave_types` FOR EACH ROW BEGIN
    -- Remove all employee leave balances linked to this leave type
    DELETE FROM employee_leave_balances
    WHERE leave_type_id = OLD.leave_type_id;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `after_leave_type_insert` AFTER INSERT ON `leave_types` FOR EACH ROW BEGIN
    INSERT INTO employee_leave_balances (employee_id, leave_type_id, year, leave_limit, leave_used)
    SELECT e.employee_id, NEW.leave_type_id, YEAR(CURDATE()), NEW.leave_limit, 0
    FROM employees e;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `after_leave_type_update` AFTER UPDATE ON `leave_types` FOR EACH ROW BEGIN
    IF NEW.leave_limit <> OLD.leave_limit THEN
        UPDATE employee_leave_balances
        SET leave_limit = NEW.leave_limit
        WHERE leave_type_id = NEW.leave_type_id
          AND year = YEAR(CURDATE());
    END IF;
END
$$
DELIMITER ;

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

--
-- Table structure for table `liability_categories`
--

CREATE TABLE `liability_categories` (
  `category_id` int(11) NOT NULL,
  `code` varchar(50) NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `is_recurring` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `loans`
--

CREATE TABLE `loans` (
  `loan_id` int(11) NOT NULL,
  `employee_id` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `employee_name` varchar(255) DEFAULT NULL,
  `loan_amount` decimal(10,2) DEFAULT NULL,
  `date_start` date DEFAULT NULL,
  `description` text DEFAULT NULL,
  `date_end` date DEFAULT NULL,
  `balance` decimal(10,2) DEFAULT NULL,
  `loan_type` enum('company','sss','pagibig') NOT NULL DEFAULT 'company',
  `liability_type` enum('cash_loan','cash_advance','item_issue','damage','other') NOT NULL DEFAULT 'cash_loan',
  `reference_no` varchar(100) DEFAULT NULL,
  `status` enum('draft','pending','approved','active','closed','cancelled') NOT NULL DEFAULT 'approved',
  `is_installment` tinyint(1) NOT NULL DEFAULT 1,
  `quantity` int(11) DEFAULT NULL,
  `unit_cost` decimal(12,2) DEFAULT NULL,
  `total_cost` decimal(12,2) DEFAULT NULL,
  `created_by` varchar(100) DEFAULT NULL,
  `approved_by` varchar(100) DEFAULT NULL,
  `approved_at` datetime DEFAULT NULL,
  `closed_at` datetime DEFAULT NULL,
  `origin` varchar(50) DEFAULT NULL,
  `meta` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`meta`)),
  `item_id` int(11) DEFAULT NULL,
  `loan_reference_no` varchar(100) DEFAULT NULL,
  `reason` text DEFAULT NULL,
  `monthly_interest_generated` decimal(10,2) DEFAULT 0.00,
  `total_interest` decimal(10,2) DEFAULT 0.00,
  `last_interest_date` date DEFAULT NULL,
  `deduction_schedule` enum('monthly','semi-monthly','current-payroll') DEFAULT 'monthly',
  `interest_type` enum('none','fixed','monthly') DEFAULT 'none',
  `interest_rate` decimal(5,2) DEFAULT 0.00,
  `terms` int(11) DEFAULT 1,
  `payable_per_term` decimal(10,2) DEFAULT 0.00,
  `final_loan_deduction` decimal(10,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `loans`
--

INSERT INTO `loans` (`loan_id`, `employee_id`, `employee_name`, `loan_amount`, `date_start`, `description`, `date_end`, `balance`, `loan_type`, `liability_type`, `reference_no`, `status`, `is_installment`, `quantity`, `unit_cost`, `total_cost`, `created_by`, `approved_by`, `approved_at`, `closed_at`, `origin`, `meta`, `item_id`, `loan_reference_no`, `reason`, `monthly_interest_generated`, `total_interest`, `last_interest_date`, `deduction_schedule`, `interest_type`, `interest_rate`, `terms`, `payable_per_term`, `final_loan_deduction`) VALUES
(38, 'CJIS-2025-0030', 'Gerome Hapson', 18458.00, '2025-10-01', 'td', NULL, 17535.10, 'sss', 'cash_loan', NULL, 'active', 1, NULL, NULL, 18458.00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'ts', NULL, 0.00, 0.00, NULL, 'semi-monthly', 'fixed', 30.13, 20, 461.45, NULL),
(40, 'CJIS-2025-0030', 'Gerome Hapson', 31207.97, '2025-10-01', 'HDMF - Loan', NULL, 29611.37, 'pagibig', 'cash_loan', NULL, 'active', 1, NULL, NULL, 31207.97, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '1', NULL, 0.00, 0.00, NULL, 'semi-monthly', 'none', 0.00, 19, 821.26, NULL),
(42, 'CJIS-2025-0024', 'ricardo Rimando', 620.00, '2025-10-28', 'speaker', NULL, 0.00, 'company', 'item_issue', NULL, 'closed', 1, 1, 620.00, 620.00, NULL, NULL, NULL, '2025-10-28 08:16:30', NULL, NULL, NULL, NULL, NULL, 0.00, 0.00, NULL, 'current-payroll', 'none', 0.00, 1, 620.00, NULL);

--
-- Triggers `loans`
--
DELIMITER $$
CREATE TRIGGER `trg_insert_loan_deduction` AFTER INSERT ON `loans` FOR EACH ROW BEGIN
  IF NEW.final_loan_deduction IS NOT NULL AND NEW.final_loan_deduction > 0 THEN
    INSERT INTO loan_journal_entry (
      loan_id,
      employee_id,
      entry_type,
      amount,
      description,
      entry_date
    ) VALUES (
      NEW.loan_id,
      NEW.employee_id,
      'credit',
      NEW.final_loan_deduction,
      CONCAT('Initial deduction (₱', NEW.final_loan_deduction, ') on insert'),
      NOW()
    );
  END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trg_set_initial_balance` BEFORE INSERT ON `loans` FOR EACH ROW BEGIN
  -- Set the balance to loan_amount only if it's not already set
  IF NEW.balance IS NULL THEN
    SET NEW.balance = NEW.loan_amount;
  END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trg_update_final_loan_deduction` BEFORE UPDATE ON `loans` FOR EACH ROW BEGIN
  -- Only process if NEW deduction value is provided and different
  IF NEW.final_loan_deduction IS NOT NULL 
     AND NEW.final_loan_deduction > 0 
     AND (OLD.final_loan_deduction IS NULL OR OLD.final_loan_deduction != NEW.final_loan_deduction)
  THEN
    -- Step 1: Subtract from balance
    SET NEW.balance = GREATEST(OLD.balance - NEW.final_loan_deduction, 0);

    -- Step 2: Insert journal entry
    INSERT INTO loan_journal_entry (
      loan_id,
      employee_id,
      entry_type,
      amount,
      description,
      entry_date
    ) VALUES (
      OLD.loan_id,
      OLD.employee_id,
      'credit',
      NEW.final_loan_deduction,
      CONCAT('Manual deduction via update (₱', NEW.final_loan_deduction, ')'),
      NOW()
    );

    -- Step 3: Reset the field to avoid repeated deductions
    SET NEW.final_loan_deduction = NULL;
  END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trg_update_loan_deduction` BEFORE UPDATE ON `loans` FOR EACH ROW BEGIN
  -- Trigger fires ONLY IF a new final_loan_deduction is provided
  IF NEW.final_loan_deduction IS NOT NULL 
     AND NEW.final_loan_deduction > 0 
     AND (OLD.final_loan_deduction IS NULL OR OLD.final_loan_deduction != NEW.final_loan_deduction)
  THEN
    -- Deduct balance
    SET NEW.balance = GREATEST(OLD.balance - NEW.final_loan_deduction, 0);

    -- Insert journal entry
    INSERT INTO loan_journal_entry (
      loan_id,
      employee_id,
      entry_type,
      amount,
      description,
      entry_date
    ) VALUES (
      OLD.loan_id,
      OLD.employee_id,
      'credit',
      NEW.final_loan_deduction,
      CONCAT('Manual deduction during payroll (₱', NEW.final_loan_deduction, ')'),
      NOW()
    );

    -- Reset final_loan_deduction to NULL to prevent duplicate deduction
    SET NEW.final_loan_deduction = NULL;
  END IF;
END
$$
DELIMITER ;

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

--
-- Table structure for table `loan_journal_entry`
--

CREATE TABLE `loan_journal_entry` (
  `journal_id` int(11) NOT NULL,
  `loan_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `entry_type` enum('debit','credit') NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `description` text DEFAULT NULL,
  `origin` varchar(50) DEFAULT NULL,
  `reference_no` varchar(100) DEFAULT NULL,
  `payroll_cutoff` date DEFAULT NULL,
  `entry_date` datetime DEFAULT current_timestamp(),
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `loan_journal_entry`
--

INSERT INTO `loan_journal_entry` (`journal_id`, `loan_id`, `employee_id`, `entry_type`, `amount`, `description`, `origin`, `reference_no`, `payroll_cutoff`, `entry_date`, `created_at`) VALUES
(88, 38, 'CJIS-2025-0030', 'credit', 461.45, 'SSS - td', 'payroll_auto', NULL, NULL, '2025-10-28 00:00:00', '2025-10-30 01:26:06'),
(89, 40, 'CJIS-2025-0030', 'credit', 798.30, 'PAGIBIG - HDMF - Loan', 'payroll_auto', NULL, NULL, '2025-10-28 00:00:00', '2025-10-30 01:26:06');

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

--
-- Table structure for table `loan_payment_history`
--

CREATE TABLE `loan_payment_history` (
  `loan_payment_history_id` int(11) NOT NULL,
  `loan_id` int(11) DEFAULT NULL,
  `employee_id` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `employee_name` varchar(255) DEFAULT NULL,
  `loan_payment` decimal(10,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `loan_remittance_logs`
--

CREATE TABLE `loan_remittance_logs` (
  `remittance_id` int(11) NOT NULL,
  `loan_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `payroll_cutoff` date NOT NULL,
  `loan_type` enum('sss','pagibig') NOT NULL,
  `remitted` tinyint(1) DEFAULT 0,
  `remittance_date` date DEFAULT NULL,
  `reference_file` varchar(255) DEFAULT NULL,
  `remarks` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `loan_skip_requests`
--

CREATE TABLE `loan_skip_requests` (
  `skip_id` int(11) NOT NULL,
  `loan_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `payroll_cutoff` date NOT NULL,
  `reason` text DEFAULT NULL,
  `status` enum('pending','approved','rejected') DEFAULT 'pending',
  `requested_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `reviewed_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `logs`
--

CREATE TABLE `logs` (
  `log_id` int(11) NOT NULL,
  `user_full_name` varchar(255) DEFAULT NULL,
  `user_role` varchar(50) DEFAULT NULL,
  `action` varchar(1000) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `logs`
--

INSERT INTO `logs` (`log_id`, `user_full_name`, `user_role`, `action`, `created_at`) VALUES
(1, NULL, 'ADMIN', 'Added employee: ahahah ahah (ID: CJIS-2025-0047)', '2025-09-25 09:19:59'),
(2, 'admin', 'ADMIN', 'Added employee: asd asd (ID: CJIS-2025-0047)', '2025-09-25 09:22:56'),
(3, 'Ragheil Lagat  Atacador ', 'CONGRRESSMAN', 'Added employee: 123123 123123 (ID: CJIS-2025-0048)', '2025-09-25 09:23:30'),
(4, 'Unknown User', 'ADMIN', 'Deleted employee: 123123 123123 (ID: CJIS-2025-0048)', '2025-09-25 09:34:02'),
(5, 'admin', 'ADMIN', 'Added employee: delete me (ID: CJIS-2025-0048)', '2025-09-25 09:36:41'),
(6, 'Ragheil Lagat  Atacador ', 'CONGRRESSMAN', 'Deleted employee: delete me (ID: CJIS-2025-0048)', '2025-09-25 09:36:58'),
(7, 'Unknown User', 'GUEST', 'Updated employee: asd asd (ID: CJIS-2025-0047)', '2025-09-25 09:37:22'),
(8, 'Ragheil Lagat  Atacador ', 'CONGRRESSMAN', 'Updated employee: asd udpate asd (ID: CJIS-2025-0047)', '2025-09-25 09:40:45'),
(9, 'Ragheil Lagat  Atacador ', 'CONGRRESSMAN', 'Updated employee: dont udpate me asd (ID: CJIS-2025-0047). Changes: middle_name: \'\' → \'asd\', contact_number: \'\' → \'234\'', '2025-09-25 09:43:38'),
(10, 'Ragheil Lagat  Atacador ', 'CLASS PRESIDENT', 'Updated employee: dont udpate me asd (ID: CJIS-2025-0047). Changes: first_name: \'dont udpate me\' → \'wawawa\', middle_name: \'asd\' → \'wawawa\', last_name: \'asd\' → \'asd wawaw\', email: \'\' → \'asdas@.dfg\', contact_number: \'234\' → \'234234234\', department_id: \'Admi', '2025-09-25 09:45:31'),
(11, 'Ragheil Lagat  Atacador ', 'CLASS PRESIDENT', 'Updated employee: wawawa asd wawaw (ID: CJIS-2025-0047). Changes: first_name: \'wawawa\' → \'ahahahaha\', middle_name: \'wawawa\' → \'ahahahah\', last_name: \'asd wawaw\' → \'ahahahahah\', email: \'asdas@.dfg\' → \'aahahahahsdas@.dfg\', contact_number: \'234234234\' → \'234234234sdfg\', department_id: \'DEP-001\' → \'Admin-001\', position_id: \'1\' → \'Admin001\', base_salary: \'12.00\' → \'01564562.00\', employee_type: \'Contractual\' → \'OJT\'', '2025-09-25 09:47:00'),
(12, 'Ragheil Lagat  Atacador ', 'CONGRRESSMAN', 'Deleted employee: ahahahaha ahahahahah (ID: CJIS-2025-0047)', '2025-09-25 09:48:09'),
(13, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Project-Based\' → \'Regular\'', '2025-10-03 08:23:17'),
(14, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Regular\' → \'Part-time\'', '2025-10-03 08:23:25'),
(15, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Part-time\' → \'OJT\'', '2025-10-03 08:23:28'),
(16, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'OJT\' → \'Project-Based\'', '2025-10-03 08:23:34'),
(17, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Project-Based\' → \'Part-time\'', '2025-10-03 08:23:52'),
(18, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Part-time\' → \'Regular\'', '2025-10-03 08:24:22'),
(19, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Regular\' → \'Project-Based\'', '2025-10-03 08:25:00'),
(20, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Project-Based\' → \'Regular\'', '2025-10-03 16:58:13'),
(21, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Regular\' → \'Part-time\'', '2025-10-03 16:58:21'),
(22, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Part-time\' → \'Contractual\'', '2025-10-03 16:58:23'),
(23, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Updated employee (ID: CJIS-2025-0001). Changes: No changes', '2025-10-03 16:58:40'),
(24, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Contractual\' → \'Regular\'', '2025-10-03 16:59:02'),
(25, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Regular\' → \'OJT\'', '2025-10-03 16:59:08'),
(26, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'OJT\' → \'Regular\'', '2025-10-03 16:59:23'),
(27, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Regular\' → \'OJT\'', '2025-10-03 16:59:29'),
(28, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'OJT\' → \'Regular\'', '2025-10-04 03:04:15'),
(29, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Regular\' → \'Project-Based\'', '2025-10-04 14:59:02'),
(30, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Project-Based\' → \'Regular\'', '2025-10-05 08:10:03'),
(31, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Regular\' → \'Part-time\'', '2025-10-05 08:10:05'),
(32, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Part-time\' → \'OJT\'', '2025-10-05 08:10:07'),
(33, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'OJT\' → \'Contractual\'', '2025-10-05 08:10:09'),
(34, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Contractual\' → \'Project-Based\'', '2025-10-05 08:10:11'),
(35, 'UNAUTHENTICATED / NO ACTOR', 'UNSET', 'Created attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 12, 2025. Time in AM: in 12:00 PM | Time out AM: —.  Time in PM: — | Time out PM: —.', '2025-10-08 11:50:13'),
(36, 'UNAUTHENTICATED / NO ACTOR', 'UNSET', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 12, 2025. Time out AM: 12:00 PM.', '2025-10-08 11:51:23'),
(37, 'Ragheil Lagat  Atacador ', 'CONGRESSMAN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 12, 2025. Time in AM: in 12:00 PM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: — -> *cleared time in PM* | Time out PM: — -> *cleared time out PM*.', '2025-10-08 11:53:40'),
(38, 'Ragheil Lagat  Atacador', 'CONGRESSMAN', 'Created attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 12, 2025. Time in AM: in 12:00 PM | Time out AM: —.  Time in PM: — | Time out PM: —.', '2025-10-08 11:54:06'),
(39, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 12, 2025. Time in AM: in 12:00 PM -> *cleared time in AM* | Time out AM: — -> *cleared time out AM*.  Time in PM: — -> *cleared time in PM* | Time out PM: — -> *cleared time out PM*.', '2025-10-08 11:58:00'),
(40, 'Ragheil Lagat  Atacador', 'CONGRESSMAN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 10, 2025. Time out AM: 12:00 PM.', '2025-10-10 03:59:46'),
(44, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0028 (Mark   Busbus) for Oct. 8, 2025. No time changes.', '2025-10-13 02:06:58'),
(45, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador) for Oct. 14, 2025. Time in AM: in 9:00 AM -> *cleared time in AM* | Time out AM: — -> *cleared time out AM*.  Time in PM: — -> *cleared time in PM* | Time out PM: — -> *cleared time out PM*.', '2025-10-13 12:35:09'),
(46, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0033). Changes: employee_type: \'Project-Based\' → \'Regular\'', '2025-10-15 00:48:43'),
(47, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Project-Based\' → \'Regular\'', '2025-10-15 05:40:24'),
(48, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Regular\' → \'Project-Based\'', '2025-10-15 05:40:40'),
(49, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Project-Based\' → \'Regular\'', '2025-10-15 05:40:54'),
(74, 'admin', 'ADMIN', 'Created attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 31, 2025. Time in AM: in 9:00 AM | Time out AM: —.  Time in PM: — | Time out PM: —.', '2025-10-26 10:51:10'),
(75, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 31, 2025. Time out AM: 12:00 PM.', '2025-10-26 10:51:21'),
(76, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 31, 2025. Time in PM: 1:00 PM.', '2025-10-26 10:51:35'),
(77, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 31, 2025. Time out PM: 9:00 PM.', '2025-10-26 10:51:43'),
(78, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 31, 2025. No time changes.', '2025-10-26 10:52:06'),
(79, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 31, 2025. No time changes.', '2025-10-26 10:59:25'),
(80, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 31, 2025. Time in AM: in 9:00 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 9:00 PM -> *cleared time out PM*.', '2025-10-26 10:59:32'),
(81, 'admin', 'ADMIN', 'Created attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 30, 2025. Time in AM: in 9:00 AM | Time out AM: —.  Time in PM: — | Time out PM: —.', '2025-10-26 10:59:53'),
(82, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 30, 2025. Time out AM: 12:00 PM.', '2025-10-26 11:00:04'),
(83, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 30, 2025. Time out PM: 6:00 PM.', '2025-10-26 11:00:12'),
(84, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 30, 2025. Time in PM: 1:00 PM.', '2025-10-26 11:00:29'),
(85, 'admin', 'ADMIN', 'Created attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 29, 2025. Time in AM: in 9:00 AM | Time out AM: —.  Time in PM: — | Time out PM: —.', '2025-10-26 11:02:27'),
(86, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 29, 2025. Time out AM: 12:00 PM.', '2025-10-26 11:02:37'),
(87, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 29, 2025. Time in PM: 1:00 PM.', '2025-10-26 11:02:56'),
(88, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 29, 2025. Time out PM: 6:00 PM.', '2025-10-26 11:03:06'),
(89, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 29, 2025. Time out AM: *cleared Time out AM*.', '2025-10-26 11:18:33'),
(90, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 29, 2025. Time in AM: *cleared Time in AM*.', '2025-10-26 11:18:38'),
(91, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 29, 2025. Time in PM: *cleared Time in PM* | Time out PM: *cleared Time out PM*.', '2025-10-26 11:18:59'),
(92, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 30, 2025. Time in AM: 9:00 AM -> 9:06 AM.', '2025-10-26 11:29:57'),
(93, 'Ragheil Lagat  Atacador', 'MANAGER', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 29, 2025. Time in AM: 9:00 AM.', '2025-10-26 15:00:21'),
(94, 'Ragheil Lagat  Atacador', 'MANAGER', 'Created attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 28, 2025. Time in AM: in 9:00 AM | Time out AM: —.  Time in PM: — | Time out PM: —.', '2025-10-26 15:00:31'),
(95, 'Ragheil Lagat  Atacador', 'MANAGER', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 28, 2025. Time in AM: 9:00 AM -> 9:06 AM.', '2025-10-26 15:00:57'),
(96, 'Ragheil Lagat  Atacador', 'MANAGER', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 28, 2025. Time out AM: 12:00 PM.', '2025-10-26 15:01:01'),
(97, 'Ragheil Lagat  Atacador', 'MANAGER', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 28, 2025. Time in PM: 1:07 PM.', '2025-10-26 15:01:06'),
(98, 'Ragheil Lagat  Atacador', 'MANAGER', 'Update attendance for employee CJIS-2025-0044 (this  is  test account) for Oct. 28, 2025. Time out PM: 6:00 PM.', '2025-10-26 15:01:10'),
(99, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 2, 2025. Time in AM: 9:25 AM -> 9:51 AM.', '2025-10-27 01:57:34'),
(100, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 3, 2025. Time out PM: 6:00 PM.', '2025-10-27 01:57:45'),
(101, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 4, 2025. Time in AM: 9:26 AM -> 9:00 AM.', '2025-10-27 01:57:55'),
(102, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 4, 2025. Time in AM: 9:00 AM -> 9:26 AM.', '2025-10-27 01:58:03'),
(103, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 4, 2025. Time out AM: 12:00 PM.', '2025-10-27 01:58:08'),
(104, 'admin', 'ADMIN', 'Created attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 6, 2025. Time in AM: in — | Time out AM: —.  Time in PM: 1:43 PM | Time out PM: —.', '2025-10-27 01:58:32'),
(105, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 6, 2025. Time out PM: 6:00 PM.', '2025-10-27 01:58:40'),
(106, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 4, 2025. Time in PM: 1:14 PM.', '2025-10-27 01:58:55'),
(107, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 4, 2025. Time out PM: 6:00 PM.', '2025-10-27 01:58:59'),
(108, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 8, 2025. Time out AM: 12:00 PM.', '2025-10-27 01:59:13'),
(109, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 8, 2025. Time in PM: 1:00 PM.', '2025-10-27 01:59:40'),
(110, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 8, 2025. Time out PM: 6:00 PM.', '2025-10-27 01:59:43'),
(111, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 9, 2025. Time in AM: 9:14 AM -> 9:13 AM | Time out AM: 12:00 PM.', '2025-10-27 02:00:00'),
(112, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 9, 2025. Time in PM: 1:00 PM.', '2025-10-27 02:00:15'),
(113, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 9, 2025. Time out PM: 6:00 PM.', '2025-10-27 02:00:19'),
(114, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 10, 2025. Time in AM: 9:44 AM.', '2025-10-27 02:00:37'),
(115, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 10, 2025. Time out AM: 12:00 PM.', '2025-10-27 02:01:05'),
(116, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0041 (Aaron Magasin Cordova) for Sep. 30, 2025. Time out AM: 12:00 PM | Time in PM: 1:00 PM | Time out PM: 6:00 PM.', '2025-10-27 02:03:21'),
(117, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0041 (Aaron Magasin Cordova) for Oct. 1, 2025. Time out PM: 6:00 PM.', '2025-10-27 02:03:52'),
(118, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0041 (Aaron Magasin Cordova) for Oct. 4, 2025. Time out PM: 6:00 PM.', '2025-10-27 02:04:09'),
(119, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0041 (Aaron Magasin Cordova) for Oct. 6, 2025. Time out PM: 6:00 PM.', '2025-10-27 02:04:25'),
(120, 'admin', 'ADMIN', 'Created attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Sep. 28, 2025. Time in AM: in — | Time out AM: —.  Time in PM: — | Time out PM: —.', '2025-10-27 14:05:14'),
(121, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Sep. 29, 2025. No time changes.', '2025-10-27 14:05:19'),
(122, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Sep. 30, 2025. No time changes.', '2025-10-27 14:07:44'),
(123, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Sep. 27, 2025. No time changes.', '2025-10-27 14:12:42'),
(124, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Sep. 26, 2025. No time changes.', '2025-10-27 14:12:45'),
(125, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Sep. 26, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-10-27 14:12:53'),
(126, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Sep. 25, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-10-27 14:12:56'),
(127, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 1, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-10-27 14:13:29'),
(128, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 2, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-10-27 14:13:35'),
(129, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 3, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-10-27 14:13:36'),
(130, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 4, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-10-27 14:13:37'),
(131, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 1, 2025. Time out PM: 6:01 PM -> 6:00 PM.', '2025-10-27 14:13:39'),
(132, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 2, 2025. Time out PM: 6:01 PM -> 6:00 PM.', '2025-10-27 14:13:41'),
(133, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 3, 2025. Time out PM: 6:01 PM -> 6:00 PM.', '2025-10-27 14:13:42'),
(134, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 4, 2025. Time out PM: 6:01 PM -> 6:00 PM.', '2025-10-27 14:13:43'),
(135, 'Ragheil Lagat  Atacador', 'MANAGER', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 27, 2025. No time changes.', '2025-10-27 18:01:33'),
(136, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 6, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-10-27 19:13:26'),
(137, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 7, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-10-27 19:13:28'),
(138, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 8, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-10-27 19:13:28'),
(139, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 9, 2025. Time out PM: 6:09 PM -> 6:00 PM.', '2025-10-27 19:13:32'),
(140, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 8, 2025. Time out PM: 6:01 PM -> 6:00 PM.', '2025-10-27 19:13:35'),
(141, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 6, 2025. Time out PM: 6:01 PM -> 6:00 PM.', '2025-10-27 19:13:37'),
(142, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 7, 2025. Time out PM: 6:01 PM -> 6:00 PM.', '2025-10-27 19:13:37'),
(143, 'Ragheil Lagat  Atacador', 'MANAGER', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 28, 2025. Time out AM: 12:00 PM.', '2025-10-28 05:04:12'),
(144, 'Ragheil Lagat  Atacador', 'MANAGER', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 28, 2025. Time in PM: 1:04 PM.', '2025-10-28 05:04:16'),
(145, 'Ragheil Lagat  Atacador', 'MANAGER', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 28, 2025. Time in PM: 1:04 PM -> 1:00 PM.', '2025-10-28 05:04:31'),
(146, 'admin', 'ADMIN', 'Created attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 18, 2025. Time in AM: in 9:55 AM | Time out AM: —.  Time in PM: — | Time out PM: —.', '2025-10-28 07:01:50'),
(147, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 18, 2025. Time out AM: 12:00 PM.', '2025-10-28 07:02:02'),
(148, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 18, 2025. Time in PM: 3:21 PM.', '2025-10-28 07:02:11'),
(149, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 18, 2025. Time in PM: *cleared Time in PM*.', '2025-10-28 07:02:16'),
(150, 'admin', 'ADMIN', 'Created attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 25, 2025. Time in AM: in 9:28 AM | Time out AM: —.  Time in PM: — | Time out PM: —.', '2025-10-28 07:02:57'),
(151, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 25, 2025. Time out AM: 12:00 PM.', '2025-10-28 07:03:12'),
(152, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 25, 2025. Time out AM: 12:00 PM -> 11:41 PM.', '2025-10-28 07:03:30'),
(153, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 25, 2025. Time out AM: 11:41 PM -> 11:41 AM.', '2025-10-28 07:03:47'),
(154, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0030 (Gerome Tangara Hapson) for Oct. 25, 2025. No time changes.', '2025-10-28 07:03:49'),
(156, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0044). Changes: employee_type: \'Regular\' → \'Project-Based\'', '2025-10-30 03:16:20'),
(157, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0044). Changes: employee_type: \'Project-Based\' → \'Regular\'', '2025-10-30 05:10:10'),
(158, 'Ragheil Lagat  Atacador', 'MANAGER', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 30, 2025. Time out PM: 6:00 PM.', '2025-10-30 10:56:02'),
(159, 'admin', 'ADMIN', 'Updated Employee [CJIS-2025-0002]: Alan Tumulak Ang | Dept: DEP-001 | Position: POS-001 | SalaryType: Daily | Daily: ₱230.00 | Monthly: ₱5980.00 | Hourly: ₱28.75 | Branch: Lapasan (NULL)', '2025-11-01 09:55:14'),
(160, 'admin', 'ADMIN', 'Updated Employee [CJIS-2025-0002]: Alan Tumulak Ang | Dept: DEP-001 | Position: POS-001 | SalaryType: Daily | Daily: ₱999.00 | Monthly: ₱25974.00 | Hourly: ₱124.88 | Branch: N/A (NULL)', '2025-11-01 09:55:44'),
(161, 'admin', 'ADMIN', 'Updated Employee [CJIS-2025-0002]: Alan Tumulak Ang | Dept: DEP-001 | Position: POS-001 | SalaryType: Daily | Daily: ₱423.00 | Monthly: ₱10998.00 | Hourly: ₱52.88 | Branch: N/A (NULL)', '2025-11-01 10:03:01'),
(162, 'admin', 'ADMIN', 'Updated Employee [CJIS-2025-0002]: Alan Tumulak Ang | Dept: DEP-001 | Position: POS-001 | SalaryType: Daily | Daily: ₱400.00 | Monthly: ₱10400.00 | Hourly: ₱50.00 | Branch: N/A (NULL)', '2025-11-01 10:03:59'),
(163, 'admin', 'ADMIN', 'Updated Employee: {\"employee_id\":\"CJIS-2025-0002\",\"first_name\":\"Alan\",\"middle_name\":\"Tumulak\",\"last_name\":\"Ang\",\"email\":\"centraljuan.net@gmail.com\",\"contact_number\":\"09171799527\",\"date_of_birth\":\"2025-05-05\",\"department_id\":\"DEP-001\",\"position_id\":\"POS-001\",\"password\":\"password\",\"status\":\"active\",\"description\":null,\"image\":\"https:\\/\\/hris.centraljuan.com\\/images\\/1745833117-ca9cb037-49bc-4aee-9000-8ac028174a84.png\",\"base_salary\":\"423.00\",\"salary_type\":\"daily\",\"monthly_rate\":\"10998.00\",\"hourly_rate\":\"52.88\",\"reset_code\":\"802155\",\"employee_type\":\"Regular\",\"branch_id\":null,\"branch_name\":null,\"department_name\":\"IT DEPARTMENT\",\"position_name\":\"Manager\"}', '2025-11-01 10:10:58'),
(164, 'admin', 'ADMIN', 'Updated Employee: {\"employee_id\":\"CJIS-2025-0002\",\"first_name\":\"Alan\",\"middle_name\":\"Tumulak\",\"last_name\":\"Ang\",\"email\":\"centraljuan.net@gmail.com\",\"contact_number\":\"09171799527\",\"date_of_birth\":\"2025-05-05\",\"department_id\":\"DEP-001\",\"position_id\":\"POS-001\",\"password\":\"password\",\"status\":\"active\",\"description\":null,\"image\":\"https:\\/\\/hris.centraljuan.com\\/images\\/1745833117-ca9cb037-49bc-4aee-9000-8ac028174a84.png\",\"base_salary\":\"423.00\",\"salary_type\":\"daily\",\"monthly_rate\":\"10998.00\",\"hourly_rate\":\"52.88\",\"reset_code\":\"802155\",\"employee_type\":\"Regular\",\"branch_id\":1,\"branch_name\":\"PABAYO\",\"department_name\":\"IT DEPARTMENT\",\"position_name\":\"Manager\"}', '2025-11-01 10:11:20'),
(165, 'admin', 'ADMIN', 'Updated Employee: {\"employee_id\":\"CJIS-2025-0002\",\"first_name\":\"Alan\",\"middle_name\":\"Tumulak\",\"last_name\":\"Ang\",\"email\":\"centraljuan.net@gmail.com\",\"contact_number\":\"09171799527\",\"date_of_birth\":\"2025-05-05\",\"department_id\":\"DEP-001\",\"position_id\":\"POS-001\",\"password\":\"password\",\"status\":\"active\",\"description\":null,\"image\":\"https:\\/\\/hris.centraljuan.com\\/images\\/1745833117-ca9cb037-49bc-4aee-9000-8ac028174a84.png\",\"base_salary\":\"1000.00\",\"salary_type\":\"daily\",\"monthly_rate\":\"26000.00\",\"hourly_rate\":\"125.00\",\"reset_code\":\"802155\",\"employee_type\":\"Regular\",\"branch_id\":null,\"branch_name\":null,\"department_name\":\"IT DEPARTMENT\",\"position_name\":\"Manager\"}', '2025-11-01 10:11:38'),
(166, 'admin', 'ADMIN', 'Employee updated. BEFORE: {\"employee_id\":\"CJIS-2025-0002\",\"first_name\":\"Alan\",\"middle_name\":\"Tumulak\",\"last_name\":\"Ang\",\"email\":\"centraljuan.net@gmail.com\",\"contact_number\":\"09171799527\",\"date_of_birth\":\"2025-05-05\",\"department_id\":\"DEP-001\",\"position_id\":\"POS-001\",\"password\":\"password\",\"status\":\"active\",\"description\":null,\"image\":\"https:\\/\\/hris.centraljuan.com\\/images\\/1745833117-ca9cb037-49bc-4aee-9000-8ac028174a84.png\",\"base_salary\":\"1000.00\",\"salary_type\":\"daily\",\"monthly_rate\":\"26000.00\",\"hourly_rate\":\"125.00\",\"reset_code\":\"802155\",\"employee_type\":\"Regular\",\"branch_id\":null,\"branch_name\":null,\"department_name\":\"IT DEPARTMENT\",\"position_name\":\"Manager\"} || AFTER: {\"employee_id\":\"CJIS-2025-0002\",\"first_name\":\"Alan\",\"middle_name\":\"Tumulak\",\"last_name\":\"Ang\",\"email\":\"centraljuan.net@gmail.com\",\"contact_number\":\"09171799527\",\"date_of_birth\":\"2025-05-05\",\"department_id\":\"DEP-001\",\"position_id\":\"POS-001\",\"password\":\"password\",\"status\":\"active\",\"description\":null,\"image\":\"https:\\/\\/hris.', '2025-11-01 10:24:38'),
(167, 'admin', 'ADMIN', 'Employee updated. BEFORE: {\"employee_id\":\"CJIS-2025-0002\",\"first_name\":\"Alan\",\"middle_name\":\"Tumulak\",\"last_name\":\"Ang\",\"email\":\"centraljuan.net@gmail.com\",\"contact_number\":\"09171799527\",\"date_of_birth\":\"2025-05-05\",\"department_id\":\"DEP-001\",\"position_id\":\"POS-001\",\"password\":\"password\",\"status\":\"active\",\"description\":null,\"image\":\"https:\\/\\/hris.centraljuan.com\\/images\\/1745833117-ca9cb037-49bc-4aee-9000-8ac028174a84.png\",\"base_salary\":\"500.00\",\"salary_type\":\"daily\",\"monthly_rate\":\"13000.00\",\"hourly_rate\":\"62.50\",\"reset_code\":\"802155\",\"employee_type\":\"Regular\",\"branch_id\":null,\"branch_name\":null,\"department_name\":\"IT DEPARTMENT\",\"position_name\":\"Manager\"} || AFTER: {\"employee_id\":\"CJIS-2025-0002\",\"first_name\":\"Alan\",\"middle_name\":\"Tumulak\",\"last_name\":\"Ang\",\"email\":\"centraljuan.net@gmail.com\",\"contact_number\":\"09171799527\",\"date_of_birth\":\"2025-05-05\",\"department_id\":\"DEP-001\",\"position_id\":\"POS-001\",\"password\":\"password\",\"status\":\"active\",\"description\":null,\"image\":\"https:\\/\\/hris.ce', '2025-11-01 10:31:17'),
(168, 'admin', 'ADMIN', 'Updated Employee [CJIS-2025-0002] - Alan Tumulak Ang. Changes: Daily Rate: 1000.00 → 500.00; Monthly Rate: 26000.00 → 13000.00; Hourly Rate: 125.00 → 62.50. BEFORE: {\"employee_id\":\"CJIS-2025-0002\",\"first_name\":\"Alan\",\"middle_name\":\"Tumulak\",\"last_name\":\"Ang\",\"email\":\"centraljuan.net@gmail.com\",\"contact_number\":\"09171799527\",\"date_of_birth\":\"2025-05-05\",\"department_id\":\"DEP-001\",\"position_id\":\"POS-001\",\"password\":\"password\",\"status\":\"active\",\"description\":null,\"image\":\"https:\\/\\/hris.centraljuan.com\\/images\\/1745833117-ca9cb037-49bc-4aee-9000-8ac028174a84.png\",\"base_salary\":\"1000.00\",\"salary_type\":\"daily\",\"monthly_rate\":\"26000.00\",\"hourly_rate\":\"125.00\",\"reset_code\":\"802155\",\"employee_type\":\"Regular\",\"branch_id\":null,\"branch_name\":null,\"department_name\":\"IT DEPARTMENT\",\"position_name\":\"Manager\"} || AFTER: {\"employee_id\":\"CJIS-2025-0002\",\"first_name\":\"Alan\",\"middle_name\":\"Tumulak\",\"last_name\":\"Ang\",\"email\":\"centraljuan.net@gmail.com\",\"contact_number\":\"09171799527\",\"date_of_birth\":\"2025-0', '2025-11-01 10:32:04'),
(169, 'admin', 'ADMIN', 'Updated Employee [CJIS-2025-0002] - Alan Tumulak Ang. Changes: No changes. BEFORE: {\"employee_id\":\"CJIS-2025-0002\",\"first_name\":\"Alan\",\"middle_name\":\"Tumulak\",\"last_name\":\"Ang\",\"email\":\"centraljuan.net@gmail.com\",\"contact_number\":\"09171799527\",\"date_of_birth\":\"2025-05-05\",\"department_id\":\"DEP-001\",\"position_id\":\"POS-001\",\"password\":\"password\",\"status\":\"active\",\"description\":null,\"image\":\"https:\\/\\/hris.centraljuan.com\\/images\\/1745833117-ca9cb037-49bc-4aee-9000-8ac028174a84.png\",\"base_salary\":\"500.00\",\"salary_type\":\"daily\",\"monthly_rate\":\"13000.00\",\"hourly_rate\":\"62.50\",\"reset_code\":\"802155\",\"employee_type\":\"Regular\",\"branch_id\":null,\"branch_name\":null,\"department_name\":\"IT DEPARTMENT\",\"position_name\":\"Manager\"} || AFTER: {\"employee_id\":\"CJIS-2025-0002\",\"first_name\":\"Alan\",\"middle_name\":\"Tumulak\",\"last_name\":\"Ang\",\"email\":\"centraljuan.net@gmail.com\",\"contact_number\":\"09171799527\",\"date_of_birth\":\"2025-05-05\",\"department_id\":\"DEP-001\",\"position_id\":\"POS-001\",\"password\":\"password\",\"statu', '2025-11-01 10:34:26'),
(170, 'admin', 'ADMIN', 'Updated Employee [CJIS-2025-0002] - Alan Tumulak Ang. Changes: No changes. BEFORE: {\"employee_id\":\"CJIS-2025-0002\",\"first_name\":\"Alan\",\"middle_name\":\"Tumulak\",\"last_name\":\"Ang\",\"email\":\"centraljuan.net@gmail.com\",\"contact_number\":\"09171799527\",\"date_of_birth\":\"2025-05-05\",\"department_id\":\"DEP-001\",\"position_id\":\"POS-001\",\"password\":\"password\",\"status\":\"active\",\"description\":null,\"image\":\"https:\\/\\/hris.centraljuan.com\\/images\\/1745833117-ca9cb037-49bc-4aee-9000-8ac028174a84.png\",\"base_salary\":\"500.00\",\"salary_type\":\"daily\",\"monthly_rate\":\"13000.00\",\"hourly_rate\":\"62.50\",\"reset_code\":\"802155\",\"employee_type\":\"Regular\",\"branch_id\":null,\"branch_name\":null,\"department_name\":\"IT DEPARTMENT\",\"position_name\":\"Manager\"} || AFTER: {\"employee_id\":\"CJIS-2025-0002\",\"first_name\":\"Alan\",\"middle_name\":\"Tumulak\",\"last_name\":\"Ang\",\"email\":\"centraljuan.net@gmail.com\",\"contact_number\":\"09171799527\",\"date_of_birth\":\"2025-05-05\",\"department_id\":\"DEP-001\",\"position_id\":\"POS-001\",\"password\":\"password\",\"statu', '2025-11-01 10:34:39'),
(171, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Project-Based\' → \'Regular\'', '2025-11-01 10:47:00'),
(172, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Regular\' → \'Project-Based\'', '2025-11-01 10:47:04'),
(173, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Project-Based\' → \'Regular\'', '2025-11-01 10:52:28'),
(174, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Regular\' → \'Project-Based\'', '2025-11-01 10:52:31'),
(175, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Project-Based\' → \'Regular\'', '2025-11-01 11:01:02'),
(176, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Regular\' → \'Project-Based\'', '2025-11-01 11:01:08'),
(177, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Project-Based\' → \'Part-time\'', '2025-11-01 11:05:56'),
(178, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Part-time\' → \'Regular\'', '2025-11-01 11:05:58'),
(179, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Regular\' → \'Project-Based\'', '2025-11-01 12:59:56'),
(180, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Project-Based\' → \'Contractual\'', '2025-11-01 13:00:18'),
(181, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Contractual\' → \'Project-Based\'', '2025-11-01 13:01:44'),
(182, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'423.00\' → \'4231.00\'', '2025-11-01 13:01:57'),
(183, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'4231.00\' → \'423.00\', monthly_rate: \'0.00\' → \'10998\', hourly_rate: \'0.00\' → \'52.88\'', '2025-11-01 13:44:11'),
(184, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'423.00\' → \'20000\', monthly_rate: \'10998.00\' → \'20000\', hourly_rate: \'52.88\' → \'96.15\'', '2025-11-01 13:45:04'),
(185, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: No changes', '2025-11-01 13:47:43'),
(186, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'20000.00\' → \'423\', monthly_rate: \'20000.00\' → \'10998\', hourly_rate: \'96.15\' → \'52.88\'', '2025-11-01 13:47:54'),
(187, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'423.00\' → \'769.230769\', monthly_rate: \'10998.00\' → \'20000\', hourly_rate: \'52.88\' → \'96.153846\'', '2025-11-01 14:04:59'),
(188, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'769.23\' → \'423\', monthly_rate: \'20000.00\' → \'10998\', hourly_rate: \'96.15\' → \'52.875\'', '2025-11-01 14:05:29'),
(189, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'423.00\' → \'769.230769\', monthly_rate: \'10998.00\' → \'20000\', hourly_rate: \'52.88\' → \'96.153846\'', '2025-11-01 14:05:40'),
(190, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'769.23\' → \'423\', monthly_rate: \'20000.00\' → \'10998\', hourly_rate: \'96.15\' → \'52.875\'', '2025-11-01 14:10:34'),
(191, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'423.00\' → \'769.230769\', monthly_rate: \'10998.00\' → \'20000\', hourly_rate: \'52.88\' → \'96.153846\'', '2025-11-01 14:10:42'),
(192, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: monthly_rate: \'20000.00\' → \'19999.98\', hourly_rate: \'96.15\' → \'96.15375\'', '2025-11-01 14:11:12'),
(193, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'769.23\' → \'769.230769\', monthly_rate: \'19999.98\' → \'20000\', hourly_rate: \'96.15\' → \'96.153846\'', '2025-11-01 14:12:57'),
(194, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'769.23\' → \'423\', monthly_rate: \'20000.00\' → \'10998\', hourly_rate: \'96.15\' → \'52.875\'', '2025-11-01 14:13:12'),
(195, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: hourly_rate: \'52.88\' → \'52.875\'', '2025-11-01 14:18:34'),
(196, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'423.00\' → \'769.230769\', monthly_rate: \'10998.00\' → \'20000\', hourly_rate: \'52.88\' → \'96.153846\'', '2025-11-01 14:18:51'),
(197, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'769.23\' → \'423\', monthly_rate: \'20000.00\' → \'10998\', hourly_rate: \'96.15\' → \'52.875\'', '2025-11-01 14:26:11'),
(198, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'423.00\' → \'769.230769\', monthly_rate: \'10998.00\' → \'20000\', hourly_rate: \'52.88\' → \'96.153846\'', '2025-11-01 14:26:22'),
(199, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'769.23\' → \'769.230769\', hourly_rate: \'96.15\' → \'96.153846\'', '2025-11-01 14:26:40'),
(200, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'769.23\' → \'576.923077\', monthly_rate: \'20000.00\' → \'15000\', hourly_rate: \'96.15\' → \'72.115385\'', '2025-11-01 14:27:00'),
(201, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'576.92\' → \'769.230769\', monthly_rate: \'15000.00\' → \'20000\', hourly_rate: \'72.12\' → \'96.153846\', employee_type: \'Project-Based\' → \'Regular\', branch_name: \'PABAYO\' → \'TEST\'', '2025-11-01 14:27:42'),
(202, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: first_name: \'Ragheil\' → \'Ragheil1\', middle_name: \'Lagat \' → \'Lagat 1\', last_name: \'Atacador \' → \'Atacador 1\', email: \'ragheil123@gmail.com\' → \'1ragheil123@gmail.com\', contact_number: \'87000jejdj\' → \'87000jejdj1\', base_salary: \'769.23\' → \'576.923077\', monthly_rate: \'20000.00\' → \'15000\', hourly_rate: \'96.15\' → \'72.115385\', employee_type: \'Regular\' → \'Part-time\'', '2025-11-01 14:28:51'),
(203, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: first_name: \'Ragheil1\' → \'Ragheil\', middle_name: \'Lagat 1\' → \'Lagat \', last_name: \'Atacador 1\' → \'Atacador \', email: \'1ragheil123@gmail.com\' → \'ragheil123@gmail.com\', contact_number: \'87000jejdj1\' → \'87000jejdj\', base_salary: \'576.92\' → \'769.230769\', monthly_rate: \'15000.00\' → \'20000\', hourly_rate: \'72.12\' → \'96.153846\', employee_type: \'Part-time\' → \'Project-Based\', branch_name: \'TEST\' → \'PABAYO\'', '2025-11-01 14:29:35'),
(204, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: first_name: \'Ragheil\' → \'1Ragheil\', middle_name: \'Lagat \' → \'1Lagat \', last_name: \'Atacador \' → \'1Atacador \', email: \'ragheil123@gmail.com\' → \'1ragheil123@gmail.com\', contact_number: \'87000jejdj\' → \'187000jejdj\', base_salary: \'769.23\' → \'576.923077\', monthly_rate: \'20000.00\' → \'15000\', hourly_rate: \'96.15\' → \'72.115385\', employee_type: \'Project-Based\' → \'OJT\', branch_name: \'PABAYO\' → \'TEST\'', '2025-11-01 14:35:10'),
(205, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: first_name: \'1Ragheil\' → \'Ragheil\', middle_name: \'1Lagat \' → \'Lagat \', last_name: \'1Atacador \' → \'Atacador \', email: \'1ragheil123@gmail.com\' → \'ragheil123@gmail.com\', contact_number: \'187000jejdj\' → \'87000jejdj\', base_salary: \'576.92\' → \'423\', monthly_rate: \'15000.00\' → \'10998\', hourly_rate: \'72.12\' → \'52.875\'', '2025-11-01 14:35:36'),
(206, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: hourly_rate: \'52.88\' → \'52.875\', branch_name: \'TEST\' → \'PABAYO\'', '2025-11-01 14:35:51'),
(207, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'OJT\' → \'Project-Based\'', '2025-11-02 08:39:22'),
(208, 'Ragheil Lagat  Atacador ', 'MANAGER', 'Updated employee (ID: CJIS-2025-0019). Changes: email: \'ivanjaydaigdigan@gmail.com\' → \'ivanjaydaigdigan@gmail.com1\', monthly_rate: \'0.00\' → \'10998\', hourly_rate: \'0.00\' → \'52.875\'', '2025-11-02 08:48:13'),
(209, 'Ragheil Lagat  Atacador ', 'MANAGER', 'Updated employee (ID: CJIS-2025-0002). Changes: email: \'centraljuan.net@gmail.com\' → \'centraljuan.net@gmail.com1\'', '2025-11-02 08:48:22'),
(210, 'Ragheil Lagat  Atacador ', 'MANAGER', 'Updated employee (ID: CJIS-2025-0024). Changes: email: \'ricardorimando22@gmail.com\' → \'ricardorimando22@gmail.com1\', monthly_rate: \'0.00\' → \'10998\', hourly_rate: \'0.00\' → \'52.875\'', '2025-11-02 08:48:35'),
(211, 'Ragheil Lagat  Atacador ', 'MANAGER', 'Updated employee (ID: CJIS-2025-0028). Changes: email: \'busqu4red@gmail.com\' → \'busqu4red@gmail.com1\', monthly_rate: \'0.00\' → \'10998\', hourly_rate: \'0.00\' → \'52.875\'', '2025-11-02 08:48:50'),
(212, 'Ragheil Lagat  Atacador ', 'MANAGER', 'Updated employee (ID: CJIS-2025-0029). Changes: email: \'reyesquenniereyn@gmail.com\' → \'reyesquenniereyn@gmail.com1\', monthly_rate: \'0.00\' → \'12480\', hourly_rate: \'0.00\' → \'60\'', '2025-11-02 08:49:04'),
(213, 'Ragheil Lagat  Atacador ', 'MANAGER', 'Updated employee (ID: CJIS-2025-0030). Changes: email: \'hapsongerome@yahoo.com\' → \'hapsongerome@yahoo.com1\', monthly_rate: \'0.00\' → \'11180\', hourly_rate: \'0.00\' → \'53.75\'', '2025-11-02 08:49:17'),
(214, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0044). Changes: email: \'\' → \'atacadorragheil@gmail.com\'', '2025-11-02 08:59:01'),
(215, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0044). Changes: email: \'atacadorragheil@gmail.com\' → \'baboypigex@gmail.com\'', '2025-11-02 09:03:33'),
(216, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0044). Changes: No changes', '2025-11-02 09:10:41'),
(217, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0019). Changes: email: \'ivanjaydaigdigan@gmail.com1\' → \'forsale23123@gmail.com\', hourly_rate: \'52.88\' → \'52.875\'', '2025-11-02 09:29:41'),
(218, 'admin', 'ADMIN', 'Added new employee: [ID: CJIS-2025-0045] HAHA  HEHEHE | Email: ragheil123@gmail.com | Contact:  | DOB:  | Dept ID: DEP-001 | Position ID: 1 | Employee Type: Regular | Branch: PABAYO (ID: 1) | Salary Type: Daily | Daily: ₱0.00 | Monthly: ₱0.00 | Hourly: ₱0.00', '2025-11-03 16:13:17'),
(219, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'423.00\' → \'769.230769\', monthly_rate: \'10998.00\' → \'20000\', hourly_rate: \'52.88\' → \'96.153846\'', '2025-11-06 09:47:18'),
(220, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'769.23\' → \'423\', monthly_rate: \'20000.00\' → \'10998\', hourly_rate: \'96.15\' → \'52.875\'', '2025-11-06 10:00:04'),
(221, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'423.00\' → \'769.230769\', monthly_rate: \'10998.00\' → \'20000\', hourly_rate: \'52.88\' → \'96.153846\', salary_type: \'daily\' → \'monthly\'', '2025-11-06 10:00:20'),
(222, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'769.23\' → \'400\', monthly_rate: \'20000.00\' → \'10400\', hourly_rate: \'96.15\' → \'50\', salary_type: \'monthly\' → \'daily\'', '2025-11-06 10:00:56'),
(223, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 13, 2025. No time changes.', '2025-11-06 10:04:29'),
(224, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 13, 2025. Time out PM: 6:02 PM -> 6:00 PM.', '2025-11-06 10:04:36'),
(225, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 14, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:04:45'),
(226, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 15, 2025. Time out PM: 6:01 PM -> 6:00 PM.', '2025-11-06 10:04:46'),
(227, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 16, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:04:59'),
(228, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 17, 2025. Time out PM: 6:03 PM -> 6:01 PM.', '2025-11-06 10:05:00'),
(229, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 18, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:05:01'),
(230, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 20, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:05:02'),
(231, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 21, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:05:03'),
(232, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 22, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:05:04'),
(233, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 23, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:05:07'),
(234, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 24, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:05:08'),
(235, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 25, 2025. Time out PM: 6:10 PM -> 6:01 PM.', '2025-11-06 10:05:09'),
(236, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 17, 2025. Time in PM: 1:03 PM -> 1:00 PM.', '2025-11-06 10:05:38'),
(237, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 17, 2025. Time in PM: 1:00 PM -> 1:05 PM.', '2025-11-06 10:05:44'),
(238, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 17, 2025. Time in PM: 1:05 PM -> 1:01 PM.', '2025-11-06 10:05:54'),
(239, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 17, 2025. Time in PM: 1:01 PM -> 1:10 PM.', '2025-11-06 10:06:01'),
(240, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 17, 2025. Time in PM: 1:10 PM -> 1:00 PM.', '2025-11-06 10:06:07'),
(241, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 27, 2025. Time out PM: 6:15 PM -> 6:00 PM.', '2025-11-06 10:06:39'),
(242, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 28, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:06:47'),
(243, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 16, 2025. Time out PM: 6:01 PM -> 4:01 PM.', '2025-11-06 10:07:35'),
(244, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 16, 2025. Time out PM: 4:01 PM -> 3:01 PM.', '2025-11-06 10:07:42'),
(245, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 16, 2025. Time out PM: 3:01 PM -> 2:01 PM.', '2025-11-06 10:07:48'),
(246, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 16, 2025. Time out PM: 2:01 PM -> 2:00 PM.', '2025-11-06 10:07:53'),
(247, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 16, 2025. Time out PM: 2:00 PM -> 2:05 PM.', '2025-11-06 10:08:04'),
(248, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 16, 2025. Time out PM: 2:05 PM -> 2:00 PM.', '2025-11-06 10:08:13'),
(249, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'400.00\' → \'450\', monthly_rate: \'10400.00\' → \'11700\', hourly_rate: \'50.00\' → \'56.25\'', '2025-11-06 10:08:59'),
(250, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 17, 2025. Time out PM: 6:01 PM -> 2:00 PM.', '2025-11-06 10:09:13'),
(251, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 14, 2025. Time out PM: 6:01 PM -> 6:00 PM.', '2025-11-06 10:22:32'),
(252, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 15, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:22:36'),
(253, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 15, 2025. Time out PM: 6:01 PM -> 6:00 PM.', '2025-11-06 10:22:51'),
(254, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 15, 2025. Time in PM: 12:36 PM -> 12:00 PM.', '2025-11-06 10:22:57'),
(255, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 15, 2025. Time in PM: 12:00 PM -> 1:00 PM.', '2025-11-06 10:23:01'),
(256, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 16, 2025. Time in PM: 12:59 PM -> 1:00 PM.', '2025-11-06 10:23:13'),
(257, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 17, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:23:18'),
(258, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:23:18'),
(259, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 17, 2025. Time in AM: 9:03 AM -> 9:00 AM.', '2025-11-06 10:23:24'),
(260, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time out PM: 6:01 PM -> 6:00 PM.', '2025-11-06 10:23:33'),
(261, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. No time changes.', '2025-11-06 10:23:41');
INSERT INTO `logs` (`log_id`, `user_full_name`, `user_role`, `action`, `created_at`) VALUES
(262, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 20, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:23:55'),
(263, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 21, 2025. Time out PM: 6:04 PM -> 6:01 PM.', '2025-11-06 10:23:56'),
(264, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 22, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:23:57'),
(265, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 23, 2025. Time out PM: 6:25 PM -> 6:01 PM.', '2025-11-06 10:23:58'),
(266, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 24, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:23:59'),
(267, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 25, 2025. Time out PM: 6:09 PM -> 6:01 PM.', '2025-11-06 10:24:00'),
(268, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 27, 2025. Time out PM: 6:05 PM -> 6:01 PM.', '2025-11-06 10:24:03'),
(269, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 28, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:24:04'),
(270, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 29, 2025. Time out PM: 6:00 PM -> 6:01 PM.', '2025-11-06 10:24:05'),
(271, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time in AM: 9:00 AM -> 8:30 AM.', '2025-11-06 10:24:15'),
(272, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time out PM: 6:00 PM -> 6:02 PM.', '2025-11-06 10:27:14'),
(273, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time in PM: 1:00 PM -> 1:02 PM.', '2025-11-06 10:27:24'),
(274, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time in PM: 1:02 PM -> 12:02 PM.', '2025-11-06 10:27:30'),
(275, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time in PM: 12:02 PM -> 12:50 PM.', '2025-11-06 10:27:36'),
(276, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time in PM: 12:50 PM -> 12:09 PM.', '2025-11-06 10:27:42'),
(277, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time in PM: 12:09 PM -> 12:59 PM.', '2025-11-06 10:27:49'),
(278, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time in PM: 12:59 PM -> 12:00 PM.', '2025-11-06 10:28:00'),
(279, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time in PM: 12:00 PM -> 1:00 PM.', '2025-11-06 10:28:06'),
(280, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 16, 2025. Time in AM: in 8:32 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:00 PM -> *cleared time out PM*.', '2025-11-06 10:29:18'),
(281, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 17, 2025. Time in AM: in 9:00 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-06 10:29:20'),
(282, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time in AM: in 8:30 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:02 PM -> *cleared time out PM*.', '2025-11-06 10:29:21'),
(283, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 20, 2025. Time in AM: in 8:31 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-06 10:29:23'),
(284, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0024). Changes: base_salary: \'423.00\' → \'576.923077\', monthly_rate: \'10998.00\' → \'15000\', hourly_rate: \'52.88\' → \'72.115385\', salary_type: \'daily\' → \'monthly\'', '2025-11-06 10:29:59'),
(285, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0024). Changes: base_salary: \'576.92\' → \'15000\', monthly_rate: \'15000.00\' → \'390000\', hourly_rate: \'72.12\' → \'1875\', salary_type: \'monthly\' → \'daily\'', '2025-11-06 10:36:59'),
(286, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0024). Changes: base_salary: \'15000.00\' → \'576.92\', monthly_rate: \'390000.00\' → \'15000\', hourly_rate: \'1875.00\' → \'61.64\', salary_type: \'daily\' → \'monthly\'', '2025-11-06 10:37:07'),
(287, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0024). Changes: monthly_rate: \'15000.00\' → \'14999.92\', hourly_rate: \'61.64\' → \'72.12\', salary_type: \'monthly\' → \'daily\'', '2025-11-06 10:39:26'),
(288, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0024). Changes: monthly_rate: \'14999.92\' → \'15000\', hourly_rate: \'72.12\' → \'61.64\', salary_type: \'daily\' → \'monthly\'', '2025-11-06 11:28:42'),
(289, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 2, 2025. Time out PM: 6:00 PM -> 2:00 PM.', '2025-11-06 11:55:21'),
(290, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 21, 2025. Time out PM: 6:01 PM -> 2:01 PM.', '2025-11-06 11:55:33'),
(291, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 21, 2025. Time out PM: 2:01 PM -> 6:01 PM.', '2025-11-06 11:55:46'),
(292, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0024). Changes: monthly_rate: \'15000.00\' → \'14999.92\', hourly_rate: \'61.64\' → \'72.12\', salary_type: \'monthly\' → \'daily\'', '2025-11-06 13:44:40'),
(293, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0024). Changes: monthly_rate: \'14999.92\' → \'15000\', hourly_rate: \'72.12\' → \'61.64\', salary_type: \'daily\' → \'monthly\'', '2025-11-06 13:45:01'),
(294, 'admin', 'ADMIN', 'Created attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 16, 2025. Time in AM: in 9:00 AM | Time out AM: —.  Time in PM: — | Time out PM: —.', '2025-11-06 13:50:04'),
(295, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 16, 2025. Time out AM: 12:00 PM.', '2025-11-06 13:51:10'),
(296, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 16, 2025. Time in AM: *cleared Time in AM* | Time out AM: *cleared Time out AM*.', '2025-11-06 14:01:37'),
(297, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 18, 2025. Time out PM: 6:01 PM -> 3:01 PM.', '2025-11-06 14:47:04'),
(298, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 18, 2025. Time out PM: 3:01 PM -> 3:00 PM.', '2025-11-06 14:47:12'),
(299, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 18, 2025. Time in PM: *cleared Time in PM* | Time out PM: *cleared Time out PM*.', '2025-11-06 14:47:36'),
(300, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 18, 2025. Time out AM: 12:00 PM -> 11:00 PM.', '2025-11-06 14:47:51'),
(301, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 18, 2025. Time out AM: 11:00 PM -> 11:00 AM.', '2025-11-06 14:47:58'),
(302, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 16, 2025. Time in AM: 9:00 AM.', '2025-11-07 02:09:54'),
(303, 'admin', 'ADMIN', 'Created attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 17, 2025. Time in AM: in 9:00 AM | Time out AM: —.  Time in PM: — | Time out PM: —.', '2025-11-07 02:09:59'),
(304, 'admin', 'ADMIN', 'Created attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time in AM: in 9:00 AM | Time out AM: —.  Time in PM: — | Time out PM: —.', '2025-11-07 02:10:03'),
(305, 'admin', 'ADMIN', 'Created attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 20, 2025. Time in AM: in 9:00 AM | Time out AM: —.  Time in PM: — | Time out PM: —.', '2025-11-07 02:10:08'),
(306, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 16, 2025. Time in AM: *cleared Time in AM*.', '2025-11-07 02:15:54'),
(307, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 17, 2025. Time in AM: *cleared Time in AM*.', '2025-11-07 02:15:55'),
(308, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 18, 2025. Time in AM: *cleared Time in AM*.', '2025-11-07 02:16:00'),
(309, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 20, 2025. Time in AM: *cleared Time in AM*.', '2025-11-07 02:17:15'),
(310, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 21, 2025. Time out PM: 6:01 PM -> 4:01 PM.', '2025-11-07 02:17:26'),
(311, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 21, 2025. Time out PM: 4:01 PM -> 2:01 PM.', '2025-11-07 02:17:48'),
(312, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 21, 2025. Time out PM: 2:01 PM -> 3:01 PM.', '2025-11-07 02:17:59'),
(313, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 21, 2025. Time out PM: 3:01 PM -> 5:01 PM.', '2025-11-07 02:18:15'),
(314, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 21, 2025. Time out PM: 5:01 PM -> 6:01 PM.', '2025-11-07 02:18:25'),
(315, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 20, 2025. Time in AM: 9:00 AM.', '2025-11-07 02:18:43'),
(316, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 20, 2025. Time out AM: 11:00 AM.', '2025-11-07 02:18:49'),
(317, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 20, 2025. Time in AM: *cleared Time in AM* | Time out AM: *cleared Time out AM*.', '2025-11-07 02:20:54'),
(318, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 21, 2025. Time out PM: 6:01 PM -> 3:01 PM.', '2025-11-07 02:20:57'),
(319, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 21, 2025. Time out PM: 3:01 PM -> 3:00 PM.', '2025-11-07 02:21:01'),
(320, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 20, 2025. Time in PM: 1:00 PM.', '2025-11-07 02:37:42'),
(321, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 20, 2025. Time out PM: 6:00 PM.', '2025-11-07 02:37:50'),
(322, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'450.00\' → \'423\', monthly_rate: \'11700.00\' → \'10998\', hourly_rate: \'56.25\' → \'45.2\', salary_type: \'daily\' → \'monthly\'', '2025-11-07 02:42:11'),
(323, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: hourly_rate: \'45.20\' → \'52.88\', salary_type: \'monthly\' → \'daily\'', '2025-11-07 02:45:07'),
(324, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'423.00\' → \'1000\', monthly_rate: \'10998.00\' → \'26000\', hourly_rate: \'52.88\' → \'125\'', '2025-11-07 02:51:49'),
(325, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: hourly_rate: \'125.00\' → \'106.85\', salary_type: \'daily\' → \'monthly\'', '2025-11-07 03:07:08'),
(326, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0031). Changes: base_salary: \'510.00\' → \'0\', salary_type: \'daily\' → \'monthly\'', '2025-11-07 03:08:01'),
(327, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0031). Changes: base_salary: \'0.00\' → \'384.62\', monthly_rate: \'0.00\' → \'10000\', hourly_rate: \'0.00\' → \'41.1\'', '2025-11-07 03:15:23'),
(328, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0031). Changes: No changes', '2025-11-07 03:16:44'),
(329, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0031). Changes: monthly_rate: \'10000.00\' → \'10000.12\', hourly_rate: \'41.10\' → \'48.08\', salary_type: \'monthly\' → \'daily\'', '2025-11-07 03:17:27'),
(330, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 13, 2025. Time in AM: in 8:38 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:00 PM -> *cleared time out PM*.', '2025-11-07 04:38:30'),
(331, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 15, 2025. Time in AM: in 8:30 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:00 PM -> *cleared time out PM*.', '2025-11-07 04:38:59'),
(332, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Project-Based\' → \'Regular\'', '2025-11-07 07:38:31'),
(333, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0024). Changes: No changes', '2025-11-07 12:29:58'),
(334, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0024). Changes: monthly_rate: \'15000.00\' → \'14999.92\', hourly_rate: \'61.64\' → \'72.12\', salary_type: \'monthly\' → \'daily\'', '2025-11-07 12:30:34'),
(335, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0024). Changes: monthly_rate: \'14999.92\' → \'15000\', hourly_rate: \'72.12\' → \'61.64\', salary_type: \'daily\' → \'monthly\'', '2025-11-07 12:31:09'),
(336, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0031). Changes: No changes', '2025-11-07 12:34:11'),
(337, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0031). Changes: monthly_rate: \'10000.12\' → \'10000\', hourly_rate: \'48.08\' → \'41.1\', salary_type: \'daily\' → \'monthly\'', '2025-11-07 12:34:41'),
(338, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 20, 2025. Time in AM: 8:57 AM -> 9:00 AM.', '2025-11-07 12:39:38'),
(339, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 21, 2025. Time in AM: 8:59 AM -> 9:00 AM.', '2025-11-07 12:39:42'),
(340, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Sep. 25, 2025. Time in AM: 8:53 AM -> 9:00 AM.', '2025-11-07 12:43:34'),
(341, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Sep. 25, 2025. Time out AM: 12:01 PM -> 12:00 PM | Time out PM: 6:04 PM -> 6:00 PM.', '2025-11-07 12:43:41'),
(342, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Sep. 26, 2025. Time out PM: 6:02 PM -> 6:00 PM.', '2025-11-07 12:43:44'),
(343, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Sep. 29, 2025. Time out PM: 6:02 PM -> 6:00 PM.', '2025-11-07 12:43:48'),
(344, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Sep. 30, 2025. Time in AM: 8:59 AM -> 9:59 AM.', '2025-11-07 12:43:51'),
(345, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Sep. 30, 2025. Time in AM: 9:59 AM -> 9:00 AM.', '2025-11-07 12:43:56'),
(346, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 16, 2025. Time in AM: 9:03 AM -> 9:00 AM | Time out PM: 6:01 PM -> 6:00 PM.', '2025-11-07 12:44:13'),
(347, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 17, 2025. Time in AM: 9:05 AM -> 9:00 AM | Time out PM: 6:03 PM -> 6:00 PM.', '2025-11-07 12:44:13'),
(348, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 20, 2025. Time out PM: 6:04 PM -> 6:00 PM.', '2025-11-07 12:44:15'),
(349, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 22, 2025. Time in AM: 9:04 AM -> 9:00 AM.', '2025-11-07 12:44:18'),
(350, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 22, 2025. Time out PM: 6:13 PM -> 6:00 PM.', '2025-11-07 12:44:22'),
(351, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 23, 2025. Time out PM: 6:20 PM -> 6:00 PM.', '2025-11-07 12:44:22'),
(352, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 28, 2025. Time in AM: 9:03 AM -> 9:00 AM | Time out PM: 6:03 PM -> 6:00 PM.', '2025-11-07 12:44:31'),
(353, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 9, 2025. Time in AM: 8:55 AM -> 9:00 AM.', '2025-11-07 12:45:17'),
(354, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 9, 2025. No time changes.', '2025-11-07 12:45:44'),
(355, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 8, 2025. Time in AM: 9:04 AM -> 9:00 AM.', '2025-11-07 12:46:30'),
(356, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 7, 2025. Time in AM: 9:02 AM -> 9:00 AM.', '2025-11-07 12:46:31'),
(357, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 7, 2025. Time out PM: 6:02 PM -> 6:00 PM.', '2025-11-07 12:46:35'),
(358, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 8, 2025. Time out PM: 6:01 PM -> 6:00 PM.', '2025-11-07 12:46:35'),
(359, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 1, 2025. Time in AM: 9:04 AM -> 9:00 AM.', '2025-11-07 12:46:43'),
(360, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 2, 2025. Time in AM: 8:48 AM -> 9:00 AM.', '2025-11-07 12:46:45'),
(361, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 3, 2025. Time in AM: 8:59 AM -> 9:00 AM.', '2025-11-07 12:46:47'),
(362, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 4, 2025. Time in AM: 8:59 AM -> 9:00 AM.', '2025-11-07 12:46:48'),
(363, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 1, 2025. Time out PM: 6:04 PM -> 6:00 PM.', '2025-11-07 12:46:52'),
(364, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 3, 2025. Time out PM: 6:35 PM -> 6:00 PM.', '2025-11-07 12:46:53'),
(365, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 4, 2025. Time out PM: 6:08 PM -> 6:00 PM.', '2025-11-07 12:46:54'),
(366, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0031 (Joric A. Labrador Jr.) for Oct. 11, 2025. Time out PM: 6:01 PM -> 6:00 PM.', '2025-11-07 12:46:58'),
(367, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 9, 2025. Time in AM: 8:30 AM -> 9:00 AM.', '2025-11-07 12:51:41'),
(368, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 8, 2025. Time in AM: 8:31 AM -> 9:00 AM.', '2025-11-07 12:51:44'),
(369, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 10, 2025. Time in AM: 8:41 AM -> 8:31 AM.', '2025-11-07 12:51:55'),
(370, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 11, 2025. Time out AM: 12:09 PM -> 12:10 PM.', '2025-11-07 12:52:09'),
(371, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 11, 2025. Time out AM: 12:10 PM -> 12:00 PM.', '2025-11-07 12:52:14'),
(372, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 13, 2025. No time changes.', '2025-11-07 12:52:20'),
(373, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: employee_type: \'Regular\' → \'Project-Based\'', '2025-11-07 13:33:12'),
(374, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'1000.00\' → \'400\', monthly_rate: \'26000.00\' → \'10400\', hourly_rate: \'106.85\' → \'50\', salary_type: \'monthly\' → \'daily\'', '2025-11-08 01:10:56'),
(375, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'400.00\' → \'500\', monthly_rate: \'10400.00\' → \'13000\', hourly_rate: \'50.00\' → \'62.5\'', '2025-11-08 01:12:52'),
(376, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0024). Changes: base_salary: \'576.92\' → \'500\', monthly_rate: \'15000.00\' → \'13000\', hourly_rate: \'61.64\' → \'62.5\', salary_type: \'monthly\' → \'daily\'', '2025-11-08 01:13:17'),
(377, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0024). Changes: No changes', '2025-11-08 01:14:49'),
(378, 'admin', 'ADMIN', 'Updated employee (ID: CJIS-2025-0001). Changes: base_salary: \'500.00\' → \'576.92\', monthly_rate: \'13000.00\' → \'15000\', hourly_rate: \'62.50\' → \'61.64\', salary_type: \'daily\' → \'monthly\'', '2025-11-08 01:16:23'),
(379, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 16, 2025. No time changes.', '2025-11-08 11:31:25'),
(380, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 30, 2025. No time changes.', '2025-11-08 15:24:03'),
(381, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 27, 2025. No time changes.', '2025-11-08 15:31:53'),
(382, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 27, 2025. No time changes.', '2025-11-08 15:32:19'),
(383, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 29, 2025. Time in AM: 8:41 AM -> 9:00 AM.', '2025-11-08 15:50:21'),
(384, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 30, 2025. Time in AM: 8:34 AM -> 8:00 AM.', '2025-11-08 15:50:24'),
(385, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 30, 2025. Time in AM: 8:00 AM -> 9:00 AM.', '2025-11-08 15:50:31'),
(386, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 20, 2025. Time in AM: in 8:32 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:52:36'),
(387, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 21, 2025. Time in AM: in 8:38 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:52:38'),
(388, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 22, 2025. Time in AM: in 8:30 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:52:39'),
(389, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 23, 2025. Time in AM: in 8:33 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:52:40'),
(390, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 24, 2025. Time in AM: in 8:36 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:52:42'),
(391, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 25, 2025. Time in AM: in 8:36 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:52:44'),
(392, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 27, 2025. Time in AM: in 8:38 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:00 PM -> *cleared time out PM*.', '2025-11-09 11:52:46'),
(393, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 28, 2025. Time in AM: in 8:30 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:52:48'),
(394, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 29, 2025. Time in AM: in 9:00 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:00 PM -> *cleared time out PM*.', '2025-11-09 11:52:49'),
(395, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Oct. 30, 2025. Time in AM: in 9:00 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:00 PM -> *cleared time out PM*.', '2025-11-09 11:52:51'),
(396, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0019 (Ivan Jay Orcajada Daigdigan) for Oct. 20, 2025. Time in AM: in 8:56 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:00 PM -> *cleared time out PM*.', '2025-11-09 11:53:11'),
(397, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0019 (Ivan Jay Orcajada Daigdigan) for Oct. 21, 2025. Time in AM: in 9:22 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:02 PM -> *cleared time out PM*.', '2025-11-09 11:53:13'),
(398, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0019 (Ivan Jay Orcajada Daigdigan) for Oct. 22, 2025. Time in AM: in 9:19 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:00 PM -> *cleared time out PM*.', '2025-11-09 11:53:14'),
(399, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0019 (Ivan Jay Orcajada Daigdigan) for Oct. 23, 2025. Time in AM: in 9:22 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:20 PM -> *cleared time out PM*.', '2025-11-09 11:53:16'),
(400, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0019 (Ivan Jay Orcajada Daigdigan) for Oct. 24, 2025. Time in AM: in 8:49 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:02 PM -> *cleared time out PM*.', '2025-11-09 11:53:17'),
(401, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0019 (Ivan Jay Orcajada Daigdigan) for Oct. 25, 2025. Time in AM: in 9:56 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:00 PM -> *cleared time out PM*.', '2025-11-09 11:53:18'),
(402, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0019 (Ivan Jay Orcajada Daigdigan) for Oct. 27, 2025. Time in AM: in 8:55 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:00 PM -> *cleared time out PM*.', '2025-11-09 11:53:20'),
(403, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0019 (Ivan Jay Orcajada Daigdigan) for Oct. 28, 2025. Time in AM: in 9:26 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:02 PM -> *cleared time out PM*.', '2025-11-09 11:53:22'),
(404, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0019 (Ivan Jay Orcajada Daigdigan) for Oct. 29, 2025. Time in AM: in 9:05 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:00 PM -> *cleared time out PM*.', '2025-11-09 11:53:24'),
(405, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 20, 2025. Time in AM: in — -> *cleared time in AM* | Time out AM: — -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:00 PM -> *cleared time out PM*.', '2025-11-09 11:53:36'),
(406, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 21, 2025. Time in AM: in 8:40 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 3:00 PM -> *cleared time out PM*.', '2025-11-09 11:53:37'),
(407, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 22, 2025. Time in AM: in 8:43 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:53:39'),
(408, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 23, 2025. Time in AM: in 8:33 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:53:41'),
(409, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 24, 2025. Time in AM: in 8:35 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:53:42'),
(410, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 25, 2025. Time in AM: in 8:26 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:53:44'),
(411, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 27, 2025. Time in AM: in 8:34 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:53:45'),
(412, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 28, 2025. Time in AM: in 8:32 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:53:46'),
(413, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 29, 2025. Time in AM: in 9:05 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:01 PM -> *cleared time out PM*.', '2025-11-09 11:53:48'),
(414, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Oct. 30, 2025. Time in AM: in 8:53 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: — -> *cleared time out PM*.', '2025-11-09 11:53:50'),
(415, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Atacador ) for Nov. 1, 2025 — — → *cleared time in AM*, — → *cleared time out AM*, — → *cleared time in PM*, — → *cleared time out PM*', '2025-11-09 12:28:37'),
(416, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Nov. 3, 2025. Time in AM: in 8:13 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:00 PM -> *cleared time out PM*.', '2025-11-09 13:50:50'),
(417, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0024 (ricardo  Rimando) for Nov. 3, 2025. Time in AM: in 8:18 AM -> *cleared time in AM* | Time out AM: 12:00 PM -> *cleared time out AM*.  Time in PM: 1:00 PM -> *cleared time in PM* | Time out PM: 6:17 PM -> *cleared time out PM*.', '2025-11-09 13:50:57'),
(418, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Nov. 1, 2025. Time in AM: 9:00 AM.', '2025-11-09 14:24:45'),
(419, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Nov. 1, 2025. Time out AM: 12:00 PM.', '2025-11-09 14:24:49'),
(420, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Nov. 1, 2025. Time in PM: 1:00 PM.', '2025-11-09 14:24:52'),
(421, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Nov. 1, 2025. Time out PM: 6:00 PM.', '2025-11-09 14:24:58'),
(422, 'admin', 'ADMIN', 'Cleared attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Nov. 3, 2025. Time in AM: in — -> *cleared time in AM* | Time out AM: — -> *cleared time out AM*.  Time in PM: — -> *cleared time in PM* | Time out PM: — -> *cleared time out PM*.', '2025-11-09 14:29:05'),
(423, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0001 (Ragheil Lagat  Atacador ) for Nov. 1, 2025. No time changes.', '2025-11-09 14:31:03'),
(424, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0028 (Mark   Busbus) for Oct. 29, 2025. Time in AM: 9:01 AM -> 9:00 AM.', '2025-11-09 16:58:15'),
(425, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0028 (Mark   Busbus) for Oct. 30, 2025. Time in AM: 9:09 AM -> 9:00 AM.', '2025-11-09 16:58:16'),
(426, 'admin', 'ADMIN', 'Update attendance for employee CJIS-2025-0028 (Mark   Busbus) for Oct. 30, 2025. Time out PM: 6:06 PM -> 6:00 PM.', '2025-11-09 16:58:22');

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

--
-- Table structure for table `overtime_settings`
--

CREATE TABLE `overtime_settings` (
  `overtime_id` int(11) NOT NULL,
  `overtime_start` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `overtime_settings`
--

INSERT INTO `overtime_settings` (`overtime_id`, `overtime_start`) VALUES
(1, '18:30:00');

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

--
-- Table structure for table `overtime_table`
--

CREATE TABLE `overtime_table` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `overtime` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `overtime_types`
--

CREATE TABLE `overtime_types` (
  `id` int(11) NOT NULL,
  `label` varchar(100) NOT NULL,
  `multiplier` decimal(4,2) NOT NULL,
  `is_enabled` tinyint(1) DEFAULT 1,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `pagibig_contribution`
--

CREATE TABLE `pagibig_contribution` (
  `pagibig_contribution_id` int(11) NOT NULL,
  `employee_id` varchar(15) DEFAULT NULL,
  `employee_name` varchar(150) NOT NULL,
  `pagibig_ID` varchar(20) NOT NULL,
  `employee_share` decimal(10,2) NOT NULL,
  `employer_share` decimal(10,2) NOT NULL,
  `salary` decimal(10,2) NOT NULL,
  `semi_monthly_salary` decimal(10,2) NOT NULL,
  `total_contribution` decimal(10,2) NOT NULL,
  `total_salary` decimal(10,2) NOT NULL,
  `override_employee_share` decimal(10,2) DEFAULT NULL,
  `is_override_enabled` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `pagibig_contribution`
--

INSERT INTO `pagibig_contribution` (`pagibig_contribution_id`, `employee_id`, `employee_name`, `pagibig_ID`, `employee_share`, `employer_share`, `salary`, `semi_monthly_salary`, `total_contribution`, `total_salary`, `override_employee_share`, `is_override_enabled`) VALUES
(146, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador ', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(147, 'CJIS-2025-0002', 'Alan Tumulak Ang', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(164, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(165, 'CJIS-2025-0020', 'Ailyn May Morcilla Tongol ', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(167, 'CJIS-2025-0022', 'Louis Gio Noval', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(169, 'CJIS-2025-0024', 'ricardo Rimando', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(172, 'CJIS-2025-0025', 'Sarfeil Curran', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(177, 'CJIS-2025-0028', 'Mark  Busbus', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, 105.00, 1),
(178, 'CJIS-2025-0029', 'Quennie Reyn Reyes', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(179, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, 220.00, 1),
(180, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, 220.00, 1),
(182, 'CJIS-2025-0033', 'Jasper Perote', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, 275.00, 1),
(183, 'CJIS-2025-0034', 'dummy test', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(186, 'CJIS-2025-0035', 'asd asd', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(187, 'CJIS-2025-0036', 'Yes No Yes', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(188, 'CJIS-2025-0037', 'Yes  No', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(195, 'CJIS-2025-0038', 'test test', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(196, 'CJIS-2025-0039', 'tesg aras', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(197, 'CJIS-2025-0040', 'Jeribrunne Cabrera', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(198, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(200, 'CJIS-2025-0042', 'this is my test account asd', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(201, 'CJIS-2025-0043', 'asd asd', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(202, 'CJIS-2025-0044', 'this  is  test account', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0),
(204, 'CJIS-2025-0045', 'HAHA HEHEHE', '', 239.72, 239.72, 11986.00, 5993.00, 479.44, 11746.28, NULL, 0);

--
-- Triggers `pagibig_contribution`
--
DELIMITER $$
CREATE TRIGGER `before_insert_pagibig_contribution` BEFORE INSERT ON `pagibig_contribution` FOR EACH ROW BEGIN
    -- Set employee and employer share to 2% of monthly salary
    SET NEW.employee_share = NEW.salary * 0.02;
    SET NEW.employer_share = NEW.salary * 0.02;

    -- Calculate total contribution (employee + employer share)
    SET NEW.total_contribution = NEW.employee_share + NEW.employer_share;

    -- Calculate total salary after employee contribution is deducted
    SET NEW.total_salary = NEW.salary - NEW.employee_share;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `before_update_pagibig_contribution` BEFORE UPDATE ON `pagibig_contribution` FOR EACH ROW BEGIN
    -- Ensure employee and employer share remain at 2%
    SET NEW.employee_share = NEW.salary * 0.02;
    SET NEW.employer_share = NEW.salary * 0.02;

    -- Recalculate total contribution when monthly_salary changes
    SET NEW.total_contribution = NEW.employee_share + NEW.employer_share;

    -- Recalculate total salary after employee contribution is deducted
    SET NEW.total_salary = NEW.salary - NEW.employee_share;
END
$$
DELIMITER ;

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

--
-- Table structure for table `pagibig_contributions_2025`
--

CREATE TABLE `pagibig_contributions_2025` (
  `id` int(11) NOT NULL,
  `salary_range_min` decimal(10,2) NOT NULL,
  `salary_range_max` decimal(10,2) NOT NULL,
  `employee_share` decimal(10,2) NOT NULL,
  `employer_share` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `pagibig_contributions_2025`
--

INSERT INTO `pagibig_contributions_2025` (`id`, `salary_range_min`, `salary_range_max`, `employee_share`, `employer_share`) VALUES
(1, 0.00, 1499.99, 50.00, 50.00),
(2, 1500.00, 999999.99, 100.00, 100.00);

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

--
-- Table structure for table `payroll`
--

CREATE TABLE `payroll` (
  `payroll_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `name` varchar(150) NOT NULL,
  `department_id` varchar(11) DEFAULT NULL,
  `position_id` varchar(50) DEFAULT NULL,
  `date_from` date NOT NULL,
  `date_until` date DEFAULT NULL,
  `total_days` decimal(10,2) DEFAULT NULL,
  `total_salary` decimal(10,2) DEFAULT NULL,
  `basic_salary` decimal(10,2) DEFAULT NULL,
  `total_basic_salary` decimal(10,2) DEFAULT NULL,
  `total_overtime_hours` decimal(10,2) DEFAULT 0.00,
  `final_overtime_hours` decimal(10,2) DEFAULT 0.00,
  `payroll_type` varchar(20) DEFAULT NULL,
  `loan_deduction_applied` decimal(10,2) DEFAULT 0.00,
  `contribution_deduction_type` enum('monthly','semi-monthly') DEFAULT 'monthly',
  `total_allowances` decimal(12,2) DEFAULT 0.00,
  `total_incentives` decimal(12,2) DEFAULT 0.00,
  `incentive_remarks` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payroll`
--

INSERT INTO `payroll` (`payroll_id`, `employee_id`, `name`, `department_id`, `position_id`, `date_from`, `date_until`, `total_days`, `total_salary`, `basic_salary`, `total_basic_salary`, `total_overtime_hours`, `final_overtime_hours`, `payroll_type`, `loan_deduction_applied`, `contribution_deduction_type`, `total_allowances`, `total_incentives`, `incentive_remarks`) VALUES
(217, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador ', 'DEP-001', 'POS-002', '2025-10-29', '2025-11-12', 1.00, 461.00, 576.92, 576.92, 0.00, 0.00, 'semi-monthly', 0.00, 'semi-monthly', 0.00, 0.00, NULL),
(218, 'CJIS-2025-0002', 'Alan Tumulak Ang', 'DEP-001', 'POS-001', '2025-10-29', '2025-11-12', 0.00, 0.00, 500.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(235, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', 'Admin-001', 'Admin001', '2025-10-29', '2025-11-12', 1.00, 461.00, 423.00, 423.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(236, 'CJIS-2025-0020', 'Ailyn May Morcilla Tongol ', '002', 'SALES-001', '2025-10-29', '2025-11-12', 0.00, 0.00, 400.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(238, 'CJIS-2025-0022', 'Louis Gio  Noval', '002', 'SALES-001', '2025-10-29', '2025-11-12', 0.00, 0.00, 430.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'semi-monthly', 0.00, 0.00, NULL),
(240, 'CJIS-2025-0024', 'ricardo  Rimando', 'DEP-001', 'POS-002', '2025-10-29', '2025-11-12', 0.00, 0.00, 500.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(243, 'CJIS-2025-0025', 'Sarfeil  Curran', '002', 'SALES-001', '2025-10-29', '2025-11-12', 0.00, 0.00, 430.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(248, 'CJIS-2025-0028', 'Mark   Busbus', 'tech -1', 'tech 2', '2025-10-29', '2025-11-12', 3.00, 1383.00, 423.00, 1269.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(249, 'CJIS-2025-0029', 'Quennie Reyn  Reyes', 'Admin-001', 'Admin001', '2025-10-29', '2025-11-12', 3.00, 1383.00, 480.00, 1440.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(250, 'CJIS-2025-0030', 'Gerome Tangara Hapson', 'tech -1', 'tech 2', '2025-10-29', '2025-11-12', 0.00, 0.00, 430.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(251, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', 'DEP-001', 'POS-001', '2025-10-29', '2025-11-12', 2.91, 1341.51, 384.62, 1119.24, 0.00, 0.00, 'semi-monthly', 0.00, 'semi-monthly', 0.00, 0.00, NULL),
(253, 'CJIS-2025-0033', 'Jasper  Perote', 'tech -1', 'tech 2', '2025-10-29', '2025-11-12', 3.00, 1383.00, 423.00, 1269.00, 0.00, 0.00, 'semi-monthly', 0.00, 'semi-monthly', 0.00, 0.00, NULL),
(254, 'CJIS-2025-0034', 'dummy  test', 'Admin-001', 'Admin002', '2025-10-29', '2025-11-12', 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(257, 'CJIS-2025-0035', 'asd  asd', '002', 'SALES-001', '2025-10-29', '2025-11-12', 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(258, 'CJIS-2025-0036', 'Yes No Yes', '002', 'SALES-001', '2025-10-29', '2025-11-12', 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(259, 'CJIS-2025-0037', 'Yes   No', 'Admin-001', 'Admin001', '2025-10-29', '2025-11-12', 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(266, 'CJIS-2025-0038', 'test  test', 'Admin-001', 'Admin001', '2025-10-29', '2025-11-12', 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(267, 'CJIS-2025-0039', 'tesg  aras', 'Admin-001', 'Admin001', '2025-10-29', '2025-11-12', 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(268, 'CJIS-2025-0040', 'Jeribrunne  Cabrera', '002', 'Sales-002', '2025-10-29', '2025-11-12', 0.00, 0.00, 423.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(269, 'CJIS-2025-0041', 'Aaron Magasin Cordova', 'Admin-001', 'Admin001', '2025-10-29', '2025-11-12', 1.53, 705.33, 400.00, 612.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(271, 'CJIS-2025-0042', 'this is my test account  asd', '002', 'SALES-001', '2025-10-29', '2025-11-12', 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(272, 'CJIS-2025-0043', 'asd  asd', '002', 'SALES-001', '2025-10-29', '2025-11-12', 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL),
(273, 'CJIS-2025-0044', 'this  is  test account', '002', 'SALES-001', '2025-10-29', '2025-11-12', 0.97, 447.17, 0.00, 0.00, 0.00, 0.00, 'semi-monthly', 0.00, 'semi-monthly', 0.00, 0.00, NULL),
(275, 'CJIS-2025-0045', 'HAHA  HEHEHE', 'DEP-001', '1', '2025-10-29', '2025-11-12', 0.00, 0.00, NULL, NULL, 0.00, 0.00, 'semi-monthly', 0.00, 'monthly', 0.00, 0.00, NULL);

--
-- Triggers `payroll`
--
DELIMITER $$
CREATE TRIGGER `before_insert_payroll` BEFORE INSERT ON `payroll` FOR EACH ROW BEGIN
  DECLARE total_loan DECIMAL(10,2);

  -- Calculate total loan credit (deduction) for the payroll period
  SELECT IFNULL(SUM(amount), 0) INTO total_loan
  FROM loan_journal_entry
  WHERE employee_id = NEW.employee_id
    AND entry_type = 'credit'
    AND DATE(entry_date) BETWEEN NEW.date_from AND NEW.date_until;

  -- Set the computed loan deduction to the payroll record
  SET NEW.loan_deduction_applied = total_loan;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `before_payroll_insert` BEFORE INSERT ON `payroll` FOR EACH ROW BEGIN
  DECLARE emp_department_id VARCHAR(11);
  DECLARE emp_position_id VARCHAR(50);

  -- Fetch department_id and position_id from employees table
  SELECT department_id, position_id INTO emp_department_id, emp_position_id 
  FROM employees WHERE employee_id = NEW.employee_id;

  -- Assign values to the new row
  SET NEW.department_id = emp_department_id;
  SET NEW.position_id = emp_position_id;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `before_payroll_update` BEFORE UPDATE ON `payroll` FOR EACH ROW BEGIN
  DECLARE emp_department_id VARCHAR(11);
  DECLARE emp_position_id VARCHAR(50);

  -- Fetch latest department_id and position_id from employees table
  SELECT department_id, position_id INTO emp_department_id, emp_position_id 
  FROM employees WHERE employee_id = NEW.employee_id;

  -- Update payroll data
  SET NEW.department_id = emp_department_id;
  SET NEW.position_id = emp_position_id;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `before_update_payroll` BEFORE UPDATE ON `payroll` FOR EACH ROW BEGIN
  DECLARE total_loan DECIMAL(10,2);

  -- Calculate total loan credit (deduction) for the payroll period
  SELECT IFNULL(SUM(amount), 0) INTO total_loan
  FROM loan_journal_entry
  WHERE employee_id = NEW.employee_id
    AND entry_type = 'credit'
    AND DATE(entry_date) BETWEEN NEW.date_from AND NEW.date_until;

  -- Set the computed loan deduction to the payroll record
  SET NEW.loan_deduction_applied = total_loan;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `before_update_total_salary` BEFORE UPDATE ON `payroll` FOR EACH ROW BEGIN
    DECLARE emp_salary DECIMAL(10,2);

    -- Get the employee's semi-monthly salary from salary_for_employee
    SELECT semi_monthly_salary 
    INTO emp_salary
    FROM salary_for_employee 
    WHERE employee_id = NEW.employee_id;

    -- Calculate the new total salary before updating the row
    IF emp_salary IS NOT NULL THEN
        SET NEW.total_salary = ROUND((emp_salary / 13) * NEW.total_days, 2);
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `calculate_total_basic_salary` BEFORE INSERT ON `payroll` FOR EACH ROW BEGIN
    SET NEW.total_basic_salary = NEW.basic_salary * NEW.total_days;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `calculate_total_overtime` BEFORE INSERT ON `payroll` FOR EACH ROW BEGIN
    DECLARE total_overtime DECIMAL(10,2);

    -- Calculate total overtime hours for the employee within the date range
    SELECT IFNULL(SUM(overtime_hours), 0) 
    INTO total_overtime
    FROM attendance 
    WHERE employee_id = NEW.employee_id 
    AND attendance_date BETWEEN NEW.date_from AND NEW.date_until;

    -- Assign the calculated value to total_overtime_hours
    SET NEW.total_overtime_hours = total_overtime;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `payroll_before_update` BEFORE UPDATE ON `payroll` FOR EACH ROW BEGIN
    DECLARE total_days_in_range INT;
    DECLARE total_days_credited DECIMAL(10,2);
    DECLARE emp_salary DECIMAL(10,2);

    -- Calculate total days in the range excluding Sundays
    SET total_days_in_range = (
        SELECT COUNT(*)
        FROM (
            SELECT DATE_ADD(NEW.date_from, INTERVAL n DAY) AS date
            FROM (
                SELECT @rownum := @rownum + 1 AS n
                FROM (SELECT 0 UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) t1,
                     (SELECT 0 UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) t2,
                     (SELECT @rownum := -1) r
            ) numbers
            WHERE DATE_ADD(NEW.date_from, INTERVAL n DAY) <= NEW.date_until
        ) AS date_range
        WHERE DAYOFWEEK(date) != 1  -- Exclude Sundays (1 = Sunday)
    );

    -- Calculate total days credited based on attendance
    SET total_days_credited = (
        SELECT COALESCE(SUM(days_credited), 0)
        FROM attendance
        WHERE 
            employee_id = NEW.employee_id
            AND attendance_date BETWEEN NEW.date_from AND NEW.date_until
    );

    -- Update total_days in payroll
    SET NEW.total_days = total_days_credited;

    -- Get the employee's semi-monthly salary
    SELECT semi_monthly_salary INTO emp_salary
    FROM salary_for_employee 
    WHERE employee_id = NEW.employee_id;

    -- Calculate total salary based on the semi-monthly salary and days credited
    IF emp_salary IS NOT NULL AND total_days_in_range > 0 THEN
        SET NEW.total_salary = ROUND((emp_salary / total_days_in_range) * total_days_credited, 2);
    ELSE
        SET NEW.total_salary = 0; -- Handle case where there are no valid days
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `payroll_insert` BEFORE INSERT ON `payroll` FOR EACH ROW BEGIN
    DECLARE salary DECIMAL(10, 2);
    
    -- Get the basic salary from the base_salary table
    SELECT basic_salary INTO salary
    FROM base_salary
    WHERE employee_id = NEW.employee_id;

    -- Set the basic_salary in the new payroll record
    SET NEW.basic_salary = salary;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `set_payroll_type` BEFORE INSERT ON `payroll` FOR EACH ROW BEGIN
    DECLARE day_of_until INT;

    SET day_of_until = DAY(NEW.date_until);

    IF day_of_until BETWEEN 10 AND 15 THEN
        SET NEW.payroll_type = 'semi-monthly';
    ELSEIF day_of_until BETWEEN 20 AND 31 THEN
        SET NEW.payroll_type = 'monthly';
    ELSE
        SET NEW.payroll_type = NULL; -- or 'unknown'
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `set_payroll_type_on_update` BEFORE UPDATE ON `payroll` FOR EACH ROW BEGIN
    DECLARE day_of_until INT;

    SET day_of_until = DAY(NEW.date_until);

    IF day_of_until BETWEEN 10 AND 15 THEN
        SET NEW.payroll_type = 'semi-monthly';
    ELSEIF day_of_until BETWEEN 20 AND 31 THEN
        SET NEW.payroll_type = 'monthly';
    ELSE
        SET NEW.payroll_type = NULL;
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `update_total_basic_salary` BEFORE UPDATE ON `payroll` FOR EACH ROW BEGIN
    SET NEW.total_basic_salary = NEW.basic_salary * NEW.total_days;
END
$$
DELIMITER ;

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

--
-- Table structure for table `payroll_allowance_exceptions`
--

CREATE TABLE `payroll_allowance_exceptions` (
  `exception_id` int(11) NOT NULL,
  `payroll_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `allowance_id` int(11) DEFAULT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `created_by` varchar(50) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `payroll_logs`
--

CREATE TABLE `payroll_logs` (
  `id` int(11) NOT NULL,
  `date_from` date NOT NULL,
  `date_until` date NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `payroll_logs`
--

INSERT INTO `payroll_logs` (`id`, `date_from`, `date_until`, `created_at`) VALUES
(121, '2025-05-14', '2025-05-27', '2025-05-31 07:41:46'),
(122, '2025-05-14', '2025-05-27', '2025-05-31 07:43:12'),
(123, '2025-05-14', '2025-05-27', '2025-05-31 07:45:27'),
(124, '2025-05-14', '2025-05-27', '2025-05-31 09:29:21'),
(125, '2025-05-28', '2025-06-13', '2025-06-13 07:57:03'),
(126, '2025-05-28', '2025-06-13', '2025-06-13 08:26:00'),
(127, '2025-06-14', '2025-06-28', '2025-06-25 02:06:20'),
(128, '2025-06-14', '2025-06-28', '2025-06-25 02:09:14'),
(129, '2025-06-14', '2025-06-28', '2025-06-28 08:42:20'),
(130, '2025-06-14', '2025-06-28', '2025-06-28 08:45:03'),
(131, '2025-06-14', '2025-06-28', '2025-06-28 08:53:22'),
(132, '2025-06-14', '2025-06-28', '2025-06-28 08:54:20'),
(133, '2025-06-14', '2025-06-28', '2025-06-28 08:55:51'),
(134, '2025-06-14', '2025-06-28', '2025-06-28 08:56:56'),
(135, '2025-06-14', '2025-06-28', '2025-06-28 08:57:37'),
(136, '2025-06-14', '2025-06-28', '2025-06-28 09:02:34'),
(137, '2025-06-14', '2025-06-28', '2025-06-28 09:06:52'),
(138, '2025-06-14', '2025-06-28', '2025-06-28 09:09:54'),
(139, '2025-06-14', '2025-06-28', '2025-06-28 09:22:40'),
(140, '2025-06-14', '2025-06-28', '2025-06-28 10:00:00'),
(141, '2025-07-01', '2025-07-02', '2025-07-02 05:29:29'),
(142, '2025-06-29', '2025-07-13', '2025-07-13 12:40:21'),
(143, '2025-06-29', '2025-07-13', '2025-07-14 00:17:11'),
(144, '2025-06-29', '2025-07-13', '2025-07-15 09:45:48'),
(145, '2025-07-14', '2025-07-28', '2025-07-24 09:06:07'),
(146, '2025-07-14', '2025-07-28', '2025-07-24 09:06:07'),
(147, '2025-07-14', '2025-07-25', '2025-07-28 01:49:35'),
(148, '2025-07-14', '2025-07-25', '2025-08-01 01:33:49'),
(149, '2025-05-29', '2025-06-13', '2025-08-02 03:33:03'),
(150, '2025-05-29', '2025-06-13', '2025-08-02 03:33:53'),
(151, '2025-05-13', '2025-05-28', '2025-08-02 03:35:58'),
(152, '2025-07-29', '2025-08-13', '2025-08-11 03:53:23'),
(153, '2025-07-28', '2025-08-13', '2025-08-11 08:39:53'),
(154, '2025-07-26', '2025-08-13', '2025-08-14 00:56:32'),
(155, '2025-07-26', '2025-08-13', '2025-08-14 02:12:07'),
(156, '2025-07-26', '2025-08-13', '2025-08-14 07:23:35'),
(157, '2025-08-14', '2025-08-28', '2025-08-21 01:13:38'),
(158, '2025-08-14', '2025-08-28', '2025-08-28 02:35:25'),
(159, '2025-08-14', '2025-08-28', '2025-08-28 02:40:17'),
(160, '2025-08-14', '2025-08-27', '2025-08-28 02:43:48'),
(161, '2025-08-13', '2025-08-13', '2025-08-30 00:31:43'),
(162, '2025-08-14', '2025-08-27', '2025-08-30 00:31:55'),
(163, '2025-08-28', '2025-09-13', '2025-09-10 05:23:18'),
(164, '2025-08-28', '2025-09-12', '2025-09-11 02:27:59'),
(165, '2025-08-28', '2025-09-12', '2025-09-11 03:27:49'),
(166, '2025-08-12', '2025-08-27', '2025-09-27 10:39:48'),
(167, '2025-09-13', '2025-09-27', '2025-09-29 03:54:59'),
(168, '2025-09-28', '2025-10-13', '2025-10-13 01:54:34'),
(169, '2025-09-28', '2025-10-13', '2025-10-27 14:13:47'),
(170, '2025-10-14', '2025-10-29', '2025-10-29 08:14:58'),
(171, '2025-10-14', '2025-10-29', '2025-10-29 08:15:03'),
(172, '2025-10-14', '2025-10-28', '2025-10-30 01:46:57'),
(173, '2025-10-14', '2025-10-28', '2025-10-30 03:14:29'),
(174, '2025-10-14', '2025-10-28', '2025-11-02 10:09:38'),
(175, '2025-10-14', '2025-10-28', '2025-11-02 10:09:38'),
(176, '2025-10-14', '2025-10-28', '2025-11-06 11:43:06'),
(177, '2025-10-14', '2025-10-28', '2025-11-06 13:18:07'),
(178, '2025-10-14', '2025-10-28', '2025-11-06 13:28:51'),
(179, '2025-10-01', '2025-10-02', '2025-11-06 13:32:12'),
(180, '2025-10-14', '2025-10-28', '2025-11-06 13:32:18'),
(181, '2025-10-01', '2025-10-02', '2025-11-06 13:32:26'),
(182, '2025-10-14', '2025-10-28', '2025-11-06 13:32:32'),
(183, '2025-10-14', '2025-10-28', '2025-11-07 04:50:45'),
(184, '2025-10-14', '2025-10-28', '2025-11-07 12:29:41'),
(185, '2025-09-28', '2025-10-13', '2025-11-07 12:41:37'),
(186, '2025-09-28', '2025-10-13', '2025-11-07 12:45:52'),
(187, '2025-10-14', '2025-10-30', '2025-11-07 14:28:51'),
(188, '2025-10-13', '2025-10-30', '2025-11-07 15:43:34'),
(189, '2025-10-14', '2025-10-30', '2025-11-07 15:43:45'),
(190, '2025-10-14', '2025-10-30', '2025-11-08 01:15:01'),
(191, '2025-10-14', '2025-10-30', '2025-11-08 15:40:58'),
(192, '2025-10-14', '2025-10-28', '2025-11-08 15:55:04'),
(193, '2025-10-14', '2025-10-28', '2025-11-08 15:56:27'),
(194, '2025-10-14', '2025-10-28', '2025-11-09 11:15:51'),
(195, '2025-10-14', '2025-10-28', '2025-11-09 12:22:30'),
(196, '2025-10-29', '2025-11-13', '2025-11-09 12:24:09'),
(197, '2025-10-29', '2025-11-13', '2025-11-09 12:32:56'),
(198, '2025-10-29', '2025-11-12', '2025-11-09 12:33:18'),
(199, '2025-10-29', '2025-11-13', '2025-11-09 12:33:42'),
(200, '2025-10-29', '2025-11-13', '2025-11-09 13:09:16'),
(201, '2025-10-29', '2025-11-13', '2025-11-09 13:49:24'),
(202, '2025-10-28', '2025-11-13', '2025-11-09 13:52:55'),
(203, '2025-10-28', '2025-11-13', '2025-11-09 13:53:30'),
(204, '2025-10-29', '2025-11-13', '2025-11-09 13:55:11'),
(205, '2025-10-29', '2025-11-13', '2025-11-09 14:31:12'),
(206, '2025-10-29', '2025-11-12', '2025-11-09 14:31:52'),
(207, '2025-10-29', '2025-11-11', '2025-11-09 15:48:41'),
(208, '2025-10-29', '2025-11-12', '2025-11-09 15:49:05');

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

--
-- Table structure for table `philhealth_contribution`
--

CREATE TABLE `philhealth_contribution` (
  `PH_contribution_id` int(11) NOT NULL,
  `employee_id` varchar(15) DEFAULT NULL,
  `employee_name` varchar(100) NOT NULL,
  `ph_id` varchar(20) NOT NULL,
  `salary` decimal(10,2) NOT NULL,
  `semi_monthly_salary` decimal(10,2) NOT NULL,
  `premium_rate` decimal(5,4) NOT NULL,
  `employee_share` decimal(10,2) NOT NULL,
  `employer_share` decimal(10,2) NOT NULL,
  `total_contribution` decimal(10,2) NOT NULL DEFAULT 0.00,
  `total_salary` decimal(10,2) NOT NULL,
  `override_employee_share` decimal(10,2) DEFAULT NULL,
  `is_override_enabled` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `philhealth_contribution`
--

INSERT INTO `philhealth_contribution` (`PH_contribution_id`, `employee_id`, `employee_name`, `ph_id`, `salary`, `semi_monthly_salary`, `premium_rate`, `employee_share`, `employer_share`, `total_contribution`, `total_salary`, `override_employee_share`, `is_override_enabled`) VALUES
(146, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador ', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(147, 'CJIS-2025-0002', 'Alan Tumulak Ang', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(164, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(165, 'CJIS-2025-0020', 'Ailyn May Morcilla Tongol ', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(167, 'CJIS-2025-0022', 'Louis Gio Noval', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(169, 'CJIS-2025-0024', 'ricardo Rimando', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(172, 'CJIS-2025-0025', 'Sarfeil Curran', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(177, 'CJIS-2025-0028', 'Mark  Busbus', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, 137.50, 1),
(178, 'CJIS-2025-0029', 'Quennie Reyn Reyes', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(179, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, 275.00, 1),
(180, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, 275.00, 1),
(182, 'CJIS-2025-0033', 'Jasper Perote', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, 210.00, 1),
(183, 'CJIS-2025-0034', 'dummy test', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(186, 'CJIS-2025-0035', 'asd asd', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(187, 'CJIS-2025-0036', 'Yes No Yes', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(188, 'CJIS-2025-0037', 'Yes  No', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(195, 'CJIS-2025-0038', 'test test', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(196, 'CJIS-2025-0039', 'tesg aras', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(197, 'CJIS-2025-0040', 'Jeribrunne Cabrera', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(198, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(200, 'CJIS-2025-0042', 'this is my test account asd', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(201, 'CJIS-2025-0043', 'asd asd', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(202, 'CJIS-2025-0044', 'this  is  test account', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0),
(204, 'CJIS-2025-0045', 'HAHA HEHEHE', '', 11986.00, 5993.00, 0.0000, 299.65, 299.65, 599.30, 11686.35, NULL, 0);

--
-- Triggers `philhealth_contribution`
--
DELIMITER $$
CREATE TRIGGER `calculate_shares` BEFORE INSERT ON `philhealth_contribution` FOR EACH ROW BEGIN
    -- Calculate total contribution based on monthly salary and premium rate
    DECLARE total_contribution DECIMAL(10,2);
    
    SET total_contribution = ROUND((NEW.salary * 0.05), 2); -- Assuming premium_rate is 0.05 (5%)
    
    -- Calculate employee and employer shares
    SET NEW.employee_share = ROUND((total_contribution / 2), 2);
    SET NEW.employer_share = ROUND((total_contribution / 2), 2);
    
    -- Update total contribution
    SET NEW.total_contribution = ROUND((NEW.employee_share + NEW.employer_share), 2);
    
    -- Deduct only employee share from the monthly salary to get the total salary
    SET NEW.total_salary = ROUND((NEW.salary - NEW.employee_share), 2);
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `calculate_shares_on_update` BEFORE UPDATE ON `philhealth_contribution` FOR EACH ROW BEGIN
    -- Calculate total contribution based on monthly salary and premium rate
    DECLARE total_contribution DECIMAL(10,2);
    
    SET total_contribution = ROUND((NEW.salary * 0.05), 2); -- Assuming premium_rate is 0.05 (5%)
    
    -- Calculate employee and employer shares
    SET NEW.employee_share = ROUND((total_contribution / 2), 2);
    SET NEW.employer_share = ROUND((total_contribution / 2), 2);
    
    -- Update total contribution
    SET NEW.total_contribution = ROUND((NEW.employee_share + NEW.employer_share), 2);
    
    -- Deduct only employee share from the monthly salary to get the total salary
    SET NEW.total_salary = ROUND((NEW.salary - NEW.employee_share), 2);
END
$$
DELIMITER ;

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

--
-- Table structure for table `philhealth_contributions_2025`
--

CREATE TABLE `philhealth_contributions_2025` (
  `id` int(11) NOT NULL,
  `salary_range_min` decimal(10,2) NOT NULL,
  `salary_range_max` decimal(10,2) NOT NULL,
  `premium_rate` decimal(5,4) NOT NULL,
  `employee_share` decimal(10,2) NOT NULL,
  `employer_share` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `philhealth_contributions_2025`
--

INSERT INTO `philhealth_contributions_2025` (`id`, `salary_range_min`, `salary_range_max`, `premium_rate`, `employee_share`, `employer_share`) VALUES
(1, 0.00, 9999.99, 0.0350, 175.00, 175.00),
(2, 10000.00, 79999.99, 0.0350, 175.00, 175.00),
(3, 80000.00, 999999.99, 0.0350, 1400.00, 1400.00);

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

--
-- Table structure for table `philippine_holidays`
--

CREATE TABLE `philippine_holidays` (
  `id` int(11) NOT NULL,
  `holiday_name` varchar(255) NOT NULL,
  `holiday_date` date NOT NULL,
  `credited_days` int(11) DEFAULT 1,
  `holiday_type` enum('Regular','Special Non-Working','Special Working') DEFAULT 'Regular',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `philippine_holidays`
--

INSERT INTO `philippine_holidays` (`id`, `holiday_name`, `holiday_date`, `credited_days`, `holiday_type`, `created_at`) VALUES
(1, 'Bagong Taon', '2025-01-01', 1, 'Regular', '2025-04-21 08:40:47'),
(2, 'Maundy Thursday', '2025-04-17', 1, 'Regular', '2025-04-21 08:40:47'),
(3, 'Good Friday', '2025-04-18', 1, 'Regular', '2025-04-21 08:40:47'),
(4, 'Araw ng Kagitingan', '2025-04-09', 1, 'Regular', '2025-04-21 08:40:47'),
(5, 'Labor Day', '2025-05-01', 1, 'Regular', '2025-04-21 08:40:47'),
(6, 'Independence Day', '2025-06-12', 1, 'Regular', '2025-04-21 08:40:47'),
(7, 'National Heroes Day', '2025-08-25', 1, 'Regular', '2025-04-21 08:40:47'),
(8, 'Bonifacio Day', '2025-11-30', 1, 'Regular', '2025-04-21 08:40:47'),
(9, 'Christmas Day', '2025-12-25', 1, 'Regular', '2025-04-21 08:40:47'),
(10, 'Rizal Day', '2025-12-30', 1, 'Regular', '2025-04-21 08:40:47'),
(11, 'Ninoy Aquino Day', '2025-08-21', 1, 'Special Non-Working', '2025-04-21 08:40:47'),
(12, 'All Saints’ Day', '2025-11-01', 1, 'Special Non-Working', '2025-04-21 08:40:47'),
(13, 'Chinese New Year', '2025-01-29', 1, 'Special Non-Working', '2025-04-21 08:40:47'),
(15, 'test hostinger', '2025-04-22', 1, 'Regular', '2025-04-22 02:16:18');

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

--
-- Table structure for table `positions`
--

CREATE TABLE `positions` (
  `position_id` varchar(50) NOT NULL,
  `position_name` varchar(255) NOT NULL,
  `department_id` varchar(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `positions`
--

INSERT INTO `positions` (`position_id`, `position_name`, `department_id`) VALUES
('1', 'OJT', 'DEP-001'),
('1230', 'trse', 'hD2'),
('213', 'weqwe', 'hD2'),
('23', 'dfs', 'hD2'),
('Admin001', 'Admin Staff', 'Admin-001'),
('Admin002', 'Store Manager', 'Admin-001'),
('asd2312', 'weq', 'hD2'),
('ha2', 'hakdog', 'Admin-001'),
('has', 'hasdo', 'hD2'),
('POS-001', 'Manager', 'DEP-001'),
('POS-002', 'Programmer', 'DEP-001'),
('ps', 'Hak', 'hD2'),
('qw12', 'qwea', 'hD2'),
('qwe99', 'sdasd', 'hD2'),
('SALES-001', 'Corporate Sales Professionall', '002'),
('Sales-002', 'Sales Staff', '002'),
('tech 1', 'Main Technician', 'tech -1'),
('tech 2', 'Greatest Technician Ever Live', 'tech -1'),
('TY1', 'DOC', 'DEP-007');

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

--
-- Table structure for table `push_subscriptions`
--

CREATE TABLE `push_subscriptions` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `endpoint` text NOT NULL,
  `p256dh` text NOT NULL,
  `auth` text NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `push_subscriptions`
--

INSERT INTO `push_subscriptions` (`id`, `user_id`, `endpoint`, `p256dh`, `auth`, `created_at`) VALUES
(1, 1, 'https://fcm.googleapis.com/fcm/send/e9abqO_YdWw:APA91bG2C3hn6do2hcuqaDKF8xZtu_QHXWdE516OjRItaE3MtehZJTuIZi6ELRWee5zdFoiylgAnm_YmvrRAAZ0-KTzmrvd0s4dLUSxB44xrlqQtXW7pey9lxHuTtK1vy3DETWWctH9k', 'BATE01tYvFa0Qw8PB4_EmejWUSC2bEWrpOTpEMX_XqnzBScr1lh6tMstNEC2b6Zn8Z9mX7-TU9A8NHBLnSjBjd8', 'VT_4M5eED8Px13lZzz5GTg', '2025-06-10 07:11:43'),
(2, 1, 'https://fcm.googleapis.com/fcm/send/fM7l07AwnAE:APA91bHEwGymIAtdSe-OFCfcDZKY0hdim6rFZRnYWTfjrz1G1Yb-rcaOfoeoyNA1ae8OMIXs87iX-1trWJS18BaFuNXUbQqSXVpSwD93aYxzun6tO7pPk8cCu1zHGEHwxLkblZ79XmD0', 'BKxvL6f0xaIToMYCmt0G2q7NdejQqOEV0zKNWc0ZhoqQzS2EzKosT9li3DWc3ZIktAzNpovNn1KZEZfI6lcFk0E', 'mzuLE7V3duCYSqhdw3eFvQ', '2025-06-11 06:25:55'),
(3, 1, 'https://fcm.googleapis.com/fcm/send/ctz6nloJ2Xk:APA91bGNbhdOnE2M4xwnV_zkh-JQMPXWfZTTxf3rg1NjZwH3-xZPDFcLNCl5QKC9ZAsM52DEmZYzbYfM8pyG7RWdYHWvXqIcBbkJwvU0THGLNwPWjN386c-wUkDbrSo0e2pzEy0uy003', 'BNUz_U_RmRZ0W3cfXFFY7n04BFGzn_YIoeAkyHcxTEul81ysnI7Ti8aKbHi0lOs-ylLNQ_3vanF-jWYQNZgnP10', 'emTGzooCB5ltvX5c7FjDtg', '2025-06-11 07:09:47');

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

--
-- Table structure for table `retro_adjustments`
--

CREATE TABLE `retro_adjustments` (
  `retro_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `amount` decimal(12,2) NOT NULL,
  `description` varchar(255) NOT NULL,
  `effective_date` date DEFAULT NULL,
  `created_by` varchar(50) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `status` enum('pending','applied','cancelled') NOT NULL DEFAULT 'pending',
  `applied_in_payroll_id` int(11) DEFAULT NULL,
  `applied_at` datetime DEFAULT NULL,
  `tax_in_current_payroll` tinyint(1) NOT NULL DEFAULT 1,
  `supporting_doc` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `reward_journal_entry`
--

CREATE TABLE `reward_journal_entry` (
  `journal_id` int(11) NOT NULL,
  `payroll_id` int(11) DEFAULT NULL,
  `employee_id` varchar(15) NOT NULL,
  `reward_rule_id` int(11) DEFAULT NULL,
  `amount` decimal(12,2) NOT NULL,
  `entry_date` datetime DEFAULT current_timestamp(),
  `payroll_cutoff` date DEFAULT NULL,
  `origin` varchar(50) DEFAULT 'manual',
  `description` varchar(255) DEFAULT NULL,
  `created_by` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `reward_rules`
--

CREATE TABLE `reward_rules` (
  `reward_rule_id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `min_total_hours` decimal(8,2) DEFAULT NULL,
  `min_days_credited` decimal(6,2) DEFAULT NULL,
  `payout_type` enum('fixed','per_hour','percentage') NOT NULL DEFAULT 'fixed',
  `payout_value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `is_active` tinyint(1) DEFAULT 1,
  `priority` int(11) DEFAULT 10,
  `applies_to_employee_type` varchar(50) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `role_approver_levels`
--

CREATE TABLE `role_approver_levels` (
  `role_id` int(11) NOT NULL,
  `approver_level` tinyint(1) DEFAULT NULL COMMENT '1 = level1, 2 = level2, NULL = not an approver',
  `updated_by` varchar(128) DEFAULT NULL,
  `updated_by_name` varchar(255) DEFAULT NULL,
  `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 `role_approver_levels`
--

INSERT INTO `role_approver_levels` (`role_id`, `approver_level`, `updated_by`, `updated_by_name`, `updated_at`) VALUES
(1, 2, '1', 'admin', '2025-10-27 13:20:47'),
(12, 1, '1', 'admin', '2025-10-27 13:20:52');

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

--
-- Table structure for table `salary_for_employee`
--

CREATE TABLE `salary_for_employee` (
  `salary_id` int(11) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `employee_name` varchar(150) NOT NULL,
  `department_name` varchar(100) NOT NULL,
  `position_name` varchar(100) NOT NULL,
  `position_level` int(11) NOT NULL,
  `step` int(11) NOT NULL,
  `salary` decimal(10,2) DEFAULT NULL,
  `semi_monthly_salary` decimal(10,2) DEFAULT NULL,
  `use_base_salary` tinyint(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `salary_for_employee`
--

INSERT INTO `salary_for_employee` (`salary_id`, `employee_id`, `employee_name`, `department_name`, `position_name`, `position_level`, `step`, `salary`, `semi_monthly_salary`, `use_base_salary`) VALUES
(171, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador ', 'IT DEPARTMENT', 'Programmer', 1, 1, 11986.00, 5993.00, 0),
(172, 'CJIS-2025-0002', 'Alan Tumulak Ang', 'IT DEPARTMENT', 'Manager', 1, 1, 11986.00, 5993.00, 0),
(189, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', 'Admin Department', 'Admin Staff', 1, 1, 11986.00, 5993.00, 0),
(190, 'CJIS-2025-0020', 'Ailyn May Morcilla Tongol ', 'SALES-1', 'Corporate Sales Professionall', 1, 1, 11986.00, 5993.00, 0),
(192, 'CJIS-2025-0022', 'Louis Gio Noval', 'SALES-1', 'Corporate Sales Professionall', 1, 1, 11986.00, 5993.00, 0),
(194, 'CJIS-2025-0024', 'ricardo Rimando', 'IT DEPARTMENT', 'Programmer', 1, 1, 11986.00, 5993.00, 0),
(197, 'CJIS-2025-0025', 'Sarfeil Curran', 'SALES-1', 'Corporate Sales Professionall', 1, 1, 11986.00, 5993.00, 0),
(202, 'CJIS-2025-0028', 'Mark  Busbus', 'Technician ', 'Greatest Technician Ever Live', 1, 1, 11986.00, 5993.00, 0),
(203, 'CJIS-2025-0029', 'Quennie Reyn Reyes', 'Admin Department', 'Admin Staff', 1, 1, 11986.00, 5993.00, 0),
(204, 'CJIS-2025-0030', 'Gerome Tangara Hapson', 'Technician ', 'Greatest Technician Ever Live', 1, 1, 11986.00, 5993.00, 0),
(205, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', 'IT DEPARTMENT', 'Manager', 1, 1, 11986.00, 5993.00, 0),
(207, 'CJIS-2025-0033', 'Jasper Perote', 'Technician ', 'Greatest Technician Ever Live', 1, 1, 11986.00, 5993.00, 0),
(208, 'CJIS-2025-0034', 'dummy test', 'Admin Department', 'Store Manager', 1, 1, 11986.00, 5993.00, 0),
(211, 'CJIS-2025-0035', 'asd asd', 'SALES-1', 'Corporate Sales Professionall', 1, 1, 11986.00, 5993.00, 0),
(212, 'CJIS-2025-0036', 'Yes No Yes', 'SALES-1', 'Corporate Sales Professionall', 1, 1, 11986.00, 5993.00, 0),
(213, 'CJIS-2025-0037', 'Yes  No', 'Admin Department', 'Admin Staff', 1, 1, 11986.00, 5993.00, 0),
(220, 'CJIS-2025-0038', 'test test', 'Admin Department', 'Admin Staff', 1, 1, 11986.00, 5993.00, 0),
(221, 'CJIS-2025-0039', 'tesg aras', 'Admin Department', 'Admin Staff', 1, 1, 11986.00, 5993.00, 0),
(222, 'CJIS-2025-0040', 'Jeribrunne Cabrera', 'SALES-1', 'Sales Staff', 1, 1, 11986.00, 5993.00, 0),
(223, 'CJIS-2025-0041', 'Aaron Magasin Cordova', 'Admin Department', 'Admin Staff', 1, 1, 11986.00, 5993.00, 0),
(225, 'CJIS-2025-0042', 'this is my test account asd', 'SALES-1', 'Corporate Sales Professionall', 1, 1, 11986.00, 5993.00, 0),
(226, 'CJIS-2025-0043', 'asd asd', 'SALES-1', 'Corporate Sales Professionall', 1, 1, 11986.00, 5993.00, 0),
(227, 'CJIS-2025-0044', 'this  is  test account', 'SALES-1', 'Corporate Sales Professionall', 1, 1, 11986.00, 5993.00, 0),
(229, 'CJIS-2025-0045', 'HAHA HEHEHE', 'IT DEPARTMENT', 'OJT', 1, 1, 11986.00, 5993.00, 0);

--
-- Triggers `salary_for_employee`
--
DELIMITER $$
CREATE TRIGGER `after_salary_insert` AFTER INSERT ON `salary_for_employee` FOR EACH ROW BEGIN
    -- Insert into SSS Contribution table


    -- Insert into PhilHealth Contribution table
    INSERT INTO philhealth_contribution (employee_id, employee_name, salary, semi_monthly_salary)
    VALUES (NEW.employee_id, NEW.employee_name, NEW.salary, NEW.semi_monthly_salary);

    -- Insert into Pag-IBIG Contribution table
    INSERT INTO pagibig_contribution (employee_id, employee_name, salary, semi_monthly_salary)
    VALUES (NEW.employee_id, NEW.employee_name, NEW.salary, NEW.semi_monthly_salary);
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `after_salary_update` AFTER UPDATE ON `salary_for_employee` FOR EACH ROW BEGIN
    -- Update SSS Contribution table
    UPDATE sss_contribution 
    SET employee_name = NEW.employee_name, 
        salary = NEW.salary, 
        semi_monthly_salary = NEW.semi_monthly_salary
    WHERE employee_id = NEW.employee_id;

    -- Update PhilHealth Contribution table
    UPDATE philhealth_contribution 
    SET employee_name = NEW.employee_name, 
        salary = NEW.salary, 
        semi_monthly_salary = NEW.semi_monthly_salary
    WHERE employee_id = NEW.employee_id;

    -- Update Pag-IBIG Contribution table
    UPDATE pagibig_contribution 
    SET employee_name = NEW.employee_name, 
        salary = NEW.salary, 
        semi_monthly_salary = NEW.semi_monthly_salary
    WHERE employee_id = NEW.employee_id;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `apply_sss_contribution` AFTER INSERT ON `salary_for_employee` FOR EACH ROW BEGIN
    DECLARE emp_employer_share DECIMAL(10,2);
    DECLARE emp_employee_share DECIMAL(10,2);
    
    -- Find the employer and employee share based on the salary
    SELECT employer_share, employee_share INTO emp_employer_share, emp_employee_share
    FROM sss_contribution_table
    WHERE NEW.salary BETWEEN salary_from AND salary_to
    LIMIT 1; -- Assuming there is only one applicable range

    -- If a valid share is found, insert or update the SSS contribution
    IF emp_employer_share IS NOT NULL AND emp_employee_share IS NOT NULL THEN
        INSERT INTO sss_contribution (employee_id, employee_name, salary, semi_monthly_salary, employer_share, employee_share)
        VALUES (NEW.employee_id, NEW.employee_name, NEW.salary, NEW.semi_monthly_salary, emp_employer_share, emp_employee_share)
        ON DUPLICATE KEY UPDATE
            employer_share = emp_employer_share,
            employee_share = emp_employee_share,
            salary = NEW.salary,
            semi_monthly_salary = NEW.semi_monthly_salary;
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `apply_sss_contribution_update` AFTER UPDATE ON `salary_for_employee` FOR EACH ROW BEGIN
    DECLARE emp_employer_share DECIMAL(10,2);
    DECLARE emp_employee_share DECIMAL(10,2);
    
    -- Find the employer and employee share based on the updated salary
    SELECT employer_share, employee_share INTO emp_employer_share, emp_employee_share
    FROM sss_contribution_table
    WHERE NEW.salary BETWEEN salary_from AND salary_to
    LIMIT 1; -- Assuming there is only one applicable range

    -- If a valid share is found, update the SSS contribution
    IF emp_employer_share IS NOT NULL AND emp_employee_share IS NOT NULL THEN
        UPDATE sss_contribution
        SET employer_share = emp_employer_share,
            employee_share = emp_employee_share,
            salary = NEW.salary,
            semi_monthly_salary = NEW.semi_monthly_salary
        WHERE employee_id = NEW.employee_id;
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `set_salary_before_insert` BEFORE INSERT ON `salary_for_employee` FOR EACH ROW BEGIN
    DECLARE monthly_salary DECIMAL(10,2);
    DECLARE semi_monthly_salary DECIMAL(10,2);

    IF NEW.use_base_salary THEN
        SELECT basic_salary * 26 
        INTO monthly_salary 
        FROM base_salary 
        WHERE employee_id = NEW.employee_id;
    ELSE
        SELECT 
            CASE NEW.step
                WHEN 1 THEN sg.Step1
                WHEN 2 THEN sg.Step2
                WHEN 3 THEN sg.Step3
                ELSE NULL
            END 
        INTO monthly_salary
        FROM salary_grades sg
        WHERE sg.GradeID = NEW.position_level;
    END IF;

    IF monthly_salary IS NOT NULL THEN
        SET semi_monthly_salary = ROUND((monthly_salary / 26) * 13, 2);
        SET NEW.salary = monthly_salary;
        SET NEW.semi_monthly_salary = semi_monthly_salary;
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `update_salary_before_update` BEFORE UPDATE ON `salary_for_employee` FOR EACH ROW BEGIN
    DECLARE new_monthly_salary DECIMAL(10,2);
    DECLARE new_semi_monthly_salary DECIMAL(10,2);

    IF NEW.use_base_salary THEN
        SELECT basic_salary * 26 
        INTO new_monthly_salary 
        FROM base_salary 
        WHERE employee_id = NEW.employee_id;
    ELSE
        SELECT 
            CASE NEW.step
                WHEN 1 THEN sg.Step1
                WHEN 2 THEN sg.Step2
                WHEN 3 THEN sg.Step3
                ELSE NULL
            END 
        INTO new_monthly_salary
        FROM salary_grades sg
        WHERE sg.GradeID = NEW.position_level;
    END IF;

    IF new_monthly_salary IS NOT NULL THEN
        SET new_semi_monthly_salary = ROUND((new_monthly_salary / 26) * 13, 2);
        SET NEW.salary = new_monthly_salary;
        SET NEW.semi_monthly_salary = new_semi_monthly_salary;
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `update_total_salary_after_salary_change` AFTER UPDATE ON `salary_for_employee` FOR EACH ROW BEGIN
    UPDATE payroll 
    SET total_salary = ROUND((NEW.semi_monthly_salary / 13) * total_days, 2)
    WHERE employee_id = NEW.employee_id;
END
$$
DELIMITER ;

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

--
-- Table structure for table `salary_grades`
--

CREATE TABLE `salary_grades` (
  `GradeID` int(11) NOT NULL,
  `PositionLevel` varchar(50) DEFAULT NULL,
  `Step1` decimal(10,2) DEFAULT NULL,
  `Step2` decimal(10,2) DEFAULT NULL,
  `Step3` decimal(10,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `salary_grades`
--

INSERT INTO `salary_grades` (`GradeID`, `PositionLevel`, `Step1`, `Step2`, `Step3`) VALUES
(1, 'Entry- Level', 11986.00, 11500.00, 12000.00),
(2, 'Junior-Level', 12500.00, 13000.00, 13500.00),
(3, 'Senior Staff\n', 14000.00, 14500.00, 15000.00),
(4, 'Supervisor\n', 15500.00, 16000.00, 16500.00),
(5, 'Assistant Manager\n', 17000.00, 17500.00, 18000.00),
(6, 'Manager\n', 18500.00, 19000.00, 19500.00);

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

--
-- Table structure for table `schedule_submissions`
--

CREATE TABLE `schedule_submissions` (
  `submission_id` int(11) NOT NULL,
  `submitter_id` varchar(100) DEFAULT NULL,
  `submitter_name` varchar(255) DEFAULT NULL,
  `employee_id` varchar(32) NOT NULL,
  `work_time_id` int(11) NOT NULL,
  `effective_date` date NOT NULL,
  `end_date` date DEFAULT NULL,
  `recurrence_type` enum('none','daily','weekly','monthly') DEFAULT 'none',
  `recurrence_interval` int(11) DEFAULT 1,
  `days_of_week` varchar(128) DEFAULT NULL,
  `occurrence_limit` int(11) DEFAULT NULL,
  `priority` int(11) DEFAULT 1,
  `comment` text DEFAULT NULL,
  `status` enum('pending','lvl1_approved','lvl2_approved','rejected','applied') NOT NULL DEFAULT 'pending',
  `approved_by_lvl1` varchar(100) DEFAULT NULL,
  `approved_at_lvl1` datetime DEFAULT NULL,
  `approved_by_lvl2` varchar(100) DEFAULT NULL,
  `approved_at_lvl2` datetime DEFAULT NULL,
  `applied_by` varchar(100) DEFAULT NULL,
  `applied_at` datetime DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `notes` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `schedule_submissions`
--

INSERT INTO `schedule_submissions` (`submission_id`, `submitter_id`, `submitter_name`, `employee_id`, `work_time_id`, `effective_date`, `end_date`, `recurrence_type`, `recurrence_interval`, `days_of_week`, `occurrence_limit`, `priority`, `comment`, `status`, `approved_by_lvl1`, `approved_at_lvl1`, `approved_by_lvl2`, `approved_at_lvl2`, `applied_by`, `applied_at`, `created_at`, `updated_at`, `notes`) VALUES
(11, '1', 'admin', 'CJIS-2025-0001', 5, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:25:10', 'admin', '2025-11-09 21:25:10', '2025-11-09 13:25:03', '2025-11-09 13:25:10', NULL),
(12, '1', 'admin', 'CJIS-2025-0024', 5, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:25:10', 'admin', '2025-11-09 21:25:10', '2025-11-09 13:25:05', '2025-11-09 13:25:10', NULL),
(13, '1', 'admin', 'CJIS-2025-0001', 2, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:25:34', 'admin', '2025-11-09 21:25:34', '2025-11-09 13:25:29', '2025-11-09 13:25:34', NULL),
(14, '1', 'admin', 'CJIS-2025-0024', 2, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:25:34', 'admin', '2025-11-09 21:25:34', '2025-11-09 13:25:31', '2025-11-09 13:25:34', NULL),
(15, '1', 'admin', 'CJIS-2025-0001', 2, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:30:00', 'admin', '2025-11-09 21:30:00', '2025-11-09 13:28:15', '2025-11-09 13:30:00', NULL),
(16, '1', 'admin', 'CJIS-2025-0024', 2, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:30:00', 'admin', '2025-11-09 21:30:00', '2025-11-09 13:28:18', '2025-11-09 13:30:00', NULL),
(17, '1', 'admin', 'CJIS-2025-0001', 5, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:33:01', 'admin', '2025-11-09 21:33:01', '2025-11-09 13:32:54', '2025-11-09 13:33:01', NULL),
(18, '1', 'admin', 'CJIS-2025-0024', 5, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:33:01', 'admin', '2025-11-09 21:33:01', '2025-11-09 13:32:56', '2025-11-09 13:33:01', NULL),
(19, '1', 'admin', 'CJIS-2025-0001', 2, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:33:25', 'admin', '2025-11-09 21:33:25', '2025-11-09 13:33:19', '2025-11-09 13:33:25', NULL),
(20, '1', 'admin', 'CJIS-2025-0024', 2, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:33:25', 'admin', '2025-11-09 21:33:25', '2025-11-09 13:33:21', '2025-11-09 13:33:25', NULL),
(21, '1', 'admin', 'CJIS-2025-0001', 4, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:37:26', 'admin', '2025-11-09 21:37:26', '2025-11-09 13:37:12', '2025-11-09 13:37:26', NULL),
(22, '1', 'admin', 'CJIS-2025-0024', 4, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:37:26', 'admin', '2025-11-09 21:37:26', '2025-11-09 13:37:16', '2025-11-09 13:37:26', NULL),
(23, '1', 'admin', 'CJIS-2025-0001', 5, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:42:59', 'admin', '2025-11-09 21:42:59', '2025-11-09 13:42:53', '2025-11-09 13:42:59', NULL),
(24, '1', 'admin', 'CJIS-2025-0024', 5, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:42:59', 'admin', '2025-11-09 21:42:59', '2025-11-09 13:42:55', '2025-11-09 13:42:59', NULL),
(25, '1', 'admin', 'CJIS-2025-0001', 2, '2025-11-01', '2025-11-01', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:43:35', 'admin', '2025-11-09 21:43:35', '2025-11-09 13:43:22', '2025-11-09 13:43:35', NULL),
(26, '1', 'admin', 'CJIS-2025-0024', 2, '2025-11-01', '2025-11-01', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:43:35', 'admin', '2025-11-09 21:43:35', '2025-11-09 13:43:24', '2025-11-09 13:43:35', NULL),
(27, '1', 'admin', 'CJIS-2025-0001', 2, '2025-11-03', '2025-11-03', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:43:35', 'admin', '2025-11-09 21:43:35', '2025-11-09 13:43:27', '2025-11-09 13:43:35', NULL),
(28, '1', 'admin', 'CJIS-2025-0024', 2, '2025-11-03', '2025-11-03', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:43:35', 'admin', '2025-11-09 21:43:35', '2025-11-09 13:43:29', '2025-11-09 13:43:35', NULL),
(29, '1', 'admin', 'CJIS-2025-0001', 2, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:44:13', 'admin', '2025-11-09 21:44:13', '2025-11-09 13:43:58', '2025-11-09 13:44:13', NULL),
(30, '1', 'admin', 'CJIS-2025-0024', 2, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:44:13', 'admin', '2025-11-09 21:44:13', '2025-11-09 13:44:00', '2025-11-09 13:44:13', NULL),
(31, '1', 'admin', 'CJIS-2025-0001', 5, '2025-11-03', '2025-11-03', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:44:13', 'admin', '2025-11-09 21:44:13', '2025-11-09 13:44:02', '2025-11-09 13:44:13', NULL),
(32, '1', 'admin', 'CJIS-2025-0024', 5, '2025-11-03', '2025-11-03', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:44:13', 'admin', '2025-11-09 21:44:13', '2025-11-09 13:44:04', '2025-11-09 13:44:13', NULL),
(33, '1', 'admin', 'CJIS-2025-0001', 5, '2025-11-01', '2025-11-01', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:44:13', 'admin', '2025-11-09 21:44:13', '2025-11-09 13:44:06', '2025-11-09 13:44:13', NULL),
(34, '1', 'admin', 'CJIS-2025-0024', 5, '2025-11-01', '2025-11-01', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:44:13', 'admin', '2025-11-09 21:44:13', '2025-11-09 13:44:08', '2025-11-09 13:44:13', NULL),
(35, '1', 'admin', 'CJIS-2025-0001', 5, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:47:17', 'admin', '2025-11-09 21:47:17', '2025-11-09 13:47:12', '2025-11-09 13:47:17', NULL),
(36, '1', 'admin', 'CJIS-2025-0001', 5, '2025-11-04', '2025-11-04', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:49:05', 'admin', '2025-11-09 21:49:05', '2025-11-09 13:48:55', '2025-11-09 13:49:05', NULL),
(37, '1', 'admin', 'CJIS-2025-0024', 5, '2025-11-04', '2025-11-04', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:49:05', 'admin', '2025-11-09 21:49:05', '2025-11-09 13:48:58', '2025-11-09 13:49:05', NULL),
(38, '1', 'admin', 'CJIS-2025-0024', 5, '2025-11-02', '2025-11-02', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:49:05', 'admin', '2025-11-09 21:49:05', '2025-11-09 13:49:00', '2025-11-09 13:49:05', NULL),
(39, '1', 'admin', 'CJIS-2025-0001', 2, '2025-11-01', '2025-11-01', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:52:18', 'admin', '2025-11-09 21:52:18', '2025-11-09 13:51:58', '2025-11-09 13:52:18', NULL),
(40, '1', 'admin', 'CJIS-2025-0024', 2, '2025-11-01', '2025-11-01', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:52:18', 'admin', '2025-11-09 21:52:18', '2025-11-09 13:52:01', '2025-11-09 13:52:18', NULL),
(41, '1', 'admin', 'CJIS-2025-0001', 2, '2025-11-03', '2025-11-03', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:52:18', 'admin', '2025-11-09 21:52:18', '2025-11-09 13:52:04', '2025-11-09 13:52:18', NULL),
(42, '1', 'admin', 'CJIS-2025-0001', 2, '2025-11-04', '2025-11-04', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:52:18', 'admin', '2025-11-09 21:52:18', '2025-11-09 13:52:06', '2025-11-09 13:52:18', NULL),
(43, '1', 'admin', 'CJIS-2025-0024', 2, '2025-11-04', '2025-11-04', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:52:18', 'admin', '2025-11-09 21:52:18', '2025-11-09 13:52:08', '2025-11-09 13:52:18', NULL),
(44, '1', 'admin', 'CJIS-2025-0024', 2, '2025-11-03', '2025-11-03', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:52:18', 'admin', '2025-11-09 21:52:18', '2025-11-09 13:52:10', '2025-11-09 13:52:18', NULL),
(45, '1', 'admin', 'CJIS-2025-0024', 5, '2025-11-09', '2025-11-09', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:57:50', 'admin', '2025-11-09 21:57:50', '2025-11-09 13:57:43', '2025-11-09 13:57:50', NULL),
(46, '1', 'admin', 'CJIS-2025-0001', 5, '2025-11-09', '2025-11-09', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 21:57:50', 'admin', '2025-11-09 21:57:50', '2025-11-09 13:57:46', '2025-11-09 13:57:50', NULL),
(47, '1', 'admin', 'CJIS-2025-0001', 2, '2025-11-03', '2025-11-03', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-09 22:29:44', 'admin', '2025-11-09 22:29:44', '2025-11-09 14:29:38', '2025-11-09 14:29:44', NULL),
(48, '1', 'admin', 'CJIS-2025-0001', 5, '2025-11-05', '2025-11-05', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-10 01:11:18', 'admin', '2025-11-10 01:11:18', '2025-11-09 17:11:07', '2025-11-09 17:11:18', NULL),
(49, '1', 'admin', 'CJIS-2025-0024', 5, '2025-11-05', '2025-11-05', 'none', 1, NULL, NULL, 1, NULL, 'applied', NULL, NULL, '1', '2025-11-10 01:11:18', 'admin', '2025-11-10 01:11:18', '2025-11-09 17:11:13', '2025-11-09 17:11:18', NULL);

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

--
-- Table structure for table `sss_contribution`
--

CREATE TABLE `sss_contribution` (
  `SSS_Contribution_id` int(11) NOT NULL,
  `employee_id` varchar(15) DEFAULT NULL,
  `employee_name` varchar(150) NOT NULL,
  `sss_number` varchar(10) NOT NULL,
  `employer_share` decimal(10,2) NOT NULL,
  `employee_share` decimal(10,2) NOT NULL,
  `salary` decimal(10,2) NOT NULL,
  `semi_monthly_salary` decimal(10,2) NOT NULL,
  `total_contribution` decimal(10,2) NOT NULL,
  `override_employee_share` decimal(10,2) DEFAULT NULL,
  `is_override_enabled` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `sss_contribution`
--

INSERT INTO `sss_contribution` (`SSS_Contribution_id`, `employee_id`, `employee_name`, `sss_number`, `employer_share`, `employee_share`, `salary`, `semi_monthly_salary`, `total_contribution`, `override_employee_share`, `is_override_enabled`) VALUES
(148, 'CJIS-2025-0001', 'Ragheil Lagat  Atacador ', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, 550.00, 1),
(149, 'CJIS-2025-0002', 'Alan Tumulak Ang', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(166, 'CJIS-2025-0019', 'Ivan Jay Orcajada Daigdigan', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(167, 'CJIS-2025-0020', 'Ailyn May Morcilla Tongol ', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(169, 'CJIS-2025-0022', 'Louis Gio Noval', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(171, 'CJIS-2025-0024', 'ricardo Rimando', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, 0.00, 1),
(174, 'CJIS-2025-0025', 'Sarfeil Curran', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(179, 'CJIS-2025-0028', 'Mark  Busbus', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, 262.50, 1),
(180, 'CJIS-2025-0029', 'Quennie Reyn Reyes', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(181, 'CJIS-2025-0030', 'Gerome Tangara Hapson', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, 550.00, 1),
(182, 'CJIS-2025-0031', 'Joric A. Labrador Jr.', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(184, 'CJIS-2025-0033', 'Jasper Perote', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, 525.00, 1),
(185, 'CJIS-2025-0034', 'dummy test', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(188, 'CJIS-2025-0035', 'asd asd', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(189, 'CJIS-2025-0036', 'Yes No Yes', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(190, 'CJIS-2025-0037', 'Yes  No', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(197, 'CJIS-2025-0038', 'test test', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(198, 'CJIS-2025-0039', 'tesg aras', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(199, 'CJIS-2025-0040', 'Jeribrunne Cabrera', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(200, 'CJIS-2025-0041', 'Aaron Magasin Cordova', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(202, 'CJIS-2025-0042', 'this is my test account asd', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(203, 'CJIS-2025-0043', 'asd asd', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(204, 'CJIS-2025-0044', 'this  is  test account', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0),
(206, 'CJIS-2025-0045', 'HAHA HEHEHE', '', 1210.00, 600.00, 11986.00, 5993.00, 1810.00, NULL, 0);

--
-- Triggers `sss_contribution`
--
DELIMITER $$
CREATE TRIGGER `before_insert_sss_contribution` BEFORE INSERT ON `sss_contribution` FOR EACH ROW BEGIN
    -- Calculate total contribution as the sum of employer_share and employee_share
    SET NEW.total_contribution = NEW.employer_share + NEW.employee_share;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `before_update_sss_contribution` BEFORE UPDATE ON `sss_contribution` FOR EACH ROW BEGIN
    -- Calculate total contribution as the sum of employer_share and employee_share
    SET NEW.total_contribution = NEW.employer_share + NEW.employee_share;
END
$$
DELIMITER ;

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

--
-- Table structure for table `sss_contributions_2025`
--

CREATE TABLE `sss_contributions_2025` (
  `id` int(11) NOT NULL,
  `salary_range_min` decimal(10,2) NOT NULL,
  `salary_range_max` decimal(10,2) NOT NULL,
  `monthly_salary_credit` decimal(10,2) NOT NULL,
  `employee_share` decimal(10,2) NOT NULL,
  `employer_share` decimal(10,2) NOT NULL,
  `total_contribution` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `sss_contributions_2025`
--

INSERT INTO `sss_contributions_2025` (`id`, `salary_range_min`, `salary_range_max`, `monthly_salary_credit`, `employee_share`, `employer_share`, `total_contribution`) VALUES
(1, 0.00, 5250.00, 5000.00, 250.00, 260.00, 510.00),
(2, 5250.00, 5749.99, 5500.00, 275.00, 560.00, 835.00),
(3, 5750.00, 6249.99, 6000.00, 300.00, 610.00, 910.00),
(4, 6250.00, 6749.99, 6500.00, 325.00, 660.00, 985.00),
(5, 6750.00, 7249.99, 7000.00, 350.00, 710.00, 1060.00),
(6, 7250.00, 7749.99, 7500.00, 375.00, 760.00, 1135.00),
(7, 7750.00, 8249.99, 8000.00, 400.00, 810.00, 1210.00),
(8, 8250.00, 8749.99, 8500.00, 425.00, 860.00, 1285.00),
(9, 8750.00, 9249.99, 9000.00, 450.00, 910.00, 1360.00),
(10, 9250.00, 9749.99, 9500.00, 475.00, 960.00, 1435.00),
(11, 9750.00, 10249.99, 10000.00, 500.00, 1010.00, 1510.00),
(12, 10250.00, 10749.99, 10500.00, 525.00, 1060.00, 1585.00),
(13, 10750.00, 11249.99, 11000.00, 550.00, 1110.00, 1660.00),
(14, 11250.00, 11749.99, 11500.00, 575.00, 1160.00, 1735.00),
(15, 11750.00, 12249.99, 12000.00, 600.00, 1210.00, 1810.00),
(16, 12250.00, 12749.99, 12500.00, 625.00, 1260.00, 1885.00),
(17, 12750.00, 13249.99, 13000.00, 650.00, 1310.00, 1960.00),
(18, 13250.00, 13749.99, 13500.00, 675.00, 1360.00, 2035.00),
(19, 13750.00, 14249.99, 14000.00, 700.00, 1410.00, 2110.00),
(20, 14250.00, 14749.99, 14500.00, 725.00, 1460.00, 2185.00),
(21, 14750.00, 15249.99, 15000.00, 750.00, 1510.00, 2260.00),
(22, 15250.00, 15749.99, 15500.00, 775.00, 1560.00, 2335.00),
(23, 15750.00, 16249.99, 16000.00, 800.00, 1610.00, 2410.00),
(24, 16250.00, 16749.99, 16500.00, 825.00, 1660.00, 2485.00),
(25, 16750.00, 17249.99, 17000.00, 850.00, 1710.00, 2560.00),
(26, 17250.00, 17749.99, 17500.00, 875.00, 1760.00, 2635.00),
(27, 17750.00, 18249.99, 18000.00, 900.00, 1810.00, 2710.00),
(28, 18250.00, 18749.99, 18500.00, 925.00, 1860.00, 2785.00),
(29, 18750.00, 19249.99, 19000.00, 950.00, 1910.00, 2860.00),
(30, 19250.00, 19749.99, 19500.00, 975.00, 1960.00, 2935.00),
(31, 19750.00, 20249.99, 20000.00, 1000.00, 2010.00, 3010.00),
(32, 20250.00, 20749.99, 20500.00, 1025.00, 2060.00, 3085.00),
(33, 20750.00, 21249.99, 21000.00, 1050.00, 2110.00, 3160.00),
(34, 21250.00, 21749.99, 21500.00, 1075.00, 2160.00, 3235.00),
(35, 21750.00, 22249.99, 22000.00, 1100.00, 2210.00, 3310.00),
(36, 22250.00, 22749.99, 22500.00, 1125.00, 2260.00, 3385.00),
(37, 22750.00, 23249.99, 23000.00, 1150.00, 2310.00, 3460.00),
(38, 23250.00, 23749.99, 23500.00, 1175.00, 2360.00, 3535.00),
(39, 23750.00, 24249.99, 24000.00, 1200.00, 2410.00, 3610.00),
(40, 24250.00, 24749.99, 24500.00, 1225.00, 2460.00, 3685.00),
(41, 24750.00, 25249.99, 25000.00, 1250.00, 2510.00, 3760.00),
(42, 25250.00, 25749.99, 25500.00, 1275.00, 2560.00, 3835.00),
(43, 25750.00, 26249.99, 26000.00, 1300.00, 2610.00, 3910.00),
(44, 26250.00, 26749.99, 26500.00, 1325.00, 2660.00, 3985.00),
(45, 26750.00, 27249.99, 27000.00, 1350.00, 2710.00, 4060.00),
(46, 27250.00, 27749.99, 27500.00, 1375.00, 2760.00, 4135.00);

--
-- Triggers `sss_contributions_2025`
--
DELIMITER $$
CREATE TRIGGER `trg_before_insert_sss_total_contribution` BEFORE INSERT ON `sss_contributions_2025` FOR EACH ROW BEGIN
    SET NEW.total_contribution = NEW.employer_share + NEW.employee_share;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `trg_before_update_sss_total_contribution` BEFORE UPDATE ON `sss_contributions_2025` FOR EACH ROW BEGIN
    SET NEW.total_contribution = NEW.employer_share + NEW.employee_share;
END
$$
DELIMITER ;

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

--
-- Table structure for table `sss_contribution_table`
--

CREATE TABLE `sss_contribution_table` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `salary_from` decimal(10,2) DEFAULT NULL,
  `salary_to` decimal(10,2) DEFAULT NULL,
  `employer_share` decimal(10,2) DEFAULT NULL,
  `employee_share` decimal(10,2) DEFAULT NULL,
  `mpf_ee` decimal(10,2) DEFAULT NULL,
  `total_employee_share` decimal(10,2) DEFAULT NULL,
  `total_contribution` decimal(10,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `sss_contribution_table`
--

INSERT INTO `sss_contribution_table` (`id`, `salary_from`, `salary_to`, `employer_share`, `employee_share`, `mpf_ee`, `total_employee_share`, `total_contribution`) VALUES
(1, NULL, 5250.00, 510.00, 250.00, 0.00, 250.00, 760.00),
(2, 5250.00, 5749.99, 560.00, 275.00, 0.00, 275.00, 835.00),
(3, 5750.00, 6249.99, 610.00, 300.00, 0.00, 300.00, 910.00),
(4, 6250.00, 6749.99, 660.00, 325.00, 0.00, 325.00, 985.00),
(5, 6750.00, 7249.99, 710.00, 350.00, 0.00, 350.00, 1060.00),
(6, 7250.00, 7749.99, 760.00, 375.00, 0.00, 375.00, 1135.00),
(7, 7750.00, 8249.99, 810.00, 400.00, 0.00, 400.00, 1210.00),
(8, 8250.00, 8749.99, 860.00, 425.00, 0.00, 425.00, 1285.00),
(9, 8750.00, 9249.99, 910.00, 450.00, 0.00, 450.00, 1360.00),
(10, 9250.00, 9749.99, 960.00, 475.00, 0.00, 475.00, 1435.00),
(11, 9750.00, 10249.99, 1010.00, 500.00, 0.00, 500.00, 1510.00),
(12, 10250.00, 10749.99, 1060.00, 525.00, 0.00, 525.00, 1585.00),
(13, 10750.00, 11249.99, 1110.00, 550.00, 0.00, 550.00, 1660.00),
(14, 11250.00, 11749.99, 1160.00, 575.00, 0.00, 575.00, 1735.00),
(15, 11750.00, 12249.99, 1210.00, 600.00, 0.00, 600.00, 1810.00),
(16, 12250.00, 12749.99, 1260.00, 625.00, 0.00, 625.00, 1885.00),
(17, 12750.00, 13249.99, 1310.00, 650.00, 0.00, 650.00, 1960.00),
(18, 13250.00, 13749.99, 1360.00, 675.00, 0.00, 675.00, 2035.00),
(19, 13750.00, 14249.99, 1410.00, 700.00, 0.00, 700.00, 2110.00),
(20, 14250.00, 14749.99, 1460.00, 725.00, 0.00, 725.00, 2185.00),
(21, 14750.00, 15249.99, 1530.00, 750.00, 0.00, 750.00, 2280.00),
(22, 15250.00, 15749.99, 1580.00, 775.00, 0.00, 775.00, 2355.00),
(23, 15750.00, 16249.99, 1630.00, 800.00, 0.00, 800.00, 2430.00),
(24, 16250.00, 16749.99, 1680.00, 825.00, 0.00, 825.00, 2505.00),
(25, 16750.00, 17249.99, 1730.00, 850.00, 0.00, 850.00, 2580.00),
(26, 17250.00, 17749.99, 1780.00, 875.00, 0.00, 875.00, 2655.00),
(27, 17750.00, 18249.99, 1830.00, 900.00, 0.00, 900.00, 2730.00),
(28, 18250.00, 18749.99, 1880.00, 925.00, 0.00, 925.00, 2805.00),
(29, 18750.00, 19249.99, 1930.00, 950.00, 0.00, 950.00, 2880.00),
(30, 19250.00, 19749.99, 1980.00, 975.00, 0.00, 975.00, 2955.00),
(31, 19750.00, 20249.99, 2030.00, 1000.00, 0.00, 1000.00, 3030.00),
(32, 20250.00, 20749.99, 2080.00, 1000.00, 25.00, 1025.00, 3105.00),
(33, 20750.00, 21249.99, 2130.00, 1000.00, 50.00, 1050.00, 3180.00),
(34, 21250.00, 21749.99, 2180.00, 1000.00, 75.00, 1075.00, 3255.00),
(35, 21750.00, 22249.99, 2230.00, 1000.00, 100.00, 1100.00, 3330.00),
(36, 22250.00, 22749.99, 2280.00, 1000.00, 125.00, 1125.00, 3405.00),
(37, 22750.00, 23249.99, 2330.00, 1000.00, 150.00, 1150.00, 3480.00),
(38, 23250.00, 23749.99, 2380.00, 1000.00, 175.00, 1175.00, 3555.00),
(39, 23750.00, 24249.99, 2430.00, 1000.00, 200.00, 1200.00, 3630.00),
(40, 24250.00, 24749.99, 2480.00, 1000.00, 225.00, 1225.00, 3705.00),
(41, 24750.00, 25249.99, 2530.00, 1000.00, 250.00, 1250.00, 3780.00),
(42, 25250.00, 25749.99, 2580.00, 1000.00, 275.00, 1275.00, 3855.00),
(43, 25750.00, 26249.99, 2630.00, 1000.00, 300.00, 1300.00, 3930.00),
(44, 26250.00, 26749.99, 2680.00, 1000.00, 325.00, 1325.00, 4005.00),
(45, 26750.00, 27249.99, 2730.00, 1000.00, 350.00, 1350.00, 4080.00),
(46, 27250.00, 27749.99, 2780.00, 1000.00, 375.00, 1375.00, 4155.00),
(47, 27750.00, 28249.99, 2830.00, 1000.00, 400.00, 1400.00, 4230.00),
(48, 28250.00, 28749.99, 2880.00, 1000.00, 425.00, 1425.00, 4305.00),
(49, 28750.00, 29249.99, 2930.00, 1000.00, 450.00, 1450.00, 4380.00),
(50, 29250.00, 29749.99, 2980.00, 1000.00, 475.00, 1475.00, 4455.00),
(51, 29750.00, 30249.99, 3030.00, 1000.00, 500.00, 1500.00, 4530.00),
(52, 30250.00, 30749.99, 3080.00, 1000.00, 525.00, 1525.00, 4605.00),
(53, 30750.00, 31249.99, 3130.00, 1000.00, 550.00, 1550.00, 4680.00),
(54, 31250.00, 31749.99, 3180.00, 1000.00, 575.00, 1575.00, 4755.00),
(55, 31750.00, 32249.99, 3230.00, 1000.00, 600.00, 1600.00, 4830.00),
(56, 32250.00, 32749.99, 3280.00, 1000.00, 625.00, 1625.00, 4905.00),
(57, 32750.00, 33249.99, 3330.00, 1000.00, 650.00, 1650.00, 4980.00),
(58, 33250.00, 33749.99, 3380.00, 1000.00, 675.00, 1675.00, 5055.00),
(59, 33750.00, 34249.99, 3430.00, 1000.00, 700.00, 1700.00, 5130.00),
(60, 34250.00, 34749.99, 3480.00, 1000.00, 725.00, 1725.00, 5205.00),
(61, 34750.00, NULL, 3530.00, 1000.00, 750.00, 1750.00, 5280.00);

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

--
-- Table structure for table `tbl_biometrics_logs`
--

CREATE TABLE `tbl_biometrics_logs` (
  `id` int(11) NOT NULL,
  `person_id` int(11) NOT NULL,
  `name` varchar(150) NOT NULL,
  `department` varchar(100) DEFAULT NULL,
  `time_log` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `thirteenth_month_pays`
--

CREATE TABLE `thirteenth_month_pays` (
  `id` int(11) NOT NULL,
  `employee_name` varchar(150) NOT NULL,
  `employee_id` varchar(15) NOT NULL,
  `year` int(11) NOT NULL,
  `total_basic_salary` decimal(10,2) NOT NULL,
  `thirteenth_month_pay` decimal(10,2) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `users` (
  `user_id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` varchar(50) NOT NULL,
  `status` enum('active','disabled') NOT NULL DEFAULT 'active'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `users` (`user_id`, `username`, `password`, `role`, `status`) VALUES
(1, 'admin', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', 'ADMIN', 'active'),
(2, 'hr', '1b52f3a2e15148731314bf167145c54565ed2385a862b5eb7771eaf719e4f82e', 'hr', 'active'),
(105, 'CJIS-2025-0001', '6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b', 'MANAGER', 'active'),
(106, 'CJIS-2025-0002', '5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8', 'employee', 'active'),
(107, 'CJIS-2025-0003', '3e621b3c572020ea69676bffd0bad0b0340399ba05dfa057271a3f48a0f9888f', 'employee', 'active'),
(108, 'CJIS-2025-0004', 'e7edf28cc7366b3aa15644a744981da1c3f061c3bb6ab87d57adc7c8480f6d32', 'employee', 'active'),
(109, 'CJIS-2025-0005', 'b8ee60b38577e156f05f0e18817eaaa02fffe43fbdb4b287ce0a27e6b7911375', 'employee', 'active'),
(110, 'CJIS-2025-0006', 'b49ab2d86739f9bf49f6f656c36a0de16ac27b2e849c9575068ad2705f020bd6', 'employee', 'active'),
(111, 'CJIS-2025-0007', '050488836ca1d4343073b3a248c7b2856ff1c62cc441f58dadc6f29f4cfc3518', 'employee', 'active'),
(112, 'CJIS-2025-0008', '98ba19abe8d144bbdd6171fadea4ffcf3e4eaad922e6ec7eee2e312ac391fd54', 'employee', 'active'),
(113, 'CJIS-2025-0009', 'c2a8202234df0efec12916faa9d4a4e2692ba86ff5c4d10f304f49157d18cc94', 'employee', 'active'),
(114, 'CJIS-2025-0010', '689cb4e7bfbaa53f0b5eb53d4b9dd3cbf970495aa65a7879013d341dae3b2b78', 'employee', 'active'),
(115, 'CJIS-2025-0011', 'dfc063ed014a2308aaaa64c0b6f70a9056f8261c841155bc2bb20a79e6e50e12', 'employee', 'active'),
(116, 'CJIS-2025-0012', '3ac1c0fe802837780a834ab85483c7c63ebd0e676be1866e3175bec13cabb5a4', 'employee', 'active'),
(117, 'CJIS-2025-0013', 'f837f141174d0c2f3bb7ca4b6e9e05ab4c20ed716b3ea2b2d5630d7ea658859d', 'employee', 'active'),
(118, 'CJIS-2025-0014', '06732a5980a2204be15b31c5273ae42b54dbd63fd4081ec4b8244317354ffb3e', 'employee', 'active'),
(119, 'CJIS-2025-0015', '5494fae0126ec53b8c5a5706bde4b41212fbea1ae1d2d14a44550f8c6edfaa72', 'employee', 'active'),
(120, 'CJIS-2025-0016', '5747782b13b1a58fe587ff5f6c39218696027bb09dc6cfcadea7f4e5c602553a', 'employee', 'active'),
(121, 'CJIS-2025-0017', '2353a6c2730ba50a25e422b197cd41b2eb5233da1432819fd5ae9d0a4cd32eea', 'employee', 'active'),
(122, 'CJIS-2025-0018', '29a636311b6d75309ca9a4a35bb9d600a5ec7db80295941d4ae906034aa46aae', 'employee', 'active'),
(123, 'CJIS-2025-0019', '52dfb3e79b9ba00c96bba8a1cf3e60138b9e950f9c0233fb195bf5227b930b58', 'employee', 'active'),
(124, 'CJIS-2025-0020', 'a674581c2393ec7fc8398e083d191f8eed4dd688a77b6f4fc94da27e275e5c56', 'employee', 'disabled'),
(125, 'CJIS-2025-0021', '87023f94ed483d89e19d9e9f57e657af0a996ed7efe016fbba55f7980f5c98d6', 'employee', 'active'),
(126, 'CJIS-2025-0022', 'd5af4bc63bda044056bac2752fe5b4365f6e0b5df9fcd295bee809ce8591c325', 'employee', 'disabled'),
(127, 'CJIS-2025-0023', '626846811449ea48b8ccd22b3da4db404ca09fdc7a8357bceaf1f18a5e4cc697', 'employee', 'active'),
(128, 'CJIS-2025-0024', '60f7195af0219c52f21502102cc48b3b723f6b8b132a495241d89287d49951dd', 'employee', 'active'),
(129, '1000', 'bd6c00066c4c2dcb72ebd1d2add47983f1ed54c99f8621e4a955df0bf285360e', 'employee', 'active'),
(130, 'CJIS-2025-0025', '4128f6b76241a17abf53f12e8e07119a89587f9ee073abeccad63010da5720ce', 'employee', 'disabled'),
(131, 'CJIS-2025-0026', '21c63989333baa4ac7c371544801b02af08aa2fd05d9cf8323d63d3494b8c84e', 'employee', 'active'),
(132, 'CJIS-2025-0027', '3106a62b33bd05cb2fafd15afc3d859475acbb47b5e548d5d5bad7c41828a2d5', 'employee', 'active'),
(133, 'CJIS-2025-0028', '77d746f5293f8e1aec5a4b57e20c38761e406e72acdd62ee2ec077112af19901', 'employee', 'active'),
(134, 'CJIS-2025-0029', '8336d1fee03244565c75ebd9cb952f69fa8113c6e4acf731e4111085f7d216d5', 'hr', 'active'),
(135, 'CJIS-2025-0030', '4f6934f2abfa07ac06393019f4faea57c848dc48a47f7ba8f577d87721987c11', 'employee', 'active'),
(136, 'CJIS-2025-0031', 'a40e76ffeaf327acc7b602c26bd02c58f3a6a42d3a95814465bc604458a822de', 'employee', 'active'),
(137, 'CJIS-2025-0032', 'ed0f3b29ecb54b0da6567af5cf7f7a94d2a61aeecac832cb27c33db9eede6c2e', 'employee', 'active'),
(138, 'CJIS-2025-0033', 'bde5dc3a221c42e6ee7b9066b5116ea3b8b43c3e78fa796446dc4afa3500dc22', 'employee', 'active'),
(139, 'CJIS-2025-0034', 'c217a3f7c1b441d43275d6523d25ac292511214544aa5e78fdea560e610a2425', 'employee', 'disabled'),
(140, 'CJIS-2025-0035', 'b934e4abb7ae291f2326e06c78f0e43b49b644acc3901ce4efe6c5c1eb84a0ae', 'employee', 'disabled'),
(141, 'CJIS-2025-0036', 'f6e0a1e2ac41945a9aa7ff8a8aaa0cebc12a3bcc981a929ad5cf810a090e11ae', 'employee', 'disabled'),
(142, 'CJIS-2025-0037', 'f6e0a1e2ac41945a9aa7ff8a8aaa0cebc12a3bcc981a929ad5cf810a090e11ae', 'employee', 'disabled'),
(143, 'CJIS-2025-0038', 'f6e0a1e2ac41945a9aa7ff8a8aaa0cebc12a3bcc981a929ad5cf810a090e11ae', 'employee', 'disabled'),
(144, 'CJIS-2025-0039', 'ac486f73932f935f69e3a6b365dcb2c56cc8f009074a70b7a7c60bc2752e4abf', 'employee', 'disabled'),
(145, 'CJIS-2025-0040', '1484c51771ecd2886efecd4b4d0e8e96338f9ec62ca25eee8e6d2d337b947c92', 'employee', 'disabled'),
(146, 'CJIS-2025-0041', '63b73e2adc97c0b05f98712cabb963a8b85153e13cd34f7aeae726bfacdbf68a', 'employee', 'active'),
(147, 'CJIS-2025-0042', '4afe609fbdc1246a74a35b1d8b28289c45891064883e0b29ef3778bf038ea1d1', 'employee', 'active'),
(148, 'CJIS-2025-0043', '4df49be199e5d152a6aaa364dd3905e18ad5aa6ed45fdaf0bbcd1ba44099ff7d', 'employee', 'disabled'),
(149, 'CJIS-2025-0044', 'd8e4306124a3fae18257c766195bc05faaa575e49e74af1ed1593885ea206302', 'employee', 'active'),
(150, '11111', 'c5fd14272f9e805ca145625b94c229e4b4b993bd314453335a4efeeee679d81e', 'employee', 'active'),
(151, 'CJIS-2025-0045', '9ca2329d3e4c8fe834b3b3592155646ab61981a938eaddfdc6ae21ea4d1759c8', 'employee', 'active');

--
-- Triggers `users`
--
DELIMITER $$
CREATE TRIGGER `trg_update_user_access_role` AFTER UPDATE ON `users` FOR EACH ROW BEGIN
    -- Only update if role actually changed
    IF NEW.role <> OLD.role THEN
        UPDATE user_access
        SET role = NEW.role
        WHERE username = NEW.username;
    END IF;
END
$$
DELIMITER ;

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

--
-- Table structure for table `user_access`
--

CREATE TABLE `user_access` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `role` varchar(50) NOT NULL,
  `can_edit` enum('yes','no') DEFAULT 'no',
  `can_add` enum('yes','no') DEFAULT 'no',
  `can_delete` enum('yes','no') DEFAULT 'no',
  `can_print` enum('yes','no') DEFAULT 'no',
  `can_action` enum('yes','no') DEFAULT 'no',
  `can_edit_payroll_date` enum('yes','no') DEFAULT 'no',
  `can_print_payroll` enum('yes','no') DEFAULT 'no',
  `can_payroll_logs` enum('yes','no') DEFAULT 'no',
  `can_view` enum('yes','no') DEFAULT 'no',
  `employee_list` enum('yes','no') DEFAULT 'no',
  `department` enum('yes','no') DEFAULT 'no',
  `branches` enum('yes','no') NOT NULL DEFAULT 'no',
  `attendance_dtr` enum('yes','no') DEFAULT 'no',
  `attendance_log` enum('yes','no') DEFAULT 'no',
  `leave_access` enum('yes','no') DEFAULT 'no',
  `payroll_records` enum('yes','no') DEFAULT 'no',
  `loan` enum('yes','no') DEFAULT 'no',
  `late_deduction` enum('yes','no') DEFAULT 'no',
  `leave_type` enum('yes','no') DEFAULT 'no',
  `overtime` enum('yes','no') DEFAULT 'no',
  `holiday` enum('yes','no') DEFAULT 'no',
  `leave_balances` enum('yes','no') DEFAULT 'no',
  `attendance_request` enum('yes','no') DEFAULT 'no',
  `overtime_request` enum('yes','no') DEFAULT 'no',
  `leave_request` enum('yes','no') DEFAULT 'no',
  `manage_users_access` enum('yes','no') DEFAULT 'no',
  `user_role_management` enum('yes','no') DEFAULT 'no',
  `schedule_management` enum('yes','no') NOT NULL DEFAULT 'no',
  `schedule_settings` enum('yes','no') NOT NULL DEFAULT 'no',
  `assign_approver` enum('yes','no') DEFAULT 'no',
  `approvals_queue` enum('yes','no') DEFAULT 'no'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_access`
--

INSERT INTO `user_access` (`id`, `username`, `role`, `can_edit`, `can_add`, `can_delete`, `can_print`, `can_action`, `can_edit_payroll_date`, `can_print_payroll`, `can_payroll_logs`, `can_view`, `employee_list`, `department`, `branches`, `attendance_dtr`, `attendance_log`, `leave_access`, `payroll_records`, `loan`, `late_deduction`, `leave_type`, `overtime`, `holiday`, `leave_balances`, `attendance_request`, `overtime_request`, `leave_request`, `manage_users_access`, `user_role_management`, `schedule_management`, `schedule_settings`, `assign_approver`, `approvals_queue`) VALUES
(2, 'admin', 'ADMIN', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes'),
(7, 'hr', '', 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),
(8, 'CJIS-2025-0001', 'MANAGER', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes'),
(9, 'CJIS-2025-0039', '', 'no', 'no', 'no', 'no', 'no', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'no', 'no', 'no', 'no'),
(10, 'CJIS-2025-0045', '', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),
(11, 'CJIS-2025-0046', 'managerr', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'no', 'no', 'no', 'no', 'no'),
(12, 'CJIS-2025-0024', '', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no'),
(13, 'CJIS-2025-0029', 'hr', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'no', 'yes', 'yes', 'no', 'no', 'no', 'no', 'no', 'no', 'no');

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

--
-- Table structure for table `user_menu_access`
--

CREATE TABLE `user_menu_access` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `dashboard` enum('yes','no') DEFAULT 'no',
  `employees` enum('yes','no') DEFAULT 'no',
  `attendance` enum('yes','no') DEFAULT 'no',
  `dtr` enum('yes','no') DEFAULT 'no',
  `payroll` enum('yes','no') DEFAULT 'no',
  `utilities` enum('yes','no') DEFAULT 'no',
  `requests` enum('yes','no') DEFAULT 'no',
  `users` enum('yes','no') DEFAULT 'no',
  `biometrics` enum('yes','no') DEFAULT 'no',
  `email_customization` enum('yes','no') DEFAULT 'no',
  `contributions` enum('yes','no') DEFAULT 'no',
  `menu_access` enum('yes','no') DEFAULT 'no',
  `time_in_out` enum('yes','no') DEFAULT 'no',
  `users_management` enum('yes','no') DEFAULT 'no',
  `reset_password` enum('yes','no') DEFAULT 'no',
  `logs` enum('yes','no') NOT NULL DEFAULT 'no'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_menu_access`
--

INSERT INTO `user_menu_access` (`id`, `username`, `dashboard`, `employees`, `attendance`, `dtr`, `payroll`, `utilities`, `requests`, `users`, `biometrics`, `email_customization`, `contributions`, `menu_access`, `time_in_out`, `users_management`, `reset_password`, `logs`) VALUES
(1, 'admin', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'no', 'yes'),
(5, 'CJIS-2025-0039', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 'no', 'no', 'no', 'no', 'no', 'yes', 'no', 'no', 'no'),
(6, 'CJIS-2025-0001', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 'yes'),
(7, 'CJIS-2025-0046', 'yes', 'yes', 'yes', 'no', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'yes', 'no', 'yes', 'no', 'no', 'no'),
(8, 'CJIS-2025-0029', 'yes', 'yes', 'no', 'yes', 'no', 'no', 'yes', 'no', 'no', 'no', 'no', 'no', 'yes', 'no', 'yes', 'no');

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

--
-- Table structure for table `user_role_list`
--

CREATE TABLE `user_role_list` (
  `role_id` int(11) NOT NULL,
  `role_name` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `user_role_list`
--

INSERT INTO `user_role_list` (`role_id`, `role_name`) VALUES
(1, 'ADMIN'),
(13, 'employee'),
(12, 'GENERAL OPERATIONS MANAGER'),
(2, 'HR'),
(3, 'MANAGER'),
(4, 'SUPERVISOR');

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

--
-- Table structure for table `work_time`
--

CREATE TABLE `work_time` (
  `id` int(11) NOT NULL,
  `shift_name` varchar(100) NOT NULL,
  `start_time` time NOT NULL,
  `end_time` time NOT NULL,
  `valid_in_start` time NOT NULL,
  `valid_in_end` time NOT NULL,
  `valid_out_start` time NOT NULL,
  `valid_out_end` time NOT NULL,
  `is_default` tinyint(1) DEFAULT 0,
  `total_minutes` int(11) GENERATED ALWAYS AS (time_to_sec(timediff(`end_time`,`start_time`)) / 60) STORED
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `work_time`
--

INSERT INTO `work_time` (`id`, `shift_name`, `start_time`, `end_time`, `valid_in_start`, `valid_in_end`, `valid_out_start`, `valid_out_end`, `is_default`) VALUES
(2, 'CJIS Default Time 9am-6pm', '09:00:00', '18:00:00', '08:00:00', '09:00:00', '18:00:00', '18:30:00', 1),
(3, 'afternoon work 1pm to 6pm', '13:00:00', '18:00:00', '12:30:00', '13:00:00', '18:00:00', '18:30:00', 0),
(4, '9 to 2/ 4 to 8', '09:00:00', '20:00:00', '08:30:00', '09:00:00', '20:00:00', '00:00:20', 0),
(5, 'Rest Day', '00:00:00', '00:00:01', '00:00:00', '00:00:01', '00:00:00', '00:00:01', 0);

--
-- Triggers `work_time`
--
DELIMITER $$
CREATE TRIGGER `after_delete_work_time_cleanup` AFTER DELETE ON `work_time` FOR EACH ROW BEGIN
    -- Just in case CASCADE didn’t cover future tables
    DELETE FROM break_time WHERE work_time_id = OLD.id;
    DELETE FROM work_time_break WHERE work_time_id = OLD.id;
    DELETE FROM late_deduction WHERE work_time_id = OLD.id;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `before_insert_work_time_default` BEFORE INSERT ON `work_time` FOR EACH ROW BEGIN
    -- If a new row is marked as default
    IF NEW.is_default = 1 THEN
        -- Reset all other rows to not default
        UPDATE work_time
        SET is_default = 0;
    END IF;
END
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `before_insert_work_time_validations` BEFORE INSERT ON `work_time` FOR EACH ROW BEGIN
    -- Ensure start < end
    IF NEW.start_time >= NEW.end_time THEN
        SIGNAL SQLSTATE '45000'
        SET MESSAGE_TEXT = 'Invalid shift: start_time must be earlier than end_time';
    END IF;

    -- Ensure valid_in_start <= valid_in_end
    IF NEW.valid_in_start > NEW.valid_in_end THEN
        SIGNAL SQLSTATE '45000'
        SET MESSAGE_TEXT = 'Invalid shift: valid_in_start must be <= valid_in_end';
    END IF;

    -- Ensure valid_out_start <= valid_out_end
    IF NEW.valid_out_start > NEW.valid_out_end THEN
        SIGNAL SQLSTATE '45000'
        SET MESSAGE_TEXT = 'Invalid shift: valid_out_start must be <= valid_out_end';
    END IF;
END
$$
DELIMITER ;

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

--
-- Table structure for table `work_time_break`
--

CREATE TABLE `work_time_break` (
  `id` int(11) NOT NULL,
  `work_time_id` int(11) NOT NULL,
  `break_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `work_time_break`
--

INSERT INTO `work_time_break` (`id`, `work_time_id`, `break_id`) VALUES
(1, 2, 1),
(2, 4, 2);

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

--
-- Table structure for table `work_time_late_deduction`
--

CREATE TABLE `work_time_late_deduction` (
  `id` int(11) NOT NULL,
  `work_time_id` int(11) NOT NULL,
  `tier_id` int(11) NOT NULL,
  `block_index` int(11) DEFAULT NULL COMMENT 'NULL=apply to whole-shift; 1=first block,2=second block'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `work_time_late_deduction`
--

INSERT INTO `work_time_late_deduction` (`id`, `work_time_id`, `tier_id`, `block_index`) VALUES
(1, 3, 3, NULL),
(2, 2, 3, NULL),
(3, 4, 2, NULL);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `allowance_journal`
--
ALTER TABLE `allowance_journal`
  ADD PRIMARY KEY (`journal_id`),
  ADD KEY `fk_jr_allow` (`allowance_id`),
  ADD KEY `fk_jr_payroll` (`payroll_id`);

--
-- Indexes for table `attendance`
--
ALTER TABLE `attendance`
  ADD PRIMARY KEY (`attendance_id`),
  ADD UNIQUE KEY `unique_employee_date` (`employee_id`,`attendance_date`),
  ADD KEY `fk_employee` (`employee_id`);

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

--
-- Indexes for table `base_salary`
--
ALTER TABLE `base_salary`
  ADD PRIMARY KEY (`base_salary_id`),
  ADD KEY `fk_employee_id` (`employee_id`);

--
-- Indexes for table `branches`
--
ALTER TABLE `branches`
  ADD PRIMARY KEY (`branch_id`),
  ADD KEY `assigned_employee_id` (`assigned_employee_id`);

--
-- Indexes for table `break_time`
--
ALTER TABLE `break_time`
  ADD PRIMARY KEY (`id`),
  ADD KEY `work_time_id` (`work_time_id`);

--
-- Indexes for table `deduction`
--
ALTER TABLE `deduction`
  ADD PRIMARY KEY (`deduction_id`),
  ADD KEY `employee_id` (`employee_id`);

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

--
-- Indexes for table `departments`
--
ALTER TABLE `departments`
  ADD PRIMARY KEY (`department_id`);

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

--
-- Indexes for table `employees`
--
ALTER TABLE `employees`
  ADD PRIMARY KEY (`employee_id`),
  ADD KEY `department_id` (`department_id`),
  ADD KEY `fk_position` (`position_id`),
  ADD KEY `branch_id` (`branch_id`),
  ADD KEY `idx_employees_employee_id` (`employee_id`);

--
-- Indexes for table `employee_allowance`
--
ALTER TABLE `employee_allowance`
  ADD PRIMARY KEY (`allowance_id`),
  ADD KEY `fk_allow_emp` (`employee_id`);

--
-- Indexes for table `employee_leaves`
--
ALTER TABLE `employee_leaves`
  ADD PRIMARY KEY (`leave_id`),
  ADD KEY `employee_id` (`employee_id`),
  ADD KEY `leave_type_id` (`leave_type_id`);

--
-- Indexes for table `employee_leave_balances`
--
ALTER TABLE `employee_leave_balances`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_leave_balance` (`employee_id`,`leave_type_id`,`year`),
  ADD KEY `leave_type_id` (`leave_type_id`);

--
-- Indexes for table `employee_overtime_request`
--
ALTER TABLE `employee_overtime_request`
  ADD PRIMARY KEY (`request_id`),
  ADD KEY `fk_overtime_employee_id` (`employee_id`),
  ADD KEY `fk_overtime_holiday` (`holiday_id`);

--
-- Indexes for table `employee_shift_schedule`
--
ALTER TABLE `employee_shift_schedule`
  ADD PRIMARY KEY (`schedule_id`),
  ADD KEY `fk_sched_employee` (`employee_id`),
  ADD KEY `fk_sched_work_time` (`work_time_id`);

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

--
-- Indexes for table `holidays`
--
ALTER TABLE `holidays`
  ADD PRIMARY KEY (`holiday_id`);

--
-- Indexes for table `inactive_employees`
--
ALTER TABLE `inactive_employees`
  ADD PRIMARY KEY (`employee_id`);

--
-- Indexes for table `incentives`
--
ALTER TABLE `incentives`
  ADD PRIMARY KEY (`incentives_id`),
  ADD KEY `employee_id` (`employee_id`),
  ADD KEY `position_id` (`position_id`);

--
-- Indexes for table `issued_items`
--
ALTER TABLE `issued_items`
  ADD PRIMARY KEY (`item_id`);

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

--
-- Indexes for table `late_attendance_requests`
--
ALTER TABLE `late_attendance_requests`
  ADD PRIMARY KEY (`request_id`),
  ADD KEY `employee_id` (`employee_id`),
  ADD KEY `reviewed_by` (`reviewed_by`);

--
-- Indexes for table `late_deduction`
--
ALTER TABLE `late_deduction`
  ADD PRIMARY KEY (`id`),
  ADD KEY `tier_id` (`tier_id`);

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

--
-- Indexes for table `leave_deduction_logs`
--
ALTER TABLE `leave_deduction_logs`
  ADD PRIMARY KEY (`log_id`),
  ADD KEY `employee_id` (`employee_id`),
  ADD KEY `leave_type_id` (`leave_type_id`),
  ADD KEY `leave_id` (`leave_id`);

--
-- Indexes for table `leave_requests`
--
ALTER TABLE `leave_requests`
  ADD PRIMARY KEY (`leave_id`),
  ADD KEY `employee_id` (`employee_id`),
  ADD KEY `leave_type_id` (`leave_type_id`);

--
-- Indexes for table `leave_types`
--
ALTER TABLE `leave_types`
  ADD PRIMARY KEY (`leave_type_id`);

--
-- Indexes for table `liability_categories`
--
ALTER TABLE `liability_categories`
  ADD PRIMARY KEY (`category_id`),
  ADD UNIQUE KEY `code` (`code`);

--
-- Indexes for table `loans`
--
ALTER TABLE `loans`
  ADD PRIMARY KEY (`loan_id`),
  ADD KEY `fk_loans_employee` (`employee_id`),
  ADD KEY `fk_loans_item` (`item_id`),
  ADD KEY `employee_id` (`employee_id`),
  ADD KEY `liability_type` (`liability_type`),
  ADD KEY `status` (`status`),
  ADD KEY `employee_id_2` (`employee_id`),
  ADD KEY `liability_type_2` (`liability_type`),
  ADD KEY `status_2` (`status`),
  ADD KEY `employee_id_3` (`employee_id`),
  ADD KEY `liability_type_3` (`liability_type`),
  ADD KEY `status_3` (`status`),
  ADD KEY `employee_id_4` (`employee_id`),
  ADD KEY `liability_type_4` (`liability_type`),
  ADD KEY `status_4` (`status`);

--
-- Indexes for table `loan_journal_entry`
--
ALTER TABLE `loan_journal_entry`
  ADD PRIMARY KEY (`journal_id`),
  ADD KEY `loan_id` (`loan_id`),
  ADD KEY `employee_id` (`employee_id`),
  ADD KEY `loan_id_2` (`loan_id`),
  ADD KEY `employee_id_2` (`employee_id`),
  ADD KEY `entry_date` (`entry_date`),
  ADD KEY `loan_id_3` (`loan_id`),
  ADD KEY `employee_id_3` (`employee_id`),
  ADD KEY `entry_date_2` (`entry_date`),
  ADD KEY `loan_id_4` (`loan_id`),
  ADD KEY `employee_id_4` (`employee_id`),
  ADD KEY `entry_date_3` (`entry_date`),
  ADD KEY `loan_id_5` (`loan_id`),
  ADD KEY `employee_id_5` (`employee_id`),
  ADD KEY `entry_date_4` (`entry_date`);

--
-- Indexes for table `loan_payment_history`
--
ALTER TABLE `loan_payment_history`
  ADD PRIMARY KEY (`loan_payment_history_id`),
  ADD KEY `fk_payment_loan` (`loan_id`),
  ADD KEY `fk_payment_employee` (`employee_id`);

--
-- Indexes for table `loan_remittance_logs`
--
ALTER TABLE `loan_remittance_logs`
  ADD PRIMARY KEY (`remittance_id`),
  ADD KEY `loan_id` (`loan_id`),
  ADD KEY `employee_id` (`employee_id`);

--
-- Indexes for table `loan_skip_requests`
--
ALTER TABLE `loan_skip_requests`
  ADD PRIMARY KEY (`skip_id`),
  ADD KEY `loan_id` (`loan_id`),
  ADD KEY `employee_id` (`employee_id`);

--
-- Indexes for table `logs`
--
ALTER TABLE `logs`
  ADD PRIMARY KEY (`log_id`);

--
-- Indexes for table `overtime_settings`
--
ALTER TABLE `overtime_settings`
  ADD PRIMARY KEY (`overtime_id`);

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

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

--
-- Indexes for table `pagibig_contribution`
--
ALTER TABLE `pagibig_contribution`
  ADD PRIMARY KEY (`pagibig_contribution_id`),
  ADD KEY `fk_pagibig_employee` (`employee_id`);

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

--
-- Indexes for table `payroll`
--
ALTER TABLE `payroll`
  ADD PRIMARY KEY (`payroll_id`),
  ADD KEY `employee_id` (`employee_id`);

--
-- Indexes for table `payroll_allowance_exceptions`
--
ALTER TABLE `payroll_allowance_exceptions`
  ADD PRIMARY KEY (`exception_id`),
  ADD KEY `fk_exc_payroll` (`payroll_id`),
  ADD KEY `fk_exc_allow` (`allowance_id`);

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

--
-- Indexes for table `philhealth_contribution`
--
ALTER TABLE `philhealth_contribution`
  ADD PRIMARY KEY (`PH_contribution_id`),
  ADD KEY `fk_philhealth_employee` (`employee_id`);

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

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

--
-- Indexes for table `positions`
--
ALTER TABLE `positions`
  ADD PRIMARY KEY (`position_id`),
  ADD KEY `fk_department` (`department_id`);

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

--
-- Indexes for table `retro_adjustments`
--
ALTER TABLE `retro_adjustments`
  ADD PRIMARY KEY (`retro_id`),
  ADD KEY `idx_employee` (`employee_id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_applied_payroll` (`applied_in_payroll_id`);

--
-- Indexes for table `reward_journal_entry`
--
ALTER TABLE `reward_journal_entry`
  ADD PRIMARY KEY (`journal_id`);

--
-- Indexes for table `reward_rules`
--
ALTER TABLE `reward_rules`
  ADD PRIMARY KEY (`reward_rule_id`);

--
-- Indexes for table `role_approver_levels`
--
ALTER TABLE `role_approver_levels`
  ADD PRIMARY KEY (`role_id`);

--
-- Indexes for table `salary_for_employee`
--
ALTER TABLE `salary_for_employee`
  ADD PRIMARY KEY (`salary_id`),
  ADD KEY `employee_id` (`employee_id`),
  ADD KEY `position_level` (`position_level`);

--
-- Indexes for table `salary_grades`
--
ALTER TABLE `salary_grades`
  ADD PRIMARY KEY (`GradeID`),
  ADD KEY `idx_position_level` (`PositionLevel`);

--
-- Indexes for table `schedule_submissions`
--
ALTER TABLE `schedule_submissions`
  ADD PRIMARY KEY (`submission_id`),
  ADD KEY `employee_id` (`employee_id`),
  ADD KEY `status` (`status`),
  ADD KEY `effective_date` (`effective_date`);

--
-- Indexes for table `sss_contribution`
--
ALTER TABLE `sss_contribution`
  ADD PRIMARY KEY (`SSS_Contribution_id`),
  ADD KEY `fk_sss_employee` (`employee_id`);

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

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

--
-- Indexes for table `tbl_biometrics_logs`
--
ALTER TABLE `tbl_biometrics_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `person_id` (`person_id`);

--
-- Indexes for table `thirteenth_month_pays`
--
ALTER TABLE `thirteenth_month_pays`
  ADD PRIMARY KEY (`id`),
  ADD KEY `employee_id` (`employee_id`);

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

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

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

--
-- Indexes for table `user_role_list`
--
ALTER TABLE `user_role_list`
  ADD PRIMARY KEY (`role_id`),
  ADD UNIQUE KEY `role_name` (`role_name`);

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

--
-- Indexes for table `work_time_break`
--
ALTER TABLE `work_time_break`
  ADD PRIMARY KEY (`id`),
  ADD KEY `work_time_id` (`work_time_id`),
  ADD KEY `break_id` (`break_id`);

--
-- Indexes for table `work_time_late_deduction`
--
ALTER TABLE `work_time_late_deduction`
  ADD PRIMARY KEY (`id`),
  ADD KEY `work_time_id` (`work_time_id`),
  ADD KEY `tier_id` (`tier_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `allowance_journal`
--
ALTER TABLE `allowance_journal`
  MODIFY `journal_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `attendance`
--
ALTER TABLE `attendance`
  MODIFY `attendance_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4567119;

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

--
-- AUTO_INCREMENT for table `base_salary`
--
ALTER TABLE `base_salary`
  MODIFY `base_salary_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=165;

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `employee_leaves`
--
ALTER TABLE `employee_leaves`
  MODIFY `leave_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

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

--
-- AUTO_INCREMENT for table `employee_overtime_request`
--
ALTER TABLE `employee_overtime_request`
  MODIFY `request_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=67;

--
-- AUTO_INCREMENT for table `employee_shift_schedule`
--
ALTER TABLE `employee_shift_schedule`
  MODIFY `schedule_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=50;

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

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

--
-- AUTO_INCREMENT for table `incentives`
--
ALTER TABLE `incentives`
  MODIFY `incentives_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `issued_items`
--
ALTER TABLE `issued_items`
  MODIFY `item_id` int(11) NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `late_attendance_requests`
--
ALTER TABLE `late_attendance_requests`
  MODIFY `request_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=503;

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

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

--
-- AUTO_INCREMENT for table `leave_deduction_logs`
--
ALTER TABLE `leave_deduction_logs`
  MODIFY `log_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `leave_requests`
--
ALTER TABLE `leave_requests`
  MODIFY `leave_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `leave_types`
--
ALTER TABLE `leave_types`
  MODIFY `leave_type_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `liability_categories`
--
ALTER TABLE `liability_categories`
  MODIFY `category_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `loans`
--
ALTER TABLE `loans`
  MODIFY `loan_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=43;

--
-- AUTO_INCREMENT for table `loan_journal_entry`
--
ALTER TABLE `loan_journal_entry`
  MODIFY `journal_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=92;

--
-- AUTO_INCREMENT for table `loan_payment_history`
--
ALTER TABLE `loan_payment_history`
  MODIFY `loan_payment_history_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `loan_remittance_logs`
--
ALTER TABLE `loan_remittance_logs`
  MODIFY `remittance_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `loan_skip_requests`
--
ALTER TABLE `loan_skip_requests`
  MODIFY `skip_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `logs`
--
ALTER TABLE `logs`
  MODIFY `log_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=427;

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

--
-- AUTO_INCREMENT for table `overtime_table`
--
ALTER TABLE `overtime_table`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `pagibig_contribution`
--
ALTER TABLE `pagibig_contribution`
  MODIFY `pagibig_contribution_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=205;

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

--
-- AUTO_INCREMENT for table `payroll`
--
ALTER TABLE `payroll`
  MODIFY `payroll_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=276;

--
-- AUTO_INCREMENT for table `payroll_allowance_exceptions`
--
ALTER TABLE `payroll_allowance_exceptions`
  MODIFY `exception_id` int(11) NOT NULL AUTO_INCREMENT;

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

--
-- AUTO_INCREMENT for table `philhealth_contribution`
--
ALTER TABLE `philhealth_contribution`
  MODIFY `PH_contribution_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=205;

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

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

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

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

--
-- AUTO_INCREMENT for table `reward_journal_entry`
--
ALTER TABLE `reward_journal_entry`
  MODIFY `journal_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `reward_rules`
--
ALTER TABLE `reward_rules`
  MODIFY `reward_rule_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `salary_for_employee`
--
ALTER TABLE `salary_for_employee`
  MODIFY `salary_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=230;

--
-- AUTO_INCREMENT for table `schedule_submissions`
--
ALTER TABLE `schedule_submissions`
  MODIFY `submission_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=50;

--
-- AUTO_INCREMENT for table `sss_contribution`
--
ALTER TABLE `sss_contribution`
  MODIFY `SSS_Contribution_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=207;

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

--
-- AUTO_INCREMENT for table `sss_contribution_table`
--
ALTER TABLE `sss_contribution_table`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=62;

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

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

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

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

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

--
-- AUTO_INCREMENT for table `user_role_list`
--
ALTER TABLE `user_role_list`
  MODIFY `role_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `allowance_journal`
--
ALTER TABLE `allowance_journal`
  ADD CONSTRAINT `fk_jr_allow` FOREIGN KEY (`allowance_id`) REFERENCES `employee_allowance` (`allowance_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_jr_payroll` FOREIGN KEY (`payroll_id`) REFERENCES `payroll` (`payroll_id`) ON DELETE SET NULL;

--
-- Constraints for table `attendance`
--
ALTER TABLE `attendance`
  ADD CONSTRAINT `attendance_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_employee` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE;

--
-- Constraints for table `base_salary`
--
ALTER TABLE `base_salary`
  ADD CONSTRAINT `fk_employee_id` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE;

--
-- Constraints for table `break_time`
--
ALTER TABLE `break_time`
  ADD CONSTRAINT `break_time_ibfk_1` FOREIGN KEY (`work_time_id`) REFERENCES `work_time` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `deduction`
--
ALTER TABLE `deduction`
  ADD CONSTRAINT `deduction_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `employees`
--
ALTER TABLE `employees`
  ADD CONSTRAINT `employees_ibfk_1` FOREIGN KEY (`department_id`) REFERENCES `departments` (`department_id`),
  ADD CONSTRAINT `fk_employees_branch` FOREIGN KEY (`branch_id`) REFERENCES `branches` (`branch_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_position` FOREIGN KEY (`position_id`) REFERENCES `positions` (`position_id`);

--
-- Constraints for table `employee_allowance`
--
ALTER TABLE `employee_allowance`
  ADD CONSTRAINT `fk_allow_emp` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE;

--
-- Constraints for table `employee_overtime_request`
--
ALTER TABLE `employee_overtime_request`
  ADD CONSTRAINT `fk_overtime_employee_id` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_overtime_holiday` FOREIGN KEY (`holiday_id`) REFERENCES `holidays` (`holiday_id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `incentives`
--
ALTER TABLE `incentives`
  ADD CONSTRAINT `incentives_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`),
  ADD CONSTRAINT `incentives_ibfk_2` FOREIGN KEY (`position_id`) REFERENCES `employees` (`position_id`);

--
-- Constraints for table `late_attendance_requests`
--
ALTER TABLE `late_attendance_requests`
  ADD CONSTRAINT `late_attendance_requests_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `late_attendance_requests_ibfk_2` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`username`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `late_deduction`
--
ALTER TABLE `late_deduction`
  ADD CONSTRAINT `late_deduction_ibfk_1` FOREIGN KEY (`tier_id`) REFERENCES `late_deduction_tier` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `loans`
--
ALTER TABLE `loans`
  ADD CONSTRAINT `fk_loans_employee` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_loans_item` FOREIGN KEY (`item_id`) REFERENCES `issued_items` (`item_id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `loan_journal_entry`
--
ALTER TABLE `loan_journal_entry`
  ADD CONSTRAINT `loan_journal_entry_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`loan_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `loan_journal_entry_ibfk_2` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE;

--
-- Constraints for table `loan_payment_history`
--
ALTER TABLE `loan_payment_history`
  ADD CONSTRAINT `fk_payment_employee` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_payment_loan` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`loan_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `loan_remittance_logs`
--
ALTER TABLE `loan_remittance_logs`
  ADD CONSTRAINT `loan_remittance_logs_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`loan_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `loan_remittance_logs_ibfk_2` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE;

--
-- Constraints for table `loan_skip_requests`
--
ALTER TABLE `loan_skip_requests`
  ADD CONSTRAINT `loan_skip_requests_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `loans` (`loan_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `loan_skip_requests_ibfk_2` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE;

--
-- Constraints for table `pagibig_contribution`
--
ALTER TABLE `pagibig_contribution`
  ADD CONSTRAINT `fk_pagibig_employee` FOREIGN KEY (`employee_id`) REFERENCES `salary_for_employee` (`employee_id`) ON DELETE CASCADE;

--
-- Constraints for table `payroll`
--
ALTER TABLE `payroll`
  ADD CONSTRAINT `payroll_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `payroll_allowance_exceptions`
--
ALTER TABLE `payroll_allowance_exceptions`
  ADD CONSTRAINT `fk_exc_allow` FOREIGN KEY (`allowance_id`) REFERENCES `employee_allowance` (`allowance_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `fk_exc_payroll` FOREIGN KEY (`payroll_id`) REFERENCES `payroll` (`payroll_id`) ON DELETE CASCADE;

--
-- Constraints for table `philhealth_contribution`
--
ALTER TABLE `philhealth_contribution`
  ADD CONSTRAINT `fk_philhealth_employee` FOREIGN KEY (`employee_id`) REFERENCES `salary_for_employee` (`employee_id`) ON DELETE CASCADE;

--
-- Constraints for table `positions`
--
ALTER TABLE `positions`
  ADD CONSTRAINT `fk_department` FOREIGN KEY (`department_id`) REFERENCES `departments` (`department_id`);

--
-- Constraints for table `push_subscriptions`
--
ALTER TABLE `push_subscriptions`
  ADD CONSTRAINT `push_subscriptions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE;

--
-- Constraints for table `retro_adjustments`
--
ALTER TABLE `retro_adjustments`
  ADD CONSTRAINT `fk_retro_employee` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_retro_payroll` FOREIGN KEY (`applied_in_payroll_id`) REFERENCES `payroll` (`payroll_id`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `role_approver_levels`
--
ALTER TABLE `role_approver_levels`
  ADD CONSTRAINT `fk_role_approver_levels_user_role_list` FOREIGN KEY (`role_id`) REFERENCES `user_role_list` (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `salary_for_employee`
--
ALTER TABLE `salary_for_employee`
  ADD CONSTRAINT `salary_for_employee_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `salary_for_employee_ibfk_2` FOREIGN KEY (`position_level`) REFERENCES `salary_grades` (`GradeID`) ON UPDATE CASCADE;

--
-- Constraints for table `sss_contribution`
--
ALTER TABLE `sss_contribution`
  ADD CONSTRAINT `fk_sss_contribution_employee` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE;

--
-- Constraints for table `tbl_biometrics_logs`
--
ALTER TABLE `tbl_biometrics_logs`
  ADD CONSTRAINT `fk_biometrics_user` FOREIGN KEY (`person_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `thirteenth_month_pays`
--
ALTER TABLE `thirteenth_month_pays`
  ADD CONSTRAINT `thirteenth_month_pays_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `employees` (`employee_id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `work_time_break`
--
ALTER TABLE `work_time_break`
  ADD CONSTRAINT `work_time_break_ibfk_1` FOREIGN KEY (`work_time_id`) REFERENCES `work_time` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `work_time_break_ibfk_2` FOREIGN KEY (`break_id`) REFERENCES `break_time` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `work_time_late_deduction`
--
ALTER TABLE `work_time_late_deduction`
  ADD CONSTRAINT `work_time_late_deduction_ibfk_1` FOREIGN KEY (`work_time_id`) REFERENCES `work_time` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `work_time_late_deduction_ibfk_2` FOREIGN KEY (`tier_id`) REFERENCES `late_deduction_tier` (`id`) ON DELETE CASCADE;
COMMIT;

