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 :  /wamp/www/sipkd_2019_test/application/modules/setting/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /wamp/www/sipkd_2019_test/application/modules/setting/models/setting_model.php
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Setting_model extends Base_Model {

  var $tahun;
  var $status;
  var $ppkd;
  var $mode;
  var $autosave;
  var $autologout;
  var $sppbast;
  var $sppgupajak;
  var $sppuppagu;
  var $spptu;
  var $spdmode;
  var $pbsp2d;
  var $autobku;
  var $no_bku_bersambung;
  var $no_bku_skpd_bersambung;
  var $exp_pass;

  function __construct()
  {
    // Call the Model constructor
    parent::__construct();

  }

  function fill_data()
  {
    $this->tahun = $this->input->post('tahun') ? $this->input->post('tahun') : 0;
    $this->status = $this->input->post('status') ? $this->input->post('status') : '';
    $this->ppkd = $this->input->post('ppkd') ? $this->input->post('ppkd') : 0;
    $this->autosave = $this->input->post('autosave') ? $this->input->post('autosave') : 0;
    $this->autologout = $this->input->post('autologout') ? $this->input->post('autologout') : 0;
    $this->sppbast = $this->input->post('sppbast') == 'true' ? 1 : 0;
    $this->sppgupajak = $this->input->post('sppgupajak') == 'true' ? 1 : 0;
    $this->sppuppagu = $this->input->post('sppuppagu') == 'true' ? 1 : 0;
    $this->sppup = $this->input->post('sppup') ? (int) $this->input->post('sppup') : 0;
    $this->spptu = $this->input->post('spptu') ? (int) $this->input->post('spptu') : 0;
    $this->spdmode = $this->input->post('spdmode') ? (int) $this->input->post('spdmode') : 0;
    $this->pbsp2d = $this->input->post('pbsp2d') == 'true' ? 1 : 0;
    $this->autobku = $this->input->post('autobku')  == 'true' ? 1 : 0;
    $this->no_bku_bersambung = $this->input->post('no_bku_bersambung') == 'true' ? 1 : 0;
    $this->no_bku_skpd_bersambung = $this->input->post('no_bku_skpd_bersambung') == 'true' ? 1 : 0;
    $this->exp_pass = $this->input->post('exp_pass') ? $this->input->post('exp_pass') : 0;
    $this->sp2d_dp = $this->input->post('sp2d_dp') ? (int) $this->input->post('sp2d_dp') : 0;
  }

  function get_setting()
  {
    /* skpd sebagai ppkd ada di tabel konfigurasi */
    $this->db->select('first 1 a.id_skpd, b.kode_skpd_lkp, b.nama_skpd')
          ->from('skpd a')
          ->join('v_skpd b', 'b.id_skpd = a.id_skpd')
          ->where('a.is_ppkd <>', '0');
    $result = $this->db->get()->row_array();

    $this->db->select('first 1 *')
          ->from($this->app_config_table);
    $result2 = $this->db->get()->row_array();

    return array(
      'tahun' => $this->app_config['tahun'],
      'status' => $this->app_config['status'],
      'ppkd' => isset($result['ID_SKPD']) ? $result['ID_SKPD'] : 0,
      'kd_skpd' => isset($result['KODE_SKPD_LKP']) ? $result['KODE_SKPD_LKP'] : 0,
      'nm_skpd' => isset($result['NAMA_SKPD']) ? $result['NAMA_SKPD'] : 0,
      'auto_save' => isset($result2['AUTO_SAVE']) ? $result2['AUTO_SAVE'] : 0,
      'auto_logout' => isset($result2['AUTO_LOGOUT']) ? $result2['AUTO_LOGOUT'] : 0,
      'sppbast' => isset($result2['SPP_PAKAI_BAST']) && $result2['SPP_PAKAI_BAST'] == 1 ? TRUE : FALSE,
      'sppgupajak' => isset($result2['SPP_GU_PAJAK']) && $result2['SPP_GU_PAJAK'] == 1 ? TRUE : FALSE,
      'sppuppagu' => isset($result2['SPP_UP_SERAP_PAGU']) && $result2['SPP_UP_SERAP_PAGU'] == 1 ? TRUE : FALSE,
      'sppup' => isset($result2['SPP_UP']) ? $result2['SPP_UP'] : 2,  // default SPP UP Global
      'spptu' => isset($result2['SPP_TU']) ? $result2['SPP_TU'] : 0,  // default SPP TU Rinci
      'spdmode' => isset($result2['SPD_MODE']) ? $result2['SPD_MODE'] : 0,
      'pb_sp2d' => isset($result2['PB_SP2D']) && $result2['PB_SP2D'] == 1 ? TRUE : FALSE,
      'autobku' => isset($result2['BKU_AUTO']) && $result2['BKU_AUTO'] == 1 ? TRUE : FALSE,
      'no_bku_bersambung' => isset($result2['NO_BKU_BERSAMBUNG']) && $result2['NO_BKU_BERSAMBUNG'] == 1 ? TRUE : FALSE,
      'no_bku_skpd_bersambung' => isset($result2['NO_BKU_SKPD_BERSAMBUNG']) && $result2['NO_BKU_SKPD_BERSAMBUNG'] == 1 ? TRUE : FALSE,
      'password_expired' => isset($result2['PASSWORD_EXPIRED']) ? $result2['PASSWORD_EXPIRED'] : 0,
      'sp2d_dp' => isset($result2['CETAK_SP2D_DP']) ? $result2['CETAK_SP2D_DP'] : 0,
    );
  }

  function save_setting()
  {
    $this->db->trans_begin();
    try {
      // update ppkd skpd
      $this->db->set('is_ppkd', '0')->where('is_ppkd <>',  '0')->update('skpd');
      $this->db->set('is_ppkd', '1')->where('id_skpd', $this->ppkd)->update('skpd');
      $this->check_trans_status('update ppkd skpd failed');
      $data = array(
        'AUTO_SAVE' => $this->autosave,
        'AUTO_LOGOUT' => $this->autologout,
        'SPP_PAKAI_BAST' => $this->sppbast,
        'SPP_GU_PAJAK' => $this->sppgupajak,
        'SPP_UP_SERAP_PAGU' => $this->sppuppagu,
        'SPP_UP' => $this->sppup,
        'SPP_TU' => $this->spptu,
        'SPD_MODE' => $this->spdmode,
        'PB_SP2D' => $this->pbsp2d,
        'BKU_AUTO' => $this->autobku,
        'NO_BKU_BERSAMBUNG' => $this->no_bku_bersambung,
        'NO_BKU_SKPD_BERSAMBUNG' => $this->no_bku_skpd_bersambung,
        'PASSWORD_EXPIRED' => $this->exp_pass,
        'CETAK_SP2D_DP' => $this->sp2d_dp,
      );
      $this->db->set($data)->update($this->app_config_table);
      $this->check_trans_status('update konfigurasi failed');
    }
    catch(Exception $e){
      //TODO : log error to file
    }

    if ($this->db->trans_status() === FALSE)
    {
      $this->id = NULL;
      $this->last_error_id = $this->db->_error_number();
      $this->last_error_message = $this->db->_error_message();
      $this->db->trans_rollback();
      return FALSE;
    }

    $this->save_config();

    return TRUE;
  }


  function save_config()
  {
    $config_file = @file_get_contents($this->app_config_file);

    $config = array(
      'tahun' => $this->tahun,
      'status' => $this->status,
    );
    foreach($config as $key => $val)
    {
      $val = '\''.$val.'\'';
      $pattern = '%(config\[\''.$key.'\'\] = )(\'?.*\'?)(;)%';
      $config_file = preg_replace($pattern, '${1}'.$val. '${3}', $config_file );
    }
    $ret = @file_put_contents($this->app_config_file, $config_file);
    if ( !$ret)
    {
      return FALSE;
    }
    return TRUE;
  }

}

Youez - 2016 - github.com/yon3zu
LinuXploit