| Server IP : 127.0.0.1 / Your IP : 192.168.99.1 Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9 System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64 User : Administrator ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /wamp/www/sipapbd_2020_integrasi_1/application/modules/sp2d/controllers/ |
Upload File : |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Sp2d extends Aktivitas_Controller {
public function __construct()
{
parent::__construct();
$this->modul_name = 'sp2d';
$this->modul_display = 'SP2D';
$this->view_form = 'sp2d_form';
$this->view_daftar = 'sp2d_view';
$this->report_daftar = 'Daftar SP2D';
$this->report_form = 'Form SP2D';
$this->load->model('Sp2d_model','data_model');
$this->message_aktivitas_dihapus = 'SP2D telah dihapus.';
$this->message_aktivitas_gagal_dihapus = 'SP2D telah dicairkan, tidak bisa dihapus.';
}
function validasi()
{
$this->form_validation->set_rules('kaskpd', 'Kepala SKPD', 'trim|integer');
/* cek spp, hanya boleh digunakan di spm sekali */
//$this->form_validation->set_rules('id_spm', 'SPM', 'trim|callback__cek_spm');
$this->form_validation->set_message('_cek_spm', '%s sudah dipakai di SP2D lain.');
}
public function _cek_spm()
{
$id = $this->input->post('id') ? $this->input->post('id') : 0;
$id_spm = $this->input->post('id_spm') ? $this->input->post('id_spm') : 0;
return !$this->data_model->cek_spm($id, $id_spm);
}
function _cek_bku()
{
// lakukan pengecekan bku hanya untuk SP2D yang sudah disimpan
// return TRUE jika sudah masuk BKU
$id = (int) $this->input->post('id');
if ($id != 0) return $this->data_model->check_bku($id);
else return FALSE;
}
function get_extra_data($id)
{
$extra = array();
$extra['spp_up'] = $this->session->userdata('konf_spp_up');
$extra['spp_tu'] = $this->session->userdata('konf_spp_tu');
$extra['sp2d_dp'] = $this->session->userdata('konf_cetak_sp2d_dp');
return $extra;
}
protected function extra_message()
{
return array(
'id_bku' => $this->data_model->id_bku,
'no_bku' => $this->data_model->no_bku
);
}
function spm($id=0)
{
$result = $this->data_model->get_spm_by_id($id);
$response = (object) NULL;
if ($result){
$response->id_spp = $result['ID_SPP'];
$response->id_spm = $result['ID_AKTIVITAS'];
$response->no_spm = $result['NOMOR'];
$response->tgl_spm = format_date($result['TANGGAL']);
$response->tgl_spm_veri = format_date($result['TANGGAL_VERIFIKASI']);
$response->nominal = $result['NOMINAL'];
$response->deskripsi = $result['DESKRIPSI'];
$response->id_skpd = $result['ID_SKPD'];
$response->kd_skpd = $result['KODE_SKPD_LKP'];
$response->nm_skpd = $result['NAMA_SKPD'];
$response->beban = $result['BEBAN'];
$response->jenis_beban = $result['JENIS_BEBAN'];
$response->keperluan = $result['KEPERLUAN'];
$response->penerima = $result['NAMA_PENERIMA'];
$response->bank = $result['NAMA_BANK'];
$response->norek = $result['NO_REKENING_BANK'];
$response->bast = $result['NO_BAST'];
$response->npwp = $result['NPWP'];
$response->no_dpa = $result['NO_DPA'];
$response->tgl_dpa = format_date($result['TANGGAL_DPA']);
$response->pagu_dpa = $result['PAGU_DPA'];
$response->id_pekas = $result['ID_REKENING_PEKAS'];
$response->kd_pekas = $result['KODE_REKENING_PEKAS'];
$response->nm_pekas = $result['NAMA_REKENING_PEKAS'];
$response->kaskpd = $result['ID_KASKPD'];
$response->nm_kaskpd = $result['KASKPD_NAMA'];
$response->bk = $result['ID_BK'];
$response->nm_bk = $result['BK_NAMA'];
$response->nominal = $result['NOMINAL'];
}
echo json_encode($response);
}
public function sisa_skpd()
{
$param = array(
'id_skpd' => $this->input->post('id_skpd') ? $this->input->post('id_skpd') : 0,
'beban' => $this->input->post('beban') ? $this->input->post('beban') : '',
'keperluan' => $this->input->post('keperluan') ? $this->input->post('keperluan') : '',
'tanggal' => $this->input->post('tanggal') ? $this->input->post('tanggal') : '',
'id' => $this->input->post('id') ? $this->input->post('id') : 0,
'arrspd' => $this->input->post('arrspd') ? $this->input->post('arrspd') : 0,
);
if ($param['keperluan'] === 'PP')
{
$sisa_gu = 0;
$sisa_tu = 0;
$label = 'Sisa STS';
}
else
{
if ($param['keperluan'] === 'GU NIHIL')
{
$sisa_gu = 0;
$sisa_tu = 0;
$label = 'UP yang dinihilkan';
}
else
{
$sisa_gu = $this->data_model->get_sisa_spj($param, 'UP');
$sisa_tu = $this->data_model->get_sisa_spj($param, 'TU');
$label = 'Sisa SPD + CP + SSU';
}
}
$response = (object) NULL;
$response = array(
'lbl_sisa_pagu' => $label,
'sisa_gu' => $sisa_gu,
'sisa_tu' => $sisa_tu,
'sql' => $this->db->queries,
);
echo json_encode($response);
}
}