<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Loan_model extends CI_Model{
	
	public function chartOfAcctLoan_all(){
		$this->db->select('*');
		$this->db->select('CONCAT(substr(acctCode,1,4),"-", substr(acctCode,5,3),"-", substr(acctCode,8,2)) as acctCode', false);
	    $this->db->where('acctCode >', 370000000);
		$this->db->where('acctGroupID', 4);
	    $this->db->where('companyID', element('compID', $this->session->userdata('logged_in')));
		$this->db->from('comp_chart_of_acct');
		$query = $this->db->get();
		if($query->num_rows() >= 1){
			return $query->result();
		}else{
			return false;
		}
	}
	
	public function updateLoan($table, $updateuser, $ID){
		$this->db->where('ID', $ID);
		$query = $this->db->update($table, $updateuser); 
		if($query === TRUE){
			return TRUE;
		} else {
			return FALSE;
		}
	}

}

/* End of file company_info_model.php */
/* Location: ./application/model/company/company_info_model.php */
/* Created : Fadhirul Hilmi edited 26/5/2014 */
