db->query("select database() as current_db")->result(); // print_r($cek); } function get_data() { $prm = $this->sys_input; $PID = ""; if (isset($prm["PID"])) { $PID = trim($prm["PID"]); } $username = ""; if (isset($prm["username"])) { $username = trim($prm["username"]); } $PLang = ""; if (isset($prm["PLang"])) { $PLang = trim($prm["PLang"]); } $sql = "CALL `sp_rpt_t_hasil_so_elmd`(?, ?, ?)"; $qry = $this->db->query($sql, [$PID, $PLang, $username]); if ($qry) { $rows = $qry->result_array(); $this->clean_mysqli_connection($this->db->conn_id); } else { $this->sys_error_db("call error", $this->db); exit; } $this->sys_ok($rows); } public function getData() { $prm = $this->sys_input; $PID = ""; if (isset($prm["PID"])) { $PID = trim($prm["PID"]); } $username = ""; if (isset($prm["username"])) { $username = trim($prm["username"]); } $PLang = ""; if (isset($prm["PLang"])) { $PLang = trim($prm["PLang"]); } $sql = "call sp_rpt_t_hasil_so_elmd($PID,$PLang,'$username')"; // $sql = "call sp_rpt_t_hasil_so_xray('131769', '1', 'ADMIN')"; $qry = $this->db->query($sql); if (!$qry) { $this->db->trans_rollback(); $this->sys_error_db(["status" => "ERR", "message" => "error call sp_rpt_t_hasil_so_elmd | " . $this->db->error()["message"], "debug" => $this->db->last_query()]); exit; } else { $data = $qry->result_array(); $this->clean_mysqli_connection($this->db->conn_id); $this->sys_ok($data); } } }