-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 05, 2025 at 08:15 PM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12

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_website`
--

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

--
-- Table structure for table `announcements`
--

CREATE TABLE `announcements` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `content` text NOT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `visible` tinyint(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `announcements`
--

INSERT INTO `announcements` (`id`, `title`, `content`, `created_at`, `visible`) VALUES
(4, 'Important Announcement for St Martin Gisenyi TSS Students and Parents', 'We are pleased to inform all students, parents, and staff of St Martin Gisenyi TSS about upcoming school events and important updates. As part of our commitment to technical excellence, we have introduced new training programs in Plumbing, Fashion and Design, and Software Development. These programs aim to equip our students with industry-relevant skills to enhance their career prospects.\r\n\r\nAdditionally, we remind all students to adhere to the school’s dress code of green T-shirts and khaki trousers or skirts while attending classes and practical sessions. This ensures uniformity and discipline within our institution.\r\n\r\nFor further inquiries or more details on these updates, please visit the school administration office or contact us through our official communication channels.\r\n\r\nThank you for your continued support and cooperation.\r\n\r\nSt Martin Gisenyi TSS Administration', '2025-02-04 11:52:44', 1);

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

--
-- Table structure for table `applications`
--

CREATE TABLE `applications` (
  `id` int(11) NOT NULL,
  `full_name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `phone` varchar(15) DEFAULT NULL,
  `department` varchar(100) NOT NULL,
  `level` varchar(50) NOT NULL,
  `message` text NOT NULL,
  `last_results` varchar(255) DEFAULT NULL,
  `status` varchar(20) DEFAULT 'Pending',
  `submitted_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `applications`
--

INSERT INTO `applications` (`id`, `full_name`, `email`, `phone`, `department`, `level`, `message`, `last_results`, `status`, `submitted_at`) VALUES
(4, 'Coder Mael', 'umwamimael@gmail.com', '+250798055344', 'Software Development', 'L5', 'Hi Curry, I hope you\'re doing well! Just wanted to quickly check in and see how things are going on your end. Looking forward to catching up soon!', 'uploads/steph-curry-GettyImages-2166073455.jpg', 'Pending', '2025-01-23 23:01:12'),
(5, 'Nsengiyumva Eric', 'nsengiyumvaeric003@gmail.com', '0784656177', 'Plumbing', 'L3', 'Nuko mpakunda', 'uploads/lamine1.jpg', 'Pending', '2025-02-04 09:47:08');

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

--
-- Table structure for table `contact_form`
--

CREATE TABLE `contact_form` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `submitted_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `contact_form`
--

INSERT INTO `contact_form` (`id`, `name`, `email`, `message`, `submitted_at`) VALUES
(6, 'Mbonyi', 'Karusi@gmail.com', 'This is what it is!', '2025-02-05 13:31:24');

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

--
-- Table structure for table `images`
--

