

CREATE TABLE `riwayat_backupdb` (
  `id_backup` int(11) NOT NULL AUTO_INCREMENT,
  `nama_db` text NOT NULL,
  `tanggal` date NOT NULL,
  PRIMARY KEY (`id_backup`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO riwayat_backupdb VALUES("38","citracak_rt_rw_net 2025-06-20.sql","2025-06-20");



CREATE TABLE `tb_kas` (
  `id_kas` int(11) NOT NULL AUTO_INCREMENT,
  `id_transaksi` int(11) DEFAULT NULL,
  `tgl_kas` date DEFAULT NULL,
  `keterangan` varchar(255) DEFAULT NULL,
  `penerimaan` int(11) DEFAULT NULL,
  `pengeluaran` int(11) DEFAULT NULL,
  `jenis_kas` varchar(15) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `id_tagihan` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_kas`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

INSERT INTO tb_kas VALUES("1","","2025-06-25","Pembayaran Internet AN.&nbspputra,&nbspPaket&nbsp5 Mbps","100000","","","","1");
INSERT INTO tb_kas VALUES("3","","2025-06-25","Pembayaran Internet AN.&nbspMARIANA RIRIK,&nbspPaket&nbsp5 Mbps","100000","","","","3");
INSERT INTO tb_kas VALUES("4","","2025-06-25","Pembayaran Internet AN.&nbspARISANDI ACHRI,&nbspPaket&nbsp5 Mbps","100000","","","","4");



CREATE TABLE `tb_kas2` (
  `id_kas` int(11) NOT NULL AUTO_INCREMENT,
  `id_transaksi` int(11) DEFAULT NULL,
  `tgl_kas` date DEFAULT NULL,
  `keterangan` varchar(255) DEFAULT NULL,
  `penerimaan` int(11) DEFAULT NULL,
  `pengeluaran` int(11) DEFAULT NULL,
  `jenis_kas` varchar(15) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `id_tagihan` int(11) DEFAULT NULL,
  `id_pelanggan` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_kas`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;




CREATE TABLE `tb_paket` (
  `id_paket` int(11) NOT NULL AUTO_INCREMENT,
  `nama_paket` varchar(255) NOT NULL,
  `harga` int(11) NOT NULL,
  `ppn` decimal(10,2) DEFAULT NULL,
  `id_pmikrotik` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id_paket`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

INSERT INTO tb_paket VALUES("24","5 Mbps","100000","0.00","");
INSERT INTO tb_paket VALUES("25","10 Mbps","160000","0.00","");
INSERT INTO tb_paket VALUES("26","20 Mbps","200000","","");
INSERT INTO tb_paket VALUES("27","30 Mbps","240000","","");
INSERT INTO tb_paket VALUES("28","50 Mbps","470000","","");



CREATE TABLE `tb_pelanggan` (
  `id_pelanggan` int(11) NOT NULL AUTO_INCREMENT,
  `kode_pelanggan` varchar(30) NOT NULL,
  `nik` varchar(18) DEFAULT NULL,
  `nama_pelanggan` varchar(255) NOT NULL,
  `alamat` varchar(255) NOT NULL,
  `no_telp` varchar(20) NOT NULL,
  `paket` int(11) NOT NULL,
  `ip_address` varchar(255) DEFAULT NULL,
  `tgl_pemasangan` datetime NOT NULL,
  `jatuh_tempo` datetime NOT NULL DEFAULT current_timestamp(),
  `location` varchar(255) DEFAULT NULL,
  `id_perangkat` varchar(11) DEFAULT NULL,
  `odp` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_pelanggan`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

INSERT INTO tb_pelanggan VALUES("2","WNG031001","","putra","asdas","08222341232","24","","2025-06-20 07:33:00","2025-07-25 11:06:50","","1","1");
INSERT INTO tb_pelanggan VALUES("3","WNG031003","123123123","ahmad","sadasd","082259532559","26","","2025-06-20 10:23:00","2025-07-20 10:23:00","","2","1");
INSERT INTO tb_pelanggan VALUES("4","WNG031004","","MARIANA RIRIK","JL. SUNGAI LIMBOTO LR.37A NO.5","081935697026","24","","2025-06-20 11:09:00","2025-09-20 12:20:25","","2","1");
INSERT INTO tb_pelanggan VALUES("5","WNG031005","","ARISANDI ACHRI","JL. TITANG NO.32","081524471588","24","","2025-06-20 11:12:00","2025-08-20 13:01:24","","2","1");



CREATE TABLE `tb_perangkat` (
  `id_perangkat` int(11) NOT NULL AUTO_INCREMENT,
  `nama_perangkat` text NOT NULL,
  PRIMARY KEY (`id_perangkat`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tb_perangkat VALUES("1","G665");
INSERT INTO tb_perangkat VALUES("2","GM220S");



CREATE TABLE `tb_profile` (
  `id_profile` int(11) NOT NULL AUTO_INCREMENT,
  `nama_sekolah` varchar(255) NOT NULL,
  `alamat` text NOT NULL,
  `telpon` varchar(20) NOT NULL,
  `website` varchar(100) NOT NULL,
  `kota` varchar(100) NOT NULL,
  `bendahara` varchar(100) NOT NULL,
  `nip` varchar(30) NOT NULL,
  `foto` varchar(255) NOT NULL,
  `ktu` varchar(255) NOT NULL,
  `nip_ktu` varchar(30) NOT NULL,
  PRIMARY KEY (`id_profile`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

INSERT INTO tb_profile VALUES("1","TAGIHAN INTERNET","Jl. Gunung Lokon No.14","021.090939","www.sekolah.com","Jakarta","Bejo Santoso","1968890993933434","default.png","ABDUL MUIS","343434343434");



CREATE TABLE `tb_tagihan` (
  `id_tagihan` int(11) NOT NULL AUTO_INCREMENT,
  `id_pelanggan` int(11) NOT NULL,
  `bulan_tahun` varchar(30) NOT NULL,
  `jml_bayar` int(11) NOT NULL,
  `terbayar` int(11) DEFAULT NULL,
  `tgl_bayar` date DEFAULT NULL,
  `status_bayar` int(11) DEFAULT NULL,
  `no_invoice` varchar(100) DEFAULT NULL,
  `blokir_status` int(11) DEFAULT NULL,
  `terkirim` enum('belum','terkirim') NOT NULL,
  `waktu_bayar` datetime DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_tagihan`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

INSERT INTO tb_tagihan VALUES("1","2","062025","100000","100000","2025-06-25","1","00001.BLR.MST.","","belum","2025-06-25 18:06:52","2");
INSERT INTO tb_tagihan VALUES("2","3","062025","200000","","","","","","belum","","");
INSERT INTO tb_tagihan VALUES("3","4","062025","100000","100000","2025-06-25","1","00003.BLR.MST.","","belum","2025-06-25 19:20:26","2");
INSERT INTO tb_tagihan VALUES("4","5","062025","100000","100000","2025-06-25","1","00004.BLR.MST.","","belum","2025-06-25 20:01:26","2");
INSERT INTO tb_tagihan VALUES("5","2","072025","100000","","","","","","belum","","");
INSERT INTO tb_tagihan VALUES("6","3","072025","200000","","","","","","belum","","");
INSERT INTO tb_tagihan VALUES("7","4","072025","100000","","","","","","belum","","");
INSERT INTO tb_tagihan VALUES("8","5","072025","100000","","","","","","belum","","");



CREATE TABLE `tb_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(100) NOT NULL,
  `nama_user` varchar(255) NOT NULL,
  `password` varchar(100) NOT NULL,
  `level` varchar(30) NOT NULL,
  `foto` varchar(255) NOT NULL,
  `id_pelanggan` int(11) DEFAULT NULL,
  `phone_number` varchar(15) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=130 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

INSERT INTO tb_user VALUES("2","admin","admin","$2@N%5&amp;t#M","admin","title.png","","123456778");
INSERT INTO tb_user VALUES("125","teknisi","teknisi","teknisi","user","default.png","","2132232");
INSERT INTO tb_user VALUES("126","17219755","putra","putraa","user","admin.png","2","");
INSERT INTO tb_user VALUES("127","asdasd","ahmad","asdas","user","admin.png","3","");
INSERT INTO tb_user VALUES("128","46487319","MARIANA RIRIK","1234","user","admin.png","4","");
INSERT INTO tb_user VALUES("129","44179782","ARISANDI ACHRI","1234","user","admin.png","5","");



CREATE TABLE `tbl_badmin` (
  `id_badmin` int(11) NOT NULL AUTO_INCREMENT,
  `harga` varchar(255) DEFAULT NULL,
  `status` enum('saya','pelanggan') NOT NULL,
  PRIMARY KEY (`id_badmin`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

INSERT INTO tbl_badmin VALUES("1","4000","pelanggan");



CREATE TABLE `tbl_blokir` (
  `id_blokir` int(11) NOT NULL AUTO_INCREMENT,
  `status_blokir` enum('aktif','tidakaktif') NOT NULL,
  `set_waktu` int(11) DEFAULT NULL,
  `set_waktu2` varchar(30) DEFAULT NULL,
  `pesan_blokir` text DEFAULT NULL,
  PRIMARY KEY (`id_blokir`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tbl_blokir VALUES("1","aktif","1","minutes","$nama : Untuk Mengambil Nama Pelanggan
$jatuh_tempo : Untuk Mengambil Tanggal Jatuh Tempo
$tagihan : Untuk Mengambil Harga 
$no_telp : Untuk Mengambil Nomor Telepon Pelanggan
$sekarang_format : Untuk Mendapatkan Waktu Sekarang");



CREATE TABLE `tbl_bukablokir` (
  `id_bukablokir` int(11) NOT NULL AUTO_INCREMENT,
  `pesan_bukablokir` text DEFAULT NULL,
  PRIMARY KEY (`id_bukablokir`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tbl_bukablokir VALUES("1","$nama : Untuk Mengambil Nama Pelanggan
$jatuh_tempo : Untuk Mengambil Tanggal Jatuh Tempo
$tagihan : Untuk Mengambil Harga 
$no_telp : Untuk Mengambil Nomor Telepon Pelanggan
$harinin : Untuk Mengambil Waktu dan Tanggal Hari Ini
");



CREATE TABLE `tbl_buktibayar` (
  `id_buktibayar` int(11) NOT NULL AUTO_INCREMENT,
  `id_rekening` int(11) NOT NULL,
  `id_pelanggan` int(11) NOT NULL,
  `id_tagihan` int(11) NOT NULL,
  `gambar` text NOT NULL,
  `keterangan` text NOT NULL,
  `tanggal_terima` datetime NOT NULL,
  PRIMARY KEY (`id_buktibayar`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;




CREATE TABLE `tbl_informasi` (
  `id_informasi` int(11) NOT NULL AUTO_INCREMENT,
  `judul_informasi` varchar(255) NOT NULL,
  `isi_informasi` text NOT NULL,
  PRIMARY KEY (`id_informasi`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;




CREATE TABLE `tbl_keluhan` (
  `id_keluhan` int(11) NOT NULL AUTO_INCREMENT,
  `id_pelanggan` int(11) NOT NULL,
  `judul_keluhan` varchar(50) NOT NULL,
  `nomor_tiket` varchar(255) NOT NULL,
  `isi_keluhan` text NOT NULL,
  `gambar` text NOT NULL,
  `masalah` text DEFAULT NULL,
  `no_wa` varchar(15) NOT NULL,
  `status_keluhan` enum('menunggu','proses','selesai','tidak merespon') NOT NULL,
  `tanggal` datetime NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_keluhan`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;




CREATE TABLE `tbl_mikrotik` (
  `id_mikrotik` int(11) NOT NULL AUTO_INCREMENT,
  `ip` varchar(255) NOT NULL,
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `port_mikrotik` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id_mikrotik`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tbl_mikrotik VALUES("1","103.36.70.1","admin","1$2%w3*eD@2!5M&?","8728");



CREATE TABLE `tbl_nomorphone` (
  `id_mynumber` int(11) NOT NULL AUTO_INCREMENT,
  `my_number` varchar(15) NOT NULL,
  `nama_pemilik` varchar(255) NOT NULL,
  PRIMARY KEY (`id_mynumber`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tbl_nomorphone VALUES("1","081627517083","PT. Citra Cakrawala Pratama");



CREATE TABLE `tbl_notif` (
  `id_notifikasi` int(11) NOT NULL AUTO_INCREMENT,
  `status_notifikasi` enum('aktif','tidakaktif') NOT NULL,
  `pesan_notifikasi` text NOT NULL,
  PRIMARY KEY (`id_notifikasi`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tbl_notif VALUES("1","aktif","$nama : Untuk Mengambil Nama Pelanggan
$jatuh_tempo : Untuk Mengambil Tanggal Jatuh Tempo
$tagihan : Untuk Mengambil Harga 
$no_telp : Untuk Mengambil Nomor Telepon Pelanggan");



CREATE TABLE `tbl_notifbayar` (
  `id_notifbayar` int(11) NOT NULL AUTO_INCREMENT,
  `pesan_bayar` text NOT NULL,
  PRIMARY KEY (`id_notifbayar`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tbl_notifbayar VALUES("1","$nama : Untuk Mengambil Nama Pelanggan
$jatuh_tempo : Untuk Mengambil Tanggal Jatuh Tempo
$tagihan : Untuk Mengambil Harga 
$no_telp : Untuk Mengambil Nomor Telepon Pelanggan
$harinin : Untuk Mengambil Waktu dan Tanggal Hari Ini
");



CREATE TABLE `tbl_npemasangan` (
  `id_npemasangan` int(11) NOT NULL AUTO_INCREMENT,
  `status_notif` enum('aktif','tidak') NOT NULL,
  `pesan_notif` text NOT NULL,
  PRIMARY KEY (`id_npemasangan`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tbl_npemasangan VALUES("1","aktif","$nama : Untuk Mengambil Nama Pelanggan
$alamat : Untuk Mengambil Alamat Pelanggan
$no_telp : Untuk Mengambil Nomor Telepon Pelanggan
$paket : Untuk Mengambil Paket Pilihan Pelanggan
$tgl_pemasangan : Untuk Mengambil Tanggal Pemasangan Pelanggan
                           ");



CREATE TABLE `tbl_odc` (
  `id_odc` int(11) NOT NULL AUTO_INCREMENT,
  `nama_odc` varchar(255) NOT NULL,
  `perangkat_odc` varchar(50) NOT NULL,
  `port_odc` varchar(30) NOT NULL,
  `location` text NOT NULL,
  PRIMARY KEY (`id_odc`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tbl_odc VALUES("1","GUNUNG LOKON","HIOSO","8","-5.146618, 119.424670");



CREATE TABLE `tbl_odp` (
  `id_odp` int(11) NOT NULL AUTO_INCREMENT,
  `nama_odp` varchar(255) NOT NULL,
  `port_odp` varchar(30) NOT NULL,
  `location` varchar(255) NOT NULL,
  `odc` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_odp`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tbl_odp VALUES("1","ODP GUNUNG LOKON","8","-5.144033, 119.423962","1");
INSERT INTO tbl_odp VALUES("2","ODP SUNGAI POSO LR79","8","","1");



CREATE TABLE `tbl_paketmikrotik` (
  `id_paketmikrotik` int(11) NOT NULL AUTO_INCREMENT,
  `status` enum('ya','tidak') NOT NULL,
  `ppn` enum('aktif','tidak') DEFAULT NULL,
  PRIMARY KEY (`id_paketmikrotik`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tbl_paketmikrotik VALUES("1","tidak","tidak");



CREATE TABLE `tbl_penggunamikrotik` (
  `id_penggunamikrotik` int(11) NOT NULL AUTO_INCREMENT,
  `status` enum('ya','tidak') NOT NULL,
  `addppsecret` enum('ya','tidak') NOT NULL,
  `ippelanggan` enum('statik','dynamic') NOT NULL,
  `mapping` enum('aktif','tidak') DEFAULT NULL,
  `ip_pool` enum('ya','tidak') DEFAULT NULL,
  PRIMARY KEY (`id_penggunamikrotik`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

INSERT INTO tbl_penggunamikrotik VALUES("1","tidak","tidak","dynamic","aktif","tidak");



CREATE TABLE `tbl_pengumuman` (
  `id_pengumuman` int(11) NOT NULL AUTO_INCREMENT,
  `isi_pengumuman` text NOT NULL,
  PRIMARY KEY (`id_pengumuman`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;




CREATE TABLE `tbl_pesan_siaran` (
  `id_pesan_siaran` int(11) NOT NULL AUTO_INCREMENT,
  `judul_pesan_siaran` varchar(255) NOT NULL,
  `isi_pesan` text NOT NULL,
  PRIMARY KEY (`id_pesan_siaran`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;




CREATE TABLE `tbl_pgate` (
  `id_pgat` int(11) NOT NULL AUTO_INCREMENT,
  `tclientkey` varchar(255) DEFAULT NULL,
  `tserverkey` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id_pgat`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

INSERT INTO tbl_pgate VALUES("1","Mid-client-iodx3MHG-lotBVp0","Mid-server-41BWm71OYozpdwJsMY6gZ0rD");



CREATE TABLE `tbl_rekening` (
  `id_rekening` int(11) NOT NULL AUTO_INCREMENT,
  `nama_bank` varchar(50) NOT NULL,
  `nomor_rekening` varchar(255) NOT NULL,
  `nama_rekening` varchar(255) NOT NULL,
  PRIMARY KEY (`id_rekening`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;




CREATE TABLE `tbl_token` (
  `id_token` int(11) NOT NULL AUTO_INCREMENT,
  `token` varchar(255) NOT NULL,
  PRIMARY KEY (`id_token`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;


