SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';

DROP TABLE IF EXISTS `account`;
CREATE TABLE `account` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `parent_id` int(11) NOT NULL DEFAULT 0,
  `code` varchar(10) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `remark` varchar(100) DEFAULT NULL,
  `descr` varchar(100) DEFAULT NULL,
  `lev1` varchar(16) DEFAULT NULL,
  `lev2` varchar(16) DEFAULT NULL,
  `cname` varchar(16) DEFAULT NULL,
  `min` varchar(2) DEFAULT NULL,
  `saldo_normal` varchar(10) DEFAULT NULL,
  `st` tinyint(4) NOT NULL DEFAULT 1,
  `sel` tinyint(4) NOT NULL DEFAULT 0,
  `sel2` tinyint(4) NOT NULL DEFAULT 0,
  `level` tinyint(4) NOT NULL DEFAULT 0,
  `col` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'pos amount at report',
  `trx` tinyint(4) NOT NULL DEFAULT 0,
  `seq` tinyint(4) NOT NULL DEFAULT 0,
  `c1` tinyint(4) NOT NULL DEFAULT 0,
  `c2` int(11) NOT NULL DEFAULT 0,
  `c3` int(11) NOT NULL DEFAULT 0,
  `id2` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`),
  KEY `id_parent_id_code` (`id`,`parent_id`,`code`)
) ENGINE=InnoDB AUTO_INCREMENT=124 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `account` VALUES ('1','0','N','Neraca','','','0','','','','','1','0','0','0','0','2','0','0','0','0','1','0');
INSERT INTO `account` VALUES ('2','0','RL','Rugi Laba','','','0','','','','','1','0','0','0','0','2','0','0','0','0','2','0');
INSERT INTO `account` VALUES ('3','0','AK','Arus Kas','','','0','','','','','1','0','0','0','0','2','0','0','0','0','3','0');
INSERT INTO `account` VALUES ('4','0','PM','Perubahan Modal','','','0','','','','','1','0','0','0','0','2','0','0','0','0','4','0');
INSERT INTO `account` VALUES ('5','1','10000','Aktiva/Aset','','','0','c10000','','','debet','1','1','0','1','0','2','0','0','0','0','5','1746512969');
INSERT INTO `account` VALUES ('6','1','20000','Liabilitas/Utang/Kewajiban','','','Aset','c20000','','','debet','1','1','0','1','0','2','0','0','0','0','6','1746514847');
INSERT INTO `account` VALUES ('7','5','11000','Aktiva Lancar','','','','c11000','','','','1','1','0','2','0','2','0','0','0','0','7','1746512995');
INSERT INTO `account` VALUES ('8','2','L410','Penerimaan','','','','c5100','','','','1','1','0','1','4','2','1','0','0','0','8','1746540174');
INSERT INTO `account` VALUES ('9','2','L510','Harga Pokok Penjualan','','','','c5200','','','','1','1','0','1','4','2','5','0','0','0','9','1746540166');
INSERT INTO `account` VALUES ('10','2','L620','Beban Administrasi','','','0','c5400','','','','1','1','0','1','4','2','11','0','0','0','10','1746540024');
INSERT INTO `account` VALUES ('11','2','L640','Laba Operasi/Sebelum PPh','','','0','c5500','','','','1','1','0','1','4','2','20','0','0','0','11','1746540102');
INSERT INTO `account` VALUES ('12','43','62106','Kebersihan','','','','','','-','','1','1','0','4','1','1','0','0','0','62','12','1746515614');
INSERT INTO `account` VALUES ('13','5','12000','Aktiva/Aset Tetap','','','','c12000','','','','1','1','0','2','0','2','0','0','0','0','13','1746513204');
INSERT INTO `account` VALUES ('14','6','21100','Utang Dagang','','','','c21100','','','','1','1','0','3','2','1','0','0','0','21','14','1746514790');
INSERT INTO `account` VALUES ('15','1','30000','Equity/Modal','','','','c30000','','','','1','1','0','2','0','2','0','0','0','0','15','1746513749');
INSERT INTO `account` VALUES ('16','5','19999','Total Aktiva','','','','','','','','1','1','0','2','4','2','0','0','0','0','16','1746513437');
INSERT INTO `account` VALUES ('17','1','40000','Penerimaan/Pendapatan','','','','c40000','','','','1','1','0','2','0','2','0','0','0','0','17','1746514605');
INSERT INTO `account` VALUES ('18','1','50000','Harga Pokok Penjualan','','','','c50000','','','','1','1','0','2','0','2','0','0','0','0','18','1746513961');
INSERT INTO `account` VALUES ('19','1','60000','Beban','','','','c60000','','','','1','1','0','2','0','2','0','0','0','0','19','1746513975');
INSERT INTO `account` VALUES ('20','6','21200','Utang Biaya','','','','c22100','','','','1','1','0','3','2','1','0','0','0','21','20','1747195466');
INSERT INTO `account` VALUES ('21','7','11101','Kas & Bank','','','','c11101','','','','1','1','0','3','2','1','0','0','0','11','21','1746513048');
INSERT INTO `account` VALUES ('22','7','11202','Persediaan Barang Dagang','','','','c11202','','','','1','1','0','3','2','1','0','0','0','11','22','1746513100');
INSERT INTO `account` VALUES ('23','7','11201','Piutang','','','','c11201','','','','1','1','1','3','2','1','0','0','0','11','23','1746513080');
INSERT INTO `account` VALUES ('24','7','11203','Perlengkapan','','','','c11203','','','','1','1','0','3','2','1','0','0','0','11','24','1746513117');
INSERT INTO `account` VALUES ('25','7','11205','Biaya/sewa Dibayar Dimuka','','','','c11205','','','','1','1','0','3','2','1','0','0','0','11','25','1746513167');
INSERT INTO `account` VALUES ('26','7','11999','Total Aktiva Lancar','','','','','','','','1','1','0','3','3','2','0','0','0','0','26','1746513371');
INSERT INTO `account` VALUES ('27','13','12101','Tanah','','','','c12101','','','','1','1','0','3','2','1','0','0','0','12','27','1746513223');
INSERT INTO `account` VALUES ('28','13','12301','Kendaraan','','','','c12301','','','','1','1','0','3','2','1','0','0','0','12','28','1746513286');
INSERT INTO `account` VALUES ('29','13','12201','Bangunan','','','','c12201','','','','1','1','0','3','2','1','0','0','0','12','29','1746513246');
INSERT INTO `account` VALUES ('30','13','12401','Peralatan','','','','c12401','','','','1','1','0','3','2','1','0','0','0','12','30','1746513322');
INSERT INTO `account` VALUES ('31','6','29999','Total Utang','','','','','','','','1','1','0','2','3','2','0','0','0','0','31','1746514492');
INSERT INTO `account` VALUES ('32','17','41999','Total Penerimaan/Pendapatan','','','','','','','','1','1','0','3','3','2','0','0','0','0','32','1746514712');
INSERT INTO `account` VALUES ('33','13','12999','Total Aktiva Tetap','','','','','','','','1','1','0','3','3','2','0','0','0','0','33','1746513343');
INSERT INTO `account` VALUES ('34','7','11204','Asuransi Dibayar Dimuka','','','','','','','','1','1','0','3','2','1','0','0','0','11','34','1746513146');
INSERT INTO `account` VALUES ('35','18','51999','Harga Pokok Penjualan','','','','','','','','1','1','0','3','4','2','0','0','0','0','35','1746515217');
INSERT INTO `account` VALUES ('36','15','31100','Setor Modal','','','','c31100','','','','1','1','0','3','2','1','0','0','0','31','36','1746514526');
INSERT INTO `account` VALUES ('37','17','41100','Penjualan','','','','c41100','','','','1','1','1','3','2','1','0','0','0','41','37','1746514631');
INSERT INTO `account` VALUES ('38','17','41200','Retur Penjualan','','','','c41200','','-','','1','1','0','3','2','1','0','0','0','41','38','1746514654');
INSERT INTO `account` VALUES ('39','17','41300','Potongan Penjualan','','','','c41300','','-','','1','1','0','3','2','1','0','0','0','41','39','1746514685');
INSERT INTO `account` VALUES ('40','43','62107','Penyusutan Bangunan','','','','','','-','','1','1','0','4','1','1','0','0','0','62','40','1746515637');
INSERT INTO `account` VALUES ('41','42','61102','Operasional','','','','c61102','','-','','1','1','0','4','1','1','0','0','0','61','41','1746522468');
INSERT INTO `account` VALUES ('42','19','61000','Operasional/Penjualan','','','','c61000','','','','1','1','0','3','0','2','0','0','0','61','42','1746515037');
INSERT INTO `account` VALUES ('43','19','62000','Administrasi','','','','c62000','','','','1','1','0','3','0','2','0','0','0','62','43','1746515136');
INSERT INTO `account` VALUES ('44','43','62999','Total Beban Administrasi','','','','','','','','1','1','0','4','2','2','0','0','0','0','44','1746515669');
INSERT INTO `account` VALUES ('45','3','A','Arus Kas dari Aktivitas Operasional','','','','','','','','1','1','0','1','0','2','0','0','0','0','45','1687098868');
INSERT INTO `account` VALUES ('46','3','B','Arus Kas dari Aktivitas Investasi','','','','','','','','1','1','0','1','0','2','0','0','0','0','46','1687098877');
INSERT INTO `account` VALUES ('47','3','C','Arus Kas dari Aktivitas Pendanaan','','','','','','','','1','1','0','1','0','2','0','0','0','0','47','1687098885');
INSERT INTO `account` VALUES ('48','45','A1','Kas Diterima dari Customer','','','','','','','','1','1','0','2','1','0','0','0','0','0','48','1687244794');
INSERT INTO `account` VALUES ('49','45','A2','Pembayaran kas untuk supplier','','','','','','','','1','1','0','2','1','0','0','0','0','0','49','1687244802');
INSERT INTO `account` VALUES ('50','45','A3','Pembayaran kas untuk beban operasi','','','','','','','','1','1','0','2','1','0','0','0','0','0','50','1687244809');
INSERT INTO `account` VALUES ('51','45','A4','Pembayaran kas untuk bunga','','','','','','','','1','1','0','2','1','0','0','0','0','0','51','1687244820');
INSERT INTO `account` VALUES ('52','45','A5','Pembayaran kas untuk pajak','','','','','','','','1','1','0','2','1','0','0','0','0','0','52','1687244829');
INSERT INTO `account` VALUES ('53','46','B1','Kas diterima dari penjualan aktiva tetap','','','','','','','','1','1','0','2','1','0','0','0','0','0','53','1687446507');
INSERT INTO `account` VALUES ('54','46','B3','Pembayaran kas untuk pembelian aktiva tetap','','','','','','','','1','1','0','2','1','0','0','0','0','0','54','1687447868');
INSERT INTO `account` VALUES ('55','45','A9','Jumlah kas dari aktivitas operasi','jumlah dari A','','','cA9','','','','0','1','0','2','2','0','0','0','0','0','55','1687245302');
INSERT INTO `account` VALUES ('56','46','B9','Jumlah kas untuk aktivitas investasi','Jumlah dari B','','','','','','','1','1','0','2','2','0','0','0','0','0','56','1687244887');
INSERT INTO `account` VALUES ('57','47','C1','Kas diterima dari penyertaan saham','','','','','','','','1','1','0','2','1','0','0','0','0','0','57','1687244897');
INSERT INTO `account` VALUES ('58','47','C2','Kas diterima dari hutang/pinjaman','','','','','','','','1','1','0','2','1','0','0','0','0','0','58','1687446474');
INSERT INTO `account` VALUES ('59','47','C6','Pembayaran kas untuk prive','','','','','','','','1','1','0','2','1','0','0','0','0','0','59','1687244911');
INSERT INTO `account` VALUES ('60','47','C7','Pembayaran kas untuk bunga/bagi hasil','','','','','','','','1','1','0','2','1','0','0','0','0','0','60','1687244922');
INSERT INTO `account` VALUES ('61','47','C8','Pembayaran kas untuk pelunasan hutang/pinjaman jangka panjang','','','','','','','','1','1','0','2','1','0','0','0','0','0','61','1687244932');
INSERT INTO `account` VALUES ('62','47','C9','Jumlah kas dari aktivitas pendanaan','jumlah dari C','','','','','','','1','1','0','2','2','0','0','0','0','0','62','1687244939');
INSERT INTO `account` VALUES ('63','4','PM01','Modal Usaha','=31900','','','cPM01','','','','1','1','0','1','2','0','1','0','0','0','63','1714402115');
INSERT INTO `account` VALUES ('64','63','PM02','Pembayaran Prive','','','','','','','','1','1','0','2','1','0','2','0','0','0','64','1687245025');
INSERT INTO `account` VALUES ('65','63','PM03','Pembayaran Deviden','','','','','','','','1','1','0','2','1','0','3','0','0','0','65','1687245031');
INSERT INTO `account` VALUES ('66','63','PM04','Laba/Rugi Periode Ini','=90000','','','','','','','1','1','0','2','1','0','4','0','0','0','66','1687245036');
INSERT INTO `account` VALUES ('67','4','PM09','Perubahan Modal atau Laba/Rugi Periode Ini','modal awal - prive - deviden -/+ laba/rugi','','','','','','','1','1','0','1','2','0','5','0','0','0','67','1687245042');
INSERT INTO `account` VALUES ('68','19','69999','Total Beban','','','','','','','','1','1','0','3','3','2','0','0','0','0','68','1746515251');
INSERT INTO `account` VALUES ('69','15','31200','Prive/Tarik Modal','','','','c31200','','','','1','1','0','3','2','1','0','0','0','31','69','1746514545');
INSERT INTO `account` VALUES ('70','15','31999','Total Modal','','','','','','','','1','1','0','3','3','2','0','0','0','0','70','1746514569');
INSERT INTO `account` VALUES ('71','79','71000','Pendapatan Bunga','','','','','','','','1','1','0','3','2','1','0','0','0','71','71','1746515699');
INSERT INTO `account` VALUES ('72','121','81100','Beban Bunga','','','','','','-','','1','1','0','3','2','1','0','0','0','81','72','1746515718');
INSERT INTO `account` VALUES ('73','13','12302','Akumulasi Penyusutan Kendaraan','','','','','','','','1','1','0','3','2','1','0','0','0','12','73','1746513396');
INSERT INTO `account` VALUES ('74','43','62104','Asuransi','','','','c62104','','-','','1','1','0','4','2','1','0','0','0','62','74','1746522632');
INSERT INTO `account` VALUES ('75','2','L612','Laba Kotor','a-b','','','c5300','','','','1','1','0','1','4','2','10','0','0','0','75','1746540059');
INSERT INTO `account` VALUES ('76','121','81200','Biaya Bank','','','','','','-','','1','1','0','3','2','1','0','0','0','81','76','1746515741');
INSERT INTO `account` VALUES ('77','13','12202','Aumulasi Penyusutan Bangunan','','','','c12202','','','','1','1','0','3','2','1','0','0','0','12','77','1746513271');
INSERT INTO `account` VALUES ('78','18','51100','Harga Pokok Penjualan','','','','','','','','1','1','0','3','2','1','0','0','0','51','78','1746590212');
INSERT INTO `account` VALUES ('79','1','70000','Pendapatan Lain-lain','','','','','','','','1','0','0','1','0','2','0','0','0','0','79','1746514042');
INSERT INTO `account` VALUES ('80','6','21300','Utang Bank Jangka Panjang','','','','','','','','1','1','0','3','2','1','0','0','0','21','80','1747195478');
INSERT INTO `account` VALUES ('81','13','12402','Akumulasi Penyusutan Peralatan','','','','','','','','1','1','0','3','2','1','0','0','0','12','81','1746522066');
INSERT INTO `account` VALUES ('82','3','D','Arus kas bersih dan saldo akhir periode','jumlah/saldo dari A+B+C','','','','','','','1','1','0','1','2','0','0','0','0','0','82','1687244980');
INSERT INTO `account` VALUES ('83','18','51200','Biaya Pembelian','','','','','','','','1','1','0','3','2','1','0','0','0','51','83','1746526561');
INSERT INTO `account` VALUES ('84','15','31300','Deviden','','','','','','','','1','1','0','3','2','1','0','0','0','31','84','1746531856');
INSERT INTO `account` VALUES ('85','47','C5','Pembayaran kas untuk Deviden','','','','','','','','1','1','0','2','1','0','0','0','0','0','85','1687446730');
INSERT INTO `account` VALUES ('86','1','90000','Total Pasiva','','','','','','','','1','1','0','2','4','2','0','0','0','0','86','1746536810');
INSERT INTO `account` VALUES ('87','6','21400','Utang Pajak','','','','','','','','1','1','0','3','2','1','0','0','0','21','87','1747195514');
INSERT INTO `account` VALUES ('88','46','B2','Kas diterima dari bunga/bagi hasil bank','','','','','','','','1','0','0','0','0','2','0','0','0','0','88','1687447899');
INSERT INTO `account` VALUES ('89','43','62105','Biaya Pajak/Retribusi','','','','','','','','1','1','0','4','2','1','0','0','0','62','89','1747195545');
INSERT INTO `account` VALUES ('96','42','61101','Upah/Gaji','','','','c61101','','-','','1','1','0','4','1','1','0','0','34','61','90','1746518768');
INSERT INTO `account` VALUES ('97','42','61104','Sewa Gedung','','','','c61104','','-','','1','1','0','4','1','1','0','0','34','61','91','1746515341');
INSERT INTO `account` VALUES ('98','42','61105','Penyusutan Kendaraan','','','','c61105','','-','','1','1','0','4','1','1','0','0','34','61','92','1746515369');
INSERT INTO `account` VALUES ('99','42','61103','Marketing','','','','','','-','','1','1','0','4','1','1','0','0','0','61','93','1746515094');
INSERT INTO `account` VALUES ('100','42','61106','Penyusutan Peralatan','','','','c61106','','-','','1','1','0','4','1','1','0','0','34','61','94','1746515402');
INSERT INTO `account` VALUES ('101','42','61199','Total Beban Penjualan','','','','','','','','1','1','0','4','2','2','0','0','0','0','95','1746515445');
INSERT INTO `account` VALUES ('102','43','62101','Upah/Gaji Staf Kantor ','','','','c62101','','-','','1','1','0','4','1','1','0','0','34','62','96','1746515496');
INSERT INTO `account` VALUES ('103','43','62102','Listrik, Air, telp/data','','','','c62102','','-','','1','1','0','4','1','1','0','0','34','62','97','1746515529');
INSERT INTO `account` VALUES ('104','43','62103','Perlengkapan','','','','c62103','','-','','1','1','0','4','1','1','0','0','34','62','98','1746515557');
INSERT INTO `account` VALUES ('106','18','51300','Potongan Pembelian','','','','','','','','1','2','0','3','2','1','0','0','0','51','99','1746622519');
INSERT INTO `account` VALUES ('112','2','L650','Pajak Penghasilan','','','','c5600','','','','1','1','0','1','4','2','0','0','0','0','100','1746540134');
INSERT INTO `account` VALUES ('113','2','L660','Laba/Rugi Bersih Setalah Pajak','','','','c5700','','','','1','1','0','1','4','2','0','0','0','0','101','1746540151');
INSERT INTO `account` VALUES ('121','1','80000','Beban Lain-lain','','','','','','','','1','0','0','2','0','2','0','0','0','0','102','1746514097');
INSERT INTO `account` VALUES ('122','2','L610','Beban Penjualan','','','','','','','','1','1','0','1','4','2','0','0','0','0','103','1746540035');


DROP TABLE IF EXISTS `account_equation`;
CREATE TABLE `account_equation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `action_at` int(11) NOT NULL DEFAULT 0,
  `transaction_id` int(11) NOT NULL,
  `action_id` int(11) NOT NULL,
  `year` int(11) NOT NULL DEFAULT 0,
  `month` int(11) NOT NULL DEFAULT 0,
  `week` int(11) NOT NULL DEFAULT 0,
  `amount` bigint(20) NOT NULL DEFAULT 0,
  `c11101` bigint(20) NOT NULL DEFAULT 0,
  `c11201` bigint(20) NOT NULL DEFAULT 0,
  `c11202` bigint(20) NOT NULL DEFAULT 0,
  `c11203` bigint(20) NOT NULL DEFAULT 0,
  `c11204` bigint(20) NOT NULL DEFAULT 0,
  `c11205` bigint(20) NOT NULL DEFAULT 0,
  `c12101` bigint(20) NOT NULL DEFAULT 0,
  `c12201` bigint(20) NOT NULL DEFAULT 0,
  `c12202` bigint(20) NOT NULL DEFAULT 0,
  `c12301` bigint(20) NOT NULL DEFAULT 0,
  `c12302` bigint(20) NOT NULL DEFAULT 0,
  `c12401` bigint(20) NOT NULL DEFAULT 0,
  `c12402` bigint(20) NOT NULL DEFAULT 0,
  `c21100` bigint(20) NOT NULL DEFAULT 0,
  `c21200` bigint(20) NOT NULL DEFAULT 0,
  `c21300` bigint(20) NOT NULL DEFAULT 0,
  `c21400` bigint(20) NOT NULL DEFAULT 0,
  `c31100` bigint(20) NOT NULL DEFAULT 0,
  `c31200` bigint(20) NOT NULL DEFAULT 0,
  `c31300` bigint(20) NOT NULL DEFAULT 0,
  `c41100` bigint(20) NOT NULL DEFAULT 0,
  `c41200` bigint(20) NOT NULL DEFAULT 0,
  `c41300` bigint(20) NOT NULL DEFAULT 0,
  `c51100` bigint(20) NOT NULL DEFAULT 0,
  `c51200` bigint(20) NOT NULL DEFAULT 0,
  `c51300` bigint(20) NOT NULL DEFAULT 0,
  `c61101` bigint(20) NOT NULL DEFAULT 0,
  `c61102` bigint(20) NOT NULL DEFAULT 0,
  `c61103` bigint(20) NOT NULL DEFAULT 0,
  `c61104` bigint(20) NOT NULL DEFAULT 0,
  `c61105` bigint(20) NOT NULL DEFAULT 0,
  `c61106` bigint(20) NOT NULL DEFAULT 0,
  `c62101` bigint(20) NOT NULL DEFAULT 0,
  `c62102` bigint(20) NOT NULL DEFAULT 0,
  `c62103` bigint(20) NOT NULL DEFAULT 0,
  `c62104` bigint(20) NOT NULL DEFAULT 0,
  `c62105` bigint(20) NOT NULL DEFAULT 0,
  `c62106` bigint(20) NOT NULL DEFAULT 0,
  `c62107` bigint(20) NOT NULL DEFAULT 0,
  `c71000` bigint(20) NOT NULL DEFAULT 0,
  `c81100` bigint(20) NOT NULL DEFAULT 0,
  `c81200` bigint(20) NOT NULL DEFAULT 0,
  `id2` int(11) NOT NULL DEFAULT 0,
  `st` tinyint(4) NOT NULL DEFAULT 1,
  `view` tinyint(4) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `transaction_id` (`transaction_id`),
  KEY `id_action_at_cash` (`id`,`action_at`),
  KEY `action_id` (`action_id`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `account_equation` VALUES ('19','0','19','0','1970','197001','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','1','1','1');


DROP TABLE IF EXISTS `action`;
CREATE TABLE `action` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `action_at` int(11) NOT NULL DEFAULT 0,
  `bank` int(11) NOT NULL DEFAULT 0,
  `amount` bigint(20) NOT NULL DEFAULT 0,
  `descr` text DEFAULT NULL,
  `invoice` varchar(75) DEFAULT NULL,
  `pay_to` varchar(50) DEFAULT NULL,
  `pay_from` varchar(50) DEFAULT NULL,
  `debit` varchar(10) DEFAULT NULL,
  `credit` varchar(10) DEFAULT NULL,
  `year` varchar(5) DEFAULT NULL,
  `month` varchar(7) DEFAULT NULL,
  `tgl` date DEFAULT NULL,
  `url_pdf` varchar(150) DEFAULT NULL,
  `img` varchar(150) NOT NULL DEFAULT 'no_img.jpeg',
  `update_at` int(11) NOT NULL DEFAULT 0,
  `reff_trx_id` int(11) NOT NULL DEFAULT 0,
  `reff_sales_id` int(11) NOT NULL DEFAULT 0,
  `seq` int(11) NOT NULL DEFAULT 0,
  `id2` int(11) NOT NULL DEFAULT 0,
  `cat` tinyint(4) NOT NULL DEFAULT 0,
  `inout` tinyint(4) NOT NULL DEFAULT 0,
  `st` tinyint(4) NOT NULL DEFAULT 1,
  `st_trx` tinyint(4) NOT NULL DEFAULT 0,
  `cr` tinyint(4) NOT NULL DEFAULT 0,
  `view` tinyint(4) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  KEY `id_tgl_nilai_akun_tunai` (`id`,`action_at`),
  KEY `bank_amount_debit_credit` (`bank`,`amount`,`debit`,`credit`)
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `action` VALUES ('10','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753760652','0','0','0','1','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('11','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753760781','0','0','0','2','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('12','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753760972','0','0','0','3','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('13','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753761101','0','0','0','4','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('14','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753761538','0','0','0','5','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('15','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753761602','0','0','0','6','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('16','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753761729','0','0','0','7','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('17','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753761795','0','0','0','8','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('18','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753761981','0','0','0','9','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('19','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753762105','0','0','0','10','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('20','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753762232','0','0','0','11','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('21','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753762297','0','0','0','12','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('22','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753762358','0','0','0','13','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('23','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753762481','0','0','0','14','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('24','5184000','0','0','','','','','','','','','','','no_img.jpeg','1753762612','0','0','0','15','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('25','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753762677','0','0','0','16','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('26','5184000','0','0','','','','','','','','','','','no_img.jpeg','1753762741','0','0','0','17','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('27','5184000','0','0','','','','','','','','','','','no_img.jpeg','1753762802','0','0','0','18','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('28','5184000','0','0','','','','','','','','','','','no_img.jpeg','1753762930','0','0','0','19','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('29','5184000','0','0','','','','','','','','','','','no_img.jpeg','1753763054','0','0','0','20','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('30','5184000','0','0','','','','','','','','','','','no_img.jpeg','1753763178','0','0','0','21','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('31','7776000','0','0','','','','','','','','','','','no_img.jpeg','1753763243','0','0','0','22','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('32','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753763305','0','0','0','23','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('36','5184000','0','0','','','','','','','','','','','no_img.jpeg','1753763622','0','0','0','24','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('37','5184000','0','0','','','','','','','','','','','no_img.jpeg','1753763685','0','0','0','25','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('38','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753763813','0','0','0','26','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('39','5184000','0','0','','','','','','','','','','','no_img.jpeg','1753763942','0','0','0','27','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('40','7776000','0','0','','','','','','','','','','','no_img.jpeg','1753764008','0','0','0','28','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('41','5184000','0','0','','','','','','','','','','','no_img.jpeg','1753764258','0','0','0','29','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('42','7776000','0','0','','','','','','','','','','','no_img.jpeg','1753764385','0','0','0','30','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('43','7776000','0','0','','','','','','','','','','','no_img.jpeg','1753764578','0','0','0','31','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('44','5184000','0','0','','','','','','','','','','','no_img.jpeg','1753764768','0','0','0','32','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('45','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753764828','0','0','0','33','0','0','1','0','0','1');
INSERT INTO `action` VALUES ('46','2592000','0','0','','','','','','','','','','','no_img.jpeg','1753765021','0','0','0','34','0','0','1','0','0','1');


DROP TABLE IF EXISTS `bank`;
CREATE TABLE `bank` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cif` int(11) NOT NULL DEFAULT 0,
  `balance` bigint(20) NOT NULL DEFAULT 0,
  `min_saldo` bigint(20) NOT NULL DEFAULT 0,
  `account_name` varchar(50) DEFAULT NULL,
  `bank_name` varchar(50) DEFAULT NULL,
  `swift_code` varchar(12) DEFAULT NULL,
  `account_number` varchar(100) DEFAULT NULL,
  `currency` varchar(4) DEFAULT NULL,
  `st` tinyint(4) NOT NULL DEFAULT 1,
  `del` tinyint(4) NOT NULL DEFAULT 0,
  `sel` tinyint(4) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `account_number` (`account_number`),
  KEY `id_cif_account_number` (`id`,`cif`,`account_number`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `bank` VALUES ('1','0','0','1000000','Navis Murbiyanto','Mandiri  Jatimakmur','BMRIIDJA','1670001143709','IDR','1','0','1','1747962136');
INSERT INTO `bank` VALUES ('2','0','0','0','df','bjb syariah','dfg46','56754745','idr','1','1','0','1748486616');
INSERT INTO `bank` VALUES ('3','0','0','0','gh4','bca26789','hfg4','4523425','fgdh','1','1','0','1748478557');


DROP TABLE IF EXISTS `company`;
CREATE TABLE `company` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(99) DEFAULT NULL,
  `initial` varchar(9) DEFAULT NULL,
  `nib` varchar(25) DEFAULT NULL,
  `npwp` varchar(25) DEFAULT NULL,
  `city` varchar(25) DEFAULT NULL,
  `address` varchar(100) DEFAULT NULL,
  `img` varchar(200) NOT NULL DEFAULT 'no_img.jpeg',
  `postcode` varchar(5) DEFAULT NULL,
  `relation` tinyint(4) NOT NULL DEFAULT 9,
  `st` tinyint(4) NOT NULL DEFAULT 1,
  `del` tinyint(4) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `create_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  KEY `id_cif_account_number` (`id`,`address`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `company` VALUES ('1','pt alfa global niaga','agnia','1209220047702','609030267001000','jakarta timur','JL KAYUMANIS 8 NO 54, MATRAMAN, JAKARTA, INDONESIA (13130)','company/25/05/24/19/1/1/image/small/20250524194635.jpeg','13130','0','1','0','1748090795','0');
INSERT INTO `company` VALUES ('2','pt nusantara jaya','c001','','','surabaya','jl dipinegoro 100','no_img.jpeg','','9','1','0','1747013760','0');
INSERT INTO `company` VALUES ('3','ud citra makmur','c002','','','surabaya','jl manyar jaya 25','no_img.jpeg','','9','1','0','1746508254','0');
INSERT INTO `company` VALUES ('4','pt berlian indah','c003','','','surabaya','jl mulyorejo 38','no_img.jpeg','','0','1','0','1748393117','0');
INSERT INTO `company` VALUES ('5','toko damai sejahtera','c004','','','surabaya','jl merpati 45','company/25/05/24/19/5/1/image/small/20250524195312.jpeg','','0','1','0','1748091192','0');
INSERT INTO `company` VALUES ('6','pt pansonic gobel indonesia','s001','','','surabaya','margomulyo 26','no_img.jpeg','','9','1','0','1746492676','0');
INSERT INTO `company` VALUES ('7','pt samsung indonesia','s002','','','surabaya','margomulyo 70','company/25/05/24/19/7/1/image/small/20250524194935.png','','0','1','0','1748090974','0');
INSERT INTO `company` VALUES ('8','pt sharp','s003','','','surabaya','rungkut industro 27','company/25/05/24/19/8/2/image/small/20250524195748.jpeg','17413','0','1','0','1748091467','0');
INSERT INTO `company` VALUES ('9','ert 234','ert','et','ert','etr','etr jufg','company/25/05/24/19/9/1/image/small/20250524194440.jpeg','17423','0','1','1','1748476005','1747012024');


DROP TABLE IF EXISTS `company_relation`;
CREATE TABLE `company_relation` (
  `company_id` int(11) NOT NULL DEFAULT 0,
  `relation` tinyint(4) NOT NULL DEFAULT 0,
  UNIQUE KEY `person_id_relation` (`company_id`,`relation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `company_relation` VALUES ('2','8');
INSERT INTO `company_relation` VALUES ('3','8');


DROP TABLE IF EXISTS `copy_product_trx`;
CREATE TABLE `copy_product_trx` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `action_at` int(11) NOT NULL DEFAULT 0,
  `product_id` int(11) NOT NULL DEFAULT 0,
  `action_id` int(11) NOT NULL DEFAULT 0,
  `transaction_id` int(11) NOT NULL DEFAULT 0,
  `item_in` int(11) NOT NULL DEFAULT 0,
  `item_out` int(11) NOT NULL DEFAULT 0,
  `balance` int(11) NOT NULL DEFAULT 0,
  `invoice` varchar(20) DEFAULT NULL,
  `remark` varchar(200) DEFAULT NULL,
  `year` varchar(5) DEFAULT NULL,
  `month` varchar(7) DEFAULT NULL,
  `item_code` varchar(7) DEFAULT NULL,
  `tgl` date DEFAULT NULL,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `inout` tinyint(4) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `action_id` (`action_id`),
  KEY `id_tgl_nilai_akun_tunai` (`id`,`action_at`),
  KEY `bank_amount_debit_credit` (`product_id`,`balance`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `copy_product_trx` VALUES ('1','1735664400','1','2','2','20','0','20','','lemari es 20 pcs','2025','202501','pn-243','2025-01-01','1746664093','1');
INSERT INTO `copy_product_trx` VALUES ('2','1735664400','2','3','3','32','0','32','','lemari es 32 pcs','2025','202501','pn-222','2025-01-01','1746664111','1');
INSERT INTO `copy_product_trx` VALUES ('3','1735664400','3','4','4','29','0','29','','lemari es 29 pcs','2025','202501','sm-200','2025-01-01','1746664117','1');
INSERT INTO `copy_product_trx` VALUES ('4','1735664400','4','5','5','22','0','22','','22 unit Lemari Es Sa','2025','202501','sm-021','2025-01-01','1746664123','1');
INSERT INTO `copy_product_trx` VALUES ('5','1735664400','5','6','6','18','0','18','','18 Lemari Es Sharp S','2025','202501','shr-174','2025-01-01','1746664127','1');
INSERT INTO `copy_product_trx` VALUES ('6','1735664400','6','7','7','35','0','35','','35 Lemari Es Sharp S','2025','202501','shr-201','2025-01-01','1746664165','1');
INSERT INTO `copy_product_trx` VALUES ('7','1735837200','4','21','21','0','1','21','fpj-001','Jual Lemari Es Samsu','2025','202501','sm-021','2025-01-03','1746665669','2');
INSERT INTO `copy_product_trx` VALUES ('8','1735837200','3','23','12','0','1','28','fpj-001','Jual Lemari Es Samsu','2025','202501','sm-200','2025-01-03','1746665758','2');
INSERT INTO `copy_product_trx` VALUES ('9','1736096400','3','25','14','0','20','8','fp-si-011','Jual Lemari Es Samsu','2025','202501','sm-200','2025-01-06','1746665769','2');
INSERT INTO `copy_product_trx` VALUES ('10','1736182800','1','27','23','0','15','-6','fp-pg-0015','Jual Lemari Es Panas','2025','202501','pn-243','2025-01-07','1746665773','2');
INSERT INTO `copy_product_trx` VALUES ('11','1736182800','2','29','25','0','15','17','fp-pg-0015','Jual Lemari Es Panas','2025','202501','pn-222','2025-01-07','1746665778','2');
INSERT INTO `copy_product_trx` VALUES ('12','1736182800','1','40','36','0','11','9','fpj-002','Jual Lemari Es Panas','2025','202501','pn-243','2025-01-07','1746665782','2');
INSERT INTO `copy_product_trx` VALUES ('13','1736182800','3','42','38','0','15','-7','fpj-002','Jual Lemari Es Samsu','2025','202501','sm-200','2025-01-07','1746665786','2');
INSERT INTO `copy_product_trx` VALUES ('14','1736182800','5','44','40','0','8','10','fpj-002','Jual Lemari Es Sharp','2025','202501','shr-174','2025-01-07','1746665791','2');
INSERT INTO `copy_product_trx` VALUES ('15','1736701200','4','48','44','0','7','14','fpj-003','Jual Lemari Es Samsu','2025','202501','sm-021','2025-01-13','1746665795','2');
INSERT INTO `copy_product_trx` VALUES ('16','1736701200','3','50','46','0','15','-22','fpj-003','Jual Lemari Es Samsu','2025','202501','sm-200','2025-01-13','1746665799','2');
INSERT INTO `copy_product_trx` VALUES ('17','1736701200','6','52','49','0','12','23','fpj-003','Jual Lemari Es Sharp','2025','202501','shr-201','2025-01-13','1746665807','2');
INSERT INTO `copy_product_trx` VALUES ('18','1736787600','2','56','52','0','1','16','fpj-004','Jual Lemari Es Panas','2025','202501','pn-222','2025-01-14','1746665811','2');
INSERT INTO `copy_product_trx` VALUES ('19','1737046800','6','59','55','0','1','22','','Jual Lemari Es Sharp','2025','202501','shr-201','2025-01-17','1746665816','2');
INSERT INTO `copy_product_trx` VALUES ('20','1737392400','5','65','61','15','0','25','sharp-115','Beli secara kredit 3','2025','202501','shr-174','2025-01-21','1746670303','1');
INSERT INTO `copy_product_trx` VALUES ('21','1737392400','6','66','62','20','0','42','shrap-115','beli barang dagangan','2025','202501','shr-201','2025-01-21','1746671934','1');
INSERT INTO `copy_product_trx` VALUES ('22','1736701200','4','68','51','1','0','15','nk-001','retur sm-021,  Samsu','2025','202501','sm-021','2025-01-13','1746750360','1');
INSERT INTO `copy_product_trx` VALUES ('23','1737478800','5','70','65','0','2','23','nr-001','','2025','202501','shr-174','2025-01-22','1746753100','2');


DROP TABLE IF EXISTS `cp_filephp_2`;
CREATE TABLE `cp_filephp_2` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `modul` varchar(20) DEFAULT NULL,
  `slug` varchar(99) DEFAULT NULL,
  `name` varchar(99) DEFAULT NULL,
  `param` text DEFAULT NULL,
  `method` varchar(99) NOT NULL DEFAULT 'POST',
  `folder` varchar(40) DEFAULT NULL,
  `php` text DEFAULT NULL,
  `body` text DEFAULT NULL,
  `remark` varchar(150) DEFAULT NULL,
  `st` tinyint(4) NOT NULL,
  `type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1=api,2=non api',
  `del` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=delete',
  `update_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `folder_slug` (`folder`,`slug`),
  KEY `id_folder_slug` (`id`,`folder`,`slug`),
  KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=171 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `cp_filephp_2` VALUES ('1','post','index','item','','GET','u9/','','','','0','1','0','1746796618');
INSERT INTO `cp_filephp_2` VALUES ('10','','header','','','GET','u9/','','','','0','1','0','1746796603');
INSERT INTO `cp_filephp_2` VALUES ('11','','footer','','','GET','u9/','','','','0','1','0','1746796610');
INSERT INTO `cp_filephp_2` VALUES ('12','','inc/inc.filephp','','','GET','u9/','','','','0','1','0','1747094450');
INSERT INTO `cp_filephp_2` VALUES ('19','','app.function','','','GET','u9/','','','','0','1','0','1746796578');
INSERT INTO `cp_filephp_2` VALUES ('23','','inc.ar','','','GET','u9/','','','','0','1','0','1746796505');
INSERT INTO `cp_filephp_2` VALUES ('29','','inc.mail','','','GET','u9/api/v2/','','','','0','1','0','1746832199');
INSERT INTO `cp_filephp_2` VALUES ('30','','signup','','','GET','u9/api/v2/php/','','','','0','1','0','1746832319');
INSERT INTO `cp_filephp_2` VALUES ('31','','login','','','POST','u9/api/v2/php/','','email=navismur@gmail.com&password=jakarta2000','','0','1','0','1747066623');
INSERT INTO `cp_filephp_2` VALUES ('32','','password_forgot','','','GET','u9/api/v2/php/','','','','0','1','0','1746832446');
INSERT INTO `cp_filephp_2` VALUES ('33','','password_change','','','GET','u9/api/v2/php/','','','','0','1','0','1746832463');
INSERT INTO `cp_filephp_2` VALUES ('34','','account_edit','','','GET','u9/api/v2/php/','','','','0','1','0','1746832478');
INSERT INTO `cp_filephp_2` VALUES ('35','','account_delete','','','GET','u9/api/v2/php/','','','','0','1','0','1746832491');
INSERT INTO `cp_filephp_2` VALUES ('36','','address_add','','','GET','u9/api/v2/php/','','','','0','1','0','1746832503');
INSERT INTO `cp_filephp_2` VALUES ('37','','address_list','','','GET','u9/api/v2/php/','','','','0','1','0','1746832535');
INSERT INTO `cp_filephp_2` VALUES ('38','','get_address','','uuid=1','GET','u9/api/v2/php/','','','','0','1','0','1746832551');
INSERT INTO `cp_filephp_2` VALUES ('39','','address_delete','','uuid=1','GET','u9/api/v2/php/','','','','0','1','0','1746832566');
INSERT INTO `cp_filephp_2` VALUES ('40','','address_edit','','uuid=1','GET','u9/api/v2/php/','','','','0','1','0','1746832585');
INSERT INTO `cp_filephp_2` VALUES ('41','','start','','','GET','u9/api/v2/php/','','','','0','1','0','1746838167');
INSERT INTO `cp_filephp_2` VALUES ('42','','action','','','GET','u9/api/v2/php/','','','','0','1','0','1746838537');
INSERT INTO `cp_filephp_2` VALUES ('43','','inventory','','','GET','u9/api/v2/php/','','','','0','1','0','1746838826');
INSERT INTO `cp_filephp_2` VALUES ('44','','tes_curl','','','GET','u9/','','','','0','1','0','1746836609');
INSERT INTO `cp_filephp_2` VALUES ('45','','inc.ar.app','','','GET','u9/','','','','0','1','0','1746836928');
INSERT INTO `cp_filephp_2` VALUES ('46','','journal','','','GET','u9/api/v2/php/','','','','0','1','0','1746838944');
INSERT INTO `cp_filephp_2` VALUES ('47','','person','','','GET','u9/api/v2/php/','','','','0','1','0','1746839012');
INSERT INTO `cp_filephp_2` VALUES ('48','','product','','','GET','u9/api/v2/php/','','','','0','1','0','1746839080');
INSERT INTO `cp_filephp_2` VALUES ('49','','sales','','','GET','u9/api/v2/php/','','','','0','1','0','1746839139');
INSERT INTO `cp_filephp_2` VALUES ('50','','transaction','','','GET','u9/api/v2/php/','','','','0','1','0','1746839204');
INSERT INTO `cp_filephp_2` VALUES ('51','','action_add','','action_at=2025-01-31&cat=2&bank=1&amount=1300000&invoice=j-01&descr=tes+kiri&pay_to=&pay_from=&inout=2','GET','u9/api/v2/php/','','','','0','1','0','1746846615');
INSERT INTO `cp_filephp_2` VALUES ('52','','action_edit','','action_at=2025-01-31&cat=2&bank=1&amount=1300000&invoice=j-01&descr=tes+kiri&pay_to=&pay_from=&inout=2&id=79','GET','u9/api/v2/php/','','','','0','1','0','1746847471');
INSERT INTO `cp_filephp_2` VALUES ('54','','htmlbeauty','','','GET','u9/','','','','0','1','0','1746877835');
INSERT INTO `cp_filephp_2` VALUES ('55','','product_buy','','','GET','u9/api/v2/php/','','','','0','1','0','1746959390');
INSERT INTO `cp_filephp_2` VALUES ('58','','product_sell','','','GET','u9/api/v2/php/','','','','0','1','0','1746964874');
INSERT INTO `cp_filephp_2` VALUES ('59','','product_retur','','','GET','u9/api/v2/php/','','','','0','1','0','1746967479');
INSERT INTO `cp_filephp_2` VALUES ('60','','ucol','','','GET','u9/api/enuvy/php/','','','','0','1','0','1747763682');
INSERT INTO `cp_filephp_2` VALUES ('61','','product_edit','','','GET','u9/api/v2/php/','','','','0','1','0','1746968544');
INSERT INTO `cp_filephp_2` VALUES ('62','','product_image','','','GET','u9/api/v2/php/','','','','0','1','0','1746974052');
INSERT INTO `cp_filephp_2` VALUES ('63','','company_edit','','','POST','u9/api/v2/php/','','','','0','1','0','1747010757');
INSERT INTO `cp_filephp_2` VALUES ('64','','company_add','','','POST','u9/api/v2/php/','','','','0','1','0','1747010901');
INSERT INTO `cp_filephp_2` VALUES ('65','','inventory_edit','','','POST','u9/api/v2/php/','','','','0','1','0','1747017118');
INSERT INTO `cp_filephp_2` VALUES ('72','','bank','','','GET','u9/api/v2/php/','','','','0','1','0','1747103147');
INSERT INTO `cp_filephp_2` VALUES ('73','','company','','','GET','u9/api/v2/php/','','','','0','1','0','1747103307');
INSERT INTO `cp_filephp_2` VALUES ('74','','bank_edit','','','POST','u9/api/v2/php/','','','','0','1','0','1747116398');
INSERT INTO `cp_filephp_2` VALUES ('75','','bank_add','','','POST','u9/api/v2/php/','','','','0','1','0','1747118077');
INSERT INTO `cp_filephp_2` VALUES ('76','','person_edit','','','POST','u9/api/v2/php/','','','','0','1','0','1747121875');
INSERT INTO `cp_filephp_2` VALUES ('77','','person_add','','','POST','u9/api/v2/php/','','','','0','1','0','1747133733');
INSERT INTO `cp_filephp_2` VALUES ('78','','inc/inc.fcode','','','GET','u9/','','','','0','1','0','1747183260');
INSERT INTO `cp_filephp_2` VALUES ('79','','htmbeauty','','','GET','u9/','','','','0','1','0','1747266187');
INSERT INTO `cp_filephp_2` VALUES ('80','','inc.ar.f7icon','','','GET','u9/','','','','0','1','0','1747302797');
INSERT INTO `cp_filephp_2` VALUES ('86','','inc/inc.t6_js','','','GET','u9/','','','','0','1','0','1747531111');
INSERT INTO `cp_filephp_2` VALUES ('90','','inc/inc.t6_h_page','','','GET','u9/','','','','0','1','0','1747531246');
INSERT INTO `cp_filephp_2` VALUES ('91','','inc/inc.t6_h_tab','','','GET','u9/','','','','0','1','0','1747531360');
INSERT INTO `cp_filephp_2` VALUES ('92','','signup','','','POST','u9/api/enuvy/php/','','','','0','1','0','1747802117');
INSERT INTO `cp_filephp_2` VALUES ('93','','user_update','','','GET','u9/api/enuvy/php/','','','','0','1','0','1747779726');
INSERT INTO `cp_filephp_2` VALUES ('94','','user_events','','','GET','u9/api/enuvy/php/','','','','0','1','0','1747779738');
INSERT INTO `cp_filephp_2` VALUES ('95','','users','','','GET','u9/api/enuvy/php/','','','','0','1','0','1747779765');
INSERT INTO `cp_filephp_2` VALUES ('96','','venue_create','','','GET','u9/api/enuvy/php/','','','','0','1','0','1747779783');
INSERT INTO `cp_filephp_2` VALUES ('97','','venue_all','venue_all','','POST','u9/api/enuvy/php/','','','','0','1','0','1747799431');
INSERT INTO `cp_filephp_2` VALUES ('98','','venue_byid','venue_byid','','POST','u9/api/enuvy/php/','','','','0','1','0','1747799441');
INSERT INTO `cp_filephp_2` VALUES ('99','','venue_update','venue_update','','POST','u9/api/enuvy/php/','','','','0','1','0','1747799500');
INSERT INTO `cp_filephp_2` VALUES ('100','','venue_delete','venue_delete','','POST','u9/api/enuvy/php/','','','','0','1','0','1747799452');
INSERT INTO `cp_filephp_2` VALUES ('101','','venue_imgs','venue_imgs','','POST','u9/api/enuvy/php/','','','','0','1','0','1747799461');
INSERT INTO `cp_filephp_2` VALUES ('102','','venue_img_add','venue_img_add','','POST','u9/api/enuvy/php/','','','','0','1','0','1747799482');
INSERT INTO `cp_filephp_2` VALUES ('103','','venue_img','venue_img','','POST','u9/api/enuvy/php/','','','','0','1','0','1747799491');
INSERT INTO `cp_filephp_2` VALUES ('104','','event_add','event_create','','POST','u9/api/enuvy/php/','','','','0','1','0','1747799526');
INSERT INTO `cp_filephp_2` VALUES ('105','','events','events','','POST','u9/api/enuvy/php/','','','','0','1','0','1747799536');
INSERT INTO `cp_filephp_2` VALUES ('106','','event_byid','event_byid','','POST','u9/api/enuvy/php/','','','','0','1','0','1747799471');
INSERT INTO `cp_filephp_2` VALUES ('107','','event_delete','event_delete','','POST','u9/api/enuvy/php/','','','','0','1','0','1747799547');
INSERT INTO `cp_filephp_2` VALUES ('108','','notification_add','notification_create','','POST','u9/api/enuvy/php/','','','','0','1','0','1747799513');
INSERT INTO `cp_filephp_2` VALUES ('109','','inc/inc.account','','','GET','u9/','','','','0','1','0','1747796344');
INSERT INTO `cp_filephp_2` VALUES ('110','','inc/inc.action','','','GET','u9/','','','','0','1','0','1747796363');
INSERT INTO `cp_filephp_2` VALUES ('111','','inc/inc.company','','','GET','u9/','','','','0','1','0','1747796386');
INSERT INTO `cp_filephp_2` VALUES ('112','','inc/inc.inventory','','','GET','u9/','','','','0','1','0','1747796403');
INSERT INTO `cp_filephp_2` VALUES ('113','','inc/inc.person','','','GET','u9/','','','','0','1','0','1747796412');
INSERT INTO `cp_filephp_2` VALUES ('114','','inc/inc.product','','','GET','u9/','','','','0','1','0','1747796421');
INSERT INTO `cp_filephp_2` VALUES ('115','','inc/inc.sales','','','GET','u9/','','','','0','1','0','1747796432');
INSERT INTO `cp_filephp_2` VALUES ('116','','inc/inc.transaction','','','GET','u9/','','','','0','1','0','1747796443');
INSERT INTO `cp_filephp_2` VALUES ('117','','inc/inc.en_user','','','GET','u9/','','','','0','1','0','1747796497');
INSERT INTO `cp_filephp_2` VALUES ('118','','inc/inc.en_event','','','GET','u9/','','','','0','1','0','1747796518');
INSERT INTO `cp_filephp_2` VALUES ('119','','inc/inc.en_venue','','','GET','u9/','','','','0','1','0','1747796526');
INSERT INTO `cp_filephp_2` VALUES ('120','','login','','','POST','u9/api/enuvy/php/','','','','0','1','0','1747830191');
INSERT INTO `cp_filephp_2` VALUES ('121','','product','','','GET','u9/api/v1/php/','','','','0','1','0','1747971398');
INSERT INTO `cp_filephp_2` VALUES ('122','','inventory','','','GET','u9/api/v1/php/','','','','0','1','0','1747972337');
INSERT INTO `cp_filephp_2` VALUES ('123','','account_edit','','','GET','u9/api/v1/php/','','','','0','1','0','1747988901');
INSERT INTO `cp_filephp_2` VALUES ('124','','account_delete','','','GET','u9/api/v1/php/','','','','0','1','0','1747993070');
INSERT INTO `cp_filephp_2` VALUES ('125','','inc/inc.users','','','GET','u9/','','','','0','1','0','1748040634');
INSERT INTO `cp_filephp_2` VALUES ('126','','login','','','POST','u9/api/v1/php/','','email=navismur@gmail.com&password=jakarta2000','','0','1','0','1748571173');
INSERT INTO `cp_filephp_2` VALUES ('127','','image_upload','','','POST','u9/api/v1/php/','','','','0','1','0','1748681931');
INSERT INTO `cp_filephp_2` VALUES ('128','','upload_image_v1','','','POST','u9/api/v1/php/','','','','0','1','0','1748082486');
INSERT INTO `cp_filephp_2` VALUES ('129','','company','','','GET','u9/api/v1/php/','','','','0','1','0','1748087959');
INSERT INTO `cp_filephp_2` VALUES ('130','','company_edit','','','POST','u9/api/v1/php/','','','','0','1','0','1748089472');
INSERT INTO `cp_filephp_2` VALUES ('131','','company_add','','','POST','u9/api/v1/php/','','','','0','1','0','1748091872');
INSERT INTO `cp_filephp_2` VALUES ('132','','inventory_edit','','','POST','u9/api/v1/php/','','','','0','1','0','1748092407');
INSERT INTO `cp_filephp_2` VALUES ('133','','inventory_add','','','POST','u9/api/v1/php/','','','','0','1','0','1748092507');
INSERT INTO `cp_filephp_2` VALUES ('134','','person','','','GET','u9/api/v1/php/','','','','0','1','0','1748096217');
INSERT INTO `cp_filephp_2` VALUES ('135','','action','','','GET','u9/api/v1/php/','','','','0','1','0','1748130401');
INSERT INTO `cp_filephp_2` VALUES ('136','','transaction_add','','','POST','u9/api/v1/php/','','','','0','1','0','1748227579');
INSERT INTO `cp_filephp_2` VALUES ('137','','api.common.function','','','POST','u9/api/v1/','','email=navismur@gmail.com&password=jakarta2000','','0','1','0','1748392664');
INSERT INTO `cp_filephp_2` VALUES ('138','','inc/inc.journal','','','GET','u9/','','','','0','1','0','1748599572');
INSERT INTO `cp_filephp_2` VALUES ('139','','action_add','','action_at=2025-01-31&cat=2&bank=1&amount=1300000&invoice=j-01&descr=tes+kiri&pay_to=&pay_from=&inout=2','GET','u9/api/v1/php/','','','','0','1','0','1748422751');
INSERT INTO `cp_filephp_2` VALUES ('140','','inc/inc.cp_sphp','','','GET','u9/','','','','0','1','0','1748422989');
INSERT INTO `cp_filephp_2` VALUES ('141','','bank_delete','','','GET','u9/api/v1/php/','','','','0','1','0','1748473077');
INSERT INTO `cp_filephp_2` VALUES ('142','','bank','','','GET','u9/api/v1/php/','','','','0','1','0','1748474265');
INSERT INTO `cp_filephp_2` VALUES ('143','','company_delete','','','GET','u9/api/v1/php/','','','','0','1','0','1748475662');
INSERT INTO `cp_filephp_2` VALUES ('144','','person_add','','','POST','u9/api/v1/php/','','','','0','1','0','1748476129');
INSERT INTO `cp_filephp_2` VALUES ('145','','person_edit','','','POST','u9/api/v1/php/','','','','0','1','0','1748477068');
INSERT INTO `cp_filephp_2` VALUES ('146','','person_delete','','','GET','u9/api/v1/php/','','','','0','1','0','1748477539');
INSERT INTO `cp_filephp_2` VALUES ('147','','product_edit','','','GET','u9/api/v1/php/','','','','0','1','0','1748483839');
INSERT INTO `cp_filephp_2` VALUES ('148','','product_add','','','GET','u9/api/v1/php/','','','','0','1','0','1748483855');
INSERT INTO `cp_filephp_2` VALUES ('149','','product_edit-','','','GET','u9/api/v2/php/','','','','0','1','0','1748490738');
INSERT INTO `cp_filephp_2` VALUES ('150','','product_buy','','','GET','u9/api/v1/php/','','','','0','1','0','1748496946');
INSERT INTO `cp_filephp_2` VALUES ('151','','product_retur','','','POST','u9/api/v1/php/','','','','0','1','0','1748604094');
INSERT INTO `cp_filephp_2` VALUES ('152','','action_out_add','','','POST','u9/api/v1/php/','','email=navismur@gmail.com&password=jakarta2000','','0','1','0','1748989765');
INSERT INTO `cp_filephp_2` VALUES ('153','','product_sell','','','GET','u9/api/v1/php/','','','','0','1','0','1748579455');
INSERT INTO `cp_filephp_2` VALUES ('154','','sales','','','GET','u9/api/v1/php/','','','','0','1','0','1748595203');
INSERT INTO `cp_filephp_2` VALUES ('155','','fcode','','','GET','u9/api/v1/php/','','','','0','1','0','1748651241');
INSERT INTO `cp_filephp_2` VALUES ('156','','tes_equ_count','','','POST','u9/api/v1/php/','','','','0','1','0','1748780644');
INSERT INTO `cp_filephp_2` VALUES ('157','','journal','','','GET','u9/api/v1/php/','','','','0','1','0','1748666517');
INSERT INTO `cp_filephp_2` VALUES ('158','','action_edit','','action_at=2025-01-31&cat=2&bank=1&amount=1300000&invoice=j-01&descr=tes+kiri&pay_to=&pay_from=&inout=2&id=79','GET','u9/api/v1/php/','','','','0','1','0','1748677549');
INSERT INTO `cp_filephp_2` VALUES ('159','','inc/inc.bank','','','GET','u9/','','','','0','1','0','1748679340');
INSERT INTO `cp_filephp_2` VALUES ('160','','inc/inc.files','','','GET','u9/','','','','0','1','0','1748679354');
INSERT INTO `cp_filephp_2` VALUES ('161','','image_delete','','','POST','u9/api/v1/php/','','','','0','1','0','1748683140');
INSERT INTO `cp_filephp_2` VALUES ('162','','images','','','POST','u9/api/v1/php/','','','','0','1','0','1748683880');
INSERT INTO `cp_filephp_2` VALUES ('163','','inc.common.function','','','GET','u9/','','','','0','1','0','1748687862');
INSERT INTO `cp_filephp_2` VALUES ('164','','start','','','GET','u9/api/v1/php/','','','','0','1','0','1748703036');
INSERT INTO `cp_filephp_2` VALUES ('165','','action_in_add','','','POST','u9/api/v1/php/','','email=navismur@gmail.com&password=jakarta2000','','0','1','0','1748705963');
INSERT INTO `cp_filephp_2` VALUES ('166','','action_delete','','','POST','u9/api/v1/php/','','','','0','1','0','1748739057');
INSERT INTO `cp_filephp_2` VALUES ('167','','inc/inc.trx_title','','','GET','u9/','','','','0','1','0','1748830507');
INSERT INTO `cp_filephp_2` VALUES ('168','','index','','','GET','u9/api/v1/','','','','0','1','0','1748840719');
INSERT INTO `cp_filephp_2` VALUES ('169','','signin','','','POST','u9/api/v1/php/','','email=navismur@gmail.com&password=jakarta2000','','0','1','0','1748995263');
INSERT INTO `cp_filephp_2` VALUES ('170','','inc/inc.summary','','','GET','u9/','','','','0','1','0','1750221218');


DROP TABLE IF EXISTS `cp_sphp`;
CREATE TABLE `cp_sphp` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `modul` varchar(99) DEFAULT NULL,
  `name` varchar(99) DEFAULT NULL,
  `body` text DEFAULT NULL,
  `is` varchar(10) DEFAULT '0',
  `del` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=delete',
  `level` tinyint(4) NOT NULL DEFAULT 0,
  `parent` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `folder_name` (`modul`(20),`name`),
  KEY `id_folder_slug` (`id`,`modul`(20)),
  KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `cp_sphp` VALUES ('1','api','api','','php','0','1','0','1748424030');
INSERT INTO `cp_sphp` VALUES ('2','app','app','','php','0','1','0','0');
INSERT INTO `cp_sphp` VALUES ('3','common','common','','php','0','1','0','1748689002');
INSERT INTO `cp_sphp` VALUES ('4','api','transaction_byid','function transaction_byid() {\n  global $ar,$db;\n  $dt=array();\n  $sql="SELECT * from `transaction` where id>0 order by id";\n  $res2=mysqli_query($db,$sql);\n  while($r2=mysqli_fetch_assoc($res2)) {\n    $d=$r2[\'id\'];\n    $dt[$d]=$r2;    \n    if($r2[\'inout\']==2) {\n      $rp="-".ang2($r2[\'amount\']);\n      $col="red";\n    } else {\n      $rp=ang2($r2[\'amount\']);\n      $col="green"; \n    }\n    $dt[$d][\'rp\']=$rp;    \n    $dt[$d][\'col\']=$col;    \n    $dt[$d][\'act_datetime\']=date("Y-m-d H:i:s",$r2[\'action_at\']);\n    $dt[$d][\'act_date\']=date("Y-m-d",$r2[\'action_at\']);\n    $dt[$d][\'act_month\']=date("Y-m",$r2[\'action_at\']);\n    $dt[$d][\'update\']=date("Y-m-d H:i:s",$r2[\'update_at\']);\n  }\n  return $dt;    \n}','php','0','2','1','1748424212');
INSERT INTO `cp_sphp` VALUES ('5','api','transaction_byseq','function transaction_byseq() {\n  global $ar,$db;\n  $dt=array();\n  $sql="SELECT * from `transaction` where id>0 order by id desc";\n  $res2=mysqli_query($db,$sql);\n  $d=0;\n  while($r2=mysqli_fetch_assoc($res2)) {\n    //$d=$r2[\'id\'];\n    $dt[$d]=$r2;    \n    if($r2[\'inout\']==2) {\n      $rp="-".ang2($r2[\'amount\']);\n      $col="red";\n    } else {\n      $rp=ang2($r2[\'amount\']);\n      $col="green"; \n    }\n    $dt[$d][\'rp\']=$rp;    \n    $dt[$d][\'col\']=$col;    \n    $dt[$d][\'image\']=$ar[\'imgurl\']."".$r2[\'img\'];  \n    $dt[$d][\'act_datetime\']=date("Y-m-d H:i:s",$r2[\'action_at\']);\n    $dt[$d][\'act_date\']=date("Y-m-d",$r2[\'action_at\']);\n    $dt[$d][\'act_month\']=date("Y-m",$r2[\'action_at\']);\n    $dt[$d][\'update\']=date("Y-m-d H:i:s",$r2[\'update_at\']);\n    $d++;\n  }\n  return $dt;    \n}','php','0','2','1','1748424234');
INSERT INTO `cp_sphp` VALUES ('6','api','journal_add','function journal_add($transaction_id) {\n  global $ar,$db;\n  $dt=array();\n  $sql = "select * from transaction where id=".$transaction_id;\n  $res = mysqli_query($db, $sql);\n  //echo $sql;\n  $r1 = mysqli_fetch_assoc($res);    \n\n    $sql3 = "select id,id2,id-id2 as k from journal where id-id2>0 order by id2 limit 1";\n    $res3 = mysqli_query($db, $sql3);\n    if(mysqli_num_rows($res3)>0) {\n      $rw3 = mysqli_fetch_assoc($res3);\n      $id2=$rw3[\'id2\'];\n    } else {\n      $sql4 = "select * from journal order by id desc limit 1";\n      $res4 = mysqli_query($db, $sql4);\n      $rw4 = mysqli_fetch_assoc($res4);\n      if(isset($rw4[\'id\']) && $rw4[\'id\']>0) {\n        $id2=$rw4[\'id\']+1;\n      } else {\n        $id2=1;\n      }\n    }\n\n    $idt1=array(\n      \'id\'=>$id2,\n      \'transaction_id\'=>$r1[\'id\'],\n      \'action_at\'=>$r1[\'action_at\'],\n      \'amount\'=>to_numeric($r1[\'amount\']),\n      \'debit\'=>to_numeric($r1[\'amount\']),\n      \'inout\'=>1,\n      \'account_code\'=>$r1[\'debit\'],\n      \'action_id\'=>$r1[\'action_id\'],\n      \'seq\'=>$r1[\'seq\'],\n      \'year\'=>date("Y",$r1[\'action_at\']),\n      \'week\'=>date("W",$r1[\'action_at\']),\n      \'month\'=>date("Ym",$r1[\'action_at\']),\n    ); \n    $udt1=array(\n      \'transaction_id\'=>$r1[\'id\'],\n      \'action_at\'=>$r1[\'action_at\'],\n      \'amount\'=>to_numeric($r1[\'amount\']),\n      \'debit\'=>to_numeric($r1[\'amount\']),\n      \'inout\'=>1,\n      \'account_code\'=>$r1[\'debit\'],\n      \'action_id\'=>$r1[\'action_id\'],\n      \'seq\'=>$r1[\'seq\'],\n      \'year\'=>date("Y",$r1[\'action_at\']),\n      \'week\'=>date("W",$r1[\'action_at\']),\n      \'month\'=>date("Ym",$r1[\'action_at\']),\n      \'update_at\'=>time(),\n    );\n    InsertUpdate($db,"journal",$idt1,$udt1,0); \n    tool_id2("journal"); \n\n    $sql3 = "select id,id2,id-id2 as k from journal where id-id2>0 order by id2 limit 1";\n    $res3 = mysqli_query($db, $sql3);\n    if(mysqli_num_rows($res3)>0) {\n      $rw3 = mysqli_fetch_assoc($res3);\n      $id2=$rw3[\'id2\'];\n    } else {\n      $sql4 = "select * from journal order by id desc limit 1";\n      $res4 = mysqli_query($db, $sql4);\n      $rw4 = mysqli_fetch_assoc($res4);\n      if(isset($rw4[\'id\']) && $rw4[\'id\']>0) {\n        $id2=$rw4[\'id\']+1;\n      } else {\n        $id2=1;\n      }\n    }\n\n    $idt2=array(\n      \'id\'=>$id2,\n      \'action_at\'=>$r1[\'action_at\'],\n      \'seq\'=>$r1[\'seq\'],\n      \'transaction_id\'=>$r1[\'id\'],\n      \'action_id\'=>$r1[\'action_id\'],\n      \'amount\'=>to_numeric($r1[\'amount\']),\n      \'credit\'=>to_numeric($r1[\'amount\']),\n      \'inout\'=>2,\n      \'account_code\'=>$r1[\'credit\'],\n      \'year\'=>date("Y",$r1[\'action_at\']),\n      \'week\'=>date("W",$r1[\'action_at\']),\n      \'month\'=>date("Ym",$r1[\'action_at\']),\n    ); \n    $udt2=array(\n      \'transaction_id\'=>$r1[\'id\'],\n      \'action_id\'=>$r1[\'action_id\'],\n      \'action_at\'=>$r1[\'action_at\'],\n      \'seq\'=>$r1[\'seq\'],\n      \'amount\'=>to_numeric($r1[\'amount\']),\n      \'credit\'=>to_numeric($r1[\'amount\']),\n      \'inout\'=>2,\n      \'account_code\'=>$r1[\'credit\'],\n      \'year\'=>date("Y",$r1[\'action_at\']),\n      \'week\'=>date("W",$r1[\'action_at\']),\n      \'month\'=>date("Ym",$r1[\'action_at\']),\n      \'update_at\'=>time(),\n    );\n    InsertUpdate($db,"journal",$idt2,$udt2,0); \n    tool_id2("journal");  \n    account_equation($r1); \n    $dt[\'message\']="journal & account_equation added";\n    //$dt[\'account_equation\']=account_equation($r1);    \n    //JournalCount(date("Y",$r1[\'action_at\']));\n    return $dt;\n}','php','0','2','1','1748424288');
INSERT INTO `cp_sphp` VALUES ('7','api','action_add_v2','function action_add_v2($js){\n  global $ar,$db;\n  $dt=array();\n\n  $sql3 = "select id,id2,id-id2 as k from `action` where id-id2>0 order by id2 limit 1";\n  $res3 = mysqli_query($db, $sql3);\n  if(mysqli_num_rows($res3)>0) {\n    $rw3 = mysqli_fetch_assoc($res3);\n    $id2=$rw3[\'id2\'];\n  } else {\n    $sql4 = "select * from `action` order by id desc limit 1";\n    $res4 = mysqli_query($db, $sql4);\n    $rw4 = mysqli_fetch_assoc($res4);\n    if(isset($rw4[\'id\']) && $rw4[\'id\']>0) {\n      $id2=$rw4[\'id\']+1;\n    } else {\n      $id2=1;\n    }\n  }\n\n  $idt=array(\n    \'id\'=>$id2,\n    \'action_at\'=>strtotime($js[\'action_at\']),\n    \'descr\'=>$js[\'descr\'],\n    \'cat\'=>$js[\'cat\'],\n    \'inout\'=>$js[\'inout\'],\n    \'bank\'=>$js[\'bank\'],\n    \'amount\'=>$js[\'amount\'],\n    \'year\'=>date("Y",strtotime($js[\'action_at\'])),\n    \'month\'=>date("Ym",strtotime($js[\'action_at\'])),\n    \'tgl\'=>date("Y-m-d",strtotime($js[\'action_at\'])),\n    \'update_at\'=>time(),\n  );\n  if(isset($js[\'pay_to\'])) {\n    $idt[\'pay_to\']=$js[\'pay_to\'];  \n  }\n  if(isset($js[\'pay_from\'])) {\n    $idt[\'pay_from\']=$js[\'pay_from\'];  \n  }\n  if(isset($js[\'invoice\'])) {\n    $idt[\'invoice\']=$js[\'invoice\'];  \n  }\n  if(isset($js[\'reff_sales_id\'])) {\n    $idt[\'reff_sales_id\']=$js[\'reff_sales_id\'];  \n  }\n  Insert($db,"action",$idt,0);  \n  tool_id2("action");\n  $dt[\'action_id\']=$id2;\n  $dt[\'success\']=true;\n  return $dt;\n}','php','0','2','1','1748589472');
INSERT INTO `cp_sphp` VALUES ('8','api','sales_action_v2','function sales_action_v2($js,$v=0) {\n  global $db,$ar;\n  $dt=array();\n/*  \n\ncat=4=jual tunai\n- id1\n- persediaan berkurang //credit: 11202\n- hpp debit //51100\n\n-id2\n- terima cash dr penjualan //debit 11101\n- penjualan bertambah //credit 41100\n\ncat=7=jual kredit\n- id1\n- persediaan berkurang //credit: 11202\n- hpp debit //51100\n\n-id2\n- piutang berambah dr penjualan //debit 11201\n- penjualan bertambah //credit 41100\n\nitem_inout=2 (berkurang)\n\ncat=1, retur dr agen, menambah persediaan, mengurangi piutang\ncat=2, retur ke supplier, mengurangi utang dan persediaan\npersediaan/11202 dan utang dagang 21100\n*/\n\n\n  $sql4 = "select id from `action` order by id desc limit 1";\n  $res4 = mysqli_query($db, $sql4);\n  $r4 = mysqli_fetch_assoc($res4);\n  $id1=$r4[\'id\']+1;\n  $id2=$r4[\'id\']+2;\n\n  //catat penjualan-hpp\n\n  $idt1=array(\n    \'id\'=>$id1,\n    \'action_at\'=>strtotime($js[\'action_at\']),\n    \'pay_from\'=>$js[\'pay_from\'],\n    \'invoice\'=>$js[\'invoice\'],\n    \'reff_sales_id\'=>$js[\'reff_sales_id\'],\n    \'inout\'=>1,\n    \'descr\'=>$js[\'descr\'],\n    \'bank\'=>0,\n    \'cat\'=>$js[\'cat\'],\n    \'amount\'=>$js[\'qty\']*$js[\'hpp\'],\n    \'year\'=>date("Y",strtotime($js[\'action_at\'])),\n    \'month\'=>date("Ym",strtotime($js[\'action_at\'])),\n    \'tgl\'=>date("Y-m-d",strtotime($js[\'action_at\'])),\n    \'update_at\'=>time(),\n  );\n  Insert($db,"action",$idt1,$v);\n  $js1=$js;\n  $js1[\'action_id\']=$id1;\n  $js1[\'debit\']=51100; //hpp\n  $js1[\'credit\']=11202; //persediaan\n  //$dt[\'trx\']=transaction_add_v2($js1);\n  transaction_add_v2($js1);\n\n  $rr[\'descr\'][4]   ="Terima cash dari ";\n  $rr[\'debit\'][4]   =11101;\n  $rr[\'credit\'][4]  =41100;\n  $rr[\'bank\'][4]    =1;\n\n  $rr[\'descr\'][7]   ="Piutang ".$js[\'due_days\']." hari dari ";\n  $rr[\'debit\'][7]   =11201;\n  $rr[\'credit\'][7]  =41100;\n  $rr[\'bank\'][7]    =0;\n\n\n\n  // catat cash-penjuala (jika 4), piutang-penjualan (jika 7)\n  $idt2=array(\n    \'id\'=>$id2,\n    \'action_at\'=>strtotime($js[\'action_at\']),\n    \'pay_from\'=>$js[\'pay_from\'],\n    \'invoice\'=>$js[\'invoice\'],\n    \'reff_sales_id\'=>$js[\'reff_sales_id\'],\n    \'inout\'=>1,\n    \'descr\'=>$rr[\'descr\'][$js[\'cat\']]." ".$js[\'descr\'],\n    \'bank\'=>$rr[\'bank\'][$js[\'cat\']],\n    \'cat\'=>$js[\'cat\'],\n    \'amount\'=>$js[\'qty\']*$js[\'price_per_unit\'],\n    \'year\'=>date("Y",strtotime($js[\'action_at\'])),\n    \'month\'=>date("Ym",strtotime($js[\'action_at\'])),\n    \'tgl\'=>date("Y-m-d",strtotime($js[\'action_at\'])),\n    \'update_at\'=>time(),\n  );\n  Insert($db,"action",$idt2,$v);\n  $js2=$js;\n  $js2[\'action_id\']=$id2;\n  $js2[\'debit\']=$rr[\'debit\'][$js[\'cat\']];\n  $js2[\'credit\']=$rr[\'credit\'][$js[\'cat\']];\n  //$dt[\'trx\']=transaction_add_v2($js2);\n  transaction_add_v2($js2);\n\n  //catat di product_trx\n  $js3[\'action_at\']=strtotime($js[\'action_at\']);\n  $js3[\'inout\']=2;\n  $js3[\'remark\']=$js[\'descr\'];\n  $js3[\'action_id\']=$id1;\n  product_trx($js3);\n  $dt[\'message\']="add transaction succes";\n\n  $udt_41=array(\n    \'action_id_1\'=>$id1,\n    \'action_id_2\'=>$id2,\n  );\n  Update($db,"sales",$udt_41,"id=".$js[\'reff_sales_id\'],$v);\n\n  return $dt;\n}','php','0','2','1','1748768668');
INSERT INTO `cp_sphp` VALUES ('9','api','bank','function bank(){\n  global $ar,$db;\n  $dt=array();\n  $sql2="SELECT * from `bank` where del=0";\n  $res2=mysqli_query($db,$sql2);\n  $r2=mysqli_num_rows($res2);\n  $dt[\'count\']=$r2;\n  $dt[\'success\']=true;\n\n  $sql=$sql2." order by id desc";\n  //echo $sql.";<br>";\n  $res=mysqli_query($db,$sql);\n  if(mysqli_num_rows($res2)>0) {\n    $c=0;\n    while($r1=mysqli_fetch_assoc($res)) {\n      $dt[\'data\'][$c]=$r1;    \n      $dt[\'data\'][$c][\'rp\']=ang2($r1[\'amount\']);    \n      $dt[\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n      $c++;\n    }\n  } else {\n    $dt[\'count\']=0;\n    $dt[\'error\']=true;\n    $dt[\'message\']="data action not found";\n  }\n  return $dt;\n  $db->close();\n}','php','0','2','1','1748499497');
INSERT INTO `cp_sphp` VALUES ('10','api','company','function company(){\n  global $ar,$db;\n  $dt=array();\n  $sql2="SELECT * from `company` where del=0";\n  $res2=mysqli_query($db,$sql2);\n  $r2=mysqli_num_rows($res2);\n  $dt[\'count\']=$r2;\n  $dt[\'success\']=true;\n\n  $sql=$sql2." order by name";\n  //echo $sql.";<br>";\n  $res=mysqli_query($db,$sql);\n  if(mysqli_num_rows($res2)>0) {\n    $c=0;\n    while($r1=mysqli_fetch_assoc($res)) {\n      $dt[\'data\'][$c]=$r1;    \n      $dt[\'data\'][$c][\'image\']=$ar[\'imgurl\']."".$r1[\'img\'];    \n      $dt[\'data\'][$c][\'as\']=$ar[\'relation\'][$r1[\'relation\']];    \n      $dt[\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n      $c++;\n    }\n  } else {\n    $dt[\'count\']=0;\n    $dt[\'error\']=true;\n    $dt[\'message\']="data action not found";\n  }\n  return $dt;\n  $db->close();\n}','php','0','2','1','1748475588');
INSERT INTO `cp_sphp` VALUES ('11','api','person','function person(){\n  global $ar,$db;\n  $dt=array();\n  $sql2="SELECT * from `person` where del=0";\n  $res2=mysqli_query($db,$sql2);\n  $r2=mysqli_num_rows($res2);\n  $dt[\'count\']=$r2;\n  $dt[\'success\']=true;\n\n  $sql=$sql2." order by id";\n  //echo $sql.";<br>";\n  $res=mysqli_query($db,$sql);\n  if(mysqli_num_rows($res2)>0) {\n    $c=0;\n    while($r1=mysqli_fetch_assoc($res)) {\n      $dt[\'data\'][$c]=$r1;    \n      $dt[\'data\'][$c][\'image\']=$ar[\'imgurl\']."".$r1[\'img\'];    \n      $dt[\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n      $c++;\n    }\n  } else {\n    $dt[\'count\']=0;\n  }  \n  return $dt;\n  $db->close();\n}','php','0','2','1','1748477025');
INSERT INTO `cp_sphp` VALUES ('12','api','product','function product(){\n  global $ar,$db;  \n  $dt=array();\n  $dt2=array();\n  //id,name,brand,qty,item_code,price_per_unit,update_at\n  $sql2="SELECT `brand` from `product` where `del`=0 group by `brand` order by `brand`";\n  $res2=mysqli_query($db,$sql2);\n  //$dt[\'count\']=$r2;\n  $count=0;\n  if(mysqli_num_rows($res2)>0) {\n    $c=0;\n    while($r2=mysqli_fetch_assoc($res2)) {\n      $dt[\'data\'][\'by_brand\'][$c][\'brand\']=$r2[\'brand\'];\n      $sql3="SELECT id,name,qty,item_code,price_per_unit,img,update_at from `product` where del=0 and brand=\'".$r2[\'brand\']."\' order by `name`";\n      $res3=mysqli_query($db,$sql3);\n      $d=0;\n      while($r3=mysqli_fetch_assoc($res3)) {\n        $i_img_med=str_replace(\'small\',\'medium\',$r3[\'img\']);\n        $i_img_big=str_replace(\'small\',\'big\',$r3[\'img\']);\n        $dt[\'data\'][\'by_brand\'][$c][\'items\'][$d]=$r3;\n        $dt[\'data\'][\'by_brand\'][$c][\'items\'][$d][\'url_img\']=$ar[\'img_url\'].\'\'.$r3[\'img\'];\n        $dt[\'data\'][\'by_brand\'][$c][\'items\'][$d][\'url_img_medium\']=$ar[\'img_url\'].\'\'.$i_img_med;\n        $dt[\'data\'][\'by_brand\'][$c][\'items\'][$d][\'url_img_big\']=$ar[\'img_url\'].\'\'.$i_img_big;\n        $dt[\'data\'][\'by_brand\'][$c][\'items\'][$d][\'hpp\']=ang2($r3[\'price_per_unit\']);\n        $dt[\'data\'][\'by_brand\'][$c][\'items\'][$d][\'amount\']=ang2($r3[\'price_per_unit\']*$r3[\'qty\']);\n        $dt[\'data\'][\'by_brand\'][$c][\'items\'][$d][\'update\']=date("Y-m-d H:i:s",$r3[\'update_at\']);\n\n        $sql4="SELECT a.id,a.action_id,a.transaction_id,a.item_in,a.item_out,a.`balance`,a.invoice,a.tgl,a.`inout`,b.descr from `product_trx` a JOIN `action` b ON a.action_id=b.id where product_id=".$r3[\'id\']." order by a.action_at,a.action_id ";\n        $res4=mysqli_query($db,$sql4);\n        $e=0;\n        while($r4=mysqli_fetch_assoc($res4)) {\n          $dt[\'data\'][\'by_brand\'][$c][\'items\'][$d][\'trx\'][$e]=$r3;\n          $dt[\'data\'][\'by_brand\'][$c][\'items\'][$d][\'trx\'][$e][\'amount\']=ang2($r3[\'balance\']*$r1[\'price_per_unit\']);\n          $e++;\n        }        \n        $d++;\n        $count++;\n      }\n      $c++;\n    }\n\n    \n    $sql5="SELECT id,name,img,brand,qty,item_code,price_per_unit,update_at from `product` where del=0 order by id";\n    //echo $sql.";<br>";\n    $res5=mysqli_query($db,$sql5);\n    while($r5=mysqli_fetch_assoc($res5)) {\n      $c=$r5[\'id\'];\n\n      $i_img_med=str_replace(\'small\',\'medium\',$r5[\'img\']);\n      $i_img_big=str_replace(\'small\',\'big\',$r5[\'img\']);\n\n      $dt[\'data\'][\'by_id\'][$c]=$r5;\n      $dt[\'data\'][\'by_id\'][$c][\'url_img\']=$ar[\'img_url\'].\'\'.$r5[\'img\'];\n      $dt[\'data\'][\'by_id\'][$c][\'url_img_medium\']=$ar[\'img_url\'].\'\'.$i_img_med;\n      $dt[\'data\'][\'by_id\'][$c][\'url_img_big\']=$ar[\'img_url\'].\'\'.$i_img_big;\n      $dt[\'data\'][\'by_id\'][$c][\'hpp\']=ang2($r5[\'price_per_unit\']);\n      $dt[\'data\'][\'by_id\'][$c][\'amount\']=ang2($r5[\'price_per_unit\']*$r5[\'qty\']);\n      $dt[\'data\'][\'by_id\'][$c][\'update\']=date("Y-m-d H:i:s",$r5[\'update_at\']);\n      $sql6="SELECT a.id,a.action_id,a.transaction_id,a.item_in,a.item_out,a.`balance`,a.invoice,a.tgl,a.`inout`,b.descr from `product_trx` a JOIN `action` b ON a.action_id=b.id where product_id=".$r5[\'id\']." order by a.action_at,a.action_id ";\n      $res6=mysqli_query($db,$sql6);\n      $d=0;\n      while($r6=mysqli_fetch_assoc($res6)) {\n        $dt[\'data\'][\'by_id\'][$c][\'trx\'][$d]=$r6;\n        $dt[\'data\'][\'by_id\'][$c][\'trx\'][$d][\'amount\']=ang2($r6[\'balance\']*$r5[\'price_per_unit\']);\n        $d++;\n      }\n    }\n\n    $dt[\'count\']=$count;\n    $dt[\'success\']=true;\n  } else {\n    $dt[\'count\']=0;\n  }  \n  return $dt;\n  $db->close();\n}','php','0','2','1','1748481911');
INSERT INTO `cp_sphp` VALUES ('13','api','action_byid','function action_byid() {\n  global $ar,$db;\n  $dt=array();\n  $sql="SELECT * from `action` where id>0 order by id";\n  $res2=mysqli_query($db,$sql);\n  while($r2=mysqli_fetch_assoc($res2)) {\n    $d=$r2[\'id\'];\n    $dt[$d]=$r2;    \n    if($r2[\'inout\']==2) {\n      $rp="-".ang2($r2[\'amount\']);\n      $col="red";\n      $p3=$r2[\'pay_to\'];       \n    } else {\n      $rp=ang2($r2[\'amount\']);\n      $col="green"; \n      $p3=$r2[\'pay_from\'];       \n    }\n    $dt[$d][\'rp\']=$rp;    \n    $dt[$d][\'col\']=$col;    \n    $dt[$d][\'p3\']=$p3;    \n    $dt[$d][\'image\']=$ar[\'imgurl\']."".$r2[\'img\'];  \n    $dt[$d][\'act_datetime\']=date("Y-m-d H:i:s",$r2[\'action_at\']);\n    $dt[$d][\'act_date\']=date("Y-m-d",$r2[\'action_at\']);\n    $dt[$d][\'act_month\']=date("Y-m",$r2[\'action_at\']);\n    $dt[$d][\'update\']=date("Y-m-d H:i:s",$r2[\'update_at\']);\n  }\n  return $dt;    \n}','php','0','2','1','1748423982');
INSERT INTO `cp_sphp` VALUES ('14','app','tool_id2','function tool_id2($tbl) {\n  global $db,$ar;\n  $sql = "select * from ".$tbl." order by id";\n  $res = mysqli_query($db, $sql);\n  $id2=1;\n  while($rw = mysqli_fetch_assoc($res)) {\n    $udt=array(\n      \'id2\'=>$id2,\n    );    \n    Update($db,$tbl,$udt,"id=".$rw[\'id\'],0);\n    $id2++;\n  }  \n}','php','0','2','2','1748499552');
INSERT INTO `cp_sphp` VALUES ('15','app','tool_id3','function tool_id3($tbl) {\n  global $db,$ar;\n  \n  $sql4 = "select id from ".$tbl." where id2=id order by id desc limit 1";\n  $res4 = mysqli_query($db, $sql4);\n  $rw4 = mysqli_fetch_assoc($res4);\n  if(isset($rw4) && $rw4[\'id\']>0) {        \n    $sql = "select * from ".$tbl." where id>".$rw4[\'id\']." order by id";\n    $res = mysqli_query($db, $sql);\n    $id2=$rw4[\'id\']+1;\n    while($rw = mysqli_fetch_assoc($res)) {\n      $udt=array(\n          \'id2\'=>$id2,\n      );\n      Update($db,$tbl,$udt,"id=".$rw[\'id\'],0);\n      $id2++;\n    }  \n  }\n}','php','0','2','2','1748499593');
INSERT INTO `cp_sphp` VALUES ('16','app','product_trx_count','function product_trx_count() {\n  global $db,$ar;\n  \n  $sql4 = "select product_id from product_trx group by product_id";\n  $res4 = mysqli_query($db, $sql4);\n  while($rw4 = mysqli_fetch_assoc($res4)) {\n    $sql = "select * from product_trx where product_id=".$rw4[\'product_id\']." order by action_at";\n    $res = mysqli_query($db, $sql);\n    $j[\'balance\']=0;\n    while($r=mysqli_fetch_assoc($res)) {\n      $j[\'balance\']=$j[\'balance\']+$r[\'item_in\']-$r[\'item_out\'];\n      $udt=array(\n        \'balance\'=>$j[\'balance\'],\n      );\n      Update($db,"product_trx",$udt,"id=".$r[\'id\'],0);\n    }\n    $udt=array(\n      \'qty\'=>$j[\'balance\'],\n    );\n    Update($db,"product",$udt,"id=".$rw4[\'product_id\'],0);\n  }\n}','php','0','2','2','1748594290');
INSERT INTO `cp_sphp` VALUES ('17','app','product_trx','function product_trx($js) {\n  global $db,$ar;\n  //$dt=array();\n  //echo "<pre>"; print_r($js); echo "</pre>";\n  //beli=add inout=1; jual=minus; inout=2\n  $sql4 = "select id from product_trx order by id desc limit 1";\n  $res4 = mysqli_query($db, $sql4);\n  $rw4 = mysqli_fetch_assoc($res4);\n  if(isset($rw4) && $rw4[\'id\']>0) {        \n    $id2=$rw4[\'id\']+1;\n  } else {\n    $id2=1;\n  }\n  $idt=array(\n    \'id\'=>$id2,\n    \'action_at\'=>$js[\'action_at\'],\n    \'action_id\'=>$js[\'action_id\'],\n    \'product_id\'=>$js[\'product_id\'],\n    \'item_code\'=>$js[\'item_code\'],\n    \'inout\'=>$js[\'inout\'],\n    \'invoice\'=>$js[\'invoice\'],\n    \'remark\'=>$js[\'descr\'],\n    \'year\'=>date("Y",$js[\'action_at\']),\n    \'month\'=>date("Ym",$js[\'action_at\']),\n    \'tgl\'=>date("Y-m-d",$js[\'action_at\']),\n    \'update_at\'=>time(),\n  );\n  $udt=array(\n    \'action_at\'=>$js[\'action_at\'],\n    \'action_id\'=>$js[\'action_id\'],\n    \'product_id\'=>$js[\'product_id\'],\n    \'item_code\'=>$js[\'item_code\'],\n    \'inout\'=>$js[\'inout\'],\n    \'invoice\'=>$js[\'invoice\'],\n    \'remark\'=>$js[\'descr\'],\n    \'year\'=>date("Y",$js[\'action_at\']),\n    \'month\'=>date("Ym",$js[\'action_at\']),\n    \'tgl\'=>date("Y-m-d",$js[\'action_at\']),\n    \'update_at\'=>time(),\n  );\n  if($js[\'inout\']==1) {\n    $idt[\'item_in\']=$udt[\'item_in\']=$js[\'qty\'];\n  } else {\n    $idt[\'item_out\']=$udt[\'item_out\']=$js[\'qty\'];\n  }\n  InsertUpdate($db,"product_trx",$idt,$udt,0);\n}','php','0','2','2','1748504043');
INSERT INTO `cp_sphp` VALUES ('18','app','JournalCount','function JournalCount($year) {\n  global $db,$ar;\n  $sql6="update account set sel2=0";\n  $res6=mysqli_query($db,$sql6);\n  $sql3="SELECT * from action order by action_at,seq";\n  $res3=mysqli_query($db,$sql3);\n  while($r3=mysqli_fetch_assoc($res3)) {\n      $udt3=array(\n          \'seq\'=>$r3[\'seq\'],\n      );\n      Update($db,"journal",$udt3,"action_id=".$r3[\'id\'],0);\n      Update($db,"transaction",$udt3,"action_id=".$r3[\'id\'],0);\n  }\n  $sql="SELECT account_code from journal group by account_code";\n  $res=mysqli_query($db,$sql);\n  while($r1=mysqli_fetch_assoc($res)) {\n    $sql2="SELECT * from journal where year=".$year." and account_code=\'".$r1[\'account_code\']."\' order by action_at asc, seq asc";\n    //echo $sql2."<br>";\n    $res2=mysqli_query($db,$sql2);\n    $bal=0;\n    $seq2=1;\n    while($r2=mysqli_fetch_assoc($res2)) {\n      $bal=$bal+$r2[\'debit\']-$r2[\'credit\'];\n      $udt=array(\n        \'balance\'=>$bal,\n        \'seq2\'=>$seq2,\n        \'update_at\'=>time(),\n      );\n      Update($db,"journal",$udt,"id=".$r2[\'id\'],1);\n      $seq2++;\n    } \n    $udt4=array(\n      \'sel2\'=>1,\n    );\n    Update($db,"account",$udt4,"code=\'".$r1[\'account_code\']."\'",0);  \n  }  \n}','php','0','2','2','1748499670');
INSERT INTO `cp_sphp` VALUES ('19','app','JournalCount_v2','function JournalCount_v2($year) {\n  global $db,$ar;\n  $sql6="update fcode set sel2=0";\n  $res6=mysqli_query($db,$sql6);\n  $sql3="SELECT * from action order by action_at,seq";\n  $res3=mysqli_query($db,$sql3);\n  while($r3=mysqli_fetch_assoc($res3)) {\n      $udt3=array(\n          \'seq\'=>$r3[\'seq\'],\n      );\n      Update($db,"journal",$udt3,"action_id=".$r3[\'id\'],0);\n      Update($db,"transaction",$udt3,"action_id=".$r3[\'id\'],0);\n  }\n  $sql="SELECT account_code from journal group by account_code";\n  $res=mysqli_query($db,$sql);\n  while($r1=mysqli_fetch_assoc($res)) {\n    $sql2="SELECT * from journal where year=".$year." and account_code=\'".$r1[\'account_code\']."\' order by action_at asc, seq asc";\n    //echo $sql2."<br>";\n    $res2=mysqli_query($db,$sql2);\n    $bal=0;\n    $seq2=1;\n    while($r2=mysqli_fetch_assoc($res2)) {\n      $bal=$bal+$r2[\'debit\']-$r2[\'credit\'];\n      $udt=array(\n        \'balance\'=>$bal,\n        \'seq2\'=>$seq2,\n        \'update_at\'=>time(),\n      );\n      Update($db,"journal",$udt,"id=".$r2[\'id\'],0);\n      $seq2++;\n    } \n    $udt4=array(\n      \'sel2\'=>1,\n    );\n    Update($db,"fcode",$udt4,"code=\'c".$r1[\'account_code\']."\'",0);  \n  }  \n}','php','0','2','2','1748499696');
INSERT INTO `cp_sphp` VALUES ('20','app','ExportfMandiri2','function ExportfMandiri2($id) {\n  global $db,$ar;  \n  $sql4 = "select * from mandiri_mutasi where id=".$id;\n  $res4 = mysqli_query($db, $sql4);\n  $r4 = mysqli_fetch_assoc($res4);\n  //echo "<pre>"; print_r($r4); echo "</pre>";\n  \n  if($r4[\'debit\']==0) {\n      $amount=$r4[\'kredit\'];\n      $inout=2;\n      $payto="Mandiri IDR ".substr($r4[\'rek\'],-3);\n      $payfrom="";\n  } else {\n      $amount=$r4[\'debit\'];\n      $inout=1;\n      $payfrom="Mandiri IDR ".substr($r4[\'rek\'],-3);\n      $payto="";\n  }\n  \n  if($r4[\'payto\']!=\'\') {\n      $payto2=$r4[\'payto\'];\n  } else {\n      $payto2=$payto;\n  }\n\n  $sql3 = "select * from action where bank=1 and amount=".$amount." and tgl=\'".$r4[\'tgl\']."\'";\n  echo $sql3."<br>";\n  $res3 = mysqli_query($db, $sql3);\n  if(mysqli_num_rows($res3)>0) {\n    $r3 = mysqli_fetch_assoc($res3);\n    //echo "<pre>"; print_r($r3); echo "</pre>";\n    $udt=array(\n      \'action_id\'=>$r3[\'id\'],\n    );\n    Update($db,"mandiri_mutasi",$udt,"id=".$r4[\'id\'],1);\n      \n  } else {\n    $sql2 = "select id from action where id2=id order by id desc limit 1";\n    $res2 = mysqli_query($db, $sql2);\n    $r2 = mysqli_fetch_assoc($res2);\n    $id2=$r2[\'id\']+1;\n    $idt=array(\n          \'id\'=>$id2,\n          \'action_at\'=>$r4[\'tgl2\'],\n          \'tgl\'=>$r4[\'tgl\'],\n          \'month\'=>$r4[\'month\'],\n          \'year\'=>$r4[\'year\'],\n          \'descr\'=>$r4[\'keterangan\']." ".$r4[\'remark\'],\n          \'pay_to\'=>$payto2,\n          \'pay_from\'=>$payfrom,\n          \'cat\'=>$inout,\n          \'seq\'=>$r4[\'seq\'],\n          \'inout\'=>$inout,\n          \'bank\'=>$ar[\'manp\'][$r4[\'rek\']],\n          \'amount\'=>$amount,\n          \'st\'=>1,\n          \'update_at\'=>time(),\n    );\n    Insert($db,"action",$idt,1);\n    tool_id3("action");      \n    $udt=array(\n      \'action_id\'=>$id2,\n    );\n    Update($db,"mandiri_mutasi",$udt,"id=".$r4[\'id\'],1);\n  }  \n}','php','0','2','2','1748499718');
INSERT INTO `cp_sphp` VALUES ('21','app','SalesAction','function SalesAction($p,$v=0) {\n  global $db,$ar;\n  //echo "<pre>"; print_r($p); echo "</pre>";\n  $ar[\'act_desc\'][1]=\'Penerimaan tunai atas\';\n  $ar[\'act_bank\'][1]=1;\n  $ar[\'act__cat\'][1]=1;\n\n  $ar[\'act_desc\'][2]=\'Piutang kredit \'.$p[\'days_due_date\'].\' atas\';\n  $ar[\'act_bank\'][2]=0;\n  $ar[\'act__cat\'][2]=7; //piutang\n\n  //cek dulu ref id,\n  $sql1 = "select id,reff_sales_id from `action` where reff_sales_id=".$p[\'id\'];\n  $res1 = mysqli_query($db, $sql1);\n  if(mysqli_num_rows($res1)==0) {\n    //insert\n      $sql4 = "select * from `action` order by id desc limit 1";\n      $res4 = mysqli_query($db, $sql4);\n      $r4 = mysqli_fetch_assoc($res4);\n      $id1=$r4[\'id\']+1;\n      $id2=$r4[\'id\']+2;\n\n      $idt1=array(\n        \'id\'=>$id1,\n        \'action_at\'=>strtotime($p[\'sales_at\']),\n        \'reff_sales_id\'=>$p[\'id\'],\n        \'pay_from\'=>$p[\'buyer\'],\n        \'invoice\'=>$p[\'invoice\'],\n        \'inout\'=>1,\n        \'descr\'=>$p[\'descr\'],\n        \'bank\'=>0,\n        \'cat\'=>4,\n        \'amount\'=>$p[\'qty\']*$p[\'hpp\'],\n        \'year\'=>date("Y",strtotime($p[\'sales_at\'])),\n        \'month\'=>date("Ym",strtotime($p[\'sales_at\'])),\n        \'tgl\'=>date("Y-m-d",strtotime($p[\'sales_at\'])),\n        \'update_at\'=>time(),\n      );\n      Insert($db,"action",$idt1,$v);\n      $idt2=array(\n        \'id\'=>$id2,\n        \'action_at\'=>strtotime($p[\'sales_at\']),\n        \'reff_sales_id\'=>$p[\'id\'],\n        \'pay_from\'=>$p[\'buyer\'],\n        \'invoice\'=>$p[\'invoice\'],\n        \'inout\'=>1,\n        \'descr\'=>$ar[\'act_desc\'][$p[\'cash_credit\']]." ".$p[\'descr\'],\n        \'bank\'=>$ar[\'act_bank\'][$p[\'cash_credit\']],\n        \'cat\'=>$ar[\'act__cat\'][$p[\'cash_credit\']],\n        \'amount\'=>$p[\'qty\']*$p[\'price\'],\n        \'year\'=>date("Y",strtotime($p[\'sales_at\'])),\n        \'month\'=>date("Ym",strtotime($p[\'sales_at\'])),\n        \'tgl\'=>date("Y-m-d",strtotime($p[\'sales_at\'])),\n        \'update_at\'=>time(),\n      );\n      Insert($db,"action",$idt2,$v);\n      $udt_41=array(\n        \'action_id_1\'=>$id1,\n        \'action_id_2\'=>$id2,\n      );\n      Update($db,"sales",$udt_41,"id=".$p[\'id\'],$v);\n      //catat di product_trx\n      $p[\'action_at\']=strtotime($p[\'sales_at\']);\n      $p[\'inout\']=2;\n      $p[\'remark\']=$p[\'descr\'];\n      $p[\'action_id\']=$id1;\n      product_trx($p);\n\n\n  } else {\n    $sql2=$sql1." order by id";\n    $res2 = mysqli_query($db, $sql2);\n    $dt=array();\n    while($r2=mysqli_fetch_assoc($res2)) {\n      $dt[\'id\'][]=$r2[\'id\'];\n    }\n    $udt1=array(\n      \'action_at\'=>strtotime($p[\'sales_at\']),\n      \'reff_sales_id\'=>$p[\'id\'],\n      \'pay_from\'=>$p[\'buyer\'],\n      \'invoice\'=>$p[\'invoice\'],\n      \'inout\'=>1,\n      \'descr\'=>$p[\'descr\'],\n      \'bank\'=>0,\n      \'cat\'=>4,\n      \'amount\'=>$p[\'qty\']*$p[\'hpp\'],\n      \'year\'=>date("Y",strtotime($p[\'sales_at\'])),\n      \'month\'=>date("Ym",strtotime($p[\'sales_at\'])),\n      \'tgl\'=>date("Y-m-d",strtotime($p[\'sales_at\'])),\n      \'update_at\'=>time(),\n    );\n    Update($db,"action",$udt1,"id=".$dt[\'id\'][0],$v);\n    $udt2=array(\n      \'action_at\'=>strtotime($p[\'sales_at\']),\n      \'reff_sales_id\'=>$p[\'id\'],\n      \'pay_from\'=>$p[\'buyer\'],\n      \'invoice\'=>$p[\'invoice\'],\n      \'inout\'=>1,\n      \'descr\'=>$ar[\'act_desc\'][$p[\'cash_credit\']]." ".$p[\'descr\'],\n      \'bank\'=>$ar[\'act_bank\'][$p[\'cash_credit\']],\n      \'cat\'=>$ar[\'act__cat\'][$p[\'cash_credit\']],\n      \'amount\'=>$p[\'qty\']*$p[\'price\'],\n      \'year\'=>date("Y",strtotime($p[\'sales_at\'])),\n      \'month\'=>date("Ym",strtotime($p[\'sales_at\'])),\n      \'tgl\'=>date("Y-m-d",strtotime($p[\'sales_at\'])),\n      \'update_at\'=>time(),\n    );\n    Update($db,"action",$udt2,"id=".$dt[\'id\'][1],$v);\n    $udt_41=array(\n      \'action_id_1\'=>$dt[\'id\'][0],\n      \'action_id_2\'=>$dt[\'id\'][1],\n    );\n    Update($db,"sales",$udt_41,"id=".$p[\'id\'],$v);\n    //catat di product_trx\n    $p[\'action_at\']=strtotime($p[\'sales_at\']);\n    $p[\'inout\']=2;\n    $p[\'remark\']=$p[\'descr\'];\n    $p[\'action_id\']=$dt[\'id\'][0];\n    product_trx($p);\n  }\n}','php','0','2','2','1748499742');
INSERT INTO `cp_sphp` VALUES ('22','app','to_money','function to_money($ang) {\n    $sid = preg_replace("/[^0-9+-]/","",$ang);\n    return $sid;\n}','php','0','2','2','1748499764');
INSERT INTO `cp_sphp` VALUES ('23','app','list_equ_2','function list_equ_2(){\n  global $ar,$db;\n  $dt=array();\n\n  $sql = "select a.*, b.descr as descr,b.seq as seq from account_equation a JOIN `action` b ON a.action_id=b.id where a.st>0 ";\n  \n    $sql .= " and a.`year`=\'".date("Y")."\' ";\n\n  \n  //$sql .= " order by a.".$sortby." asc, a.id asc";\n  $res = mysqli_query($db, $sql);\n    foreach ($ar[\'equ\'] as $k => $v) {\n      $j[$v]=0;\n    }\n\n  while($rw = mysqli_fetch_assoc($res)) {\n    foreach ($ar[\'equ\'] as $k1 => $v1) {\n      $j[$v1]=$j[$v1]+$rw[$v1];\n    } \n  }\n\n  $j[\'aktiva_lancar\']=$j[\'c11\']=$j[\'c11101\']+$j[\'c11201\']+$j[\'c11202\']+$j[\'c11203\']+$j[\'c11204\']+$j[\'c11205\'];\n\n  $j[\'aktiva_tak_lancar\']=$j[\'c12\']=$j[\'c12101\']+$j[\'c12201\']+$j[\'c12202\']+$j[\'c12301\']+$j[\'c12302\']+$j[\'c12401\']+$j[\'c12402\'];\n\n  $j[\'utang\']=$j[\'c21\']=$j[\'c21100\']+$j[\'c22100\']+$j[\'c23100\'];\n\n  $j[\'equity\']=$j[\'c31\']=$j[\'c31100\']+$j[\'c31200\']+$j[\'c31300\'];\n\n  $j[\'pendapatan\']=$j[\'c41\']=$j[\'c41100\']+$j[\'c41200\']+$j[\'c41300\'];\n\n  $j[\'hpp\']=$j[\'c51\']=$j[\'c51100\']+$j[\'c51200\']+$j[\'c51300\'];\n\n  $j[\'beban_penjualan\']=$j[\'c61\']=$j[\'c61101\']+$j[\'c61102\']+$j[\'c61103\']+$j[\'c61104\']+$j[\'c61105\']+$j[\'c61106\'];\n\n  $j[\'beban_administrasi\']=$j[\'c62\']=$j[\'c62101\']+$j[\'c62102\']+$j[\'c62103\']+$j[\'c62104\']+$j[\'c62106\']+$j[\'c62107\'];\n\n  $j[\'pendapatan_lain\']=$j[\'c71\']=$j[\'c71000\'];\n\n  $j[\'beban_lain\']=$j[\'c81\']=$j[\'c81100\']+$j[\'c81200\'];\n\n  $j[\'beban\']=$j[\'beban_penjualan\']+$j[\'beban_administrasi\'];\n\n  $j[\'aktiva\']=$j[\'aktiva_lancar\']+$j[\'aktiva_tak_lancar\'];\n\n  $j[\'laba_kotor\']=$j[\'pendapatan\']+$j[\'hpp\']+$j[\'beban_penjualan\'];\n\n  $j[\'laba_sebelum_pph\']=$j[\'laba_kotor\']+$j[\'beban_administrasi\'];\n\n  $j[\'pph\']=0;\n\n  $j[\'laba_setelah_pph\']=$j[\'laba_bersih\']=$j[\'laba_sebelum_pph\']-$j[\'pph\'];\n\n  $j[\'pasiva\']=$j[\'utang\']+$j[\'equity\']+$j[\'laba_setelah_pph\']; \n  echo "aktiva:<br>".ang2($j[\'aktiva\'])."<br>pasiva:<br>".ang2($j[\'pasiva\'])."<br>Rugi/Laba:<br>".ang2($j[\'laba_bersih\']); \n}','php','0','2','2','1748658706');
INSERT INTO `cp_sphp` VALUES ('24','app','list_equ_3','function list_equ_3(){\n  global $ar,$db;\n  $dt=array();\n\n  $sql = "select a.*, b.descr as descr,b.seq as seq from account_equation a JOIN `action` b ON a.action_id=b.id where a.st>0 ";\n  \n    $sql .= " and a.`year`=\'".date("Y")."\' ";\n\n  \n  //$sql .= " order by a.".$sortby." asc, a.id asc";\n  $res = mysqli_query($db, $sql);\n    foreach ($ar[\'equ\'] as $k => $v) {\n      $j[$v]=0;\n    }\n\n  while($rw = mysqli_fetch_assoc($res)) {\n    foreach ($ar[\'equ\'] as $k1 => $v1) {\n      $j[$v1]=$j[$v1]+$rw[$v1];\n    } \n  }\n\n  foreach ($ar[\'equ\'] as $k1 => $v1) {\n    //$j[$v1]=$j[$v1]+$rw[$v1];\n    $udt=array(\n      \'update_at\'=>time(),\n      \'s2025\'=>$j[$v1],\n    );\n    Update($db,"fcode",$udt,"`code`=\'".$v1."\'",0);\n  }\n  \n\n}','php','0','2','2','1748499813');
INSERT INTO `cp_sphp` VALUES ('25','app','account_equation','function account_equation($trx) {\n  global $db,$ar;\n  $dt=array();\n  $dt[\'src\']=$trx;\n  /*  \n  //cek kolom apa saja yg diupdate\n  $sql = "SELECT `code` from account where code=\'".$trx[\'debit\']."\'"; \n  //echo $sql."<br>";\n  $res = mysqli_query($db,$sql);\n  $r1  = mysqli_fetch_assoc($res);\n\n  $sql2 = "SELECT lev2,min from account where code=\'".$trx[\'credit\']."\'"; \n  $res2 = mysqli_query($db,$sql2);\n  $r2   = mysqli_fetch_assoc($res2);\n  */\n  $col_debit=\'c\'.$trx[\'debit\'];\n  $col_credit=\'c\'.$trx[\'credit\'];\n  \n  $col3_debit=substr($col_debit,0,3);\n  $col3_credit=substr($col_credit,0,3);\n\n  $val_credit=to_numeric($trx[\'amount\']);\n  $val_debit=to_numeric($trx[\'amount\']);\n\n  //beban dr cash\n  if($col_credit==\'c11101\') {\n    //bayar beban\n    if($col3_debit==\'c61\' or $col3_debit==\'c62\' or $col_debit==\'c21100\' or $col_debit==\'c41300\' or $col_debit==\'c31200\') {\n      $val_credit=-to_numeric($trx[\'amount\']);\n      $val_debit=-to_numeric($trx[\'amount\']);\n    }\n    //bayar asset\n    if($col_debit==\'c11202\' or $col_debit==\'c11203\' or $col_debit==\'c11204\' or $col_debit==\'c11205\' or $col_debit==\'c12101\' or $col_debit==\'c12201\' or $col_debit==\'c12301\' or $col_debit==\'c12401\') {\n      $val_credit=-to_numeric($trx[\'amount\']);\n      $val_debit=to_numeric($trx[\'amount\']);\n    }\n\n  } \n\n  //ada piutang yg di bayar\n  if($col_credit==\'c11201\' && $col_debit==\'c11101\') {\n    $val_credit=-to_numeric($trx[\'amount\']);\n    $val_debit=to_numeric($trx[\'amount\']);\n  } \n\n  //ada piutang dg barang dagangan di retur\n  if($col_credit==\'c11201\' && $col_debit==\'c41100\') {\n    $val_credit=-to_numeric($trx[\'amount\']);\n    $val_debit=-to_numeric($trx[\'amount\']);\n  } \n\n  //ada piutang yg di bayar\n  if($col_credit==\'c11202\' && $col_debit==\'c51100\') {\n    $val_credit=-to_numeric($trx[\'amount\']);\n    $val_debit=-to_numeric($trx[\'amount\']);\n  } \n\n  //ada rtur barang pembelian kredit (utang)\n  if($col_credit==\'c11202\' && $col_debit==\'c21100\') {\n    $val_credit=-to_numeric($trx[\'amount\']);\n    $val_debit=-to_numeric($trx[\'amount\']);\n  } \n\n  //bayar biaya dengan utang\n  if($col_credit==\'c22100\') {\n    if($col3_debit==\'c61\' or $col3_debit==\'c62\') {\n      $val_credit=to_numeric($trx[\'amount\']);\n      $val_debit=-to_numeric($trx[\'amount\']);\n    }\n  } \n\n  //penyusutan aset\n  if($col_credit==\'c12202\' or $col_credit==\'c12302\' or $col_credit==\'c12402\') {\n    if($col3_debit==\'c61\' or $col3_debit==\'c62\') {\n      $val_credit=-to_numeric($trx[\'amount\']);\n      $val_debit=-to_numeric($trx[\'amount\']);\n    }\n  } \n\n\n  $sql3 = "select id,id2,id-id2 as k from account_equation where id-id2>0 order by id2 limit 1";\n  $res3 = mysqli_query($db, $sql3);\n  if(mysqli_num_rows($res3)>0) {\n    $rw3 = mysqli_fetch_assoc($res3);\n    $id2=$rw3[\'id2\'];\n  } else {\n    $sql4 = "select * from account_equation order by id desc limit 1";\n    $res4 = mysqli_query($db, $sql4);\n    $rw4 = mysqli_fetch_assoc($res4);\n    if(isset($rw4[\'id\']) && $rw4[\'id\']>0) {\n      $id2=$rw4[\'id\']+1;\n    } else {\n      $id2=1;\n    }\n  }\n  /*\n  foreach ($ar[\'equ\'] as $k => $v) {\n    $udt6=array(\n      $v=>0,\n    );\n    Update($db,"account_equation",$udt6,"transaction_id=".$trx[\'id\'],0);\n  }*/\n  $idt=array(\n    \'id\'=>$id2,\n    \'transaction_id\'=>$trx[\'id\'],\n    \'action_at\'=>$trx[\'action_at\'],\n    \'action_id\'=>$trx[\'action_id\'],\n    \'year\'=>date("Y",$trx[\'action_at\']),\n    \'month\'=>date("Ym",$trx[\'action_at\']),\n    \'week\'=>date("W",$trx[\'action_at\']),\n    \'amount\'=>to_numeric($trx[\'amount\']),\n    $col_debit=>$val_debit,\n    $col_credit=>$val_credit,\n  );\n  $udt=array(\n    \'action_at\'=>$trx[\'action_at\'],\n    \'year\'=>date("Y",$trx[\'action_at\']),\n    \'month\'=>date("Ym",$trx[\'action_at\']),\n    \'week\'=>date("W",$trx[\'action_at\']),\n    \'amount\'=>to_numeric($trx[\'amount\']),\n    $col_debit=>$val_debit,\n    $col_credit=>$val_credit,\n  );\n  InsertUpdate($db,"account_equation",$idt,$udt,0);\n  tool_id2("account_equation");\n  equ_count();\n  $dt[\'idt\']=$idt;\n  $dt[\'udt\']=$udt;\n  return $dt;\n}','php','0','2','2','1748666334');
INSERT INTO `cp_sphp` VALUES ('26','api','start_old','function start_old(){\n  global $ar,$db;\n  $dt=array();\n$dt2=array();\n\n//account_trx\n$sql2="SELECT `id`,`name`,`code`,`c3`,`parent_id` from `account` where trx=1";\n$res2=mysqli_query($db,$sql2);\n$r2=mysqli_num_rows($res2);\n$dt[\'account_trx\'][\'count\']=$r2;\n\n$sql=$sql2." order by `code`";\n//echo $sql.";<br>";\n$res=mysqli_query($db,$sql);\nif(mysqli_num_rows($res2)>0) {\n  $c=0; $d=0;\n  while($r1=mysqli_fetch_assoc($res)) {\n    $dt[\'account_trx\'][\'data\'][\'all\'][$r1[\'code\']]=$r1;\n    if($r1[\'c3\']<30) {\n      $dt[\'account_trx\'][\'data\'][\'left\'][$c]=$r1;\n      $c++;\n    } else {\n      $dt[\'account_trx\'][\'data\'][\'right\'][$d]=$r1; \n      $d++;     \n    }\n  }\n} else {\n  $dt[\'account_trx\'][\'count\']=0;\n}\n\n$sql2="SELECT * from `account_equation` where id>0";\n$res2=mysqli_query($db,$sql2);\n$r2=mysqli_num_rows($res2);\n$dt[\'account_equation\'][\'count\']=$r2;\n\n$sql=$sql2." order by id";\n//echo $sql.";<br>";\n$res=mysqli_query($db,$sql);\nif(mysqli_num_rows($res2)>0) {\n  $c=0;\n  while($r1=mysqli_fetch_assoc($res)) {\n    $dt[\'account_equation\'][\'data\'][$c]=$r1;    \n    //$dt[\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n    $c++;\n  }\n} else {\n  $dt[\'account_equation\'][\'count\']=0;\n}\n\n//action\n$sql2="SELECT * from `action` where id>0";\n$res2=mysqli_query($db,$sql2);\n$r2=mysqli_num_rows($res2);\n$dt[\'action\'][\'count\']=$r2;\n\n$sql=$sql2." order by id";\n//echo $sql.";<br>";\n$res=mysqli_query($db,$sql);\nif(mysqli_num_rows($res2)>0) {\n  while($r1=mysqli_fetch_assoc($res)) {\n    $c=$r1[\'id\'];\n    $dt[\'action\'][\'data\'][$c]=$r1;    \n    $dt[\'action\'][\'data\'][$c][\'rp\']=ang2($r1[\'amount\']);    \n    $dt[\'action\'][\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n  }\n} else {\n  $dt[\'action\'][\'count\']=0;\n}\n\n//bank\n$sql2="SELECT * from `bank` where id>0";\n$res2=mysqli_query($db,$sql2);\n$r2=mysqli_num_rows($res2);\n$dt[\'bank\'][\'count\']=$r2;\n\n$sql=$sql2." order by id";\n//echo $sql.";<br>";\n$res=mysqli_query($db,$sql);\nif(mysqli_num_rows($res2)>0) {\n  $c=0;\n  while($r1=mysqli_fetch_assoc($res)) {\n    $dt[\'bank\'][\'data\'][$c]=$r1;    \n    $dt[\'bank\'][\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n    $c++;\n  }\n} else {\n  $dt[\'bank\'][\'count\']=0;\n}\n\n//company\n$sql2="SELECT * from `company` where id>0";\n$res2=mysqli_query($db,$sql2);\n$r2=mysqli_num_rows($res2);\n$dt[\'company\'][\'count\']=$r2;\n\n$sql=$sql2." order by id";\n//echo $sql.";<br>";\n$res=mysqli_query($db,$sql);\nif(mysqli_num_rows($res2)>0) {\n  $c=0;\n  while($r1=mysqli_fetch_assoc($res)) {\n    $dt[\'company\'][\'data\'][$c]=$r1;    \n    $dt[\'company\'][\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n    $c++;\n  }\n} else {\n  $dt[\'company\'][\'count\']=0;\n}\n\n//inventory\n$sql2="SELECT * from `inventory` where id>0";\n$res2=mysqli_query($db,$sql2);\n$r2=mysqli_num_rows($res2);\n$dt[\'inventory\'][\'count\']=$r2;\n\n$sql=$sql2." order by id";\n//echo $sql.";<br>";\n$res=mysqli_query($db,$sql);\nif(mysqli_num_rows($res2)>0) {\n  $c=0;\n  while($r1=mysqli_fetch_assoc($res)) {\n    $dt[\'inventory\'][\'data\'][$c]=$r1;    \n    $dt[\'inventory\'][\'data\'][$c][\'rp\']=ang2($r1[\'amount\']);    \n    $dt[\'inventory\'][\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n    $c++;\n  }\n} else {\n  $dt[\'inventory\'][\'count\']=0;\n}\n\n//journal\n$sql2="SELECT a.*,b.descr from `journal` a JOIN `action` b ON a.action_id=b.id where a.id>0";\n$res2=mysqli_query($db,$sql2);\n$r2=mysqli_num_rows($res2);\n$dt[\'journal\'][\'count\']=$r2;\n\n$sql=$sql2." order by a.action_at desc,a.id desc";\n//echo $sql.";<br>";\n$res=mysqli_query($db,$sql);\nif(mysqli_num_rows($res2)>0) {\n  $c=0;\n  while($r1=mysqli_fetch_assoc($res)) {\n    $dt[\'journal\'][\'data\'][$c]=$r1;    \n    $dt[\'journal\'][\'data\'][$c][\'rp_debit\']=ang2($r1[\'debit\']);    \n    $dt[\'journal\'][\'data\'][$c][\'rp_credit\']=ang2($r1[\'credit\']);    \n    $dt[\'journal\'][\'data\'][$c][\'rp_balance\']=ang2($r1[\'balance\']);    \n    $dt[\'journal\'][\'data\'][$c][\'rp\']=ang2($r1[\'amount\']);    \n    $dt[\'journal\'][\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n    $c++;\n  }\n} else {\n  $dt[\'journal\'][\'count\']=0;\n}\n\n//person\n$sql2="SELECT * from `person` where id>0";\n$res2=mysqli_query($db,$sql2);\n$r2=mysqli_num_rows($res2);\n$dt[\'person\'][\'count\']=$r2;\n\n$sql=$sql2." order by id";\n//echo $sql.";<br>";\n$res=mysqli_query($db,$sql);\nif(mysqli_num_rows($res2)>0) {\n  $c=0;\n  while($r1=mysqli_fetch_assoc($res)) {\n    $dt[\'person\'][\'data\'][$c]=$r1;    \n    $dt[\'person\'][\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n    $c++;\n  }\n} else {\n  $dt[\'person\'][\'count\']=0;\n}\n\n//product\n\n$sql2="SELECT id,name,img,brand,qty,item_code,price_per_unit,update_at from `product` where del=0";\n$res2=mysqli_query($db,$sql2);\n$r2=mysqli_num_rows($res2);\n$dt[\'product_byid\'][\'count\']=$r2;\n\n$sql=$sql2." order by id";\n//echo $sql.";<br>";\n$res=mysqli_query($db,$sql);\nif(mysqli_num_rows($res2)>0) {\n  //$c=0;\n  while($r1=mysqli_fetch_assoc($res)) {\n    $c=$r1[\'id\'];\n    $dt[\'product_byid\'][\'data\'][$c]=$r1;\n    $dt[\'product_byid\'][\'data\'][$c][\'hpp\']=ang2($r1[\'price_per_unit\']);\n    $dt[\'product_byid\'][\'data\'][$c][\'amount\']=ang2($r1[\'price_per_unit\']*$r1[\'qty\']);\n    $dt[\'product_byid\'][\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n    $sql3="SELECT a.id,a.action_id,a.transaction_id,a.item_in,a.item_out,a.`balance`,a.invoice,a.tgl,a.`inout`,b.descr from `product_trx` a JOIN `action` b ON a.action_id=b.id where product_id=".$r1[\'id\']." order by a.action_at,a.action_id ";\n    $res3=mysqli_query($db,$sql3);\n    $d=0;\n    while($r3=mysqli_fetch_assoc($res3)) {\n      $dt[\'product_byid\'][\'data\'][$c][\'trx\'][$d]=$r3;\n      $dt[\'product_byid\'][\'data\'][$c][\'trx\'][$d][\'amount\']=ang2($r3[\'balance\']*$r1[\'price_per_unit\']);\n      $d++;\n    }\n  }\n} else {\n  $dt[\'product_byid\'][\'count\']=0;\n}\n/* */\n\n$sql2="SELECT `brand` from `product` where `del`=0 group by `brand` order by `brand`";\n  $res2=mysqli_query($db,$sql2);\n  //$dt[\'count\']=$r2;\n  $count=0;\n  if(mysqli_num_rows($res2)>0) {\n    $c=0;\n    while($r2=mysqli_fetch_assoc($res2)) {\n      $dt[\'product\'][\'data\'][$c][\'brand\']=$r2[\'brand\'];\n      $sql3="SELECT id,name,qty,item_code,price_per_unit,img,update_at from `product` where del=0 and brand=\'".$r2[\'brand\']."\' order by `name`";\n      $res3=mysqli_query($db,$sql3);\n      $d=0;\n      while($r3=mysqli_fetch_assoc($res3)) {\n        $dt[\'product\'][\'data\'][$c][\'items\'][$d]=$r3;\n        $dt[\'product\'][\'data\'][$c][\'items\'][$d][\'hpp\']=ang2($r3[\'price_per_unit\']);\n        $dt[\'product\'][\'data\'][$c][\'items\'][$d][\'amount\']=ang2($r3[\'price_per_unit\']*$r3[\'qty\']);\n        $dt[\'product\'][\'data\'][$c][\'items\'][$d][\'update\']=date("Y-m-d H:i:s",$r3[\'update_at\']);\n\n        $sql4="SELECT a.id,a.action_id,a.transaction_id,a.item_in,a.item_out,a.`balance`,a.invoice,a.tgl,a.`inout`,b.descr from `product_trx` a JOIN `action` b ON a.action_id=b.id where product_id=".$r3[\'id\']." order by a.action_at,a.action_id ";\n        $res4=mysqli_query($db,$sql4);\n        $e=0;\n        while($r4=mysqli_fetch_assoc($res4)) {\n          $dt[\'product\'][\'data\'][$c][\'items\'][$d][\'trx\'][$e]=$r4;\n          $dt[\'product\'][\'data\'][$c][\'items\'][$d][\'trx\'][$e][\'amount\']=ang2($r4[\'balance\']*$r3[\'price_per_unit\']);\n          $e++;\n        }        \n        $d++;\n        $count++;\n      }\n      $c++;\n    }\n    $dt[\'product\'][\'count\']=$count;\n  } else {\n    $dt[\'product\'][\'count\']=0;\n  }  \n\n\n//[\'sales\']\n$sql2="SELECT * from `sales` where del=0";\n$res2=mysqli_query($db,$sql2);\n$r2=mysqli_num_rows($res2);\n$dt[\'sales\'][\'count\']=$r2;\n\n$sql=$sql2." order by id";\n//echo $sql.";<br>";\n$res=mysqli_query($db,$sql);\nif(mysqli_num_rows($res2)>0) {\n  $c=0;\n  while($r1=mysqli_fetch_assoc($res)) {\n    $dt[\'sales\'][\'data\'][$c]=$r1;\n    $dt[\'sales\'][\'data\'][$c][\'rp_hpp\']=ang2($r1[\'hpp\']);\n    $dt[\'sales\'][\'data\'][$c][\'rp_price\']=ang2($r1[\'price\']);\n    $dt[\'sales\'][\'data\'][$c][\'rp_amount\']=ang2($r1[\'amount\']);\n    $dt[\'sales\'][\'data\'][$c][\'pay\']=$ar[\'cash_credit\'][$r1[\'cash_credit\']];\n    $dt[\'sales\'][\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n    $c++;\n  }\n} else {\n  $dt[\'sales\'][\'count\']=0;\n}\n\n//[\'transaction\']\n$sql2="SELECT a.*,b.descr,b.invoice from `transaction` a JOIN `action` b ON a.id=b.id where a.id>0";\n$res2=mysqli_query($db,$sql2);\n$r2=mysqli_num_rows($res2);\n$dt[\'transaction\'][\'count\']=$r2;\n\n$sql=$sql2." order by a.action_at desc,a.id desc";\n//echo $sql.";<br>";\n$res=mysqli_query($db,$sql);\nif(mysqli_num_rows($res2)>0) {\n  $c=0;\n  while($r1=mysqli_fetch_assoc($res)) {\n    $dt[\'transaction\'][\'data\'][$c]=$r1;    \n    $dt[\'transaction\'][\'data\'][$c][\'tgl\']=date("Y-m-d",$r1[\'action_at\']);    \n    $dt[\'transaction\'][\'data\'][$c][\'debit_acc\']=$ar[\'acc_name\'][$r1[\'debit\']];    \n    $dt[\'transaction\'][\'data\'][$c][\'credit_acc\']=$ar[\'acc_name\'][$r1[\'credit\']];    \n    $dt[\'transaction\'][\'data\'][$c][\'rp_amount\']=ang2($r1[\'amount\']);\n    $dt[\'transaction\'][\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n    $c++;\n  }\n} else {\n  $dt[\'transaction\'][\'count\']=0;\n}\n\n//icons\ninclude_once $ar[\'path_core\']."u9/inc.ar.f7icon.php";\n$dt[\'icons\'][\'count\']=count($ar[\'f7_icon\']);\nforeach($ar[\'f7_icon\'] as $k=>$v) {\n  $dt[\'icons\'][\'data\'][$k][\'name\']=$v;\n  $dt[\'icons\'][\'data\'][$k][\'id\']=$k+1;\n}\n\n\n\n$dt2[\'result\']=$dt;\n$dt2[\'status\']=true;\n//echo json_encode($dt2);\n\n\n\n  return $dt2;\n  $db->close();\n}','php','0','2','1','1748571940');
INSERT INTO `cp_sphp` VALUES ('27','api','start','function start(){\n  global $ar,$db;\n  $dt=array();\n  $dt2=array();\n  $dt[\'menu\']=tab_add_menu();\n  //account_trx\n  $sql2="SELECT `id`,`name`,`code`,`c3`,`parent_id` from `account` where trx=1";\n  $res2=mysqli_query($db,$sql2);\n  $r2=mysqli_num_rows($res2);\n  $dt[\'account_trx\'][\'count\']=$r2;\n\n  $sql=$sql2." order by `code`";\n  //echo $sql.";<br>";\n  $res=mysqli_query($db,$sql);\n  if(mysqli_num_rows($res2)>0) {\n    $c=0; $d=0;\n    while($r1=mysqli_fetch_assoc($res)) {\n      $dt[\'account_trx\'][\'data\'][\'all\'][$r1[\'code\']]=$r1;\n      if($r1[\'c3\']<30) {\n        $dt[\'account_trx\'][\'data\'][\'left\'][$c]=$r1;\n        $c++;\n      } else {\n        $dt[\'account_trx\'][\'data\'][\'right\'][$d]=$r1; \n        $d++;     \n      }\n    }\n  } else {\n    $dt[\'account_trx\'][\'count\']=0;\n  }\n\n  //account_trx\n  $sql2="SELECT `id`,`name`,`code`,`parent` from `fcode` where `code`=\'c61\' or `code`=\'c62\'  or `code`=\'c81\' or `code`=\'c11\' or `code`=\'c21\' or `code`=\'c31\'";\n  $res2=mysqli_query($db,$sql2);\n  $r2=mysqli_num_rows($res2);\n\n  $sql=$sql2." order by `code`";\n  //echo $sql.";<br>";\n  $res=mysqli_query($db,$sql);\n  if(mysqli_num_rows($res2)>0) {\n    $c=0;\n    while($r1=mysqli_fetch_assoc($res)) {\n      $dt[\'account_cost\'][\'data\'][$r1[\'code\']]=$r1;\n      $sql3="SELECT `id`,`name`,`code`,`parent` from `fcode` where `parent`=".$r1[\'id\']." and trx=1 and is_cost=1 order by `name`";\n      $res3=mysqli_query($db,$sql3);\n      $d=0;\n      while($r3=mysqli_fetch_assoc($res3)) {\n        $dt[\'account_cost\'][\'data\'][$r1[\'code\']][\'items\'][$d]=$r3;\n        $dt[\'account_cost\'][\'data\'][$r1[\'code\']][\'items\'][$d][\'code\']=substr($r3[\'code\'],1);\n        $d++;        \n      }\n      $c++;\n    }\n  } \n\n  //account_trx\n  $sql2="SELECT `id`,`name`,`code`,`parent` from `fcode` where `code`=\'c31\'  or `code`=\'c71\' or `code`=\'c11\' or `code`=\'c21\' ";\n  $res2=mysqli_query($db,$sql2);\n  $r2=mysqli_num_rows($res2);\n\n  $sql=$sql2." order by `code`";\n  //echo $sql.";<br>";\n  $res=mysqli_query($db,$sql);\n  if(mysqli_num_rows($res2)>0) {\n    $c=0;\n    while($r1=mysqli_fetch_assoc($res)) {\n      $dt[\'account_in\'][\'data\'][$r1[\'code\']]=$r1;\n      $sql3="SELECT `id`,`name`,`code`,`parent` from `fcode` where `parent`=".$r1[\'id\']." and trx=1 and is_income=1 order by `name`";\n      $res3=mysqli_query($db,$sql3);\n      $d=0;\n      while($r3=mysqli_fetch_assoc($res3)) {\n        $dt[\'account_in\'][\'data\'][$r1[\'code\']][\'items\'][$d]=$r3;\n        $dt[\'account_in\'][\'data\'][$r1[\'code\']][\'items\'][$d][\'code\']=substr($r3[\'code\'],1);\n        $d++;        \n      }\n      $c++;\n    }\n  } \n\n  //icons\n  include_once $ar[\'path_core\']."u9/inc.ar.f7icon.php";\n  $dt[\'icons\'][\'count\']=count($ar[\'f7_icon\']);\n  foreach($ar[\'f7_icon\'] as $k=>$v) {\n    $dt[\'icons\'][\'data\'][$k][\'name\']=$v;\n    $dt[\'icons\'][\'data\'][$k][\'id\']=$k+1;\n  }\n  $dt2[\'result\']=$dt;\n  $dt2[\'status\']=true;\n  //echo json_encode($dt2);\n  return $dt2;\n  $db->close();\n}','php','0','2','1','1748922599');
INSERT INTO `cp_sphp` VALUES ('28','app','sales_add','function sales_add($js){\n  global $ar,$db;\n  $dt=array();\n  $sql3 = "select id,id2,id-id2 as k from `sales` where id-id2>0 order by id2 limit 1";\n  $res3 = mysqli_query($db, $sql3);\n  if(mysqli_num_rows($res3)>0) {\n    $rw3 = mysqli_fetch_assoc($res3);\n    $id1=$rw3[\'id2\'];\n  } else {\n    $sql4 = "select * from `sales` order by id desc limit 1";\n    $res4 = mysqli_query($db, $sql4);\n    $rw4 = mysqli_fetch_assoc($res4);\n    if(isset($rw4[\'id\']) && $rw4[\'id\']>0) {\n      $id1=$rw4[\'id\']+1;\n    } else {\n      $id1=1;\n    }\n  }\n\n  if($js[\'cat\']==7 && $js[\'due_days\']>0) {\n    $due_days=$js[\'due_days\']*24*60*60;\n    $due_date=date("Y-m-d",strtotime($js[\'action_at\'])+$due_days);\n    $cash_credit=2;\n  } else {\n    $due_date=$js[\'action_at\'];\n    $cash_credit=1;\n  }\n\n  $idt=array(\n    \'id\'=>$id1,\n    \'product_id\'=>$js[\'product_id\'],\n    \'hpp\'=>$js[\'hpp\'],\n    \'cash_credit\'=>$cash_credit,\n    \'buyer\'=>$js[\'buyer\'],\n    \'sales\'=>$js[\'sales\'],\n    \'sales_at\'=>strtotime($js[\'action_at\']),\n    \'qty\'=>$js[\'qty\'],\n    \'price\'=>$js[\'price_per_unit\'],\n    \'amount\'=>$js[\'qty\']*$js[\'price_per_unit\'],\n    \'due_date\'=>$due_date,\n    \'invoice\'=>$js[\'invoice\'],\n    \'descr\'=>$js[\'descr\'],\n    \'tgl\'=>$js[\'action_at\'],\n    \'days_due_date\'=>$js[\'due_days\'],\n    \'year\'=>date("Y",strtotime($js[\'action_at\'])),\n    \'month\'=>date("Ym",strtotime($js[\'action_at\'])),\n    \'update_at\'=>time(),\n  );\n  Insert($db,"sales",$idt,0);\n  tool_id2(\'sales\'); \n  $dt[\'message\']="Add sales Successfully";\n  $dt[\'sales_id\']=$id1;\n  $dt[\'success\']=true; \n  return $dt;\n}','php','0','2','2','1748589739');
INSERT INTO `cp_sphp` VALUES ('29','app','equ_count','function equ_count(){\n  global $ar,$db;\n  //$dt=array();\n  $udt1=array(\n  \'s2025\'=>0\n  );\n  Update($db,"fcode",$udt1,"id>0",0);\n  $ar[\'fcode\'][\'level4\']=array(\'b3201\',\'b3202\',\'b3203\',\'b3204\',\'b3205\',\'b3206\',\'b3207\',\'b3208\',\'b3209\',\'b3210\');\n\n  $ar[\'fcode\'][\'level3\']=array(\'b11\',\'b12\',\'b21\',\'b31\',\'b32\',\'b33\',\'c11\',\'c12\',\'c21\',\'c31\',\'c41\',\'c51\',\'c61\',\'c62\',\'c71\',\'c81\');\n  /*\n  $ar[\'fcode\'][\'level2\']=array(\'a01\', \'a02\', \'a03\', \'a04\', \'a05\', \'a06\', \'a07\', \'a08\', \'a09\', \'a10\', \'b11\', \'b12\', \'b21\', \'b33\', \'c1\', \'c2\', \'d1\', \'d2\', \'d3\', \'d4\', \'m1\', \'m2\');\n  */\n  $ar[\'fcode\'][\'level2\']=array(\'a01\', \'a02\', \'a03\', \'a04\', \'a05\', \'a06\', \'a07\', \'a08\', \'a09\', \'a10\', \'b11\', \'b12\', \'b21\', \'b33\',\'b1\',\'b2\', \'c1\', \'c2\');\n\n  $sql = "select a.*, b.descr as descr,b.seq as seq from account_equation a JOIN `action` b ON a.action_id=b.id where a.st>0 ";\n  \n    $sql .= " and a.`year`=\'".date("Y")."\' ";\n\n  \n  //$sql .= " order by a.".$sortby." asc, a.id asc";\n  $res = mysqli_query($db, $sql);\n    foreach ($ar[\'equ\'] as $k => $v) {\n      $j[$v]=0;\n    }\n\n  while($rw = mysqli_fetch_assoc($res)) {\n    foreach ($ar[\'equ\'] as $k1 => $v1) {\n      $j[$v1]=$j[$v1]+$rw[$v1];\n    } \n  }\n\n  $j[\'aktiva_lancar\']=$j[\'c11\']=$j[\'c11101\']+$j[\'c11201\']+$j[\'c11202\']+$j[\'c11203\']+$j[\'c11204\']+$j[\'c11205\'];\n\n  $j[\'aktiva_tak_lancar\']=$j[\'c12\']=$j[\'c12101\']+$j[\'c12201\']+$j[\'c12202\']+$j[\'c12301\']+$j[\'c12302\']+$j[\'c12401\']+$j[\'c12402\'];\n\n  $j[\'utang\']=$j[\'c21\']=$j[\'c21100\']+$j[\'c22100\']+$j[\'c23100\'];\n\n  $j[\'equity\']=$j[\'c31\']=$j[\'c31100\']+$j[\'c31200\']+$j[\'c31300\'];\n\n  $j[\'pendapatan\']=$j[\'c41\']=$j[\'c41100\']+$j[\'c41200\']+$j[\'c41300\'];\n\n  $j[\'hpp\']=$j[\'c51\']=$j[\'c51100\']+$j[\'c51200\']+$j[\'c51300\'];\n\n  $j[\'beban_penjualan\']=$j[\'c61\']=$j[\'c61101\']+$j[\'c61102\']+$j[\'c61103\']+$j[\'c61104\']+$j[\'c61105\']+$j[\'c61106\'];\n\n  $j[\'beban_administrasi\']=$j[\'c62\']=$j[\'c62101\']+$j[\'c62102\']+$j[\'c62103\']+$j[\'c62104\']+$j[\'c62106\']+$j[\'c62107\'];\n\n  $j[\'pendapatan_lain\']=$j[\'c71\']=$j[\'c71000\'];\n\n  $j[\'beban_lain\']=$j[\'c81\']=$j[\'c81100\']+$j[\'c81200\'];\n\n  $j[\'beban\']=$j[\'beban_penjualan\']+$j[\'beban_administrasi\'];\n\n  $j[\'aktiva\']=$j[\'aktiva_lancar\']+$j[\'aktiva_tak_lancar\'];\n\n  $j[\'laba_kotor\']=$j[\'pendapatan\']+$j[\'hpp\']+$j[\'beban_penjualan\'];\n\n  $j[\'laba_sebelum_pph\']=$j[\'laba_kotor\']+$j[\'beban_administrasi\']+$j[\'pendapatan_lain\']+$j[\'beban_lain\'];\n\n  $j[\'pph\']=0;\n\n  $j[\'laba_setelah_pph\']=$j[\'laba_bersih\']=$j[\'laba_sebelum_pph\']-$j[\'pph\'];\n\n  $j[\'pasiva\']=$j[\'utang\']+$j[\'equity\']+$j[\'laba_setelah_pph\']; \n\n  //level4\n  $j[\'b3201\']=$j[\'c41\'];\n  $j[\'b3202\']=$j[\'c51\'];\n  $j[\'b3203\']=$j[\'c61\'];\n  $j[\'b3204\']=$j[\'b3201\']+$j[\'b3202\']+$j[\'b3203\'];\n  $j[\'b3205\']=$j[\'c62\'];\n  $j[\'b3206\']=$j[\'c71\'];\n  $j[\'b3207\']=$j[\'c81\'];\n  $j[\'b3208\']=$j[\'b3204\']+$j[\'b3205\']+$j[\'b3206\']+$j[\'b3207\'];\n  $j[\'b3209\']=$j[\'pph\'];\n  $j[\'b3210\']=$j[\'b3208\']+$j[\'b3209\'];\n\n  //level3;\n  $j[\'b11\']=$j[\'c11\'];\n  $j[\'b12\']=$j[\'c12\'];\n  $j[\'b21\']=$j[\'c21\'];\n  $j[\'b31\']=$j[\'c31\'];\n  $j[\'b32\']=$j[\'b3210\'];\n  $j[\'b33\']=$j[\'c31\']+$j[\'b32\'];\n\n  //level2\n  $j[\'a01\']=$j[\'c41\'];\n  $j[\'a02\']=$j[\'c51\'];\n  $j[\'a03\']=$j[\'c61\'];\n  $j[\'a04\']=$j[\'laba_kotor\'];\n  $j[\'a05\']=$j[\'c62\'];\n  $j[\'a06\']=$j[\'c71\'];\n  $j[\'a07\']=$j[\'c81\'];\n  $j[\'a08\']=$j[\'laba_sebelum_pph\'];\n  $j[\'a09\']=$j[\'pph\'];\n  $j[\'a10\']=$j[\'laba_setelah_pph\'];\n\n  $j[\'b1\']=$j[\'b11\']+$j[\'b12\'];\n  $j[\'b2\']=$j[\'b21\']+$j[\'b33\'];\n\n  $j[\'c1\']=$j[\'c11\']+$j[\'c12\'];\n  $j[\'c2\']=$j[\'pasiva\'];\n\n  foreach ($ar[\'equ\'] as $k1 => $v1) {  \n    $udt=array(\n      \'s2025\'=>$j[$v1],\n    );\n    $dt[\'sql\'][]=Update_v2($db,"fcode",$udt,"code=\'".$v1."\'",1);\n  } \n  foreach ($ar[\'fcode\'][\'level4\'] as $k => $v) {\n    $udt=array(\n      \'s2025\'=>$j[$v],\n    );\n    $dt[\'sql\'][]=Update_v2($db,"fcode",$udt,"code=\'".$v."\'",1);\n  }\n  foreach ($ar[\'fcode\'][\'level3\'] as $k => $v) {\n    $udt=array(\n      \'s2025\'=>$j[$v],\n    );\n    $dt[\'sql\'][]=Update_v2($db,"fcode",$udt,"code=\'".$v."\'",1);\n  }\n  foreach ($ar[\'fcode\'][\'level2\'] as $k => $v) {\n    $udt=array(\n      \'s2025\'=>$j[$v],\n    );\n    $dt[\'sql\'][]=Update_v2($db,"fcode",$udt,"code=\'".$v."\'",1);\n  }\n  $dt[\'count\']=$j;\n  //return $dt; \n  //$dt[\'count\']=$j;\n  //return $dt; \n}','php','0','2','2','1748786406');
INSERT INTO `cp_sphp` VALUES ('30','api','inventory','function inventory(){\n  global $ar,$db;\n  $dt=array();\n  $sql2="SELECT * from `inventory` where id>0";\n  $res2=mysqli_query($db,$sql2);\n  $r2=mysqli_num_rows($res2);\n  $dt[\'count\']=$r2;\n  $dt[\'success\']=true;\n  $sql=$sql2." order by id";\n  //echo $sql.";<br>";\n  $res=mysqli_query($db,$sql);\n  if(mysqli_num_rows($res2)>0) {\n    $c=0;\n    while($r1=mysqli_fetch_assoc($res)) {\n      $dt[\'data\'][$c]=$r1;    \n      $dt[\'data\'][$c][\'image\']=$ar[\'imgurl\']."".$r1[\'img\'];    \n      $dt[\'data\'][$c][\'rp\']=ang2($r1[\'amount\']);    \n      $dt[\'data\'][$c][\'date_purchase\']=date("Y-m-d H:i:s",$r1[\'purchase_date\']);\n      $dt[\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n      $c++;\n    }\n  } else {\n    $dt[\'count\']=0;\n    $dt[\'message\']="data not found";\n  }\n  return $dt;\n  $db->close();\n}','php','0','2','1','1748591291');
INSERT INTO `cp_sphp` VALUES ('31','api','sales','function sales(){\n  global $ar,$db;  \n  $dt=array();\n  $sql2="SELECT * from `sales` where del=0";\n  $res2=mysqli_query($db,$sql2);\n  $r2=mysqli_num_rows($res2);\n  $dt[\'count\']=$r2;\n  $dt[\'success\']=true;\n\n  $sql=$sql2." order by id";\n  //echo $sql.";<br>";\n  $res=mysqli_query($db,$sql);\n  if(mysqli_num_rows($res2)>0) {\n    $c=0;\n    while($r1=mysqli_fetch_assoc($res)) {\n      $dt[\'data\'][$c]=$r1;\n      $dt[\'data\'][$c][\'tgl\']=date("Y-m-d",$r1[\'sales_at\']);\n      $dt[\'data\'][$c][\'image\']=$ar[\'imgurl\']."".$r1[\'img\'];  \n      $dt[\'data\'][$c][\'rp_hpp\']=ang2($r1[\'hpp\']);\n      $dt[\'data\'][$c][\'rp_price\']=ang2($r1[\'price\']);\n      $dt[\'data\'][$c][\'rp_amount\']=ang2($r1[\'amount\']);\n      $dt[\'data\'][$c][\'pay\']=$ar[\'cash_credit\'][$r1[\'cash_credit\']];\n      $dt[\'data\'][$c][\'update\']=date("Y-m-d H:i:s",$r1[\'update_at\']);\n      $c++;\n    }\n  } else {\n    $dt[\'count\']=0;\n  }\n  return $dt;\n  $db->close();\n}','php','0','2','1','1748676741');
INSERT INTO `cp_sphp` VALUES ('32','app','retur_action','function retur_action($js,$v=0) {\n  global $db,$ar;\n  $dt=array();\n/*  \ncat=1, retur dr agen, menambah persediaan, mengurangi piutang\ncat=2, retur ke supplier, mengurangi utang dan persediaan\npersediaan/11202 dan utang dagang 21100\n*/\n  $rr[\'retur_descr\'][1]="";\n  $rr[\'debit\'][1]      ="41100";\n  $rr[\'credit\'][1]     ="11201";\n\n  $rr[\'retur_descr\'][2]="";\n  $rr[\'debit\'][2]      ="21100";\n  $rr[\'credit\'][2]     ="11202";\n\n  $sql4 = "select id from `action` order by id desc limit 1";\n  $res4 = mysqli_query($db, $sql4);\n  $r4 = mysqli_fetch_assoc($res4);\n  $id1=$r4[\'id\']+1;\n  $id2=$r4[\'id\']+2;\n\n  $idt1=array(\n    \'id\'=>$id1,\n    \'action_at\'=>strtotime($js[\'action_at\']),\n    \'pay_to\'=>$js[\'pay_to\'],\n    \'pay_from\'=>$js[\'pay_from\'],\n    \'invoice\'=>$js[\'invoice\'],\n    \'inout\'=>$js[\'inout\'],\n    \'descr\'=>$js[\'descr\']." ".$rr[\'retur_descr\'][$js[\'inout\']],\n    \'bank\'=>0,\n    \'cat\'=>8,\n    \'amount\'=>$js[\'amount\'],\n    \'year\'=>date("Y",strtotime($js[\'action_at\'])),\n    \'month\'=>date("Ym",strtotime($js[\'action_at\'])),\n    \'tgl\'=>date("Y-m-d",strtotime($js[\'action_at\'])),\n    \'update_at\'=>time(),\n  );\n  Insert($db,"action",$idt1,$v);\n  $js1=$js;\n  $js1[\'action_id\']=$id1;\n  $js1[\'debit\']=$rr[\'debit\'][$js[\'inout\']];\n  $js1[\'credit\']=$rr[\'credit\'][$js[\'inout\']];\n  //$dt[\'trx\']=transaction_add_v2($js1);\n  transaction_add_v2($js1);\n  \n  if($js[\'inout\']==1) {\n    $idt2=array(\n      \'id\'=>$id2,\n      \'action_at\'=>strtotime($js[\'action_at\']),\n      \'pay_to\'=>$js[\'pay_to\'],\n      \'pay_from\'=>$js[\'pay_from\'],\n      \'invoice\'=>$js[\'invoice\'],\n      \'inout\'=>$js[\'inout\'],\n      \'descr\'=>$js[\'descr\']."",\n      \'bank\'=>0,\n      \'cat\'=>8,\n      \'amount\'=>$js[\'amount\'],\n      \'year\'=>date("Y",strtotime($js[\'action_at\'])),\n      \'month\'=>date("Ym",strtotime($js[\'action_at\'])),\n      \'tgl\'=>date("Y-m-d",strtotime($js[\'action_at\'])),\n      \'update_at\'=>time(),\n    );\n    Insert($db,"action",$idt2,$v);\n    $js2=$js;\n    $js2[\'action_id\']=$id2;\n    $js2[\'debit\']=11202;\n    $js2[\'credit\']=51100;\n    //$dt[\'trx\']=transaction_add_v2($js2);\n    transaction_add_v2($js2);\n  }\n\n  //catat di product_trx\n  $js[\'action_at\']=strtotime($js[\'action_at\']);\n  //$js[\'inout\']=2;\n  $js[\'remark\']=$js[\'descr\'];\n  $js[\'action_id\']=$id1;\n  product_trx($js);\n  $dt[\'message\']="add transaction succes";\n  return $dt;\n}','php','0','2','2','1748607404');
INSERT INTO `cp_sphp` VALUES ('33','api','fcode','function fcode(){\n  global $ar,$db;\n  $dt=array();\n\n  $sql1 = "select `id`,`name`,`code`,`remark`,`s2025`,`level` from `fcode` where del=0 and parent=0 and view=1 order by `code`";\n  $res1 = mysqli_query($db, $sql1);\n  $a=0;\n  while($r1 = mysqli_fetch_assoc($res1)) {\n    $dt[\'success\']=true;\n    $dt[\'data\'][$a]=$r1;\n    //echo $r1[\'code\']." (".$r1[\'name\'].")<br>";\n    $sql2 = "select `id`,`name`,`code`,`remark`,`s2025`,`level` from `fcode` where del=0 and parent=".$r1[\'id\']." order by `code`";\n    $res2 = mysqli_query($db, $sql2);\n    $b=0;\n    while($r2 = mysqli_fetch_assoc($res2)) {\n      $dt[\'data\'][$a][\'items\'][$b]=$r2;\n      $dt[\'data\'][$a][\'items\'][$b][\'rp\']=ang2($r2[\'s2025\']);\n\n      //echo "- ".$r2[\'code\']." (".$r2[\'name\'].")<br>";\n      $sql3 = "select `id`,`name`,`code`,`remark`,`s2025`,`level` from `fcode` where del=0 and parent=".$r2[\'id\']." order by `code`";\n      $res3 = mysqli_query($db, $sql3);\n      $c=0;\n      while($r3 = mysqli_fetch_assoc($res3)) {\n        $dt[\'data\'][$a][\'items\'][$b][\'items\'][$c]=$r3;\n        $dt[\'data\'][$a][\'items\'][$b][\'items\'][$c][\'rp\']=ang2($r3[\'s2025\']);\n\n        //echo "- - ".$r3[\'code\']." (".$r3[\'name\'].")<br>";\n        $sql4 = "select `id`,`name`,`code`,`remark`,`s2025`,`level`,`trx` from `fcode` where del=0 and parent=".$r3[\'id\']." order by `code`";\n        $res4 = mysqli_query($db, $sql4);\n        $d=0;\n        while($r4 = mysqli_fetch_assoc($res4)) {\n          $dt[\'data\'][$a][\'items\'][$b][\'items\'][$c][\'items\'][$d]=$r4;\n          $dt[\'data\'][$a][\'items\'][$b][\'items\'][$c][\'items\'][$d][\'cd\']=substr($r4[\'code\'],1);\n          $dt[\'data\'][$a][\'items\'][$b][\'items\'][$c][\'items\'][$d][\'rp\']=ang2($r4[\'s2025\']);\n          //echo "- - - ".$r4[\'code\']." (".$r4[\'name\'].") [".ang2($r4[\'s2025\'])."]<br>";\n          $sql5 = "select `id`,`name`,`code`,`remark`,`s2025`,`level` from `fcode` where del=0 and parent=".$r4[\'id\']." order by `code`";\n          $res5 = mysqli_query($db, $sql5);\n          $e=0;\n          while($r5 = mysqli_fetch_assoc($res5)) {\n            $dt[\'data\'][$a][\'items\'][$b][\'items\'][$c][\'items\'][$d][\'items\'][$e]=$r5;\n            $dt[\'data\'][$a][\'items\'][$b][\'items\'][$c][\'items\'][$d][\'items\'][$e][\'rp\']=ang2($r5[\'s2025\']);\n            //echo "- - - - ".$r5[\'code\']." (".$r5[\'name\'].")<br>";\n            $e++;\n          }   \n          $d++;\n        }   \n        $c++;\n      } \n      $b++;  \n    } \n    $a++;  \n  }   \n  \n  return $dt;\n  $db->close();\n}','php','0','2','1','1748786730');
INSERT INTO `cp_sphp` VALUES ('34','api','tes_equ_count','function tes_equ_count(){\n  global $ar,$db;\n  $dt=array();\n  $sql="update `fcode` set s2025=0";\n  $res=mysqli_query($db,$sql);\n\n  $ar[\'fcode\'][\'level4\']=array(\'b3201\',\'b3202\',\'b3203\',\'b3204\',\'b3205\',\'b3206\',\'b3207\',\'b3208\',\'b3209\',\'b3210\');\n\n  $ar[\'fcode\'][\'level3\']=array(\'b11\',\'b12\',\'b21\',\'b31\',\'b32\',\'b33\',\'c11\',\'c12\',\'c21\',\'c31\',\'c41\',\'c51\',\'c61\',\'c62\',\'c71\',\'c81\');\n  /*\n  $ar[\'fcode\'][\'level2\']=array(\'a01\', \'a02\', \'a03\', \'a04\', \'a05\', \'a06\', \'a07\', \'a08\', \'a09\', \'a10\', \'b11\', \'b12\', \'b21\', \'b33\', \'c1\', \'c2\', \'d1\', \'d2\', \'d3\', \'d4\', \'m1\', \'m2\');\n  */\n  $ar[\'fcode\'][\'level2\']=array(\'a01\', \'a02\', \'a03\', \'a04\', \'a05\', \'a06\', \'a07\', \'a08\', \'a09\', \'a10\', \'b11\', \'b12\', \'b21\', \'b33\',\'b1\',\'b2\', \'c1\', \'c2\');\n\n  $sql = "select a.*, b.descr as descr,b.seq as seq from account_equation a JOIN `action` b ON a.action_id=b.id where a.st>0 ";\n  \n    $sql .= " and a.`year`=\'".date("Y")."\' ";\n\n  \n  //$sql .= " order by a.".$sortby." asc, a.id asc";\n  $res = mysqli_query($db, $sql);\n    foreach ($ar[\'equ\'] as $k => $v) {\n      $j[$v]=0;\n    }\n\n  while($rw = mysqli_fetch_assoc($res)) {\n    foreach ($ar[\'equ\'] as $k1 => $v1) {\n      $j[$v1]=$j[$v1]+$rw[$v1];\n    } \n  }\n\n  $j[\'aktiva_lancar\']=$j[\'c11\']=$j[\'c11101\']+$j[\'c11201\']+$j[\'c11202\']+$j[\'c11203\']+$j[\'c11204\']+$j[\'c11205\'];\n\n  $j[\'aktiva_tak_lancar\']=$j[\'c12\']=$j[\'c12101\']+$j[\'c12201\']+$j[\'c12202\']+$j[\'c12301\']+$j[\'c12302\']+$j[\'c12401\']+$j[\'c12402\'];\n\n  $j[\'utang\']=$j[\'c21\']=$j[\'c21100\']+$j[\'c22100\']+$j[\'c23100\'];\n\n  $j[\'equity\']=$j[\'c31\']=$j[\'c31100\']+$j[\'c31200\']+$j[\'c31300\'];\n\n  $j[\'pendapatan\']=$j[\'c41\']=$j[\'c41100\']+$j[\'c41200\']+$j[\'c41300\'];\n\n  $j[\'hpp\']=$j[\'c51\']=$j[\'c51100\']+$j[\'c51200\']+$j[\'c51300\'];\n\n  $j[\'beban_penjualan\']=$j[\'c61\']=$j[\'c61101\']+$j[\'c61102\']+$j[\'c61103\']+$j[\'c61104\']+$j[\'c61105\']+$j[\'c61106\'];\n\n  $j[\'beban_administrasi\']=$j[\'c62\']=$j[\'c62101\']+$j[\'c62102\']+$j[\'c62103\']+$j[\'c62104\']+$j[\'c62106\']+$j[\'c62107\'];\n\n  $j[\'pendapatan_lain\']=$j[\'c71\']=$j[\'c71000\'];\n\n  $j[\'beban_lain\']=$j[\'c81\']=$j[\'c81100\']+$j[\'c81200\'];\n\n  $j[\'beban\']=$j[\'beban_penjualan\']+$j[\'beban_administrasi\'];\n\n  $j[\'aktiva\']=$j[\'aktiva_lancar\']+$j[\'aktiva_tak_lancar\'];\n\n  $j[\'laba_kotor\']=$j[\'pendapatan\']+$j[\'hpp\']+$j[\'beban_penjualan\'];\n\n  $j[\'laba_sebelum_pph\']=$j[\'laba_kotor\']+$j[\'beban_administrasi\']+$j[\'pendapatan_lain\']+$j[\'beban_lain\'];\n\n  $j[\'pph\']=0;\n\n  $j[\'laba_setelah_pph\']=$j[\'laba_bersih\']=$j[\'laba_sebelum_pph\']-$j[\'pph\'];\n\n  $j[\'pasiva\']=$j[\'utang\']+$j[\'equity\']+$j[\'laba_setelah_pph\']; \n\n  //level4\n  $j[\'b3201\']=$j[\'c41\'];\n  $j[\'b3202\']=$j[\'c51\'];\n  $j[\'b3203\']=$j[\'c61\'];\n  $j[\'b3204\']=$j[\'b3201\']+$j[\'b3202\']+$j[\'b3203\'];\n  $j[\'b3205\']=$j[\'c62\'];\n  $j[\'b3206\']=$j[\'c71\'];\n  $j[\'b3207\']=$j[\'c81\'];\n  $j[\'b3208\']=$j[\'b3204\']+$j[\'b3205\']+$j[\'b3206\']+$j[\'b3207\'];\n  $j[\'b3209\']=$j[\'pph\'];\n  $j[\'b3210\']=$j[\'b3208\']+$j[\'b3209\'];\n\n  //level3;\n  $j[\'b11\']=$j[\'c11\'];\n  $j[\'b12\']=$j[\'c12\'];\n  $j[\'b21\']=$j[\'c21\'];\n  $j[\'b31\']=$j[\'c31\'];\n  $j[\'b32\']=$j[\'b3210\'];\n  $j[\'b33\']=$j[\'c31\']+$j[\'b32\'];\n\n  //level2\n  $j[\'a01\']=$j[\'c41\'];\n  $j[\'a02\']=$j[\'c51\'];\n  $j[\'a03\']=$j[\'c61\'];\n  $j[\'a04\']=$j[\'laba_kotor\'];\n  $j[\'a05\']=$j[\'c62\'];\n  $j[\'a06\']=$j[\'c71\'];\n  $j[\'a07\']=$j[\'c81\'];\n  $j[\'a08\']=$j[\'laba_sebelum_pph\'];\n  $j[\'a09\']=$j[\'pph\'];\n  $j[\'a10\']=$j[\'laba_setelah_pph\'];\n\n  $j[\'b1\']=$j[\'b11\']+$j[\'b12\'];\n  $j[\'b2\']=$j[\'b21\']+$j[\'b33\'];\n\n  $j[\'c1\']=$j[\'c11\']+$j[\'c12\'];\n  $j[\'c2\']=$j[\'pasiva\'];\n\n  foreach ($ar[\'equ\'] as $k1 => $v1) {  \n    $udt=array(\n      \'s2025\'=>$j[$v1],\n    );\n    $dt[\'sql\'][]=Update_v2($db,"fcode",$udt,"code=\'".$v1."\'",1);\n  } \n  foreach ($ar[\'fcode\'][\'level4\'] as $k => $v) {\n    $udt=array(\n      \'s2025\'=>$j[$v],\n    );\n    $dt[\'sql\'][]=Update_v2($db,"fcode",$udt,"code=\'".$v."\'",1);\n  }\n  foreach ($ar[\'fcode\'][\'level3\'] as $k => $v) {\n    $udt=array(\n      \'s2025\'=>$j[$v],\n    );\n    $dt[\'sql\'][]=Update_v2($db,"fcode",$udt,"code=\'".$v."\'",1);\n  }\n  foreach ($ar[\'fcode\'][\'level2\'] as $k => $v) {\n    $udt=array(\n      \'s2025\'=>$j[$v],\n    );\n    $dt[\'sql\'][]=Update_v2($db,"fcode",$udt,"code=\'".$v."\'",1);\n  }\n  $dt[\'count\']=$j;\n  return $dt; \n}','php','0','2','1','1748781864');
INSERT INTO `cp_sphp` VALUES ('35','api','journal','function journal($year=2025){\n  global $ar,$db;\n  $dt=array();\n\n  $sql="SELECT account_code from journal where `year`=".$year." group by account_code";\n  $res=mysqli_query($db,$sql);\n  if(mysqli_num_rows($res)>0) {  \n    $dt[\'success\']=true;\n    $a=0;\n    while($r1=mysqli_fetch_assoc($res)) {\n      $dt[\'data\'][$r1[\'account_code\']][\'name\']=$ar[\'acc_name\'][$r1[\'account_code\']];\n      //$dt[\'data\'][\'title\']=$ar[\'acc_name\'][$r1[\'account_code\']];\n      $sql2="SELECT a.*,b.descr,b.img from `journal` a JOIN `action` b ON a.action_id=b.id where a.account_code=\'".$r1[\'account_code\']."\' and a.`year`=".$year." order by seq";\n      $res2=mysqli_query($db,$sql2);\n      $b=0;\n      while($r2=mysqli_fetch_assoc($res2)) {\n    if($r2[\'inout\']==2) {\n      $rp="-".ang2($r2[\'amount\']);\n      $col="red";\n      //$p3=$r2[\'pay_to\'];       \n    } else {\n      $rp=ang2($r2[\'amount\']);\n      $col="green"; \n      //$p3=$r2[\'pay_from\'];       \n    }\n      \n        $dt[\'data\'][$r1[\'account_code\']][\'items\'][$b]=$r2;\n        $dt[\'data\'][$r1[\'account_code\']][\'items\'][$b][\'image\']=$ar[\'imgurl\']."".$r2[\'img\'];  \n        $dt[\'data\'][$r1[\'account_code\']][\'items\'][$b][\'rp\']=$rp;\n        $dt[\'data\'][$r1[\'account_code\']][\'items\'][$b][\'col\']=$col;\n        $dt[\'data\'][$r1[\'account_code\']][\'items\'][$b][\'tgl\']=date("Y-m-d",$r2[\'action_at\']);\n        $dt[\'data\'][$r1[\'account_code\']][\'items\'][$b][\'rp_debit\']=ang2($r2[\'debit\']);\n        $dt[\'data\'][$r1[\'account_code\']][\'items\'][$b][\'rp_credit\']=ang2($r2[\'credit\']);\n        $dt[\'data\'][$r1[\'account_code\']][\'items\'][$b][\'rp_balance\']=ang2($r2[\'balance\']);\n        $b++;\n      }\n      $a++;\n    }\n\n  } else {\n    $dt[\'error\']=true;\n    $dt[\'message\']="data not found";\n  }\n  return $dt;\n  $db->close();\n}','php','0','2','1','1748672889');
INSERT INTO `cp_sphp` VALUES ('36','api','action_byseq','function action_byseq() {\n  global $ar,$db;\n  $dt=array();\n  $sql="SELECT * from `action` where id>0 order by id desc";\n  $res2=mysqli_query($db,$sql);\n  $d=0;\n  while($r2=mysqli_fetch_assoc($res2)) {\n    //$d=$r2[\'id\'];\n    $dt[$d]=$r2;    \n    if($r2[\'inout\']==2) {\n      $rp="-".ang2($r2[\'amount\']);\n      $col="red";\n      $p3=$r2[\'pay_to\'];       \n    } else {\n      $rp=ang2($r2[\'amount\']);\n      $col="green"; \n      $p3=$r2[\'pay_from\'];       \n    }\n    $dt[$d][\'rp\']=$rp;    \n    $dt[$d][\'col\']=$col;    \n    $dt[$d][\'p3\']=$p3;    \n    $dt[$d][\'image\']=$ar[\'imgurl\']."".$r2[\'img\'];  \n    $dt[$d][\'act_datetime\']=date("Y-m-d H:i:s",$r2[\'action_at\']);\n    $dt[$d][\'act_date\']=date("Y-m-d",$r2[\'action_at\']);\n    $dt[$d][\'act_month\']=date("Y-m",$r2[\'action_at\']);\n    $dt[$d][\'update\']=date("Y-m-d H:i:s",$r2[\'update_at\']);\n    $d++;\n  }\n  return $dt;    \n}','php','0','2','1','1748424079');
INSERT INTO `cp_sphp` VALUES ('37','common','UploadImageData','function UploadImageData($POST,$img_data,$modul) {\n    global $db,$ar;\n    //echo "<pre>"; print_r($POST); echo "</pre>";\n    //echo "<pre>"; print_r($FILES); echo "</pre>";\n    if(isset($POST[\'title\']) && ($POST[\'title\']!=\'\')) {\n        $title=$POST[\'title\'];\n    } else {\n        $title="";\n    }\n    if(isset($POST[\'caption\']) && ($POST[\'caption\']!=\'\')) {\n        $caption=$POST[\'caption\'];\n    } else {\n        $caption="";\n    }\n    //get last id\n    $sql2= "select id from `files` order by id desc limit 1";\n    $res2=mysqli_query($db,$sql2);\n    $r2=mysqli_fetch_assoc($res2);\n\n    if(isset($r2[\'id\']) && ($r2[\'id\']>0)) {\n        $iid=$r2[\'id\']+1;\n    } else {\n        $iid=1;\n    }\n\n    //get last seq\n    $sql9= "select seq from `files` where item_id=".$POST[\'id\']." and modul=\'".$modul."\' order by seq desc limit 1";\n    $res9=mysqli_query($db,$sql9);\n    $r9=mysqli_fetch_assoc($res9);\n\n    if(isset($r9[\'seq\']) && ($r9[\'seq\']>0)) {\n        $seq=$r9[\'seq\']+1;\n    } else {\n        $seq=1;\n    }\n\n    $folder_y=$ar[\'img_path\']."".$modul."/".date("y");\n    if (!is_dir($folder_y)) {\n        mkdir($folder_y, 0777, true);\n    }\n    $folder_ym=$folder_y."/".date("m");\n    if (!is_dir($folder_ym)) {\n        mkdir($folder_ym, 0777, true);\n    }\n\n    $folder_ymd=$folder_ym."/".date("d");\n    if (!is_dir($folder_ymd)) {\n        mkdir($folder_ymd, 0777, true);\n    }\n\n    $folder_ymdh=$folder_ymd."/".date("H");\n    if (!is_dir($folder_ymdh)) {\n        mkdir($folder_ymdh, 0777, true);\n    }\n\n    $folder_main=$folder_ymdh."/".$POST[\'id\'];\n\n    if (!is_dir($folder_main)) {\n        mkdir($folder_main, 0777, true);\n    }\n    $folder_seq=$folder_main."/".$seq;\n    if (!is_dir($folder_seq)) {\n        mkdir($folder_seq, 0777, true);\n    }\n\n    $folder_tmp=$folder_seq."/tmp";\n    if (!is_dir($folder_tmp)) {\n        mkdir($folder_tmp, 0777, true);\n    }\n\n    /*$sub_folder=$_POST[\'id\']."/".$seq."/";\n    switch($_POST[\'file_type\']) {\n      case "Image";\n\n    }*/\n\n    $path=date("y")."/".date("m")."/".date("d")."/".date("H")."/".$POST[\'id\'];;\n    $data=$img_data;\n    $image_info = getimagesize($img_data);\n    $extension = (isset($image_info["mime"]) ? explode(\'/\', $image_info["mime"] )[1]: "");\n    $file_name=date("YmdHis").".".$extension;\n\n    $data = str_replace(\'data:image/\'.$extension.\';base64,\', \'\', $data);\n    $data = str_replace(\' \',\'+\',$data);\n    $bin = base64_decode($data);\n    if ($bin === false) {\n      //$dt[\'info\']="convert invalid";  \n    }\n    //$img = imageCreateFromString($bin);\n    //tmp file\n    $tmp_file=$folder_tmp.\'/\'.$file_name;\n    file_put_contents($tmp_file, $bin);\n\n    $sub_folder=$folder_seq."/image";\n    $sub_folder_big=$folder_seq."/image/big";\n    $sub_folder_medium=$folder_seq."/image/medium";\n    $sub_folder_small=$folder_seq."/image/small";\n\n    if(!is_dir($sub_folder)){ mkdir($sub_folder, 0755); }\n    if(!is_dir($sub_folder_big)){ mkdir($sub_folder_big, 0755); }\n    if(!is_dir($sub_folder_medium)){ mkdir($sub_folder_medium, 0755); }\n    if(!is_dir($sub_folder_small)){ mkdir($sub_folder_small, 0755); }\n\n    $source_image=$tmp_file;\n    $img_big= $sub_folder_big."/".$file_name;\n    $img_medium= $sub_folder_medium."/".$file_name;\n    $img_small= $sub_folder_small."/".$file_name;\n    //$destination=$ar[\'img_path\']."".$img_url;\n    //resize(640, $destination, $source_image);\n    image_handler($source_image,$img_big,1080,1080,90,false);\n    image_handler($source_image,$img_medium,800,800,90,false);\n    image_handler($source_image,$img_small,150,150,90,false);\n\n    $udata2=array(\n      \'id\'=>$iid,\n      \'seq\'=>$seq,\n      \'modul\'=>$modul,\n      \'item_id\'=>$POST[\'id\'],\n      \'type\'=>\'image\',\n      \'title\'=>gpc($title),\n      \'caption\'=>gpc($caption),\n      \'url_original\'=>"temp/".$file_name,\n      \'create_at\'=>time(),\n      \'path\'=>$path,\n      \'url\'=>$file_name\n      );\n    Insert($db,"files",$udata2,0);\n\n    $udt2=array(\n      \'img\'=>$modul."/".$path."/".$seq."/image/small/".$file_name,\n    );\n    Update($db,$modul,$udt2,"id=".$POST[\'id\']);\n}','php','0','2','3','1748687899');
INSERT INTO `cp_sphp` VALUES ('38','common','genToken','function genToken($length = 10) {\n  $characters = \'abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPRSTUVWXYZ_@!)(^%\';\n  $charactersLength = strlen($characters);\n  $randomString = \'\';\n  for ($i = 0; $i < $length; $i++) {\n      $randomString .= $characters[rand(0, $charactersLength - 1)];\n  }\n  return $randomString;\n}','php','0','2','3','1748687964');
INSERT INTO `cp_sphp` VALUES ('39','common','arCss','function arCss($css) {\n  $cleanCss = [];\n\n  // Remove css comments\n  $clean1 = explode(\'/*\', $css);\n  foreach($clean1 as $clean2) {\n      $clean3 = explode(\'*/\', $clean2);\n      $cleanCss[] = $clean3[count($clean3) -1];\n  }\n  $css = implode(\'\', $cleanCss);\n  $temp = explode(\'}\', $css);\n  $params = [];\n  $type = \'all\';\n  $nextBracketIsNotMediaEnd = false;\n  foreach($temp as $tem2) {\n      $data = explode(\'{\', $tem2);\n      if (count($data) == 1) {\n          if ($nextBracketIsNotMediaEnd) {\n              $nextBracketIsNotMediaEnd = false;\n          } else {\n              $type = \'all\';\n              continue;\n          }\n      }\n      if (count($data) == 3) {\n          $typeTemp = trim($data[0]);\n          if (substr( $typeTemp, 0, 6 ) === "@media" ) {\n              $type = $typeTemp;\n              array_shift($data);\n          } else {\n              $data[1] = $data[0].$data[1];\n              $nextBracketIsNotMediaEnd = true;\n          }\n      }\n      if (count($data) == 2) {\n          $rows = explode(\';\',$data[1]);\n\n          $tempData = [];\n          foreach($rows as $row) {\n              $paramsinline = explode(\':\', $row);\n              if (empty($paramsinline[0]) || empty($paramsinline[1])){\n                  continue;\n              }\n              $tempData[trim($paramsinline[0])] = trim($paramsinline[1]);\n          }\n          $selector = trim($data[0]);\n          if (!empty($tempData)) {\n              if (empty($params[$type][$selector])) {\n                  $params[$type][$selector] = $tempData;\n              } else {\n                  $params[$type][$selector] = array_merge($params[$type][$selector], $tempData);\n              }\n          }\n      }\n  }\n  return $params; \n}','php','0','2','3','1748687993');
INSERT INTO `cp_sphp` VALUES ('40','common','genRandom','function genRandom($length = 10) {\n    $characters = \'1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ\';\n    $charactersLength = strlen($characters);\n    $randomString = \'\';\n    for ($i = 0; $i < $length; $i++) {\n        $randomString .= $characters[rand(0, $charactersLength - 1)];\n    }\n    return $randomString;\n}','php','0','2','3','1748688025');
INSERT INTO `cp_sphp` VALUES ('41','common','genCode','function genCode($length = 10) {\n    $characters = \'abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPRSTUVWXYZ\';\n    $charactersLength = strlen($characters);\n    $randomString = \'\';\n    for ($i = 0; $i < $length; $i++) {\n        $randomString .= $characters[rand(0, $charactersLength - 1)];\n    }\n    return $randomString;\n}','php','0','2','3','1748688046');
INSERT INTO `cp_sphp` VALUES ('42','common','getUserIP','function getUserIP(){\n  $client  = @$_SERVER[\'HTTP_CLIENT_IP\'];\n  $forward = @$_SERVER[\'HTTP_X_FORWARDED_FOR\'];\n  $remote  = $_SERVER[\'REMOTE_ADDR\'];\n\n  if(filter_var($client, FILTER_VALIDATE_IP)){\n      $ip = $client;\n  }\n  elseif(filter_var($forward, FILTER_VALIDATE_IP)){\n      $ip = $forward;\n  }\n  else{\n      $ip = $remote;\n  }\n  return $ip;\n}','php','0','2','3','1748688096');
INSERT INTO `cp_sphp` VALUES ('43','common','emptyDir','function emptyDir($dir) {\n  if (is_dir($dir)) {\n    $scn = scandir($dir);\n    foreach ($scn as $files) {\n      if ($files !== \'.\') {\n        if ($files !== \'..\') {\n          if (!is_dir($dir . \'/\' . $files)) {\n            unlink($dir . \'/\' . $files);\n          } else {\n            emptyDir($dir . \'/\' . $files);\n            rmdir($dir . \'/\' . $files);\n          }\n        }\n      }\n    }\n  }\n}','php','0','2','3','1748688148');
INSERT INTO `cp_sphp` VALUES ('44','common','slug','function slug($text){\n  // replace non letter or digits by -\n  $text = preg_replace(\'~[^pLd]+~u\', \'-\', $text);\n  // transliterate\n  $text = iconv(\'utf-8\', \'us-ascii//TRANSLIT\', $text);\n  // remove unwanted characters\n  $text = preg_replace(\'~[^-w]+~\', \'\', $text);\n  // trim\n  $text = trim($text, \'-\');\n  // remove duplicate -\n  $text = preg_replace(\'~-+~\', \'-\', $text);\n  // lowercase\n  $text = strtolower($text);\n  if (empty($text)) {\n    return \'n-a\';\n  }\n  return $text;\n}','php','0','2','3','1748688192');
INSERT INTO `cp_sphp` VALUES ('45','common','image_resize','function image_resize($newWidth, $targetFile, $originalFile) {\n  $info = getimagesize($originalFile);\n  $mime = $info[\'mime\'];\n\n  switch ($mime) {\n    case \'image/jpeg\':\n      $image_create_func = \'imagecreatefromjpeg\';\n      $image_save_func = \'imagejpeg\';\n      $new_image_ext = \'jpg\';\n      break;\n\n    case \'image/png\':\n      $image_create_func = \'imagecreatefrompng\';\n      $image_save_func = \'imagepng\';\n      $new_image_ext = \'png\';\n      break;\n\n    case \'image/gif\':\n      $image_create_func = \'imagecreatefromgif\';\n      $image_save_func = \'imagegif\';\n      $new_image_ext = \'gif\';\n      break;\n\n    default: \n      throw new Exception(\'Unknown image type.\');\n  }\n\n  $img = $image_create_func($originalFile);\n  list($width, $height) = getimagesize($originalFile);\n  $newHeight = ($height / $width) * $newWidth;\n  $tmp = imagecreatetruecolor($newWidth, $newHeight);\n  imagecopyresampled($tmp, $img, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);\n  if (file_exists($targetFile)) {\n    unlink($targetFile);\n  }\n  $image_save_func($tmp, "$targetFile");\n}','php','0','2','3','1748692193');
INSERT INTO `cp_sphp` VALUES ('46','common','image_resize_w_mark','function image_resize_w_mark($img_src,$img_dst,$new_w,$quality=80,$wmsource=false) {\n  // The getimagesize functions provides an "imagetype" string contstant, which can be passed to the image_type_to_mime_type function for the corresponding mime type\n  $info = getimagesize($img_src);\n  $imgtype = image_type_to_mime_type($info[2]);\n  // Then the mime type can be used to call the correct function to generate an image resource from the provided image\n  switch ($imgtype) {\n  case \'image/jpeg\':\n    $source = imagecreatefromjpeg($img_src);\n    break;\n  case \'image/gif\':\n    $source = imagecreatefromgif($img_src);\n    break;\n  case \'image/png\':\n    $source = imagecreatefrompng($img_src);\n    break;\n  default:\n    die($img_src.\'Invalid image type.\');\n  }\n  // Now, we can determine the dimensions of the provided image, and calculate the width/height ratio\n  $src_w = imagesx($source);\n  $src_h = imagesy($source);\n  $src_ratio = $src_h/$src_w;\n  // Now we can use the power of math to determine whether the image needs to be cropped to fit the new dimensions, and if so then whether it should be cropped vertically or horizontally. We\'re just going to crop from the center to keep this simple.\n  \n  /*\n  if ($tn_w/$tn_h > $src_ratio) {\n  $new_h = $tn_w/$src_ratio;\n  $new_w = $tn_w;\n  } else {\n  $new_w = $tn_h*$src_ratio;\n  $new_h = $tn_h;\n  }\n  */\n  \n  $new_h=$new_w*$src_ratio;\n  $tn_w=$new_w;\n  $tn_h=$new_h;\n  \n  $x_mid = $new_w/2;\n  $y_mid = $new_h/2;\n\n  // Now actually apply the crop and resize!\n  $newpic = imagecreatetruecolor(round($new_w), round($new_h));\n  imagecopyresampled($newpic, $source, 0, 0, 0, 0, $new_w, $new_h, $src_w, $src_h);\n  $final = imagecreatetruecolor($tn_w, $tn_h);\n  imagecopyresampled($final, $newpic, 0, 0, ($x_mid-($tn_w/2)), ($y_mid-($tn_h/2)), $tn_w, $tn_h, $tn_w, $tn_h);\n  // If a watermark source file is specified, get the information about the watermark as well. This is the same thing we did above for the source image.\n  if($wmsource) {\n  $info = getimagesize($wmsource);\n  $imgtype = image_type_to_mime_type($info[2]);\n  switch ($imgtype) {\n    case \'image/jpeg\':\n      $watermark = imagecreatefromjpeg($wmsource);\n      break;\n    case \'image/gif\':\n      $watermark = imagecreatefromgif($wmsource);\n      break;\n    case \'image/png\':\n      $watermark = imagecreatefrompng($wmsource);\n      break;\n    default:\n      die(\'Invalid watermark type.\');\n  }\n  // Determine the size of the watermark, because we\'re going to specify the placement from the top left corner of the watermark image, so the width and height of the watermark matter.\n  $wm_w = imagesx($watermark);\n  $wm_h = imagesy($watermark);\n  // Now, figure out the values to place the watermark in the bottom right hand corner. You could set one or both of the variables to "0" to watermark the opposite corners, or do your own math to put it somewhere else.\n  $wm_x = ($tn_w - $wm_w)/2;\n  $wm_y = ($tn_h - $wm_h)/2;\n  // Copy the watermark onto the original image\n  // The last 4 arguments just mean to copy the entire watermark\n  imagecopy($final, $watermark, $wm_x, $wm_y, 0, 0, $wm_w, $wm_h);\n  }\n  // Ok, save the output as a jpeg, to the specified img_dst path at the desired quality.\n  // You could use imagepng or imagegif here if you wanted to output those file types instead.\n  if(Imagejpeg($final,$img_dst,$quality)) {\n  return true;\n  }\n  // If something went wrong\n  return false;\n}','php','0','2','3','1748693189');
INSERT INTO `cp_sphp` VALUES ('47','common','image_handler','function image_handler($source_image,$destination,$tn_w = 100,$tn_h = 100,$quality = 80,$wmsource = false) {\n  // The getimagesize functions provides an "imagetype" string contstant, which can be passed to the image_type_to_mime_type function for the corresponding mime type\n  $info = getimagesize($source_image);\n  $imgtype = image_type_to_mime_type($info[2]);\n  // Then the mime type can be used to call the correct function to generate an image resource from the provided image\n  switch ($imgtype) {\n  case \'image/jpeg\':\n    $source = imagecreatefromjpeg($source_image);\n    break;\n  case \'image/gif\':\n    $source = imagecreatefromgif($source_image);\n    break;\n  case \'image/png\':\n    $source = imagecreatefrompng($source_image);\n    break;\n  default:\n    die($source_image.\'Invalid image type.\');\n  }\n  // Now, we can determine the dimensions of the provided image, and calculate the width/height ratio\n  $src_w = imagesx($source);\n  $src_h = imagesy($source);\n  $src_ratio = $src_w/$src_h;\n  // Now we can use the power of math to determine whether the image needs to be cropped to fit the new dimensions, and if so then whether it should be cropped vertically or horizontally. We\'re just going to crop from the center to keep this simple.\n  if ($tn_w/$tn_h > $src_ratio) {\n  $new_h = $tn_w/$src_ratio;\n  $new_w = $tn_w;\n  } else {\n  $new_w = $tn_h*$src_ratio;\n  $new_h = $tn_h;\n  }\n  $x_mid = $new_w/2;\n  $y_mid = $new_h/2;\n  // Now actually apply the crop and resize!\n  $newpic = imagecreatetruecolor(round($new_w), round($new_h));\n  imagecopyresampled($newpic, $source, 0, 0, 0, 0, $new_w, $new_h, $src_w, $src_h);\n  $final = imagecreatetruecolor($tn_w, $tn_h);\n  imagecopyresampled($final, $newpic, 0, 0, ($x_mid-($tn_w/2)), ($y_mid-($tn_h/2)), $tn_w, $tn_h, $tn_w, $tn_h);\n  // If a watermark source file is specified, get the information about the watermark as well. This is the same thing we did above for the source image.\n  if($wmsource) {\n  $info = getimagesize($wmsource);\n  $imgtype = image_type_to_mime_type($info[2]);\n  switch ($imgtype) {\n    case \'image/jpeg\':\n      $watermark = imagecreatefromjpeg($wmsource);\n      break;\n    case \'image/gif\':\n      $watermark = imagecreatefromgif($wmsource);\n      break;\n    case \'image/png\':\n      $watermark = imagecreatefrompng($wmsource);\n      break;\n    default:\n      die(\'Invalid watermark type.\');\n  }\n  // Determine the size of the watermark, because we\'re going to specify the placement from the top left corner of the watermark image, so the width and height of the watermark matter.\n  $wm_w = imagesx($watermark);\n  $wm_h = imagesy($watermark);\n  // Now, figure out the values to place the watermark in the bottom right hand corner. You could set one or both of the variables to "0" to watermark the opposite corners, or do your own math to put it somewhere else.\n  $wm_x = ($tn_w - $wm_w)/2;\n  $wm_y = ($tn_h - $wm_h)/2;\n  // Copy the watermark onto the original image\n  // The last 4 arguments just mean to copy the entire watermark\n  imagecopy($final, $watermark, $wm_x, $wm_y, 0, 0, $wm_w, $wm_h);\n  }\n  // Ok, save the output as a jpeg, to the specified destination path at the desired quality.\n  // You could use imagepng or imagegif here if you wanted to output those file types instead.\n  if(Imagejpeg($final,$destination,$quality)) {\n  return true;\n  }\n  // If something went wrong\n  return false;\n}','php','0','2','3','1748688345');
INSERT INTO `cp_sphp` VALUES ('48','common','UploadImage','function UploadImage($POST,$FILES,$modul) {\n  global $db,$ar;\n  if(isset($POST[\'title\']) && ($POST[\'title\']!=\'\')) {\n      $title=$POST[\'title\'];\n  } else {\n      $title="";\n  }\n  if(isset($POST[\'caption\']) && ($POST[\'caption\']!=\'\')) {\n      $caption=$POST[\'caption\'];\n  } else {\n      $caption="";\n  }\n  //get last id\n  $sql2= "select id from `files` order by id desc limit 1";\n  $res2=mysqli_query($db,$sql2);\n  $r2=mysqli_fetch_assoc($res2);\n\n  if(isset($r2[\'id\']) && ($r2[\'id\']>0)) {\n      $iid=$r2[\'id\']+1;\n  } else {\n      $iid=1;\n  }\n\n  //get last seq\n  $sql9= "select seq from `files` where item_id=".$POST[\'id\']." and modul=\'".$modul."\' order by seq desc limit 1";\n  echo $sql9."<br>";\n  $res9=mysqli_query($db,$sql9);\n  $r9=mysqli_fetch_assoc($res9);\n\n  if(isset($r9[\'seq\']) && ($r9[\'seq\']>0)) {\n    $seq=$r9[\'seq\']+1;\n  } else {\n    $seq=1;\n  }\n\n  $folder_y=$ar[\'img_path\'].$modul."/".date("y");\n  if (!is_dir($folder_y)) {\n    mkdir($folder_y, 0777, true);\n  }\n  $folder_ym=$folder_y."/".date("m");\n  if (!is_dir($folder_ym)) {\n    mkdir($folder_ym, 0777, true);\n  }\n\n  $folder_ymd=$folder_ym."/".date("d");\n  if (!is_dir($folder_ymd)) {\n    mkdir($folder_ymd, 0777, true);\n  }\n\n  $folder_ymdh=$folder_ymd."/".date("H");\n  if (!is_dir($folder_ymdh)) {\n    mkdir($folder_ymdh, 0777, true);\n  }\n\n  $folder_main=$folder_ymdh."/".$POST[\'id\'];\n  if (!is_dir($folder_main)) {\n    mkdir($folder_main, 0777, true);\n  }\n  $folder_seq=$folder_main."/".$seq;\n  if (!is_dir($folder_seq)) {\n    mkdir($folder_seq, 0777, true);\n  }\n  $folder_tmp=$folder_seq."/tmp";\n  if (!is_dir($folder_tmp)) {\n    mkdir($folder_tmp, 0777, true);\n  }\n\n  /*$sub_folder=$_POST[\'id\']."/".$seq."/";\n  switch($_POST[\'file_type\']) {\n    case "Image";\n\n  }*/\n\n  $path=date("y")."/".date("m")."/".date("d")."/".date("H")."/".$POST[\'id\'];\n  $e_ext=explode("/",$FILES[\'file\'][\'type\']);\n  $file_name=date("YmdHis").".".$e_ext[1];\n\n  if($POST[\'file_type\']==\'image\') {\n    if (move_uploaded_file($FILES[\'file\'][\'tmp_name\'], $folder_tmp.\'/\'. $FILES["file"][\'name\'])) {\n      //echo "Image Card Front Uploaded";\n      //$file_name=date("YmdHis").".jpg";\n\n\n      $sub_folder=$folder_seq."/image";\n      $sub_folder_big=$folder_seq."/image/big";\n      $sub_folder_medium=$folder_seq."/image/medium";\n      $sub_folder_small=$folder_seq."/image/small";\n\n      if(!is_dir($sub_folder)){ mkdir($sub_folder, 0755); }\n      if(!is_dir($sub_folder_big)){ mkdir($sub_folder_big, 0755); }\n      if(!is_dir($sub_folder_medium)){ mkdir($sub_folder_medium, 0755); }\n      if(!is_dir($sub_folder_small)){ mkdir($sub_folder_small, 0755); }\n\n      $source_image=$folder_tmp.\'/\'. $FILES["file"][\'name\'];\n      $img_big= $sub_folder_big."/".$file_name;\n      $img_medium= $sub_folder_medium."/".$file_name;\n      $img_small= $sub_folder_small."/".$file_name;\n      //$destination=$ar[\'img_path\']."".$img_url;\n      //resize(640, $destination, $source_image);\n      image_handler($source_image,$img_big,1080,1080,90,false);\n      image_handler($source_image,$img_medium,800,800,90,false);\n      image_handler($source_image,$img_small,150,150,90,false);\n\n      echo $sub_folder_small."<br>";\n\n      $udata2=array(\n        \'id\'=>$iid,\n        \'seq\'=>$seq,\n        \'modul\'=>$modul,\n        \'item_id\'=>$POST[\'id\'],\n        \'type\'=>\'image\',\n        \'title\'=>gpc($title),\n        \'caption\'=>gpc($caption),\n        \'url_original\'=>\'tmp/\'.$FILES["file"][\'name\'],\n        \'create_at\'=>time(),\n        \'path\'=>$path,\n        \'url\'=>$file_name\n        );\n      Insert($db,"files",$udata2,1);\n\n      $udt2=array(\n        \'img\'=>$modul."/".$path."/".$seq."/image/small/".$file_name,\n      );\n      Update($db,$modul,$udt2,"id=".$POST[\'id\'],1);\n    }\n  } else {\n    if (move_uploaded_file($FILES[\'file\'][\'tmp_name\'], $folder_seq.\'/\'.$file_name)) {\n      //echo "Image Card Front Uploaded";\n      $udata2=array(\n        \'id\'=>$iid,\n        \'seq\'=>$seq,\n        \'modul\'=>$modul,\n        \'item_id\'=>$POST[\'id\'],\n        \'type\'=>$POST[\'file_type\'],\n        \'title\'=>gpc($title),\n        \'caption\'=>gpc($caption),\n        \'url_original\'=>\'tmp/\'.$FILES["file"][\'name\'],\n        \'create_at\'=>time(),\n        \'path\'=>$path,\n        \'url\'=>$file_name,\n        );\n      Insert($db,"files",$udata2,0);\n    }\n  }   \n}','php','0','2','3','1748688515');
INSERT INTO `cp_sphp` VALUES ('49','common','CopyUrlImage','function CopyUrlImage($POST,$modul) {\n  global $db,$ar;\n  if(isset($POST[\'title\']) && ($POST[\'title\']!=\'\')) {\n      $title=$POST[\'title\'];\n  } else {\n      $title="";\n  }\n  if(isset($POST[\'caption\']) && ($POST[\'caption\']!=\'\')) {\n      $caption=$POST[\'caption\'];\n  } else {\n      $caption="";\n  }\n  //get last id\n  $sql2= "select id from `files` order by id desc limit 1";\n  $res2=mysqli_query($db,$sql2);\n  $r2=mysqli_fetch_assoc($res2);\n\n  if(isset($r2[\'id\']) && ($r2[\'id\']>0)) {\n      $iid=$r2[\'id\']+1;\n  } else {\n      $iid=1;\n  }\n\n\n  //get last seq\n  $sql9= "select seq from `files` where item_id=".$POST[\'id\']." and modul=\'".$modul."\' order by seq desc limit 1";\n  //echo $sql9."<br>";\n  $res9=mysqli_query($db,$sql9);\n  $r9=mysqli_fetch_assoc($res9);\n\n  if(isset($r9[\'seq\']) && ($r9[\'seq\']>0)) {\n      $seq=$r9[\'seq\']+1;\n  } else {\n      $seq=1;\n  }\n\n  $folder_y=$ar[\'img_path\'].$modul."/".date("y");\n  if (!is_dir($folder_y)) {\n      mkdir($folder_y, 0777, true);\n  }\n  $folder_ym=$folder_y."/".date("m");\n  if (!is_dir($folder_ym)) {\n      mkdir($folder_ym, 0777, true);\n  }\n\n  $folder_ymd=$folder_ym."/".date("d");\n  if (!is_dir($folder_ymd)) {\n      mkdir($folder_ymd, 0777, true);\n  }\n\n  $folder_ymdh=$folder_ymd."/".date("H");\n  if (!is_dir($folder_ymdh)) {\n      mkdir($folder_ymdh, 0777, true);\n  }\n\n  $folder_main=$folder_ymdh."/".$POST[\'id\'];\n\n  if (!is_dir($folder_main)) {\n      mkdir($folder_main, 0777, true);\n  }\n  $folder_seq=$folder_main."/".$seq;\n  if (!is_dir($folder_seq)) {\n      mkdir($folder_seq, 0777, true);\n  }\n\n  $folder_tmp=$folder_seq."/tmp";\n  if (!is_dir($folder_tmp)) {\n      mkdir($folder_tmp, 0777, true);\n  }\n\n  $path=date("y")."/".date("m")."/".date("d")."/".date("H")."/".$POST[\'id\'];\n  if($POST[\'url_img_src\']!=\'\') {\n    $info_img = getimagesize($POST[\'url_img_src\']);\n    $e_ext=explode("/",$info_img[\'mime\']);\n    $file_name=date("YmdHis").".".$e_ext[1];\n    $e_url=explode("/",$POST[\'url_img_src\']);\n\n    copyimg($POST[\'url_img_src\'],$folder_tmp."/".$file_name);\n    //echo "Image Card Front Uploaded";\n    //$file_name=date("YmdHis").".jpg";\n\n\n    $sub_folder=$folder_seq."/image";\n    $sub_folder_big=$folder_seq."/image/big";\n    $sub_folder_medium=$folder_seq."/image/medium";\n    $sub_folder_small=$folder_seq."/image/small";\n\n    if(!is_dir($sub_folder)){ mkdir($sub_folder, 0755); }\n    if(!is_dir($sub_folder_big)){ mkdir($sub_folder_big, 0755); }\n    if(!is_dir($sub_folder_medium)){ mkdir($sub_folder_medium, 0755); }\n    if(!is_dir($sub_folder_small)){ mkdir($sub_folder_small, 0755); }\n\n    $source_image=$folder_tmp.\'/\'. $file_name;\n    $img_big= $sub_folder_big."/".$file_name;\n    $img_medium= $sub_folder_medium."/".$file_name;\n    $img_small= $sub_folder_small."/".$file_name;\n    //$destination=$ar[\'img_path\']."".$img_url;\n    //resize(640, $destination, $source_image);\n    image_handler($source_image,$img_big,1080,1080,90,false);\n    image_handler($source_image,$img_medium,800,800,90,false);\n    image_handler($source_image,$img_small,150,150,90,false);\n\n    //echo $sub_folder_small."<br>";\n\n    $udata2=array(\n      \'id\'=>$iid,\n      \'seq\'=>$seq,\n      \'modul\'=>$modul,\n      \'item_id\'=>$POST[\'id\'],\n      \'type\'=>\'image\',\n      \'title\'=>gpc($title),\n      \'caption\'=>gpc($caption),\n      \'url_original\'=>\'tmp/\'.$file_name,\n      \'create_at\'=>time(),\n      \'path\'=>$path,\n      \'url\'=>$file_name\n      );\n    Insert($db,"files",$udata2,0);\n    $udt2=array(\n      \'img\'=>$modul."/".$path."/".$seq."/image/small/".$file_name,\n    );\n    Update($db,$modul,$udt2,"id=".$POST[\'id\'],0);\n  }\n}','php','0','2','3','1748688648');
INSERT INTO `cp_sphp` VALUES ('50','common','getDistance','function getDistance($latitude1, $longitude1, $latitude2, $longitude2) {\n  $theta = $longitude1 - $longitude2;\n  $miles = (sin(deg2rad($latitude1)) * sin(deg2rad($latitude2))) + (cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * cos(deg2rad($theta)));\n  $miles = acos($miles);\n  $miles = rad2deg($miles);\n  $miles = $miles * 60 * 1.1515;\n  $feet = $miles * 5280;\n  $yards = $feet / 3;\n  $kilometers = $miles * 1.609344;\n  $meters = $kilometers * 1000;\n  //return compact(\'miles\',\'feet\',\'yards\',\'kilometers\',\'meters\'); \n  return $kilometers;\n}','php','0','2','3','1748688710');
INSERT INTO `cp_sphp` VALUES ('51','common','to_tgl','function to_tgl($time) {\n  if($time>0) {\n    $tt=date("Y-m-d H:i:s",$time);\n  } else {\n    $tt="";\n  }    \n  return $tt;\n}','php','0','2','3','1748688779');
INSERT INTO `cp_sphp` VALUES ('52','common','to_hp','function to_hp($ang) {\n  $sid = preg_replace("/[^0-9]/","",$ang);\n\n  $awalan=substr($sid,0,2);\n  if($awalan==\'08\') {\n      $newhp="628".substr($sid,2);\n  } else {\n      $newhp=$sid;\n  }\n\n  return $newhp;\n}','php','0','2','3','1748688814');
INSERT INTO `cp_sphp` VALUES ('53','common','NoSpace','function NoSpace($ang) {\n  $sid = preg_replace("/[^A-Za-z0-9]/","",$ang);\n  return $sid;\n}','php','0','2','3','1748688840');
INSERT INTO `cp_sphp` VALUES ('54','common','to_numeric','function to_numeric($ang) {\n  $sid = preg_replace("/[^0-9]/","",$ang);\n  return $sid;\n}','php','0','2','3','1748688862');
INSERT INTO `cp_sphp` VALUES ('55','common','getimg','function getimg($url) {         \n  $headers[] = \'Accept: image/gif, image/x-bitmap, image/jpeg, image/pjpeg\';              \n  $headers[] = \'Connection: Keep-Alive\';         \n  $headers[] = \'Content-type: application/x-www-form-urlencoded;charset=UTF-8\';         \n  $user_agent = \'php\';         \n  $process = curl_init($url);         \n  curl_setopt($process, CURLOPT_HTTPHEADER, $headers);         \n  curl_setopt($process, CURLOPT_HEADER, 0);         \n  curl_setopt($process, CURLOPT_USERAGENT, $user_agent); //check here         \n  curl_setopt($process, CURLOPT_TIMEOUT, 30);         \n  curl_setopt($process, CURLOPT_RETURNTRANSFER, 1);         \n  curl_setopt($process, CURLOPT_FOLLOWLOCATION, 1);         \n  $return = curl_exec($process);         \n  curl_close($process);         \n  return $return;     \n}','php','0','2','3','1748688889');
INSERT INTO `cp_sphp` VALUES ('56','common','copyimg','function copyimg($file,$newfile) {\n  if (copy($file, $newfile)) {\n    //echo "<br>Copy <b>$file</b> success!<br>";\n  }else{\n    //echo "<br>Copy <b>$file</b> failed.<br>";\n  }\n}','php','0','2','3','1748695801');
INSERT INTO `cp_sphp` VALUES ('57','common','viewImage','function viewImage($modul,$item_id) {\n  global $db,$ar;\n  $sql2 = "SELECT * FROM `files` WHERE modul=\'".$modul."\' and item_id=\'".$item_id."\' and `type`=\'image\' ";\n  $run2 = mysqli_query($db, $sql2);\n  $ret= "<hr><h3>Images</h3><div class=\'row mb-20 pb-20\'>";\n  while($r2 = mysqli_fetch_assoc($run2)) {\n    $img_small=$modul."/".$r2[\'path\']."/".$r2[\'seq\']."/image/small/".$r2[\'url\'];\n    $img_big=$modul."/".$r2[\'path\']."/".$r2[\'seq\']."/image/big/".$r2[\'url\'];\n    $ret .= \'\n    <div class="col-sm-3 col-lg-2 col-xs-6">\n      <div class="card">\n    \';\n    $ret .= \'<img src="\'.$ar[\'url_img\'].\'\'.$img_small.\'" alt="">\';\n    $ret .= \'\';\n    $ret .= \'\n      </div>\n    </div>\';\n  }\n  $ret .= "</div>";\n  return $ret;\n}','php','0','2','3','1748692136');
INSERT INTO `cp_sphp` VALUES ('58','common','repl_space','function repl_space($text) {\n  $ret = preg_replace(\'!s+!\', \' \', $text);\n  return $ret;\n}','php','0','2','3','1748689052');
INSERT INTO `cp_sphp` VALUES ('59','common','Insert','function Insert($mysqli,$table,$data,$v=0){\n  //global $mysqli;\n  //print_r($data);\n  $fields = array_keys( $data );  \n  $values = array_map( array($mysqli, \'real_escape_string\'), array_values( $data ) );\n  if($v==1) {\n    echo "INSERT INTO `$table`(`".implode("`,`",$fields)."`) VALUES (\'".implode("\',\'", $values )."\');";\n  }\n  //exit;  \n  mysqli_query($mysqli, "INSERT INTO `$table`(`".implode("`,`",$fields)."`) VALUES (\'".implode("\',\'", $values )."\');") or die( mysqli_error($mysqli) );\n}','php','0','2','3','1748692299');
INSERT INTO `cp_sphp` VALUES ('60','common','InsertUpdate','function InsertUpdate($mysqli,$table_name,$i_data,$u_data,$v=0){   \n  $i_fields = array_keys( $i_data );  \n  $i_values = array_map( array($mysqli, \'real_escape_string\'), array_values( $i_data ) );\n\n  $u_fields = array_keys( $u_data );  \n  $u_values = array_map( array($mysqli, \'real_escape_string\'), array_values( $u_data ) );\n\n  $sql = "INSERT INTO `$table_name` (`".implode("`,`",$i_fields)."`) VALUES (\'".implode("\',\'", $i_values )."\') ";    \n\n  // start the actual SQL statement\n  $sql .= " on duplicate key UPDATE ";\n\n  // loop and build the column /\n  $sets = array();\n  foreach($u_data as $column => $value) {\n       $sets[] = "`".$column."`=\'".$value."\'";\n  }\n  $sql .= implode(\', \', $sets);\n\n  if($v==1) {\n    echo $sql.";<br>";\n  }\n  return mysqli_query($mysqli,$sql);\n}','php','0','2','3','1748692370');
INSERT INTO `cp_sphp` VALUES ('61','common','Update','function Update($mysqli,$table_name, $form_data, $where_clause=\'\',$v=0){   \n  $whereSQL = \'\';\n  if(!empty($where_clause)){\n    // check to see if the \'where\' keyword exists\n    if(substr(strtoupper(trim($where_clause)), 0, 5) != \'WHERE\'){\n        // not found, add key word\n      $whereSQL = " WHERE ".$where_clause;\n    } else {\n      $whereSQL = " ".trim($where_clause);\n    }\n  }\n  // start the actual SQL statement\n  $sql = "UPDATE `".$table_name."` SET ";\n  // loop and build the column /\n  $sets = array();\n  foreach($form_data as $column => $value) {\n    $sets[] = "`".$column."` = \'".$value."\'";\n  }\n  $sql .= implode(\', \', $sets);\n  // append the where statement\n  $sql .= $whereSQL;\n  // run and return the query result\n  if($v==1) {\n    echo $sql."<br>";\n  }\n  return mysqli_query($mysqli,$sql);\n}','php','0','2','3','1748692470');
INSERT INTO `cp_sphp` VALUES ('62','common','Delete','function Delete($mysqli,$table_name, $where_clause=\'\'){   \n  $whereSQL = \'\';\n  if(!empty($where_clause)) {\n    // check to see if the \'where\' keyword exists\n    if(substr(strtoupper(trim($where_clause)), 0, 5) != \'WHERE\') {\n      // not found, add keyword\n      $whereSQL = " WHERE ".$where_clause;\n    } else {\n      $whereSQL = " ".trim($where_clause);\n    }\n  }\n  $sql = "DELETE FROM `".$table_name."` ".$whereSQL;\n  return mysqli_query($mysqli,$sql);\n}','php','0','2','3','1748692539');
INSERT INTO `cp_sphp` VALUES ('63','common','Insert_v2','function Insert_v2($mysqli,$table,$data){\n  $dt=array();\n  $fields = array_keys($data);  \n  $values = array_map(array($mysqli,\'real_escape_string\'),array_values($data));\n  $sql="INSERT INTO `$table` (`".implode("`,`",$fields)."`) VALUES (\'".implode("\',\'",$values)."\')";\n  $dt[\'sql\']=$sql;\n  if(mysqli_query($mysqli,$sql)) {\n    $dt[\'result\']="Success";\n  } else {\n    $dt[\'result\']="Error";    \n  }\n  return json_encode($dt);\n}','php','0','2','3','1748692565');
INSERT INTO `cp_sphp` VALUES ('64','common','InsertUpdate_v2','function InsertUpdate_v2($mysqli,$table_name,$i_data,$u_data){   \n  $dt=array();\n  $i_fields = array_keys($i_data);  \n  $i_values = array_map(array($mysqli, \'real_escape_string\'), array_values($i_data));\n\n  $u_fields = array_keys($u_data);  \n  $u_values = array_map(array($mysqli, \'real_escape_string\'), array_values($u_data));\n\n  $sql = "INSERT INTO `$table_name` (`".implode("`,`",$i_fields)."`) VALUES (\'".implode("\',\'", $i_values)."\')";\n\n  // start the actual SQL statement\n  $sql .= " on duplicate key UPDATE ";\n\n  // loop and build the column /\n  $sets = array();\n  foreach($u_data as $column => $value) {\n       $sets[] = "`".$column."`=\'".$value."\'";\n  }\n  $sql .= implode(\', \', $sets);\n  $dt[\'sql\']=$sql.";";\n  // run and return the query result\n  // return mysqli_query($mysqli,$sql);\n  if(mysqli_query($mysqli,$sql)) {\n    $dt[\'result\']="Success";\n  } else {\n    $dt[\'result\']="Error";    \n  }  \n  return json_encode($dt);\n}','php','0','2','3','1748692586');
INSERT INTO `cp_sphp` VALUES ('65','common','Update_v2','function Update_v2($mysqli,$table_name, $form_data, $where_clause=\'\'){   \n  //global $mysqli;\n  // check for optional where clause\n  $whereSQL = \'\';\n  if(!empty($where_clause)){\n    // check to see if the \'where\' keyword exists\n    if(substr(strtoupper(trim($where_clause)), 0, 5) != \'WHERE\'){\n      // not found, add key word\n      $whereSQL = " WHERE ".$where_clause;\n    } else {\n      $whereSQL = " ".trim($where_clause);\n    }\n  }\n  // start the actual SQL statement\n  $sql = "UPDATE `".$table_name."` SET ";\n\n  // loop and build the column /\n  $sets = array();\n  foreach($form_data as $column => $value){\n    $sets[] = "`".$column."` = \'".$value."\'";\n  }\n  $sql .= implode(\', \', $sets);\n\n  // append the where statement\n  $sql .= $whereSQL;\n       \n  $dt[\'sql\']=$sql.";";\n  // run and return the query result\n  // return mysqli_query($mysqli,$sql);\n  if(mysqli_query($mysqli,$sql)) {\n    $dt[\'result\']="Success";\n  } else {\n    $dt[\'result\']="Error";    \n  }  \n  return json_encode($dt);\n}','php','0','2','3','1748692612');
INSERT INTO `cp_sphp` VALUES ('66','common','Delete_v2','function Delete_v2($db,$table_name, $where_clause=\'\'){   \n  $whereSQL = \'\';\n  if(!empty($where_clause)) {\n    if(substr(strtoupper(trim($where_clause)), 0, 5) != \'WHERE\') {\n      $whereSQL = " WHERE ".$where_clause;\n    } else {\n      $whereSQL = " ".trim($where_clause);\n    }\n  }\n  $sql = "DELETE FROM `".$table_name."` ".$whereSQL;\n  $dt[\'sql\']=$sql.";";\n  if(mysqli_query($db,$sql)) {\n    $dt[\'result\']="Success";\n  } else {\n    $dt[\'result\']="Error";    \n  }  \n  return json_encode($dt);\n}','php','0','2','3','1748692682');
INSERT INTO `cp_sphp` VALUES ('67','common','image_upload_v2','function image_upload_v2($POST,$FILES,$modul) {\n  global $db,$ar;\n  if(isset($POST[\'title\']) && ($POST[\'title\']!=\'\')) {\n      $title=$POST[\'title\'];\n  } else {\n      $title="";\n  }\n  if(isset($POST[\'caption\']) && ($POST[\'caption\']!=\'\')) {\n      $caption=$POST[\'caption\'];\n  } else {\n      $caption="";\n  }\n  //get last id\n  $sql2= "select id from `files` order by id desc limit 1";\n  $res2=mysqli_query($db,$sql2);\n  $r2=mysqli_fetch_assoc($res2);\n\n  if(isset($r2[\'id\']) && ($r2[\'id\']>0)) {\n      $iid=$r2[\'id\']+1;\n  } else {\n      $iid=1;\n  }\n\n  //get last seq\n  $sql9= "select seq from `files` where item_id=".$POST[\'id\']." and modul=\'".$modul."\' order by seq desc limit 1";\n  echo $sql9."<br>";\n  $res9=mysqli_query($db,$sql9);\n  $r9=mysqli_fetch_assoc($res9);\n\n  if(isset($r9[\'seq\']) && ($r9[\'seq\']>0)) {\n    $seq=$r9[\'seq\']+1;\n  } else {\n    $seq=1;\n  }\n\n  $folder_y=$ar[\'img_path\'].$modul."/".date("y");\n  if (!is_dir($folder_y)) {\n    mkdir($folder_y, 0777, true);\n  }\n  $folder_ym=$folder_y."/".date("m");\n  if (!is_dir($folder_ym)) {\n    mkdir($folder_ym, 0777, true);\n  }\n\n  $folder_ymd=$folder_ym."/".date("d");\n  if (!is_dir($folder_ymd)) {\n    mkdir($folder_ymd, 0777, true);\n  }\n\n  $folder_ymdh=$folder_ymd."/".date("H");\n  if (!is_dir($folder_ymdh)) {\n    mkdir($folder_ymdh, 0777, true);\n  }\n\n  $folder_main=$folder_ymdh."/".$POST[\'id\'];\n  if (!is_dir($folder_main)) {\n    mkdir($folder_main, 0777, true);\n  }\n  $folder_seq=$folder_main."/".$seq;\n  if (!is_dir($folder_seq)) {\n    mkdir($folder_seq, 0777, true);\n  }\n  $folder_tmp=$folder_seq."/tmp";\n  if (!is_dir($folder_tmp)) {\n    mkdir($folder_tmp, 0777, true);\n  }\n\n  /*$sub_folder=$_POST[\'id\']."/".$seq."/";\n  switch($_POST[\'file_type\']) {\n    case "Image";\n\n  }*/\n\n  $path=date("y")."/".date("m")."/".date("d")."/".date("H")."/".$POST[\'id\'];\n  $e_ext=explode("/",$FILES[\'file\'][\'type\']);\n  $file_name=date("YmdHis").".".$e_ext[1];\n\n  if($POST[\'file_type\']==\'image\') {\n    if (move_uploaded_file($FILES[\'file\'][\'tmp_name\'], $folder_tmp.\'/\'. $FILES["file"][\'name\'])) {\n      //echo "Image Card Front Uploaded";\n      //$file_name=date("YmdHis").".jpg";\n\n\n      $sub_folder=$folder_seq."/image";\n      $sub_folder_big=$folder_seq."/image/big";\n      $sub_folder_medium=$folder_seq."/image/medium";\n      $sub_folder_small=$folder_seq."/image/small";\n\n      if(!is_dir($sub_folder)){ mkdir($sub_folder, 0755); }\n      if(!is_dir($sub_folder_big)){ mkdir($sub_folder_big, 0755); }\n      if(!is_dir($sub_folder_medium)){ mkdir($sub_folder_medium, 0755); }\n      if(!is_dir($sub_folder_small)){ mkdir($sub_folder_small, 0755); }\n\n      $source_image=$folder_tmp.\'/\'. $FILES["file"][\'name\'];\n      $img_big= $sub_folder_big."/".$file_name;\n      $img_medium= $sub_folder_medium."/".$file_name;\n      $img_small= $sub_folder_small."/".$file_name;\n      //$destination=$ar[\'img_path\']."".$img_url;\n      //resize(640, $destination, $source_image);\n      image_handler($source_image,$img_big,1080,1080,90,false);\n      image_handler($source_image,$img_medium,800,800,90,false);\n      image_handler($source_image,$img_small,150,150,90,false);\n\n      echo $sub_folder_small."<br>";\n\n      $udata2=array(\n        \'id\'=>$iid,\n        \'seq\'=>$seq,\n        \'modul\'=>$modul,\n        \'item_id\'=>$POST[\'id\'],\n        \'type\'=>\'image\',\n        \'title\'=>gpc($title),\n        \'caption\'=>gpc($caption),\n        \'url_original\'=>\'tmp/\'.$FILES["file"][\'name\'],\n        \'create_at\'=>time(),\n        \'path\'=>$path,\n        \'url\'=>$file_name\n        );\n      Insert($db,"files",$udata2,1);\n\n      $udt2=array(\n        \'img\'=>$modul."/".$path."/".$seq."/image/small/".$file_name,\n      );\n      Update($db,$modul,$udt2,"id=".$POST[\'id\'],1);\n    }\n  } else {\n    if (move_uploaded_file($FILES[\'file\'][\'tmp_name\'], $folder_seq.\'/\'.$file_name)) {\n      //echo "Image Card Front Uploaded";\n      $udata2=array(\n        \'id\'=>$iid,\n        \'seq\'=>$seq,\n        \'modul\'=>$modul,\n        \'item_id\'=>$POST[\'id\'],\n        \'type\'=>$POST[\'file_type\'],\n        \'title\'=>gpc($title),\n        \'caption\'=>gpc($caption),\n        \'url_original\'=>\'tmp/\'.$FILES["file"][\'name\'],\n        \'create_at\'=>time(),\n        \'path\'=>$path,\n        \'url\'=>$file_name,\n        );\n      Insert($db,"files",$udata2,0);\n    }\n  }   \n}','php','0','2','3','1748701148');
INSERT INTO `cp_sphp` VALUES ('68','common','image_from_url','function image_from_url($POST,$modul) {\n  global $db,$ar;\n  if(isset($POST[\'title\']) && ($POST[\'title\']!=\'\')) {\n      $title=$POST[\'title\'];\n  } else {\n      $title="";\n  }\n  if(isset($POST[\'caption\']) && ($POST[\'caption\']!=\'\')) {\n      $caption=$POST[\'caption\'];\n  } else {\n      $caption="";\n  }\n  //get last id\n  $sql2= "select id from `files` order by id desc limit 1";\n  $res2=mysqli_query($db,$sql2);\n  $r2=mysqli_fetch_assoc($res2);\n\n  if(isset($r2[\'id\']) && ($r2[\'id\']>0)) {\n      $iid=$r2[\'id\']+1;\n  } else {\n      $iid=1;\n  }\n  //get last seq\n  $sql9= "select seq from `files` where item_id=".$POST[\'id\']." and modul=\'".$modul."\' order by seq desc limit 1";\n  //echo $sql9."<br>";\n  $res9=mysqli_query($db,$sql9);\n  $r9=mysqli_fetch_assoc($res9);\n\n  if(isset($r9[\'seq\']) && ($r9[\'seq\']>0)) {\n      $seq=$r9[\'seq\']+1;\n  } else {\n      $seq=1;\n  }\n\n  $folder_y=$ar[\'img_path\'].$modul."/".date("y");\n  if (!is_dir($folder_y)) {\n      mkdir($folder_y, 0777, true);\n  }\n  $folder_ym=$folder_y."/".date("m");\n  if (!is_dir($folder_ym)) {\n      mkdir($folder_ym, 0777, true);\n  }\n\n  $folder_ymd=$folder_ym."/".date("d");\n  if (!is_dir($folder_ymd)) {\n      mkdir($folder_ymd, 0777, true);\n  }\n\n  $folder_ymdh=$folder_ymd."/".date("H");\n  if (!is_dir($folder_ymdh)) {\n      mkdir($folder_ymdh, 0777, true);\n  }\n\n  $folder_main=$folder_ymdh."/".$POST[\'id\'];\n\n  if (!is_dir($folder_main)) {\n      mkdir($folder_main, 0777, true);\n  }\n  $folder_seq=$folder_main."/".$seq;\n  if (!is_dir($folder_seq)) {\n      mkdir($folder_seq, 0777, true);\n  }\n\n  $folder_tmp=$folder_seq."/tmp";\n  if (!is_dir($folder_tmp)) {\n      mkdir($folder_tmp, 0777, true);\n  }\n\n  $path=date("y")."/".date("m")."/".date("d")."/".date("H")."/".$POST[\'id\'];\n  if($POST[\'url_img_src\']!=\'\') {\n    $info_img = getimagesize($POST[\'url_img_src\']);\n    $e_ext=explode("/",$info_img[\'mime\']);\n    $file_name=date("YmdHis").".".$e_ext[1];\n    $e_url=explode("/",$POST[\'url_img_src\']);\n\n    copyimg($POST[\'url_img_src\'],$folder_tmp."/".$file_name);\n    //echo "Image Card Front Uploaded";\n    //$file_name=date("YmdHis").".jpg";\n\n\n    $sub_folder=$folder_seq."/image";\n    $sub_folder_big=$folder_seq."/image/big";\n    $sub_folder_medium=$folder_seq."/image/medium";\n    $sub_folder_small=$folder_seq."/image/small";\n\n    if(!is_dir($sub_folder)){ mkdir($sub_folder, 0755); }\n    if(!is_dir($sub_folder_big)){ mkdir($sub_folder_big, 0755); }\n    if(!is_dir($sub_folder_medium)){ mkdir($sub_folder_medium, 0755); }\n    if(!is_dir($sub_folder_small)){ mkdir($sub_folder_small, 0755); }\n\n    $source_image=$folder_tmp.\'/\'. $file_name;\n    $img_big= $sub_folder_big."/".$file_name;\n    $img_medium= $sub_folder_medium."/".$file_name;\n    $img_small= $sub_folder_small."/".$file_name;\n    //$destination=$ar[\'img_path\']."".$img_url;\n    //resize(640, $destination, $source_image);\n    image_handler($source_image,$img_big,1080,1080,90,false);\n    image_handler($source_image,$img_medium,800,800,90,false);\n    image_handler($source_image,$img_small,150,150,90,false);\n\n    //echo $sub_folder_small."<br>";\n\n    $udata2=array(\n      \'id\'=>$iid,\n      \'seq\'=>$seq,\n      \'modul\'=>$modul,\n      \'item_id\'=>$POST[\'id\'],\n      \'type\'=>\'image\',\n      \'title\'=>gpc($title),\n      \'caption\'=>gpc($caption),\n      \'url_original\'=>\'tmp/\'.$file_name,\n      \'create_at\'=>time(),\n      \'path\'=>$path,\n      \'url\'=>$file_name\n      );\n    Insert($db,"files",$udata2,0);\n    $udt2=array(\n      \'img\'=>$modul."/".$path."/".$seq."/image/small/".$file_name,\n    );\n    Update($db,$modul,$udt2,"id=".$POST[\'id\'],0);\n  }\n}','php','0','2','3','1748692878');
INSERT INTO `cp_sphp` VALUES ('69','common','xhr','function xhr($url){\n  global $ar,$db;\n  include_once $ar[\'path_core\']."dom/request.php";\n  $xhr = request($url);\n  return $xhr;\n}','php','0','2','3','1748693264');
INSERT INTO `cp_sphp` VALUES ('70','common','repl_all_space','function repl_all_space($text) {\n  $ret = preg_replace(\'/s|&nbsp;/\', \'\', $text);\n  return $ret;\n}','php','0','2','3','1748693286');
INSERT INTO `cp_sphp` VALUES ('71','common','repl_class','function repl_class($text) {\n  $ret = preg_replace(\'/ class=".*?"/\', \'\', $text);\n  $ret = preg_replace(\'/ style=".*?"/\', \'\', $ret);\n  $ret = preg_replace(\'/ dir=".*?"/\', \'\', $ret);\n  return $ret;\n}','php','0','2','3','1748693304');
INSERT INTO `cp_sphp` VALUES ('74','common','CommaToDot','function CommaToDot($grade) {\n$grade = str_replace(\',\', \'.\', $grade);\nreturn $grade;\n}','php','0','2','3','1748693469');
INSERT INTO `cp_sphp` VALUES ('75','common','ang2','function ang2($l) {\n  $l=number_format($l, 0, \'.\', \',\');\n  return $l;\n}','php','0','2','3','1748693487');
INSERT INTO `cp_sphp` VALUES ('76','common','ang','function ang($l) {\n  $l=number_format($l, 0, \',\', \'.\');\n  return $l;\n}','php','0','2','3','1748693506');
INSERT INTO `cp_sphp` VALUES ('77','common','dec','function dec($l) {\n  $l=number_format($l, 2, \',\', \'.\');\n  return $l;\n}\nfunction dec1($l) {\n  $l=number_format($l, 1, \',\', \'.\');\n  return $l;\n}\nfunction dec2($l) {\n  $l=number_format($l, 2, \',\', \'.\');\n  return $l;\n}','php','0','2','3','1748763715');
INSERT INTO `cp_sphp` VALUES ('78','common','nodec','function nodec($l) {\n  $l=number_format($l, 0, \'\', \'\');\n  return $l;\n}','php','0','2','3','1748695113');
INSERT INTO `cp_sphp` VALUES ('79','common','find_contains','function find_contains($html, $selector, $keyword, $index=-1) {\n    $ret = array();\n    foreach ($html->find($selector) as $e) {\n        if (strpos($e->innertext, $keyword)!==false)\n            $ret[] = $e;\n    }\n\n    if ($index<0) return $ret;\n    return (isset($ret[$index])) ? $ret[$index] : null;\n}','php','0','2','3','1748695153');
INSERT INTO `cp_sphp` VALUES ('80','common','find_contains_v1','function find_contains_v1($html, $selector, $index=-1) {\n    $ret = array();\n    foreach ($html->find($selector) as $e) {\n            $ret[] = $e;\n    }\n\n    if ($index<0) return $ret;\n    return (isset($ret[$index])) ? $ret[$index] : null;\n}','php','0','2','3','1748695173');
INSERT INTO `cp_sphp` VALUES ('81','common','to_char','function to_char($ang) {\n$sid = preg_replace("/[^A-Za-z]/","",$ang);\nreturn $sid;\n}','php','0','2','3','1748695207');
INSERT INTO `cp_sphp` VALUES ('82','common','image_view','function image_view($modul,$item_id) {\n  global $db,$ar;\n  $sql2 = "SELECT * FROM `files` WHERE modul=\'".$modul."\' and item_id=\'".$item_id."\' and `type`=\'image\' ";\n  $run2 = mysqli_query($db, $sql2);\n  $ret= "<hr><h3>Images</h3><div class=\'row mb-20 pb-20\'>";\n  while($r2 = mysqli_fetch_assoc($run2)) {\n    $img_small=$modul."/".$r2[\'path\']."/".$r2[\'seq\']."/image/small/".$r2[\'url\'];\n    $img_big=$modul."/".$r2[\'path\']."/".$r2[\'seq\']."/image/big/".$r2[\'url\'];\n    $ret .= \'\n    <div id="row-\'.$r2[\'id\'].\'" class="col-sm-3 col-lg-2 col-xs-6">\n      <div class="card">\n    \';\n    $ret .= \'<img src="\'.$ar[\'url_img\'].\'\'.$img_small.\'" alt="">\';\n    $ret .= \'\';\n    $ret .= \'\n      </div>\n      <button onClick="imgdel(\'.$r2[\'id\'].\');" class="btn btn-danger btn-xs">Delete</button>\n      \n    </div>\';\n  }\n  $ret .= "</div>";\n  return $ret;\n}','php','0','2','3','1748697036');
INSERT INTO `cp_sphp` VALUES ('83','api','image_delete_byid','function image_delete_byid($js){\n  global $ar,$db;\n  $dt=array();  \n  $sql="SELECT * from `files` where id=".$js[\'id\'];\n  $res=mysqli_query($db,$sql);\n  if(mysqli_num_rows($res)==1) {\n    $r=mysqli_fetch_assoc($res);\n    $dt[\'success\']=true;\n    $this_path=$ar[\'img_path\']."".$r[\'modul\']."/".$r[\'path\'];\n    $dt[\'r\']=$r;\n    $dt[\'path\']=$this_path;\n    if(is_dir($this_path)) {\n      $dt[\'is_dir\']="exist";\n      emptyDir($this_path);\n      Delete($db,"files","id=".$js[\'id\'],0);\n    }\n  } else {\n    $dt[\'error\']=true;\n    $dt[\'message\']="data not found";\n  }\n  return $dt;\n}','php','0','2','1','1748739802');
INSERT INTO `cp_sphp` VALUES ('84','api','image_delete_byitemid','function image_delete_byitemid($js){\n  global $ar,$db;\n  $dt=array();\n  \n  $sql="SELECT * from `files` where `modul`=\'".$js[\'modul\']."\' and `item_id`=".$js[\'id\'];\n  $res=mysqli_query($db,$sql);\n  if(mysqli_num_rows($res)==1) {\n    $r=mysqli_fetch_assoc($res);\n    $dt[\'success\']=true;\n    $this_path=$ar[\'img_path\']."".$r[\'modul\']."/".$r[\'path\'];\n    $dt[\'r\']=$r;\n    $dt[\'path\']=$this_path;\n    if(is_dir($this_path)) {\n      $dt[\'is_dir\']="exist";\n      emptyDir($this_path);\n      Delete($db,"files","id=".$r[\'id\'],0);\n    }\n  } else {\n    $dt[\'error\']=true;\n    $dt[\'message\']="data not found";\n  }\n  return $dt;\n}','php','0','2','1','1748741426');
INSERT INTO `cp_sphp` VALUES ('85','api','transaction_add_v2','function transaction_add_v2($js){\n  global $ar,$db;\n  $dt=array();\n  //$dt[\'param\']=$js;\n\n  $sql="SELECT * from `transaction` where `action_id`=\'".$js[\'action_id\']."\'";\n  //$dt[\'sql\'][1]=$sql8;\n  $res=mysqli_query($db,$sql);\n  if(mysqli_num_rows($res)==0){\n    //belum ada data, insert\n    $sql6 = "SELECT * from `action` where id=".$js[\'action_id\'];\n    $res6 = mysqli_query($db, $sql6);\n    //echo $sql;\n    $r6 = mysqli_fetch_assoc($res6); \n\n\n    $sql3 = "select id,id2,id-id2 as k from `transaction` where id-id2>0 order by id2 limit 1";\n    $res3 = mysqli_query($db, $sql3);\n    if(mysqli_num_rows($res3)>0) {\n      $rw3 = mysqli_fetch_assoc($res3);\n      $id1=$rw3[\'id2\'];\n    } else {\n      $sql4 = "select * from `transaction` order by id desc limit 1";\n      $res4 = mysqli_query($db, $sql4);\n      $rw4 = mysqli_fetch_assoc($res4);\n      if(isset($rw4[\'id\']) && $rw4[\'id\']>0) {\n        $id1=$rw4[\'id\']+1;\n      } else {\n        $id1=1;\n      }\n    }\n\n    $idt=array(\n      \'id\'=>$id1,\n      \'action_at\'=>$r6[\'action_at\'],\n      \'action_id\'=>$js[\'action_id\'],\n      \'year\'=>date("Y",$r6[\'action_at\']),\n      \'month\'=>date("Ym",$r6[\'action_at\']),\n      \'seq\'=>$r6[\'seq\'],\n      \'cat\'=>$r6[\'cat\'],\n      \'inout\'=>$r6[\'inout\'],\n      \'debit\'=>$js[\'debit\'],\n      \'credit\'=>$js[\'credit\'],\n      \'amount\'=>to_numeric($r6[\'amount\']),\n      \'st\'=>1,\n      \'update_at\'=>time(),\n    );\n    Insert($db,"transaction",$idt,0);\n    tool_id2(\'transaction\');\n\n    $dt[\'success\']=true;\n    $dt[\'message\']="Add transaction successfull"; \n\n    $udt=array(\n      \'st_trx\'=>1,\n    );\n    Update($db,"action",$udt,"id=".$js[\'action_id\'],0);  \n    journal_add($id1); \n\n    $dt[\'data\'][\'transaction\'][\'byid\']=transaction_byid();\n    $dt[\'data\'][\'transaction\'][\'byseq\']=transaction_byseq();\n    $dt[\'data\'][\'action\'][\'byid\']=action_byid();\n    $dt[\'data\'][\'action\'][\'byseq\']=action_byseq();\n\n  } else {\n    $r1=mysqli_fetch_assoc($res);\n    //sudah ada data, update\n    $sql6 = "SELECT * from `action` where id=".$js[\'action_id\'];\n    $res6 = mysqli_query($db, $sql6);\n    //echo $sql;\n    $r6 = mysqli_fetch_assoc($res6); \n\n    $udt=array(\n      \'st_trx\'=>1,\n    );\n    Update($db,"action",$udt,"id=".$js[\'action_id\'],0);  \n\n    $udt2=array(\n      \'debit\'=>$js[\'debit\'],\n      \'credit\'=>$js[\'credit\'],\n      \'amount\'=>$r6[\'amount\'],\n      \'update_at\'=>time(),\n    );\n    Update($db,"transaction",$udt2,"id=".$r1[\'id\'],0);\n    tool_id2("journal"); \n    $dt[\'journal\']=journal_add($r1[\'id\']);     \n    \n    $dt[\'data\'][\'transaction\'][\'byid\']=transaction_byid();\n    $dt[\'data\'][\'transaction\'][\'byseq\']=transaction_byseq();\n    $dt[\'data\'][\'action\'][\'byid\']=action_byid();\n    $dt[\'data\'][\'action\'][\'byseq\']=action_byseq();\n    $dt[\'success\']=true;\n    $dt[\'message\']="This transaction update successfully";        \n  }\n\n  JournalCount_v2(date("Y"));\nlist_equ_3();\n\n  return $dt;\n  $db->close();\n}','php','0','2','1','1748593709');
INSERT INTO `cp_sphp` VALUES ('86','api','tab_add_menu','function tab_add_menu(){\n  global $ar,$db;\n  $dt=array();\n  for($a=1;$a<4;$a++) {\n   $dt[\'name\'][$a]=$ar[\'menu\'][$a];    \n   $sql="SELECT `code`,`title`,`inout` from `trx_title` where del=0 and `menu`=\'add\' and position=".$a." order by title";\n   $res=mysqli_query($db,$sql);\n   $b=0;\n   while($r1=mysqli_fetch_assoc($res)) {\n    if($r1[\'inout\']==1) {\n      $url=\'action_in_add/\'.$r1[\'code\'];\n    } else {\n      $url=\'action_out_add/\'.$r1[\'code\'];\n    }\n    $dt[\'name\'][$a][\'items\'][$b]=$r1;    \n    $dt[\'name\'][$a][\'items\'][$b][\'url\']=$url;    \n    $b++;\n   }\n  }\n  \n   $sql2="SELECT `code`,`title`,`inout`,`position`,`cat`,`bank`,`debit`,`credit` from `trx_title` where del=0 and `menu`=\'add\' order by `code`";\n   $res2=mysqli_query($db,$sql2);\n   while($r2=mysqli_fetch_assoc($res2)) {\n    if($r2[\'inout\']==1) {\n      $url=\'action_in_add/\'.$r2[\'code\'];\n    } else {\n      $url=\'action_cost_add/\'.$r2[\'code\'];\n    }\n\n    $dt[\'data\'][$r2[\'code\']]=$r2;    \n    $dt[\'data\'][$r2[\'code\']][\'url\']=$url;    \n\n    if($r2[\'credit\']!=\'\') {\n      $n_credit=$ar[\'acc_name\'][$r2[\'credit\']];\n      $dt[\'data\'][$r2[\'code\']][\'n_credit\']=$n_credit;    \n    } \n    if($r2[\'debit\']!=\'\') {\n      $n_debit=$ar[\'acc_name\'][$r2[\'debit\']];\n      $dt[\'data\'][$r2[\'code\']][\'n_debit\']=$n_debit;    \n    } \n\n    \n    $sql3="SELECT id,debit,credit from `trx_title` where del=0 and parent=".$r2[\'code\'];\n    $c=0;\n    $res3=mysqli_query($db,$sql3);\n    while($r3=mysqli_fetch_assoc($res3)) {\n      $dt[\'data\'][$r2[\'code\']][\'items\'][$c]=$r3;    \n      $dt[\'data\'][$r2[\'code\']][\'items\'][$c][\'n_debit\']=$ar[\'acc_name\'][$r3[\'debit\']];    \n      $dt[\'data\'][$r2[\'code\']][\'items\'][$c][\'n_credit\']=$ar[\'acc_name\'][$r3[\'credit\']];    \n      $c++;\n    }\n    \n   }\n  \n  return $dt;\n  $db->close();\n}','php','0','2','1','1748990050');


DROP TABLE IF EXISTS `en_event`;
CREATE TABLE `en_event` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(200) DEFAULT NULL,
  `description` varchar(250) DEFAULT NULL,
  `date` datetime DEFAULT NULL,
  `organizername` varchar(20) DEFAULT NULL,
  `owneremail` varchar(20) DEFAULT NULL,
  `venuename` varchar(100) DEFAULT NULL,
  `organizer` int(11) NOT NULL DEFAULT 0,
  `create_at` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `del` tinyint(4) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `id_item_id_modul` (`id`,`organizername`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `en_event` VALUES ('1','pesta','','2025-05-22 00:00:00','','','','0','0','1747799100','0');


DROP TABLE IF EXISTS `en_user`;
CREATE TABLE `en_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fname` varchar(20) DEFAULT NULL,
  `lname` varchar(20) DEFAULT NULL,
  `username` varchar(99) DEFAULT NULL,
  `password` varchar(99) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `contact` varchar(200) DEFAULT NULL,
  `img` varchar(200) DEFAULT NULL,
  `token` varchar(200) DEFAULT NULL,
  `create_at` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `del` tinyint(4) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`),
  KEY `id_item_id_modul` (`id`,`fname`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `en_user` VALUES ('1','navis','murbiyanto','navis','96457fa50d3a5aeb8f294e6b6fcfb5d1','navis@mail.com','','en_user/25/05/21/14/1/3/image/small/20250521141116.jpeg','GWs50a30oViBf7rfqD8MlQrI7zho9o60HmL9n7lCn79zbBbpZCBVaaGfmt2XY31hTltl2xDeHlXF7gZvYWlLCIqQ8Lkv3G8xRkm2yVs3oIlzui4qVx4dbVutEiWHabvtGUJiEjAD69ipl0rt6','0','1747811475','0');
INSERT INTO `en_user` VALUES ('2','navis','mur','','e10adc3949ba59abbe56e057f20f883e','navis.mur@gmail.com','123456','','','1747818490','1747818490','0');
INSERT INTO `en_user` VALUES ('4','ria','jaya','','ce9689abdeab50b5bee3b56c7aadee27','ria@mail.com','9875','','','1747818742','1747818742','0');
INSERT INTO `en_user` VALUES ('5','','','','d41d8cd98f00b204e9800998ecf8427e','','','','','1747830181','1747830181','0');


DROP TABLE IF EXISTS `en_venue`;
CREATE TABLE `en_venue` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) DEFAULT NULL,
  `address` varchar(20) DEFAULT NULL,
  `capacity` varchar(100) DEFAULT NULL,
  `pricing` varchar(200) DEFAULT NULL,
  `description` varchar(250) DEFAULT NULL,
  `image` varchar(250) DEFAULT NULL,
  `owner` int(11) NOT NULL DEFAULT 0,
  `create_at` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `del` tinyint(4) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `id_item_id_modul` (`id`,`name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `en_venue` VALUES ('1','','','','-','','','0','0','1747798401','0');


DROP TABLE IF EXISTS `fcode`;
CREATE TABLE `fcode` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(99) DEFAULT NULL,
  `code` varchar(10) DEFAULT '0',
  `remark` varchar(99) DEFAULT NULL,
  `del` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=delete',
  `level` tinyint(4) NOT NULL DEFAULT 0,
  `trx` tinyint(4) NOT NULL DEFAULT 0,
  `parent` int(11) NOT NULL DEFAULT 0,
  `s2023` bigint(20) NOT NULL DEFAULT 0,
  `s2022` bigint(20) NOT NULL DEFAULT 0,
  `s2024` bigint(20) NOT NULL DEFAULT 0,
  `s2025` bigint(20) NOT NULL DEFAULT 0,
  `s2026` bigint(20) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `sel2` tinyint(4) NOT NULL DEFAULT 0,
  `is_cost` tinyint(4) NOT NULL DEFAULT 0,
  `is_income` tinyint(4) NOT NULL DEFAULT 0,
  `view` tinyint(4) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `id_folder_slug` (`id`),
  KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `fcode` VALUES ('1','Laba/Rugi','a','','0','1','0','0','0','0','0','0','0','1746835276','0','0','0','1');
INSERT INTO `fcode` VALUES ('2','Neraca','c','','0','1','0','0','0','0','0','0','0','1746834282','0','0','0','1');
INSERT INTO `fcode` VALUES ('3','Arus Kas','d','','0','4','0','0','0','0','0','0','0','1746835126','0','0','0','0');
INSERT INTO `fcode` VALUES ('4','Perubahan Modal','m','','0','1','0','0','0','0','0','0','0','1746931121','0','0','0','0');
INSERT INTO `fcode` VALUES ('5','Aktiva','c1','','0','2','0','2','0','0','0','2226563700','0','1747185578','0','0','0','0');
INSERT INTO `fcode` VALUES ('6','Pasiva','c2','','0','2','0','2','0','0','0','2226563700','0','1747185607','0','0','0','0');
INSERT INTO `fcode` VALUES ('7','Aktiva/Aset Lancar','c11','','0','3','0','5','0','0','0','1461006700','0','1747185635','0','0','0','0');
INSERT INTO `fcode` VALUES ('8','Aktiva/Aset Tetap','c12','','0','3','0','5','0','0','0','765557000','0','1747185678','0','0','0','0');
INSERT INTO `fcode` VALUES ('9','Pendapatan/Penjualan','c41','','0','3','0','6','0','0','0','80622700','0','1747185770','0','0','0','0');
INSERT INTO `fcode` VALUES ('10','Utang/Kuwajiban/Liabilitas','c21','','0','3','0','6','0','0','0','744711000','0','1747185776','0','0','0','0');
INSERT INTO `fcode` VALUES ('11','Beban Lain-lain','c81','','0','3','0','6','0','0','0','0','0','1747185780','0','0','0','0');
INSERT INTO `fcode` VALUES ('12','Pendapatan Lain-lain','c71','','0','3','0','6','0','0','0','0','0','1747185786','0','0','0','0');
INSERT INTO `fcode` VALUES ('13','Beban Administrasi','c62','','0','3','0','6','0','0','0','-22500000','0','1747185787','0','0','0','0');
INSERT INTO `fcode` VALUES ('14','Beban Penjualan','c61','','0','3','0','6','0','0','0','-14250000','0','1747185788','0','0','0','0');
INSERT INTO `fcode` VALUES ('15','Modal/Equity','c31','','0','3','0','6','0','0','0','1500000000','0','1747185789','0','0','0','0');
INSERT INTO `fcode` VALUES ('16','Harga Pokok Penjualan','c51','','0','3','0','6','0','0','0','-62020000','0','1747185796','0','0','0','0');
INSERT INTO `fcode` VALUES ('17','Biaya dibayar dimuka','c11204','','0','4','1','7','0','0','0','0','0','1748821069','0','0','0','0');
INSERT INTO `fcode` VALUES ('19','Perlengkapan','c11203','','0','4','1','7','0','0','0','0','0','1748821069','0','0','0','0');
INSERT INTO `fcode` VALUES ('20','Persediaan Barang','c11202','','0','4','1','7','0','0','0','682691000','0','1748821069','1','1','0','0');
INSERT INTO `fcode` VALUES ('21','Piutang','c11201','','0','4','1','7','0','0','0','-11284000','0','1748821069','1','1','1','0');
INSERT INTO `fcode` VALUES ('22','Kas ','c11101','','0','4','1','7','0','0','0','789599700','0','1748821069','1','0','0','0');
INSERT INTO `fcode` VALUES ('23','Peralatan','c12401','','0','4','1','8','0','0','0','42557000','0','1748821069','1','0','0','0');
INSERT INTO `fcode` VALUES ('24','Akumulasi Penyusutan Kendaraan','c12302','','0','4','1','8','0','0','0','0','0','1748821069','0','0','0','0');
INSERT INTO `fcode` VALUES ('25','Kendaraan','c12301','','0','4','1','8','0','0','0','93000000','0','1748821069','1','0','0','0');
INSERT INTO `fcode` VALUES ('26','Akumulasi Penyusutan Bangunan','c12202','','0','4','1','8','0','0','0','0','0','1748821069','0','0','0','0');
INSERT INTO `fcode` VALUES ('27','Bangunan','c12201','','0','4','1','8','0','0','0','280000000','0','1748821069','1','0','0','0');
INSERT INTO `fcode` VALUES ('28','Tanah','c12101','','0','4','1','8','0','0','0','350000000','0','1748821069','1','0','0','0');
INSERT INTO `fcode` VALUES ('29','Akumulasi Penyusutan Peralatan','c12402','','0','4','1','8','0','0','0','0','0','1748821069','0','0','0','0');
INSERT INTO `fcode` VALUES ('30','Utang bank jangka panjang','c21300','','0','4','1','10','0','0','0','0','0','1748821069','0','1','1','0');
INSERT INTO `fcode` VALUES ('31','Utang biaya','c21200','','0','4','1','10','0','0','0','0','0','1748821069','0','1','0','0');
INSERT INTO `fcode` VALUES ('32','Utang dagang','c21100','','0','4','1','10','0','0','0','744711000','0','1748821069','1','1','0','0');
INSERT INTO `fcode` VALUES ('33','Deviden','c31300','','0','4','1','15','0','0','0','0','0','1748821069','0','1','0','0');
INSERT INTO `fcode` VALUES ('34','Modal ditarik/Prive','c31200','','0','4','1','15','0','0','0','0','0','1748821069','0','1','0','0');
INSERT INTO `fcode` VALUES ('35','Modal Disetor','c31100','','0','4','1','15','0','0','0','1500000000','0','1748821069','1','0','1','0');
INSERT INTO `fcode` VALUES ('36','Penjualan','c41100','','0','4','1','9','0','0','0','80622700','0','1748821069','1','0','0','0');
INSERT INTO `fcode` VALUES ('37','Retur Penjualan','c41200','','0','4','1','9','0','0','0','0','0','1748821069','0','0','0','0');
INSERT INTO `fcode` VALUES ('38','Potongan Penjualan','c41300','','0','4','1','9','0','0','0','0','0','1748821069','0','0','0','0');
INSERT INTO `fcode` VALUES ('39','Harga Pokok Penjualan','c51100','','0','4','1','16','0','0','0','-62020000','0','1748821069','1','0','0','0');
INSERT INTO `fcode` VALUES ('40','Biaya langsung pembelian','c51200','','0','4','1','16','0','0','0','0','0','1748821069','0','0','0','0');
INSERT INTO `fcode` VALUES ('41','Potongan Pembelian','c51300','','0','4','1','16','0','0','0','0','0','1748821069','0','0','0','0');
INSERT INTO `fcode` VALUES ('42','Upah/gaji staff toko','c61101','','0','4','1','14','0','0','0','-13000000','0','1748821069','1','1','0','0');
INSERT INTO `fcode` VALUES ('43','Operasional','c61102','','0','4','1','14','0','0','0','0','0','1748821069','0','1','0','0');
INSERT INTO `fcode` VALUES ('44','Marketing','c61103','','0','4','1','14','0','0','0','-1250000','0','1748821069','1','1','0','0');
INSERT INTO `fcode` VALUES ('45','Sewa Bangunan/Toko','c61104','','0','4','1','14','0','0','0','0','0','1748821069','0','1','0','0');
INSERT INTO `fcode` VALUES ('46','Penyusutan Kendaraan','c61105','','0','4','1','14','0','0','0','0','0','1748821069','0','1','0','0');
INSERT INTO `fcode` VALUES ('47','Penyusutan Peralatan','c61106','','0','4','1','14','0','0','0','0','0','1748821069','0','1','0','0');
INSERT INTO `fcode` VALUES ('48','Upah/gaji staff kantor','c62101','','0','4','1','13','0','0','0','-10500000','0','1748821069','1','1','0','0');
INSERT INTO `fcode` VALUES ('49','Listrik/Air/Telp/Internet','c62102','','0','4','1','13','0','0','0','-3000000','0','1748821069','1','1','0','0');
INSERT INTO `fcode` VALUES ('50','Perlengkapan','c62103','','0','4','1','13','0','0','0','0','0','1748821069','0','1','0','0');
INSERT INTO `fcode` VALUES ('51','Asuransi','c62104','','0','4','1','13','0','0','0','-9000000','0','1748821069','1','1','0','0');
INSERT INTO `fcode` VALUES ('52','Kebersihan','c62106','','0','4','1','13','0','0','0','0','0','1748821069','0','1','0','0');
INSERT INTO `fcode` VALUES ('53','Penyusutan Bangunan','c62107','','0','4','1','13','0','0','0','0','0','1748821069','0','1','0','0');
INSERT INTO `fcode` VALUES ('54','Pendapatan Bunga','c71000','','0','4','1','12','0','0','0','0','0','1748821069','0','0','1','0');
INSERT INTO `fcode` VALUES ('55','Beban Bunga Pinjaman','c81100','','0','4','1','11','0','0','0','0','0','1748821069','0','1','0','0');
INSERT INTO `fcode` VALUES ('56','Biaya Bank','c81200','','0','4','1','11','0','0','0','0','0','1748821069','0','1','0','0');
INSERT INTO `fcode` VALUES ('57','Pendapatan/Penjualan','a01','=c41','0','2','0','1','0','0','0','80622700','0','1747187880','0','0','0','0');
INSERT INTO `fcode` VALUES ('58','Harga Pokok Penjualan','a02','=c51','0','2','0','1','0','0','0','-62020000','0','1747187890','0','0','0','0');
INSERT INTO `fcode` VALUES ('59','Beban Penjualan','a03','=c61','0','2','0','1','0','0','0','-14250000','0','1747187891','0','0','0','0');
INSERT INTO `fcode` VALUES ('60','Laba Kotor','a04','=a01+a02+a03','0','2','0','1','0','0','0','4352700','0','1747187892','0','0','0','0');
INSERT INTO `fcode` VALUES ('61','Beban Administrasi','a05','=c62','0','2','0','1','0','0','0','-22500000','0','1747187893','0','0','0','0');
INSERT INTO `fcode` VALUES ('62','Laba/Rugi Operasional Sebelum Pajak','a08','=a04+a05+a06+a07','0','2','0','1','0','0','0','-18147300','0','1747187894','0','0','0','0');
INSERT INTO `fcode` VALUES ('63','Pajak','a09','0','0','2','0','1','0','0','0','0','0','1747187895','0','0','0','0');
INSERT INTO `fcode` VALUES ('64','Laba/Rugi Bersih/Setelah Pajak','a10','=a8-a09','0','2','0','1','0','0','0','-18147300','0','1747187896','0','0','0','0');
INSERT INTO `fcode` VALUES ('65','Arus Kas dari aktivitas operasional','d1','','0','2','0','3','0','0','0','0','0','1747188065','0','0','0','0');
INSERT INTO `fcode` VALUES ('66','Arus Kas dari aktivitas investasi','d2','','0','2','0','3','0','0','0','0','0','1747188072','0','0','0','0');
INSERT INTO `fcode` VALUES ('67','Arus Kas dari aktivitas pendanaan','d3','','0','2','0','3','0','0','0','0','0','1747188073','0','0','0','0');
INSERT INTO `fcode` VALUES ('68','Arus Kas bersih/saldo akhir','d4','','0','2','0','3','0','0','0','0','0','1747188074','0','0','0','0');
INSERT INTO `fcode` VALUES ('69','Kas Diterima dari customer','d11','','0','3','0','65','0','0','0','0','0','1747188171','0','0','0','0');
INSERT INTO `fcode` VALUES ('70','Pembayaran kas untuk supplier','d12','','0','3','0','65','0','0','0','0','0','1747188192','0','0','0','0');
INSERT INTO `fcode` VALUES ('71','Pembayaran kas untuk beban operasi','d13','','0','3','0','65','0','0','0','0','0','1747188193','0','0','0','0');
INSERT INTO `fcode` VALUES ('72','Pembayaran kas untuk bunga','d14','','0','3','0','65','0','0','0','0','0','1747188194','0','0','0','0');
INSERT INTO `fcode` VALUES ('73','Pembayaran kas untuk pajak','d15','','0','3','0','65','0','0','0','0','0','1747188195','0','0','0','0');
INSERT INTO `fcode` VALUES ('74','Jumlah kas dari aktivitas operasi','d19','','0','3','0','65','0','0','0','0','0','1747188196','0','0','0','0');
INSERT INTO `fcode` VALUES ('75','Kas diterima dari penjualan aktiva','d21','','0','3','0','66','0','0','0','0','0','1747188387','0','0','0','0');
INSERT INTO `fcode` VALUES ('76','Kas diterima dari bunga/bagi hasil bank','d22','','0','3','0','66','0','0','0','0','0','1747188389','0','0','0','0');
INSERT INTO `fcode` VALUES ('77','Pembayaran kas untuk pembelian aktiva tetap','d23','','0','3','0','66','0','0','0','0','0','1747188390','0','0','0','0');
INSERT INTO `fcode` VALUES ('78','Jumlah kas untuk aktivitas investasi','d29','','0','3','0','66','0','0','0','0','0','1747188392','0','0','0','0');
INSERT INTO `fcode` VALUES ('79','Kas diterima dari penyertaan saham','d31','','0','3','0','67','0','0','0','0','0','1747188517','0','0','0','0');
INSERT INTO `fcode` VALUES ('80','Kas diterima dari hutang/pinjaman','d32','','0','3','0','67','0','0','0','0','0','1747188520','0','0','0','0');
INSERT INTO `fcode` VALUES ('81','Pembayaran kas untuk deviden','d33','','0','3','0','67','0','0','0','0','0','1747188521','0','0','0','0');
INSERT INTO `fcode` VALUES ('82','Pembayaran kas untuk prive','d34','','0','3','0','67','0','0','0','0','0','1747188522','0','0','0','0');
INSERT INTO `fcode` VALUES ('83','Pembayaran kas untuk bunga/bagi hasil','d35','','0','3','0','67','0','0','0','0','0','1747188523','0','0','0','0');
INSERT INTO `fcode` VALUES ('84','Pembayaran kas untuk pelunasan hutang/pinjaman','d36','','0','3','0','67','0','0','0','0','0','1747188524','0','0','0','0');
INSERT INTO `fcode` VALUES ('85','Jumlah kas dari aktivitas pendanaan','d39','','0','3','0','67','0','0','0','0','0','1747188525','0','0','0','0');
INSERT INTO `fcode` VALUES ('86','Modal Usaha','m1','','0','2','0','4','0','0','0','0','0','1747188662','0','0','0','0');
INSERT INTO `fcode` VALUES ('87','Perubahan Modal atau Laba/Rugi Periode Ini','m2','','0','2','0','4','0','0','0','0','0','1747188665','0','0','0','0');
INSERT INTO `fcode` VALUES ('88','Pembayaran prive','m11','','0','3','0','86','0','0','0','0','0','1747188732','0','0','0','0');
INSERT INTO `fcode` VALUES ('89','Pembayaran Deviden','m12','','0','3','0','86','0','0','0','0','0','1747188735','0','0','0','0');
INSERT INTO `fcode` VALUES ('90','Laba/Rugi Periode Ini','m13','','0','3','0','86','0','0','0','0','0','1747188736','0','0','0','0');
INSERT INTO `fcode` VALUES ('91','Persamaan Akuntansi','b','','0','1','0','0','0','0','0','0','0','1747191258','0','0','0','1');
INSERT INTO `fcode` VALUES ('92','Aktiva','b1','=c1','0','1','0','91','0','0','0','2226563700','0','1747191314','0','0','0','0');
INSERT INTO `fcode` VALUES ('93','Pasiva','b2','=c2','0','1','0','91','0','0','0','2226563700','0','1747191322','0','0','0','0');
INSERT INTO `fcode` VALUES ('94','Aktiva/Aset Lancar','b11','=c11','0','2','0','92','0','0','0','1461006700','0','1747191733','0','0','0','0');
INSERT INTO `fcode` VALUES ('95','Aktiva/Aset Tetap','b12','=c12','0','2','0','92','0','0','0','765557000','0','1747191737','0','0','0','0');
INSERT INTO `fcode` VALUES ('96','Utang/Kewajiban/Liabilitas','b21','=c21','0','2','0','93','0','0','0','744711000','0','1747191789','0','0','0','0');
INSERT INTO `fcode` VALUES ('97','Ekuitas','b33','','0','2','0','93','0','0','0','1481852700','0','1747191850','0','0','0','0');
INSERT INTO `fcode` VALUES ('98','Modal Disetor','b31','=c31','0','3','0','97','0','0','0','1500000000','0','1747191926','0','0','0','0');
INSERT INTO `fcode` VALUES ('99','Laba/Rugi Berjalan','b32','=c41+c61+c62+c81+c71','0','3','0','97','0','0','0','-18147300','0','1747191930','0','0','0','0');
INSERT INTO `fcode` VALUES ('100','Pendapatan','b3201','=c41=a1','0','4','0','99','0','0','0','80622700','0','1747192039','0','0','0','0');
INSERT INTO `fcode` VALUES ('101','Harga Pokok Penjualan','b3202','=c51=a2','0','4','0','99','0','0','0','-62020000','0','1747192116','0','0','0','0');
INSERT INTO `fcode` VALUES ('102','Beban Penjualan','b3203','=c61=a3','0','4','0','99','0','0','0','-14250000','0','1747192119','0','0','0','0');
INSERT INTO `fcode` VALUES ('103','Laba/Rugi Kotor','b3204','=a04','0','4','0','99','0','0','0','4352700','0','1747192123','0','0','0','0');
INSERT INTO `fcode` VALUES ('104','Beban Administrasi','b3205','=c62','0','4','0','99','0','0','0','-22500000','0','1747192125','0','0','0','0');
INSERT INTO `fcode` VALUES ('105','Laba/Rugi Operasional Sebelum Pajak','b3208','=a06','0','4','0','99','0','0','0','-18147300','0','1747192176','0','0','0','0');
INSERT INTO `fcode` VALUES ('106','Pajak','b3209','=a07','0','4','0','99','0','0','0','0','0','1747192179','0','0','0','0');
INSERT INTO `fcode` VALUES ('107','Laba/Rugi Bersih/Setelah Pajak','b3210','=a08','0','4','0','99','0','0','0','-18147300','0','1747192180','0','0','0','0');
INSERT INTO `fcode` VALUES ('108','Pendapatan Lain-lain','a06','=c71','0','2','0','1','0','0','0','0','0','1747193454','0','0','0','0');
INSERT INTO `fcode` VALUES ('109','Beban Lain-lain','a07','=c81','0','2','0','1','0','0','0','0','0','1747193458','0','0','0','0');
INSERT INTO `fcode` VALUES ('110','Utang pajak','c21400','','0','4','1','10','0','0','0','0','0','1748821069','0','1','0','0');
INSERT INTO `fcode` VALUES ('111','Pendapatan Lain-lain','b3206','=c71','0','4','0','99','0','0','0','0','0','1747194700','0','0','0','0');
INSERT INTO `fcode` VALUES ('112','Beban Lain-lain','b3207','=c81','0','4','0','99','0','0','0','0','0','1747194703','0','0','0','0');
INSERT INTO `fcode` VALUES ('113','Beban Pajak/Retribusi','c62105','','0','4','1','13','0','0','0','0','0','1748821069','0','1','0','0');


DROP TABLE IF EXISTS `files`;
CREATE TABLE `files` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `item_id` int(11) NOT NULL DEFAULT 0,
  `seq` int(11) NOT NULL DEFAULT 0,
  `modul` varchar(20) DEFAULT NULL,
  `type` varchar(20) DEFAULT NULL,
  `title` varchar(100) DEFAULT NULL,
  `caption` varchar(200) DEFAULT NULL,
  `url` varchar(200) DEFAULT NULL,
  `url_src` varchar(200) DEFAULT NULL,
  `url_original` varchar(200) DEFAULT NULL,
  `path` varchar(200) DEFAULT NULL,
  `create_at` int(11) NOT NULL DEFAULT 0,
  `width` int(11) NOT NULL DEFAULT 0,
  `height` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `id_item_id_modul` (`id`,`item_id`,`modul`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `files` VALUES ('3','1','1','en_ser','image','','','20250521140943.jpeg','','tmp/20250521140943.jpeg','25/05/21/14/1','1747811385','0','0');
INSERT INTO `files` VALUES ('4','1','3','en_user','image','','','20250521141116.jpeg','','tmp/20250521141116.jpeg','25/05/21/14/1','1747811478','0','0');
INSERT INTO `files` VALUES ('5','1','1','product','image','','','20250523094504.jpeg','','tmp/20250523094504.jpeg','25/05/23/09/1','1747968305','0','0');
INSERT INTO `files` VALUES ('6','6','1','product','image','','','20250523102749.jpeg','','tmp/20250523102749.jpeg','25/05/23/10/6','1747970869','0','0');
INSERT INTO `files` VALUES ('7','5','1','product','image','','','20250523102926.jpeg','','tmp/20250523102926.jpeg','25/05/23/10/5','1747970966','0','0');
INSERT INTO `files` VALUES ('8','2','1','product','image','','','20250523103037.jpeg','','tmp/20250523103037.jpeg','25/05/23/10/2','1747971038','0','0');
INSERT INTO `files` VALUES ('9','1','2','product','image','','','20250523103418.jpeg','','tmp/20250523103418.jpeg','25/05/23/10/1','1747971258','0','0');
INSERT INTO `files` VALUES ('12','2','1','users','image','','','20250524063119.jpeg','','tmp/20250524063119.jpeg','25/05/24/06/2','1748043079','0','0');
INSERT INTO `files` VALUES ('14','1','4','users','image','','','20250524135233.jpeg','','tmp/20250524135233.jpeg','25/05/24/13/1','1748069553','0','0');
INSERT INTO `files` VALUES ('23','9','1','company','image','ert 234','','20250524194440.jpeg','','tmp/20250524194440.jpeg','25/05/24/19/9','1748090680','0','0');
INSERT INTO `files` VALUES ('24','1','1','company','image','pt alfa global niaga','','20250524194635.jpeg','','tmp/20250524194635.jpeg','25/05/24/19/1','1748090796','0','0');
INSERT INTO `files` VALUES ('25','7','1','company','image','pt samsung indonesia','','20250524194935.png','','tmp/20250524194935.png','25/05/24/19/7','1748090976','0','0');
INSERT INTO `files` VALUES ('26','8','1','company','image','pt sharp','','20250524195137.jpeg','','tmp/20250524195137.jpeg','25/05/24/19/8','1748091098','0','0');
INSERT INTO `files` VALUES ('27','5','1','company','image','toko damai sejahtera','','20250524195312.jpeg','','tmp/20250524195312.jpeg','25/05/24/19/5','1748091192','0','0');
INSERT INTO `files` VALUES ('28','8','2','company','image','pt sharp','','20250524195748.jpeg','','tmp/20250524195748.jpeg','25/05/24/19/8','1748091468','0','0');
INSERT INTO `files` VALUES ('34','4','1','product','image','','','20250529081912.jpeg','','tmp/20250529081912.jpeg','25/05/29/08/4','1748481552','0','0');
INSERT INTO `files` VALUES ('35','3','1','product','image','','','20250529082009.jpeg','','tmp/20250529082009.jpeg','25/05/29/08/3','1748481609','0','0');
INSERT INTO `files` VALUES ('36','4','2','product','image','','','20250529112029.jpeg','','temp/20250529112029.jpeg','25/05/29/11/4','1748492430','0','0');
INSERT INTO `files` VALUES ('37','2','2','product','image','','','20250529112842.jpeg','','temp/20250529112842.jpeg','25/05/29/11/2','1748492922','0','0');
INSERT INTO `files` VALUES ('38','6','2','product','image','','','20250530081407.jpeg','','temp/20250530081407.jpeg','25/05/30/08/6','1748567647','0','0');
INSERT INTO `files` VALUES ('41','1','5','users','image','','','20250531212137.jpeg','','temp/20250531212137.jpeg','25/05/31/21/1','1748701297','0','0');
INSERT INTO `files` VALUES ('42','6','1','action','image','','','20250601064631.jpeg','','temp/20250601064631.jpeg','25/06/01/06/6','1748735191','0','0');


DROP TABLE IF EXISTS `inventory`;
CREATE TABLE `inventory` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(200) DEFAULT NULL,
  `brand` varchar(200) DEFAULT NULL,
  `qty` int(11) NOT NULL DEFAULT 0,
  `unit` varchar(10) DEFAULT NULL,
  `remark` varchar(200) DEFAULT NULL,
  `position` varchar(200) DEFAULT NULL,
  `group` varchar(50) DEFAULT NULL,
  `code` varchar(10) DEFAULT NULL,
  `condition` varchar(200) DEFAULT NULL,
  `img` varchar(200) NOT NULL DEFAULT 'no_img.jpeg',
  `purchase_date` int(11) NOT NULL,
  `will_age` int(11) NOT NULL DEFAULT 10,
  `transaction_id` int(11) NOT NULL DEFAULT 0,
  `action_id` int(11) NOT NULL DEFAULT 0,
  `price_per_unit` bigint(20) NOT NULL DEFAULT 0,
  `value` bigint(20) NOT NULL DEFAULT 0,
  `amount` bigint(20) NOT NULL DEFAULT 0,
  `create_at` int(11) NOT NULL DEFAULT 0,
  `create_by` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `update_by` int(11) NOT NULL DEFAULT 0,
  `id2` int(11) NOT NULL DEFAULT 0,
  `st` tinyint(4) NOT NULL DEFAULT 1,
  `view` tinyint(4) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  KEY `id_nama_nilai` (`id`,`name`,`value`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `inventory` VALUES ('1','Tanah','','1','Obyek','','','','','','no_img.jpeg','1735747320','0','0','3','350000000','0','350000000','1748707363','0','1748707363','0','1','1','1');
INSERT INTO `inventory` VALUES ('2','Bangunan','','1','Obyek','','','','','','no_img.jpeg','1735781820','20','0','4','280000000','0','280000000','1748741841','0','1748741841','0','2','1','1');
INSERT INTO `inventory` VALUES ('3','Peralatan','','1','Set','','','','','','no_img.jpeg','1735747440','4','0','5','42557000','0','42557000','1748707501','0','1748707501','0','3','1','1');
INSERT INTO `inventory` VALUES ('4','Kendaraan','','1','Unit','','','','','','no_img.jpeg','1735747500','5','0','6','93000000','0','93000000','1748707544','0','1748707544','0','4','1','1');


DROP TABLE IF EXISTS `journal`;
CREATE TABLE `journal` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `inout` tinyint(4) NOT NULL DEFAULT 0,
  `transaction_id` int(11) NOT NULL DEFAULT 0,
  `action_id` int(11) NOT NULL DEFAULT 0,
  `action_at` int(11) NOT NULL DEFAULT 0,
  `year` int(11) NOT NULL DEFAULT 0,
  `month` int(11) NOT NULL DEFAULT 0,
  `week` int(11) NOT NULL DEFAULT 0,
  `seq` int(11) NOT NULL DEFAULT 0,
  `seq2` int(11) NOT NULL DEFAULT 0,
  `debit` bigint(20) NOT NULL DEFAULT 0,
  `credit` bigint(20) NOT NULL DEFAULT 0,
  `amount` bigint(20) NOT NULL DEFAULT 0,
  `balance` bigint(20) NOT NULL DEFAULT 0,
  `account_code` varchar(10) DEFAULT NULL,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `id2` int(11) NOT NULL DEFAULT 0,
  `st` tinyint(4) NOT NULL DEFAULT 1,
  `view` tinyint(4) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `transaction_id_inout` (`transaction_id`,`inout`),
  KEY `id_tgl_nilai_akun_tunai` (`id`,`transaction_id`,`debit`,`account_code`),
  KEY `action_id` (`action_id`)
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `journal` VALUES ('37','1','19','0','0','1970','197001','1','0','0','0','0','0','0','11201','1748788886','1','1','1');
INSERT INTO `journal` VALUES ('38','2','19','0','0','1970','197001','1','0','0','0','0','0','0','41100','1748788886','2','1','1');


DROP TABLE IF EXISTS `js_code`;
CREATE TABLE `js_code` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `c1` varchar(20) NOT NULL,
  `v1` varchar(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=337 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `js_code` VALUES ('1','_0x101565','0x167');
INSERT INTO `js_code` VALUES ('2','_0x10a542','0xaa');
INSERT INTO `js_code` VALUES ('3','_0x10a542','0xda');
INSERT INTO `js_code` VALUES ('4','_0x10a542','0xf1');
INSERT INTO `js_code` VALUES ('5','_0x13cc87','0x13d');
INSERT INTO `js_code` VALUES ('6','_0x13cc87','0x143');
INSERT INTO `js_code` VALUES ('7','_0x13cc87','0xf2');
INSERT INTO `js_code` VALUES ('8','_0x1bd0ea','0x10b');
INSERT INTO `js_code` VALUES ('9','_0x1bd0ea','0x10e');
INSERT INTO `js_code` VALUES ('10','_0x1bd0ea','0x143');
INSERT INTO `js_code` VALUES ('11','_0x1bd0ea','0x157');
INSERT INTO `js_code` VALUES ('12','_0x1bd0ea','0x15c');
INSERT INTO `js_code` VALUES ('13','_0x1bd0ea','0x176');
INSERT INTO `js_code` VALUES ('14','_0x1bd0ea','0x189');
INSERT INTO `js_code` VALUES ('15','_0x1bd0ea','0x8b');
INSERT INTO `js_code` VALUES ('16','_0x1bd0ea','0x8c');
INSERT INTO `js_code` VALUES ('17','_0x1bd0ea','0x99');
INSERT INTO `js_code` VALUES ('18','_0x1bd0ea','0xba');
INSERT INTO `js_code` VALUES ('19','_0x1bd0ea','0xf2');
INSERT INTO `js_code` VALUES ('20','_0x1d83b9','0x13f');
INSERT INTO `js_code` VALUES ('21','_0x1d83b9','0x14c');
INSERT INTO `js_code` VALUES ('22','_0x1d83b9','0x158');
INSERT INTO `js_code` VALUES ('23','_0x1eef1e','0x108');
INSERT INTO `js_code` VALUES ('24','_0x1eef1e','0x13f');
INSERT INTO `js_code` VALUES ('25','_0x1eef1e','0x151');
INSERT INTO `js_code` VALUES ('26','_0x1eef1e','0x165');
INSERT INTO `js_code` VALUES ('27','_0x1eef1e','0x17c');
INSERT INTO `js_code` VALUES ('28','_0x1eef1e','0x183');
INSERT INTO `js_code` VALUES ('29','_0x20a62f','0x10a');
INSERT INTO `js_code` VALUES ('30','_0x20a62f','0x185');
INSERT INTO `js_code` VALUES ('31','_0x20c08e','0x12c');
INSERT INTO `js_code` VALUES ('32','_0x20c08e','0x15c');
INSERT INTO `js_code` VALUES ('33','_0x20c08e','0x91');
INSERT INTO `js_code` VALUES ('34','_0x25fc4f','0x84');
INSERT INTO `js_code` VALUES ('35','_0x2833e4','0x100');
INSERT INTO `js_code` VALUES ('36','_0x2833e4','0x13e');
INSERT INTO `js_code` VALUES ('37','_0x2833e4','0x152');
INSERT INTO `js_code` VALUES ('38','_0x2aa9b6','0xaa');
INSERT INTO `js_code` VALUES ('39','_0x2aa9b6','0xda');
INSERT INTO `js_code` VALUES ('40','_0x2aa9b6','0xf1');
INSERT INTO `js_code` VALUES ('41','_0x2ae3bf','0x13f');
INSERT INTO `js_code` VALUES ('42','_0x2ae3bf','0xcd');
INSERT INTO `js_code` VALUES ('43','_0x2b4fa4','0x102');
INSERT INTO `js_code` VALUES ('44','_0x2b4fa4','0x113');
INSERT INTO `js_code` VALUES ('45','_0x2b4fa4','0x156');
INSERT INTO `js_code` VALUES ('46','_0x2b4fa4','0x16e');
INSERT INTO `js_code` VALUES ('47','_0x2b4fa4','0x184');
INSERT INTO `js_code` VALUES ('48','_0x2b4fa4','0x18a');
INSERT INTO `js_code` VALUES ('49','_0x2b4fa4','0x1a0');
INSERT INTO `js_code` VALUES ('50','_0x2b4fa4','0x93');
INSERT INTO `js_code` VALUES ('51','_0x2b4fa4','0x94');
INSERT INTO `js_code` VALUES ('52','_0x2b4fa4','0xb3');
INSERT INTO `js_code` VALUES ('53','_0x2b4fa4','0xd5');
INSERT INTO `js_code` VALUES ('54','_0x2b4fa4','0xd7');
INSERT INTO `js_code` VALUES ('55','_0x2b4fa4','0xdd');
INSERT INTO `js_code` VALUES ('56','_0x2e82c0','0x14a');
INSERT INTO `js_code` VALUES ('57','_0x2e82c0','0x176');
INSERT INTO `js_code` VALUES ('58','_0x2e82c0','0x8f');
INSERT INTO `js_code` VALUES ('59','_0x2fa512','0x11a');
INSERT INTO `js_code` VALUES ('60','_0x2fa512','0x127');
INSERT INTO `js_code` VALUES ('61','_0x2fa512','0xae');
INSERT INTO `js_code` VALUES ('62','_0x2ff86b','0x9c');
INSERT INTO `js_code` VALUES ('63','_0x2ff86b','0xc6');
INSERT INTO `js_code` VALUES ('64','_0x2ff86b','0xe2');
INSERT INTO `js_code` VALUES ('65','_0x327eab','0x13c');
INSERT INTO `js_code` VALUES ('66','_0x327eab','0x15c');
INSERT INTO `js_code` VALUES ('67','_0x327eab','0x164');
INSERT INTO `js_code` VALUES ('68','_0x327eab','0x16f');
INSERT INTO `js_code` VALUES ('69','_0x327eab','0x88');
INSERT INTO `js_code` VALUES ('70','_0x327eab','0xe3');
INSERT INTO `js_code` VALUES ('71','_0x38f0e5','0x17b');
INSERT INTO `js_code` VALUES ('72','_0x38f0e5','0xa9');
INSERT INTO `js_code` VALUES ('73','_0x38f0e5','0xc2');
INSERT INTO `js_code` VALUES ('74','_0x38f0e5','0xe7');
INSERT INTO `js_code` VALUES ('75','_0x38f0e5','0xea');
INSERT INTO `js_code` VALUES ('76','_0x3d06a4','0x11f');
INSERT INTO `js_code` VALUES ('77','_0x3d06a4','0x12c');
INSERT INTO `js_code` VALUES ('78','_0x3d06a4','0x15c');
INSERT INTO `js_code` VALUES ('79','_0x3d06a4','0x19e');
INSERT INTO `js_code` VALUES ('80','_0x3d06a4','0x8e');
INSERT INTO `js_code` VALUES ('81','_0x3d06a4','0x9f');
INSERT INTO `js_code` VALUES ('82','_0x3d06a4','0xa2');
INSERT INTO `js_code` VALUES ('83','_0x3d06a4','0xac');
INSERT INTO `js_code` VALUES ('84','_0x3d06a4','0xb5');
INSERT INTO `js_code` VALUES ('85','_0x3d06a4','0xd2');
INSERT INTO `js_code` VALUES ('86','_0x3d06a4','0xf3');
INSERT INTO `js_code` VALUES ('87','_0x422701','0xa5');
INSERT INTO `js_code` VALUES ('88','_0x430abc','0x1a1');
INSERT INTO `js_code` VALUES ('89','_0x437779','0x101');
INSERT INTO `js_code` VALUES ('90','_0x437779','0x103');
INSERT INTO `js_code` VALUES ('91','_0x437779','0x104');
INSERT INTO `js_code` VALUES ('92','_0x437779','0x106');
INSERT INTO `js_code` VALUES ('93','_0x437779','0x10c');
INSERT INTO `js_code` VALUES ('94','_0x437779','0x10f');
INSERT INTO `js_code` VALUES ('95','_0x437779','0x110');
INSERT INTO `js_code` VALUES ('96','_0x437779','0x112');
INSERT INTO `js_code` VALUES ('97','_0x437779','0x116');
INSERT INTO `js_code` VALUES ('98','_0x437779','0x117');
INSERT INTO `js_code` VALUES ('99','_0x437779','0x118');
INSERT INTO `js_code` VALUES ('100','_0x437779','0x11e');
INSERT INTO `js_code` VALUES ('101','_0x437779','0x120');
INSERT INTO `js_code` VALUES ('102','_0x437779','0x121');
INSERT INTO `js_code` VALUES ('103','_0x437779','0x122');
INSERT INTO `js_code` VALUES ('104','_0x437779','0x123');
INSERT INTO `js_code` VALUES ('105','_0x437779','0x124');
INSERT INTO `js_code` VALUES ('106','_0x437779','0x128');
INSERT INTO `js_code` VALUES ('107','_0x437779','0x12a');
INSERT INTO `js_code` VALUES ('108','_0x437779','0x12d');
INSERT INTO `js_code` VALUES ('109','_0x437779','0x130');
INSERT INTO `js_code` VALUES ('110','_0x437779','0x132');
INSERT INTO `js_code` VALUES ('111','_0x437779','0x134');
INSERT INTO `js_code` VALUES ('112','_0x437779','0x135');
INSERT INTO `js_code` VALUES ('113','_0x437779','0x136');
INSERT INTO `js_code` VALUES ('114','_0x437779','0x138');
INSERT INTO `js_code` VALUES ('115','_0x437779','0x139');
INSERT INTO `js_code` VALUES ('116','_0x437779','0x13a');
INSERT INTO `js_code` VALUES ('117','_0x437779','0x13f');
INSERT INTO `js_code` VALUES ('118','_0x437779','0x144');
INSERT INTO `js_code` VALUES ('119','_0x437779','0x147');
INSERT INTO `js_code` VALUES ('120','_0x437779','0x148');
INSERT INTO `js_code` VALUES ('121','_0x437779','0x149');
INSERT INTO `js_code` VALUES ('122','_0x437779','0x14b');
INSERT INTO `js_code` VALUES ('123','_0x437779','0x14d');
INSERT INTO `js_code` VALUES ('124','_0x437779','0x14e');
INSERT INTO `js_code` VALUES ('125','_0x437779','0x155');
INSERT INTO `js_code` VALUES ('126','_0x437779','0x159');
INSERT INTO `js_code` VALUES ('127','_0x437779','0x15e');
INSERT INTO `js_code` VALUES ('128','_0x437779','0x15f');
INSERT INTO `js_code` VALUES ('129','_0x437779','0x160');
INSERT INTO `js_code` VALUES ('130','_0x437779','0x161');
INSERT INTO `js_code` VALUES ('131','_0x437779','0x162');
INSERT INTO `js_code` VALUES ('132','_0x437779','0x163');
INSERT INTO `js_code` VALUES ('133','_0x437779','0x168');
INSERT INTO `js_code` VALUES ('134','_0x437779','0x169');
INSERT INTO `js_code` VALUES ('135','_0x437779','0x16c');
INSERT INTO `js_code` VALUES ('136','_0x437779','0x16d');
INSERT INTO `js_code` VALUES ('137','_0x437779','0x170');
INSERT INTO `js_code` VALUES ('138','_0x437779','0x171');
INSERT INTO `js_code` VALUES ('139','_0x437779','0x172');
INSERT INTO `js_code` VALUES ('140','_0x437779','0x173');
INSERT INTO `js_code` VALUES ('141','_0x437779','0x175');
INSERT INTO `js_code` VALUES ('142','_0x437779','0x178');
INSERT INTO `js_code` VALUES ('143','_0x437779','0x17f');
INSERT INTO `js_code` VALUES ('144','_0x437779','0x180');
INSERT INTO `js_code` VALUES ('145','_0x437779','0x181');
INSERT INTO `js_code` VALUES ('146','_0x437779','0x186');
INSERT INTO `js_code` VALUES ('147','_0x437779','0x18c');
INSERT INTO `js_code` VALUES ('148','_0x437779','0x18d');
INSERT INTO `js_code` VALUES ('149','_0x437779','0x18e');
INSERT INTO `js_code` VALUES ('150','_0x437779','0x18f');
INSERT INTO `js_code` VALUES ('151','_0x437779','0x190');
INSERT INTO `js_code` VALUES ('152','_0x437779','0x191');
INSERT INTO `js_code` VALUES ('153','_0x437779','0x193');
INSERT INTO `js_code` VALUES ('154','_0x437779','0x195');
INSERT INTO `js_code` VALUES ('155','_0x437779','0x196');
INSERT INTO `js_code` VALUES ('156','_0x437779','0x19a');
INSERT INTO `js_code` VALUES ('157','_0x437779','0x19d');
INSERT INTO `js_code` VALUES ('158','_0x437779','0x1a3');
INSERT INTO `js_code` VALUES ('159','_0x437779','0x80');
INSERT INTO `js_code` VALUES ('160','_0x437779','0x81');
INSERT INTO `js_code` VALUES ('161','_0x437779','0x82');
INSERT INTO `js_code` VALUES ('162','_0x437779','0x83');
INSERT INTO `js_code` VALUES ('163','_0x437779','0x86');
INSERT INTO `js_code` VALUES ('164','_0x437779','0x87');
INSERT INTO `js_code` VALUES ('165','_0x437779','0x8d');
INSERT INTO `js_code` VALUES ('166','_0x437779','0x92');
INSERT INTO `js_code` VALUES ('167','_0x437779','0x96');
INSERT INTO `js_code` VALUES ('168','_0x437779','0x97');
INSERT INTO `js_code` VALUES ('169','_0x437779','0x98');
INSERT INTO `js_code` VALUES ('170','_0x437779','0x9a');
INSERT INTO `js_code` VALUES ('171','_0x437779','0xa0');
INSERT INTO `js_code` VALUES ('172','_0x437779','0xa3');
INSERT INTO `js_code` VALUES ('173','_0x437779','0xa6');
INSERT INTO `js_code` VALUES ('174','_0x437779','0xa7');
INSERT INTO `js_code` VALUES ('175','_0x437779','0xab');
INSERT INTO `js_code` VALUES ('176','_0x437779','0xad');
INSERT INTO `js_code` VALUES ('177','_0x437779','0xb0');
INSERT INTO `js_code` VALUES ('178','_0x437779','0xb1');
INSERT INTO `js_code` VALUES ('179','_0x437779','0xb7');
INSERT INTO `js_code` VALUES ('180','_0x437779','0xbb');
INSERT INTO `js_code` VALUES ('181','_0x437779','0xbc');
INSERT INTO `js_code` VALUES ('182','_0x437779','0xbe');
INSERT INTO `js_code` VALUES ('183','_0x437779','0xbf');
INSERT INTO `js_code` VALUES ('184','_0x437779','0xc0');
INSERT INTO `js_code` VALUES ('185','_0x437779','0xc1');
INSERT INTO `js_code` VALUES ('186','_0x437779','0xc3');
INSERT INTO `js_code` VALUES ('187','_0x437779','0xc4');
INSERT INTO `js_code` VALUES ('188','_0x437779','0xc7');
INSERT INTO `js_code` VALUES ('189','_0x437779','0xc8');
INSERT INTO `js_code` VALUES ('190','_0x437779','0xca');
INSERT INTO `js_code` VALUES ('191','_0x437779','0xcb');
INSERT INTO `js_code` VALUES ('192','_0x437779','0xcc');
INSERT INTO `js_code` VALUES ('193','_0x437779','0xce');
INSERT INTO `js_code` VALUES ('194','_0x437779','0xd0');
INSERT INTO `js_code` VALUES ('195','_0x437779','0xd3');
INSERT INTO `js_code` VALUES ('196','_0x437779','0xd4');
INSERT INTO `js_code` VALUES ('197','_0x437779','0xd6');
INSERT INTO `js_code` VALUES ('198','_0x437779','0xd9');
INSERT INTO `js_code` VALUES ('199','_0x437779','0xdc');
INSERT INTO `js_code` VALUES ('200','_0x437779','0xde');
INSERT INTO `js_code` VALUES ('201','_0x437779','0xdf');
INSERT INTO `js_code` VALUES ('202','_0x437779','0xe0');
INSERT INTO `js_code` VALUES ('203','_0x437779','0xe1');
INSERT INTO `js_code` VALUES ('204','_0x437779','0xe4');
INSERT INTO `js_code` VALUES ('205','_0x437779','0xe8');
INSERT INTO `js_code` VALUES ('206','_0x437779','0xec');
INSERT INTO `js_code` VALUES ('207','_0x437779','0xed');
INSERT INTO `js_code` VALUES ('208','_0x437779','0xee');
INSERT INTO `js_code` VALUES ('209','_0x437779','0xf6');
INSERT INTO `js_code` VALUES ('210','_0x437779','0xf9');
INSERT INTO `js_code` VALUES ('211','_0x437779','0xfa');
INSERT INTO `js_code` VALUES ('212','_0x437779','0xfe');
INSERT INTO `js_code` VALUES ('213','_0x437779','0xff');
INSERT INTO `js_code` VALUES ('214','_0x43fd4f','0x13f');
INSERT INTO `js_code` VALUES ('215','_0x43fd4f','0x18c');
INSERT INTO `js_code` VALUES ('216','_0x445e42','0x126');
INSERT INTO `js_code` VALUES ('217','_0x445e42','0x19e');
INSERT INTO `js_code` VALUES ('218','_0x445e42','0x8e');
INSERT INTO `js_code` VALUES ('219','_0x445e42','0x95');
INSERT INTO `js_code` VALUES ('220','_0x445e42','0x9e');
INSERT INTO `js_code` VALUES ('221','_0x445e42','0xa1');
INSERT INTO `js_code` VALUES ('222','_0x445e42','0xb4');
INSERT INTO `js_code` VALUES ('223','_0x445e42','0xf0');
INSERT INTO `js_code` VALUES ('224','_0x467965','0x177');
INSERT INTO `js_code` VALUES ('225','_0x46e733','0x13f');
INSERT INTO `js_code` VALUES ('226','_0x46e733','0xef');
INSERT INTO `js_code` VALUES ('227','_0x473202','0x167');
INSERT INTO `js_code` VALUES ('228','_0x490ae4','0x192');
INSERT INTO `js_code` VALUES ('229','_0x490ae4','0x7f');
INSERT INTO `js_code` VALUES ('230','_0x493622','0x176');
INSERT INTO `js_code` VALUES ('231','_0x493622','0xa4');
INSERT INTO `js_code` VALUES ('232','_0x4fa556','0x182');
INSERT INTO `js_code` VALUES ('233','_0x4fa556','0xe5');
INSERT INTO `js_code` VALUES ('234','_0x4fa556','0xf4');
INSERT INTO `js_code` VALUES ('235','_0x4fa556','0xfd');
INSERT INTO `js_code` VALUES ('236','_0x4fe4c2','0x115');
INSERT INTO `js_code` VALUES ('237','_0x4fe4c2','0x11c');
INSERT INTO `js_code` VALUES ('238','_0x4fe4c2','0x84');
INSERT INTO `js_code` VALUES ('239','_0x4fe4c2','0xeb');
INSERT INTO `js_code` VALUES ('240','_0x50f06d','0x119');
INSERT INTO `js_code` VALUES ('241','_0x50f06d','0x17d');
INSERT INTO `js_code` VALUES ('242','_0x50f06d','0x194');
INSERT INTO `js_code` VALUES ('243','_0x50f06d','0xa1');
INSERT INTO `js_code` VALUES ('244','_0x50f06d','0xb2');
INSERT INTO `js_code` VALUES ('245','_0x50f06d','0xcf');
INSERT INTO `js_code` VALUES ('246','_0x50f06d','0xd8');
INSERT INTO `js_code` VALUES ('247','_0x51edfd','0x11c');
INSERT INTO `js_code` VALUES ('248','_0x51edfd','0x12e');
INSERT INTO `js_code` VALUES ('249','_0x51edfd','0x140');
INSERT INTO `js_code` VALUES ('250','_0x51edfd','0x174');
INSERT INTO `js_code` VALUES ('251','_0x51edfd','0x176');
INSERT INTO `js_code` VALUES ('252','_0x51edfd','0x199');
INSERT INTO `js_code` VALUES ('253','_0x51edfd','0x1a2');
INSERT INTO `js_code` VALUES ('254','_0x51edfd','0x8a');
INSERT INTO `js_code` VALUES ('255','_0x51edfd','0x9c');
INSERT INTO `js_code` VALUES ('256','_0x5280ba','0x167');
INSERT INTO `js_code` VALUES ('257','_0x54633d','0x131');
INSERT INTO `js_code` VALUES ('258','_0x54633d','0x143');
INSERT INTO `js_code` VALUES ('259','_0x54633d','0x16a');
INSERT INTO `js_code` VALUES ('260','_0x54633d','0x8b');
INSERT INTO `js_code` VALUES ('261','_0x54633d','0xf2');
INSERT INTO `js_code` VALUES ('262','_0x566f70','0x19f');
INSERT INTO `js_code` VALUES ('263','_0x566f70','0xdb');
INSERT INTO `js_code` VALUES ('264','_0x566f70','0xf2');
INSERT INTO `js_code` VALUES ('265','_0x577418','0x115');
INSERT INTO `js_code` VALUES ('266','_0x577418','0x15b');
INSERT INTO `js_code` VALUES ('267','_0x577418','0xeb');
INSERT INTO `js_code` VALUES ('268','_0x57822c','0x13f');
INSERT INTO `js_code` VALUES ('269','_0x57822c','0x146');
INSERT INTO `js_code` VALUES ('270','_0x57822c','0x18b');
INSERT INTO `js_code` VALUES ('271','_0x57822c','0xb6');
INSERT INTO `js_code` VALUES ('272','_0x57822c','0xc2');
INSERT INTO `js_code` VALUES ('273','_0x57822c','0xc9');
INSERT INTO `js_code` VALUES ('274','_0x57822c','0xf8');
INSERT INTO `js_code` VALUES ('275','_0x59b173','0x12b');
INSERT INTO `js_code` VALUES ('276','_0x59b173','0x13f');
INSERT INTO `js_code` VALUES ('277','_0x59b173','0x166');
INSERT INTO `js_code` VALUES ('278','_0x59b173','0x176');
INSERT INTO `js_code` VALUES ('279','_0x59b173','0x19c');
INSERT INTO `js_code` VALUES ('280','_0x59b173','0xe6');
INSERT INTO `js_code` VALUES ('281','_0x5d6b58','0xa8');
INSERT INTO `js_code` VALUES ('282','_0x7a7ba8','0x176');
INSERT INTO `js_code` VALUES ('283','_0x7a7ba8','0x17a');
INSERT INTO `js_code` VALUES ('284','_0x7a7ba8','0x19b');
INSERT INTO `js_code` VALUES ('285','_0x7a7ba8','0xd1');
INSERT INTO `js_code` VALUES ('286','_0x7a7ba8','0xf5');
INSERT INTO `js_code` VALUES ('287','_0x8637ad','0x12b');
INSERT INTO `js_code` VALUES ('288','_0x8637ad','0x176');
INSERT INTO `js_code` VALUES ('289','_0x8637ad','0x9b');
INSERT INTO `js_code` VALUES ('290','_0xacde4d','0x167');
INSERT INTO `js_code` VALUES ('291','_0xdd1099','0x129');
INSERT INTO `js_code` VALUES ('292','_0xdd1099','0x12f');
INSERT INTO `js_code` VALUES ('293','_0xdd1099','0x137');
INSERT INTO `js_code` VALUES ('294','_0xdd1099','0x13f');
INSERT INTO `js_code` VALUES ('295','_0xdd1099','0x17e');
INSERT INTO `js_code` VALUES ('296','_0xdd1099','0x188');
INSERT INTO `js_code` VALUES ('297','_0xdd1099','0x89');
INSERT INTO `js_code` VALUES ('298','_0xdd1099','0xaf');
INSERT INTO `js_code` VALUES ('299','_0xdd1099','0xc2');
INSERT INTO `js_code` VALUES ('300','_0xe1a0be','0x105');
INSERT INTO `js_code` VALUES ('301','_0xe1a0be','0x107');
INSERT INTO `js_code` VALUES ('302','_0xe1a0be','0x109');
INSERT INTO `js_code` VALUES ('303','_0xe1a0be','0x10d');
INSERT INTO `js_code` VALUES ('304','_0xe1a0be','0x111');
INSERT INTO `js_code` VALUES ('305','_0xe1a0be','0x113');
INSERT INTO `js_code` VALUES ('306','_0xe1a0be','0x114');
INSERT INTO `js_code` VALUES ('307','_0xe1a0be','0x11b');
INSERT INTO `js_code` VALUES ('308','_0xe1a0be','0x11d');
INSERT INTO `js_code` VALUES ('309','_0xe1a0be','0x13b');
INSERT INTO `js_code` VALUES ('310','_0xe1a0be','0x141');
INSERT INTO `js_code` VALUES ('311','_0xe1a0be','0x142');
INSERT INTO `js_code` VALUES ('312','_0xe1a0be','0x145');
INSERT INTO `js_code` VALUES ('313','_0xe1a0be','0x14f');
INSERT INTO `js_code` VALUES ('314','_0xe1a0be','0x153');
INSERT INTO `js_code` VALUES ('315','_0xe1a0be','0x154');
INSERT INTO `js_code` VALUES ('316','_0xe1a0be','0x156');
INSERT INTO `js_code` VALUES ('317','_0xe1a0be','0x15d');
INSERT INTO `js_code` VALUES ('318','_0xe1a0be','0x16b');
INSERT INTO `js_code` VALUES ('319','_0xe1a0be','0x16e');
INSERT INTO `js_code` VALUES ('320','_0xe1a0be','0x187');
INSERT INTO `js_code` VALUES ('321','_0xe1a0be','0x18b');
INSERT INTO `js_code` VALUES ('322','_0xe1a0be','0x197');
INSERT INTO `js_code` VALUES ('323','_0xe1a0be','0x198');
INSERT INTO `js_code` VALUES ('324','_0xe1a0be','0x1a0');
INSERT INTO `js_code` VALUES ('325','_0xe1a0be','0x94');
INSERT INTO `js_code` VALUES ('326','_0xe1a0be','0x9d');
INSERT INTO `js_code` VALUES ('327','_0xe1a0be','0xb3');
INSERT INTO `js_code` VALUES ('328','_0xe1a0be','0xb9');
INSERT INTO `js_code` VALUES ('329','_0xe1a0be','0xbd');
INSERT INTO `js_code` VALUES ('330','_0xe1a0be','0xc2');
INSERT INTO `js_code` VALUES ('331','_0xe1a0be','0xc5');
INSERT INTO `js_code` VALUES ('332','_0xe1a0be','0xdd');
INSERT INTO `js_code` VALUES ('333','_0xe1a0be','0xe9');
INSERT INTO `js_code` VALUES ('334','_0xe1a0be','0xf7');
INSERT INTO `js_code` VALUES ('335','_0xe1a0be','0xfb');
INSERT INTO `js_code` VALUES ('336','_0xe43f13','0x167');


DROP TABLE IF EXISTS `liability`;
CREATE TABLE `liability` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `action_at` int(11) NOT NULL DEFAULT 0,
  `amount` bigint(20) NOT NULL DEFAULT 0,
  `partner` varchar(50) DEFAULT NULL,
  `invoice` varchar(50) DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `img` varchar(199) DEFAULT NULL,
  `remark` varchar(199) DEFAULT NULL,
  `due_days` tinyint(4) NOT NULL DEFAULT 1,
  `del` tinyint(4) NOT NULL DEFAULT 0,
  `product_id` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `create_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `id_cif_account_number` (`id`,`action_at`,`img`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;



DROP TABLE IF EXISTS `mandiri_mutasi`;
CREATE TABLE `mandiri_mutasi` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `text` varchar(250) DEFAULT NULL,
  `seq` int(11) NOT NULL DEFAULT 0,
  `tgl` date NOT NULL,
  `tgl2` int(11) NOT NULL DEFAULT 0,
  `debit` int(11) NOT NULL DEFAULT 0,
  `kredit` int(11) NOT NULL DEFAULT 0,
  `saldo` int(11) NOT NULL DEFAULT 0,
  `remark` varchar(200) DEFAULT NULL,
  `keterangan` varchar(200) DEFAULT NULL,
  `action_id` int(11) NOT NULL DEFAULT 0,
  `year` varchar(5) DEFAULT NULL,
  `month` varchar(7) DEFAULT NULL,
  `payto` varchar(50) DEFAULT NULL,
  `st` tinyint(4) NOT NULL DEFAULT 0,
  `inout` tinyint(4) NOT NULL DEFAULT 0,
  `bank` tinyint(4) NOT NULL DEFAULT 0,
  `rek` varchar(40) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_seq_st` (`id`,`seq`,`st`),
  KEY `tgl_tgl2_debit_kredit_saldo` (`tgl`,`tgl2`,`debit`,`kredit`,`saldo`),
  KEY `year_month_seq` (`year`,`month`,`seq`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf32 COLLATE=utf32_general_ci;

INSERT INTO `mandiri_mutasi` VALUES ('1','','1','2025-04-08','1744068287','450000','0','546429','','Transfer BI Fast  Dari BSI  NAVISMURBIYANTO 7000438892','0','2025','202504','','0','1','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('2','','2','2025-04-08','1744084917','0','300000','246429','','Penarikan tunai tanpa kartu  Di ATM BKS RM SABANARESTO 0   087781217347','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('3','','3','2025-04-08','1744131599','0','5500','240929','','Biaya administrasi kartu debit','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('4','','4','2025-04-10','1744289061','0','60600','180329','','Pembayaran QR  ke O SAVE KEMANG  504500355826','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('5','','5','2025-04-16','1744813021','800000','0','980329','','Transfer dari BANK MANDIRI  NAVIS MURBIYANTO 1670001143709','0','2025','202504','','0','1','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('6','','6','2025-04-16','1744813057','0','306000','674329','','Pembayaran Oxygen.id  8799821503108','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('7','','7','2025-04-16','1744813131','0','500000','174329','','Transfer ke BANK MANDIRI  HAJAR RASYIDA 1670007658627','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('8','','8','2025-04-17','1744854013','3200000','0','3374329','','Transfer BI Fast  Dari BSI  TUTINURBAITIQQMARYAM 7059903367','0','2025','202504','','0','1','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('9','','9','2025-04-17','1744854049','0','3196182','178147','','Pembayaran kartu kredit  4137196200039083','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('10','','10','2025-04-24','1745465882','1000000','0','1178147','','Transfer BI Fast  Dari BCA  NAVIS MURBIYANTO 5520059671  - -','0','2025','202504','','0','1','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('11','','11','2025-04-24','1745465946','0','1000','1177147','','Biaya pembayaran GoPay Customer  6287824526451','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('12','','12','2025-04-24','1745465946','0','100000','1077147','','Pembayaran GoPay Customer  6287824526451','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('13','','13','2025-04-24','1745468307','0','77700','999447','','Pembayaran Indosat Ooredoo Postpaid  085715824894','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('14','','14','2025-04-24','1745469892','0','40900','958547','','Pembayaran Tokopedia  8870887781217347','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('15','','15','2025-04-24','1745480889','0','1000','957547','','Biaya pembayaran GoPay Customer  6285921267916','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('16','','16','2025-04-24','1745480889','0','200000','757547','','Pembayaran GoPay Customer  6285921267916','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('17','','17','2025-04-25','1745539768','5000000','0','5757547','','Transfer dari BANK MANDIRI  NAVIS MURBIYANTO 1670001143709','0','2025','202504','','0','1','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('18','','18','2025-04-25','1745539803','0','3200000','2557547','','Transfer ke BANK MANDIRI  MARYAM HUWRUN\'IYN 1670004830815','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('19','','19','2025-04-25','1745541103','0','500000','2057547','','Transfer ke BANK MANDIRI  SURYANINGSIH 1440004812894','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('20','','20','2025-04-25','1745541424','0','16000','2041547','','Pembayaran Tokopedia  8870887781217347','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('21','','21','2025-04-25','1745541450','0','16000','2025547','','Pembayaran Tokopedia  8870887781217347','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('22','','22','2025-04-25','1745550412','0','127500','1898047','','MPS TUp SA nobookPur  940000P60106032982106177601  NAVIS MURBIYANTO 087751217347','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('23','','23','2025-04-25','1745582426','0','150000','1748047','','Transfer ke BANK MANDIRI  HAJAR RASYIDA 1670007658627','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('24','','24','2025-04-26','1745630633','0','216500','1531547','','Pembayaran QR  ke AHASS CAKRA LAKSANA SAKTI  504669584786','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('25','','25','2025-04-26','1745644866','0','21500','1510047','','Pembayaran QR  ke O SAVE KEMANG  504665018536','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('26','','26','2025-04-26','1745650008','0','35530','1474517','','Pembayaran Tokopedia  8870887781217347','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('27','','27','2025-04-27','1745708072','0','500000','974517','','Penarikan tunai tanpa kartu  Di ATM BKS SM TIPTOPPNDOKGD   087781217347','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('28','','28','2025-04-27','1745750887','0','567090','407427','','Pembayaran QR  ke QR PT. TIP TOP PD.GEDE  504673412849','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('29','','29','2025-04-29','1745913878','0','26300','381127','','Pembayaran Tokopedia  8870887781217347','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('30','','30','2025-04-29','1745925134','0','100000','281127','','Penarikan tunai tanpa kartu  Di ATM BKS RM SABANARESTO 0   087781217347','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('31','','31','2025-04-30','1746032340','0','12500','268627','','Biaya administrasi rekening','0','2025','202504','','0','2','0','1670001143709');
INSERT INTO `mandiri_mutasi` VALUES ('32','','32','2025-04-30','1746032340','0','5000','263627','','Biaya saldo minimum','0','2025','202504','','0','2','0','1670001143709');


DROP TABLE IF EXISTS `network`;
CREATE TABLE `network` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(60) DEFAULT NULL,
  `initial` varchar(60) DEFAULT NULL,
  `email` varchar(90) DEFAULT NULL,
  `password` varchar(200) DEFAULT NULL,
  `modul` varchar(200) DEFAULT NULL,
  `modul2` varchar(200) DEFAULT NULL,
  `modul3` varchar(200) DEFAULT NULL,
  `reff` varchar(200) DEFAULT NULL,
  `address` varchar(200) DEFAULT NULL,
  `city` varchar(50) DEFAULT NULL,
  `wa` varchar(30) DEFAULT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `role` tinyint(4) DEFAULT NULL,
  `web` varchar(90) DEFAULT NULL,
  `fb` varchar(90) DEFAULT NULL,
  `ig` varchar(90) DEFAULT NULL,
  `linkedin` varchar(90) DEFAULT NULL,
  `tw` varchar(90) DEFAULT NULL,
  `nik` varchar(90) DEFAULT NULL,
  `img` varchar(90) DEFAULT NULL,
  `remark` varchar(200) DEFAULT NULL,
  `parent_id` int(11) NOT NULL,
  `create_at` int(11) NOT NULL,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `update_by` int(11) NOT NULL DEFAULT 0,
  `last_login` int(11) NOT NULL,
  `st` tinyint(4) NOT NULL DEFAULT 1,
  `fav` tinyint(4) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `wa` (`wa`),
  KEY `id_name_email` (`id`,`name`,`email`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;



DROP TABLE IF EXISTS `network_login`;
CREATE TABLE `network_login` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `network_id` int(11) NOT NULL DEFAULT 0,
  `ip` varchar(20) DEFAULT NULL,
  `action` varchar(20) DEFAULT NULL,
  `action_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `id_item_id_ip` (`id`,`ip`)
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `network_login` VALUES ('1','1','103.136.58.207','login','1717905596');


DROP TABLE IF EXISTS `person`;
CREATE TABLE `person` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(99) DEFAULT NULL,
  `initial` varchar(9) DEFAULT NULL,
  `email` varchar(90) DEFAULT NULL,
  `city` varchar(25) DEFAULT NULL,
  `phone` varchar(25) DEFAULT NULL,
  `nik` varchar(25) DEFAULT NULL,
  `npwp` varchar(25) DEFAULT NULL,
  `address` varchar(100) DEFAULT NULL,
  `img` varchar(200) NOT NULL DEFAULT 'no_img.jpeg',
  `postcode` varchar(5) DEFAULT NULL,
  `st` tinyint(4) NOT NULL DEFAULT 1,
  `relation` tinyint(4) NOT NULL DEFAULT 0,
  `del` tinyint(4) NOT NULL DEFAULT 0,
  `company_id` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `create_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  KEY `id_cif_account_number` (`id`,`address`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `person` VALUES ('1','navis murbiyanto','navis','ret','etr','6287781217347','','ert','Jl haji rijin no 71','no_img.jpeg','ert','1','0','0','0','1748486650','1748486650');
INSERT INTO `person` VALUES ('2','afza muna','muna','afza@mail.com','','56756789','','','','no_img.jpeg','','1','0','0','0','1748478688','1748478688');
INSERT INTO `person` VALUES ('3','ainun','','','','','','','','no_img.jpeg','','1','0','1','0','1748478654','1748477643');
INSERT INTO `person` VALUES ('4','karyo','','','','','','','','no_img.jpeg','','1','0','1','0','1748477865','1748477659');


DROP TABLE IF EXISTS `person_relation`;
CREATE TABLE `person_relation` (
  `person_id` int(11) NOT NULL DEFAULT 0,
  `relation` tinyint(4) NOT NULL DEFAULT 0,
  UNIQUE KEY `person_id_relation` (`person_id`,`relation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `person_relation` VALUES ('1','1');


DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(200) DEFAULT NULL,
  `brand` varchar(200) DEFAULT NULL,
  `qty` int(11) NOT NULL DEFAULT 0,
  `remark` varchar(200) DEFAULT NULL,
  `item_code` varchar(10) DEFAULT NULL,
  `img` varchar(200) NOT NULL DEFAULT 'no_img.jpeg',
  `price_per_unit` bigint(20) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `id2` int(11) NOT NULL DEFAULT 0,
  `del` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `id_nama_nilai` (`id`,`name`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `product` VALUES ('1','Lemari Es Panasonics NRB243 ','Panasonic','20','lemari es 20 pcs','pn-243','product/25/05/23/10/1/2/image/small/20250523103418.jpeg','4351000','1747971258','1','0');
INSERT INTO `product` VALUES ('2','Lemari Es Samsung RS21CR','Samsung','22','','SM-021','product/25/05/29/11/2/2/image/small/20250529112842.jpeg','10500000','1748484707','2','0');
INSERT INTO `product` VALUES ('3','Lemari Es Samsung RT20FAR ','Samsung','29','lemari es 29 pcs','sm-200','product/25/05/29/08/3/1/image/small/20250529082009.jpeg','3659000','1748481609','3','0');
INSERT INTO `product` VALUES ('4','Lemari Es Panasonics NR B222R','Panasonic','32','','PN-222','product/25/05/29/11/4/2/image/small/20250529112029.jpeg','2603000','1748492394','4','0');
INSERT INTO `product` VALUES ('5','Lemari Es Sharp SJG174T','Sharp','18','18 Lemari Es Sharp SJG174T','shr-174','product/25/05/23/10/5/1/image/small/20250523102926.jpeg','1648000','1747970966','5','0');
INSERT INTO `product` VALUES ('6','Lemari Es Sharp SJ-F201S','Sharp','35','','SHR-201','product/25/05/30/08/6/2/image/small/20250530081407.jpeg','2750000','1748567667','6','0');
INSERT INTO `product` VALUES ('7','LEMARI ES SAMSUNG RT20FAR','Samsung','20','','SM200B','no_img.jpeg','3603000','1748771331','7','0');
INSERT INTO `product` VALUES ('8','NR-B243 LEMARI ES PANASONIC','Panasonic','15','','PN243B','no_img.jpeg','4251000','1748771677','8','0');
INSERT INTO `product` VALUES ('9','NRB222 LEMARI ES PANASONIC','Panasonic','15','','PN222B','no_img.jpeg','2503000','1748771730','9','0');


DROP TABLE IF EXISTS `product_trx`;
CREATE TABLE `product_trx` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `action_at` int(11) NOT NULL DEFAULT 0,
  `product_id` int(11) NOT NULL DEFAULT 0,
  `action_id` int(11) NOT NULL DEFAULT 0,
  `transaction_id` int(11) NOT NULL DEFAULT 0,
  `item_in` int(11) NOT NULL DEFAULT 0,
  `item_out` int(11) NOT NULL DEFAULT 0,
  `balance` int(11) NOT NULL DEFAULT 0,
  `invoice` varchar(20) DEFAULT NULL,
  `remark` varchar(200) DEFAULT NULL,
  `year` varchar(5) DEFAULT NULL,
  `month` varchar(7) DEFAULT NULL,
  `item_code` varchar(7) DEFAULT NULL,
  `tgl` date DEFAULT NULL,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `inout` tinyint(4) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `action_id` (`action_id`),
  KEY `id_tgl_nilai_akun_tunai` (`id`,`action_at`),
  KEY `bank_amount_debit_credit` (`product_id`,`balance`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;



DROP TABLE IF EXISTS `receiveble`;
CREATE TABLE `receiveble` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `action_at` int(11) NOT NULL DEFAULT 0,
  `amount` bigint(20) NOT NULL DEFAULT 0,
  `partner` varchar(50) DEFAULT NULL,
  `invoice` varchar(50) DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `img` varchar(199) DEFAULT NULL,
  `remark` varchar(199) DEFAULT NULL,
  `due_days` tinyint(4) NOT NULL DEFAULT 1,
  `del` tinyint(4) NOT NULL DEFAULT 0,
  `product_id` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `create_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `id_cif_account_number` (`id`,`action_at`,`img`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;



DROP TABLE IF EXISTS `report`;
CREATE TABLE `report` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `year` int(11) NOT NULL DEFAULT 0,
  `account` int(11) NOT NULL,
  `parent` int(11) NOT NULL,
  `code` varchar(10) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `amount` bigint(20) NOT NULL DEFAULT 0,
  `c1` bigint(20) NOT NULL,
  `c2` bigint(20) NOT NULL,
  `c3` bigint(20) NOT NULL,
  `c4` bigint(20) NOT NULL,
  `remark` varchar(100) DEFAULT NULL,
  `st` tinyint(4) NOT NULL DEFAULT 1,
  `level` tinyint(4) NOT NULL DEFAULT 0,
  `trx` tinyint(4) NOT NULL DEFAULT 0,
  `seq` tinyint(4) NOT NULL,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `id2` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `year_account` (`year`,`account`),
  KEY `id_tgl_nilai_akun_tunai` (`id`,`code`),
  KEY `account` (`account`),
  KEY `parent` (`parent`)
) ENGINE=InnoDB AUTO_INCREMENT=512 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `report` VALUES ('1','2025','5','1','10000','Aktiva/Aset','0','0','0','0','0','','1','1','2','0','0','1');
INSERT INTO `report` VALUES ('2','2025','6','1','20000','Liabilitas/Utang/Kewajiban','0','0','0','0','0','','1','1','2','0','0','2');
INSERT INTO `report` VALUES ('3','2025','45','3','A','Arus Kas dari Aktivitas Operasional','0','0','0','0','0','','1','1','2','0','0','3');
INSERT INTO `report` VALUES ('4','2025','46','3','B','Arus Kas dari Aktivitas Investasi','0','0','0','0','0','','1','1','2','0','0','4');
INSERT INTO `report` VALUES ('5','2025','47','3','C','Arus Kas dari Aktivitas Pendanaan','0','0','0','0','0','','1','1','2','0','0','5');
INSERT INTO `report` VALUES ('6','2025','82','3','D','Arus kas bersih dan saldo akhir periode','0','0','0','0','0','jumlah/saldo dari A+B+C','1','1','0','0','1762525512','6');
INSERT INTO `report` VALUES ('7','2025','8','2','L410','Penerimaan','0','0','0','0','0','','1','1','2','1','0','7');
INSERT INTO `report` VALUES ('8','2025','9','2','L510','Harga Pokok Penjualan','0','0','0','0','0','','1','1','2','5','0','8');
INSERT INTO `report` VALUES ('9','2025','75','2','L612','Laba Kotor','0','0','0','0','0','a-b','1','1','2','10','0','9');
INSERT INTO `report` VALUES ('10','2025','10','2','L620','Beban Administrasi','0','0','0','0','0','','1','1','2','11','0','10');
INSERT INTO `report` VALUES ('11','2025','11','2','L640','Laba Operasi/Sebelum PPh','0','0','0','0','0','','1','1','2','20','0','11');
INSERT INTO `report` VALUES ('12','2025','112','2','L650','Pajak Penghasilan','0','0','0','0','0','','1','1','2','0','0','12');
INSERT INTO `report` VALUES ('13','2025','113','2','L660','Laba/Rugi Bersih Setalah Pajak','0','0','0','0','0','','1','1','2','0','0','13');
INSERT INTO `report` VALUES ('14','2025','63','4','PM01','Modal Usaha','0','0','0','0','0','=31900','1','1','0','1','0','14');
INSERT INTO `report` VALUES ('15','2025','67','4','PM09','Perubahan Modal atau Laba/Rugi Periode Ini','0','0','0','0','0','modal awal - prive - deviden -/+ laba/rugi','1','1','0','5','0','15');
INSERT INTO `report` VALUES ('16','2025','7','5','11000','Aktiva Lancar','0','0','0','0','0','','1','2','2','0','0','16');
INSERT INTO `report` VALUES ('17','2025','13','5','12000','Aktiva/Aset Tetap','0','0','0','0','0','','1','2','2','0','0','17');
INSERT INTO `report` VALUES ('18','2025','16','5','19999','Total Aktiva','0','0','0','0','0','','1','2','2','0','0','18');
INSERT INTO `report` VALUES ('19','2025','31','6','29999','Total Utang','0','0','0','0','0','','1','2','2','0','0','19');
INSERT INTO `report` VALUES ('20','2025','15','1','30000','Equity/Modal','0','0','0','0','0','','1','2','2','0','0','20');
INSERT INTO `report` VALUES ('21','2025','17','1','40000','Penerimaan/Pendapatan','0','0','0','0','0','','1','2','2','0','0','21');
INSERT INTO `report` VALUES ('22','2025','18','1','50000','Harga Pokok Penjualan','0','0','0','0','0','','1','2','2','0','0','22');
INSERT INTO `report` VALUES ('23','2025','19','1','60000','Beban','0','0','0','0','0','','1','2','2','0','0','23');
INSERT INTO `report` VALUES ('24','2025','48','45','A1','Kas Diterima dari Customer','0','0','0','0','0','','1','2','0','0','1762525512','24');
INSERT INTO `report` VALUES ('25','2025','49','45','A2','Pembayaran kas untuk supplier','0','0','0','0','0','','1','2','0','0','1762525512','25');
INSERT INTO `report` VALUES ('26','2025','50','45','A3','Pembayaran kas untuk beban operasi','0','0','0','0','0','','1','2','0','0','1762525512','26');
INSERT INTO `report` VALUES ('27','2025','51','45','A4','Pembayaran kas untuk bunga','0','0','0','0','0','','1','2','0','0','1762525512','27');
INSERT INTO `report` VALUES ('28','2025','52','45','A5','Pembayaran kas untuk pajak','0','0','0','0','0','','1','2','0','0','0','28');
INSERT INTO `report` VALUES ('29','2025','55','45','A9','Jumlah kas dari aktivitas operasi','0','0','0','0','0','jumlah dari A','1','2','0','0','1762525512','29');
INSERT INTO `report` VALUES ('30','2025','53','46','B1','Kas diterima dari penjualan aktiva tetap','0','0','0','0','0','','1','2','0','0','1762525512','30');
INSERT INTO `report` VALUES ('31','2025','54','46','B3','Pembayaran kas untuk pembelian aktiva tetap','0','0','0','0','0','','1','2','0','0','1762525512','31');
INSERT INTO `report` VALUES ('32','2025','56','46','B9','Jumlah kas untuk aktivitas investasi','0','0','0','0','0','Jumlah dari B','1','2','0','0','1762525512','32');
INSERT INTO `report` VALUES ('33','2025','57','47','C1','Kas diterima dari penyertaan saham','0','0','0','0','0','','1','2','0','0','1762525512','33');
INSERT INTO `report` VALUES ('34','2025','58','47','C2','Kas diterima dari hutang/pinjaman','0','0','0','0','0','','1','2','0','0','1762525512','34');
INSERT INTO `report` VALUES ('35','2025','85','47','C5','Pembayaran kas untuk Deviden','0','0','0','0','0','','1','2','0','0','1762525512','35');
INSERT INTO `report` VALUES ('36','2025','59','47','C6','Pembayaran kas untuk prive','0','0','0','0','0','','1','2','0','0','1762525512','36');
INSERT INTO `report` VALUES ('37','2025','60','47','C7','Pembayaran kas untuk bunga/bagi hasil','0','0','0','0','0','','1','2','0','0','1762525512','37');
INSERT INTO `report` VALUES ('38','2025','61','47','C8','Pembayaran kas untuk pelunasan hutang/pinjaman jangka panjang','0','0','0','0','0','','1','2','0','0','0','38');
INSERT INTO `report` VALUES ('39','2025','62','47','C9','Jumlah kas dari aktivitas pendanaan','0','0','0','0','0','jumlah dari C','1','2','0','0','1762525512','39');
INSERT INTO `report` VALUES ('40','2025','64','63','PM02','Pembayaran Prive','0','0','0','0','0','','1','2','0','2','0','40');
INSERT INTO `report` VALUES ('41','2025','65','63','PM03','Pembayaran Deviden','0','0','0','0','0','','1','2','0','3','0','41');
INSERT INTO `report` VALUES ('42','2025','66','63','PM04','Laba/Rugi Periode Ini','0','0','0','0','0','=90000','1','2','0','4','0','42');
INSERT INTO `report` VALUES ('43','2025','21','7','11101','Kas & Bank','0','0','0','0','0','','1','3','1','0','1762525512','43');
INSERT INTO `report` VALUES ('44','2025','23','7','11201','Piutang','0','0','0','0','0','','1','3','1','0','1762525512','44');
INSERT INTO `report` VALUES ('45','2025','22','7','11202','Persediaan Barang Dagang','0','0','0','0','0','','1','3','1','0','1762525512','45');
INSERT INTO `report` VALUES ('46','2025','24','7','11203','Perlengkapan','0','0','0','0','0','','1','3','1','0','1762525512','46');
INSERT INTO `report` VALUES ('47','2025','34','7','11204','Asuransi Dibayar Dimuka','0','0','0','0','0','','1','3','1','0','1762525512','47');
INSERT INTO `report` VALUES ('48','2025','25','7','11205','Biaya/sewa Dibayar Dimuka','0','0','0','0','0','','1','3','1','0','1762525512','48');
INSERT INTO `report` VALUES ('49','2025','26','7','11999','Total Aktiva Lancar','0','0','0','0','0','','1','3','2','0','0','49');
INSERT INTO `report` VALUES ('50','2025','27','13','12101','Tanah','0','0','0','0','0','','1','3','1','0','1762525512','50');
INSERT INTO `report` VALUES ('51','2025','29','13','12201','Bangunan','0','0','0','0','0','','1','3','1','0','1762525512','51');
INSERT INTO `report` VALUES ('52','2025','77','13','12202','Aumulasi Penyusutan Bangunan','0','0','0','0','0','','1','3','1','0','1762525512','52');
INSERT INTO `report` VALUES ('53','2025','28','13','12301','Kendaraan','0','0','0','0','0','','1','3','1','0','1762525512','53');
INSERT INTO `report` VALUES ('54','2025','73','13','12302','Akumulasi Penyusutan Kendaraan','0','0','0','0','0','','1','3','1','0','1762525512','54');
INSERT INTO `report` VALUES ('55','2025','30','13','12401','Peralatan','0','0','0','0','0','','1','3','1','0','1762525512','55');
INSERT INTO `report` VALUES ('56','2025','81','13','12402','Akumulasi Penyusutan Peralatan','0','0','0','0','0','','1','3','1','0','1762525512','56');
INSERT INTO `report` VALUES ('57','2025','33','13','12999','Total Aktiva Tetap','0','0','0','0','0','','1','3','2','0','0','57');
INSERT INTO `report` VALUES ('58','2025','14','6','21100','Utang Dagang','0','0','0','0','0','','1','3','1','0','1762525512','58');
INSERT INTO `report` VALUES ('59','2025','20','6','22100','Utang Biaya','13000000','0','0','0','0','','1','3','1','0','1747191167','59');
INSERT INTO `report` VALUES ('60','2025','80','6','23100','Utang Bank Jangka Panjang','0','0','0','0','0','','1','3','1','0','1747191167','60');
INSERT INTO `report` VALUES ('61','2025','36','15','31100','Setor Modal','0','0','0','0','0','','1','3','1','0','1762525512','61');
INSERT INTO `report` VALUES ('62','2025','69','15','31200','Prive/Tarik Modal','0','0','0','0','0','','1','3','1','0','1762525512','62');
INSERT INTO `report` VALUES ('63','2025','70','15','31999','Total Modal','0','0','0','0','0','','1','3','2','0','0','63');
INSERT INTO `report` VALUES ('64','2025','37','17','41100','Penjualan','0','0','0','0','0','','1','3','1','0','1762525512','64');
INSERT INTO `report` VALUES ('65','2025','38','17','41200','Retur Penjualan','0','0','0','0','0','','1','3','1','0','1762525512','65');
INSERT INTO `report` VALUES ('66','2025','39','17','41300','Potongan Penjualan','0','0','0','0','0','','1','3','1','0','1762525512','66');
INSERT INTO `report` VALUES ('67','2025','32','17','41999','Total Penerimaan/Pendapatan','0','0','0','0','0','','1','3','2','0','0','67');
INSERT INTO `report` VALUES ('68','2025','78','18','51100','HPP','0','0','0','0','0','','1','3','1','0','1762525512','68');
INSERT INTO `report` VALUES ('69','2025','83','18','51200','Biaya Pembelian','0','0','0','0','0','','1','3','1','0','1762525512','69');
INSERT INTO `report` VALUES ('70','2025','35','18','51999','Harga Pokok Penjualan','0','0','0','0','0','','1','3','2','0','0','70');
INSERT INTO `report` VALUES ('71','2025','42','19','61000','Operasional/Penjualan','0','0','0','0','0','','1','3','2','0','0','71');
INSERT INTO `report` VALUES ('72','2025','43','19','62000','Administrasi','0','0','0','0','0','','1','3','2','0','0','72');
INSERT INTO `report` VALUES ('73','2025','68','19','69999','Total Beban','0','0','0','0','0','','1','3','2','0','0','73');
INSERT INTO `report` VALUES ('74','2025','71','79','71000','Pendapatan Bunga','0','0','0','0','0','','1','3','1','0','1762525512','74');
INSERT INTO `report` VALUES ('75','2025','72','121','81100','Beban Bunga','0','0','0','0','0','','1','3','1','0','1762525512','75');
INSERT INTO `report` VALUES ('76','2025','76','121','81200','Biaya Bank','0','0','0','0','0','','1','3','1','0','1762525512','76');
INSERT INTO `report` VALUES ('77','2025','96','42','61101','Upah/Gaji','0','0','0','0','0','','1','4','1','0','1762525512','77');
INSERT INTO `report` VALUES ('78','2025','41','42','61102','Operasional','0','0','0','0','0','','1','4','1','0','1762525512','78');
INSERT INTO `report` VALUES ('79','2025','99','42','61103','Marketing','0','0','0','0','0','','1','4','1','0','1762525512','79');
INSERT INTO `report` VALUES ('80','2025','97','42','61104','Sewa Gedung','0','0','0','0','0','','1','4','1','0','1762525512','80');
INSERT INTO `report` VALUES ('81','2025','98','42','61105','Penyusutan Kendaraan','0','0','0','0','0','','1','4','1','0','1762525512','81');
INSERT INTO `report` VALUES ('82','2025','100','42','61106','Penyusutan Peralatan','0','0','0','0','0','','1','4','1','0','1762525512','82');
INSERT INTO `report` VALUES ('83','2025','101','42','61199','Total Beban Penjualan','0','0','0','0','0','','1','4','2','0','0','83');
INSERT INTO `report` VALUES ('84','2025','102','43','62101','Upah/Gaji Staf Kantor ','0','0','0','0','0','','1','4','1','0','1762525512','84');
INSERT INTO `report` VALUES ('85','2025','103','43','62102','Listrik, Air, telp/data','0','0','0','0','0','','1','4','1','0','1762525512','85');
INSERT INTO `report` VALUES ('86','2025','104','43','62103','Perlengkapan','0','0','0','0','0','','1','4','1','0','1762525512','86');
INSERT INTO `report` VALUES ('87','2025','12','43','62106','Kebersihan','0','0','0','0','0','','1','4','1','0','1762525512','87');
INSERT INTO `report` VALUES ('88','2025','40','43','62107','Penyusutan Bangunan','0','0','0','0','0','','1','4','1','0','1762525512','88');
INSERT INTO `report` VALUES ('89','2025','44','43','62999','Total Beban Administrasi','0','0','0','0','0','','1','4','2','0','0','89');
INSERT INTO `report` VALUES ('113','2025','86','1','90000','Total Pasiva','0','0','0','0','0','','1','2','2','0','0','90');
INSERT INTO `report` VALUES ('117','2025','41100','8','L41100','Penjualan','0','0','0','0','0','','1','2','0','0','1762525512','91');
INSERT INTO `report` VALUES ('118','2025','41200','8','L41200','Retur Penjualan','0','0','0','0','0','','1','2','0','0','1762525512','92');
INSERT INTO `report` VALUES ('119','2025','41300','8','L41300','Potongan Penjualan','0','0','0','0','0','','1','2','0','0','1762525512','93');
INSERT INTO `report` VALUES ('123','2025','51100','9','L51100','Harga Pokok Penjualan','0','0','0','0','0','','1','2','0','0','1762525512','94');
INSERT INTO `report` VALUES ('124','2025','51200','9','L51200','Biaya Pembelian','0','0','0','0','0','','1','2','0','0','1762525512','95');
INSERT INTO `report` VALUES ('125','2025','61101','122','L61101','Upah/Gaji','0','0','0','0','0','','1','2','0','0','1762525512','96');
INSERT INTO `report` VALUES ('126','2025','61102','122','L61102','Operasional','0','0','0','0','0','','1','2','0','0','1762525512','97');
INSERT INTO `report` VALUES ('127','2025','61103','122','L61103','Marketing','0','0','0','0','0','','1','2','0','0','1762525512','98');
INSERT INTO `report` VALUES ('128','2025','61104','122','L61104','Sewa Gedung','0','0','0','0','0','','1','2','0','0','1762525512','99');
INSERT INTO `report` VALUES ('129','2025','61105','122','L61105','Penyusutan Kendaraan','0','0','0','0','0','','1','2','0','0','1762525512','100');
INSERT INTO `report` VALUES ('130','2025','61106','122','L61106','Penyusutan Peralatan','0','0','0','0','0','','1','2','0','0','1762525512','101');
INSERT INTO `report` VALUES ('131','2025','62101','10','L62101','Upah/Gaji Staf Kantor ','0','0','0','0','0','','1','2','0','0','1762525512','102');
INSERT INTO `report` VALUES ('132','2025','62102','10','L62102','Listrik, Air, telp/data','0','0','0','0','0','','1','2','0','0','1762525512','103');
INSERT INTO `report` VALUES ('133','2025','62103','10','L62103','Perlengkapan','0','0','0','0','0','','1','2','0','0','1762525512','104');
INSERT INTO `report` VALUES ('134','2025','62104','10','L62104','Asuransi','0','0','0','0','0','','1','2','0','0','1762525512','105');
INSERT INTO `report` VALUES ('135','2025','62106','10','L62106','Kebersihan','0','0','0','0','0','','1','2','0','0','1762525512','106');
INSERT INTO `report` VALUES ('136','2025','62107','10','L62107','Penyusutan Bangunan','0','0','0','0','0','','1','2','0','0','1762525512','107');
INSERT INTO `report` VALUES ('145','2025','122','2','L610','Beban Penjualan','0','0','0','0','0','','1','1','2','0','0','108');
INSERT INTO `report` VALUES ('423','2025','51300','9','L51300','Potongan Pembelian','0','0','0','0','0','','1','2','0','0','1762525512','109');
INSERT INTO `report` VALUES ('452','2025','62105','10','L62105','Biaya Pajak/Retribusi','0','0','0','0','0','','1','2','0','0','1762525512','110');


DROP TABLE IF EXISTS `sales`;
CREATE TABLE `sales` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `sales_at` int(11) NOT NULL DEFAULT 0,
  `action_id_1` int(11) NOT NULL DEFAULT 0,
  `action_id_2` int(11) NOT NULL DEFAULT 0,
  `qty` int(11) NOT NULL DEFAULT 0,
  `hpp` int(11) NOT NULL DEFAULT 0,
  `price` int(11) NOT NULL DEFAULT 0,
  `amount` bigint(20) NOT NULL DEFAULT 0,
  `descr` text DEFAULT NULL,
  `invoice` varchar(75) DEFAULT NULL,
  `buyer` varchar(50) DEFAULT NULL,
  `sales` varchar(50) DEFAULT NULL,
  `year` varchar(5) DEFAULT NULL,
  `month` varchar(7) DEFAULT NULL,
  `tgl` date DEFAULT NULL,
  `due_date` date DEFAULT NULL,
  `days_due_date` tinyint(4) NOT NULL DEFAULT 0,
  `url_pdf` varchar(150) DEFAULT NULL,
  `img` varchar(200) NOT NULL DEFAULT 'no_img.jpeg',
  `update_at` int(11) NOT NULL DEFAULT 0,
  `product_id` int(11) NOT NULL DEFAULT 0,
  `company_id` int(11) NOT NULL DEFAULT 0,
  `person_id` int(11) NOT NULL DEFAULT 0,
  `seq` int(11) NOT NULL DEFAULT 0,
  `id2` int(11) NOT NULL DEFAULT 0,
  `st` tinyint(4) NOT NULL DEFAULT 1,
  `cash_credit` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1=cash;2=credit',
  `del` tinyint(4) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `id_tgl_nilai_akun_tunai` (`id`,`sales_at`),
  KEY `bank_amount_debit_credit` (`amount`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `sales` VALUES ('1','1735811160','15','16','1','3659000','4756700','4756700','Jual tunai sm-200 (Lemari Es Samsung RT20FAR ) 1 unit','fpj001','Adam','Supriadi','2025','202501','2025-01-02','2025-01-02','0','','no_img.jpeg','1748768691','3','0','0','0','1','1','1','0');
INSERT INTO `sales` VALUES ('2','1735809780','17','18','1','10500000','13650000','13650000','Jual tunai SM-021 (Lemari Es Samsung RS21CR) 1 unit','fpj001','Adam','Supriyadi','2025','202501','2025-01-02','2025-01-02','0','','no_img.jpeg','1748769865','2','0','0','0','2','1','1','0');
INSERT INTO `sales` VALUES ('3','1736502360','28','29','11','4351000','5656000','62216000','Jual kredit pn-243 (Lemari Es Panasonics NRB243 ) 11 unit','FPJ002','NUSANTARA JAYA','SUTRISNO','2025','202501','2025-01-10','2025-02-09','30','','no_img.jpeg','1748788568','1','0','0','0','3','1','2','0');


DROP TABLE IF EXISTS `t6_css`;
CREATE TABLE `t6_css` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `modul` varchar(20) DEFAULT NULL,
  `slug` varchar(99) DEFAULT NULL,
  `name` varchar(99) DEFAULT NULL,
  `param` varchar(99) DEFAULT NULL,
  `method` varchar(99) NOT NULL DEFAULT 'POST',
  `folder` varchar(20) DEFAULT NULL,
  `php` text DEFAULT NULL,
  `body` text DEFAULT NULL,
  `remark` varchar(150) DEFAULT NULL,
  `st` tinyint(4) NOT NULL,
  `type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1=api,2=non api',
  `del` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=delete',
  `php_tes` tinyint(4) NOT NULL DEFAULT 0,
  `php_update_at` int(11) NOT NULL DEFAULT 0,
  `php_test_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `folder_slug` (`folder`,`slug`),
  KEY `id_folder_slug` (`id`,`folder`,`slug`),
  KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `t6_css` VALUES ('1','','framework7-bundle','','','POST','tes6/css/','','','','0','1','0','0','1747447175','0');
INSERT INTO `t6_css` VALUES ('2','','default','','','POST','tes6/css/','','','','0','1','0','0','1747298776','0');
INSERT INTO `t6_css` VALUES ('3','','custom','item','op=job','GET','tes6/css/','','','','0','0','0','0','1743983414','0');
INSERT INTO `t6_css` VALUES ('4','','purpose-icons','','','POST','tes6/css/','','','','0','1','0','0','1747447228','0');
INSERT INTO `t6_css` VALUES ('5','','margin','','','POST','tes6/css/','','','','0','1','0','0','1747544004','0');
INSERT INTO `t6_css` VALUES ('6','','yui','','','POST','tes6/css/','','','','0','1','0','0','1747558903','0');
INSERT INTO `t6_css` VALUES ('7','','icons','','','POST','tes6/css/','','','','0','1','0','0','1747559132','0');


DROP TABLE IF EXISTS `t6_filejs`;
CREATE TABLE `t6_filejs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `modul` varchar(20) DEFAULT NULL,
  `slug` varchar(99) DEFAULT NULL,
  `name` varchar(99) DEFAULT NULL,
  `param` varchar(99) DEFAULT NULL,
  `method` varchar(99) NOT NULL DEFAULT 'POST',
  `folder` varchar(20) DEFAULT NULL,
  `php` text DEFAULT NULL,
  `body` text DEFAULT NULL,
  `remark` varchar(150) DEFAULT NULL,
  `st` tinyint(4) NOT NULL,
  `type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1=api,2=non api',
  `del` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=delete',
  `php_tes` tinyint(4) NOT NULL DEFAULT 0,
  `php_update_at` int(11) NOT NULL DEFAULT 0,
  `php_test_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `folder_slug` (`folder`,`slug`),
  KEY `id_folder_slug` (`id`,`folder`,`slug`),
  KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `t6_filejs` VALUES ('1','','app','item','op=job','GET','tes6/js/','','','','0','0','0','0','1743896515','0');
INSERT INTO `t6_filejs` VALUES ('2','','routes','','','POST','tes6/js/','','','','0','0','0','0','1743695863','0');
INSERT INTO `t6_filejs` VALUES ('3','','utils','','','POST','tes6/js/','','','','0','0','0','0','1743896511','0');
INSERT INTO `t6_filejs` VALUES ('4','','app-ori','','','POST','tes6/js/','','','','0','1','0','0','1747532096','0');
INSERT INTO `t6_filejs` VALUES ('5','','routes-ori','','','POST','tes6/js/','','','','0','1','0','0','1747532123','0');


DROP TABLE IF EXISTS `t6_h_page`;
CREATE TABLE `t6_h_page` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `path` varchar(44) DEFAULT NULL,
  `path_right` varchar(44) DEFAULT NULL,
  `name` varchar(44) DEFAULT NULL,
  `title` varchar(44) DEFAULT NULL,
  `title_right` varchar(44) DEFAULT NULL,
  `label` varchar(20) DEFAULT NULL,
  `page_cat` varchar(20) DEFAULT NULL,
  `custom` text DEFAULT NULL,
  `fab_bottom` text DEFAULT NULL,
  `body` text DEFAULT NULL,
  `del` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=delete',
  `content_id` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1=yes,0=no',
  `level` tinyint(4) NOT NULL DEFAULT 0,
  `page_type` tinyint(4) NOT NULL COMMENT '1=with_menu,2=no_menu',
  `view_title` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=yes,0=no',
  `view_navbar` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1=yes,0=no',
  `view_left_panel` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=yes,0=no',
  `searchbar` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=yes,0=no',
  `view_back` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1=yes,0=no',
  `view_toolbar` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1=yes,0=no',
  `url_type` varchar(20) DEFAULT NULL COMMENT 'url,componentUrl',
  `icon_right` varchar(20) DEFAULT NULL,
  `icon` varchar(20) DEFAULT NULL,
  `parent` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `path` (`path`),
  KEY `id_folder_slug` (`id`,`path`(20)),
  KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `t6_h_page` VALUES ('1','','','signup','SignUp','','page-auth','auth','<form class="auth-form">\n  <div class="list m-0">\n    <ul class="no-pseudo no-bg">\n      <li class="item-content item-input form-block">\n        <div class="item-inner no-pseudo flex-row jc-sb">\n          <input type="radio" name="i-am-a-" id="student" checked="checked" />\n          <label class="radio" for="student">\n            <p>I am a</p>\n            <span>STUDENT</span>\n            <i class="check-icon">\n              <span class="purpose-check">\n              </span>\n            </i>\n          </label>\n          <input type="radio" name="i-am-a-" id="tutor" />\n          <label class="radio" for="tutor">\n            <p>I am a</p>\n            <span>TUTOR</span>\n            <i class="check-icon">\n              <span class="purpose-check">\n              </span>\n            </i>\n          </label>\n        </div>\n      </li>\n      <li class="item-content item-input form-block">\n        <div class="item-inner no-pseudo">\n          <label>Username</label>\n          <div class="item-input-wrap">\n            <input type="text" name="username" placeholder="alisha" />\n            <span class="input-clear-button">\n            </span>\n          </div>\n        </div>\n      </li>\n      <li class="item-content item-input form-block">\n        <div class="item-inner no-pseudo">\n          <label>Email</label>\n          <div class="item-input-wrap">\n            <input type="text" name="username" placeholder="alishachenoy@example.com" />\n            <span class="input-clear-button">\n            </span>\n          </div>\n        </div>\n      </li>\n      <li class="item-content item-input form-block">\n        <div class="item-inner">\n          <label>Create Password</label>\n          <div class="item-input-wrap posr">\n            <input type="password" name="password" placeholder="*********" />\n            <span class="input-clear-button">\n            </span>\n          </div>\n        </div>\n      </li>\n    </ul>\n  </div>\n  <div class="list m-0">\n    <ul class="no-pseudo no-bg">\n      <li>\n        <a href="/login/" class="auth-btn link">CREATE ACCOUNT</a>\n      </li>\n      <li class="social-auth text-center">\n        <p>or Sign Up with</p>\n        <a href="#">\n          <img src="https://osumstudio.com/envato/purposeapp/img/icons/google.svg" />\n          <span>Google</span>\n        </a>\n        <a href="#">\n          <img src="https://osumstudio.com/envato/purposeapp/img/icons/facebook.svg" />\n          <span>Facebook</span>\n        </a>\n      </li>\n    </ul>\n    <div class="block-footer">\n      <p class="text-center">Already a User?\n        <a href="/login/">Login</a>\n      </p>\n    </div>\n  </div>\n</form>','','<template>\n  <div class="page page-signup c_auth page-auth no-toolbar" data-name="signup">\n    <div class="page-content">\n      <div class="page-header">\n        <h1>SignUp</h1>\n      </div>\n      <form class="auth-form">\n        <div class="list m-0">\n          <ul class="no-pseudo no-bg">\n            <li class="item-content item-input form-block">\n              <div class="item-inner no-pseudo flex-row jc-sb">\n                <input type="radio" name="i-am-a-" id="student" checked="checked" />\n                <label class="radio" for="student">\n                  <p>I am a</p>\n                  <span>STUDENT</span>\n                  <i class="check-icon">\n                    <span class="purpose-check">\n                    </span>\n                  </i>\n                </label>\n                <input type="radio" name="i-am-a-" id="tutor" />\n                <label class="radio" for="tutor">\n                  <p>I am a</p>\n                  <span>TUTOR</span>\n                  <i class="check-icon">\n                    <span class="purpose-check">\n                    </span>\n                  </i>\n                </label>\n              </div>\n            </li>\n            <li class="item-content item-input form-block">\n              <div class="item-inner no-pseudo">\n                <label>Username</label>\n                <div class="item-input-wrap">\n                  <input type="text" name="username" placeholder="alisha" />\n                  <span class="input-clear-button">\n                  </span>\n                </div>\n              </div>\n            </li>\n            <li class="item-content item-input form-block">\n              <div class="item-inner no-pseudo">\n                <label>Email</label>\n                <div class="item-input-wrap">\n                  <input type="text" name="username" placeholder="alishachenoy@example.com" />\n                  <span class="input-clear-button">\n                  </span>\n                </div>\n              </div>\n            </li>\n            <li class="item-content item-input form-block">\n              <div class="item-inner">\n                <label>Create Password</label>\n                <div class="item-input-wrap posr">\n                  <input type="password" name="password" placeholder="*********" />\n                  <span class="input-clear-button">\n                  </span>\n                </div>\n              </div>\n            </li>\n          </ul>\n        </div>\n        <div class="list m-0">\n          <ul class="no-pseudo no-bg">\n            <li>\n              <a href="/login/" class="auth-btn link">CREATE ACCOUNT</a>\n            </li>\n            <li class="social-auth text-center">\n              <p>or Sign Up with</p>\n              <a href="#">\n                <img src="https://osumstudio.com/envato/purposeapp/img/icons/google.svg" />\n                <span>Google</span>\n              </a>\n              <a href="#">\n                <img src="https://osumstudio.com/envato/purposeapp/img/icons/facebook.svg" />\n                <span>Facebook</span>\n              </a>\n            </li>\n          </ul>\n          <div class="block-footer">\n            <p class="text-center">Already a User?\n              <a href="/login/">Login</a>\n            </p>\n          </div>\n        </div>\n      </form>\n    </div>\n  </div>\n</template>','0','0','2','2','1','0','0','0','0','0','componentUrl','','','0','1747568994');
INSERT INTO `t6_h_page` VALUES ('2','signin/','','signin','SignIn','','page-auth','auth','<form class="auth-form">\n  <div class="list">\n    <ul class="no-pseudo no-bg">\n      <li class="item-content item-input form-block">\n        <div class="item-inner no-pseudo">\n          <label>Username or Email</label>\n          <div class="item-input-wrap">\n            <input type="text" name="username" placeholder="alishachenoy@example.com" />\n            <span class="input-clear-button">\n            </span>\n          </div>\n        </div>\n      </li>\n      <li class="item-content item-input form-block">\n        <div class="item-inner">\n          <label>Enter Password</label>\n          <div class="item-input-wrap posr">\n            <input type="password" name="password" placeholder="*********" />\n            <span class="input-clear-button">\n            </span>\n            <i class="f7-icons">eye_slash</i>\n          </div>\n        </div>\n      </li>\n    </ul>\n  </div>\n  <div class="list">\n    <ul class="no-pseudo no-bg">\n      <li>\n        <a href="/walk-through/" class="auth-btn link">LOGIN</a>\n      </li>\n      <li class="social-auth text-center">\n        <p>or Login With</p>\n        <a href="#">\n          <img src="https://osumstudio.com/envato/purposeapp/img/icons/google.svg" />\n          <span>Google</span>\n        </a>\n        <a href="#">\n          <img src="https://osumstudio.com/envato/purposeapp/img/icons/facebook.svg" />\n          <span>Facebook</span>\n        </a>\n      </li>\n    </ul>\n    <div class="block-footer">\n      <p class="text-center">New User?\n        <a href="/">Sign Up Now</a>\n      </p>\n    </div>\n  </div>\n</form>','','<template>\n  <div class="page page-signin c_auth page-auth no-toolbar" data-name="signin">\n    <div class="page-content">\n      <div class="page-header">\n        <h1>SignIn</h1>\n      </div>\n      <form class="auth-form">\n        <div class="list">\n          <ul class="no-pseudo no-bg">\n            <li class="item-content item-input form-block">\n              <div class="item-inner no-pseudo">\n                <label>Username or Email</label>\n                <div class="item-input-wrap">\n                  <input type="text" name="username" placeholder="alishachenoy@example.com" />\n                  <span class="input-clear-button">\n                  </span>\n                </div>\n              </div>\n            </li>\n            <li class="item-content item-input form-block">\n              <div class="item-inner">\n                <label>Enter Password</label>\n                <div class="item-input-wrap posr">\n                  <input type="password" name="password" placeholder="*********" />\n                  <span class="input-clear-button">\n                  </span>\n                  <i class="f7-icons">eye_slash</i>\n                </div>\n              </div>\n            </li>\n          </ul>\n        </div>\n        <div class="list">\n          <ul class="no-pseudo no-bg">\n            <li>\n              <a href="/walk-through/" class="auth-btn link">LOGIN</a>\n            </li>\n            <li class="social-auth text-center">\n              <p>or Login With</p>\n              <a href="#">\n                <img src="https://osumstudio.com/envato/purposeapp/img/icons/google.svg" />\n                <span>Google</span>\n              </a>\n              <a href="#">\n                <img src="https://osumstudio.com/envato/purposeapp/img/icons/facebook.svg" />\n                <span>Facebook</span>\n              </a>\n            </li>\n          </ul>\n          <div class="block-footer">\n            <p class="text-center">New User?\n              <a href="/">Sign Up Now</a>\n            </p>\n          </div>\n        </div>\n      </form>\n    </div>\n  </div>\n</template>','0','0','2','2','1','0','0','0','0','0','componentUrl','','','0','1747569023');


DROP TABLE IF EXISTS `t6_h_tab`;
CREATE TABLE `t6_h_tab` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `path` varchar(44) DEFAULT NULL,
  `path_right` varchar(44) DEFAULT NULL,
  `name` varchar(44) DEFAULT NULL,
  `title` varchar(44) DEFAULT NULL,
  `title_right` varchar(44) DEFAULT NULL,
  `custom` text DEFAULT NULL,
  `menu` text DEFAULT NULL,
  `body` text DEFAULT NULL,
  `del` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=delete',
  `content_id` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1=yes,0=no',
  `level` tinyint(4) NOT NULL DEFAULT 0,
  `page_type` tinyint(4) NOT NULL COMMENT '1=url,2=componentUrl',
  `view_title` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=yes,0=no',
  `view_navbar` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1=yes,0=no',
  `view_left_panel` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=yes,0=no',
  `searchbar` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=yes,0=no',
  `view_back` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1=yes,0=no',
  `seq` tinyint(4) NOT NULL DEFAULT 0,
  `is_active` tinyint(4) NOT NULL DEFAULT 0,
  `url_type` varchar(20) DEFAULT NULL COMMENT 'url,componentUrl',
  `icon_right` varchar(20) DEFAULT NULL,
  `icon` varchar(20) DEFAULT NULL,
  `parent` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`),
  KEY `id_folder_slug` (`id`,`path`(20))
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `t6_h_tab` VALUES ('1','','','header','','','<!DOCTYPE html>\n<html lang="en">\n\n<head>\n    <meta charset="UTF-8">\n    <meta name="viewport"\n    content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, viewport-fit=cover">\n    <meta name="mobile-web-app-capable" content="yes">\n    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">\n    <meta name="theme-color" content="#42C6A5">\n    <meta http-equiv="Content-Security-Policy" content="default-src * \'self\' \'unsafe-inline\' \'unsafe-eval\' data: gap:">\n    <title>t6</title>\n    <link rel="stylesheet" href="css/framework7-bundle.min.css">\n    <link rel="stylesheet" href="css/purpose-icons.css">\n    <link rel="stylesheet" href="css/default.css">\n    <link rel="stylesheet" href="css/icons.css">\n    <link rel="stylesheet" href="css/custom.css">\n    <link rel="stylesheet" href="css/margin.css">\n    <link rel="apple-touch-icon" href="img/favicon-big.png">\n    <link rel="icon" href="img/favicon.svg">\n</head>\n\n<body>\n    <!-- preloader start -->\n    <div class="Cpreloader">\n        <div class="load">\n            <span></span>\n            <span></span>\n            <span></span>\n            <span></span>\n        </div>\n    </div>\n    <!-- preloader end -->\n\n<div id="app">\n    <div class="view view-main view-init safe-areas" data-master-detail-breakpoint="768" data-url="/" >','','<!DOCTYPE html>\n<html lang="en">\n\n<head>\n  <meta charset="UTF-8">\n  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, viewport-fit=cover">\n  <meta name="mobile-web-app-capable" content="yes">\n  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">\n  <meta name="theme-color" content="#42C6A5">\n  <meta http-equiv="Content-Security-Policy" content="default-src * \'self\' \'unsafe-inline\' \'unsafe-eval\' data: gap:">\n  <title>t6</title>\n  <link rel="stylesheet" href="css/framework7-bundle.min.css">\n  <link rel="stylesheet" href="css/purpose-icons.css">\n  <link rel="stylesheet" href="css/default.css">\n  <link rel="stylesheet" href="css/icons.css">\n  <link rel="stylesheet" href="css/custom.css">\n  <link rel="stylesheet" href="css/margin.css">\n  <link rel="apple-touch-icon" href="img/favicon-big.png">\n  <link rel="icon" href="img/favicon.svg">\n</head>\n\n<body>\n  <!-- preloader start -->\n  <div class="Cpreloader">\n    <div class="load">\n      <span>\n      </span>\n      <span>\n      </span>\n      <span>\n      </span>\n      <span>\n      </span>\n    </div>\n  </div>\n  <!-- preloader end -->\n  <div id="app">\n    <div class="view view-main view-init safe-areas" data-master-detail-breakpoint="768" data-url="/">','0','0','1','2','0','1','0','0','0','1','0','componentUrl','','','0','1747571086');
INSERT INTO `t6_h_tab` VALUES ('7','','','footer','','','<div class="toolbar toolbar-bottom home-menu no-pseudo">\n            <div class="toolbar-inner">\n                <a href="/home/" class="menuItem item-home item-selected">\n                    <img src="https://osumstudio.com/envato/purposeapp/img/icons/nav-home.svg" />\n                    <span>Home</span>\n                </a>\n                <a href="/search/" class="menuItem item-search">\n                    <img src="https://osumstudio.com/envato/purposeapp/img/icons/nav-search.svg" />\n                    <span>Search</span>\n                </a>\n                <a href="/profile/" class="menuItem item-profile">\n                    <img src="https://osumstudio.com/envato/purposeapp/img/icons/nav-profile.svg" />\n                    <span>Profile</span>\n                </a>\n                <a href="/pages/" class="menuItem item-pages">\n                    <img src="https://osumstudio.com/envato/purposeapp/img/icons/pages.svg" />\n                    <span>Pages</span>\n                </a>\n            </div>\n        </div>\n</div>\n</div>\n<script src="js/framework7-bundle.min.js"></script>\n<script src="js/jquery-3.5.1.min.js"></script>\n<script src="js/routes.js"></script>\n<script src="js/app.js"></script>\n<script src="js/utils.js"></script>\n</body>\n</html>','','<div class="toolbar toolbar-bottom home-menu no-pseudo">\n  <div class="toolbar-inner">\n    <a href="/home/" class="menuItem item-home item-selected">\n      <img src="https://osumstudio.com/envato/purposeapp/img/icons/nav-home.svg" />\n      <span>Home</span>\n    </a>\n    <a href="/search/" class="menuItem item-search">\n      <img src="https://osumstudio.com/envato/purposeapp/img/icons/nav-search.svg" />\n      <span>Search</span>\n    </a>\n    <a href="/profile/" class="menuItem item-profile">\n      <img src="https://osumstudio.com/envato/purposeapp/img/icons/nav-profile.svg" />\n      <span>Profile</span>\n    </a>\n    <a href="/pages/" class="menuItem item-pages">\n      <img src="https://osumstudio.com/envato/purposeapp/img/icons/pages.svg" />\n      <span>Pages</span>\n    </a>\n  </div>\n</div>\n</div>\n</div>\n<script src="js/framework7-bundle.min.js"></script>\n<script src="js/jquery-3.5.1.min.js"></script>\n<script src="js/routes.js"></script>\n<script src="js/app.js"></script>\n<script src="js/utils.js"></script>\n</body>\n\n</html>','0','0','1','2','0','0','0','0','0','127','0','componentUrl','','','0','1747570914');


DROP TABLE IF EXISTS `t6_html`;
CREATE TABLE `t6_html` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `modul` varchar(20) DEFAULT NULL,
  `slug` varchar(99) DEFAULT NULL,
  `name` varchar(99) DEFAULT NULL,
  `param` varchar(99) DEFAULT NULL,
  `method` varchar(99) NOT NULL DEFAULT 'POST',
  `folder` varchar(20) DEFAULT NULL,
  `php` text DEFAULT NULL,
  `body` text DEFAULT NULL,
  `remark` varchar(150) DEFAULT NULL,
  `st` tinyint(4) NOT NULL,
  `type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1=api,2=non api',
  `del` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=delete',
  `php_tes` tinyint(4) NOT NULL DEFAULT 0,
  `php_update_at` int(11) NOT NULL DEFAULT 0,
  `php_test_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `folder_slug` (`folder`,`slug`),
  KEY `id_folder_slug` (`id`,`folder`,`slug`),
  KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `t6_html` VALUES ('1','post','index','item','op=job','GET','tes6/','','','','0','0','0','0','1743694817','0');


DROP TABLE IF EXISTS `t6_js`;
CREATE TABLE `t6_js` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `modul` varchar(99) DEFAULT NULL,
  `name` varchar(99) DEFAULT NULL,
  `body` text DEFAULT NULL,
  `is` varchar(10) DEFAULT '0',
  `del` tinyint(4) NOT NULL DEFAULT 0 COMMENT '1=delete',
  `level` tinyint(4) NOT NULL DEFAULT 0,
  `parent` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `folder_name` (`modul`(20),`name`),
  KEY `id_folder_slug` (`id`,`modul`(20)),
  KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=84 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `t6_js` VALUES ('1','app','app','// Dom7\nvar $ = Dom7;\n\n\n// Theme\nvar theme = \'ios\';\nif (location.href.indexOf(\'theme=md\') >= 0) theme = \'md\';\nif (location.href.indexOf(\'theme=aurora\') >= 0) theme = \'aurora\';\nvar plugin = {\n    params: {\n        theme: theme,\n        root: \'#app\',\n    }\n};\nif (Framework7.use) Framework7.use(plugin);\nelse if (Framework7.Class && Framework7.Class.use) Framework7.Class.use(plugin);\n\n\n// Init App\nvar app = new Framework7({\n    id: \'io.framework7.testapp\',\n    el: \'#app\',\n    cache: false, /* disable caching */\n    theme: theme,\n    routes: routes,\n    popup: {\n        closeOnEscape: true,\n    },\n    sheet: {\n        closeOnEscape: true,\n    },\n    popover: {\n        closeOnEscape: true,\n    },\n    actions: {\n        closeOnEscape: true,\n    },\n    vi: {\n        placementId: \'pltd4o7ibb9rc653x14\',\n    },\n});\n\napp.on(\'pageBeforeIn\', function(page) {\n    \n    var $$ = Dom7;\n    \n    // nav menu\n    if (page.$el.hasClass(\'home-v1\') || page.$el.hasClass(\'home-v2\') || page.$el.hasClass(\'home-v3\') || page.$el.hasClass(\'home-v4\') || page.$el.hasClass(\'home-v5\') || page.$el.hasClass(\'home-v6\')) {\n        $$(\'.toolbar-bottom .menuItem\').removeClass(\'item-selected\');\n        $$(\'.toolbar-bottom .menuItem.item-home\').addClass(\'item-selected\');\n    } else if (page.$el.hasClass(\'page-search\') || page.$el.hasClass(\'search-2\')) {\n        $$(\'.toolbar-bottom .menuItem\').removeClass(\'item-selected\');\n        $$(\'.toolbar-bottom .menuItem.item-search\').addClass(\'item-selected\');\n    } else if (page.$el.hasClass(\'page-profile\')) {\n        $$(\'.toolbar-bottom .menuItem\').removeClass(\'item-selected\');\n        $$(\'.toolbar-bottom .menuItem.item-profile\').addClass(\'item-selected\');\n    } else if (page.$el.hasClass(\'page-all-pages\')) {\n        $$(\'.toolbar-bottom .menuItem\').removeClass(\'item-selected\');\n        $$(\'.toolbar-bottom .menuItem.item-pages\').addClass(\'item-selected\');\n    }\n\n    $$(\'.theme-mode\').on(\'click\', function () {\n        if($$(\'.view.view-main.view-init\').hasClass(\'theme-dark\')) {\n            $$(\'.view.view-main.view-init\').removeClass(\'theme-dark\');\n        } else {\n            $$(\'.view.view-main.view-init\').addClass(\'theme-dark\');\n        }\n    });\n});\n\napp.on(\'pageInit\', function (page) {\n    var $$ = Dom7;\n    if ($$(\'.category-card-inner.selected\').length > 0) {\n        $$(\'.cate-count\').html($$(\'.category-card-inner.selected\').length + \'+\');\n    } else if ($$(\'.selected\').length == 0) {\n        $$(\'.cate-count\').html($$(\'.category-card-inner.selected\').length + \'\');\n    }\n    $$(\'.category-card-inner\').on(\'click\', function () {\n        if($$(this).hasClass(\'selected\')) {\n            $$(this).removeClass(\'selected\');\n        } else {\n            $$(this).addClass(\'selected\');\n        }\n        if ($$(\'.category-card-inner.selected\').length > 0) {\n            $$(\'.cate-count\').html($$(\'.category-card-inner.selected\').length + \'+\');\n        } else if ($$(\'.selected\').length == 0) {\n            $$(\'.cate-count\').html($$(\'.category-card-inner.selected\').length + \'\');\n        }\n    });\n    \n    $$(\'.fav\').on(\'click\', function () {\n        if($$(this).hasClass(\'faved\')) {\n            $$(this).removeClass(\'faved\');\n        } else {\n            $$(this).addClass(\'faved\');\n        }\n    });\n    \n    $$(\'#fav\').on(\'click\', function () {\n        if ($$(\'.faved-course\').hasClass(\'d-none\')) {\n            $$(\'.faved-course\').removeClass(\'d-none\');\n            $$(\'.fav-course\').addClass(\'d-none\');\n        } else {\n            $$(\'.faved-course\').addClass(\'d-none\');\n            $$(\'.fav-course\').removeClass(\'d-none\');\n        }\n    });\n    \n    $$(\'#fav2\').on(\'click\', function () {\n        if ($$(\'.faved-course2\').hasClass(\'d-none\')) {\n            $$(\'.faved-course2\').removeClass(\'d-none\');\n            $$(\'.fav-course2\').addClass(\'d-none\');\n        } else {\n            $$(\'.faved-course2\').addClass(\'d-none\');\n            $$(\'.fav-course2\').removeClass(\'d-none\');\n        }\n    });\n    \n    $$(".the-timeline .timeline-card").each(function(e) {\n        $$(e).find(".progress-num").html($$(e).find(".progressbar").attr("data-progress") + \'%\');\n    });\n    \n    $$(\'.top-search-slider .swiper-slide span\').on(\'click\', function () {\n        $$(\'.top-search-slider .swiper-slide span\').removeClass(\'selected\');\n        $$(this).addClass(\'selected\');\n    });\n    \n    $$(\'.plan, .plan-card\').on(\'click\', function () {\n        $$(\'.plan, .plan-card\').removeClass(\'selected\');\n        $$(this).addClass(\'selected\');\n    });\n    \n    $$(\'.class-type li\').on(\'click\', function () {\n        $$(\'.class-type li\').removeClass(\'selected\');\n        $$(this).addClass(\'selected\');\n    });\n    \n    $$(\'.time-frame span\').on(\'click\', function () {\n        $$(\'.time-frame span\').removeClass(\'selected\');\n        $$(this).addClass(\'selected\');\n    });\n    \n    for (let i = 0, len = $$(\'.swiper-slide\').length; i < len; i++){\n        $$(\'.swiper-slide\')[i].setAttribute(\'tabindex\', \'0\');\n    }\n    \n    if (page.$el.hasClass(\'course-single-1\')) {\n        $$(\'#addNewFile\').css(\'display\', \'none\');\n        var courseSlider = app.swiper.get(\'.tabs-swipeable-wrap\');\n        courseSlider.on(\'slideChange\', function () {\n            if($$(\'#files\').hasClass(\'tab-active\')) {\n                $$(\'#addNewFile\').css(\'display\', \'block\');\n            } else {\n                $$(\'#addNewFile\').css(\'display\', \'none\');\n            }\n        });\n    }\n    \n    /* popup */\n    var swipeToClosePopup = app.popup.create({\n        el: \'.course-video\',\n        swipeToClose: true,\n        swipeHandler: \'.swipe-to-close\',\n    });\n    app.sheet.create({\n        el: \'.download-file-1\',\n        swipeToClose: true,\n        backdrop: true,\n    });\n    app.sheet.create({\n        el: \'.download-file-2\',\n        swipeToClose: true,\n        backdrop: true,\n    });\n    app.sheet.create({\n        el: \'.download-file-3\',\n        swipeToClose: true,\n        backdrop: true,\n    });\n    app.sheet.create({\n        el: \'.share-profile\',\n        swipeToClose: true,\n        backdrop: true,\n    });\n    app.sheet.create({\n        el: \'.the-filter\',\n        swipeToClose: true,\n        backdrop: true,\n    });\n    \n    // feedback \n    if (page.$el.hasClass(\'page-feedback\')) {\n        if ($$(\'#unsatisfied\').parent().hasClass(\'rated\')) {\n            $$(\'#unsatisfied\').attr("src","img/icons/unsatisfied-rated.svg");\n        } else if($$(\'.view.view-main.view-init\').hasClass(\'theme-dark\')) {\n            $$(\'#unsatisfied\').attr("src","img/icons/unsatisfied-dark.svg");\n        } else {\n            $$(\'#unsatisfied\').attr("src","img/icons/unsatisfied.svg");\n        }\n        if ($$(\'#neutral\').parent().hasClass(\'rated\')) {\n            $$(\'#neutral\').attr("src","img/icons/neutral-rated.svg");\n        } else if($$(\'.view.view-main.view-init\').hasClass(\'theme-dark\')) {\n            $$(\'#neutral\').attr("src","img/icons/neutral-rating-dark.svg");\n        } else {\n            $$(\'#neutral\').attr("src","img/icons/neutral-rating.svg");\n        }\n        if ($$(\'#satisfied\').parent().hasClass(\'rated\')) {\n            $$(\'#satisfied\').attr("src","img/icons/satisfied-rated.svg");\n        } else if ($$(\'.view.view-main.view-init\').hasClass(\'theme-dark\')) {\n            $$(\'#satisfied\').attr("src","img/icons/satisfied-rating-dark.svg");\n        } else {\n            $$(\'#satisfied\').attr("src","img/icons/satisfied-rating.svg");\n        }\n        if ($$(\'#verysatisfied\').parent().hasClass(\'rated\')) {\n            $$(\'#verysatisfied\').attr("src","img/icons/very-satisfied-rated.svg");\n        } else if ($$(\'.view.view-main.view-init\').hasClass(\'theme-dark\')) {\n            $$(\'#verysatisfied\').attr("src","img/icons/very-satisfied-dark.svg");\n        } else {\n            $$(\'#verysatisfied\').attr("src","img/icons/verysatisfied.svg");\n        }\n        $$(\'.rating-btns a\').on(\'click\', function () {\n            $$(\'.rating-btns a\').removeClass(\'rated\');\n            $$(this).addClass(\'rated\');\n            if ($$(\'#unsatisfied\').parent().hasClass(\'rated\')) {\n                $$(\'#unsatisfied\').attr("src","img/icons/unsatisfied-rated.svg");\n            } else if($$(\'.view.view-main.view-init\').hasClass(\'theme-dark\')) {\n                $$(\'#unsatisfied\').attr("src","img/icons/unsatisfied-dark.svg");\n            } else {\n                $$(\'#unsatisfied\').attr("src","img/icons/unsatisfied.svg");\n            }\n            if ($$(\'#neutral\').parent().hasClass(\'rated\')) {\n                $$(\'#neutral\').attr("src","img/icons/neutral-rated.svg");\n            } else if($$(\'.view.view-main.view-init\').hasClass(\'theme-dark\')) {\n                $$(\'#neutral\').attr("src","img/icons/neutral-rating-dark.svg");\n            } else {\n                $$(\'#neutral\').attr("src","img/icons/neutral-rating.svg");\n            }\n            if ($$(\'#satisfied\').parent().hasClass(\'rated\')) {\n                $$(\'#satisfied\').attr("src","img/icons/satisfied-rated.svg");\n            } else if ($$(\'.view.view-main.view-init\').hasClass(\'theme-dark\')) {\n                $$(\'#satisfied\').attr("src","img/icons/satisfied-rating-dark.svg");\n            } else {\n                $$(\'#satisfied\').attr("src","img/icons/satisfied-rating.svg");\n            }\n            if ($$(\'#verysatisfied\').parent().hasClass(\'rated\')) {\n                $$(\'#verysatisfied\').attr("src","img/icons/very-satisfied-rated.svg");\n            } else if ($$(\'.view.view-main.view-init\').hasClass(\'theme-dark\')) {\n                $$(\'#verysatisfied\').attr("src","img/icons/very-satisfied-dark.svg");\n            } else {\n                $$(\'#verysatisfied\').attr("src","img/icons/verysatisfied.svg");\n            }\n        });  \n    }\n    \n    /* switch src for dark mode start */\n    if ($$(\'.view.view-main.view-init\').hasClass(\'theme-dark\')) {\n        $$(\'#walkthrough-1\').attr("src","img/walkthrough/01-dark.svg");\n        $$(\'#walkthrough-2\').attr("src","img/walkthrough/02-dark.svg");\n        $$(\'#walkthrough-4\').attr("src","img/walkthrough/04-dark.svg");\n        $$(\'#goBackDark\').attr("src","img/icons/arrow-left-white.svg");\n        $$(\'.page-header-icon-right img\').attr("src","img/icons/bell-white.svg");\n        $$(\'#close-member-page\').attr("src","img/icons/close-white.svg");\n        $$(\'.social-contacts a i img\').attr("src","img/icons/social-angle-right-white.svg");\n        $$(\'.course-coming img\').attr("src","img/icons/lock-white.svg");\n        $$(\'#goBackDark2\').attr("src","img/icons/angle-left-white.svg");\n        \n    } else {\n        $$(\'#walkthrough-1\').attr("src","img/walkthrough/01.svg");\n        $$(\'#walkthrough-2\').attr("src","img/walkthrough/02.svg");\n        $$(\'#walkthrough-4\').attr("src","img/walkthrough/04.svg");\n        $$(\'#goBackDark\').attr("src","img/icons/arrow-left.svg");\n        $$(\'.page-header-icon-right img\').attr("src","img/icons/bell.svg");\n        $$(\'#close-member-page\').attr("src","img/icons/close.svg");\n        $$(\'.social-contacts a i img\').attr("src","img/icons/social-angle-right.svg");\n        $$(\'.course-coming img\').attr("src","img/icons/lock.svg");\n        $$(\'#goBackDark2\').attr("src","img/icons/angle-left-dark.svg");\n    }\n    /* switch src for dark mode end */\n    \n    /* follow button */\n    $$(\'.course-single-1 .follow-btn\').on(\'click\', function () {\n        if ($$(".course-single-1 .follow-btn").html() == `Follow <i class="f7-icons">plus</i>`){\n            $$(".course-single-1 .follow-btn").html(`Following <i class="f7-icons">checkmark_alt</i>`);\n        } else{\n            $$(".course-single-1 .follow-btn").html(`Follow <i class="f7-icons">plus</i>`);\n        }\n    });\n    $$(\'.course-single-2 .follow-btn\').on(\'click\', function () {\n        if ($$(".course-single-2 .follow-btn").html() == `<i class="f7-icons">plus</i> Follow`){\n            $$(".course-single-2 .follow-btn").html(`<i class="f7-icons">checkmark_alt</i> Following`);\n        } else{\n            $$(".course-single-2 .follow-btn").html(`<i class="f7-icons">plus</i> Follow`);\n        }\n    });\n    $$(\'.page-teacher .follow-btn\').on(\'click\', function () {\n        if ($$(".page-teacher .follow-btn").html() == `<i class="f7-icons">plus</i> Follow`){\n            $$(".page-teacher .follow-btn").html(`<i class="f7-icons">checkmark_alt</i> Following`);\n        } else{\n            $$(".page-teacher .follow-btn").html(`<i class="f7-icons">plus</i> Follow`);\n        }\n    });\n    \n});\n\nvar delay=1500;\nsetTimeout(function() {\n $(\'.Cpreloader\').addClass(\'loadedComplete\');\n}, delay);','js','0','1','0','1747572259');
INSERT INTO `t6_js` VALUES ('2','utils','utils','let base_url = "https://nibrasfincp.azkapersada.com/api/v2/";\nlet ar={\n\'relation\':{1:\'Komisaris\',2:\'Direksi\',3:\'Staff\',6:\'Debitur\',7:\'Kreditur\',8:\'Customer\',\n9:\'Supplier\',10:\'Other\'},\n\'brand\':{1:\'Samsung\',2:\'Panasonic\',3:\'Sharp\'}\n};\n\n\nfunction checkConnection(url) {}\n\nfunction timeOut(num = 30000) {\n  setTimeout(() => {\n    app.preloader.hide();\n    app.dialog.alert(\'Operation timed out...\', \'Time Out\');\n  }, num)\n}\n\nfunction promiseTimeout(ms, promise) {\n  // Create a promise that rejects in <ms> milliseconds\n  let timeout = new Promise((resolve, reject) => {\n    let id = setTimeout(() => {\n      clearTimeout(id);\n      reject(\'Operation timed out in \' + (ms / 1000) + \'s\')\n    }, ms)\n  })\n  // Returns a race between our timeout and the passed in promise\n  return Promise.race([\n    promise,\n    timeout\n  ])\n}\n\nString.prototype.replaceAt = function(index, char) {\n  return this.substr(0, index - 1) + char + this.substr(index + char.length);\n}\n\nfunction copyToClipboard(element) {\n  var $temp = $("<input>");\n  $("body").append($temp);\n  $temp.val($(element).text()).select();\n  document.execCommand("copy");\n  $temp.remove();\n}\n\nfunction init_swiper(Id){      \nvar swiper1 = app.swiper.create(Id, {  \n  pagination: {\n    el: \'.swiper-pagination\',\n    type: \'bullets\',\n  },\n    speed: 400,\n    spaceBetween: 10,\n    slidesPerView: 1,\n    autoplay: { delay: 4000, disableOnInteraction:false }\n  });\n}','js','0','1','0','1747217421');
INSERT INTO `t6_js` VALUES ('3','utils','login','function login(req) {\n  app.preloader.show(\'multi\');\n  localStorage.removeItem(\'f06_user\');\n  localStorage.removeItem(\'f06_data\');\n  $.ajax({\n    type: "post",\n    url: base_url + \'login\',\n    data: req,\n    success: (res) => {\n      if (res.status) {\n        localStorage.setItem(\'f06_user\', JSON.stringify({\n          uuid: res.user.data.uuid,\n          email: res.user.data.email,\n          sess_token: res.user.data.token,\n          data: res.user.data\n        }))\n        localStorage.setItem(\'f06_data\', JSON.stringify({\n          data: res.results\n        }))\n        app.preloader.hide();\n        app.views.main.router.navigate(\'/home/\');\n      } else {\n        app.preloader.hide();\n        app.dialog.alert(res.message, \'Login Failed\');\n      }\n    }\n  })\n}','js','0','2','2','1747548524');
INSERT INTO `t6_js` VALUES ('4','app','login','/*\n$$(document).on(\'page:init\', \'.page[data-name="signin"]\', function(e) {\n  $(document).off("click", "#signin_button").on("click", "#signin_button", function(e) {\n  console.log(\'app signin ready\')\n    e.preventDefault();\n    var email = $("#loginEmail").val();\n    var password = $("#loginPassword").val();\n    let req = {\n      email,\n      password\n    }\n    if (email && password) {\n      login(req);\n    } else {\n      app.dialog.alert("Please enter your username and password", "Login Errors");\n    }\n  });\n})\n*/','js','0','2','1','1747571126');
INSERT INTO `t6_js` VALUES ('5','app','logout','/*$$(document).on(\'page:init\', \'.page[data-name="account"]\', function(e) {\n  $$(document).off("click", "#logout").on("click", "#logout", function(e) {\n    e.preventDefault();\n    console.log(\'logout dulu ye\')\n    localStorage.removeItem(\'f06_user\');\n    localStorage.removeItem(\'f06_data\');\n    localStorage.removeItem(\'f06_action\');\n    localStorage.removeItem(\'f06_bank\');\n    localStorage.removeItem(\'f06_company\');\n    localStorage.removeItem(\'f06_inventory\');\n    localStorage.removeItem(\'f06_journal\');\n    localStorage.removeItem(\'f06_person\');\n    localStorage.removeItem(\'f06_product\');\n    localStorage.removeItem(\'f06_sales\');\n    localStorage.removeItem(\'f06_transaction\');\n    app.views.main.router.navigate(\'/signin/\');  \n    console.log(\'geser ke signin\')\n    window.location.reload()\n  });\n})*/','js','0','2','1','1747572215');


DROP TABLE IF EXISTS `tax_info`;
CREATE TABLE `tax_info` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(150) DEFAULT NULL,
  `summary` varchar(250) DEFAULT NULL,
  `url_reff` varchar(250) DEFAULT NULL,
  `bodytext` text DEFAULT NULL,
  `st` tinyint(4) NOT NULL DEFAULT 1,
  `update_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `id_cif_account_number` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;



DROP TABLE IF EXISTS `transaction`;
CREATE TABLE `transaction` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `action_at` int(11) NOT NULL,
  `action_id` int(11) NOT NULL,
  `debit` varchar(10) DEFAULT NULL,
  `credit` varchar(10) DEFAULT NULL,
  `year` varchar(5) DEFAULT NULL,
  `month` varchar(7) DEFAULT NULL,
  `amount` bigint(20) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  `seq` int(11) NOT NULL DEFAULT 0,
  `id2` int(11) NOT NULL DEFAULT 0,
  `cat` tinyint(4) NOT NULL DEFAULT 0,
  `inout` tinyint(4) NOT NULL DEFAULT 0,
  `st` tinyint(4) NOT NULL DEFAULT 1,
  `view` tinyint(4) NOT NULL DEFAULT 1,
  PRIMARY KEY (`id`),
  UNIQUE KEY `action_id` (`action_id`),
  KEY `id_tgl_nilai_akun_tunai` (`id`,`action_at`,`amount`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `transaction` VALUES ('19','0','0','11201','41100','2025','202506','0','1748788886','0','1','0','0','1','1');


DROP TABLE IF EXISTS `trx_title`;
CREATE TABLE `trx_title` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `code` int(11) DEFAULT NULL,
  `menu` varchar(12) DEFAULT NULL,
  `title` varchar(100) DEFAULT NULL,
  `debit` varchar(12) DEFAULT NULL,
  `credit` varchar(12) DEFAULT NULL,
  `del` tinyint(4) NOT NULL DEFAULT 0,
  `cat` tinyint(4) NOT NULL DEFAULT 0,
  `bank` tinyint(4) NOT NULL DEFAULT 0,
  `level` tinyint(4) NOT NULL DEFAULT 0,
  `position` tinyint(4) NOT NULL DEFAULT 0,
  `parent` int(11) NOT NULL DEFAULT 0,
  `inout` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `id_cif_account_number` (`id`,`title`)
) ENGINE=InnoDB AUTO_INCREMENT=134 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `trx_title` VALUES ('1','101','add','Biaya Dengan Tunai','','11101','0','1','2','1','1','0','2','0');
INSERT INTO `trx_title` VALUES ('2','102','add','Saldo Utang Dagang','','21100','0','5','0','1','2','0','2','0');
INSERT INTO `trx_title` VALUES ('3','103','add','Saldo Piutang Dagang','','41100','0','7','0','1','2','0','2','0');
INSERT INTO `trx_title` VALUES ('4','104','add','Bayar Utang Dagang','','11101','0','2','1','1','1','0','2','0');
INSERT INTO `trx_title` VALUES ('5','105','product','beli persediaan secara kredit','','','0','0','0','1','0','0','0','0');
INSERT INTO `trx_title` VALUES ('6','106','product','beli persediaan tunai','','','0','0','0','1','0','0','0','0');
INSERT INTO `trx_title` VALUES ('7','107','product','retur ke supplier','','','0','0','0','1','0','0','0','0');
INSERT INTO `trx_title` VALUES ('8','108','add','Modal Ditarik','','11101','0','2','1','1','1','0','2','0');
INSERT INTO `trx_title` VALUES ('9','109','add','Bagi Hasil','','11101','0','2','1','1','3','0','2','0');
INSERT INTO `trx_title` VALUES ('10','110','add','Potongan Biaya Bank','','11101','0','2','1','1','1','0','2','0');
INSERT INTO `trx_title` VALUES ('11','111','add','Bunga Bank','','11101','0','2','1','1','1','0','2','0');
INSERT INTO `trx_title` VALUES ('12','112','add','Potongan Penjualan','','11101','0','2','1','1','1','0','2','0');
INSERT INTO `trx_title` VALUES ('13','113','add','Biaya Dengan Utang','','21200','0','2','0','1','1','0','2','0');
INSERT INTO `trx_title` VALUES ('14','114','add','Penyusutan Kendaraan','','21200','0','2','0','1','3','0','2','0');
INSERT INTO `trx_title` VALUES ('15','115','add','Penyusutan Peralatan','','21200','0','2','0','1','3','0','2','0');
INSERT INTO `trx_title` VALUES ('16','116','add','Penyusutan Bangunan','','21200','0','2','0','1','3','0','2','0');
INSERT INTO `trx_title` VALUES ('17','117','add','Biaya Dibayar Dimuka','','21200','0','2','1','1','1','0','2','0');
INSERT INTO `trx_title` VALUES ('18','118','add','Beban Pajak dengan Kas','','11101','0','2','1','1','3','0','2','0');
INSERT INTO `trx_title` VALUES ('19','119','add','Beban Pajak dengan utang','','21200','0','2','0','1','3','0','2','0');
INSERT INTO `trx_title` VALUES ('20','120','add','Hitung Biaya Dimuka','','11204','0','2','1','1','1','0','2','0');
INSERT INTO `trx_title` VALUES ('22','201','add','Modal Disetor','11101','','0','1','1','1','2','0','1','0');
INSERT INTO `trx_title` VALUES ('23','202','add','Pendapatan Bunga Bank','11101','','0','1','1','1','1','0','1','0');
INSERT INTO `trx_title` VALUES ('24','203','add','Utang Bank Jangka Panjang','11101','','0','1','1','1','1','0','1','0');
INSERT INTO `trx_title` VALUES ('25','204','add','Pembayaran Piutang dari Agen','11101','','0','1','1','1','1','0','1','0');
INSERT INTO `trx_title` VALUES ('26','205','product','jual tunai','','','0','0','0','1','0','0','0','0');
INSERT INTO `trx_title` VALUES ('27','206','product','jual kredit','','','0','0','0','1','0','0','0','0');
INSERT INTO `trx_title` VALUES ('28','207','product','retur (penjualan) dari agen','','','0','0','0','1','0','0','0','0');
INSERT INTO `trx_title` VALUES ('29','208','add','Potongan Pembelian','11101','','0','1','1','1','1','0','1','0');
INSERT INTO `trx_title` VALUES ('90','','','','61101','11101','0','2','1','2','0','101','0','0');
INSERT INTO `trx_title` VALUES ('91','','','','61102','11101','0','2','1','2','0','101','0','0');
INSERT INTO `trx_title` VALUES ('92','','','','61103','11101','0','2','1','2','0','101','0','0');
INSERT INTO `trx_title` VALUES ('93','','','','62101','11101','0','2','1','2','0','101','0','0');
INSERT INTO `trx_title` VALUES ('94','','','','62102','11101','0','2','1','2','0','101','0','0');
INSERT INTO `trx_title` VALUES ('95','','','','62103','11101','0','2','1','2','0','101','0','0');
INSERT INTO `trx_title` VALUES ('96','','','','62106','11101','0','2','1','2','0','101','0','0');
INSERT INTO `trx_title` VALUES ('97','','','','11202','21100','0','5','0','2','0','102','0','0');
INSERT INTO `trx_title` VALUES ('98','','','','11201','41100','0','7','0','2','0','103','0','0');
INSERT INTO `trx_title` VALUES ('99','','','','21100','11101','0','2','1','2','0','104','0','0');
INSERT INTO `trx_title` VALUES ('100','','','','11202','21101','0','5','0','2','0','105','0','0');
INSERT INTO `trx_title` VALUES ('101','','','','11202','11101','0','2','1','2','0','106','0','0');
INSERT INTO `trx_title` VALUES ('102','','','','21101','11202','0','8','0','2','0','107','0','0');
INSERT INTO `trx_title` VALUES ('103','','','','31200','11101','0','2','1','2','0','108','0','0');
INSERT INTO `trx_title` VALUES ('104','','','','31300','11101','0','2','1','2','0','109','0','0');
INSERT INTO `trx_title` VALUES ('105','','','','81200','11101','0','2','1','2','0','110','0','0');
INSERT INTO `trx_title` VALUES ('106','','','','81100','11101','0','2','1','2','0','111','0','0');
INSERT INTO `trx_title` VALUES ('107','','','','41300','11101','0','2','1','2','0','112','0','0');
INSERT INTO `trx_title` VALUES ('108','','','','61101','21200','0','2','0','2','0','113','0','0');
INSERT INTO `trx_title` VALUES ('109','','','','61102','21200','0','2','0','2','0','113','0','0');
INSERT INTO `trx_title` VALUES ('110','','','','61103','21200','0','2','0','2','0','113','0','0');
INSERT INTO `trx_title` VALUES ('111','','','','62101','21200','0','2','0','2','0','113','0','0');
INSERT INTO `trx_title` VALUES ('112','','','','62102','21200','0','2','0','2','0','113','0','0');
INSERT INTO `trx_title` VALUES ('113','','','','62103','21200','0','2','0','2','0','113','0','0');
INSERT INTO `trx_title` VALUES ('114','','','','62106','21200','0','2','0','2','0','113','0','0');
INSERT INTO `trx_title` VALUES ('115','','','','61105','12302','0','2','0','2','0','114','0','0');
INSERT INTO `trx_title` VALUES ('116','','','','61106','12402','0','2','0','2','0','115','0','0');
INSERT INTO `trx_title` VALUES ('117','','','','62107','12202','0','2','0','2','0','116','0','0');
INSERT INTO `trx_title` VALUES ('118','','','','11204','11101','0','2','1','2','0','117','0','0');
INSERT INTO `trx_title` VALUES ('119','','','','62105','11101','0','2','1','2','0','118','0','0');
INSERT INTO `trx_title` VALUES ('120','','','','62105','21400','0','2','0','2','0','119','0','0');
INSERT INTO `trx_title` VALUES ('121','','','','62104','11204','0','2','1','2','0','120','0','0');
INSERT INTO `trx_title` VALUES ('122','','','','61104','11204','0','2','1','2','0','120','0','0');
INSERT INTO `trx_title` VALUES ('123','','','','11101','31100','0','1','1','2','0','201','0','0');
INSERT INTO `trx_title` VALUES ('124','','','','11101','71000','0','1','1','2','0','202','0','0');
INSERT INTO `trx_title` VALUES ('125','','','','11101','21300','0','1','1','2','0','203','0','0');
INSERT INTO `trx_title` VALUES ('126','','','','11101','11201','0','1','1','2','0','204','0','0');
INSERT INTO `trx_title` VALUES ('127','','','','11101','41100','0','4','1','2','0','205','0','0');
INSERT INTO `trx_title` VALUES ('128','','','','51100','11202','0','4','0','2','0','205','0','0');
INSERT INTO `trx_title` VALUES ('129','','','','11201','41100','0','4','0','2','0','206','0','0');
INSERT INTO `trx_title` VALUES ('130','','','','51100','11202','0','4','0','2','0','206','0','0');
INSERT INTO `trx_title` VALUES ('131','','','','11202','11201','0','9','0','2','0','207','0','0');
INSERT INTO `trx_title` VALUES ('132','','','','41200','51100','0','9','0','2','0','207','0','0');
INSERT INTO `trx_title` VALUES ('133','','','','11101','51300','0','1','1','2','0','208','0','0');


DROP TABLE IF EXISTS `user_address`;
CREATE TABLE `user_address` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL DEFAULT 0,
  `seq` int(11) NOT NULL DEFAULT 0,
  `label` varchar(50) DEFAULT NULL,
  `city` varchar(50) DEFAULT NULL,
  `no` varchar(50) DEFAULT NULL,
  `postcode` varchar(6) DEFAULT NULL,
  `rw` varchar(3) DEFAULT NULL,
  `rt` varchar(3) DEFAULT NULL,
  `address` varchar(200) DEFAULT NULL,
  `name` varchar(40) DEFAULT NULL,
  `kel` varchar(40) DEFAULT NULL,
  `kec` varchar(40) DEFAULT NULL,
  `latlng` varchar(40) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `gmap` varchar(100) DEFAULT NULL,
  `remark` varchar(100) DEFAULT NULL,
  `default` tinyint(4) NOT NULL DEFAULT 0,
  `del` tinyint(4) NOT NULL DEFAULT 0,
  `create_at` int(11) NOT NULL DEFAULT 0,
  `update_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `id_item_id_modul` (`id`,`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `user_address` VALUES ('1','1','0','','kota bekasi','','17413','8','2','Jalan Jatimakmur Raya','Afza Muna','','','','628123456789','oiuerwnpoiertjtr','','0','1','1743751076','1743751076');
INSERT INTO `user_address` VALUES ('2','1','0','','kota bekasi','','17413','8','2','Jalan Jatimakmur Raya','Afza Muna','Jatimakmur','pondok gede','','628123456789','oiuerwnpoiertjtr','','0','1','1743751124','1743751124');
INSERT INTO `user_address` VALUES ('3','1','0','','dfg','67','17413','8','5','5474','ewrqwe','jati','dfg','','5437547754','dfgd','','0','1','1743758501','1743758501');
INSERT INTO `user_address` VALUES ('4','1','0','','rty','7','456456','7','6','ert','tr','rty','rtyr','','ert','rtye','','0','1','1743758679','1743758679');
INSERT INTO `user_address` VALUES ('5','1','0','','ryt','44','54645','45','54','etr','rter','yer','ry','','ert','yry','ryrty','0','1','1743758909','1743758909');
INSERT INTO `user_address` VALUES ('6','1','0','Kos-kosan','kota bekasi','123','17413','8','2','Jalan Jatimakmur Raya no 91','Afza Muna','Jatimakmur','pondok gede','','628123456789','oiuerwnpoiertjtr','lantai 3, kamar 3R','0','1','1743759201','1747111975');
INSERT INTO `user_address` VALUES ('7','1','0','','kota bekasi','123','17413','8','2','Jalan Jatimakmur Raya','Afza Muna','Jatimakmur','pondok gede','','628123456789','oiuerwnpoiertjtr','pondok gede','0','1','1743759217','1743759217');
INSERT INTO `user_address` VALUES ('8','1','0','Kantor','kota bekasi','123','17413','8','2','Jalan Jatimakmur Raya','Afza Muna','Jatimakmur','pondok gede','','628123456789','oiuerwnpoiertjtr','lantai 2','0','1','1743759258','1743838777');
INSERT INTO `user_address` VALUES ('9','1','0','rumah','kota bekasi','123','17413','8','2','Jalan Jatimakmur Raya 78','Afza Muna','Jatimakmur','pondok gede','','628123456789','oiuerwnpoiertjtr','rumah pagar biru','0','0','1743759357','1747112113');
INSERT INTO `user_address` VALUES ('10','1','0','','ert','3','453453','3','3','dfg','ert','ert','rte','','gdfg','ert','erter','0','1','1743759517','1743759517');
INSERT INTO `user_address` VALUES ('11','1','0','ytru','36','36','36','36','36',' tu               ','tyu','363','363','','tyu','36','                3636','0','1','1747087620','1747087620');
INSERT INTO `user_address` VALUES ('12','1','0','Rumah','ru','rut','rtu','rut','rtu','    rtu            ','rtu','ru','rtu','','rtu','rur','   rueru','0','0','1747112176','1748121205');
INSERT INTO `user_address` VALUES ('13','1','0','','sdg','sg','sg','sg','sg','        sdg        ','sdg','sdg','sgd','','sdg','sdg','                sgd','0','1','1747112504','1747112922');


DROP TABLE IF EXISTS `user_login`;
CREATE TABLE `user_login` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL DEFAULT 0,
  `ip` varchar(20) DEFAULT NULL,
  `browser` varchar(190) DEFAULT NULL,
  `log_at` timestamp NULL DEFAULT NULL,
  `create_at` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `id_item_id_modul` (`id`,`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `user_login` VALUES ('1','1','103.136.58.233','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36','2025-06-04 07:04:58','1748995498');
INSERT INTO `user_login` VALUES ('2','1','103.136.58.233','Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36','2025-06-04 07:11:29','1748995889');
INSERT INTO `user_login` VALUES ('3','1','112.215.235.174','Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36','2025-06-04 07:17:15','1748996235');
INSERT INTO `user_login` VALUES ('4','1','103.136.58.233','Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36','2025-06-04 07:38:40','1748997520');
INSERT INTO `user_login` VALUES ('5','1','103.136.58.233','Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36','2025-06-04 09:44:01','1749005041');
INSERT INTO `user_login` VALUES ('6','1','103.136.58.233','Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36','2025-06-04 10:00:07','1749006007');
INSERT INTO `user_login` VALUES ('7','1','15.204.248.221','Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36','2025-06-10 14:55:24','1749542124');
INSERT INTO `user_login` VALUES ('8','1','103.136.58.233','Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Mobile Safari/537.36','2025-06-15 04:21:58','1749936118');
INSERT INTO `user_login` VALUES ('9','1','103.136.58.233','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36','2025-09-28 07:27:01','1759019221');
INSERT INTO `user_login` VALUES ('10','1','103.136.58.233','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36','2025-09-29 14:58:23','1759132703');
INSERT INTO `user_login` VALUES ('11','1','103.136.58.233','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36','2025-09-30 08:44:15','1759196655');


DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `firstname` varchar(50) DEFAULT NULL,
  `lastname` varchar(50) DEFAULT NULL,
  `fullname` varchar(99) DEFAULT NULL,
  `password` varchar(50) DEFAULT NULL,
  `phone` varchar(20) DEFAULT NULL,
  `email` varchar(50) NOT NULL,
  `img` text NOT NULL DEFAULT 'users/user.png',
  `ip` varchar(20) DEFAULT NULL,
  `token` text DEFAULT NULL,
  `del_reason` text DEFAULT NULL,
  `terms` tinyint(4) NOT NULL DEFAULT 0,
  `del` tinyint(4) NOT NULL DEFAULT 0,
  `email_verified` tinyint(4) NOT NULL DEFAULT 0,
  `create_at` int(11) NOT NULL,
  `update_at` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`),
  KEY `id_firstname_lastname_email` (`id`,`firstname`,`lastname`,`email`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

INSERT INTO `users` VALUES ('1','Navis','Murbiyanto','Navis Murbiyanto','96457fa50d3a5aeb8f294e6b6fcfb5d1','6287781217347','navismur@gmail.com','users/25/05/31/21/1/5/image/small/20250531212137.jpeg','','LHHKdgjxsaEK^GdHM_ABN_PHe(Ahsq%M%weHgxGNDtzk_Jz)eVEWaNE!ZwHZ(aywb@hVtan%NFGLhgbJVe^iWHM@BL)BgCCpwC_SrifRAhTk)A_(V%tcTDCzbJr%EWM(U','tes doang dr node js','0','0','0','1734754340','1748482396');
INSERT INTO `users` VALUES ('2','Afza','Muna','Afza Muna','jak457','72488585','afzamuna22@gmail.com','users/25/05/24/06/2/1/image/small/20250524063119.jpeg','','LHHKdgjxsaEK^GdHM_ABN_PHe(Ahsq%M%weHgxGNDtzk_Jz)eVEWaNE!ZwHZ(aywb@hVtan%NFGLhgbJVe^iWHM@BL)BgCCpwC_SrifRAhTk)A_(V%tcTDCzbJr%EWM(U','','0','0','0','1743659231','1748043079');
INSERT INTO `users` VALUES ('3','Cah','Bocah','Cah Bocah','45','09876','cahbocah45@gmail.com','','','LHHKdgjxsaEK^GdHM_ABN_PHe(Ahsq%M%weHgxGNDtzk_Jz)eVEWaNE!ZwHZ(aywb@hVtan%NFGLhgbJVe^iWHM@BL)BgCCpwC_SrifRAhTk)A_(V%tcTDCzbJr%EWM(U','','0','0','0','1743697999','0');


