<?php
class MDL_upload_new extends CI_Model
{
	function __construct() {
		$CI =& get_instance(); 
		$CI->db = $CI->load->database('default', TRUE);
		$CI->db_pasi = $CI->load->database('pasi', TRUE);
		
	}	
	
	function uploadbc25_scrap_newall($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id],
			[orig_name],
			[NOMOR_AJU],
			[username],
			[createdate]
			
		");
		$this->db_pasi->from("view_upload_scrap");
		$this->db_pasi->where($where);
		$this->db_pasi->limit($limit,$start);
        $this->db_pasi->order_by($sidx,$sord);
        $result = $this->db_pasi->get()->result();
		//die($this->db_pasi->last_query());	
        return $result;
	
	}
	
	function uploadbc25_scrap_newcountAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("view_upload_scrap");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
	
	function get_supplier(){
		$this->db_pasi->select("
			[id_master_supp_code],
			[suppno],
			[suppname]
			
		");
		$this->db_pasi->from("tbl_master_supplier_code");
        $result = $this->db_pasi->get()->result();
		//die($this->db_pasi->last_query());	
        return $result;
	
	}
	
	function uploadbc41_scrap_newall($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id],
			[orig_name],
			[NOMOR_AJU],
			[username],
			[createdate]
			
		");
		$this->db_pasi->from("view_upload_scrap");
		$this->db_pasi->where($where);
		$this->db_pasi->limit($limit,$start);
        $this->db_pasi->order_by($sidx,$sord);
        $result = $this->db_pasi->get()->result();
		//die($this->db_pasi->last_query());	
        return $result;
	
	}
	
	function uploadbc41_scrap_newcountAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("view_upload_scrap");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
	
}

?>