-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: May 22, 2025 at 05:35 AM
-- Server version: 8.0.42
-- PHP Version: 8.2.28

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `school`
--

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

--
-- Table structure for table `admins`
--

CREATE TABLE `admins` (
  `id` int UNSIGNED NOT NULL,
  `user_id` int UNSIGNED NOT NULL,
  `school_id` int UNSIGNED NOT NULL,
  `first_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `last_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `email` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `hire_date` date DEFAULT NULL,
  `role` enum('super_admin','admin','staff') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'admin',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `attendance_data`
--

CREATE TABLE `attendance_data` (
  `id` int UNSIGNED NOT NULL,
  `class_id` int NOT NULL,
  `class_section_id` int NOT NULL,
  `student_id` int NOT NULL,
  `school_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `date` date NOT NULL,
  `status` enum('present','absent','late') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT 'present',
  `reason` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `reported` tinyint DEFAULT NULL,
  `semester` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `school_year` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `modified_by` int DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `attendance_data`
--

INSERT INTO `attendance_data` (`id`, `class_id`, `class_section_id`, `student_id`, `school_id`, `date`, `status`, `reason`, `reported`, `semester`, `school_year`, `modified_by`, `created_at`, `updated_at`) VALUES
(72, 0, 30, 132, 'SCH-202500004', '2025-05-22', 'absent', '', NULL, 'Fall', '2024/2025', 116, '2025-05-22 05:28:25', '2025-05-22 05:35:12');

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

--
-- Table structure for table `attendance_record`
--

CREATE TABLE `attendance_record` (
  `id` int UNSIGNED NOT NULL,
  `class_section_id` int NOT NULL,
  `student_id` int NOT NULL,
  `school_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `total_absence` int NOT NULL DEFAULT '0',
  `total_late` int NOT NULL DEFAULT '0',
  `total_presence` int NOT NULL DEFAULT '0',
  `total_attendance` int NOT NULL DEFAULT '0',
  `semester` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `school_year` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `modified_by` int DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `attendance_record`
--

INSERT INTO `attendance_record` (`id`, `class_section_id`, `student_id`, `school_id`, `total_absence`, `total_late`, `total_presence`, `total_attendance`, `semester`, `school_year`, `modified_by`, `created_at`, `updated_at`) VALUES
(33, 30, 132, 'SCH-202500004', 1, 0, 0, 1, 'Fall', '2024/2025', NULL, '2025-05-22 05:28:25', '2025-05-22 05:35:01');

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

--
-- Table structure for table `authorized_users`
--

CREATE TABLE `authorized_users` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `authorized_user_id` int DEFAULT NULL,
  `firstname` varchar(255) NOT NULL,
  `lastname` varchar(255) NOT NULL,
  `phone_number` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `gender` varchar(10) NOT NULL,
  `email` varchar(255) NOT NULL,
  `relation_to_user` varchar(64) DEFAULT NULL,
  `token` varchar(128) DEFAULT NULL,
  `status` enum('Pending','Active') DEFAULT 'Pending',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `chapters`
--

CREATE TABLE `chapters` (
  `chapter_id` int NOT NULL,
  `chapter_name` varchar(100) NOT NULL,
  `class_section_id` int NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `classes`
--

CREATE TABLE `classes` (
  `id` int UNSIGNED NOT NULL,
  `class_name` varchar(100) NOT NULL,
  `schedule` varchar(100) NOT NULL,
  `capacity` int NOT NULL,
  `semester` varchar(255) NOT NULL,
  `school_year` varchar(9) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `classes`
--

INSERT INTO `classes` (`id`, `class_name`, `schedule`, `capacity`, `semester`, `school_year`) VALUES
(1, '1', 'Sunday 10:00 AM - 1:00 PM', 30, '', NULL),
(2, '2', 'Sunday 10:00 AM - 1:00 PM', 30, '', NULL),
(3, '3', 'Sunday 10:00 AM - 1:00 PM', 30, '', NULL),
(4, '4', 'Sunday 10:00 AM - 1:00 PM', 30, '', NULL),
(5, '5', 'Sunday 10:00 PM - 1:00 PM', 30, '', NULL),
(6, '6', 'Sunday 10:00 PM - 1:00 PM', 30, '', NULL),
(7, '7', 'Sunday 10:00 AM - 1:00 PM', 30, '', NULL),
(8, '8', 'Sunday 10:00 AM - 1:00 PM', 30, '', NULL),
(9, '9', 'Sunday 10:00 PM - 1:00 PM', 30, '', NULL),
(12, 'youth', 'Sunday 10:00 AM - 1:00 PM', 30, '', NULL),
(10, '10', 'Sunday 10:00 AM - 1:00 PM', 30, '', NULL),
(11, '11', 'Sunday 10:00 AM - 1:00 PM', 30, '', NULL);

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

--
-- Table structure for table `class_section`
--

CREATE TABLE `class_section` (
  `id` int UNSIGNED NOT NULL,
  `class_id` int UNSIGNED NOT NULL,
  `section_id` int UNSIGNED NOT NULL,
  `class_section_name` varchar(100) NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `semester` varchar(255) NOT NULL,
  `school_year` varchar(9) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `class_section`
--

INSERT INTO `class_section` (`id`, `class_id`, `section_id`, `class_section_name`, `created_at`, `updated_at`, `semester`, `school_year`) VALUES
(1, 1, 10, '1', '2024-08-16 01:06:30', '2024-08-23 16:30:43', '', NULL),
(2, 1, 11, '1-A', '2024-08-16 01:06:30', '2024-08-23 17:15:54', '', NULL),
(3, 1, 12, '1-B', '2024-08-16 01:06:30', '2024-08-23 17:15:54', '', NULL),
(4, 1, 13, '1-C', '2024-08-16 01:06:30', '2024-08-23 17:15:54', '', NULL),
(5, 2, 20, '2', '2024-08-16 01:06:30', '2024-08-23 17:16:30', '', NULL),
(6, 2, 21, '2-A', '2024-08-16 01:06:30', '2024-08-23 17:16:30', '', NULL),
(7, 2, 22, '2-B', '2024-08-16 01:06:30', '2024-08-23 17:16:30', '', NULL),
(8, 2, 23, '2-C', '2024-08-16 01:06:30', '2024-08-23 17:16:30', '', NULL),
(9, 3, 30, '3', '2024-08-16 01:06:30', '2024-08-23 17:18:14', '', NULL),
(10, 3, 31, '3-A', '2024-08-16 01:06:30', '2024-08-23 17:18:14', '', NULL),
(11, 3, 32, '3-B', '2024-08-16 01:06:30', '2024-08-23 17:18:14', '', NULL),
(12, 3, 33, '3-C', '2024-08-16 01:06:30', '2024-08-23 17:18:14', '', NULL),
(13, 4, 40, '4', '2024-08-16 01:06:30', '2024-08-23 17:19:31', '', NULL),
(14, 4, 41, '4-A', '2024-08-16 01:06:30', '2024-08-23 17:19:31', '', NULL),
(15, 4, 42, '4-B', '2024-08-16 01:06:30', '2024-08-23 17:19:31', '', NULL),
(16, 4, 43, '4-C', '2024-08-16 01:06:30', '2024-08-23 17:19:31', '', NULL),
(17, 5, 50, '5', '2024-08-16 01:06:30', '2024-08-23 17:19:31', '', NULL),
(18, 5, 51, '5-A', '2024-08-16 01:06:30', '2024-08-23 17:19:31', '', NULL),
(19, 5, 52, '5-B', '2024-08-16 01:06:30', '2024-08-23 17:19:31', '', NULL),
(20, 5, 53, '', '2024-08-16 01:06:30', '2024-08-23 17:19:31', '', NULL),
(21, 6, 60, '6', '2024-08-16 01:06:30', '2024-08-23 17:19:31', '', NULL),
(22, 6, 61, '6-A', '2024-08-16 01:06:30', '2024-08-23 17:19:31', '', NULL),
(23, 6, 62, '6-B', '2024-08-16 01:06:30', '2024-08-23 17:19:31', '', NULL),
(24, 6, 63, '6-C', '2024-08-16 01:06:30', '2024-08-23 17:19:31', '', NULL),
(25, 7, 70, '7', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(26, 7, 71, '7-A', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(27, 7, 72, '7-B', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(28, 7, 73, '7-C', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(29, 8, 80, '8', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(30, 8, 81, '8-A', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(31, 8, 82, '8-B', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(32, 8, 83, '8-C', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(33, 9, 90, '9', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(34, 9, 91, '9-A', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(35, 9, 92, '9-B', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(36, 9, 93, '9-C', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(37, 10, 100, '10', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(38, 10, 101, '10-A', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(39, 10, 102, '10-B', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(40, 10, 103, '10-C', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(41, 11, 110, '11', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(42, 11, 111, '11-A', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(43, 11, 112, '11-B', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(44, 11, 113, '11-C', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(45, 12, 120, 'youth', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(46, 12, 121, 'youth-A', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(47, 12, 122, 'youth-B', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL),
(48, 12, 123, 'youth-C', '2024-08-16 01:06:30', '2024-08-23 17:21:41', '', NULL);

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

--
-- Table structure for table `configuration`
--

CREATE TABLE `configuration` (
  `id` int UNSIGNED NOT NULL,
  `config_key` varchar(100) NOT NULL,
  `config_value` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `configuration`
--

INSERT INTO `configuration` (`id`, `config_key`, `config_value`) VALUES
(1, 'max_kids', '6'),
(2, 'enrollment_deadline', '2025-10-01'),
(3, 'cleanup_timeout', '900'),
(4, 'school_year', '2024/2025'),
(5, 'first_student_fee', '350'),
(6, 'second_student_fee', '200'),
(7, 'youth_fee', '180'),
(8, 'semester', 'Fall'),
(9, 'total_semester1_days', '14'),
(10, 'total_semester2_days', '15'),
(11, 'refund_deadline', '2024-12-31'),
(13, 'delete_email_notify', 'support@alrahmaisgl.org, melabidi@alrahmaisgl.org'),
(14, 'school_start_date', '2025-09-01');

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

--
-- Table structure for table `contactus`
--

CREATE TABLE `contactus` (
  `id` int UNSIGNED NOT NULL,
  `sender_id` int UNSIGNED NOT NULL,
  `reciever_id` int UNSIGNED NOT NULL,
  `subject` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `semester` varchar(255) NOT NULL,
  `school_year` varchar(9) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `current_flag`
--

CREATE TABLE `current_flag` (
  `id` int NOT NULL,
  `student_id` int NOT NULL,
  `student_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `grade` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `flag` enum('payment','attendance','grade','behavior','other') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `flag_datetime` datetime NOT NULL,
  `flag_state` enum('Open','Closed','Canceled') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT 'Open',
  `updated_by_open` int DEFAULT NULL,
  `open_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `updated_by_closed` int DEFAULT NULL,
  `close_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `updated_by_canceled` int DEFAULT NULL,
  `cancel_description` text,
  `semester` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `school_year` varchar(9) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `emergency_contacts`
--

CREATE TABLE `emergency_contacts` (
  `id` int UNSIGNED NOT NULL,
  `emergency_contact_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `parent_id` int DEFAULT NULL,
  `cellphone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `relation` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `semester` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `school_year` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `emergency_contacts`
--

INSERT INTO `emergency_contacts` (`id`, `emergency_contact_name`, `parent_id`, `cellphone`, `email`, `relation`, `semester`, `school_year`, `created_at`, `updated_at`) VALUES
(31, 'Jessica Farao', 118, '(857)-206-6789', 'jesscharles504@gmail.com', 'Mother', 'Fall', NULL, '2025-05-22 04:20:31', '2025-05-22 04:20:31');

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

--
-- Table structure for table `enrollments`
--

CREATE TABLE `enrollments` (
  `id` int UNSIGNED NOT NULL,
  `student_id` int UNSIGNED NOT NULL,
  `class_section_id` int UNSIGNED DEFAULT NULL,
  `parent_id` int UNSIGNED NOT NULL,
  `enrollment_date` date NOT NULL,
  `enrollment_status` enum('admission under review','payment pending','Enrolled','withdraw under review','refund pending','withdrawn') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `withdrawal_date` date DEFAULT NULL,
  `is_withdrawn` tinyint(1) DEFAULT '0',
  `admission_status` enum('accepted','denied') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'denied',
  `semester` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `school_year` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `enrollments`
--

INSERT INTO `enrollments` (`id`, `student_id`, `class_section_id`, `parent_id`, `enrollment_date`, `enrollment_status`, `withdrawal_date`, `is_withdrawn`, `admission_status`, `semester`, `school_year`, `created_at`, `updated_at`) VALUES
(48, 132, 30, 118, '2025-05-22', 'payment pending', NULL, 0, 'accepted', 'Fall', '2024/2025', '2025-05-22 04:25:33', '2025-05-22 05:03:07');

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

--
-- Table structure for table `events`
--

CREATE TABLE `events` (
  `id` int UNSIGNED NOT NULL,
  `title` varchar(255) NOT NULL,
  `start` datetime NOT NULL,
  `end` datetime NOT NULL,
  `description` text,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `semester` varchar(255) NOT NULL,
  `school_year` varchar(9) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `events`
--

INSERT INTO `events` (`id`, `title`, `start`, `end`, `description`, `created_at`, `updated_at`, `semester`, `school_year`) VALUES
(12, 'Start school day', '2024-09-22 00:00:00', '2024-09-22 23:59:00', 'start', '2024-09-05 02:37:12', '2024-09-05 02:37:12', '', NULL),
(4, 'Spring Break', '2025-04-07 00:00:00', '2025-04-14 23:59:59', 'Spring break, school is closed.', '2024-08-28 01:18:35', '2024-08-28 01:18:35', '', NULL),
(5, 'Day Off - Memorial Day', '2025-05-26 00:00:00', '2025-05-26 23:59:59', 'Memorial Day holiday, no school.', '2024-08-28 01:18:35', '2024-08-28 01:18:35', '', NULL),
(6, 'End Day of School', '2025-05-15 08:00:00', '2025-06-15 15:00:00', 'The last day of the school year.', '2024-08-28 01:18:35', '2024-08-28 01:18:35', '', NULL),
(7, 'Parent-Teacher Conferences', '2024-10-15 16:00:00', '2024-10-15 20:00:00', 'Parent-teacher conferences, no classes during this time.', '2024-08-28 01:18:35', '2024-08-28 01:18:35', '', NULL),
(8, 'Staff Professional Development Day', '2024-11-01 08:00:00', '2024-11-01 15:00:00', 'No classes, staff professional development.', '2024-08-28 01:18:35', '2024-08-28 01:18:35', '', NULL),
(13, 'Test', '2025-01-22 00:00:00', '2025-01-23 00:00:00', 'Test the events window', '2025-01-21 15:45:17', '2025-01-21 15:46:09', '', NULL);

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

--
-- Table structure for table `examquestiondistribution`
--

CREATE TABLE `examquestiondistribution` (
  `exam_distribution_id` int NOT NULL,
  `exam_id` int NOT NULL,
  `question_type_id` int NOT NULL,
  `num_questions` int NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `examquestions`
--

CREATE TABLE `examquestions` (
  `exam_question_id` int NOT NULL,
  `exam_id` int NOT NULL,
  `question_id` int NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `exams`
--

CREATE TABLE `exams` (
  `id` int NOT NULL,
  `student_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `student_school_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `class_section_id` int NOT NULL,
  `exam_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `final_exam`
--

CREATE TABLE `final_exam` (
  `id` int UNSIGNED NOT NULL,
  `student_id` int NOT NULL,
  `school_id` char(36) NOT NULL,
  `class_section_id` int DEFAULT NULL,
  `teacher_id` int NOT NULL,
  `score` int DEFAULT NULL,
  `comment` text,
  `semester` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'Spring',
  `school_year` varchar(9) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

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

--
-- Table structure for table `final_score`
--

CREATE TABLE `final_score` (
  `id` int UNSIGNED NOT NULL,
  `student_id` int NOT NULL,
  `school_id` char(36) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `class_section_id` int DEFAULT NULL,
  `teacher_id` int NOT NULL,
  `score` int NOT NULL,
  `score_letter` varchar(9) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `comment` text,
  `school_year` varchar(9) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `semester` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `final_score`
--

INSERT INTO `final_score` (`id`, `student_id`, `school_id`, `class_section_id`, `teacher_id`, `score`, `score_letter`, `comment`, `school_year`, `created_at`, `updated_at`, `semester`) VALUES
(916, 132, '', 30, 116, 98, 'A', '', '2024/2025', '2025-05-22 05:25:11', '2025-05-22 05:35:20', 'Fall');

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

--
-- Table structure for table `flag`
--

CREATE TABLE `flag` (
  `id` int NOT NULL,
  `student_id` int NOT NULL,
  `student_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `grade` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `flag` enum('payment','attendance','grade','behavior','other') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `flag_datetime` datetime NOT NULL,
  `flag_state` enum('Closed','Canceled') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `updated_by_open` int DEFAULT NULL,
  `open_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `updated_by_closed` int DEFAULT NULL,
  `close_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `updated_by_canceled` int DEFAULT NULL,
  `cancel_description` text,
  `semester` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `school_year` varchar(9) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `homework`
--

CREATE TABLE `homework` (
  `id` int UNSIGNED NOT NULL,
  `student_id` int NOT NULL,
  `school_id` char(36) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `class_section_id` int DEFAULT NULL,
  `teacher_id` int NOT NULL,
  `homework_index` tinyint DEFAULT NULL,
  `score` int DEFAULT NULL,
  `comment` text,
  `semester` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `school_year` varchar(9) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `homework`
--

INSERT INTO `homework` (`id`, `student_id`, `school_id`, `class_section_id`, `teacher_id`, `homework_index`, `score`, `comment`, `semester`, `school_year`, `created_at`, `updated_at`) VALUES
(266, 132, 'SCH-202500004', 30, 116, 1, 100, NULL, 'Fall', '2024/2025', '2025-05-22 05:33:49', '2025-05-22 05:34:05'),
(267, 132, 'SCH-202500004', 30, 116, 2, 98, NULL, 'Fall', '2024/2025', '2025-05-22 05:34:01', '2025-05-22 05:34:05');

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

--
-- Table structure for table `invoices`
--

CREATE TABLE `invoices` (
  `id` int UNSIGNED NOT NULL,
  `parent_id` int NOT NULL,
  `registeredKids` int UNSIGNED NOT NULL DEFAULT '0',
  `registeredKids_after_Withdrawal` int UNSIGNED NOT NULL DEFAULT '0',
  `invoice_number` varchar(50) NOT NULL,
  `total_amount` decimal(10,2) NOT NULL,
  `refund_amount` decimal(10,2) DEFAULT NULL,
  `school_year` varchar(9) DEFAULT NULL,
  `balance` decimal(10,2) DEFAULT NULL,
  `issue_date` date NOT NULL,
  `refund_issue_date` date DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `status` varchar(50) NOT NULL DEFAULT 'unpaid',
  `description` text,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `invoices`
--

INSERT INTO `invoices` (`id`, `parent_id`, `registeredKids`, `registeredKids_after_Withdrawal`, `invoice_number`, `total_amount`, `refund_amount`, `school_year`, `balance`, `issue_date`, `refund_issue_date`, `due_date`, `status`, `description`, `created_at`, `updated_at`) VALUES
(27, 118, 1, 0, '2025_000001', 350.00, 0.00, '2024/2025', NULL, '2025-05-22', NULL, '2025-06-21', 'unpaid', 'Tuition fees for the school year', '2025-05-22 04:31:02', '2025-05-22 04:31:02');

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

--
-- Table structure for table `invoice_students_list`
--

CREATE TABLE `invoice_students_list` (
  `id` int UNSIGNED NOT NULL,
  `invoice_id` int UNSIGNED NOT NULL,
  `student_id` int UNSIGNED NOT NULL,
  `student_firstname` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `student_lastname` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `student_school_id` int UNSIGNED NOT NULL,
  `enrolled` tinyint(1) DEFAULT '1',
  `school_year` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `invoice_students_list`
--

INSERT INTO `invoice_students_list` (`id`, `invoice_id`, `student_id`, `student_firstname`, `student_lastname`, `student_school_id`, `enrolled`, `school_year`, `created_at`, `updated_at`) VALUES
(39, 27, 132, 'Jiji', 'Alex', 0, 1, '2024/2025', '2025-05-22 04:31:02', '2025-05-22 04:31:02');

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

--
-- Table structure for table `ip_attempts`
--

CREATE TABLE `ip_attempts` (
  `id` int UNSIGNED NOT NULL,
  `ip_address` varchar(45) NOT NULL,
  `attempts` int NOT NULL DEFAULT '0',
  `last_attempt_at` datetime NOT NULL,
  `blocked_until` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `ip_attempts`
--

INSERT INTO `ip_attempts` (`id`, `ip_address`, `attempts`, `last_attempt_at`, `blocked_until`, `created_at`, `updated_at`) VALUES
(9, '192.168.3.47', 3, '2025-05-22 03:56:09', NULL, '2025-05-22 03:52:42', '2025-05-22 03:56:09');

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

--
-- Table structure for table `login_activity`
--

CREATE TABLE `login_activity` (
  `id` int UNSIGNED NOT NULL,
  `user_id` int NOT NULL,
  `email` varchar(255) NOT NULL,
  `login_time` timestamp NOT NULL,
  `logout_time` timestamp NULL DEFAULT NULL,
  `ip_address` varchar(255) NOT NULL,
  `user_agent` varchar(255) NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `semester` varchar(255) NOT NULL,
  `school_year` varchar(9) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `login_activity`
--

INSERT INTO `login_activity` (`id`, `user_id`, `email`, `login_time`, `logout_time`, `ip_address`, `user_agent`, `created_at`, `updated_at`, `semester`, `school_year`) VALUES
(505, 115, 'alrahma.isgl@gmail.com', '2025-05-21 23:10:19', '2025-05-22 06:34:41', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-21 19:10:19', '2025-05-22 02:34:41', '', NULL),
(504, 115, 'alrahma.isgl@gmail.com', '2025-05-21 10:24:51', '2025-05-22 06:34:41', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-21 06:24:51', '2025-05-22 02:34:41', '', NULL),
(503, 115, 'alrahma.isgl@gmail.com', '2025-05-21 09:32:04', '2025-05-22 06:34:41', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-21 05:32:04', '2025-05-22 02:34:41', '', NULL),
(501, 115, 'alrahma.isgl@gmail.com', '2025-05-21 06:32:35', '2025-05-22 06:34:41', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-21 02:32:35', '2025-05-22 02:34:41', '', NULL),
(502, 115, 'alrahma.isgl@gmail.com', '2025-05-21 07:07:37', '2025-05-22 06:34:41', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-21 03:07:37', '2025-05-22 02:34:41', '', NULL),
(500, 115, 'alrahma.isgl@gmail.com', '2025-05-21 06:21:37', '2025-05-22 06:34:41', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-21 02:21:37', '2025-05-22 02:34:41', '', NULL),
(499, 115, 'alrahma.isgl@gmail.com', '2025-05-21 05:49:38', '2025-05-22 06:34:41', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-21 01:49:38', '2025-05-22 02:34:41', '', NULL),
(498, 115, 'alrahma.isgl@gmail.com', '2025-05-21 04:00:11', '2025-05-21 05:48:29', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-21 00:00:11', '2025-05-21 01:48:29', '', NULL),
(497, 1, 'administrator@gmail.com', '2025-05-21 02:32:29', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0', '2025-05-20 22:32:29', '2025-05-20 22:32:29', '', NULL),
(496, 115, 'alrahma.isgl@gmail.com', '2025-05-21 02:20:13', '2025-05-21 05:48:29', '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-20 22:20:13', '2025-05-21 01:48:29', '', NULL),
(495, 114, 'alrahma.isgl@gmail.com', '2025-05-21 01:51:52', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-20 21:51:52', '2025-05-20 21:51:52', '', NULL),
(494, 114, 'alrahma.isgl@gmail.com', '2025-05-21 01:29:27', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-20 21:29:27', '2025-05-20 21:29:27', '', NULL),
(493, 114, 'alrahma.isgl@gmail.com', '2025-05-21 01:27:37', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-20 21:27:37', '2025-05-20 21:27:37', '', NULL),
(492, 1, 'administrator@gmail.com', '2025-05-20 09:59:34', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-20 05:59:34', '2025-05-20 05:59:34', '', NULL),
(491, 1, 'administrator@gmail.com', '2025-05-20 08:52:42', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-20 04:52:42', '2025-05-20 04:52:42', '', NULL),
(490, 1, 'administrator@gmail.com', '2025-05-20 08:21:00', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-20 04:21:00', '2025-05-20 04:21:00', '', NULL),
(489, 1, 'administrator@gmail.com', '2025-05-20 07:05:16', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-20 03:05:16', '2025-05-20 03:05:16', '', NULL),
(487, 114, 'alrahma.isgl@gmail.com', '2025-05-19 06:18:07', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0', '2025-05-19 02:18:07', '2025-05-19 02:18:07', '', NULL),
(488, 114, 'alrahma.isgl@gmail.com', '2025-05-19 08:42:23', NULL, '::1', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0', '2025-05-19 04:42:23', '2025-05-19 04:42:23', '', NULL),
(506, 115, 'alrahma.isgl@gmail.com', '2025-05-22 05:20:24', '2025-05-22 06:34:41', '192.168.3.48', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-22 01:20:24', '2025-05-22 02:34:41', '', NULL),
(507, 1, 'administrator@gmail.com', '2025-05-22 05:31:53', NULL, '192.168.3.48', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-22 01:31:53', '2025-05-22 01:31:53', '', NULL),
(508, 1, 'administrator@gmail.com', '2025-05-22 05:34:37', NULL, '192.168.3.48', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-22 01:34:37', '2025-05-22 01:34:37', '', NULL),
(509, 115, 'alrahma.isgl@gmail.com', '2025-05-22 06:33:12', '2025-05-22 06:34:41', '192.168.3.46', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-22 02:33:12', '2025-05-22 02:34:41', '', NULL),
(510, 1, 'administrator@gmail.com', '2025-05-22 06:34:56', NULL, '192.168.3.46', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-22 02:34:56', '2025-05-22 02:34:56', '', NULL),
(511, 116, 'alrahma.isgl@gmail.com', '2025-05-22 07:48:38', NULL, '192.168.3.46', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-22 03:48:38', '2025-05-22 03:48:38', '', NULL),
(512, 116, 'alrahma.isgl@gmail.com', '2025-05-22 07:48:54', NULL, '192.168.3.46', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-22 03:48:54', '2025-05-22 03:48:54', '', NULL),
(513, 116, 'alrahma.isgl@gmail.com', '2025-05-22 07:49:06', NULL, '192.168.3.46', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-22 03:49:06', '2025-05-22 03:49:06', '', NULL),
(514, 116, 'alrahma.isgl@gmail.com', '2025-05-22 07:50:10', NULL, '192.168.3.46', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-22 03:50:10', '2025-05-22 03:50:10', '', NULL),
(515, 1, 'administrator@gmail.com', '2025-05-22 08:03:35', NULL, '192.168.3.46', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-22 04:03:35', '2025-05-22 04:03:35', '', NULL),
(516, 118, 'khoukhaela@gmail.com', '2025-05-22 08:04:13', NULL, '192.168.3.47', 'Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36', '2025-05-22 04:04:13', '2025-05-22 04:04:13', '', NULL);

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

--
-- Table structure for table `longanswerquestions`
--

CREATE TABLE `longanswerquestions` (
  `la_question_id` int NOT NULL,
  `question_id` int NOT NULL,
  `correct_answer` text
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `messages`
--

CREATE TABLE `messages` (
  `id` int UNSIGNED NOT NULL,
  `sender_id` int NOT NULL,
  `recipient_id` int NOT NULL,
  `subject` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `sent_datetime` datetime NOT NULL,
  `read_status` tinyint(1) NOT NULL DEFAULT '0',
  `read_datetime` datetime DEFAULT NULL,
  `message_number` varchar(20) NOT NULL,
  `priority` varchar(10) NOT NULL DEFAULT 'normal',
  `attachment` varchar(255) DEFAULT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'sent',
  `semester` varchar(255) NOT NULL,
  `school_year` varchar(9) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `midterm_exam`
--

CREATE TABLE `midterm_exam` (
  `id` int UNSIGNED NOT NULL,
  `student_id` int NOT NULL,
  `school_id` char(36) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `class_section_id` int DEFAULT NULL,
  `teacher_id` int NOT NULL,
  `score` int DEFAULT NULL,
  `comment` text,
  `semester` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'Fall',
  `school_year` varchar(9) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `midterm_exam`
--

INSERT INTO `midterm_exam` (`id`, `student_id`, `school_id`, `class_section_id`, `teacher_id`, `score`, `comment`, `semester`, `school_year`, `created_at`, `updated_at`) VALUES
(92, 132, '', 30, 116, 100, 'Good job', 'Fall', '2024/2025', '2025-05-22 05:34:43', '2025-05-22 05:34:43');

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

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` bigint UNSIGNED NOT NULL,
  `version` varchar(255) NOT NULL,
  `class` varchar(255) NOT NULL,
  `group` varchar(255) NOT NULL,
  `namespace` varchar(255) NOT NULL,
  `time` int NOT NULL,
  `batch` int UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` (`id`, `version`, `class`, `group`, `namespace`, `time`, `batch`) VALUES
(81, '2025-05-04-211451', 'App\\Database\\Migrations\\CreatePaypalTransactions', 'default', 'App', 1746393384, 1),
(80, '2024-09-13-192043', 'App\\Database\\Migrations\\CreateInvoicesTable', 'default', 'App', 1746393384, 1),
(79, '2024-09-05-044617', 'App\\Database\\Migrations\\CreateStudentsTable', 'default', 'App', 1746393384, 1),
(78, '2024-09-04-192537', 'App\\Database\\Migrations\\CreateAttendanceDataTable', 'default', 'App', 1746393384, 1),
(77, '2024-09-04-192530', 'App\\Database\\Migrations\\CreateAttendanceRecordTable', 'default', 'App', 1746393384, 1),
(76, '2024-09-02-225747', 'App\\Database\\Migrations\\CreateGradesTable', 'default', 'App', 1746393384, 1),
(75, '2024-09-02-224136', 'App\\Database\\Migrations\\CreateHomeworkTable', 'default', 'App', 1746393384, 1),
(74, '2024-09-02-224123', 'App\\Database\\Migrations\\CreateQuizTable', 'default', 'App', 1746393384, 1),
(73, '2024-09-02-223928', 'App\\Database\\Migrations\\CreateMidtermExamTable', 'default', 'App', 1746393384, 1),
(72, '2024-09-02-223635', 'App\\Database\\Migrations\\CreateFinalExamTable', 'default', 'App', 1746393384, 1),
(71, '2024-08-28-062205', 'App\\Database\\Migrations\\CreateMessagesTable', 'default', 'App', 1746393384, 1),
(70, '2024-08-26-193844', 'App\\Database\\Migrations\\CreateclassSectionTable', 'default', 'App', 1746393384, 1),
(69, '2024-08-26-045017', 'App\\Database\\Migrations\\CreateEnrollmentsTable', 'default', 'App', 1746393384, 1),
(68, '2024-08-26-040415', 'App\\Database\\Migrations\\CreateTeacherClassTable', 'default', 'App', 1746393384, 1),
(67, '2024-08-25-054908', 'App\\Database\\Migrations\\CreateContactUsTable', 'default', 'App', 1746393384, 1),
(66, '2024-08-25-024951', 'App\\Database\\Migrations\\CreateUsersTable', 'default', 'App', 1746393384, 1),
(65, '2024-08-25-024909', 'App\\Database\\Migrations\\CreateStudentClassTable', 'default', 'App', 1746393384, 1),
(64, '2024-08-25-024826', 'App\\Database\\Migrations\\CreatePasswordResetsTable', 'default', 'App', 1746393383, 1),
(63, '2024-08-25-024559', 'App\\Database\\Migrations\\CreateUserRolesTable', 'default', 'App', 1746393383, 1),
(62, '2024-08-25-024534', 'App\\Database\\Migrations\\CreateSupportRequestsTable', 'default', 'App', 1746393383, 1),
(61, '2024-08-25-024510', 'App\\Database\\Migrations\\CreateSettingsTable', 'default', 'App', 1746393383, 1),
(60, '2024-08-25-024457', 'App\\Database\\Migrations\\CreateRolePermissionsTable', 'default', 'App', 1746393383, 1),
(59, '2024-08-25-024447', 'App\\Database\\Migrations\\CreateRolesTable', 'default', 'App', 1746393383, 1),
(58, '2024-08-25-024435', 'App\\Database\\Migrations\\CreatePermissionsTable', 'default', 'App', 1746393383, 1),
(57, '2024-08-25-024424', 'App\\Database\\Migrations\\CreatePaymentsTable', 'default', 'App', 1746393383, 1),
(56, '2024-08-25-024411', 'App\\Database\\Migrations\\CreateParentsTable', 'default', 'App', 1746393383, 1),
(55, '2024-08-25-024345', 'App\\Database\\Migrations\\CreateNotificationsTable', 'default', 'App', 1746393383, 1),
(54, '2024-08-25-024305', 'App\\Database\\Migrations\\CreateLoginActivityTable', 'default', 'App', 1746393383, 1),
(53, '2024-08-25-024236', 'App\\Database\\Migrations\\CreateEventsTable', 'default', 'App', 1746393383, 1),
(52, '2024-08-25-024217', 'App\\Database\\Migrations\\CreateEmergencyContactsTable', 'default', 'App', 1746393383, 1),
(51, '2024-08-25-024201', 'App\\Database\\Migrations\\CreateConfigurationTable', 'default', 'App', 1746393383, 1),
(50, '2024-08-25-024150', 'App\\Database\\Migrations\\CreateClassesTable', 'default', 'App', 1746393383, 1);

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

--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` int NOT NULL,
  `title` varchar(255) DEFAULT NULL,
  `message` text NOT NULL,
  `target_group` enum('student','parent','teacher','admin') NOT NULL,
  `delivery_channels` set('in_app','email','sms') NOT NULL,
  `scheduled_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `notifications`
--

INSERT INTO `notifications` (`id`, `title`, `message`, `target_group`, `delivery_channels`, `scheduled_at`, `created_at`) VALUES
(46, 'admission under review', 'Your child admission application is under review. We will notify you once it is approved.', 'student', 'in_app,email', '2025-05-22 00:25:33', '2025-05-22 00:25:33');

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

--
-- Table structure for table `parents`
--

CREATE TABLE `parents` (
  `id` int NOT NULL,
  `firstparent_firstname` varchar(100) NOT NULL,
  `firstparent_lastname` varchar(100) NOT NULL,
  `firstparent_gender` enum('Male','Female') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `firstparent_email` varchar(150) NOT NULL,
  `firstparent_phone` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `firstparent_id` int NOT NULL,
  `secondparent_firstname` varchar(100) NOT NULL,
  `secondparent_lastname` varchar(100) NOT NULL,
  `secondparent_gender` enum('Male','Female') CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `secondparent_email` varchar(150) NOT NULL,
  `secondparent_phone` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `secondparent_id` int NOT NULL,
  `school_year` varchar(20) NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `password_resets`
--

CREATE TABLE `password_resets` (
  `id` int UNSIGNED NOT NULL,
  `email` varchar(255) NOT NULL,
  `token` varchar(255) NOT NULL,
  `created_at` datetime NOT NULL,
  `expires_at` datetime NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `password_resets`
--

INSERT INTO `password_resets` (`id`, `email`, `token`, `created_at`, `expires_at`) VALUES
(74, 'jesscharles504@gmail.com', 'c1f639628dfa06266aae8bcf8b22eccf70c37c4a18d090d08c810bf2d1769d10cc3f3de080606ec2f714d349d4e0a2da', '2025-05-22 03:53:09', '2025-05-22 04:53:09'),
(75, 'jesscharles504@gmail.com', 'd098a2547372a1ed824dae8c981bd5a890bcdd7eb156159c75d836032f56fad69da5fad0bd60ec65a616188efff9832f', '2025-05-22 03:56:07', '2025-05-22 04:56:07');

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

--
-- Table structure for table `payments`
--

CREATE TABLE `payments` (
  `id` int UNSIGNED NOT NULL,
  `firstparent_id` int NOT NULL,
  `invoice_id` int NOT NULL,
  `total_amount` decimal(10,2) NOT NULL,
  `number_of_installments` int NOT NULL,
  `paid_amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `balance_amount` decimal(10,2) NOT NULL,
  `payment_date` date NOT NULL,
  `status` varchar(50) NOT NULL DEFAULT 'Pending'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `payment_transactions`
--

CREATE TABLE `payment_transactions` (
  `id` int UNSIGNED NOT NULL,
  `transaction_id` varchar(100) NOT NULL,
  `payment_id` int NOT NULL,
  `transaction_date` datetime DEFAULT CURRENT_TIMESTAMP,
  `amount` decimal(10,2) NOT NULL,
  `payment_method` varchar(50) NOT NULL,
  `payment_status` varchar(50) NOT NULL DEFAULT 'Pending',
  `transaction_fee` decimal(10,2) DEFAULT '0.00'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `paypal_transactions`
--

CREATE TABLE `paypal_transactions` (
  `id` int NOT NULL,
  `transaction_id` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `payment_id` int DEFAULT NULL,
  `firstname` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `lastname` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `event_type` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `payer_email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `amount` decimal(10,2) NOT NULL DEFAULT '0.00',
  `currency` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `status` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'Pending',
  `payment_method` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `transaction_fee` decimal(10,2) NOT NULL DEFAULT '0.00',
  `raw_data` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `paypal_transactions`
--

INSERT INTO `paypal_transactions` (`id`, `transaction_id`, `payment_id`, `firstname`, `lastname`, `event_type`, `payer_email`, `amount`, `currency`, `status`, `payment_method`, `transaction_fee`, `raw_data`, `created_at`, `updated_at`) VALUES
(5, 'WH-TEST-123456787', NULL, 'moulay', 'elabidi', 'CHECKOUT.ORDER.COMPLETED', 'testbuyer@example.com', 100.00, 'USD', 'completed', 'paypal', 0.00, '{\"id\":\"WH-TEST-123456787\",\"event_version\":\"1.0\",\"create_time\":\"2025-05-04T21:00:00Z\",\"resource_type\":\"checkout-order\",\"event_type\":\"CHECKOUT.ORDER.COMPLETED\",\"summary\":\"Checkout order completed.\",\"resource\":{\"purchase_units\":[{\"reference_id\":\"ORDER12346\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"100.00\"}}],\"payer\":{\"email_address\":\"testbuyer@example.com\",\"payer_id\":\"PAYER123456785\",\"name\":{\"given_name\":\"moulay\",\"surname\":\"elabidi\"}},\"create_time\":\"2025-05-04T21:00:00Z\"}}', '2025-05-05 22:40:14', '2025-05-05 22:40:14'),
(4, 'WH-TEST-123456789', NULL, 'John', 'Doe', 'CHECKOUT.ORDER.COMPLETED', 'testbuyer@example.com', 100.00, 'USD', 'completed', 'paypal', 0.00, '{\"id\":\"WH-TEST-123456789\",\"event_version\":\"1.0\",\"create_time\":\"2025-05-04T21:00:00Z\",\"resource_type\":\"checkout-order\",\"event_type\":\"CHECKOUT.ORDER.COMPLETED\",\"summary\":\"Checkout order completed.\",\"resource\":{\"purchase_units\":[{\"reference_id\":\"ORDER12345\",\"amount\":{\"currency_code\":\"USD\",\"value\":\"100.00\"}}],\"payer\":{\"email_address\":\"testbuyer@example.com\",\"payer_id\":\"PAYER123456789\",\"name\":{\"given_name\":\"John\",\"surname\":\"Doe\"}},\"create_time\":\"2025-05-04T21:00:00Z\"}}', '2025-05-05 22:38:55', '2025-05-05 22:38:55');

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

--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` (`id`, `name`, `description`, `created_at`, `updated_at`) VALUES
(37, 'view_failed_login_attempts', 'Permission to view failed login attempts for the system', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(36, 'view_login_activity', 'Permission to view login activities of users', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(11, 'activate_user', 'Permission to reactivate a deactivated user account', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(12, 'reset_user_password', 'Permission to reset user passwords', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(13, 'manage_roles', 'Permission to manage roles (create, edit, delete)', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(14, 'create_role', 'Permission to create a new role', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(15, 'edit_role', 'Permission to edit an existing role', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(16, 'delete_role', 'Permission to delete a role', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(17, 'view_roles', 'Permission to view the list of roles', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(18, 'assign_role', 'Permission to assign roles to users', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(19, 'edit_role_permissions', 'Permission to edit permissions assigned to roles', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(20, 'manage_content', 'Permission to manage all types of content', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(21, 'create_content', 'Permission to create new content', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(22, 'edit_content', 'Permission to edit existing content', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(23, 'delete_content', 'Permission to delete content', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(24, 'publish_content', 'Permission to publish content', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(25, 'unpublish_content', 'Permission to unpublish content', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(26, 'view_content_list', 'Permission to view all content', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(27, 'archive_content', 'Permission to archive old content', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(28, 'upload_files', 'Permission to upload files and media', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(29, 'delete_files', 'Permission to delete uploaded files', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(30, 'view_files', 'Permission to view and access uploaded files', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(31, 'manage_file_storage', 'Permission to manage file storage settings', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(32, 'manage_security_settings', 'Permission to manage security settings', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(33, 'view_security_logs', 'Permission to view security and audit logs', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(34, 'access_sensitive_data', 'Permission to access sensitive or personally identifiable information (PII)', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(35, 'manage_password_policy', 'Permission to configure and enforce password policies', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(10, 'deactivate_user', 'Permission to deactivate a user account', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(9, 'edit_user_profile', 'Permission to edit user profiles', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(8, 'view_user_profile', 'Permission to view individual user profiles', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(7, 'view_user_list', 'Permission to view the list of users', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(6, 'delete_user', 'Permission to delete users', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(5, 'edit_user', 'Permission to edit existing users', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(4, 'create_user', 'Permission to create new users', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(3, 'manage_users', 'Permission to manage users (create, update, delete)', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(1, 'view_dashboard', 'Permission to view the admin dashboard', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(2, 'access_admin_panel', 'Permission to access the administration panel', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(327, 'teacher_dashboard', 'Permission to view teacher dashboard', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(105, 'view_school_timetable', 'Permission to view the overall school timetable', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(104, 'manage_facilities', 'Permission to manage school facilities (library, labs, etc.)', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(103, 'view_all_reports', 'Permission to view all school-wide reports', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(102, 'manage_student_enrollment', 'Permission to manage student enrollment and records', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(101, 'manage_class_schedules', 'Permission to manage class schedules', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(100, 'manage_school_events', 'Permission to manage school events and announcements', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(99, 'view_school_announcements', 'Permission for parents to view school announcements or notices', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(98, 'view_child_timetable', 'Permission for parents to view their child\'s timetable', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(97, 'communicate_with_teachers', 'Permission for parents to communicate with teachers', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(96, 'view_child_assignments', 'Permission for parents to view assignments assigned to their child', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(95, 'view_child_attendance', 'Permission for parents to view their child\'s attendance records', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(94, 'view_child_grades', 'Permission for parents to view their child\'s grades', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(93, 'view_class_timetable', 'Permission to view the class timetable', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(92, 'view_teacher_reports', 'Permission to view reports related to the teacher’s class or subjects', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(91, 'edit_assignments', 'Permission to edit existing assignments', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(90, 'create_assignments', 'Permission to create new assignments', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(89, 'manage_course_materials', 'Permission to upload and manage course materials', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(88, 'view_class_attendance', 'Permission to view class attendance', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(87, 'view_all_students', 'Permission to view all students in their class', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(86, 'grade_assignments', 'Permission to grade student assignments', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(85, 'manage_students', 'Permission to manage (add, edit, remove) students in their class', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(84, 'view_own_attendance', 'Permission for students to view their attendance records', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(83, 'view_timetable', 'Permission for students to view their own timetable or schedule', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(82, 'view_course_materials', 'Permission for students to view course materials', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(81, 'submit_assignments', 'Permission for students to submit assignments', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(80, 'view_own_assignments', 'Permission for students to view their own assignments', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(79, 'view_own_grades', 'Permission for students to view their own grades', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(78, 'access_admin_panel', 'Permission to access the administration panel', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(77, 'view_dashboard', 'Permission to view the admin dashboard', '2024-09-21 15:58:00', '2024-09-21 15:58:00'),
(76, 'manage_database', 'Permission to manage (backup, restore, optimize) the database', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(75, 'shutdown_system', 'Permission to shut down the system in case of emergencies', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(74, 'access_admin_as_other_role', 'Permission to access the admin panel as a different role', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(73, 'impersonate_user', 'Permission to impersonate other users for troubleshooting', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(72, 'assign_project_tasks', 'Permission to assign tasks within projects', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(71, 'manage_projects', 'Permission to create and manage projects', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(70, 'view_team_members', 'Permission to view team member information', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(69, 'assign_team_roles', 'Permission to assign team roles and permissions', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(68, 'manage_teams', 'Permission to create, edit, and delete teams', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(326, 'parent_dashboard', 'Permission to view the parent dashboard', '2024-09-21 17:23:01', '2024-09-21 17:23:01'),
(67, 'manage_api_access', '', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(66, 'manage_integrations', 'Permission to manage system integrations (third-party tools, webhooks, etc.)', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(65, 'view_api_logs', 'Permission to view API usage logs', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(64, 'mark_task_complete', 'Permission to mark a task as completed', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(63, 'view_task_list', 'Permission to view the list of tasks', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(62, 'assign_tasks', 'Permission to assign tasks to users or teams', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(61, 'manage_tasks', 'Permission to manage tasks and workflow configurations', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(60, 'restore_backup', 'Permission to restore a backup', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(59, 'perform_backup', 'Permission to manually initiate a backup of the system', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(58, 'manage_backups', 'Permission to configure and manage system backups', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(57, 'send_system_alerts', 'Permission to send system-wide alerts', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(56, 'view_notification_history', 'Permission to view the notification history sent by the system', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(55, 'manage_notifications', 'Permission to configure and send notifications (email, SMS, etc.)', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(54, 'view_data_privacy_logs', 'Permission to view logs related to GDPR and data privacy activities', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(53, 'perform_compliance_checks', 'Permission to perform and manage compliance checks', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(52, 'view_audit_logs', 'Permission to view audit logs for system actions', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(51, 'view_invoice_list', 'Permission to view all invoices', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(50, 'issue_refunds', 'Permission to issue refunds to users', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(49, 'view_billing_history', 'Permission to view past transactions and billing history', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(48, 'manage_billing', 'Permission to manage billing, payments, and subscriptions', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(47, 'view_analytics_dashboard', 'Permission to view the analytics dashboard', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(46, 'export_data', 'Permission to export data in various formats', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(45, 'generate_reports', 'Permission to generate and download reports', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(44, 'view_reports', 'Permission to view system reports', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(43, 'configure_email_settings', 'Permission to configure the email server settings', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(42, 'view_system_logs', 'Permission to view system activity and error logs', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(41, 'manage_api_keys', 'Permission to manage API keys', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(40, 'view_system_settings', 'Permission to view current system settings', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(39, 'edit_system_settings', 'Permission to edit system configuration (e.g., database, APIs)', '2024-09-21 15:57:22', '2024-09-21 15:57:22'),
(38, 'manage_system_settings', 'Permission to manage system-wide settings', '2024-09-21 15:57:22', '2024-09-21 15:57:22');

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

--
-- Table structure for table `preferences`
--

CREATE TABLE `preferences` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `receive_email_notifications` tinyint(1) DEFAULT '1',
  `receive_sms_notifications` tinyint(1) DEFAULT '0',
  `theme` varchar(50) DEFAULT 'light',
  `language` varchar(10) DEFAULT 'en',
  `timezone` varchar(50) DEFAULT 'UTC',
  `receive_push_notifications` tinyint(1) DEFAULT '0',
  `daily_summary_email` tinyint(1) DEFAULT '1',
  `privacy_mode` tinyint(1) DEFAULT '0',
  `marketing_emails` tinyint(1) DEFAULT '1',
  `account_activity_alerts` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `project`
--

CREATE TABLE `project` (
  `id` int UNSIGNED NOT NULL,
  `student_id` int NOT NULL,
  `school_id` char(36) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `class_section_id` int DEFAULT NULL,
  `teacher_id` int NOT NULL,
  `project_index` tinyint DEFAULT NULL,
  `score` int DEFAULT NULL,
  `comment` text,
  `semester` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `school_year` varchar(9) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `project`
--

INSERT INTO `project` (`id`, `student_id`, `school_id`, `class_section_id`, `teacher_id`, `project_index`, `score`, `comment`, `semester`, `school_year`, `created_at`, `updated_at`) VALUES
(216, 132, 'SCH-202500004', 30, 116, 1, 79, NULL, 'Fall', '2024/2025', '2025-05-22 05:34:25', '2025-05-22 05:34:29');

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

--
-- Table structure for table `qcmquestions`
--

CREATE TABLE `qcmquestions` (
  `qcm_question_id` int NOT NULL,
  `question_id` int NOT NULL,
  `answer_a` text NOT NULL,
  `answer_b` text NOT NULL,
  `answer_c` text,
  `answer_d` text,
  `answer_e` text,
  `correct_answer` char(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `questions`
--

CREATE TABLE `questions` (
  `question_id` int NOT NULL,
  `chapter_id` int NOT NULL,
  `question_type_id` int NOT NULL,
  `question_text` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `questionstruefalse`
--

CREATE TABLE `questionstruefalse` (
  `tf_question_id` int NOT NULL,
  `question_id` int NOT NULL,
  `correct_answer` tinyint(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `questiontypes`
--

CREATE TABLE `questiontypes` (
  `question_type_id` int NOT NULL,
  `question_type_name` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `quiz`
--

CREATE TABLE `quiz` (
  `id` int UNSIGNED NOT NULL,
  `student_id` int NOT NULL,
  `school_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `class_section_id` int NOT NULL,
  `teacher_id` int NOT NULL,
  `quiz_index` int NOT NULL,
  `score` int DEFAULT NULL,
  `comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `semester` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `school_year` varchar(9) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `quiz`
--

INSERT INTO `quiz` (`id`, `student_id`, `school_id`, `class_section_id`, `teacher_id`, `quiz_index`, `score`, `comment`, `semester`, `school_year`, `created_at`, `updated_at`) VALUES
(104, 132, '', 30, 116, 1, 99, NULL, 'Fall', '2024/2025', '2025-05-22 05:34:11', '2025-05-22 05:34:19');

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

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` (`id`, `name`, `description`, `created_at`, `updated_at`) VALUES
(1, 'administrator', 'Oversees all administrative functions of the school', '2024-07-10 22:11:23', '2024-08-02 03:30:42'),
(2, 'principal', 'Responsible for overall school management and operations', '2024-07-10 22:11:23', '2024-08-02 03:36:31'),
(3, 'vice principal', 'Assists the principal in administrative duties', '2024-07-10 22:11:23', '2024-08-02 03:36:31'),
(4, 'teacher', 'Delivers classroom instruction', '2024-07-10 22:11:23', '2024-08-02 03:36:31'),
(5, 'assistant teacher', 'Supports the lead teacher in instructional duties', '2024-07-10 22:11:23', '2024-08-02 03:36:31'),
(6, 'student', 'Attends classes and participates in school activities', '2024-07-10 22:11:23', '2024-08-02 03:36:31'),
(7, 'parent', 'Engages with teachers and school administration about their child', '2024-07-10 22:11:23', '2024-08-02 22:26:11'),
(8, 'admin staff', 'Handles administrative tasks and supports school operations', '2024-07-10 22:11:23', '2024-08-02 03:36:31'),
(14, 'authorized_user', 'Second user of the parent account that can view the overall parent information', '2024-07-10 22:11:23', '2024-08-02 03:30:42'),
(9, 'head of department (communication)', 'Oversees the Communication department', '2024-07-10 22:11:23', '2024-08-02 03:36:31'),
(10, 'head of department (information technology)', 'Oversees the Information Tehcnology department', '2024-07-10 22:11:23', '2024-08-02 03:36:31'),
(11, 'head of department (education)', 'Oversees the Education department', '2024-07-10 22:11:23', '2024-08-02 03:36:31'),
(12, 'head of department (finance)', 'Oversees the Financial department', '2024-07-10 22:11:23', '2024-08-02 03:36:31'),
(13, 'guest', 'Oversees all guest functions of the school', '2024-07-12 16:05:03', '2024-08-02 03:36:31');

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

--
-- Table structure for table `role_permissions`
--

CREATE TABLE `role_permissions` (
  `id` int UNSIGNED NOT NULL,
  `role_id` int NOT NULL,
  `permission_id` int NOT NULL,
  `can_create` tinyint(1) DEFAULT '0',
  `can_read` tinyint(1) DEFAULT '0',
  `can_update` tinyint(1) DEFAULT '0',
  `can_delete` tinyint(1) DEFAULT '0',
  `can_manage` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `role_permissions`
--

INSERT INTO `role_permissions` (`id`, `role_id`, `permission_id`, `can_create`, `can_read`, `can_update`, `can_delete`, `can_manage`, `created_at`, `updated_at`) VALUES
(1, 1, 1, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-07-19 17:27:01'),
(2, 1, 2, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(3, 1, 3, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(4, 1, 4, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(5, 1, 5, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(6, 1, 6, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(7, 1, 7, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(8, 1, 8, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(9, 1, 9, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(10, 1, 10, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(11, 1, 11, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(12, 1, 12, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(13, 1, 13, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(14, 1, 14, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(15, 1, 15, 1, 1, 1, 1, 0, '2024-07-19 17:27:01', '2024-08-11 04:22:34'),
(16, 2, 1, 1, 1, 1, 1, 0, '2024-08-31 04:34:16', '2024-08-31 05:01:31'),
(17, 2, 3, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31'),
(18, 2, 4, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31'),
(19, 2, 6, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31'),
(20, 2, 9, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31'),
(21, 2, 2, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31'),
(22, 2, 7, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31'),
(23, 2, 8, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31'),
(24, 2, 10, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31'),
(25, 2, 11, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31'),
(26, 2, 12, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31'),
(27, 2, 13, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31'),
(28, 2, 14, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31'),
(29, 2, 15, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31'),
(683, 7, 326, 1, 1, 1, 1, 0, '2024-09-21 16:23:42', '2024-09-21 16:23:42'),
(685, 14, 326, 0, 1, 0, 0, 0, '2024-09-28 05:20:31', '2024-09-28 05:20:31'),
(32, 5, 1, 1, 1, 1, 1, 0, '2024-08-31 05:02:50', '2024-08-31 05:02:50'),
(33, 6, 5, 1, 1, 1, 1, 0, '2024-08-31 05:03:02', '2024-08-31 05:03:02'),
(684, 4, 327, 1, 1, 1, 1, 0, '2024-09-23 15:20:04', '2024-09-23 15:20:04'),
(36, 8, 6, 1, 1, 1, 1, 0, '2024-08-31 15:36:52', '2024-08-31 15:36:52'),
(37, 11, 3, 1, 1, 1, 1, 0, '2024-09-04 14:24:19', '2024-09-04 14:24:19'),
(30, 2, 5, 1, 1, 1, 1, 0, '2024-08-31 05:01:31', '2024-08-31 05:01:31');

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

--
-- Table structure for table `scan_log`
--

CREATE TABLE `scan_log` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `card_id` varchar(255) DEFAULT NULL,
  `scan_time` datetime DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `sections`
--

CREATE TABLE `sections` (
  `id` int UNSIGNED NOT NULL,
  `section_name` varchar(100) NOT NULL,
  `description` text,
  `updated_at` datetime DEFAULT NULL,
  `updated_by` int DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `sections`
--

INSERT INTO `sections` (`id`, `section_name`, `description`, `updated_at`, `updated_by`) VALUES
(1, '', 'No-Section', '2024-08-16 01:06:30', 1),
(2, 'A', 'Section A', '2024-08-16 01:06:30', 1),
(3, 'B', 'Section B', '2024-08-16 01:06:30', 1),
(4, 'C', 'Section C', '2024-08-16 01:06:30', 1),
(5, 'D', 'Section D', '2024-08-16 01:06:30', 1),
(6, 'E', 'Section E', '2024-08-16 01:06:30', 1);

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

--
-- Table structure for table `semester_scores`
--

CREATE TABLE `semester_scores` (
  `id` int UNSIGNED NOT NULL,
  `student_id` int NOT NULL,
  `school_id` char(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `class_section_id` int DEFAULT NULL,
  `teacher_id` int DEFAULT NULL,
  `homework_avg` int DEFAULT NULL,
  `quiz_avg` int DEFAULT NULL,
  `project_avg` int DEFAULT NULL,
  `midterm_exam_score` int DEFAULT NULL,
  `final_exam_score` int DEFAULT NULL,
  `attendance_score` int DEFAULT NULL,
  `test_avg` int DEFAULT NULL,
  `semester_score` int DEFAULT NULL,
  `semester` varchar(20) NOT NULL,
  `school_year` varchar(9) DEFAULT NULL,
  `comment` text,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `semester_scores`
--

INSERT INTO `semester_scores` (`id`, `student_id`, `school_id`, `class_section_id`, `teacher_id`, `homework_avg`, `quiz_avg`, `project_avg`, `midterm_exam_score`, `final_exam_score`, `attendance_score`, `test_avg`, `semester_score`, `semester`, `school_year`, `comment`, `created_at`, `updated_at`) VALUES
(25, 132, 'SCH-202500004', 30, 116, 99, 99, 79, 100, 0, 100, 100, 99, 'Fall', '2024/2025', '', '2025-05-22 05:25:10', '2025-05-22 05:35:20');

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

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` int UNSIGNED NOT NULL,
  `name` varchar(255) NOT NULL,
  `timezone` varchar(255) NOT NULL,
  `updated_by` int DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

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

--
-- Table structure for table `shortanswerquestions`
--

CREATE TABLE `shortanswerquestions` (
  `sa_question_id` int NOT NULL,
  `question_id` int NOT NULL,
  `correct_answer` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `students`
--

CREATE TABLE `students` (
  `id` int UNSIGNED NOT NULL,
  `school_id` char(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
  `firstname` varchar(255) NOT NULL,
  `lastname` varchar(255) NOT NULL,
  `dob` date DEFAULT NULL,
  `age` int NOT NULL,
  `gender` varchar(10) NOT NULL,
  `registration_grade` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `medical_conditions` varchar(255) DEFAULT NULL,
  `allergies` varchar(255) NOT NULL,
  `photo_consent` tinyint(1) NOT NULL,
  `parent_id` int NOT NULL,
  `registration_date` datetime DEFAULT NULL,
  `tuition_paid` tinyint(1) NOT NULL DEFAULT '0',
  `year_of_registration` varchar(25) NOT NULL,
  `school_year` varchar(9) DEFAULT NULL,
  `rfid_tag` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `students`
--

INSERT INTO `students` (`id`, `school_id`, `firstname`, `lastname`, `dob`, `age`, `gender`, `registration_grade`, `medical_conditions`, `allergies`, `photo_consent`, `parent_id`, `registration_date`, `tuition_paid`, `year_of_registration`, `school_year`, `rfid_tag`) VALUES
(132, 'SCH-202500004', 'Jiji', 'Alex', '2018-01-01', 7, 'Male', '2', 'Other', 'Other', 0, 118, '2025-05-22 00:00:00', 0, '2025', '2024/2025', NULL);

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

--
-- Table structure for table `student_class`
--

CREATE TABLE `student_class` (
  `id` int UNSIGNED NOT NULL,
  `student_id` int NOT NULL,
  `class_section_id` int DEFAULT NULL,
  `semester` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `school_year` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `description` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `updated_by` int DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

--
-- Dumping data for table `student_class`
--

INSERT INTO `student_class` (`id`, `student_id`, `class_section_id`, `semester`, `school_year`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES
(119, 132, 30, 'Fall', '2024/2025', NULL, '2025-05-22 04:30:52', '2025-05-22 05:03:07', 1);

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

--
-- Table structure for table `support_requests`
--

CREATE TABLE `support_requests` (
  `id` int UNSIGNED NOT NULL,
  `user_id` int NOT NULL,
  `subject` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `status` varchar(25) NOT NULL DEFAULT 'open',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `semester` varchar(255) NOT NULL,
  `school_year` varchar(9) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

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

--
-- Table structure for table `teachers`
--

CREATE TABLE `teachers` (
  `id` int UNSIGNED NOT NULL,
  `user_id` int UNSIGNED NOT NULL,
  `school_id` int UNSIGNED NOT NULL,
  `first_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `last_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `email` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `subject` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `hire_date` date DEFAULT NULL,
  `status` enum('active','inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'active',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `teacher_class`
--

CREATE TABLE `teacher_class` (
  `id` int UNSIGNED NOT NULL,
  `class_section_id` int DEFAULT NULL,
  `teacher_id` int DEFAULT NULL,
  `first_ta_id` int DEFAULT NULL,
  `second_ta_id` int DEFAULT NULL,
  `semester` varchar(25) NOT NULL,
  `school_year` varchar(25) DEFAULT NULL,
  `description` text,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `updated_by` int DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `teacher_class`
--

INSERT INTO `teacher_class` (`id`, `class_section_id`, `teacher_id`, `first_ta_id`, `second_ta_id`, `semester`, `school_year`, `description`, `created_at`, `updated_at`, `updated_by`) VALUES
(15, 30, 116, NULL, NULL, 'Fall', '2024/2025', NULL, '2025-05-22 04:43:43', '2025-05-22 05:02:58', 1);

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

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

CREATE TABLE `users` (
  `id` int UNSIGNED NOT NULL,
  `password` varchar(255) NOT NULL,
  `account_id` varchar(255) DEFAULT NULL,
  `lastname` varchar(255) NOT NULL,
  `firstname` varchar(255) NOT NULL,
  `gender` enum('Male','Female') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `cellphone` varchar(25) NOT NULL,
  `email` varchar(255) NOT NULL,
  `address_street` varchar(255) NOT NULL,
  `apt` varchar(25) DEFAULT NULL,
  `city` varchar(255) NOT NULL,
  `state` varchar(25) NOT NULL,
  `zip` varchar(25) NOT NULL,
  `accept_school_policy` tinyint(1) NOT NULL,
  `user_type` enum('primary','secondary','tertiary') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT 'primary',
  `rfid_tag` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `failed_attempts` int NOT NULL DEFAULT '0',
  `last_failed_at` datetime DEFAULT NULL,
  `semester` varchar(255) NOT NULL,
  `school_year` varchar(9) DEFAULT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'Inactive',
  `is_suspended` tinyint(1) NOT NULL DEFAULT '0',
  `is_verified` tinyint(1) NOT NULL DEFAULT '0',
  `token` varchar(255) DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `school_id` char(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3;

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

INSERT INTO `users` (`id`, `password`, `account_id`, `lastname`, `firstname`, `gender`, `cellphone`, `email`, `address_street`, `apt`, `city`, `state`, `zip`, `accept_school_policy`, `user_type`, `rfid_tag`, `failed_attempts`, `last_failed_at`, `semester`, `school_year`, `status`, `is_suspended`, `is_verified`, `token`, `updated_at`, `created_at`, `school_id`) VALUES
(1, 'sha256$100000$c754c0c1d5926b6961c8d1eb3e5453b0$b1da71cea3e52b1669f15434136242e3a73019174a503d5fe1744ea57c1a0d4f65b566c198fd9389b4c6f6b702597644e2509f921df36083b058bed92493c583', 'ACC00000066', 'AdminLastName', 'AdminFirstName', 'Male', '0001234569', 'administrator@gmail.com', '2 bfbg', '', 'lowell', 'ma', '0000', 1, 'primary', '000000001', 0, NULL, '', '2024/2025', 'Active', 0, 1, NULL, '2025-05-22 04:03:35', '2024-08-02 00:24:41', 'SCH-202500001'),
(116, 'sha256$100000$e065834e48eb1f103d13fdf075bdd851$4fde9111929eb75bb41cb9da07ebf0eb8df7d729631f1e32fb496dde41e47f195f75d43eeab41e822db814d62ea2d354a70f5cd6b3b5cc602c5d2b25d106463c', 'ACC00000116', 'Larbi', 'Moulay', 'Male', '(121)-212-1212', 'alrahma.isgl@gmail.com', '320 njhhg st', 'NN6', 'Lowell', 'KS', '03038', 1, 'primary', NULL, 0, NULL, 'Fall', '2024/2025', 'Active', 0, 1, NULL, '2025-05-22 03:50:10', '2025-05-22 03:47:27', 'SCH-202500002'),
(118, 'sha256$100000$d3400947a62bb5cc89a5fad68a170b23$d2ad94a6ee7a6ac27f5b543f01bc6bc16713ebc099c4b860b40847d249b412aaee9ee53613f16653ebf43bbeb24ff4297524107862bea55cbd32e97ed75689c4', 'ACC00000118', 'Alex', 'Mimi', 'Female', '(857)-206-5499', 'khoukhaela@gmail.com', '90 swan st', '', 'Lowell', 'MA', '01852', 1, 'primary', NULL, 0, NULL, 'Fall', '2024/2025', 'Active', 0, 1, NULL, '2025-05-22 04:04:13', '2025-05-22 04:01:50', 'SCH-202500003');

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

--
-- Table structure for table `user_notifications`
--

CREATE TABLE `user_notifications` (
  `id` int NOT NULL,
  `notification_id` int NOT NULL,
  `user_id` int NOT NULL,
  `is_read` tinyint(1) DEFAULT '0',
  `delivered` tinyint(1) DEFAULT '0',
  `delivered_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_notifications`
--

INSERT INTO `user_notifications` (`id`, `notification_id`, `user_id`, `is_read`, `delivered`, `delivered_at`) VALUES
(46, 46, 118, 0, 0, NULL);

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

--
-- Table structure for table `user_preferences`
--

CREATE TABLE `user_preferences` (
  `id` int NOT NULL,
  `user_id` int NOT NULL,
  `notification_email` tinyint(1) DEFAULT '1',
  `notification_sms` tinyint(1) DEFAULT '1',
  `theme` varchar(50) DEFAULT 'light',
  `language` varchar(50) DEFAULT 'en',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

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

--
-- Table structure for table `user_roles`
--

CREATE TABLE `user_roles` (
  `id` int UNSIGNED NOT NULL,
  `user_id` int UNSIGNED NOT NULL,
  `role_id` int UNSIGNED NOT NULL,
  `updated_by` int DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `user_roles`
--

INSERT INTO `user_roles` (`id`, `user_id`, `role_id`, `updated_by`, `created_at`, `updated_at`, `deleted_at`) VALUES
(6, 116, 4, 1, '2025-05-22 03:47:27', '2025-05-22 03:49:53', NULL),
(1, 1, 1, NULL, NULL, NULL, NULL),
(7, 117, 7, NULL, '2025-05-22 03:51:40', '2025-05-22 03:51:40', NULL),
(8, 118, 7, NULL, '2025-05-22 04:01:50', '2025-05-22 04:01:50', NULL);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `admins`
--
ALTER TABLE `admins`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `school_id` (`school_id`);

--
-- Indexes for table `attendance_data`
--
ALTER TABLE `attendance_data`
  ADD PRIMARY KEY (`id`),
  ADD KEY `class_id` (`class_id`),
  ADD KEY `class_section_id` (`class_section_id`),
  ADD KEY `student_id` (`student_id`);

--
-- Indexes for table `attendance_record`
--
ALTER TABLE `attendance_record`
  ADD PRIMARY KEY (`id`),
  ADD KEY `class_section_id` (`class_section_id`),
  ADD KEY `student_id` (`student_id`);

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

--
-- Indexes for table `chapters`
--
ALTER TABLE `chapters`
  ADD PRIMARY KEY (`chapter_id`),
  ADD KEY `class_section_id` (`class_section_id`);

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

--
-- Indexes for table `class_section`
--
ALTER TABLE `class_section`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `class_section_unique` (`class_id`,`section_id`),
  ADD KEY `section_id` (`section_id`);

--
-- Indexes for table `configuration`
--
ALTER TABLE `configuration`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `config_key_config_value` (`config_key`,`config_value`);

--
-- Indexes for table `contactus`
--
ALTER TABLE `contactus`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sender_id` (`sender_id`),
  ADD KEY `reciever_id` (`reciever_id`);

--
-- Indexes for table `current_flag`
--
ALTER TABLE `current_flag`
  ADD PRIMARY KEY (`id`),
  ADD KEY `studentID` (`student_id`);

--
-- Indexes for table `emergency_contacts`
--
ALTER TABLE `emergency_contacts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `firstparent_id` (`parent_id`) USING BTREE;

--
-- Indexes for table `enrollments`
--
ALTER TABLE `enrollments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `student_id` (`student_id`),
  ADD KEY `class_section_id` (`class_section_id`),
  ADD KEY `firstparent_id` (`parent_id`) USING BTREE;

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

--
-- Indexes for table `examquestiondistribution`
--
ALTER TABLE `examquestiondistribution`
  ADD PRIMARY KEY (`exam_distribution_id`),
  ADD KEY `exam_id` (`exam_id`),
  ADD KEY `question_type_id` (`question_type_id`);

--
-- Indexes for table `examquestions`
--
ALTER TABLE `examquestions`
  ADD PRIMARY KEY (`exam_question_id`),
  ADD KEY `exam_id` (`exam_id`),
  ADD KEY `question_id` (`question_id`);

--
-- Indexes for table `exams`
--
ALTER TABLE `exams`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_student_school_id` (`student_school_id`),
  ADD KEY `idx_class_section_id` (`class_section_id`);

--
-- Indexes for table `final_exam`
--
ALTER TABLE `final_exam`
  ADD PRIMARY KEY (`id`),
  ADD KEY `student_id` (`student_id`),
  ADD KEY `class_section_id` (`class_section_id`),
  ADD KEY `teacher_id` (`teacher_id`);

--
-- Indexes for table `final_score`
--
ALTER TABLE `final_score`
  ADD PRIMARY KEY (`id`),
  ADD KEY `student_id` (`student_id`),
  ADD KEY `teacher_id` (`teacher_id`),
  ADD KEY `class_section_id` (`class_section_id`);

--
-- Indexes for table `flag`
--
ALTER TABLE `flag`
  ADD PRIMARY KEY (`id`),
  ADD KEY `studentID` (`student_id`);

--
-- Indexes for table `homework`
--
ALTER TABLE `homework`
  ADD PRIMARY KEY (`id`),
  ADD KEY `student_id` (`student_id`),
  ADD KEY `class_section_id` (`class_section_id`),
  ADD KEY `teacher_id` (`teacher_id`);

--
-- Indexes for table `invoices`
--
ALTER TABLE `invoices`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `invoice_number` (`invoice_number`),
  ADD KEY `firstparent_id` (`parent_id`);

--
-- Indexes for table `invoice_students_list`
--
ALTER TABLE `invoice_students_list`
  ADD PRIMARY KEY (`id`),
  ADD KEY `invoice_id` (`invoice_id`),
  ADD KEY `student_id` (`student_id`),
  ADD KEY `school_id` (`student_school_id`);

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

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

--
-- Indexes for table `longanswerquestions`
--
ALTER TABLE `longanswerquestions`
  ADD PRIMARY KEY (`la_question_id`),
  ADD KEY `question_id` (`question_id`);

--
-- Indexes for table `messages`
--
ALTER TABLE `messages`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `message_number` (`message_number`),
  ADD KEY `sender_id` (`sender_id`),
  ADD KEY `recipient_id` (`recipient_id`);

--
-- Indexes for table `midterm_exam`
--
ALTER TABLE `midterm_exam`
  ADD PRIMARY KEY (`id`),
  ADD KEY `student_id` (`student_id`),
  ADD KEY `class_section_id` (`class_section_id`),
  ADD KEY `teacher_id` (`teacher_id`);

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

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

--
-- Indexes for table `parents`
--
ALTER TABLE `parents`
  ADD PRIMARY KEY (`id`),
  ADD KEY `firstparent_id` (`firstparent_id`) USING BTREE,
  ADD KEY `secondparent_id` (`secondparent_id`) USING BTREE;

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

--
-- Indexes for table `payments`
--
ALTER TABLE `payments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `firstparent_id` (`firstparent_id`),
  ADD KEY `invoice_id` (`invoice_id`);

--
-- Indexes for table `payment_transactions`
--
ALTER TABLE `payment_transactions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `transaction_id` (`transaction_id`),
  ADD KEY `payment_id` (`payment_id`);

--
-- Indexes for table `paypal_transactions`
--
ALTER TABLE `paypal_transactions`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `transaction_id` (`transaction_id`),
  ADD KEY `payment_id` (`payment_id`);

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

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

--
-- Indexes for table `project`
--
ALTER TABLE `project`
  ADD PRIMARY KEY (`id`),
  ADD KEY `student_id` (`student_id`),
  ADD KEY `class_section_id` (`class_section_id`),
  ADD KEY `teacher_id` (`teacher_id`);

--
-- Indexes for table `qcmquestions`
--
ALTER TABLE `qcmquestions`
  ADD PRIMARY KEY (`qcm_question_id`),
  ADD KEY `question_id` (`question_id`);

--
-- Indexes for table `questions`
--
ALTER TABLE `questions`
  ADD PRIMARY KEY (`question_id`),
  ADD KEY `chapter_id` (`chapter_id`),
  ADD KEY `question_type_id` (`question_type_id`);

--
-- Indexes for table `questionstruefalse`
--
ALTER TABLE `questionstruefalse`
  ADD PRIMARY KEY (`tf_question_id`),
  ADD KEY `question_id` (`question_id`);

--
-- Indexes for table `questiontypes`
--
ALTER TABLE `questiontypes`
  ADD PRIMARY KEY (`question_type_id`);

--
-- Indexes for table `quiz`
--
ALTER TABLE `quiz`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `uq_student_quiz` (`student_id`,`quiz_index`,`class_section_id`,`semester`,`school_year`),
  ADD KEY `student_id` (`student_id`),
  ADD KEY `class_section_id` (`class_section_id`),
  ADD KEY `teacher_id` (`teacher_id`);

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

--
-- Indexes for table `role_permissions`
--
ALTER TABLE `role_permissions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `role_id` (`role_id`),
  ADD KEY `permission_id` (`permission_id`);

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

--
-- Indexes for table `sections`
--
ALTER TABLE `sections`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `BTREE` (`section_name`);

--
-- Indexes for table `semester_scores`
--
ALTER TABLE `semester_scores`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_semester_grade` (`school_id`,`class_section_id`,`semester`,`school_year`);

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

--
-- Indexes for table `shortanswerquestions`
--
ALTER TABLE `shortanswerquestions`
  ADD PRIMARY KEY (`sa_question_id`),
  ADD KEY `question_id` (`question_id`);

--
-- Indexes for table `students`
--
ALTER TABLE `students`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `school_id` (`school_id`) USING BTREE,
  ADD KEY `firstparent_id` (`parent_id`) USING BTREE;

--
-- Indexes for table `student_class`
--
ALTER TABLE `student_class`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `student_id` (`student_id`),
  ADD KEY `class_section_id` (`class_section_id`);

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

--
-- Indexes for table `teachers`
--
ALTER TABLE `teachers`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `school_id` (`school_id`);

--
-- Indexes for table `teacher_class`
--
ALTER TABLE `teacher_class`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_teacher_class` (`teacher_id`,`class_section_id`),
  ADD UNIQUE KEY `unique_teacher_id` (`teacher_id`),
  ADD UNIQUE KEY `class_section_id` (`class_section_id`),
  ADD KEY `teacher_id` (`teacher_id`),
  ADD KEY `first_ta_id` (`first_ta_id`),
  ADD KEY `second_ta_id` (`second_ta_id`);

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

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

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

--
-- Indexes for table `user_roles`
--
ALTER TABLE `user_roles`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_user_role` (`user_id`,`role_id`),
  ADD KEY `fk_user_roles_role_id` (`role_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `admins`
--
ALTER TABLE `admins`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `attendance_data`
--
ALTER TABLE `attendance_data`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=73;

--
-- AUTO_INCREMENT for table `attendance_record`
--
ALTER TABLE `attendance_record`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;

--
-- AUTO_INCREMENT for table `authorized_users`
--
ALTER TABLE `authorized_users`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `chapters`
--
ALTER TABLE `chapters`
  MODIFY `chapter_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `classes`
--
ALTER TABLE `classes`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;

--
-- AUTO_INCREMENT for table `class_section`
--
ALTER TABLE `class_section`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=50;

--
-- AUTO_INCREMENT for table `configuration`
--
ALTER TABLE `configuration`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `contactus`
--
ALTER TABLE `contactus`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `current_flag`
--
ALTER TABLE `current_flag`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;

--
-- AUTO_INCREMENT for table `emergency_contacts`
--
ALTER TABLE `emergency_contacts`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;

--
-- AUTO_INCREMENT for table `enrollments`
--
ALTER TABLE `enrollments`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=49;

--
-- AUTO_INCREMENT for table `events`
--
ALTER TABLE `events`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `examquestiondistribution`
--
ALTER TABLE `examquestiondistribution`
  MODIFY `exam_distribution_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `examquestions`
--
ALTER TABLE `examquestions`
  MODIFY `exam_question_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `exams`
--
ALTER TABLE `exams`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `final_exam`
--
ALTER TABLE `final_exam`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=53;

--
-- AUTO_INCREMENT for table `final_score`
--
ALTER TABLE `final_score`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=917;

--
-- AUTO_INCREMENT for table `flag`
--
ALTER TABLE `flag`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `homework`
--
ALTER TABLE `homework`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=268;

--
-- AUTO_INCREMENT for table `invoices`
--
ALTER TABLE `invoices`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;

--
-- AUTO_INCREMENT for table `invoice_students_list`
--
ALTER TABLE `invoice_students_list`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;

--
-- AUTO_INCREMENT for table `ip_attempts`
--
ALTER TABLE `ip_attempts`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `login_activity`
--
ALTER TABLE `login_activity`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=517;

--
-- AUTO_INCREMENT for table `longanswerquestions`
--
ALTER TABLE `longanswerquestions`
  MODIFY `la_question_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `messages`
--
ALTER TABLE `messages`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `midterm_exam`
--
ALTER TABLE `midterm_exam`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=93;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=82;

--
-- AUTO_INCREMENT for table `notifications`
--
ALTER TABLE `notifications`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;

--
-- AUTO_INCREMENT for table `parents`
--
ALTER TABLE `parents`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54;

--
-- AUTO_INCREMENT for table `password_resets`
--
ALTER TABLE `password_resets`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=76;

--
-- AUTO_INCREMENT for table `payments`
--
ALTER TABLE `payments`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `payment_transactions`
--
ALTER TABLE `payment_transactions`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `paypal_transactions`
--
ALTER TABLE `paypal_transactions`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `permissions`
--
ALTER TABLE `permissions`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=328;

--
-- AUTO_INCREMENT for table `preferences`
--
ALTER TABLE `preferences`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `project`
--
ALTER TABLE `project`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=217;

--
-- AUTO_INCREMENT for table `qcmquestions`
--
ALTER TABLE `qcmquestions`
  MODIFY `qcm_question_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `questions`
--
ALTER TABLE `questions`
  MODIFY `question_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `questionstruefalse`
--
ALTER TABLE `questionstruefalse`
  MODIFY `tf_question_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `questiontypes`
--
ALTER TABLE `questiontypes`
  MODIFY `question_type_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `quiz`
--
ALTER TABLE `quiz`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=105;

--
-- AUTO_INCREMENT for table `roles`
--
ALTER TABLE `roles`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37;

--
-- AUTO_INCREMENT for table `role_permissions`
--
ALTER TABLE `role_permissions`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=686;

--
-- AUTO_INCREMENT for table `scan_log`
--
ALTER TABLE `scan_log`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sections`
--
ALTER TABLE `sections`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `semester_scores`
--
ALTER TABLE `semester_scores`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `shortanswerquestions`
--
ALTER TABLE `shortanswerquestions`
  MODIFY `sa_question_id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `students`
--
ALTER TABLE `students`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=133;

--
-- AUTO_INCREMENT for table `student_class`
--
ALTER TABLE `student_class`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=120;

--
-- AUTO_INCREMENT for table `support_requests`
--
ALTER TABLE `support_requests`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `teachers`
--
ALTER TABLE `teachers`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `teacher_class`
--
ALTER TABLE `teacher_class`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=119;

--
-- AUTO_INCREMENT for table `user_notifications`
--
ALTER TABLE `user_notifications`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;

--
-- AUTO_INCREMENT for table `user_preferences`
--
ALTER TABLE `user_preferences`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `user_roles`
--
ALTER TABLE `user_roles`
  MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
