<?php
class MDL_upload extends CI_Model
{
	function __construct()
    {
       $CI =& get_instance(); 
	 $CI->db = $CI->load->database('default', TRUE);
	 $CI->db_pasi = $CI->load->database('pasi', TRUE);
		
	}	
//Upload data master Raw Material
	function uploadrm_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_rm]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_rm_reff");
		$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 uploadrm_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_rm_reff");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
//Upload data master Bill Of Material / Standard Wire and Tube
	function uploadbom_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bom]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_bom");
		$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 uploadbom_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_bom");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
	
	//scrap in
	
	function uploadscrapin_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_scrap_in]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_scrap_in");
		$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 uploadscrapin_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_scrap_in");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}

	
//Upload data master Bukti Penerimaan Barang 	
	function uploadbpb_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bpb]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_bpb");
		$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 uploadbpb_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_bpb");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
//Upload data master Bukti Penerimaan Barang Jadi
	function uploadbpbj_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bpbj]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_bpbj");
		$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 uploadbpbj_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_bpbj");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
//Upload data master Export BC 27 (Antar Kawasan Berikat)
	function uploadbc27_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bc27]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_bc27");
		$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 uploadbc27_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_bc27");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}	
//Upload data Stock Opname
	function uploadsto_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_sto]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_sto");
		$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 uploadsto_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_sto");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}	
//Upload data Master Kode Barang
	function uploadbrg_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_brg]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_brg");
		$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 uploadbrg_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_brg");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
//Upload data Master Supplier
	function uploadspl_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_spl]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_spl");
		$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 uploadspl_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_spl");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
//Upload data Export BC 30
	function uploadbc30_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bc30]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_bc30");
		$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 uploadbc30_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_bc30");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
//Upload data Export BC 25
	function uploadbc25_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bc25]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_bc25");
		$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_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_bc25");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
	
	function uploadbc25_scrapall($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bc25_scrap]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_bc25_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_scrapcountAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_bc25_scrap");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}

	function uploadbc25_scrapmachineall($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bc25_scrapmesin]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_bc25_scrapmesin");
		$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_scrapmesincountAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_bc25_scrapmesin");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
	
	function uploadbpo_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bpo]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_bpo");
		$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 uploadbpo_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_bpo");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
	
	function uploadsfg_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_sfg]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]
			,[update_by]
			,[update_date]
		");
		$this->db_pasi->from("tbl_upload_sfg");
		$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 uploadsfg_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_sfg");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
	function uploadscrap_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_sto_scrap]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]
			,[update_by]
			,[update_date]
		");
		$this->db_pasi->from("[tbl_upload_sto_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 uploadscrap_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("[tbl_upload_sto_scrap]");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}

	//Upload data Export BC 41
	function uploadbc41_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bc41]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_bc41");
		$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_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_bc41");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}	

	//Upload data pengeluaran bahan baku
	function uploadbbout_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bbout]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]
			,[update_by]
			,[update_date]	
		");
		$this->db_pasi->from("[tbl_upload_bb_out]");
		$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 uploadbbout_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("[tbl_upload_bb_out]");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}

	//Upload data pengeluaran sparepart
	
	function uploadsparepartout_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_sparepartout]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]
			,[update_by]
			,[update_date]	
		");
		$this->db_pasi->from("[tbl_upload_sparepart_out]");
		$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 uploadsparepartout_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("[tbl_upload_sparepart_out]");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}

	//Upload data pengeluaran bahan penolong
	function uploadbpout_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bpout]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]
			,[update_by]
			,[update_date]	
		");
		$this->db_pasi->from("[tbl_upload_bp_out]");
		$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 uploadbpout_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("[tbl_upload_bp_out]");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}

	function uploadstockopnamerm_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_sto]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]
			,[update_by]
			,[update_date]	
		");
		$this->db_pasi->from("[tbl_upload_sto_rm]");
		$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 uploadstockopnamerm_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("[tbl_upload_sto_rm]");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}	
	
	function uploadstockopnamefg_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_sto_fg]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]
			,[update_by]
			,[update_date]	
		");
		$this->db_pasi->from("[tbl_upload_sto_fg]");
		$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 uploadstockopnamefg_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("[tbl_upload_sto_fg]");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}	

	function uploadstockopnamescrap_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_sto_scrap]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]
			,[update_by]
			,[update_date]	
		");
		$this->db_pasi->from("[tbl_upload_sto_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 uploadstockopnamescrap_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("[tbl_upload_sto_scrap]");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}	
	
	function uploadstockopnamemachine_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_sto_machine]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]
			,[update_by]
			,[update_date]	
		");
		$this->db_pasi->from("[tbl_upload_sto_machine]");
		$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 uploadstockopnamemachine_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("[tbl_upload_sto_machine]");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}	

	function uploadadjustmentrm_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_adj_rm]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]
			,[update_by]
			,[update_date]	
		");
		$this->db_pasi->from("[tbl_upload_adj_rm]");
		$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 uploadadjustmentrm_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("[tbl_upload_adj_rm]");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}

	function uploadadjustmentfg_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_adj_fg]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]
			,[update_by]
			,[update_date]	
		");
		$this->db_pasi->from("[tbl_upload_adj_fg]");
		$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 uploadadjustmentfg_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("[tbl_upload_adj_fg]");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}

	function uploadadjustmentscrap_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_adj_scrap]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]
			,[update_by]
			,[update_date]	
		");
		$this->db_pasi->from("[tbl_upload_adj_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 uploadadjustmentscrap_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("[tbl_upload_adj_scrap]");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}

	function uploadadjustmentmachine_all($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_adj_machine]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]
			,[update_by]
			,[update_date]	
		");
		$this->db_pasi->from("[tbl_upload_adj_machine]");
		$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 uploadadjustmentmachine_countAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("[tbl_upload_adj_machine]");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}	
	
	function uploadbc41_scrapall($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bc41_scrap]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_bc41_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_scrapcountAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_bc41_scrap");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}

	function uploadbc27_scrapall($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bc27_scrap]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_bc27_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 uploadbc27_scrapcountAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_bc27_scrap");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
	function uploadbc27_returnall($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("
			[id_upload_bc27_return]
			,[file_name]
			,[file_path]
			,[status]
			,[upload_by]
			,[upload_date]	
		");
		$this->db_pasi->from("tbl_upload_bc27_return");
		$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 uploadbc27_returncountAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_upload_bc27_return");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
	}
}

?>