app = $app; $this->db = $db; $this->mode_detail = Param::Get("mode_detail", ""); $this->id_grup = Param::Int("Grup_RekID", 0); } public function table_detail() { if (in_array($this->mode_detail, ["insert","update","delete"])) { $sql = new SQL($this->app); $sql->set_table("gel_acc_grup"); $sql->add_param("Nama_Grup"); $sql->add_param("Aktif"); $sql->add_param_userid(); $sql->add_where("Grup_RekID"); if ($this->mode_detail === "insert") { $sql->InsertDB(); } else if ($this->mode_detail === "update") { $sql->UpdateDB(); } else if ($this->mode_detail === "delete") { $sql->DeleteDB(); } } $tcari = Param::Get("Cari_Rek"); $tsql = ''; $asql = []; if (!empty($tcari)) { $tsql = 'Nama_Grup LIKE ?'; $asql[] = '%'. $tcari .'%'; } $obj = new Table($this->app); $obj->set_table("gel_acc_grup", "*", $tsql, $asql); $obj->add_field("Grup_RekID", "ID", "hid"); $obj->add_field("Nama_Grup", "Nama Grup Rekening", "awr"); $obj->add_field("Aktif", "Aktif", "c", "checkbox"); $obj->set_field_order("Nama_Grup", "A"); $obj->add_row_btn("clipboard", "Ubah", "RekGrupJS.detail_ubah"); $obj->add_row_btn("trash", "Hapus", "RekGrupJS.detail_hapus"); $obj->set_func_btn("RekGrupJS.detail_tambah", "+ Grup Rekening"); $this->app->json([ $obj->json_table("divDetail") ]); } public function form_grup() { $atabel = [ 'Grup_RekID'=>0, 'Nama_Grup'=>"", 'Aktif'=>1 ]; if ($this->id_grup > 0) { $atabel = $this->db->fetchRow("SELECT * FROM gel_acc_Grup WHERE Grup_RekID=?", [$this->id_grup]); } $form = new Form($this->app); $tnama = $form->textbox("_", "Nama_Grup", $atabel['Nama_Grup'], true, true, "text", "nama grup rekening"); $taktif = $form->radio("_", "Aktif", $atabel['Aktif'], true, false, [1=>"Aktif",0=>"Tidak"]); $ajson['html'] = '
'.$tnama.'
'.$taktif.'
'; $this->app->json($ajson); } public function index() { $this->app->json(['html' => '
Daftar Grup Rekening
 
' ]); } }