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

class Language extends CI_Model{
	
	public function language_all(){
		$this->db->order_by('code');
		$query = $this->db->get('_ref_language');
		if($query->num_rows() >= 1){
			return $query->result();
		}else{
			return FALSE;
		}
	}

	public function language_save($ID, $data){
		$this->db->where('ID', $ID);
		$query = $this->db->update('_ref_language', $data); 
		if($query === TRUE){
			return TRUE;
		} else {
			return FALSE;
		}
	}
	
	public function language_delete($ID){
		$this->db->where('ID', $ID);
		$query = $this->db->delete('_ref_language'); 
		if($query === TRUE){
			return TRUE;
		} else {
			return FALSE;
		}
	}
	
}