# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.5.5-10.4.14-MariaDB)
# Database: albanna
# Generation Time: 2020-11-15 06:09:45 +0000
# ************************************************************




# Dump of table jenis_tagihan
# ------------------------------------------------------------


CREATE TABLE `jenis_tagihan` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `jenis_tagihan` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `jenis_tagihan_user_id_foreign` (`user_id`),
  CONSTRAINT `jenis_tagihan_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `jenis_tagihan` (`id`, `jenis_tagihan`, `user_id`, `created_at`, `updated_at`)
VALUES
	(1,'SPP',NULL,NULL,NULL),
	(2,'PPDB',NULL,NULL,NULL),
	(3,'DUSL',NULL,NULL,NULL),
	(4,'Tunggakan',NULL,NULL,NULL);



# Dump of table jenis_tagihan_item
# ------------------------------------------------------------


CREATE TABLE `jenis_tagihan_item` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `jenis_tagihan_id` bigint(20) unsigned DEFAULT NULL,
  `nama_item` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `jenis_tagihan_item_jenis_tagihan_id_foreign` (`jenis_tagihan_id`),
  KEY `jenis_tagihan_item_user_id_foreign` (`user_id`),
  CONSTRAINT `jenis_tagihan_item_jenis_tagihan_id_foreign` FOREIGN KEY (`jenis_tagihan_id`) REFERENCES `jenis_tagihan` (`id`) ON DELETE CASCADE,
  CONSTRAINT `jenis_tagihan_item_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `jenis_tagihan_item` (`id`, `jenis_tagihan_id`, `nama_item`, `user_id`, `created_at`, `updated_at`)
VALUES
	(1,2,'Uang Gedung',NULL,NULL,NULL),
	(2,2,'Pendidikan',NULL,NULL,NULL);



# Dump of table kelas
# ------------------------------------------------------------


CREATE TABLE `kelas` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `nama_kelas` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kategori` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tahun_ajaran_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `kelas_tahun_ajaran_id_foreign` (`tahun_ajaran_id`),
  KEY `kelas_user_id_foreign` (`user_id`),
  CONSTRAINT `kelas_tahun_ajaran_id_foreign` FOREIGN KEY (`tahun_ajaran_id`) REFERENCES `tahun_ajaran` (`id`),
  CONSTRAINT `kelas_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `kelas` (`id`, `nama_kelas`, `kategori`, `tahun_ajaran_id`, `user_id`, `created_at`, `updated_at`)
VALUES
	(16,'Kelas 7','SMP',1,5,'2020-11-02 22:09:26','2020-11-02 22:09:26'),
	(22,'KB','Paud',1,5,'2020-11-14 12:39:42','2020-11-14 12:39:42'),
	(23,'A1','Paud',1,5,'2020-11-14 12:40:02','2020-11-14 12:40:02'),
	(24,'A2','Paud',1,5,'2020-11-14 12:40:16','2020-11-14 12:40:16'),
	(25,'B1','Paud',1,5,'2020-11-14 12:40:34','2020-11-14 12:40:34'),
	(26,'B2','Paud',1,5,'2020-11-14 12:40:47','2020-11-14 12:40:47'),
	(27,'B3','Paud',1,5,'2020-11-14 12:40:58','2020-11-14 12:40:58');



# Dump of table konfigurasi
# ------------------------------------------------------------


CREATE TABLE `konfigurasi` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `author` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `web_title` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metatitle` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metakey` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metades` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `logo` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `favicon` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `konfigurasi_user_id_foreign` (`user_id`),
  CONSTRAINT `konfigurasi_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `konfigurasi` (`id`, `author`, `web_title`, `metatitle`, `metakey`, `metades`, `logo`, `favicon`, `user_id`, `created_at`, `updated_at`)
VALUES
	(1,'http://starlabs.id','Albanna','Albanna','Albanna','Albanna','logo.png','favicon.jpg',5,NULL,'2020-11-05 04:26:57');



