# ************************************************************
# Sequel Ace SQL dump
# Version 20099
#
# https://sequel-ace.com/
# https://github.com/Sequel-Ace/Sequel-Ace
#
# Host: 127.0.0.1 (MySQL 9.6.0)
# Database: nuralilm_db
# Generation Time: 2026-03-31 13:29:35 +0000
# ************************************************************




# Dump of table berita
# ------------------------------------------------------------


CREATE TABLE `berita` (
  `id` int NOT NULL AUTO_INCREMENT,
  `judul` varchar(255) NOT NULL,
  `penulis` varchar(255) DEFAULT NULL,
  `kategori` varchar(100) DEFAULT 'Umum',
  `konten` longtext,
  `gambar` text,
  `status` varchar(50) DEFAULT 'Draft',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `berita` (`id`, `judul`, `penulis`, `kategori`, `konten`, `gambar`, `status`, `created_at`)
VALUES
	(1,'hckjzc','dfgdfgdf','Umum','dfgdfgdfgdf','','Draft','2026-03-14 20:34:04'),
	(2,'jhvjvjjh','jhjvjhvjh','Umum','bjhbjbjh','','Publikasi','2026-03-14 20:57:55'),
	(3,'adasd','adad','Pendidikan','asdasd','','Publikasi','2026-03-30 21:12:32');



# Dump of table donasi
# ------------------------------------------------------------


CREATE TABLE `donasi` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nama` varchar(255) DEFAULT 'Anonim',
  `email` varchar(255) DEFAULT NULL,
  `nominal` int NOT NULL,
  `metode` varchar(100) DEFAULT NULL,
  `pesan` text,
  `status` varchar(50) DEFAULT 'Pending',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table galeri
# ------------------------------------------------------------


CREATE TABLE `galeri` (
  `id` int NOT NULL AUTO_INCREMENT,
  `judul` varchar(255) NOT NULL,
  `album` varchar(100) DEFAULT 'Umum',
  `url` text NOT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `status` varchar(50) DEFAULT 'Draft',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `galeri` (`id`, `judul`, `album`, `url`, `created_at`, `status`)
VALUES
	(1,'lks dikmen','Kajian','/uploads/1773676628199-i976idqp9l.webp','2026-03-16 22:57:08','Publikasi'),
	(2,'coba','Kajian','/uploads/1774879126507-uwz8q6ny4sb.webp','2026-03-30 20:58:46','Publikasi');



# Dump of table konsultasi
# ------------------------------------------------------------


CREATE TABLE `konsultasi` (
  `id` int NOT NULL AUTO_INCREMENT,
  `penanya` varchar(255) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `pertanyaan` text NOT NULL,
  `status` varchar(50) DEFAULT 'pending',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `rating` int DEFAULT NULL,
  `ulasan` text,
  `ustadz_id` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table konsultasi_reply
# ------------------------------------------------------------


CREATE TABLE `konsultasi_reply` (
  `id` int NOT NULL AUTO_INCREMENT,
  `konsultasi_id` int NOT NULL,
  `dari` varchar(50) DEFAULT 'admin',
  `nama` varchar(255) DEFAULT NULL,
  `teks` text NOT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `konsultasi_id` (`konsultasi_id`),
  CONSTRAINT `konsultasi_reply_ibfk_1` FOREIGN KEY (`konsultasi_id`) REFERENCES `konsultasi` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table logs
# ------------------------------------------------------------


CREATE TABLE `logs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `level` varchar(50) DEFAULT 'INFO',
  `msg` text NOT NULL,
  `user_id` int DEFAULT NULL,
  `ip` varchar(100) DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `logs` (`id`, `level`, `msg`, `user_id`, `ip`, `created_at`)
VALUES
	(120,'WARNING','Login gagal: admin@nuralim.id',NULL,'127.0.0.1','2026-03-30 19:19:52'),
	(121,'WARNING','Login gagal: admin@nuralim.id',NULL,'127.0.0.1','2026-03-30 19:47:49'),
	(122,'WARNING','Login gagal: admin@nuralim.id',NULL,'127.0.0.1','2026-03-30 19:48:02'),
	(123,'INFO','Login berhasil: admin@nuralilm.id',1,'127.0.0.1','2026-03-30 19:48:29'),
	(124,'INFO','Login berhasil: admin@nuralilm.id',1,'127.0.0.1','2026-03-30 19:57:05'),
	(125,'INFO','Login berhasil: admin@nuralilm.id',1,'127.0.0.1','2026-03-30 19:58:25'),
	(126,'INFO','Login berhasil: admin@nuralilm.id',1,'127.0.0.1','2026-03-30 19:58:41'),
	(127,'WARNING','Login gagal: admin@nuraliml.id',NULL,'127.0.0.1','2026-03-30 20:11:50'),
	(128,'INFO','Login berhasil: admin@nuralilm.id',1,'127.0.0.1','2026-03-30 20:12:02'),
	(129,'SUCCESS','Konsultasi #17 dijawab',1,'127.0.0.1','2026-03-30 20:12:25'),
	(130,'SUCCESS','Bulk delete konsultasi: 2 item',1,'127.0.0.1','2026-03-30 20:40:11'),
	(131,'INFO','Pengaturan diperbarui',1,'127.0.0.1','2026-03-30 20:48:46'),
	(132,'SUCCESS','Bulk delete konsultasi: 1 item',1,'127.0.0.1','2026-03-30 20:52:07'),
	(133,'SUCCESS','Risalah ditambahkan: jumat',1,'127.0.0.1','2026-03-30 20:52:36'),
	(134,'SUCCESS','Konsultasi #18 dijawab',1,'127.0.0.1','2026-03-30 20:53:49'),
	(135,'SUCCESS','Bulk delete konsultasi: 4 item',1,'127.0.0.1','2026-03-30 20:57:24'),
	(136,'SUCCESS','Bulk delete konsultasi: 4 item',1,'127.0.0.1','2026-03-30 20:57:32'),
	(137,'SUCCESS','Foto galeri ditambahkan: coba',1,'127.0.0.1','2026-03-30 20:58:46'),
	(138,'SUCCESS','Risalah ditambahkan: COBA',1,'127.0.0.1','2026-03-30 21:00:07'),
	(139,'SUCCESS','Materi diperbarui: jhvjvvjhvjh',1,'127.0.0.1','2026-03-30 21:03:30'),
	(140,'SUCCESS','Materi diperbarui: nknkjkjbkjb',1,'127.0.0.1','2026-03-30 21:03:31'),
	(141,'SUCCESS','Materi diperbarui: nknkjkjbkjb',1,'127.0.0.1','2026-03-30 21:03:33'),
	(142,'SUCCESS','Materi diperbarui: jhvjvvjhvjh',1,'127.0.0.1','2026-03-30 21:03:35'),
	(143,'SUCCESS','Risalah ditambahkan: coba',1,'127.0.0.1','2026-03-30 21:10:56'),
	(144,'SUCCESS','Risalah ditambahkan: cekcek',1,'127.0.0.1','2026-03-30 21:16:51'),
	(145,'SUCCESS','Materi ditambahkan: ceknewss',1,'127.0.0.1','2026-03-30 21:22:23'),
	(146,'INFO','Login berhasil: admin@nuralilm.id',1,'127.0.0.1','2026-03-30 22:11:45'),
	(147,'INFO','Pengaturan diperbarui',1,'127.0.0.1','2026-03-30 22:12:57'),
	(148,'INFO','Pengaturan diperbarui',1,'127.0.0.1','2026-03-30 22:15:43'),
	(149,'INFO','Pengaturan diperbarui',1,'127.0.0.1','2026-03-30 22:16:00'),
	(150,'INFO','Logo situs diperbarui',1,'127.0.0.1','2026-03-30 22:16:02'),
	(151,'INFO','Logo situs diperbarui',1,'127.0.0.1','2026-03-30 22:16:22'),
	(152,'INFO','Logo situs diperbarui',1,'127.0.0.1','2026-03-30 22:22:55'),
	(153,'INFO','Logo situs diperbarui',1,'127.0.0.1','2026-03-30 22:28:40'),
	(154,'INFO','Logo situs diperbarui',1,'127.0.0.1','2026-03-30 22:29:52'),
	(155,'INFO','Login berhasil: admin@nuralilm.id',1,'127.0.0.1','2026-03-30 22:30:18'),
	(156,'INFO','Login berhasil: admin@nuralilm.id',1,'127.0.0.1','2026-03-30 22:36:20'),
	(157,'SUCCESS','Materi diperbarui: ceknewss',1,'127.0.0.1','2026-03-31 00:46:13'),
	(158,'SUCCESS','Materi diperbarui: ceknewss',1,'127.0.0.1','2026-03-31 00:46:14'),
	(159,'SUCCESS','Materi diperbarui: ceknewss',1,'127.0.0.1','2026-03-31 00:46:20'),
	(160,'INFO','Login berhasil: admin@nuralilm.id',1,'127.0.0.1','2026-03-31 01:02:29');



# Dump of table materi
# ------------------------------------------------------------


CREATE TABLE `materi` (
  `id` int NOT NULL AUTO_INCREMENT,
  `judul` varchar(255) NOT NULL,
  `jenis` varchar(50) DEFAULT 'Tulisan',
  `kategori` varchar(100) DEFAULT NULL,
  `status` varchar(50) DEFAULT 'Draft',
  `excerpt` text,
  `konten` longtext,
  `url` text,
  `durasi` varchar(50) DEFAULT NULL,
  `gambar` text,
  `penulis_id` int DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `penulis_id` (`penulis_id`),
  CONSTRAINT `materi_ibfk_1` FOREIGN KEY (`penulis_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `materi` (`id`, `judul`, `jenis`, `kategori`, `status`, `excerpt`, `konten`, `url`, `durasi`, `gambar`, `penulis_id`, `created_at`, `updated_at`)
VALUES
	(1,'jhbbjbjk','Tulisan','Fiqih','Draft','hkk','jnkjnkjnj','','','',1,'2026-03-14 21:01:56','2026-03-14 21:01:56'),
	(2,'nknkjkjbkjb','Tulisan','Fiqih','Draft','jkkbkjbkbjkb','kjkhkjjbkjbjk','','','',1,'2026-03-14 21:06:38','2026-03-30 21:03:33'),
	(3,'jhvjvvjhvjh','Tulisan','Fiqih','Draft','hjjvjchgxhgxhg','hgjhffhgfhg','','','',1,'2026-03-14 21:26:18','2026-03-30 21:03:35'),
	(4,'gkgkjgkjkjhkhjk','Tulisan','Fiqih','Publikasi','jhvhvjhvjvjvjh','hhvhghgchgchgchg','','','/uploads/1773502187138-ygjw6er0hd8.jpeg',1,'2026-03-14 22:29:47','2026-03-16 23:00:28'),
	(5,'akjhahklalkakla','Tulisan','Fiqih','Publikasi','gfgohpjii','aoahjanalnak','','','/uploads/1773502231281-0umxvjfb03fk.jpg',1,'2026-03-14 22:30:31','2026-03-16 23:14:26'),
	(6,'pub1','Tulisan','Fiqih','Publikasi','ini draft','shgsghsuiiusiushus','','','',1,'2026-03-15 01:21:29','2026-03-16 23:35:22'),
	(8,'hijra','Tulisan','Fiqih','Publikasi','hijrah','hijra','','','',2,'2026-03-18 00:34:35','2026-03-18 00:34:35'),
	(9,'wqeqw','Tulisan','Fiqih','Publikasi','sadasdas','asdasd','','','',1,'2026-03-18 00:39:40','2026-03-18 00:39:40'),
	(10,'ceknewss','Video','Bahasa Arab','Publikasi','asdad','adasd','asda','12','',1,'2026-03-30 21:22:23','2026-03-31 00:46:14');



# Dump of table newsletter
# ------------------------------------------------------------


CREATE TABLE `newsletter` (
  `id` int NOT NULL AUTO_INCREMENT,
  `email` varchar(255) NOT NULL,
  `status` varchar(50) DEFAULT 'Aktif',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `newsletter` (`id`, `email`, `status`, `created_at`)
VALUES
	(1,'abdultenguw@gmail.com','Aktif','2026-03-17 00:09:06'),
	(4,'nandapro909@gmail.com','Aktif','2026-03-18 00:11:16'),
	(8,'openailks13@gmail.com','Aktif','2026-03-18 00:33:51'),
	(9,'test@example.com','Aktif','2026-03-18 00:38:54'),
	(10,'test@test.com','Aktif','2026-03-28 22:12:35');



# Dump of table otp_codes
# ------------------------------------------------------------


CREATE TABLE `otp_codes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `email` varchar(255) NOT NULL,
  `code` varchar(6) NOT NULL,
  `expires_at` datetime NOT NULL,
  `used` tinyint(1) DEFAULT '0',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_email` (`email`),
  KEY `idx_expires` (`expires_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `otp_codes` (`id`, `email`, `code`, `expires_at`, `used`, `created_at`)
VALUES
	(20,'abdultenguw@gmail.com','351097','2026-03-30 20:16:17',1,'2026-03-30 20:06:17');



# Dump of table program
# ------------------------------------------------------------


CREATE TABLE `program` (
  `id` int NOT NULL AUTO_INCREMENT,
  `nama` varchar(255) NOT NULL,
  `lokasi` varchar(255) DEFAULT NULL,
  `tanggal` date DEFAULT NULL,
  `waktu` varchar(100) DEFAULT NULL,
  `desc_text` text,
  `status` varchar(50) DEFAULT 'Upcoming',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `program` (`id`, `nama`, `lokasi`, `tanggal`, `waktu`, `desc_text`, `status`, `created_at`)
VALUES
	(1,'kegiatan a','kota','2026-03-15','00:57','kota','Ongoing','2026-03-16 23:56:53'),
	(2,'coba','coba','2026-03-29','09.00','coba','Ongoing','2026-03-30 20:57:57'),
	(3,'asdasda','asdasd','2026-03-30','08.00','asdasdasd','Upcoming','2026-03-30 21:13:10');



# Dump of table risalah
# ------------------------------------------------------------


CREATE TABLE `risalah` (
  `id` int NOT NULL AUTO_INCREMENT,
  `judul` varchar(255) NOT NULL,
  `khatib` varchar(255) DEFAULT NULL,
  `tanggal` date DEFAULT NULL,
  `excerpt` text,
  `konten` longtext,
  `pdf_url` text,
  `status` varchar(50) DEFAULT 'Draft',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `risalah` (`id`, `judul`, `khatib`, `tanggal`, `excerpt`, `konten`, `pdf_url`, `status`, `created_at`)
VALUES
	(1,'hjjhchchgchgc','hjhfjjh','2026-03-11','hgkjghdkkhjh','','','Publikasi','2026-03-14 21:28:55'),
	(2,'jumat','nando','2026-03-30','a','','','Publikasi','2026-03-30 20:52:36'),
	(3,'COBA','COBA','2026-03-30','COBA','','','Publikasi','2026-03-30 21:00:07'),
	(4,'coba','coba','2026-03-30','asas','','','Publikasi','2026-03-30 21:10:56'),
	(5,'cekcek','cekcek','2026-03-30','asdasd','','','Publikasi','2026-03-30 21:16:51');




