<?php
class MDL_inventory_control extends CI_Model
{	
	
	function __construct()
    {
        parent::__construct();
		
	}
	
	function tbl_upload_inventory_control_All($limit,$start,$sidx,$sord, $where){
		$this->db->select("
		 [id]
      	   ,convert(varchar(10),[date_upload],126) as date_upload
      ,[filename]
      ,[tipe]
      ,[filepath]
      ,[status_upload]
       ,convert(varchar(10),[create_date],126) as create_date
      ,[create_by]
       ,convert(varchar(10),[update_date],126) as update_date
      ,[update_by]
		");
		$this->db->from("[tbl_upload_inventory_control]");
        $this->db->where($where);
        $this->db->limit($limit,$start);
        $this->db->order_by($sidx,$sord);
        $result = $this->db->get()->result(); 
        //die($this->db->last_query());
        return $result;
	
	}
	
	function tbl_upload_inventory_control_CountAll($where){
	
		$this->db->select("*");
        $this->db->from("[tbl_upload_inventory_control]");
        $this->db->where($where);
        $result = $this->db->count_all_results(); 
        return $result;
	
	
	}
	
	function tbl_inventory_control_All($limit,$start,$sidx,$sord, $where){
		$this->db->select("
		[id_inventory_control]
      ,[tgl]
      ,[amount]
      ,[jenis]
	   ,[title]
	   ,periode
		");
		$this->db->from("[tbl_inventory_control]");
        $this->db->where($where);
        $this->db->limit($limit,$start);
        $this->db->order_by($sidx,$sord);
        $result = $this->db->get()->result(); 
        //die($this->db->last_query());
        return $result;
	
	}
	
	function tbl_inventory_control_CountAll($where){
	
		$this->db->select("*");
        $this->db->from("[tbl_inventory_control]");
        $this->db->where($where);
        $result = $this->db->count_all_results(); 
        return $result;
	
	
	}
	
	
	
}
	