<?php 
class Default_Model extends Model{
	function __construct(){
		parent::__construct();
	}
	function getDefVals($typeid=0){
		if($typeid>0){
			$this->db->where("default_id",$typeid);
		}
		return $this->db->get("model_defvaltype");
	}
	function UpDefault($defaultid,$default){
		return $this->db->where("default_id",$defaultid)->update("model_defvaltype",$default);
	}
	function delete($defaultid){
		return $this->db->in("default_id",$defaultid)->delete("model_defvaltype");
	}
	function add($data){
		return $this->db->insert("model_defvaltype",$data);
	}
	function typeGet($type){
		return $this->db->where("default_type",$type)->get("model_defvaltype")->current();
	}
}