-- https://www.phpmyadmin.net/
--
-- Waktu pembuatan: 24 Des 2025 pada 16.44
-- Versi server: 10.4.32-MariaDB
-- Versi PHP: 8.0.30

START TRANSACTION;



--
-- Database: `mayabsen`
--

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

--
-- Struktur dari tabel `absensi`
--

CREATE TABLE `absensi` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `tanggal` date NOT NULL,
  `jam_masuk` time DEFAULT NULL,
  `jam_pulang` time DEFAULT NULL,
  `status` varchar(20) DEFAULT 'Hadir'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Struktur dari tabel `absensi_guru`
--

CREATE TABLE `absensi_guru` (
  `id` int(11) NOT NULL,
  `guru_id` int(11) NOT NULL,
  `tanggal` date NOT NULL,
  `jam_masuk` time DEFAULT NULL,
  `jam_pulang` time DEFAULT NULL,
  `status` enum('Hadir','Izin','Sakit','Alpha') NOT NULL DEFAULT 'Hadir'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data untuk tabel `absensi_guru`
--

INSERT INTO `absensi_guru` (`id`, `guru_id`, `tanggal`, `jam_masuk`, `jam_pulang`, `status`) VALUES
(5, 29, '2025-12-24', '10:17:40', '10:26:47', 'Hadir');

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

--
-- Struktur dari tabel `form_izin`
--

CREATE TABLE `form_izin` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `tanggal` date NOT NULL,
  `jenis` varchar(30) NOT NULL,
  `keterangan` text NOT NULL,
  `file_surat` varchar(255) DEFAULT NULL,
  `status` varchar(20) DEFAULT 'Menunggu'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data untuk tabel `form_izin`
--

INSERT INTO `form_izin` (`id`, `user_id`, `tanggal`, `jenis`, `keterangan`, `file_surat`, `status`) VALUES
(19, 72, '2025-12-24', 'Sakit', 'Sakit we teu kudu nyaho lah', 'izin_guru_1766546882_4249.jpg', 'Disetujui'),
(20, 70, '2025-12-24', 'Sakit', 'Sakit mah sakit weee', 'izin_1766547467_5459.jpg', 'Disetujui');

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

--
-- Struktur dari tabel `guru`
--

CREATE TABLE `guru` (
  `id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `nip` varchar(30) NOT NULL,
  `nama_lengkap` varchar(100) NOT NULL,
  `jenis_kelamin` enum('L','P') NOT NULL,
  `tempat_lahir` varchar(50) DEFAULT NULL,
  `tanggal_lahir` date DEFAULT NULL,
  `alamat` text DEFAULT NULL,
  `no_wa` varchar(20) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `mapel` varchar(100) DEFAULT NULL,
  `jabatan` varchar(50) DEFAULT NULL,
  `status` enum('Aktif','Nonaktif') DEFAULT 'Aktif',
  `gaji_pokok` decimal(12,2) DEFAULT 0.00,
  `tarif_per_hari` decimal(12,2) DEFAULT 0.00,
  `foto` varchar(255) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data untuk tabel `guru`
--

INSERT INTO `guru` (`id`, `user_id`, `nip`, `nama_lengkap`, `jenis_kelamin`, `tempat_lahir`, `tanggal_lahir`, `alamat`, `no_wa`, `email`, `mapel`, `jabatan`, `status`, `gaji_pokok`, `tarif_per_hari`, `foto`, `created_at`, `updated_at`) VALUES
(29, 72, '08775434567222', 'Hendriawan', 'L', 'Bogor Barat', '1987-01-01', 'Jalan Cisande', '089507350404', 'Hasanudin@gmail.com', 'Al-Qur’an Hadits', 'Guru', 'Aktif', 0.00, 0.00, 'guru_29.png', '2025-12-24 03:01:08', '2025-12-24 03:11:11');

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

--
-- Struktur dari tabel `jadwal_kelas`
--

CREATE TABLE `jadwal_kelas` (
  `id` int(11) NOT NULL,
  `kelas` varchar(20) DEFAULT NULL,
  `hari` varchar(20) DEFAULT NULL,
  `jam_mulai` time DEFAULT NULL,
  `jam_selesai` time DEFAULT NULL,
  `mapel` varchar(100) DEFAULT NULL,
  `guru` varchar(100) DEFAULT NULL,
  `ruang` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data untuk tabel `jadwal_kelas`
--

INSERT INTO `jadwal_kelas` (`id`, `kelas`, `hari`, `jam_mulai`, `jam_selesai`, `mapel`, `guru`, `ruang`) VALUES
(18, 'X IPA', 'Senin', '08:00:00', '09:00:00', 'Al-Qur’an Hadits', 'Drs. Ahmad Fauzi, M.Pd', 'X IPA'),
(19, 'XI IPA', 'Senin', '09:00:00', '10:00:00', 'Al-Qur’an Hadits', 'Drs. Ahmad Fauzi, M.Pd', 'XI IPA'),
(20, 'XII IPA', 'Senin', '09:00:00', '10:00:00', 'Al-Qur’an Hadits', 'Drs. Ahmad Fauzi, M.Pd', 'XII IPA'),
(21, 'X IPA', 'Senin', '09:00:00', '10:00:00', 'Akidah Akhlak', 'Nur Azizah Alfiani A J, S.Kom., M.Pd.', 'X IPA'),
(22, 'XI IPA', 'Senin', '10:00:00', '11:00:00', 'Akidah Akhlak', 'Nur Azizah Alfiani A J, S.Kom., M.Pd.', 'XI IPA'),
(23, 'X IPA', 'Senin', '10:00:00', '11:00:00', 'Fiqih', 'Siti Rahmawati, S.Pd', 'X IPA'),
(24, 'X IPA', 'Senin', '13:00:00', '14:00:00', 'SKI', 'Budi Santoso, S.Pd, M.Pd', 'X IPA'),
(25, 'XI IPA', 'Senin', '08:00:00', '09:00:00', 'SKI', 'Budi Santoso, S.Pd, M.Pd', 'XI IPA'),
(26, 'XI IPA', 'Senin', '13:00:00', '14:00:00', 'Fiqih', 'Siti Rahmawati, S.Pd', 'XI IPA'),
(28, 'XII IPA', 'Senin', '10:00:00', '11:00:00', 'SKI', 'Budi Santoso, S.Pd, M.Pd', 'XII IPA'),
(29, 'XII IPA', 'Senin', '08:00:00', '09:00:00', 'Fiqih', 'Siti Rahmawati, S.Pd', 'XII IPA'),
(30, 'XII IPA', 'Senin', '13:00:00', '14:00:00', 'Akidah Akhlak', 'Nur Azizah Alfiani A J, S.Kom., M.Pd.', 'XII IPA');

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

--
-- Struktur dari tabel `siswa`
--

CREATE TABLE `siswa` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `nisn` varchar(50) NOT NULL,
  `nama_lengkap` varchar(255) NOT NULL,
  `kelas` enum('X IPA','X IPA','XI IPA','XI IPS','XII IPA','XII IPS') NOT NULL,
  `alamat` text NOT NULL,
  `tempat_lahir` varchar(100) NOT NULL,
  `tanggal_lahir` date NOT NULL,
  `no_wa` varchar(20) NOT NULL,
  `email` varchar(100) NOT NULL,
  `foto` varchar(255) DEFAULT NULL,
  `nama_ayah` varchar(255) NOT NULL,
  `nama_ibu` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data untuk tabel `siswa`
--

INSERT INTO `siswa` (`id`, `user_id`, `nisn`, `nama_lengkap`, `kelas`, `alamat`, `tempat_lahir`, `tanggal_lahir`, `no_wa`, `email`, `foto`, `nama_ayah`, `nama_ibu`) VALUES
(91, 70, '25090806', 'Nur Azizah Alfiani Azzahrotul Jannah', 'X IPA', 'Jalan Cicantayan', 'Sukabumi', '2006-08-09', '081286659195', 'alfiani@gmail.com', 'siswa_70.jpeg', 'Ujang Suryana', 'Ifah Hanifah'),
(92, 78, '0067811006', 'Dinda Safitri', 'X IPA', 'Jl. Flamboyan No.6', 'Bandung', '2008-06-18', '081234561006', 'dinda@gmail.com', NULL, 'Agus', 'Lina'),
(93, 79, '0067811007', 'Aulia Rahman', 'X IPA', 'Jl. Cempaka No.7', 'Garut', '2008-07-09', '081234561007', 'aulia@gmail.com', NULL, 'Rahmat', 'Sulastri'),
(94, 80, '0067811008', 'Nabila Putri', '', 'Jl. Teratai No.8', 'Tasikmalaya', '2008-08-14', '081234561008', 'nabila@gmail.com', NULL, 'Fahmi', 'Nurul'),
(95, 81, '0067811009', 'Rizal Pratama', 'X IPA', 'Jl. Mawar No.9', 'Cimahi', '2008-09-03', '081234561009', 'rizal@gmail.com', NULL, 'Yusuf', 'Rina'),
(96, 82, '0067811010', 'Salsa Amelia', '', 'Jl. Angkasa No.10', 'Cianjur', '2008-10-21', '081234561010', 'salsa@gmail.com', NULL, 'Bambang', 'Sri'),
(97, 83, '0067811011', 'Ilham Akbar', 'X IPA', 'Jl. Pahlawan No.11', 'Bandung', '2008-11-02', '081234561011', 'ilham@gmail.com', NULL, 'Akbar', 'Dewi'),
(98, 84, '0067811012', 'Putri Anjani', 'X IPA', 'Jl. Veteran No.12', 'Garut', '2008-12-19', '081234561012', 'anjani@gmail.com', NULL, 'Hadi', 'Ratna'),
(99, 85, '0067811013', 'Arif Setiawan', 'XII IPA', 'Jl. Merdeka No.13', 'Tasikmalaya', '2008-01-27', '081234561013', 'arif@gmail.com', NULL, 'Setyo', 'Indah'),
(100, 86, '0067811014', 'Lia Ramadhani', 'X IPA', 'Jl. Sukarasa No.14', 'Bandung', '2008-02-06', '081234561014', 'lia@gmail.com', NULL, 'Rahman', 'Siti'),
(101, 87, '0067811015', 'Bagus Firmansyah', 'X IPA', 'Jl. Sukamulya No.15', 'Sumedang', '2008-03-17', '081234561015', 'bagus@gmail.com', NULL, 'Firman', 'Yulia'),
(102, 88, '0067811016', 'Aisyah Zahra', 'XI IPS', 'Jl. Sudirman No.16', 'Ciamis', '2008-04-29', '081234561016', 'zahra@gmail.com', NULL, 'Zainal', 'Maryam'),
(103, 89, '0067811017', 'Dewi Lestari', 'X IPA', 'Jl. Ahmad Yani No.17', 'Bandung', '2008-05-05', '081234561017', 'dewi@gmail.com', NULL, 'Samsul', 'Rini'),
(104, 90, '0067811018', 'Hendra Gunawan', 'X IPA', 'Jl. Kopo No.18', 'Cimahi', '2008-06-11', '081234561018', 'hendra@gmail.com', NULL, 'Gunawan', 'Lilis'),
(105, 91, '0067811019', 'Fitri Handayani', '', 'Jl. Siliwangi No.19', 'Garut', '2008-07-24', '081234561019', 'fitri@gmail.com', NULL, 'Hendro', 'Wati'),
(106, 92, '0067811020', 'Rafi Nugraha', 'X IPA', 'Jl. Braga No.20', 'Bandung', '2008-08-01', '081234561020', 'rafi@gmail.com', NULL, 'Nugroho', 'Ani'),
(107, 93, '0067811021', 'Intan Permata', '', 'Jl. Asia Afrika No.21', 'Bandung', '2008-09-15', '081234561021', 'intan@gmail.com', NULL, 'Permadi', 'Sari'),
(108, 94, '0067811022', 'Fikri Ramadhan', 'X IPA', 'Jl. Cibaduyut No.22', 'Bandung', '2008-10-08', '081234561022', 'fikri@gmail.com', NULL, 'Rahmat', 'Ningsih'),
(109, 95, '0067811023', 'Siti Aulia', 'X IPA', 'Jl. Cikutra No.23', 'Sumedang', '2008-11-13', '081234561023', 'aulia23@gmail.com', NULL, 'Ali', 'Fatimah'),
(110, 96, '0067811024', 'Yoga Prakoso', '', 'Jl. Setiabudi No.24', 'Bandung', '2008-12-03', '081234561024', 'yoga@gmail.com', NULL, 'Prakoso', 'Yanti'),
(111, 97, '0067811025', 'Mila Septiani', 'X IPA', 'Jl. Pasteur No.25', 'Bandung', '2008-01-19', '081234561025', 'mila@gmail.com', NULL, 'Sutrisno', 'Septi'),
(112, 98, '0067811026', 'Rangga Aditya', 'X IPA', 'Jl. Tubagus Ismail No.26', 'Bandung', '2008-02-28', '081234561026', 'rangga@gmail.com', NULL, 'Aditya', 'Mega'),
(113, 99, '0067811027', 'Salsabila', '', 'Jl. Gegerkalong No.27', 'Bandung', '2008-03-07', '081234561027', 'salsa27@gmail.com', NULL, 'Abdul', 'Salma'),
(114, 100, '0067811028', 'Dion Pramana', 'X IPA', 'Jl. Cijerah No.28', 'Bandung', '2008-04-16', '081234561028', 'dion@gmail.com', NULL, 'Pramana', 'Yuli'),
(115, 101, '0067811029', 'Nina Kurnia', 'X IPA', 'Jl. Antapani No.29', 'Bandung', '2008-05-25', '081234561029', 'nina@gmail.com', NULL, 'Kurniawan', 'Ningsih'),
(116, 102, '0067811030', 'Alif Maulana', 'XI IPS', 'Jl. Cipadung No.30', 'Bandung', '2008-06-04', '081234561030', 'alif@gmail.com', NULL, 'Maulana', 'Aisyah'),
(117, 103, '0067811031', 'Tiara Putri', 'X IPA', 'Jl. Rancaekek No.31', 'Bandung', '2008-07-12', '081234561031', 'tiara@gmail.com', NULL, 'Putra', 'Lestari'),
(118, 104, '0067811032', 'Farhan Hakim', 'X IPA', 'Jl. Buah Batu No.32', 'Bandung', '2008-08-20', '081234561032', 'farhan@gmail.com', NULL, 'Hakim', 'Rahma'),
(119, 105, '0067811033', 'Sinta Maharani', '', 'Jl. Cibiru No.33', 'Bandung', '2008-09-30', '081234561033', 'sinta@gmail.com', NULL, 'Maman', 'Rohani'),
(120, 106, '0067811034', 'Bayu Saputra', 'X IPA', 'Jl. Arcamanik No.34', 'Bandung', '2008-10-10', '081234561034', 'bayu@gmail.com', NULL, 'Sapto', 'Sari'),
(121, 107, '0067811035', 'Lutfi Ramadhan', 'X IPA', 'Jl. Kiaracondong No.35', 'Bandung', '2008-11-18', '081234561035', 'lutfi@gmail.com', NULL, 'Ramli', 'Sukma'),
(122, 108, '0067811036', 'Anisa Rahmawati', 'XI IPS', 'Jl. Ujungberung No.36', 'Bandung', '2008-12-27', '081234561036', 'anisa@gmail.com', NULL, 'Wawan', 'Rahmi'),
(123, 109, '0067811037', 'Kevin Alvaro', 'X IPA', 'Jl. Cisaranten No.37', 'Bandung', '2008-01-08', '081234561037', 'kevin@gmail.com', NULL, 'Alvaro', 'Lina'),
(124, 110, '0067811038', 'Fina Lathifah', 'X IPA', 'Jl. Cinambo No.38', 'Bandung', '2008-02-14', '081234561038', 'fina@gmail.com', NULL, 'Latif', 'Hasna'),
(125, 111, '0067811039', 'Iqbal Fauzi', '', 'Jl. Mandalajati No.39', 'Bandung', '2008-03-22', '081234561039', 'iqbal@gmail.com', NULL, 'Fauzan', 'Yuliana'),
(126, 112, '0067811040', 'Rani Oktaviani', 'X IPA', 'Jl. Cicaheum No.40', 'Bandung', '2008-04-06', '081234561040', 'rani@gmail.com', NULL, 'Oka', 'Vina'),
(127, 113, '0067811041', 'Syahrul Hidayat', 'X IPA', 'Jl. Sukajadi No.41', 'Bandung', '2008-05-11', '081234561041', 'syahrul@gmail.com', NULL, 'Hidayat', 'Khadijah'),
(128, 114, '0067811042', 'Amelia Nur', 'XII IPA', 'Jl. Sarijadi No.42', 'Bandung', '2008-06-23', '081234561042', 'amelia@gmail.com', NULL, 'Nurhadi', 'Aminah'),
(129, 115, '0067811043', 'Rizky Kurniawan', 'X IPA', 'Jl. Ledeng No.43', 'Bandung', '2008-07-31', '081234561043', 'rizky43@gmail.com', NULL, 'Kurnia', 'Dewi'),
(130, 116, '0067811044', 'Putra Wibowo', 'X IPA', 'Jl. Ciumbuleuit No.44', 'Bandung', '2008-08-09', '081234561044', 'putra@gmail.com', NULL, 'Wibowo', 'Rahayu'),
(131, 117, '0067811045', 'Nadzira Zahra', '', 'Jl. Dago No.45', 'Bandung', '2008-09-18', '081234561045', 'nadzira@gmail.com', NULL, 'Zaki', 'Nur'),
(132, 118, '0067811046', 'Andi Prasetyo', 'X IPA', 'Jl. Dipatiukur No.46', 'Bandung', '2008-10-26', '081234561046', 'andi@gmail.com', NULL, 'Prasetyo', 'Lestari'),
(133, 119, '0067811047', 'Salma Nurazizah', 'X IPA', 'Jl. Tamansari No.47', 'Bandung', '2008-11-07', '081234561047', 'salma@gmail.com', NULL, 'Aziz', 'Maryati'),
(134, 120, '0067811048', 'Reza Firmansyah', '', 'Jl. Pasir Kaliki No.48', 'Bandung', '2008-12-15', '081234561048', 'reza@gmail.com', NULL, 'Firman', 'Reni'),
(135, 121, '0067811049', 'Citra Dewanti', 'X IPA', 'Jl. Kebon Kawung No.49', 'Bandung', '2008-01-26', '081234561049', 'citra@gmail.com', NULL, 'Dewan', 'Tanti'),
(136, 122, '0067811050', 'Fauzi Rahmat', 'X IPA', 'Jl. Cicendo No.50', 'Bandung', '2008-02-04', '081234561050', 'fauzi@gmail.com', NULL, 'Rahmat', 'Halimah'),
(137, 123, '0829635457', 'Ismatul Laila', 'X IPA', 'Jalan Pasir Eurih', 'Sukabumi', '2015-06-07', '081286659194', 'isma@gmail.com', NULL, 'Ujang Suryana', 'Ifah Hanifah');

--
-- Indexes for dumped tables
--

--
-- Indeks untuk tabel `absensi_guru`
--
ALTER TABLE `absensi_guru`
  ADD PRIMARY KEY (`id`),
  ADD KEY `guru_id` (`guru_id`);

--
-- Indeks untuk tabel `form_izin`
--
ALTER TABLE `form_izin`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `guru`
--
ALTER TABLE `guru`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `nip` (`nip`),
  ADD UNIQUE KEY `user_id` (`user_id`);

--
-- Indeks untuk tabel `jadwal_kelas`
--
ALTER TABLE `jadwal_kelas`
  ADD PRIMARY KEY (`id`);

--
-- Indeks untuk tabel `siswa`
--
ALTER TABLE `siswa`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `nisn` (`nisn`),
  ADD KEY `fk_siswa_userid` (`user_id`);

--
-- AUTO_INCREMENT untuk tabel yang dibuang
--

--
-- AUTO_INCREMENT untuk tabel `absensi_guru`
--
ALTER TABLE `absensi_guru`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT untuk tabel `form_izin`
--
ALTER TABLE `form_izin`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT untuk tabel `guru`
--
ALTER TABLE `guru`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT untuk tabel `jadwal_kelas`
--
ALTER TABLE `jadwal_kelas`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;

--
-- AUTO_INCREMENT untuk tabel `siswa`
--
ALTER TABLE `siswa`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=138;

--
-- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
--

--
-- Ketidakleluasaan untuk tabel `absensi_guru`
--
ALTER TABLE `absensi_guru`
  ADD CONSTRAINT `absensi_guru_ibfk_1` FOREIGN KEY (`guru_id`) REFERENCES `guru` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Ketidakleluasaan untuk tabel `siswa`
--
ALTER TABLE `siswa`
  ADD CONSTRAINT `fk_siswa_userid` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

