-- https://www.phpmyadmin.net/
--
-- مضيف: localhost:3306
-- وقت الجيل: 29 مارس 2026 الساعة 16:16
-- إصدار الخادم: 11.4.10-MariaDB-cll-lve-log
-- نسخة PHP: 8.3.30

START TRANSACTION;



--
-- قاعدة بيانات: `mahasmyn_nsor`
--

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

--
-- بنية الجدول `attendance`
--

CREATE TABLE `attendance` (
  `id` int(11) NOT NULL,
  `session_id` int(11) NOT NULL,
  `student_id` int(11) DEFAULT NULL,
  `scanned_uid` varchar(255) NOT NULL,
  `status` enum('present','not_found') NOT NULL DEFAULT 'present',
  `scanned_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- إرجاع أو استيراد بيانات الجدول `attendance`
--

INSERT INTO `attendance` (`id`, `session_id`, `student_id`, `scanned_uid`, `status`, `scanned_at`) VALUES
(1, 2, NULL, '04:f4:6d:62:9e:0f:90', 'not_found', '2025-11-24 19:35:13'),
(2, 2, NULL, '04:f4:6d:62:9e:0f:90', 'not_found', '2025-11-24 19:37:14'),
(3, 2, NULL, '04:f4:6d:62:9e:0f:90', 'not_found', '2025-11-24 19:37:35'),
(4, 2, NULL, '04:f4:6d:62:9e:0f:90', 'not_found', '2025-11-24 19:37:36'),
(5, 2, NULL, '04:f4:6d:62:9e:0f:90', 'not_found', '2025-11-24 19:37:39'),
(6, 1, NULL, '04:f4:6d:62:9e:0f:90', 'not_found', '2025-11-24 19:53:17'),
(7, 2, NULL, '19921992', 'not_found', '2025-11-24 19:55:39'),
(8, 2, NULL, '19921992', 'not_found', '2025-11-24 19:57:34'),
(9, 2, NULL, '19921992', 'not_found', '2025-11-24 19:57:56'),
(10, 2, 2, '19921992', 'present', '2025-11-24 19:59:43'),
(11, 1, 2, '19921992', 'present', '2025-11-24 20:06:35'),
(12, 3, 2, '19921992', 'present', '2025-11-24 20:07:35'),
(13, 4, 2, '19921992', 'present', '2025-11-24 20:11:01'),
(14, 5, 2, '19921992', 'present', '2025-11-24 20:26:41'),
(15, 6, NULL, '19971997', 'not_found', '2025-11-24 20:41:28'),
(16, 6, 2, '19921992', 'present', '2025-11-25 12:51:15'),
(17, 6, NULL, '1 09 73 1', 'not_found', '2025-11-25 12:51:28'),
(18, 7, 2, '19921992', 'present', '2025-11-25 15:07:04'),
(19, 7, 3, '19971997', 'present', '2025-11-25 15:10:08'),
(20, 7, 4, '19911991', 'present', '2025-12-13 05:11:52'),
(21, 10, 2, '19921992', 'present', '2025-12-13 08:11:33'),
(22, 10, NULL, '04:28:b6:62:9e:0f:91', 'not_found', '2025-12-13 08:13:41'),
(23, 10, NULL, '04:28:b6:62:9e:0f:91', 'not_found', '2025-12-13 08:13:41'),
(24, 10, NULL, '04:4c:ac:62:9e:0f:91', 'not_found', '2025-12-13 08:13:48'),
(25, 10, 3, '19971997', 'present', '2025-12-13 08:13:55'),
(26, 10, NULL, '04:f4:6d:62:9e:0f:90', 'not_found', '2025-12-13 09:08:28'),
(27, 10, NULL, '04:f4:6d:62:9e:0f:90', 'not_found', '2025-12-13 09:08:31'),
(28, 10, 5, '165137060', 'present', '2025-12-13 09:08:50'),
(29, 10, NULL, '04:f4:6d:62:9e:0f:90', 'not_found', '2025-12-13 09:09:01'),
(30, 10, NULL, 'ea:33:b7:9a', 'not_found', '2025-12-13 09:09:22'),
(31, 10, NULL, '04:f4:6d:62:9e:0f:90', 'not_found', '2025-12-13 09:51:26'),
(32, 10, NULL, '04:c2:81:62:9e:0f:90', 'not_found', '2025-12-13 09:51:36'),
(33, 10, NULL, '04:28:a5:62:9e:0f:91', 'not_found', '2025-12-13 09:51:40'),
(34, 10, NULL, '04:4c:ac:62:9e:0f:91', 'not_found', '2025-12-13 09:51:43'),
(35, 10, 4, '19911991', 'present', '2025-12-13 09:51:49'),
(36, 10, NULL, '04:4c:ac:62:9e:0f:91', 'not_found', '2025-12-13 09:51:52'),
(37, 12, 4, '19911991', 'present', '2025-12-13 09:54:31'),
(38, 12, NULL, '04:9c:6c:fa:44:12:90', 'not_found', '2025-12-13 09:54:40'),
(39, 12, 3, '19971997', 'present', '2025-12-13 09:54:50'),
(40, 12, 2, '19921992', 'present', '2025-12-13 09:55:08'),
(41, 13, NULL, '8d:3f:d6:36', 'not_found', '2025-12-15 11:10:13'),
(42, 13, NULL, '4d:8e:8c:38', 'not_found', '2025-12-15 11:11:31'),
(43, 13, 6, '4d:8e:8c:38', 'present', '2025-12-15 11:14:31'),
(44, 14, 2, '8d:3f:d6:36', 'present', '2025-12-15 11:22:41'),
(45, 15, 6, '4d:8e:8c:38', 'present', '2025-12-15 12:00:57'),
(46, 15, 2, '8d:3f:d6:36', 'present', '2025-12-15 12:01:17'),
(47, 16, 2, '8d:3f:d6:36', 'present', '2025-12-19 18:35:05'),
(48, 17, NULL, '19921992', 'not_found', '2026-01-14 19:38:46'),
(49, 17, 2, '8d:3f:d6:36', 'present', '2026-01-14 19:39:00'),
(50, 18, NULL, '19921992', 'not_found', '2026-01-14 19:56:01'),
(51, 20, NULL, '19921992', 'not_found', '2026-01-16 18:32:07'),
(52, 20, NULL, '1992', 'not_found', '2026-01-16 18:32:14'),
(53, 20, NULL, '1992', 'not_found', '2026-01-16 18:32:18'),
(54, 20, 2, '8d:3f:d6:36', 'present', '2026-01-16 18:32:46'),
(55, 20, NULL, '12228', 'not_found', '2026-01-16 18:36:56'),
(56, 20, 4, '19911991', 'present', '2026-01-16 18:41:48'),
(57, 20, 6, '4d:8e:8c:38', 'present', '2026-01-16 18:42:21'),
(58, 21, NULL, '08:fa:e5:99', 'not_found', '2026-01-16 20:46:22'),
(59, 21, 2, '8d:3f:d6:36', 'present', '2026-01-16 20:46:36'),
(60, 22, 2, '8d:3f:d6:36', 'present', '2026-01-16 20:51:05'),
(61, 22, NULL, '19921992', 'not_found', '2026-01-16 20:52:18'),
(62, 22, NULL, '8d:3f:d6:36', 'not_found', '2026-01-16 20:56:25'),
(63, 22, NULL, '8d:3f:d6:36', 'not_found', '2026-01-16 20:56:27'),
(64, 22, NULL, '8d:3f:d6:36', 'not_found', '2026-01-16 20:56:28'),
(65, 22, NULL, '8d:3f:d6:36', 'not_found', '2026-01-16 21:00:40'),
(66, 22, NULL, '8d:3f:d6:36', 'not_found', '2026-01-16 21:00:46'),
(67, 22, NULL, '19921992', 'not_found', '2026-01-16 21:04:29'),
(68, 22, 10, '04:dd:4c:62:9e:0f:90', 'present', '2026-01-16 21:05:23'),
(69, 22, NULL, 'undefined', 'not_found', '2026-01-16 21:31:13'),
(70, 22, 6, '4d:8e:8c:38', 'present', '2026-01-16 21:32:55'),
(71, 22, 12, 'ed:e2:98:38', 'present', '2026-01-17 06:32:36'),
(72, 23, 16, '3d:c1:65:38', 'present', '2026-01-17 09:18:55'),
(73, 23, 9, '8D:3F:D6:36', 'present', '2026-01-17 09:21:11'),
(74, 23, 14, '5D:4A:7A:37', 'present', '2026-01-17 09:21:42'),
(75, 24, 9, '8d:3f:d6:36', 'present', '2026-01-17 09:38:53'),
(76, 26, 9, '8d:3f:d6:36', 'present', '2026-01-18 06:16:11'),
(77, 26, 16, '3D:C1:65:38', 'present', '2026-01-18 06:16:50'),
(78, 27, 17, 'ed:ad:96:38', 'present', '2026-01-18 07:08:05'),
(79, 27, 19, '04:8b:69:fa:44:12:91', 'present', '2026-01-18 07:08:21'),
(80, 27, 13, 'bd:ea:9b:37', 'present', '2026-01-18 07:08:30'),
(81, 27, 15, 'bd:67:96:38', 'present', '2026-01-18 07:08:33'),
(82, 27, 18, '5d:63:f6:36', 'present', '2026-01-18 07:08:48'),
(83, 27, 9, '8D:3F:D6:36', 'present', '2026-01-18 07:09:11'),
(84, 29, 17, 'ed:ad:96:38', 'present', '2026-01-18 08:18:49'),
(85, 29, 13, 'bd:ea:9b:37', 'present', '2026-01-18 08:18:53'),
(86, 29, 15, 'bd:67:96:38', 'present', '2026-01-18 08:18:57'),
(87, 29, 25, 'aa:5d:22:9a', 'present', '2026-01-18 08:19:03'),
(88, 29, 18, '5d:63:f6:36', 'present', '2026-01-18 08:19:08'),
(89, 29, 20, '5d:1a:ef:37', 'present', '2026-01-18 08:19:12'),
(90, 29, 21, '7a:c9:5f:ac', 'present', '2026-01-18 08:19:30'),
(91, 29, 22, 'b4:03:36:af', 'present', '2026-01-18 08:19:34'),
(92, 29, 26, '49:89:46:94', 'present', '2026-01-18 08:19:37'),
(93, 30, 9, '8D:3F:D6:36', 'present', '2026-01-18 08:48:04'),
(94, 31, 19, '04:8B:69:FA:44:12:91', 'present', '2026-01-19 09:34:39'),
(95, 31, 9, '8D:3F:D6:36', 'present', '2026-01-19 09:34:50'),
(96, 31, 12, 'ED:E2:98:38', 'present', '2026-01-19 09:34:59'),
(97, 31, NULL, '387', 'not_found', '2026-01-19 11:27:41'),
(98, 31, NULL, '387', 'not_found', '2026-01-19 11:28:01'),
(99, 31, NULL, '387', 'not_found', '2026-01-19 11:46:12'),
(100, 32, NULL, '387', 'not_found', '2026-01-19 11:54:10'),
(101, 32, NULL, '387', 'not_found', '2026-01-19 11:54:46'),
(102, 32, 9, '8D:3F:D6:36', 'present', '2026-01-19 11:54:59'),
(103, 32, 27, '387', 'present', '2026-01-19 12:00:21'),
(104, 35, NULL, '385', 'not_found', '2026-01-19 15:02:47'),
(105, 35, 16, '385', 'present', '2026-01-19 15:04:53'),
(106, 37, NULL, '368', 'not_found', '2026-01-22 16:42:02'),
(107, 37, 27, '387', 'present', '2026-01-22 16:42:13'),
(108, 38, 9, '8d:3f:d6:36', 'present', '2026-03-07 09:50:35'),
(109, 38, 27, '387', 'present', '2026-03-07 09:51:41');

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

--
-- بنية الجدول `grades`
--

CREATE TABLE `grades` (
  `id` int(11) NOT NULL,
  `student_id` int(11) NOT NULL,
  `teacher_id` int(11) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `grade1` decimal(5,2) DEFAULT 0.00,
  `grade2` decimal(5,2) DEFAULT 0.00,
  `grade3` decimal(5,2) DEFAULT 0.00,
  `grade4` decimal(5,2) DEFAULT 0.00,
  `grade5` decimal(5,2) DEFAULT 0.00,
  `note` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- إرجاع أو استيراد بيانات الجدول `grades`
--

INSERT INTO `grades` (`id`, `student_id`, `teacher_id`, `subject`, `grade1`, `grade2`, `grade3`, `grade4`, `grade5`, `note`, `created_at`, `updated_at`) VALUES
(2, 2, 1, 'امنيه', 28.00, 5.00, 6.50, 4.50, 0.00, '', '2026-01-16 19:42:20', '2026-01-16 20:25:51'),
(3, 6, 1, 'أمنبة', 10.00, 20.00, 10.00, 5.00, 4.00, '', '2026-01-16 19:57:56', '2026-01-16 19:57:56'),
(4, 7, 1, 'محاسبه', 5.00, 0.00, 0.00, 0.00, 0.00, '', '2026-01-16 20:53:12', '2026-01-16 20:53:12'),
(5, 9, 1, 'امنيه', 10.00, 0.00, 0.00, 0.00, 0.00, '', '2026-01-17 10:12:23', '2026-01-17 10:12:23'),
(6, 9, 1, 'امنيه', 0.00, 6.00, 0.00, 0.00, 0.00, '', '2026-01-18 06:26:29', '2026-01-18 06:26:29'),
(7, 9, 1, 'امنيه', 0.00, 6.00, 0.00, 0.00, 0.00, '', '2026-01-18 06:26:30', '2026-01-18 06:26:30');

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

--
-- بنية الجدول `lectures`
--

CREATE TABLE `lectures` (
  `id` int(11) NOT NULL,
  `teacher_id` int(11) NOT NULL,
  `level` varchar(50) NOT NULL,
  `day` varchar(20) NOT NULL,
  `time_start` time NOT NULL,
  `time_end` time DEFAULT NULL,
  `subject` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- إرجاع أو استيراد بيانات الجدول `lectures`
--

INSERT INTO `lectures` (`id`, `teacher_id`, `level`, `day`, `time_start`, `time_end`, `subject`, `created_at`) VALUES
(1, 1, 'الرابع', 'الثلاثاء', '12:52:00', '18:52:00', 'مختبرات', '2025-12-13 09:52:53'),
(2, 1, 'الثاني', 'الاثنين', '23:31:00', '12:58:00', 'أمنبة', '2026-01-16 17:54:37');

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

--
-- بنية الجدول `messages`
--

CREATE TABLE `messages` (
  `id` int(11) NOT NULL,
  `sender_id` int(11) DEFAULT 0,
  `receiver_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `body` text NOT NULL,
  `is_read` tinyint(1) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- إرجاع أو استيراد بيانات الجدول `messages`
--

INSERT INTO `messages` (`id`, `sender_id`, `receiver_id`, `title`, `body`, `is_read`, `created_at`) VALUES
(1, 0, 1, 'مرحباً بك في نظام البصمة', 'نرحب بك في النظام الجديد. يمكنك هنا متابعة آخر التنبيهات والرسائل الإدارية.', 0, '2026-01-16 19:03:10'),
(2, 2, 1, 'سعيات', 'اليوم حتاج رفع جميع درجات', 0, '2026-01-16 20:05:23'),
(3, 2, 1, 'تعليم', 'تعليم', 0, '2026-01-18 06:36:13');

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

--
-- بنية الجدول `sessions`
--

CREATE TABLE `sessions` (
  `id` int(11) NOT NULL,
  `teacher_id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `session_date` date NOT NULL,
  `status` enum('open','closed') NOT NULL DEFAULT 'open',
  `closed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp()
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- إرجاع أو استيراد بيانات الجدول `sessions`
--

INSERT INTO `sessions` (`id`, `teacher_id`, `title`, `session_date`, `status`, `closed_at`, `created_at`) VALUES
(1, 1, 'حصة جديدة - 2025-11-24 19:31', '2025-11-24', 'closed', '2025-11-24 20:07:05', '2025-11-24 19:31:14'),
(2, 1, 'حصة جديدة - 2025-11-24 19:31', '2025-11-24', 'closed', '2025-11-24 20:06:01', '2025-11-24 19:31:55'),
(3, 1, 'حصة جديدة - 2025-11-24 20:07', '2025-11-24', 'closed', '2025-11-24 20:07:43', '2025-11-24 20:07:29'),
(4, 1, 'حصة جديدة - 2025-11-24 20:10', '2025-11-24', 'closed', '2025-11-24 20:11:14', '2025-11-24 20:10:48'),
(5, 1, 'حصة جديدة - 2025-11-24 20:26', '2025-11-24', 'closed', '2025-11-24 20:27:05', '2025-11-24 20:26:30'),
(6, 1, 'حصة جديدة - 2025-11-24 20:41', '2025-11-24', 'open', NULL, '2025-11-24 20:41:18'),
(7, 1, 'حصة جديدة - 2025-11-25 15:06', '2025-11-25', 'closed', '2025-12-13 08:12:31', '2025-11-25 15:06:58'),
(8, 2, 'حصة جديدة - 2025-11-26 12:55', '2025-11-26', 'open', NULL, '2025-11-26 12:55:34'),
(9, 2, 'حصة جديدة - 2025-11-26 12:55', '2025-11-26', 'open', NULL, '2025-11-26 12:55:59'),
(10, 1, 'حصة جديدة - 2025-12-13 08:09', '2025-12-13', 'open', NULL, '2025-12-13 08:09:52'),
(11, 1, 'حصة جديدة - 2025-12-13 09:53', '2025-12-13', 'open', NULL, '2025-12-13 09:53:30'),
(12, 1, 'حصة جديدة - 2025-12-13 09:54', '2025-12-13', 'closed', '2025-12-13 09:55:19', '2025-12-13 09:54:19'),
(13, 1, 'حصة جديدة - 2025-12-15 10:45', '2025-12-15', 'open', NULL, '2025-12-15 10:45:53'),
(14, 1, 'حصة جديدة - 2025-12-15 11:22', '2025-12-15', 'closed', '2025-12-15 11:22:48', '2025-12-15 11:22:25'),
(15, 1, 'حصة جديدة - 2025-12-15 12:00', '2025-12-15', 'open', NULL, '2025-12-15 12:00:45'),
(16, 1, 'حصة جديدة - 2025-12-19 18:34', '2025-12-19', 'open', NULL, '2025-12-19 18:34:09'),
(17, 1, 'حصة جديدة - 2026-01-14 19:38', '2026-01-14', 'closed', '2026-01-14 19:39:09', '2026-01-14 19:38:33'),
(18, 1, 'حصة جديدة - 2026-01-14 19:55', '2026-01-14', 'open', NULL, '2026-01-14 19:55:33'),
(19, 1, 'حصة جديدة - 2026-01-16 17:54', '2026-01-16', 'open', NULL, '2026-01-16 17:54:57'),
(20, 1, 'حصة جديدة - 2026-01-16 19:31', '2026-01-16', 'open', NULL, '2026-01-16 18:31:30'),
(21, 1, 'حصة جديدة - 2026-01-16 20:37', '2026-01-16', 'open', NULL, '2026-01-16 19:37:18'),
(22, 1, 'حصة جديدة - 2026-01-16 20:50', '2026-01-16', 'open', NULL, '2026-01-16 20:50:50'),
(23, 1, 'حصة جديدة - 2026-01-17 06:32', '2026-01-17', 'closed', '2026-01-17 09:22:09', '2026-01-17 06:32:23'),
(24, 1, 'حصة جديدة - 2026-01-17 09:38', '2026-01-17', 'open', NULL, '2026-01-17 09:38:29'),
(25, 1, 'حصة جديدة - 2026-01-18 06:15', '2026-01-18', 'open', NULL, '2026-01-18 06:15:32'),
(26, 1, 'حصة جديدة - 2026-01-18 06:16', '2026-01-18', 'closed', '2026-01-18 06:17:34', '2026-01-18 06:16:00'),
(27, 1, 'حصة جديدة - 2026-01-18 07:07', '2026-01-18', 'closed', '2026-01-18 07:09:27', '2026-01-18 07:07:44'),
(28, 1, 'حصة جديدة - 2026-01-18 07:56', '2026-01-18', 'open', NULL, '2026-01-18 07:56:11'),
(29, 1, 'حصة جديدة - 2026-01-18 08:18', '2026-01-18', 'closed', '2026-01-18 08:20:55', '2026-01-18 08:18:28'),
(30, 1, 'حصة جديدة - 2026-01-18 08:47', '2026-01-18', 'closed', '2026-01-18 08:54:25', '2026-01-18 08:47:49'),
(31, 1, 'حصة جديدة - 2026-01-18 08:58', '2026-01-18', 'open', NULL, '2026-01-18 08:58:11'),
(32, 1, 'حصة جديدة - 2026-01-19 11:51', '2026-01-19', 'open', NULL, '2026-01-19 11:51:31'),
(33, 1, 'حصة جديدة - 2026-01-19 14:16', '2026-01-19', 'open', NULL, '2026-01-19 14:16:43'),
(34, 1, 'حصة جديدة - 2026-01-19 14:25', '2026-01-19', 'open', NULL, '2026-01-19 14:25:14'),
(35, 1, 'حصة جديدة - 2026-01-19 14:37', '2026-01-19', 'open', NULL, '2026-01-19 14:37:48'),
(36, 1, 'حصة جديدة - 2026-01-22 16:41', '2026-01-22', 'open', NULL, '2026-01-22 16:41:01'),
(37, 1, 'حصة جديدة - 2026-01-22 16:41', '2026-01-22', 'closed', '2026-01-22 16:42:51', '2026-01-22 16:41:43'),
(38, 1, 'حصة جديدة - 2026-03-07 09:50', '2026-03-07', 'open', NULL, '2026-03-07 09:50:07');

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

--
-- بنية الجدول `students`
--

CREATE TABLE `students` (
  `id` int(11) NOT NULL,
  `student_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `nfc_uid` varchar(255) DEFAULT NULL,
  `first_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `second_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `third_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `level` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `department` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `id_no` varchar(50) DEFAULT NULL,
  `phone_number` varchar(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- إرجاع أو استيراد بيانات الجدول `students`
--

INSERT INTO `students` (`id`, `student_id`, `nfc_uid`, `first_name`, `second_name`, `third_name`, `level`, `department`, `created_at`, `id_no`, `phone_number`) VALUES
(9, '8D:3F:D6:36', NULL, 'خالد', 'وليد', 'خالد', 'الرابع', 'هندسه حاسبات', '2026-01-16 21:01:51', NULL, NULL),
(16, '3D:C1:65:38', NULL, 'عبد الرحمن', 'صباح', 'براهيم', 'الرابع', 'هندسة حاسبات', '2026-01-17 07:43:17', '385', '07822606364'),
(4, '19911991', NULL, 'سجاد', 'نجاح', 'احمد', 'الرابع', 'هندسة تقنيات حاسوب', '2025-12-13 05:11:20', NULL, NULL),
(6, '4d:8e:8c:38', NULL, 'ايسر', 'عبد الحميد', 'عزيز', 'الرابع', 'هندسه تقنيات حاسوب', '2025-12-15 11:13:29', NULL, NULL),
(10, '04:DD:4C:62:9E:0F:90', NULL, 'محمد', 'عمر', 'احمد', 'الثالث', 'تقنيات حاسوب', '2026-01-16 21:03:59', NULL, NULL),
(11, '6D:F7:64:37', NULL, 'براء', 'فاضل', 'جبير', 'الثالث', 'هندسة تقنيات أمن الاسيبراني', '2026-01-17 04:36:28', NULL, NULL),
(12, 'ED:E2:98:38', NULL, 'محمد', 'ياسين', 'طه', 'الرابع', 'هندسة تقنيات', '2026-01-17 06:28:56', NULL, NULL),
(13, 'BD:EA:9B:37', NULL, 'مريم', 'يونس', 'عبد الودو', 'الرابع', 'هندسة حسابات', '2026-01-17 07:41:20', NULL, NULL),
(14, '5D:4A:7A:37', NULL, 'موج', 'ماهر', 'خليل', 'الرابع', 'هندسه حسابات', '2026-01-17 07:41:51', NULL, NULL),
(15, 'BD:67:96:38', NULL, 'جنات', 'مخلد', 'قاسم', 'الرابع', 'هندسة حاسبات', '2026-01-17 07:42:26', NULL, NULL),
(17, 'ED:AD:96:38', NULL, 'عمر', 'ياسر', 'نوري', 'الرابع', 'هندسة تقنيات حاسوب', '2026-01-18 07:04:17', NULL, NULL),
(18, '5D:63:F6:36', NULL, 'احمد', 'مقداد', 'عزت', 'الرابع', 'هندسة تقنيات حاسوب', '2026-01-18 07:04:51', NULL, NULL),
(19, '04:8B:69:FA:44:12:91', NULL, 'ريم', 'خالد', 'شهاب', 'الرابع', 'هندسة تقنيات حاسوب', '2026-01-18 07:05:21', NULL, NULL),
(20, '5D:1A:EF:37', NULL, 'محمد', 'عدنان', 'حسن', 'الرابع', 'هندسة تقنيات حاسوب', '2026-01-18 07:20:28', NULL, NULL),
(21, '7A:C9:5F:AC', NULL, 'حسن نصرالله', 'حيدر', 'كريم', 'الأول', 'هندسة تقنيات حاسوب', '2026-01-18 07:48:41', NULL, NULL),
(22, 'B4:03:36:AF', NULL, 'حسين', 'على', 'محمد', 'الأول', 'هندسة تقنيات حاسوب', '2026-01-18 07:49:03', NULL, NULL),
(23, 'A4:6E:68:B3', NULL, 'علي', 'عقيل', 'عارف', 'الأول', 'هندسة تقنيات حاسوب', '2026-01-18 07:49:53', NULL, NULL),
(24, 'FB:62:1B:8D', NULL, 'عبدالله', 'محمد', 'جميل', 'الأول', 'هندسة تقنيات حاسوب', '2026-01-18 07:50:23', NULL, NULL),
(25, 'AA:5D:22:9A', NULL, 'شمس', 'جمال', 'عبدالرضا', 'الرابع', 'هندسة تقنيات حاسوب', '2026-01-18 07:51:52', NULL, NULL),
(26, '49:89:46:94', NULL, 'زين العابدين', 'بكر', 'علي', 'الأول', 'هندسة تقنيات حاسوب', '2026-01-18 07:52:51', NULL, NULL),
(27, '44:44.:88', NULL, 'محمد', 'جمال', 'حسين', 'الرابع', 'هندسة حاسبات', '2026-01-19 11:45:41', '387', '078310033');

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

--
-- بنية الجدول `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `role` enum('teacher','head') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `can_edit_grades` tinyint(4) DEFAULT 1
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- إرجاع أو استيراد بيانات الجدول `users`
--

INSERT INTO `users` (`id`, `name`, `email`, `password`, `role`, `created_at`, `can_edit_grades`) VALUES
(1, 'خالد', 'admin2@admin', '$2y$10$OwqFrkXBKAXGSYQuiqjoo.ahsytjp/oYxk3/61pORmbw2SLWPmbDS', 'teacher', '2025-11-24 16:23:20', 1),
(2, 'مكي', 'admin@admin', '$2y$10$zSWTVzHv6lwHEuW/lLeBEeQNCUgGO.Tl6OWFaIvJr9uclm807H9oK', 'head', '2025-11-24 16:30:46', 1),
(3, 'أحمد علي', 'ahmed@school.com', '$2y$10$Zy.ab8Qim9uxAW5ZDEjp2e/stLuAweBHDGBTgpwQM9PwybCIqcrTm', 'teacher', '2026-03-29 14:26:15', 1);

--
-- Indexes for dumped tables
--

--
-- فهارس للجدول `attendance`
--
ALTER TABLE `attendance`
  ADD PRIMARY KEY (`id`),
  ADD KEY `session_id` (`session_id`),
  ADD KEY `student_id` (`student_id`);

--
-- فهارس للجدول `grades`
--
ALTER TABLE `grades`
  ADD PRIMARY KEY (`id`),
  ADD KEY `student_id` (`student_id`),
  ADD KEY `teacher_id` (`teacher_id`);

--
-- فهارس للجدول `lectures`
--
ALTER TABLE `lectures`
  ADD PRIMARY KEY (`id`);

--
-- فهارس للجدول `messages`
--
ALTER TABLE `messages`
  ADD PRIMARY KEY (`id`);

--
-- فهارس للجدول `sessions`
--
ALTER TABLE `sessions`
  ADD PRIMARY KEY (`id`);

--
-- فهارس للجدول `students`
--
ALTER TABLE `students`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `student_id` (`student_id`),
  ADD UNIQUE KEY `nfc_uid` (`nfc_uid`);

--
-- فهارس للجدول `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