CREATE TABLE `images` (
  `id` int(11) NOT NULL,
  `image_path` varchar(255) NOT NULL,
  `upload_date` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `images`
--

INSERT INTO `images` (`id`, `image_path`, `upload_date`) VALUES
(5, 'uploads/images/67a1e4aabafe7.webp', '2025-02-04 09:58:02'),
(6, 'uploads/images/67a1e4aabc8d8.webp', '2025-02-04 09:58:02');

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

--
-- Table structure for table `news_articles`
--

CREATE TABLE `news_articles` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `summary` text NOT NULL,
  `content` text NOT NULL,
  `date` date NOT NULL,
  `category` varchar(100) NOT NULL,
  `image` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `news_articles`
--

INSERT INTO `news_articles` (`id`, `title`, `summary`, `content`, `date`, `category`, `image`) VALUES
(5, 'St Martin Gisenyi TSS: Shaping the Future of Technical Education in Rwanda', 'St Martin Gisenyi TSS is a leading technical secondary school in Rwanda, dedicated to equipping students with practical skills and knowledge to thrive in today\'s competitive job market. With a strong emphasis on technical education, innovation, and discipline, the school continues to produce skilled professionals who contribute significantly to national development.', 'About St Martin Gisenyi TSS\r\nSt Martin Gisenyi Technical Secondary School (TSS) is an institution committed to providing quality technical education to students across Rwanda. Established with the goal of empowering youth with hands-on skills, the school has become a hub for technical excellence, fostering innovation and creativity among its students.\r\nOur Mission and Vision\r\nMission: To provide high-quality technical education that prepares students for the workforce and further studies, fostering innovation and problem-solving skills.\r\nVision: To be a leading technical school in Rwanda, producing highly skilled graduates who contribute to the nation\'s socio-economic growth.\r\nAcademic and Technical Programs\r\nSt Martin Gisenyi TSS offers a range of technical courses designed to meet the demands of the modern job market. These programs include:\r\n•	Electrical Engineering – Training students in electrical installations, maintenance, and power systems.\r\n•	Information and Communication Technology (ICT) – Equipping learners with digital skills, software development, and computer networking.\r\n•	Construction Technology – Teaching essential skills in building design, construction, and project management.\r\n•	Automotive Mechanics – Providing expertise in vehicle maintenance, diagnostics, and repair.\r\n•	Welding and Fabrication – Offering hands-on training in metalwork, welding techniques, and structural fabrication.\r\nWhy Choose St Martin Gisenyi TSS?\r\n1.	Experienced and Dedicated Teachers: Our instructors are highly qualified and committed to student success.\r\n2.	Modern Facilities and Equipment: We provide well-equipped workshops and laboratories for practical learning.\r\n3.	Industry Partnerships: We collaborate with companies and industries to offer internships and hands-on training.\r\n4.	Student Support Services: Career guidance, counseling, and extracurricular activities enrich students\' learning experience.\r\n5.	A Track Record of Success: Our graduates are sought after in various technical fields, with many excelling in entrepreneurship and employment.\r\nCommunity Engagement and Extracurricular Activities\r\nBeyond academics, St Martin Gisenyi TSS encourages students to participate in community service, innovation competitions, and sports activities. These initiatives help students develop teamwork, leadership, and problem-solving skills, preparing them for real-world challenges.\r\nJoin Us Today!\r\nSt Martin Gisenyi TSS welcomes students passionate about technical education and innovation. By joining us, you take the first step toward a successful career in the technical field. For more information about admissions and programs, visit our school or contact us directly.\r\nEmpowering Youth, Building the Future!\r\n', '2025-02-04', 'Achievements', 'DALL·E 2025-02-04 11.43.58 - A modern technical school in Rwanda, featuring students engaged in hands-on technical training such as electrical engineering, ICT, construction, auto.webp');

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

--
-- Table structure for table `school_codes`
--

CREATE TABLE `school_codes` (
  `id` int(11) NOT NULL,
  `school_code` varchar(255) NOT NULL,
  `school_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `school_codes`
--

INSERT INTO `school_codes` (`id`, `school_code`, `school_name`) VALUES
(1, 'stmg2025', 'STMG');

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

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

CREATE TABLE `students` (
  `studentid` int(11) NOT NULL,
  `student_name` varchar(255) NOT NULL,
  `student_trade` varchar(255) NOT NULL,
  `student_level` varchar(255) NOT NULL,
  `student_picture` varchar(255) NOT NULL,
  `issue_date` date DEFAULT NULL,
  `expiration_date` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `students` (`studentid`, `student_name`, `student_trade`, `student_level`, `student_picture`, `issue_date`, `expiration_date`) VALUES
(1, 'Mbanjintwari Ismael Ismael', 'Software Development', 'level5', 'Mbanjintwari Ismael IsmaelSoftware Developmentlevel5steph-curry-GettyImages-2166073455.jpg', NULL, NULL),
(2, 'Mbanjintwari Ismael ', 'Software Development', 'level5', 'Mbanjintwari Ismael Software Developmentlevel5472189153_1155569899242422_983803909423761690_n.jpg', NULL, NULL),
(3, 'Mbanjintwari Ismael ', 'Software Development', 'level5', 'Mbanjintwari Ismael Software Developmentlevel5472189153_1155569899242422_983803909423761690_n.jpg', NULL, NULL),
(4, 'Mbanjintwari Ismael ', 'Software Development', 'level5', 'Mbanjintwari Ismael Software Developmentlevel5472189153_1155569899242422_983803909423761690_n.jpg', NULL, NULL),
(5, 'Mbanjintwari Ismael ', 'Software Development', 'level5', 'Mbanjintwari Ismael Software Developmentlevel5472189153_1155569899242422_983803909423761690_n.jpg', NULL, NULL),
(6, 'Mbanjintwari Ismael ', 'Software Development', 'level5', 'Mbanjintwari Ismael Software Developmentlevel5472189153_1155569899242422_983803909423761690_n.jpg', NULL, NULL),
(7, 'Rushingura Kampire Latipha ', 'Software Development', 'level5', 'Rushingura Kampire Latipha Software Developmentlevel5love-quotes-01.png', NULL, NULL);

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

--
-- Table structure for table `submissions`
--

CREATE TABLE `submissions` (
  `id` int(11) NOT NULL,
  `full_name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `phone` varchar(15) DEFAULT NULL,
  `department` varchar(100) NOT NULL,
  `level` varchar(50) NOT NULL,
  `message` text NOT NULL,
  `last_results` varchar(255) DEFAULT NULL,
  `status` varchar(20) DEFAULT 'Pending',
  `submitted_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `submissions`
--

INSERT INTO `submissions` (`id`, `full_name`, `email`, `phone`, `department`, `level`, `message`, `last_results`, `status`, `submitted_at`) VALUES
(1, 'Alice Green', 'alice.green@example.com', '555-0101', 'Mathematics', 'Graduate', 'Looking for guidance on thesis submission.', NULL, 'Pending', '2025-01-23 22:08:47'),
(2, 'Mark White', 'mark.white@example.com', '555-0202', 'Physics', 'Undergraduate', 'Requesting feedback on the recent exam.', 'results/mark_white_exam.pdf', 'Pending', '2025-01-23 22:08:47'),
(3, 'Sophia Brown', 'sophia.brown@example.com', '555-0303', 'Chemistry', 'Postgraduate', 'Applying for research funding.', 'results/sophia_brown_funding.pdf', 'Approved', '2025-01-23 22:08:47');

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

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

CREATE TABLE `teachers` (
  `id` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `lesson` varchar(255) NOT NULL,
  `image_path` varchar(255) NOT NULL,
  `school` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `teachers`
--

INSERT INTO `teachers` (`id`, `name`, `lesson`, `image_path`, `school`) VALUES
(1, 'Mbanjintwari Ismael', 'Math ,Python, Phyisics and Kinyarwanda', 'uploads/6792bcfb0b136_472189153_1155569899242422_983803909423761690_n.jpg', 'STMG');

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

--
-- Table structure for table `teacher_ratings`
--

CREATE TABLE `teacher_ratings` (
  `id` int(11) NOT NULL,
  `teacher_id` int(11) NOT NULL,
  `student_name` varchar(255) NOT NULL,
  `comment` text NOT NULL,
  `rating` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

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

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(255) NOT NULL,
  `phone` varchar(15) DEFAULT NULL,
  `password` varchar(255) NOT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

INSERT INTO `users` (`id`, `username`, `phone`, `password`, `created_at`) VALUES
(3, 'admin1', '+250798055344', '$2y$10$yJ5aMIZ.dO7H43jTobUZauswNnbjWW0HxII5dyvwIaRf9gEFsRApW', '2025-01-23 21:39:58'),
(5, 'admin2', '69120649', '123', '0000-00-00 00:00:00'),
(6, 'Admin3', '2346', '$2y$10$Dykw.RXlFLbbllB7SFJaXetLGrEE0AgTHVWod.eJHNAO559sL6pNe', '2025-02-04 11:38:23');

--
-- Indexes for dumped tables
--

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

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

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

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

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

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

--
-- Indexes for table `students`
--
ALTER TABLE `students`
  ADD PRIMARY KEY (`studentid`);

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

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

--
-- Constraints for dumped tables
--

--
-- Constraints for table `teacher_ratings`
--
ALTER TABLE `teacher_ratings`
  ADD CONSTRAINT `teacher_ratings_ibfk_1` FOREIGN KEY (`teacher_id`) REFERENCES `teachers` (`id`) ON DELETE CASCADE;
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 */;