# Dump of table migrations
# ------------------------------------------------------------


CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `migrations` (`id`, `migration`, `batch`)
VALUES
	(1,'2013_09_02_075525_create_tahun_ajarans_table',1),
	(2,'2013_09_02_075651_create_kelas_table',1),
	(3,'2013_10_26_071051_create_siswas_table',1),
	(4,'2014_10_12_000000_create_users_table',1),
	(5,'2014_10_12_100000_create_password_resets_table',1),
	(6,'2020_10_26_065231_create_konfigurasis_table',1),
	(7,'2020_11_02_081145_create_tagihans_table',1),
	(8,'2020_11_02_082211_create_template_w_a_s_table',1),
	(9,'2020_11_02_082613_create_pesan_was_table',1),
	(10,'2020_11_04_042330_create_permission_tables',1),
	(11,'2020_11_04_113006_create_ortu_siswas_table',1),
	(12,'2020_11_07_023239_create_tagihan_details_table',1),
	(13,'2020_11_07_081629_create_pembayarans_table',1),
	(14,'2020_11_08_042209_create_jenis_tagihans_table',2),
	(15,'2020_11_08_042322_create_jenis_tagihan_items_table',2),
	(16,'2020_11_08_042913_create_siswa_cicilans_table',2);



# Dump of table model_has_permissions
# ------------------------------------------------------------


CREATE TABLE `model_has_permissions` (
  `permission_id` int(10) unsigned NOT NULL,
  `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`),
  CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table model_has_roles
# ------------------------------------------------------------


