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_2020_perubahan/SSHLumajang/application/modules/setting/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : D:/wamp/www/sipapbd_2020_perubahan/SSHLumajang/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 $lokasi;
  var $sumberdana;
  var $ppkd;
  var $mode;

  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->lokasi = ($this->input->post('lokasi')=='true') ? 1 : 0;
    $this->sumberdana = $this->input->post('sumberdana');
    $this->exp_pass = $this->input->post('exp_pass') ? $this->input->post('exp_pass') : 0;
		$this->anggaran_kas = $this->input->post('anggaran_kas')?$this->input->post('anggaran_kas'):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'],
      'lokasi' => $this->app_config['lokasi'],
      '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,
      'password_expired' => isset($result2['PASSWORD_EXPIRED']) ? $result2['PASSWORD_EXPIRED'] : 0,
      'sumberdana' => isset($result2['SUMBER_DANA_RKA']) ? $result2['SUMBER_DANA_RKA'] : 0,
			'anggaran_kas' => $this->app_config['anggaran_kas'],
    );
  }

  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,
        'PASSWORD_EXPIRED' => $this->exp_pass,
        'SUMBER_DANA_RKA' => $this->sumberdana
      );
      $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,
      'lokasi' => $this->lokasi
    );
    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