app = $app; $this->db = $db; $this->mode_detail = Param::Get("mode_detail", ""); $this->id_reg = Param::Int("REG_ID", $session->get('WEB_APP')['REG_ID']); } public function form_gaji() { if ( $this->mode_detail == "save" ) { $sql = new SQL($this->app); $sql->set_table("gel_config"); $sql->add_param("LEMBUR"); $sql->add_param("BONUS1"); $sql->add_param("BONUS2"); $sql->add_where("REG_ID"); $sql->UpdateDB(); $this->mode_detail = "view"; } $atabel = [ 'REG_ID'=>0, 'LEMBUR'=>0, 'BONUS1'=>0, 'BONUS2'=>0 ]; if ($this->id_reg > 0) { $atabel = $this->db->fetchRow("SELECT * FROM gel_config WHERE REG_ID=?", [$this->id_reg]); } $benable = ($this->mode_detail === "update") ? true : false; $form = new Form($this->app); $tlembur = $form->textbox("_", "LEMBUR", $atabel['LEMBUR'], $benable, false, "double", "nilai lembur harian"); $tbonus1 = $form->textbox("_", "BONUS1", $atabel['BONUS1'], $benable, false, "double", "nilai bonus mingguan"); $tbonus2 = $form->textbox("_", "BONUS2", $atabel['BONUS2'], $benable, false, "double", "nilai bonus bulanan"); $ajson['html'] = '
'.$tlembur.'
'.$tbonus1.'
'.$tbonus2.'
'; $this->app->json($ajson); } public function index() { $this->app->json(['html' => '
 
' ]); } }