<?php
class SitenavModel extends CmlModel {
	//Ìí¼Ó
	public function addnav($link,$linkname,$linkclass){
		$navok=$this->db()->set('nav', array('link'=>$link,'linkname'=>$linkname,'linkclass'=>$linkclass),true);
		$this->cache()->delete('navall');
		return $navok;
	}
	//ÐÞ¸Ä
	public function editnav($navid,$navcid,$link,$linkname,$linkclass){
		$navok=$this->db()->update('nav-id-'.$navid, array('cid'=>$navcid,'link'=>$link,'linkname'=>$linkname,'linkclass'=>$linkclass),true);
		$this->cache()->delete('navall');
		return $navok;
	}
	//É¾³ý
	public function delnav($navid){
		$navok=$this->db()->delete('nav-id-'.$navid);
		$this->cache()->delete('navall');
		return $navok;
	}
	//ÏÔÊ¾
	public function indexnav(){
		$navdata=$this->db()->table('nav')->orderBy('cid', 'DESC')->select();
		return $navdata;
	}
	
}