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/modules/penyusutan/models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : D:/simbada/application/modules/penyusutan/models/penyusutan_model.php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Penyusutan_model extends Base_Model {

  var $fieldmap_daftar;
	var $fieldmap_filter;
  var $fieldmap_penyusutan;
  var $data_penyusutan;  

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

    $this->fieldmap_daftar = array(      
			'ID_MASTER_BARANG',   
      'KODE_MASTER_BARANG',     
			'NAMA_MASTER_BARANG',
			'MASA_MANFAAT'
		);

    $this->fieldmap_filter = array(          
      'kd_maba' => 'r.KODE_MASTER_BARANG',    
			'nm_maba' => 'r.NAMA_MASTER_BARANG',
      'penyusutan' => 'r.MASA_MANFAAT'
    );

    $this->fieldmap_penyusutan = array(
      'id' => 'ID_MASTER_BARANG',      
			'penyusutan' => 'MASA_MANFAAT'      
    );
  }

  function fill_data()
  {
    foreach($this->fieldmap_penyusutan as $key => $value){
      switch ($key){
        default : $$key = $this->input->post($key) ? $this->input->post($key) : NULL;
      }

      if(isset($$key))
        $this->data_penyusutan[$value] = $$key;
    }
  }

  // ----- search advance ---- >>
  function get_data_fields()
  {
    $fields = array(          
			'kd_maba' => array('name' => 'Kode Barang', 'kategori'=>'string'),         
			'nm_maba' => array('name' => 'Nama Barang', 'kategori'=>'string'),
			'penyusutan' => array('name' => 'Penyusutan', 'kategori'=>'string')
     );

    return $fields;
  }
	
  function update_master_barang()
  {
    $id = $this->data_penyusutan['ID_MASTER_BARANG'];

    $this->db->select('1')->from('MASTER_BARANG')->where('ID_MASTER_BARANG', $id);
    $rs = $this->db->get()->row_array();

    if ($rs)
    {     
      $this->db->where('ID_MASTER_BARANG', $id);
      $this->db->update('MASTER_BARANG', $this->data_penyusutan);
      $this->check_trans_status('UPDATE MASTER BARANG FAILED');
    }
		
    $this->id = $id;
  }

  function save_detail()
  {
    $this->update_master_barang();
  }

  function build_query_hapus($id=0)
  {
    //
  }
	
  function build_query_daftar()
  {
    $this->db->select("
			r.ID_MASTER_BARANG
			, r.KODE_MASTER_BARANG
			, r.NAMA_MASTER_BARANG
			, r.MASA_MANFAAT
    ");
    $this->db->from('MASTER_BARANG r');
		$this->db->where_not_in('r.JENIS_INVENTARIS', array('A', 'E'));
		
		if ($this->app_config['kelompok_penyusutan'] == 1) // Per Kelompok
		{
			$this->db->where('r.LEVEL_MASTER_BARANG', 3);
		}
		else if ($this->app_config['kelompok_penyusutan'] == 2) // Per Sub Kelompok
		{
			$this->db->where('r.LEVEL_MASTER_BARANG', 4);
		}
		else if ($this->app_config['kelompok_penyusutan'] == 3) // Tidak Ada
		{
			$this->db->where('r.LEVEL_MASTER_BARANG', 5);
		}		
  }

  function check_dependency($id)
  {
    return TRUE;
  }

  function cek_exist()
  {
    return TRUE;
  }

  function cek_changed()
  {
    return TRUE;
  }
}

Youez - 2016 - github.com/yon3zu
LinuXploit