/*
SQLyog Ultimate v12.5.1 (64 bit)
MySQL - 10.4.28-MariaDB : Database - pt_gadai
*********************************************************************
*/



CREATE DATABASE /*!32312 IF NOT EXISTS*/`pt_gadai` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;

USE `pt_gadai`;

/*Table structure for table `alamat` */


CREATE TABLE `alamat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `k_prov` varchar(30) DEFAULT NULL,
  `provinsi` varchar(30) DEFAULT NULL,
  `kode` varchar(30) DEFAULT NULL,
  `k_dusun` varchar(30) DEFAULT NULL,
  `dusun` varchar(90) DEFAULT NULL,
  `k_rtrw` varchar(8) DEFAULT NULL,
  `rtrw` varchar(8) DEFAULT NULL,
  `k_desa` varchar(10) DEFAULT NULL,
  `desa` varchar(90) DEFAULT NULL,
  `k_kec` varchar(10) DEFAULT NULL,
  `kec` varchar(90) DEFAULT NULL,
  `k_kab` varchar(10) DEFAULT NULL,
  `kab` varchar(90) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

/*Data for the table `alamat` */

insert  into `alamat`(`id`,`k_prov`,`provinsi`,`kode`,`k_dusun`,`dusun`,`k_rtrw`,`rtrw`,`k_desa`,`desa`,`k_kec`,`kec`,`k_kab`,`kab`) values 
(1,'45','','45.03.02.045.04.03','','','','','','','','','',''),
(2,'34','JATIM','34.01.02.031.02.001','001','SIDOGIRI','02','01/02','031','SIDOGIRI','02','KRATON','01','PASURUAN'),
(3,'35','JATIN','35.02.02.032.02.01','01','RUKEM','02','sungikul','032','SUNGIKILONJ','02','POHJENTREK','02','PASURUAN');

/*Table structure for table `angsuran` */


CREATE TABLE `angsuran` (
  `no` int(11) NOT NULL AUTO_INCREMENT,
  `rekening` varchar(50) DEFAULT NULL,
  `no_bukti` varchar(50) DEFAULT NULL,
  `tgl` date DEFAULT NULL,
  `plafond` int(11) NOT NULL,
  `pokok` double NOT NULL,
  `margin` double NOT NULL,
  `keterangan` varchar(100) DEFAULT NULL,
  `username` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`no`)
) ENGINE=MyISAM AUTO_INCREMENT=43 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

/*Data for the table `angsuran` */

insert  into `angsuran`(`no`,`rekening`,`no_bukti`,`tgl`,`plafond`,`pokok`,`margin`,`keterangan`,`username`) values 
(0,'100.000001.01','PP100202310112039','2023-12-31',90000000,0,0,'yeeee','admin'),
(2,'100.000002.01','PP100202310112039','2023-09-02',50000000,0,0,NULL,NULL),
(3,'100.000002.01','AG100202310021046','2022-01-01',0,2000000,5000000,'tes','admin'),
(4,'100.000001.01','PP100202310112039','2022-01-16',0,10000000,0,NULL,'admin'),
(5,'100.000001.01','PP100202310112039','2022-01-01',90000000,0,0,NULL,'admin'),
(8,'100.000001.01','AG100202310200743','2023-10-20',0,2058823.53,700000,'yes203333','admin'),
(9,'100.000001.01','AG100202310200743','2023-10-20',0,2058823.53,700000,'yesss','admin'),
(10,'100.000001.01','AG100202310200744','2023-10-20',0,2058823.53,700000,'ye','admin'),
(11,'100.000002.01','AG100202310200745','2023-10-20',0,1470588.24,5000000,'yes','admin'),
(12,'100.000003.01','PP100202310112039','2022-01-01',90000000,0,0,NULL,'admin'),
(13,'100.000003.01','AG100202310200747','2023-10-20',0,1500000,3600000,'yee','admin'),
(14,'100.000001.02','PP100202310112039','2022-01-01',90000000,0,0,NULL,'admin'),
(15,'100.000001.02','AG100202310200748','2023-10-20',0,1275000,1020000,'msss','admin'),
(16,'100.000001.01','AG100202310201411','2023-10-20',0,2058823.53,700000,'Angsuran ke 1','admin'),
(17,'100.000001.01','AG100202310201413','2022-10-20',0,2058823.53,700000,'yes','admin'),
(40,'100.000001.01','AG100202310281441','2023-10-27',0,2647058.82,900000,'ye','admin'),
(39,'100.000001.01','AG100202310281441','2023-10-28',0,2647058.82,900000,'ye','admin'),
(41,'100.000001.02','PP100202401120335','2024-01-12',677,0,0,'y','admin'),
(42,'100.000001.03','PP100202401120423','2024-01-12',344,0,0,'yy','admin');

/*Table structure for table `bukubesar` */


CREATE TABLE `bukubesar` (
  `id_jurnal` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `no_bukti` varchar(50) NOT NULL DEFAULT '0',
  `tanggal` date DEFAULT NULL,
  `kode_akun` varchar(20) NOT NULL,
  `kode` varchar(3) NOT NULL,
  `keterangan` varchar(255) NOT NULL,
  `debet` double NOT NULL DEFAULT 0,
  `kredit` double NOT NULL DEFAULT 0,
  `username` varchar(255) NOT NULL,
  PRIMARY KEY (`id_jurnal`)
) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

/*Data for the table `bukubesar` */

insert  into `bukubesar`(`id_jurnal`,`no_bukti`,`tanggal`,`kode_akun`,`kode`,`keterangan`,`debet`,`kredit`,`username`) values 
(103,'KM100202310271831','2023-10-27','1.100.10','100','TESuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuyyyyyyyyyyyyyyyyy',100000000,0,'admin'),
(104,'KM100202310271831','2023-10-27','2.310.10','100','TESuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu',0,100000000,'admin'),
(105,'KK100202310271831','2023-10-27','1.145.10','100','YES',2000000,0,'admin'),
(106,'KK100202310271831','2023-10-27','1.100.10','100','YES',0,2000000,'admin'),
(107,'KK100202310271831','2023-10-27','1.105.10','100','YES',5000000,0,'admin'),
(108,'KK100202310271831','2023-10-27','1.100.10','100','YES',0,5000000,'admin'),
(109,'KK100202310271831','2023-10-27','1.160.10','100','YES',1000000,0,'admin'),
(110,'KK100202310271831','2023-10-27','1.100.10','100','YES',0,1000000,'admin'),
(111,'JR100202310271839','2023-10-27','1.100.10','100','yes',20000000,0,'admin'),
(112,'JR100202310271839','2023-10-27','2.230.10','100','yes',0,20000000,'admin'),
(113,'AG100202310281441','2023-10-28','1.100.10','100','ye',3547058.82,0,'admin'),
(114,'AG100202310281441','2023-10-28','1.120.10','100','ye',0,2647058.82,'admin'),
(115,'AG100202310281441','2023-10-28','4.410.04','100','ye',0,900000,'admin'),
(116,'AG100202310281441','2023-10-27','1.100.10','100','ye',3547058.82,0,'admin'),
(117,'AG100202310281441','2023-10-27','1.120.10','100','ye',0,2647058.82,'admin'),
(118,'AG100202310281441','2023-10-27','4.410.04','100','ye',0,900000,'admin'),
(119,'KK100202310281945','2023-10-28','5.520.01','100','gaji',1500000,0,'admin'),
(120,'KK100202310281945','2023-10-28','1.100.10','100','gaji',0,1500000,'admin'),
(121,'KM100202310282002','2023-10-28','1.100.10','100','yes',2000000,0,'admin'),
(122,'KM100202310282002','2023-10-28','4.400.01','100','yes',0,2000000,'admin'),
(123,'PP100202401120335','2024-01-12','1.120.10','100','y',677,0,'admin'),
(124,'PP100202401120335','2024-01-12','1.100.10','100','y',0,677,'admin'),
(125,'PP100202401120423','2024-01-12','1.120.10','100','yy',344,0,'admin'),
(126,'PP100202401120423','2024-01-12','1.100.10','100','yy',0,344,'admin');

/*Table structure for table `kantor` */


CREATE TABLE `kantor` (
  `kode` varchar(20) NOT NULL,
  `nama_kantor` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`kode`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

/*Data for the table `kantor` */

insert  into `kantor`(`kode`,`nama_kantor`) values 
('100','Kota'),
('101','Lojanan');

/*Table structure for table `kode_akun` */


CREATE TABLE `kode_akun` (
  `k_akun` varchar(20) NOT NULL,
  `n_akun` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`k_akun`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

/*Data for the table `kode_akun` */

insert  into `kode_akun`(`k_akun`,`n_akun`) values 
('1.100.10','KAS'),
('1.105.10','BANK'),
('1.120.10','PIUTANG'),
('1.130.10','PERALATAN'),
('1.145.10','TANAH'),
('1.150.10','BANGUNAN'),
('1.155.10','PNYU. BANGUNAN'),
('1.160.10','KENDARAAN'),
('1.165.10','PNYU. KENDARAAN'),
('1.170.10','INVENTARIS'),
('1.175.10','PENYU. INVENTARIS'),
('2.220.10','TABUNGAN'),
('2.230.10','DEPOSITO'),
('2.310.10','MODAL'),
('2.310.20','LABA DITAHAN'),
('2.320.60','LABA BERJALAN'),
('2.320.70','LABA THN LALU'),
('4.400.01','PENDAPATAN BANK'),
('4.400.02','PENDAPATAN TRANSFER'),
('4.400.03','PENDAPATAN PPOB'),
('4.410.04','PENDAPATAN GADAI'),
('4.420.01','PENDAPATAN NON OPERA'),
('5.500.10','BEBAN BAHAS TABUNGAN'),
('5.500.11','BEBAN BAHAS DEPOSITO'),
('5.500.12','BEBAN BAHAS TABUNGAN'),
('5.510.01','BEBAN ADMIN BANK'),
('5.520.01','BEBAN GAJI KARYAWAN'),
('5.520.02','BEBAN OPERASIONAL KA'),
('5.520.03','BEBAN LISTRIK'),
('5.520.04','BEBAN SPEEDY'),
('5.520.05','BEBAN PDAM'),
('5.520.06','BEBAN FEE IT'),
('5.520.07','BEBAN TRANSPORT'),
('5.520.08','BEBAN RAPAT'),
('5.520.09','BEBAN PROMOSI');

/*Table structure for table `pinjaman` */


CREATE TABLE `pinjaman` (
  `no` int(11) NOT NULL AUTO_INCREMENT,
  `register` varchar(50) DEFAULT NULL,
  `rekening` varchar(50) DEFAULT NULL,
  `no_bukti` varchar(50) DEFAULT NULL,
  `tgl` date DEFAULT NULL,
  `plafond` double DEFAULT NULL,
  `margin` varchar(100) DEFAULT NULL,
  `bakidebet` double DEFAULT NULL,
  `keterangan` varchar(100) DEFAULT NULL,
  `jangkawaktu` varchar(100) DEFAULT NULL,
  `jtempo` varchar(50) DEFAULT NULL,
  `jeniscair` varchar(100) DEFAULT NULL,
  `barang` varchar(100) DEFAULT NULL,
  `jaminan` varchar(100) DEFAULT NULL,
  `jenisbarang` varchar(100) DEFAULT NULL,
  `kelengkapan` varchar(100) DEFAULT NULL,
  `noseri` varchar(100) DEFAULT NULL,
  `kondisi` varchar(100) DEFAULT NULL,
  `flat` varchar(50) DEFAULT NULL,
  `username` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`no`)
) ENGINE=MyISAM AUTO_INCREMENT=28 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

/*Data for the table `pinjaman` */

insert  into `pinjaman`(`no`,`register`,`rekening`,`no_bukti`,`tgl`,`plafond`,`margin`,`bakidebet`,`keterangan`,`jangkawaktu`,`jtempo`,`jeniscair`,`barang`,`jaminan`,`jenisbarang`,`kelengkapan`,`noseri`,`kondisi`,`flat`,`username`) values 
(1,'100.000002','100.000002.01','PP100202310011523','2024-02-09',50000000,' 10',0,'ya','3','','B','BECAK','TV','Elektronik','UNIT CHAS KOTAK','NF4556','Bagus',NULL,'admin'),
(2,'100.000003','100.000003.01','PP100202310011524','2022-12-01',90000000,'4',88500000,'yes','4','','B','AVANSA','TV','Elektronik','UNIT CHAS KOTAK','NF4556','Bagus',NULL,'admin'),
(26,'100.000001','100.000001.02','PP100202401120335','2024-01-19',1000000000,'7',NULL,'y','3','','B','TAS','TV','Elektronik','UNIT KOTAK','655','',NULL,'admin'),
(27,'100.000001','100.000001.03','PP100202401120423','2024-01-12',344,'7',NULL,'yy','3','','B','','TV','Elektronik','UNIT KOTAK','er','',NULL,'admin');

/*Table structure for table `registrasi` */


CREATE TABLE `registrasi` (
  `no` int(11) NOT NULL AUTO_INCREMENT,
  `id` varchar(50) DEFAULT NULL,
  `nim` varchar(50) DEFAULT NULL,
  `nokk` varchar(50) DEFAULT NULL,
  `nik` varchar(50) DEFAULT NULL,
  `tgl` date DEFAULT NULL,
  `nama` varchar(250) DEFAULT NULL,
  `kelamin` varchar(20) DEFAULT NULL,
  `ttl` varchar(100) DEFAULT NULL,
  `tgll` date DEFAULT NULL,
  `angkatan` varchar(100) DEFAULT NULL,
  `statusmasuk` varchar(100) DEFAULT NULL,
  `masukkls` varchar(100) DEFAULT NULL,
  `nohp` varchar(100) DEFAULT NULL,
  `ayah` varchar(100) DEFAULT NULL,
  `ibu` varchar(100) DEFAULT NULL,
  `wali` varchar(100) DEFAULT NULL,
  `statusanak` varchar(100) DEFAULT NULL,
  `anakke` varchar(100) DEFAULT NULL,
  `kodepos` varchar(100) DEFAULT NULL,
  `alamat` varchar(50) DEFAULT NULL,
  `rtrw` varchar(7) DEFAULT NULL,
  `desa` varchar(20) DEFAULT NULL,
  `kec` varchar(20) DEFAULT NULL,
  `kab` varchar(20) DEFAULT NULL,
  `username` varchar(20) DEFAULT NULL,
  `foto` varchar(20) DEFAULT NULL,
  `kplmmu` varchar(50) DEFAULT NULL,
  `bayar` double DEFAULT 0,
  `tglmasehi` date DEFAULT NULL,
  PRIMARY KEY (`no`)
) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

/*Data for the table `registrasi` */

insert  into `registrasi`(`no`,`id`,`nim`,`nokk`,`nik`,`tgl`,`nama`,`kelamin`,`ttl`,`tgll`,`angkatan`,`statusmasuk`,`masukkls`,`nohp`,`ayah`,`ibu`,`wali`,`statusanak`,`anakke`,`kodepos`,`alamat`,`rtrw`,`desa`,`kec`,`kab`,`username`,`foto`,`kplmmu`,`bayar`,`tglmasehi`) values 
(2,'100.000001',NULL,NULL,'3526110509860001','2023-11-30','MUSLEHA','','BANGKALA','2023-12-31',NULL,NULL,NULL,'085648336734',NULL,'HJ SAUDAH','DAGANG',NULL,NULL,NULL,'BATUAMPAR','01/02','2009','01','01','admin',NULL,NULL,0,NULL),
(1,'100.000002',NULL,NULL,'3526110509860001','2023-07-23','UDI','','BANGKALA','2022-01-09',NULL,NULL,NULL,'085648336734',NULL,'MAWADDAH','DAPUR',NULL,NULL,NULL,'Talangan','001/004','2010','01','01','admin',NULL,NULL,0,NULL),
(3,'100.000003',NULL,NULL,'3526110509860001','2023-07-23','MUSLEH','','BANGKALA','2022-01-09',NULL,NULL,NULL,'085648336734',NULL,NULL,NULL,NULL,NULL,NULL,'Talangan','001/005','2011','01','01','admin',NULL,NULL,0,NULL);

/*Table structure for table `tb_akun` */


CREATE TABLE `tb_akun` (
  `kode_akun` varchar(20) NOT NULL,
  `nama_akun` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`kode_akun`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

/*Data for the table `tb_akun` */

insert  into `tb_akun`(`kode_akun`,`nama_akun`) values 
('1-111','Kas'),
('1-112','Piutang'),
('1-113','Persediaan'),
('1-211','Peralatan'),
('1-212','Tanah dan Bangunan'),
('2-111','Hutang Usaha'),
('3-111','Modal'),
('3-211','Prive'),
('4-111','Pendapatan'),
('5-111','Beban Gaji'),
('5-112','beban Operasional dan Lain - Lain');

/*Table structure for table `tb_index` */


CREATE TABLE `tb_index` (
  `id_index` varchar(20) NOT NULL,
  `keterangan` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`id_index`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

/*Data for the table `tb_index` */

insert  into `tb_index`(`id_index`,`keterangan`) values 
('0','Tidak Semua'),
('1','Arus Kas Kegiatan Operasi'),
('2','Arus Kas kegiatan Investasi'),
('3','Arus Kas Kegiatan Pendanaan');

/*Table structure for table `tb_kegiatan` */


CREATE TABLE `tb_kegiatan` (
  `id_kegiatan` int(11) NOT NULL AUTO_INCREMENT,
  `id_unit` int(11) NOT NULL,
  `nama_kegiatan` varchar(50) NOT NULL,
  PRIMARY KEY (`id_kegiatan`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

/*Data for the table `tb_kegiatan` */

insert  into `tb_kegiatan`(`id_kegiatan`,`id_unit`,`nama_kegiatan`) values 
(1,2,'Usaha Dewi 1'),
(2,2,'Usaha Dewi 2'),
(3,2,'Usaha Dewi 3'),
(4,3,'Usaha Taruna Tani');

/*Table structure for table `tb_unit` */


CREATE TABLE `tb_unit` (
  `id_unit` int(11) NOT NULL AUTO_INCREMENT,
  `nama_unit` varchar(30) DEFAULT NULL,
  `jenis_usaha` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id_unit`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

