-- Table structure for table `psb_pendaftar`
--

CREATE TABLE `psb_pendaftar` (
  `id` int NOT NULL,
  `nama_anak` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `level` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tanggal_lahir` date DEFAULT NULL,
  `jenis_kelamin` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sekolah_asal` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nama_ortu` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `alamat` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `telepon` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sumber_info` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('pending','interview','approved','rejected') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `file_bukti_bayar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_akta_lahir` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_kk` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_ktp_ortu` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_form_wawancara` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_foto` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `psb_settings`
--

CREATE TABLE `psb_settings` (
  `id` int NOT NULL DEFAULT '1',
  `nomor_wa_admin` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `template_pesan` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `psb_settings`
--

INSERT INTO `psb_settings` (`id`, `nomor_wa_admin`, `template_pesan`, `updated_at`) VALUES
(1, '6281234567890', 'Assalamu\'alaikum {nama}...', '2026-08-01 13:35:51');

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

--
-- Table structure for table `psb_wa_log`
--

CREATE TABLE `psb_wa_log` (
  `id` int NOT NULL,
  `id_pendaftar` int DEFAULT NULL,
  `jenis_aksi` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nomor_tujuan` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `isi_pesan` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `waktu_kirim` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `raport_arsip_pdf`
--

CREATE TABLE `raport_arsip_pdf` (
  `id` int NOT NULL,
  `nis_siswa` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `semester` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tahun_ajaran` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nama_file` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `tanggal_upload` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `raport_arsip_pdf`
--

INSERT INTO `raport_arsip_pdf` (`id`, `nis_siswa`, `semester`, `tahun_ajaran`, `nama_file`, `file_data`, `tanggal_upload`) VALUES
(1, '1234567890', 'Laporan Tengah Semester', '2024/2025', 'lampiran.pdf', 'data:application/pdf;base64,[BLOB]', '2026-08-03 12:48:16');
INSERT INTO `raport_arsip_pdf` (`id`, `nis_siswa`, `semester`, `tahun_ajaran`, `nama_file`, `file_data`, `tanggal_upload`) VALUES
(2, '1234567890', 'Raport Ganjil', '2024/2025', 'lampiran.pdf', 'data:application/pdf;base64,[BLOB]', '2026-08-03 12:48:30');

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

--
-- Table structure for table `raport_isi`
--

CREATE TABLE `raport_isi` (
  `id` int NOT NULL,
  `nis_siswa` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `nuptk_guru` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `id_template` int NOT NULL,
  `semester` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tahun_ajaran` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `data_isian` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `tanggal_isi` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `raport_isi`
--

INSERT INTO `raport_isi` (`id`, `nis_siswa`, `nuptk_guru`, `id_template`, `semester`, `tahun_ajaran`, `data_isian`, `tanggal_isi`) VALUES
(1, '1234567890', '0987654321234567', 2, 'I', '2025 / 2026', '{\"htmlContent\":\"\\n\\n    <!-- ================= BAR PENGATURAN ================= -->\\n    <div class=\\\"control-bar\\\" style=\\\"display: none;\\\">\\n        <div class=\\\"control-info\\\">\\n            <b>\\u2728 EDIT MANUAL DI WEB:<\\/b> Klik teks apa saja untuk langsung mengetik.<br>\\n            <b>\\u2714\\ufe0f CENTANG NILAI:<\\/b> Klik kotak kosong untuk memberi tanda centang (\\u2713).\\n        <\\/div>\\n        <button class=\\\"btn-save\\\" onclick=\\\"saveAndClose()\\\">\\ud83d\\udcbe Save &amp; Tutup<\\/button>\\n    <\\/div>\\n\\n    <!-- ================= HALAMAN 1 ================= -->\\n    <div class=\\\"page-sheet\\\">\\n        <div class=\\\"header-box\\\">\\n            <h1 contenteditable=\\\"false\\\">KINDERGARTEN<br>JAKARTA ISLAMIC SCHOOL (JISc)<br>TEMPORARY REPORT<\\/h1>\\n        <\\/div>\\n\\n        <div class=\\\"student-info\\\">\\n            <div class=\\\"info-col\\\">\\n                <div class=\\\"info-row\\\"><span class=\\\"info-label\\\">Student\'s Name<\\/span><span class=\\\"info-sep\\\">:<\\/span><span contenteditable=\\\"true\\\" id=\\\"studentName\\\">eko setiawan<\\/span><\\/div>\\n                <div class=\\\"info-row\\\"><span class=\\\"info-label\\\">Class<\\/span><span class=\\\"info-sep\\\">:<\\/span><span contenteditable=\\\"true\\\" id=\\\"studentClass\\\">K2B (Al Kahfi)<\\/span><\\/div>\\n            <\\/div>\\n            <div class=\\\"info-col\\\">\\n                <div class=\\\"info-row\\\"><span class=\\\"info-label\\\">Term<\\/span><span class=\\\"info-sep\\\">:<\\/span><span contenteditable=\\\"true\\\" id=\\\"studentTerm\\\">I<\\/span><\\/div>\\n                <div class=\\\"info-row\\\"><span class=\\\"info-label\\\">Year<\\/span><span class=\\\"info-sep\\\">:<\\/span><span contenteditable=\\\"true\\\" id=\\\"studentYear\\\">2025 \\/ 2026<\\/span><\\/div>\\n            <\\/div>\\n        <\\/div>\\n        <div class=\\\"divider-thick\\\"><\\/div>\\n\\n        <div class=\\\"section-title\\\" contenteditable=\\\"false\\\">ISLAMIC STUDIES CURRICULUM<\\/div>\\n        <table class=\\\"custom-table\\\">\\n            <thead>\\n                <tr>\\n                    <th class=\\\"col-no\\\">NO<\\/th>\\n                    <th>SUBJECT<\\/th>\\n                    <th>E<\\/th>\\n                    <th>G<\\/th>\\n                    <th>D<\\/th>\\n                    <th>NI<\\/th>\\n                <\\/tr>\\n            <\\/thead>\\n            <tbody>\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">1<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">SPIRITUAL<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Reciting basmallah before doing something<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Reciting hamdallah after doing something<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Khusyuk when reciting du\'a<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Knowing \\\"20 sifat Allah\\\"<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">2<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">SHOLAT<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Du\'a after wudhu<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Du\'a iftitah<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">3<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">DUA<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">For healthy with meaning<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">After studying<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">4<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">HADIST<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Menutup aurat<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Pekerjaan rapih<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Salam<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">5<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">TAHSIN<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Writing<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Imla harakat fathah, kasrah, and dhumah<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Reading<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">6<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">ARABIC<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Vocabularies<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Conversations<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">7<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">SIROH<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Prophet Syuaib as, Prophet Musa as, Prophet Harun as, Zaid bin Haritsah and Bilal bin Rabbah<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n            <\\/tbody>\\n        <\\/table>\\n\\n        <div class=\\\"section-title\\\" style=\\\"margin-top: 10px;\\\" contenteditable=\\\"false\\\">TAHFIDZ<\\/div>\\n        <table class=\\\"tahfidz-table\\\">\\n            <thead>\\n                <tr>\\n                    <th style=\\\"width: 35px;\\\">No<\\/th>\\n                    <th>Name of Surah<\\/th>\\n                    <th style=\\\"width: 95px;\\\">Mumtaz<br>(Excellent)<\\/th>\\n                    <th style=\\\"width: 95px;\\\">Jayyid Jiddan<br>(Good)<\\/th>\\n                    <th style=\\\"width: 95px;\\\">Jayyid<br>(Developing)<\\/th>\\n                    <th style=\\\"width: 95px;\\\">Maqbul<br>(Need Improvement)<\\/th>\\n                <\\/tr>\\n            <\\/thead>\\n            <tbody>\\n                <tr><td contenteditable=\\\"false\\\">1<\\/td><td contenteditable=\\\"false\\\">Qs Al Zalzalah<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td contenteditable=\\\"false\\\">2<\\/td><td contenteditable=\\\"false\\\">Qs Al Bayyinah<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td contenteditable=\\\"false\\\">3<\\/td><td contenteditable=\\\"false\\\">Qs Al Qadr<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n            <\\/tbody>\\n        <\\/table>\\n    <\\/div>\\n\\n    <!-- ================= HALAMAN 2 ================= -->\\n    <div class=\\\"page-sheet\\\">\\n        <div class=\\\"section-title\\\" contenteditable=\\\"false\\\">INTERNATIONAL CURRICULUM<\\/div>\\n        <table class=\\\"custom-table\\\">\\n            <thead>\\n                <tr>\\n                    <th class=\\\"col-no\\\">NO<\\/th>\\n                    <th>SUBJECT<\\/th>\\n                    <th>E<\\/th>\\n                    <th>G<\\/th>\\n                    <th>D<\\/th>\\n                    <th>NI<\\/th>\\n                <\\/tr>\\n            <\\/thead>\\n            <tbody>\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">1<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">ENGLISH<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Vocabularies<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Conversation<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Listen to and follow two step directions<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">2<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">MATH<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Counts by 1\'s to 50<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Pattern<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Number form<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Additional<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Subtraction<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Count to tell the number object<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Sequence numbers 1-30<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">3<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">SCIENCE<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Identifying the things are can be attracted by magnet<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Distinguish same and different objects<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Clasifying the things are living things and non-living things<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Clasifying the things are solid and liquid<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n            <\\/tbody>\\n        <\\/table>\\n\\n        <div class=\\\"section-title\\\" style=\\\"margin-top: 12px;\\\" contenteditable=\\\"false\\\">INDONESIAN CURRICULUM<\\/div>\\n        <table class=\\\"custom-table\\\">\\n            <thead>\\n                <tr>\\n                    <th class=\\\"col-no\\\">NO<\\/th>\\n                    <th>SUBJECT<\\/th>\\n                    <th>E<\\/th>\\n                    <th>G<\\/th>\\n                    <th>D<\\/th>\\n                    <th>NI<\\/th>\\n                <\\/tr>\\n            <\\/thead>\\n            <tbody>\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">1<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">Language Development<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Communicates information verbally and in writing<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Follow multi-step directions<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Writing simple sentences<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Dictation<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Poem<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">2<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">Social Emotional Development<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Shows self-control<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Plays well with others<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Cares for properly<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Participates in a group activities<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">3<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">Art\\/Music\\/Physical Development<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Shows small muscle control (colouring, collage, cutting and folding )<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Shows large muscle control<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">a.Jumping with one leg<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">b.Jumping with two legs<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">c.Crawling<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Moves Rhythmically to music<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n\\n                <tr class=\\\"row-header\\\"><td class=\\\"col-no\\\">4<\\/td><td colspan=\\\"5\\\" contenteditable=\\\"false\\\">Character Development<\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Completes works on time<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Follow instructions<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Follow classroom routines<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Works well independently<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Takes responsibility for own actions<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Respects others<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n                <tr><td><\\/td><td class=\\\"sub-item\\\" contenteditable=\\\"false\\\">Discipline<\\/td><td class=\\\"check-cell\\\">\\u2713<\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><td class=\\\"check-cell\\\"><\\/td><\\/tr>\\n            <\\/tbody>\\n        <\\/table>\\n    <\\/div>\\n\\n    <!-- ================= HALAMAN 3 ================= -->\\n    <div class=\\\"page-sheet\\\">\\n        <div class=\\\"grid-2col\\\">\\n            <div class=\\\"prog-box\\\">\\n                <div class=\\\"prog-title\\\" contenteditable=\\\"false\\\">Reading Program<\\/div>\\n                <table class=\\\"prog-table\\\">\\n                    <thead>\\n                        <tr><th style=\\\"width:30px;\\\">No<\\/th><th>Description<\\/th><th style=\\\"width:65px;\\\">Mark<\\/th><\\/tr>\\n                    <\\/thead>\\n                    <tbody>\\n                        <tr>\\n                            <td contenteditable=\\\"false\\\"><b>1<\\/b><\\/td>\\n                            <td contenteditable=\\\"false\\\">Modul Membaca<\\/td>\\n                            <td>\\n                                <select>\\n                                    <option selected=\\\"\\\">-- Select --<\\/option>\\n                                    <option value=\\\"E\\\">Excellent<\\/option>\\n                                    <option value=\\\"G\\\">Good<\\/option>\\n                                    <option value=\\\"D\\\">Developing<\\/option>\\n                                    <option value=\\\"NI\\\">Need Improvement<\\/option>\\n                                <\\/select>\\n                            <\\/td>\\n                        <\\/tr>\\n                        <tr>\\n                            <td contenteditable=\\\"false\\\"><b>2<\\/b><\\/td>\\n                            <td contenteditable=\\\"false\\\">Peter &amp; Jane<\\/td>\\n                            <td>\\n                                <select>\\n                                    <option selected=\\\"\\\">-- Select --<\\/option>\\n                                    <option value=\\\"E\\\">Excellent<\\/option>\\n                                    <option value=\\\"G\\\">Good<\\/option>\\n                                    <option value=\\\"D\\\">Developing<\\/option>\\n                                    <option value=\\\"NI\\\">Need Improvement<\\/option>\\n                                <\\/select>\\n                            <\\/td>\\n                        <\\/tr>\\n                    <\\/tbody>\\n                <\\/table>\\n            <\\/div>\\n            <div class=\\\"prog-box\\\">\\n                <div class=\\\"prog-title\\\" contenteditable=\\\"false\\\">Additional Program<\\/div>\\n                <table class=\\\"prog-table\\\">\\n                    <thead>\\n                        <tr><th style=\\\"width:30px;\\\">No<\\/th><th>Description<\\/th><th style=\\\"width:75px;\\\">Mark<\\/th><\\/tr>\\n                    <\\/thead>\\n                    <tbody>\\n                        <tr>\\n                            <td contenteditable=\\\"false\\\"><b>1<\\/b><\\/td>\\n                            <td contenteditable=\\\"false\\\">School Activities<\\/td>\\n                            <td>\\n                                <select>\\n                                    <option selected=\\\"\\\">-- Select --<\\/option>\\n                                    <option value=\\\"E\\\">Excellent<\\/option>\\n                                    <option value=\\\"G\\\">Good<\\/option>\\n                                    <option value=\\\"D\\\">Developing<\\/option>\\n                                    <option value=\\\"NI\\\">Need Improvement<\\/option>\\n                                <\\/select>\\n                            <\\/td>\\n                        <\\/tr>\\n                        <tr>\\n                            <td contenteditable=\\\"false\\\"><b>2<\\/b><\\/td>\\n                            <td contenteditable=\\\"false\\\">Exschool<\\/td>\\n                            <td>\\n                                <select>\\n                                    <option selected=\\\"\\\">-- Select --<\\/option>\\n                                    <option value=\\\"E\\\">Excellent<\\/option>\\n                                    <option value=\\\"G\\\">Good<\\/option>\\n                                    <option value=\\\"D\\\">Developing<\\/option>\\n                                    <option value=\\\"NI\\\">Need Improvement<\\/option>\\n                                <\\/select>\\n                            <\\/td>\\n                        <\\/tr>\\n                    <\\/tbody>\\n                <\\/table>\\n            <\\/div>\\n        <\\/div>\\n\\n        <div class=\\\"prog-att-grid\\\">\\n            <div class=\\\"progress-list\\\" contenteditable=\\\"false\\\">\\n                <div class=\\\"title\\\">Progress:<\\/div>\\n                <div><b>E<\\/b> &nbsp;&nbsp;&nbsp;: Excellent<\\/div>\\n                <div><b>G<\\/b> &nbsp;&nbsp;&nbsp;: Good<\\/div>\\n                <div><b>D<\\/b> &nbsp;&nbsp;&nbsp;: Developing<\\/div>\\n                <div><b>NI<\\/b> &nbsp;&nbsp;: Need Improvement<\\/div>\\n            <\\/div>\\n            <div class=\\\"attendance-box\\\">\\n                <div class=\\\"title\\\" contenteditable=\\\"false\\\">Attendance<\\/div>\\n                <table class=\\\"att-table\\\">\\n                    <tbody><tr><td>1<\\/td><td contenteditable=\\\"false\\\">Absent<\\/td><td contenteditable=\\\"true\\\">-<\\/td><\\/tr>\\n                    <tr><td>2<\\/td><td contenteditable=\\\"false\\\">Sick<\\/td><td contenteditable=\\\"true\\\">-<\\/td><\\/tr>\\n                    <tr><td>3<\\/td><td contenteditable=\\\"false\\\">Permission<\\/td><td contenteditable=\\\"true\\\">-<\\/td><\\/tr>\\n                <\\/tbody><\\/table>\\n            <\\/div>\\n        <\\/div>\\n\\n        <div class=\\\"message-section\\\">\\n            <div class=\\\"message-title\\\" contenteditable=\\\"false\\\">Message for Parent<\\/div>\\n            <div class=\\\"message-box\\\" contenteditable=\\\"true\\\">Dear lovely parents,<br><br>It has been pleasure to have Alecia\'s enthusiasm and positivity in our class. She has finished her lesson in this term well. She shows a conscientious effort to learn. Sometime, she needs to listen to directions more attentively during lessons. She needs to improve on working independently and be sure to ask for assistance only when it is needed. Please encourage her to be confidence to do the task and pay attention to detail in her assignments. Hopefully, Alecia will be better in the next term. Thank you.<\\/div>\\n        <\\/div>\\n\\n        <div class=\\\"signatures\\\">\\n            <div class=\\\"sign-left\\\">\\n                <div contenteditable=\\\"false\\\">Class Teacher 1<\\/div>\\n                <div class=\\\"sign-name\\\" contenteditable=\\\"true\\\">Hanifah, S.Pd, AUD<\\/div>\\n            <\\/div>\\n            <div class=\\\"sign-right\\\">\\n                <div style=\\\"margin-bottom: 5px;\\\"><span contenteditable=\\\"true\\\">Jakarta, September 27th 2025<\\/span><\\/div>\\n                <div contenteditable=\\\"true\\\">Headmistress,<\\/div>\\n                <div class=\\\"sign-name underline\\\" contenteditable=\\\"true\\\">Dwi Komala Sari, S.Pd.AUD<\\/div>\\n                <div class=\\\"nuks-text\\\" contenteditable=\\\"true\\\">NUKS: 1902310890162212122569<\\/div>\\n            <\\/div>\\n            <div class=\\\"sign-left\\\">\\n                <div contenteditable=\\\"false\\\">Class Teacher 2<\\/div>\\n                <div class=\\\"sign-name\\\" contenteditable=\\\"true\\\">Anggi Charisma, A.Ma<\\/div>\\n            <\\/div>\\n            <div class=\\\"sign-right\\\">\\n                <div contenteditable=\\\"false\\\">Parent<\\/div>\\n                <div class=\\\"sign-name\\\" contenteditable=\\\"true\\\">----------------------<\\/div>\\n            <\\/div>\\n        <\\/div>\\n    <\\/div>\\n\\n    <!-- ================= SCRIPT INTERAKTIF ================= -->\\n    <script>\\n        \\/\\/ Fitur klik untuk otomatis mencentang nilai\\n        document.querySelectorAll(\'.check-cell\').forEach(cell => {\\n            cell.addEventListener(\'click\', function() {\\n                const row = this.parentElement;\\n                if (this.textContent === \'\\u2713\') {\\n                    this.textContent = \'\';\\n                } else {\\n                    row.querySelectorAll(\'.check-cell\').forEach(c => c.textContent = \'\');\\n                    this.textContent = \'\\u2713\';\\n                }\\n            });\\n        });\\n\\n        \\/\\/ ==================== FUNGSI SAVE & CLOSE KE DATABASE ====================\\n        async function saveAndClose() {\\n            \\/\\/ Ambil data dasar\\n            const nama = document.getElementById(\'studentName\')?.textContent?.trim() || \'Siswa\';\\n            const kelas = document.getElementById(\'studentClass\')?.textContent?.trim() || \'\';\\n            const semester = document.getElementById(\'studentTerm\')?.textContent?.trim() || \'Ganjil\';\\n            const tahun = document.getElementById(\'studentYear\')?.textContent?.trim() || \'2024\\/2025\';\\n\\n            \\/\\/ Ambil NIS dan ID Template yang dilempar dari data_guru.js via URL\\n            const urlParams = new URLSearchParams(window.location.search);\\n            const nis = urlParams.get(\'nis\') || \'\';\\n            const id_template = urlParams.get(\'id_template\') || 0;\\n\\n            if (!nis || !id_template) {\\n                alert(\'\\u274c Error: NIS atau ID Template tidak ditemukan. Pastikan membuka dari Portal Guru.\');\\n                return;\\n            }\\n\\n            \\/\\/ Sembunyikan control-bar sebelum mengambil HTML agar tombol \\\"Save\\\" tidak ikut tersimpan di Raport Siswa\\n            const controlBar = document.querySelector(\'.control-bar\');\\n            if (controlBar) controlBar.style.display = \'none\';\\n            \\n            \\/\\/ Ambil seluruh desain HTML yang sudah dicentang dan diketik\\n            const htmlIsian = document.body.innerHTML;\\n            \\n            \\/\\/ Munculkan lagi bar-nya\\n            if (controlBar) controlBar.style.display = \'flex\';\\n\\n            const data = {\\n                nis: nis,\\n                nama: nama,\\n                kelas: kelas,\\n                semester: semester,\\n                tahun: tahun,\\n                id_template: id_template,\\n                htmlContent: htmlIsian\\n            };\\n\\n            \\/\\/ MENGIRIM KE PARENT WINDOW (data_guru.js)\\n            if (window.opener && typeof window.opener.saveRaportFromTemplate === \'function\') {\\n                showSaveSuccess(\'\\u23f3 Menyimpan raport ke database...\');\\n                \\n                \\/\\/ Panggil fungsi di data_guru.js\\n                const success = await window.opener.saveRaportFromTemplate(data);\\n                \\n                if (success) {\\n                    showSaveSuccess(\'\\u2705 Raport berhasil disimpan!\');\\n                    setTimeout(() => window.close(), 1500); \\/\\/ Tutup otomatis\\n                } else {\\n                    showSaveSuccess(\'\\u274c Gagal menyimpan ke database.\');\\n                }\\n            } else {\\n                alert(\'\\u274c Halaman Guru tidak terhubung. Raport gagal disimpan.\');\\n            }\\n        }\\n\\n        function showSaveSuccess(message) {\\n            const controlBar = document.querySelector(\'.control-bar\');\\n            if (controlBar) {\\n                let existing = controlBar.querySelector(\'.save-success-msg\');\\n                if (!existing) {\\n                    existing = document.createElement(\'div\');\\n                    existing.className = \'save-success-msg\';\\n                    existing.style.cssText = \'background: #10b981; color: white; padding: 8px 16px; border-radius: 6px; font-weight: bold; font-size: 14px; margin-left: 10px;\';\\n                    controlBar.appendChild(existing);\\n                }\\n                existing.textContent = message;\\n            }\\n        }\\n\\n        \\/\\/ AUTO-FILL NAMA SISWA DARI URL SAAT HALAMAN DIBUKA\\n        (function loadFromQuery() {\\n            const urlParams = new URLSearchParams(window.location.search);\\n            if (urlParams.get(\'nama\')) {\\n                const nameEl = document.getElementById(\'studentName\');\\n                if (nameEl) nameEl.textContent = urlParams.get(\'nama\');\\n            }\\n        })();\\n    <\\/script>\\n\\n\"}', '2026-08-03 09:41:15');

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

--
-- Table structure for table `raport_kirim`
--

CREATE TABLE `raport_kirim` (
  `id` int NOT NULL,
  `id_template` int NOT NULL,
  `nuptk_guru_tujuan` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `id_kelas` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `semester` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tahun_ajaran` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pesan` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `status` enum('pending','dikirim','dibaca') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `tanggal_kirim` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `nis_siswa` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `raport_template`
--

CREATE TABLE `raport_template` (
  `id` int NOT NULL,
  `nama_template` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `path_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `tanggal_upload` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `raport_template`
--

INSERT INTO `raport_template` (`id`, `nama_template`, `path_file`, `tanggal_upload`) VALUES
(1, 'minggu1', 'data_guru/template/K2B_term2.html', '2026-08-03 09:39:14'),
(2, 'semester1', 'data_guru/template/K2B_term1.html', '2026-08-03 09:41:01');

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

--
-- Table structure for table `ruangan`
--

CREATE TABLE `ruangan` (
  `id_ruangan` int NOT NULL,
  `nama_ruangan` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `siswa`
--

CREATE TABLE `siswa` (
  `nis` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `nama_lengkap` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `id_kelas` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `foto_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `siswa`
--

INSERT INTO `siswa` (`nis`, `nama_lengkap`, `id_kelas`, `foto_url`, `created_at`) VALUES
('1234567890', 'eko setiawan', 'KLS_1785489957668', NULL, '2026-07-31 03:37:35'),
('1234567895', 'test', 'KLS_1785749612912', '', '2026-08-03 09:34:30'),
('9087654321', 'udin padidin', 'KLS_1785745397762', '', '2026-08-03 09:33:11');

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

--
-- Table structure for table `siswa_data_pribadi`
--

CREATE TABLE `siswa_data_pribadi` (
  `nis` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `nisn` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tempat_lahir` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tanggal_lahir` date DEFAULT NULL,
  `jenis_kelamin` enum('Laki-laki','Perempuan') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agama` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kewarganegaraan` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'Indonesia',
  `alamat` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
  `rt` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rw` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kelurahan` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kecamatan` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kota` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `provinsi` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telp` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nama_ayah` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pendidikan_ayah` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pekerjaan_ayah` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `no_hp_ayah` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nama_ibu` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pendidikan_ibu` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `pekerjaan_ibu` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `no_hp_ibu` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `siswa_data_pribadi`
--

INSERT INTO `siswa_data_pribadi` (`nis`, `nisn`, `tempat_lahir`, `tanggal_lahir`, `jenis_kelamin`, `agama`, `kewarganegaraan`, `alamat`, `rt`, `rw`, `kelurahan`, `kecamatan`, `kota`, `provinsi`, `telp`, `email`, `nama_ayah`, `pendidikan_ayah`, `pekerjaan_ayah`, `no_hp_ayah`, `nama_ibu`, `pendidikan_ibu`, `pekerjaan_ibu`, `no_hp_ibu`, `updated_at`) VALUES
('1234567890', '11223344', 'bogor', '2026-08-02', NULL, '', 'Indonesia', '123', '04', '01', 'bogor ', 'bogor ', 'bogor ', 'bogor ', '579856236586348689 ', 'eko@gmail.com', 'udin ', 's3 ', 'pns ', '29487289356896 ', 'idin', 's1 ', 'test ', '1827489356892536 ', '2026-08-03 11:55:20'),
('1234567895', '', '', NULL, NULL, '', 'Indonesia', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '2026-08-03 09:37:57'),
('9087654321', '', '', '0000-00-00', '', '', 'Indonesia', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '2026-08-03 09:33:11');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `anecdote`
--
ALTER TABLE `anecdote`
  ADD PRIMARY KEY (`id`),
  ADD KEY `target_id` (`target_id`);

--
-- Indexes for table `elearning_aktivitas`
--
ALTER TABLE `elearning_aktivitas`
  ADD PRIMARY KEY (`id`),
  ADD KEY `nuptk_guru` (`nuptk_guru`);

--
-- Indexes for table `elearning_balasan_diskusi`
--
ALTER TABLE `elearning_balasan_diskusi`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id_diskusi` (`id_diskusi`);

--
-- Indexes for table `elearning_diskusi`
--
ALTER TABLE `elearning_diskusi`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id_pertemuan` (`id_pertemuan`);

--
-- Indexes for table `elearning_jawaban_quiz`
--
ALTER TABLE `elearning_jawaban_quiz`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id_quiz` (`id_quiz`),
  ADD KEY `nis_siswa` (`nis_siswa`);

--
-- Indexes for table `elearning_modul`
--
ALTER TABLE `elearning_modul`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id_pertemuan` (`id_pertemuan`);

--
-- Indexes for table `elearning_pertemuan`
--
ALTER TABLE `elearning_pertemuan`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id_aktivitas` (`id_aktivitas`);

--
-- Indexes for table `elearning_quiz`
--
ALTER TABLE `elearning_quiz`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id_pertemuan` (`id_pertemuan`);

--
-- Indexes for table `elearning_video`
--
ALTER TABLE `elearning_video`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id_pertemuan` (`id_pertemuan`);

--
-- Indexes for table `guru`
--
ALTER TABLE `guru`
  ADD PRIMARY KEY (`nuptk`);

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

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

--
-- Indexes for table `info_galeri_item`
--
ALTER TABLE `info_galeri_item`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id_album` (`id_album`);

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

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

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

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

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

--
-- Indexes for table `inventaris_barang`
--
ALTER TABLE `inventaris_barang`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `kode_barang` (`kode_barang`),
  ADD KEY `id_ruangan` (`id_ruangan`);

--
-- Indexes for table `jadwal_mengajar`
--
ALTER TABLE `jadwal_mengajar`
  ADD PRIMARY KEY (`id`),
  ADD KEY `nuptk_guru` (`nuptk_guru`),
  ADD KEY `id_kelas` (`id_kelas`);

--
-- Indexes for table `kelas`
--
ALTER TABLE `kelas`
  ADD PRIMARY KEY (`id_kelas`),
  ADD UNIQUE KEY `nama_kelas` (`nama_kelas`),
  ADD KEY `nuptk_wali_kelas` (`nuptk_wali_kelas`);

--
-- Indexes for table `laporan_kerusakan`
--
ALTER TABLE `laporan_kerusakan`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id_barang` (`id_barang`);

--
-- Indexes for table `perpus_buku`
--
ALTER TABLE `perpus_buku`
  ADD PRIMARY KEY (`kode_buku`);

--
-- Indexes for table `perpus_peminjaman`
--
ALTER TABLE `perpus_peminjaman`
  ADD PRIMARY KEY (`id_transaksi`),
  ADD KEY `nis_siswa` (`nis_siswa`),
  ADD KEY `kode_buku` (`kode_buku`);

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

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

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

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

--
-- Indexes for table `psb_wa_log`
--
ALTER TABLE `psb_wa_log`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id_pendaftar` (`id_pendaftar`);

--
-- Indexes for table `raport_arsip_pdf`
--
ALTER TABLE `raport_arsip_pdf`
  ADD PRIMARY KEY (`id`),
  ADD KEY `nis_siswa` (`nis_siswa`);

--
-- Indexes for table `raport_isi`
--
ALTER TABLE `raport_isi`
  ADD PRIMARY KEY (`id`),
  ADD KEY `nis_siswa` (`nis_siswa`),
  ADD KEY `nuptk_guru` (`nuptk_guru`),
  ADD KEY `id_template` (`id_template`);

--
-- Indexes for table `raport_kirim`
--
ALTER TABLE `raport_kirim`
  ADD PRIMARY KEY (`id`),
  ADD KEY `id_template` (`id_template`),
  ADD KEY `nuptk_guru_tujuan` (`nuptk_guru_tujuan`),
  ADD KEY `nis_siswa` (`nis_siswa`);

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

--
-- Indexes for table `ruangan`
--
ALTER TABLE `ruangan`
  ADD PRIMARY KEY (`id_ruangan`),
  ADD UNIQUE KEY `nama_ruangan` (`nama_ruangan`);

--
-- Indexes for table `siswa`
--
ALTER TABLE `siswa`
  ADD PRIMARY KEY (`nis`),
  ADD KEY `id_kelas` (`id_kelas`);

--
-- Indexes for table `siswa_data_pribadi`
--
ALTER TABLE `siswa_data_pribadi`
  ADD PRIMARY KEY (`nis`);

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

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

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

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for table `jadwal_mengajar`
--
ALTER TABLE `jadwal_mengajar`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

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

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

--
-- AUTO_INCREMENT for table `raport_arsip_pdf`
--
ALTER TABLE `raport_arsip_pdf`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `raport_isi`
--
ALTER TABLE `raport_isi`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

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

--
-- AUTO_INCREMENT for table `raport_template`
--
ALTER TABLE `raport_template`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `ruangan`
--
ALTER TABLE `ruangan`
  MODIFY `id_ruangan` int NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `elearning_aktivitas`
--
ALTER TABLE `elearning_aktivitas`
  ADD CONSTRAINT `elearning_aktivitas_ibfk_1` FOREIGN KEY (`nuptk_guru`) REFERENCES `guru` (`nuptk`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `elearning_balasan_diskusi`
--
ALTER TABLE `elearning_balasan_diskusi`
  ADD CONSTRAINT `elearning_balasan_diskusi_ibfk_1` FOREIGN KEY (`id_diskusi`) REFERENCES `elearning_diskusi` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `elearning_diskusi`
--
ALTER TABLE `elearning_diskusi`
  ADD CONSTRAINT `elearning_diskusi_ibfk_1` FOREIGN KEY (`id_pertemuan`) REFERENCES `elearning_pertemuan` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `elearning_jawaban_quiz`
--
ALTER TABLE `elearning_jawaban_quiz`
  ADD CONSTRAINT `elearning_jawaban_quiz_ibfk_1` FOREIGN KEY (`id_quiz`) REFERENCES `elearning_quiz` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `elearning_jawaban_quiz_ibfk_2` FOREIGN KEY (`nis_siswa`) REFERENCES `siswa` (`nis`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `elearning_modul`
--
ALTER TABLE `elearning_modul`
  ADD CONSTRAINT `elearning_modul_ibfk_1` FOREIGN KEY (`id_pertemuan`) REFERENCES `elearning_pertemuan` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `elearning_pertemuan`
--
ALTER TABLE `elearning_pertemuan`
  ADD CONSTRAINT `elearning_pertemuan_ibfk_1` FOREIGN KEY (`id_aktivitas`) REFERENCES `elearning_aktivitas` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `elearning_quiz`
--
ALTER TABLE `elearning_quiz`
  ADD CONSTRAINT `elearning_quiz_ibfk_1` FOREIGN KEY (`id_pertemuan`) REFERENCES `elearning_pertemuan` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `elearning_video`
--
ALTER TABLE `elearning_video`
  ADD CONSTRAINT `elearning_video_ibfk_1` FOREIGN KEY (`id_pertemuan`) REFERENCES `elearning_pertemuan` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `guru`
--
ALTER TABLE `guru`
  ADD CONSTRAINT `guru_ibfk_1` FOREIGN KEY (`nuptk`) REFERENCES `users` (`nuptk`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `info_galeri_item`
--
ALTER TABLE `info_galeri_item`
  ADD CONSTRAINT `info_galeri_item_ibfk_1` FOREIGN KEY (`id_album`) REFERENCES `info_galeri_album` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `inventaris_barang`
--
ALTER TABLE `inventaris_barang`
  ADD CONSTRAINT `inventaris_barang_ibfk_1` FOREIGN KEY (`id_ruangan`) REFERENCES `ruangan` (`id_ruangan`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `jadwal_mengajar`
--
ALTER TABLE `jadwal_mengajar`
  ADD CONSTRAINT `jadwal_mengajar_ibfk_1` FOREIGN KEY (`nuptk_guru`) REFERENCES `guru` (`nuptk`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `jadwal_mengajar_ibfk_2` FOREIGN KEY (`id_kelas`) REFERENCES `kelas` (`id_kelas`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `kelas`
--
ALTER TABLE `kelas`
  ADD CONSTRAINT `kelas_ibfk_1` FOREIGN KEY (`nuptk_wali_kelas`) REFERENCES `guru` (`nuptk`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `laporan_kerusakan`
--
ALTER TABLE `laporan_kerusakan`
  ADD CONSTRAINT `laporan_kerusakan_ibfk_1` FOREIGN KEY (`id_barang`) REFERENCES `inventaris_barang` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `perpus_peminjaman`
--
ALTER TABLE `perpus_peminjaman`
  ADD CONSTRAINT `perpus_peminjaman_ibfk_1` FOREIGN KEY (`nis_siswa`) REFERENCES `siswa` (`nis`) ON DELETE SET NULL,
  ADD CONSTRAINT `perpus_peminjaman_ibfk_2` FOREIGN KEY (`kode_buku`) REFERENCES `perpus_buku` (`kode_buku`) ON DELETE SET NULL;

--
-- Constraints for table `psb_wa_log`
--
ALTER TABLE `psb_wa_log`
  ADD CONSTRAINT `psb_wa_log_ibfk_1` FOREIGN KEY (`id_pendaftar`) REFERENCES `psb_pendaftar` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `raport_isi`
--
ALTER TABLE `raport_isi`
  ADD CONSTRAINT `raport_isi_ibfk_1` FOREIGN KEY (`nis_siswa`) REFERENCES `siswa` (`nis`) ON DELETE CASCADE,
  ADD CONSTRAINT `raport_isi_ibfk_2` FOREIGN KEY (`nuptk_guru`) REFERENCES `guru` (`nuptk`) ON DELETE CASCADE,
  ADD CONSTRAINT `raport_isi_ibfk_3` FOREIGN KEY (`id_template`) REFERENCES `raport_template` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `raport_kirim`
--
ALTER TABLE `raport_kirim`
  ADD CONSTRAINT `raport_kirim_ibfk_1` FOREIGN KEY (`id_template`) REFERENCES `raport_template` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `raport_kirim_ibfk_2` FOREIGN KEY (`nuptk_guru_tujuan`) REFERENCES `guru` (`nuptk`) ON DELETE SET NULL,
  ADD CONSTRAINT `raport_kirim_ibfk_3` FOREIGN KEY (`nis_siswa`) REFERENCES `siswa` (`nis`) ON DELETE SET NULL;

--
-- Constraints for table `siswa`
--
ALTER TABLE `siswa`
  ADD CONSTRAINT `siswa_ibfk_1` FOREIGN KEY (`nis`) REFERENCES `users` (`nis`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `siswa_ibfk_2` FOREIGN KEY (`id_kelas`) REFERENCES `kelas` (`id_kelas`) ON DELETE SET NULL ON UPDATE CASCADE;

--
-- Constraints for table `siswa_data_pribadi`
--
ALTER TABLE `siswa_data_pribadi`
  ADD CONSTRAINT `siswa_data_pribadi_ibfk_1` FOREIGN KEY (`nis`) REFERENCES `siswa` (`nis`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

