<?php
class MDL_bc23 extends CI_Model
{
	function __construct()
    {
		$CI =& get_instance();
		$CI->db_pasi = $CI->load->database('pasi', TRUE);
		
	}
	
	function bc23hdrdataAll($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("[id_supplier]
				  ,[period]
				  ,[section_no]
				  ,[section_name]
				  ,[bpb_date]
				  ,[bpb_no]
				  ,[ri_no]
				  ,[ri_date]
				  ,[supp_do_no]
				  ,[supp_do_date]
				  ,[po_no]
				  ,[po_date]
				  ,[item_no]
				  ,[item_name]
				  ,[type]
				  ,[description]
				  ,[bpb_qty]
				  ,[unit]
				  ,[po_currency]
				  ,[po_amount]
				  ,[po_amount_usd]
				  ,[no_daftar]
				  ,[tgl_daftar]
				  ,[no_bc]
				  ,[tgl_bc]
				  ,[car]
				  ,[supplier]
			  ");
        $this->db_pasi->from("[tbl_supplier_01]");
        $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 bc23hdrdataCountAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_supplier_01");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
    }
	function bc27hdrdataAll($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("[id_supplier]
				  ,[period]
				  ,[section_no]
				  ,[section_name]
				  ,[bpb_date]
				  ,[bpb_no]
				  ,[ri_no]
				  ,[ri_date]
				  ,[supp_do_no]
				  ,[supp_do_date]
				  ,[po_no]
				  ,[po_date]
				  ,[item_no]
				  ,[item_name]
				  ,[type]
				  ,[description]
				  ,[bpb_qty]
				  ,[unit]
				  ,[po_currency]
				  ,[po_amount]
				  ,[po_amount_usd]
				  ,[no_daftar]
				  ,[tgl_daftar]
				  ,[no_bc]
				  ,[tgl_bc]
				  ,[car]
				  ,[supplier]
			  ");
        $this->db_pasi->from("[tbl_supplier_02]");
        $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 bc27hdrdataCountAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_supplier_02");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
    }
	function bc40hdrdataAll($limit,$start,$sidx,$sord, $where){
		$this->db_pasi->select("[id_supplier]
				  ,[period]
				  ,[section_no]
				  ,[section_name]
				  ,[bpb_date]
				  ,[bpb_no]
				  ,[ri_no]
				  ,[ri_date]
				  ,[supp_do_no]
				  ,[supp_do_date]
				  ,[po_no]
				  ,[po_date]
				  ,[item_no]
				  ,[item_name]
				  ,[type]
				  ,[description]
				  ,[bpb_qty]
				  ,[unit]
				  ,[po_currency]
				  ,[po_amount]
				  ,[po_amount_usd]
				  ,[no_daftar]
				  ,[tgl_daftar]
				  ,[no_bc]
				  ,[tgl_bc]
				  ,[car]
				  ,[supplier]
			  ");
        $this->db_pasi->from("[tbl_supplier_03]");
        $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 bc40hdrdataCountAll($where){
		$this->db_pasi->select("*");
        $this->db_pasi->from("tbl_supplier_03");
        $this->db_pasi->where($where);
        $result = $this->db_pasi->count_all_results(); 
        //die($this->db_pasi->last_query());
        return $result;
    }	
	

}