/*Data for the table `tb_unit` */

insert  into `tb_unit`(`id_unit`,`nama_unit`,`jenis_usaha`) values 
(1,'Kampung Flory','Jasa'),
(2,'Dewi Flory','Jasa'),
(3,'Taruna Tani','Jasa'),
(4,'Bali Ndeso Group','Jasa'),
(6,'Unit Batu Baru','Jasa baru');

/*Table structure for table `user` */


CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nama` varchar(100) NOT NULL,
  `jabatan` varchar(100) NOT NULL,
  `username` varchar(100) NOT NULL,
  `pasword` varchar(255) NOT NULL,
  `level` int(11) NOT NULL,
  `kode` varchar(4) DEFAULT '0',
  `kantor` varchar(50) DEFAULT '0',
  `kode_cab` varchar(50) DEFAULT '0',
  `pembuat` varchar(50) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

/*Data for the table `user` */

insert  into `user`(`id`,`nama`,`jabatan`,`username`,`pasword`,`level`,`kode`,`kantor`,`kode_cab`,`pembuat`) values 
(1,'Admin','Kadiv','admin','0cc175b9c0f1b6a831c399e269772661',0,'100','LOJANAN','100','0'),
(5,'MUSEH','Kepala','mumuz','fa46ec0b4924e8c2194a53ef61b94039',0,'101','KOTA','','100'),
(7,'UDIA','Kepala','udi','0cc175b9c0f1b6a831c399e269772661',0,'102','BONTANG','','admin');