CREATE TABLE `model_has_roles` (
  `role_id` int(10) unsigned NOT NULL,
  `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `model_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`),
  CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE,
  CONSTRAINT `model_has_roles_user_id` FOREIGN KEY (`model_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `model_has_roles` (`role_id`, `model_type`, `model_id`)
VALUES
	(6,'App\\User',3),
	(7,'App\\User',5),
	(8,'App\\User',2),
	(9,'App\\User',1),
	(10,'App\\User',7),
	(11,'App\\User',8),
	(12,'App\\User',4),
	(13,'App\\User',6);



# Dump of table ortu_siswa
# ------------------------------------------------------------


CREATE TABLE `ortu_siswa` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `siswa_nis` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ortu_siswa_siswa_nis_foreign` (`siswa_nis`),
  KEY `ortu_siswa_user_id_foreign` (`user_id`),
  CONSTRAINT `ortu_siswa_siswa_nis_foreign` FOREIGN KEY (`siswa_nis`) REFERENCES `siswa` (`nis`) ON DELETE CASCADE,
  CONSTRAINT `ortu_siswa_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `ortu_siswa` (`id`, `siswa_nis`, `user_id`, `created_at`, `updated_at`)
VALUES
	(2,'20202020',6,'2020-11-04 23:11:51','2020-11-12 02:49:41');




# Dump of table pembayaran
# ------------------------------------------------------------


CREATE TABLE `pembayaran` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `idtransaksi` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `siswa_nis` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `tagihan_id` bigint(20) unsigned DEFAULT NULL,
  `tagihan_detail_id` bigint(20) unsigned DEFAULT NULL,
  `nominal_pembayaran` decimal(12,2) DEFAULT NULL,
  `keterangan` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pembayaran_siswa_nis_foreign` (`siswa_nis`),
  KEY `pembayaran_tagihan_id_foreign` (`tagihan_id`),
  KEY `pembayaran_tagihan_detail_id_foreign` (`tagihan_detail_id`),
  KEY `pembayaran_user_id_foreign` (`user_id`),
  CONSTRAINT `pembayaran_siswa_nis_foreign` FOREIGN KEY (`siswa_nis`) REFERENCES `siswa` (`nis`) ON DELETE CASCADE,
  CONSTRAINT `pembayaran_tagihan_detail_id_foreign` FOREIGN KEY (`tagihan_detail_id`) REFERENCES `tagihan_detail` (`id`),
  CONSTRAINT `pembayaran_tagihan_id_foreign` FOREIGN KEY (`tagihan_id`) REFERENCES `tagihan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `pembayaran` (`id`, `idtransaksi`, `siswa_nis`, `tagihan_id`, `tagihan_detail_id`, `nominal_pembayaran`, `keterangan`, `user_id`, `created_at`, `updated_at`)
VALUES
	(10,'20200001','20202020',29,NULL,2000000.00,'DUSL',5,'2020-11-14 13:50:29','2020-11-14 13:50:29'),
	(11,'20200002','20202020',30,76,720000.00,'Cicilan SPP Juli',5,'2020-11-15 06:04:28','2020-11-15 06:04:28'),
	(12,'20200003','20202020',30,77,720000.00,'Cicilan SPP Agustus',5,'2020-11-15 06:07:26','2020-11-15 06:07:26'),
	(13,'20200004','20202020',30,78,720000.00,'Cicilan SPP September',5,'2020-11-15 06:08:17','2020-11-15 06:08:17'),
	(14,'20200005','20202020',30,79,720000.00,'Cicilan SPP Oktober',5,'2020-11-15 06:08:31','2020-11-15 06:08:31');



# Dump of table permissions
# ------------------------------------------------------------


CREATE TABLE `permissions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `guard_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `permissions` (`id`, `name`, `guard_name`, `created_at`, `updated_at`)
VALUES
	(1,'user-list','web','2020-11-03 20:52:21','2020-11-03 22:04:23'),
	(2,'user-add','web','2020-11-03 20:54:03','2020-11-03 20:54:03'),
	(3,'user-update','web','2020-11-03 20:54:08','2020-11-03 22:03:43'),
	(4,'user-destroy','web','2020-11-03 20:54:25','2020-11-03 22:04:13'),
	(5,'kelas-list','web','2020-11-03 22:03:01','2020-11-03 22:03:01'),
	(6,'kelas-add','web','2020-11-03 22:03:07','2020-11-03 22:03:07'),
	(7,'kelas-update','web','2020-11-03 22:03:28','2020-11-03 22:03:28'),
	(8,'kelas-destroy','web','2020-11-03 22:03:37','2020-11-03 22:03:37'),
	(9,'tahunajaran-list','web','2020-11-03 22:04:43','2020-11-03 22:04:43'),
	(10,'tahunajaran-add','web','2020-11-03 22:04:47','2020-11-03 22:04:47'),
	(11,'tahunajaran-update','web','2020-11-03 22:04:55','2020-11-03 22:04:55'),
	(12,'tahunajaran-destroy','web','2020-11-03 22:05:00','2020-11-03 22:05:00'),
	(13,'siswa-list','web','2020-11-03 22:05:19','2020-11-03 22:05:19'),
	(14,'siswa-add','web','2020-11-03 22:05:23','2020-11-03 22:05:23'),
	(15,'siswa-update','web','2020-11-03 22:05:30','2020-11-03 22:05:30'),
	(16,'siswa-destroy','web','2020-11-03 22:05:48','2020-11-03 22:05:48'),
	(17,'role-list','web','2020-11-03 22:06:37','2020-11-03 22:06:37'),
	(18,'role-add','web','2020-11-03 22:06:43','2020-11-03 22:06:43'),
	(19,'role-update','web','2020-11-03 22:06:50','2020-11-03 22:06:50'),
	(20,'role-destroy','web','2020-11-03 22:06:55','2020-11-03 22:06:55'),
	(21,'permission-list','web','2020-11-03 22:07:10','2020-11-03 22:07:10'),
	(22,'permission-add','web','2020-11-03 22:07:14','2020-11-03 22:07:14'),
	(23,'permission-update','web','2020-11-03 22:07:18','2020-11-03 22:07:18'),
	(24,'permission-destroy','web','2020-11-03 22:07:32','2020-11-03 22:07:32'),
	(25,'konfigurasi-list','web','2020-11-03 22:08:20','2020-11-03 22:08:20'),
	(26,'konfigurasi-update','web','2020-11-03 22:08:26','2020-11-03 22:08:26'),
	(27,'tagihan-list','web','2020-11-03 22:09:31','2020-11-03 22:09:31'),
	(28,'tagihan-add','web','2020-11-03 22:09:34','2020-11-03 22:09:34'),
	(29,'tagihan-update','web','2020-11-03 22:09:38','2020-11-03 22:09:38'),
	(30,'tagihan-destroy','web','2020-11-03 22:09:43','2020-11-03 22:09:43'),
	(31,'pembayaran-list','web','2020-11-03 22:09:53','2020-11-03 22:09:53'),
	(32,'pembayaran-add','web','2020-11-03 22:09:56','2020-11-03 22:09:56'),
	(33,'pembayaran-update','web','2020-11-03 22:10:01','2020-11-03 22:10:01'),
	(34,'pembayaran-destroy','web','2020-11-03 22:10:07','2020-11-03 22:10:07'),
	(35,'templatewa-list','web','2020-11-04 06:01:43','2020-11-04 06:01:43'),
	(36,'templatewa-add','web','2020-11-04 06:01:49','2020-11-04 06:01:49'),
	(37,'templatewa-update','web','2020-11-04 06:01:55','2020-11-04 06:01:55'),
	(38,'templatewa-destroy','web','2020-11-04 06:02:03','2020-11-04 06:02:03'),
	(39,'historytransaksi-list','web','2020-11-04 23:06:57','2020-11-04 23:06:57'),
	(40,'tagihan-detail-list','web','2020-11-07 08:57:27','2020-11-07 08:57:27'),
	(41,'tagihan-detail-add','web','2020-11-07 08:57:32','2020-11-07 08:57:32'),
	(42,'tagihan-detail-update','web','2020-11-07 08:57:38','2020-11-07 08:57:38'),
	(43,'tagihan-detail-destroy','web','2020-11-07 08:57:49','2020-11-07 08:57:49'),
	(44,'tunggakan-list','web','2020-11-10 08:47:06','2020-11-10 08:47:06'),
	(45,'tunggakan-add','web','2020-11-10 08:47:10','2020-11-10 08:47:10'),
	(46,'tunggakan-update','web','2020-11-10 08:47:16','2020-11-10 08:47:16'),
	(47,'tunggakan-destroy','web','2020-11-10 08:47:22','2020-11-10 08:47:22');



# Dump of table pesan_wa
# ------------------------------------------------------------


CREATE TABLE `pesan_wa` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `no_wa` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kelas_id` bigint(20) unsigned DEFAULT NULL,
  `pesan` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `pesan_wa_kelas_id_foreign` (`kelas_id`),
  KEY `pesan_wa_user_id_foreign` (`user_id`),
  CONSTRAINT `pesan_wa_kelas_id_foreign` FOREIGN KEY (`kelas_id`) REFERENCES `kelas` (`id`),
  CONSTRAINT `pesan_wa_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table role_has_permissions
# ------------------------------------------------------------


CREATE TABLE `role_has_permissions` (
  `permission_id` int(10) unsigned NOT NULL,
  `role_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`role_id`),
  KEY `role_has_permissions_role_id_foreign` (`role_id`),
  CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `role_has_permissions` (`permission_id`, `role_id`)
VALUES
	(1,7),
	(2,7),
	(3,7),
	(4,7),
	(5,6),
	(5,7),
	(5,8),
	(6,7),
	(6,8),
	(7,7),
	(7,8),
	(8,7),
	(8,8),
	(9,6),
	(9,7),
	(9,8),
	(10,7),
	(10,8),
	(11,7),
	(11,8),
	(12,7),
	(12,8),
	(13,6),
	(13,7),
	(13,8),
	(14,7),
	(14,8),
	(15,7),
	(15,8),
	(16,7),
	(16,8),
	(17,7),
	(18,7),
	(19,7),
	(20,7),
	(21,7),
	(22,7),
	(23,7),
	(24,7),
	(25,7),
	(25,8),
	(26,7),
	(26,8),
	(27,6),
	(27,7),
	(27,8),
	(27,9),
	(27,10),
	(27,11),
	(27,12),
	(28,7),
	(28,8),
	(29,7),
	(29,8),
	(30,7),
	(30,8),
	(31,6),
	(31,7),
	(31,8),
	(31,9),
	(31,10),
	(31,11),
	(31,12),
	(32,7),
	(32,8),
	(33,7),
	(33,8),
	(34,7),
	(34,8),
	(35,6),
	(35,7),
	(35,8),
	(36,7),
	(36,8),
	(37,7),
	(37,8),
	(38,7),
	(38,8),
	(39,7),
	(39,8),
	(39,13),
	(40,6),
	(40,7),
	(40,8),
	(41,7),
	(41,8),
	(42,7),
	(42,8),
	(43,7),
	(43,8),
	(44,6),
	(44,7),
	(44,8),
	(45,7),
	(45,8),
	(46,7),
	(46,8),
	(47,7),
	(47,8);



# Dump of table roles
# ------------------------------------------------------------


CREATE TABLE `roles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `guard_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `roles` (`id`, `name`, `guard_name`, `created_at`, `updated_at`)
VALUES
	(6,'Pembina','web','2020-11-03 21:18:18','2020-11-03 21:18:18'),
	(7,'Superadmin','web','2020-11-03 21:28:06','2020-11-03 21:28:06'),
	(8,'Admin','web','2020-11-03 22:13:11','2020-11-03 22:13:11'),
	(9,'TU Paud','web','2020-11-03 22:14:27','2020-11-03 22:14:27'),
	(10,'TU SD','web','2020-11-03 22:14:45','2020-11-03 22:14:45'),
	(11,'TU SMP','web','2020-11-03 22:15:02','2020-11-03 22:15:02'),
	(12,'TU SMA','web','2020-11-03 22:15:09','2020-11-03 22:15:09'),
	(13,'Wali Murid','web','2020-11-04 23:07:17','2020-11-04 23:07:17');



# Dump of table siswa
# ------------------------------------------------------------


CREATE TABLE `siswa` (
  `nis` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `nama_siswa` varchar(70) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `no_telp_hp` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tahun_ajaran_id` bigint(20) unsigned DEFAULT NULL,
  `kelas_id` bigint(20) unsigned DEFAULT NULL,
  `foto_kesepakatan` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cicilan_spp` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `spp` decimal(12,2) DEFAULT NULL,
  `cicilan_ppdb` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ppdb` decimal(12,2) DEFAULT NULL,
  `cicilan_dusl` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dusl` decimal(12,2) DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`nis`),
  KEY `siswa_tahun_ajaran_id_foreign` (`tahun_ajaran_id`),
  KEY `siswa_kelas_id_foreign` (`kelas_id`),
  KEY `siswa_user_id_foreign` (`user_id`),
  CONSTRAINT `siswa_kelas_id_foreign` FOREIGN KEY (`kelas_id`) REFERENCES `kelas` (`id`),
  CONSTRAINT `siswa_tahun_ajaran_id_foreign` FOREIGN KEY (`tahun_ajaran_id`) REFERENCES `tahun_ajaran` (`id`),
  CONSTRAINT `siswa_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `siswa` (`nis`, `nama_siswa`, `no_telp_hp`, `tahun_ajaran_id`, `kelas_id`, `foto_kesepakatan`, `status`, `cicilan_spp`, `spp`, `cicilan_ppdb`, `ppdb`, `cicilan_dusl`, `dusl`, `user_id`, `created_at`, `updated_at`)
VALUES
	('20202020','Jalaluddin Rumi','081338639779',1,16,'20202020.jpg','Aktif','12',720000.00,'10',500000.00,NULL,2000000.00,5,'2020-11-02 21:14:08','2020-11-12 02:50:36');



# Dump of table siswa_kesepakatan
# ------------------------------------------------------------


CREATE TABLE `siswa_kesepakatan` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `siswa_nis` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cicilan` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `jatuh_tempo` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subsidi` decimal(12,2) DEFAULT NULL,
  `jenis_tagihan` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `jenis_tagihan_id` bigint(20) unsigned DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `siswa_kesepakatan_siswa_nis_foreign` (`siswa_nis`),
  KEY `siswa_kesepakatan_jenis_tagihan_id_foreign` (`jenis_tagihan_id`),
  KEY `siswa_kesepakatan_user_id_foreign` (`user_id`),
  CONSTRAINT `siswa_kesepakatan_jenis_tagihan_id_foreign` FOREIGN KEY (`jenis_tagihan_id`) REFERENCES `jenis_tagihan` (`id`) ON DELETE CASCADE,
  CONSTRAINT `siswa_kesepakatan_siswa_nis_foreign` FOREIGN KEY (`siswa_nis`) REFERENCES `siswa` (`nis`),
  CONSTRAINT `siswa_kesepakatan_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table tagihan
# ------------------------------------------------------------


CREATE TABLE `tagihan` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `siswa_nis` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `jenis_tagihan` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_tagihan` decimal(12,2) DEFAULT NULL,
  `total_bayar` decimal(12,2) DEFAULT NULL,
  `sisa_tagihan` decimal(12,2) DEFAULT NULL,
  `subsidi` decimal(12,2) DEFAULT 0.00,
  `jatuh_tempo` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tahun_ajaran_id` int(11) DEFAULT NULL,
  `kelas_id` int(11) DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tagihan_siswa_nis_foreign` (`siswa_nis`),
  KEY `tagihan_user_id_foreign` (`user_id`),
  CONSTRAINT `tagihan_ibfk_1` FOREIGN KEY (`siswa_nis`) REFERENCES `siswa` (`nis`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `tagihan` (`id`, `siswa_nis`, `jenis_tagihan`, `total_tagihan`, `total_bayar`, `sisa_tagihan`, `subsidi`, `jatuh_tempo`, `status`, `tahun_ajaran_id`, `kelas_id`, `user_id`, `created_at`, `updated_at`)
VALUES
	(29,'20202020','DUSL',2000000.00,2000000.00,0.00,0.00,NULL,'Lunas',1,16,5,'2020-11-14 13:29:26','2020-11-14 13:50:29'),
	(30,'20202020','SPP',8640000.00,2880000.00,5760000.00,0.00,NULL,'Belum Lunas',1,16,5,'2020-11-15 03:49:59','2020-11-15 06:08:31');



# Dump of table tagihan_detail
# ------------------------------------------------------------


CREATE TABLE `tagihan_detail` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tagihan_id` bigint(20) unsigned NOT NULL,
  `nama_item` varchar(70) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nominal_tagihan_detail` decimal(12,2) DEFAULT NULL,
  `nominal_bayar` decimal(12,2) DEFAULT NULL,
  `bulan` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tahun_ajaran_id` bigint(20) unsigned DEFAULT NULL,
  `status` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `jatuh_tempo` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tagihan_detail_tahun_ajaran_id_foreign` (`tahun_ajaran_id`),
  KEY `tagihan_detail_user_id_foreign` (`user_id`),
  KEY `tagihan_detail_tagihan_id_foreign` (`tagihan_id`),
  CONSTRAINT `tagihan_detail_tagihan_id_foreign` FOREIGN KEY (`tagihan_id`) REFERENCES `tagihan` (`id`) ON DELETE CASCADE,
  CONSTRAINT `tagihan_detail_tahun_ajaran_id_foreign` FOREIGN KEY (`tahun_ajaran_id`) REFERENCES `tahun_ajaran` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `tagihan_detail` (`id`, `tagihan_id`, `nama_item`, `nominal_tagihan_detail`, `nominal_bayar`, `bulan`, `tahun_ajaran_id`, `status`, `jatuh_tempo`, `user_id`, `created_at`, `updated_at`)
VALUES
	(76,30,'SPP',720000.00,720000.00,'Juli',1,'Lunas','2020-11-15',5,NULL,'2020-11-15 06:04:28'),
	(77,30,'SPP',720000.00,720000.00,'Agustus',1,'Lunas','2020-11-16',5,NULL,'2020-11-15 06:07:26'),
	(78,30,'SPP',720000.00,720000.00,'September',1,'Lunas','2020-11-15',5,NULL,'2020-11-15 06:08:17'),
	(79,30,'SPP',720000.00,720000.00,'Oktober',1,'Lunas','2020-11-15',5,NULL,'2020-11-15 06:08:31'),
	(80,30,'SPP',720000.00,NULL,'November',1,'Belum Lunas','2020-11-15',5,NULL,'2020-11-15 06:05:36'),
	(81,30,'SPP',720000.00,NULL,'Desember',1,'Belum Lunas','2020-11-15',5,NULL,'2020-11-15 06:05:50'),
	(82,30,'SPP',720000.00,NULL,'Januari',1,'Belum Lunas','2020-11-15',5,NULL,'2020-11-15 06:06:03'),
	(83,30,'SPP',720000.00,NULL,'Februari',1,'Belum Lunas','2020-11-15',5,NULL,'2020-11-15 06:06:21'),
	(84,30,'SPP',720000.00,NULL,'Maret',1,'Belum Lunas','2020-11-15',5,NULL,'2020-11-15 06:06:35'),
	(85,30,'SPP',720000.00,NULL,'April',1,'Belum Lunas','2020-11-15',5,NULL,'2020-11-15 06:06:46'),
	(86,30,'SPP',720000.00,NULL,'Mei',1,'Belum Lunas','2020-11-15',5,NULL,'2020-11-15 06:06:59'),
	(87,30,'SPP',720000.00,NULL,'Juni',1,'Belum Lunas','2020-11-15',5,NULL,'2020-11-15 06:07:15');



# Dump of table tahun_ajaran
# ------------------------------------------------------------


CREATE TABLE `tahun_ajaran` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `tahun_ajaran` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'Tidak Aktif',
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `tahun_ajaran` (`id`, `tahun_ajaran`, `status`, `user_id`, `created_at`, `updated_at`)
VALUES
	(1,'2020/2021','1',5,'2020-11-02 20:58:23','2020-11-14 08:17:32');



# Dump of table template_wa
# ------------------------------------------------------------


CREATE TABLE `template_wa` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `nama_template` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `template_text` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `template_wa_user_id_foreign` (`user_id`),
  CONSTRAINT `template_wa_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `template_wa` (`id`, `nama_template`, `template_text`, `user_id`, `created_at`, `updated_at`)
VALUES
	(1,'Template 1','Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.',5,'2020-11-04 06:13:41','2020-11-04 06:13:41'),
	(2,'Template 2','Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit...',5,'2020-11-04 06:14:12','2020-11-04 06:14:12');



# Dump of table tunggakan
# ------------------------------------------------------------


CREATE TABLE `tunggakan` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `siswa_nis` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT '',
  `total_tunggakan` decimal(12,2) DEFAULT NULL,
  `total_bayar` decimal(12,2) DEFAULT NULL,
  `sisa_tunggakan` decimal(12,2) DEFAULT NULL,
  `subsidi` decimal(12,2) DEFAULT 0.00,
  `jatuh_tempo` varchar(40) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tahun_ajaran_id` int(11) DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tagihan_siswa_nis_foreign` (`siswa_nis`),
  KEY `tagihan_user_id_foreign` (`user_id`),
  CONSTRAINT `tunggakan_ibfk_1` FOREIGN KEY (`siswa_nis`) REFERENCES `siswa` (`nis`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



