<?php
class TagsModel extends CmlModel {
	public function addtags($tagname,$seotag){
		$tagok=$this->db()->set('tags', array('tag'=>$tagname,'seotag'=>$seotag),true);
		$this->cache()->delete('tagsall');
		return $tagok;
	}
		
	public function edittags($id){
		$tagdata=$this->db()->get('tags-id-'.$id);
		return $tagdata;
	}
	
	public function edittagssave($id,$tagname,$seotag){
		$tagok=$this->db()->update('tags-id-'.$id, array('tag'=>$tagname,'seotag'=>$seotag),true);
		$this->cache()->delete('tagsall');
		return $tagok;
	}
	
	public function deltags($id){
		$tagok=$this->db()->delete('tags-id-'.$id);
		$this->cache()->delete('tagsall');
		return $tagok;
	}
	
	public function indextags(){
		$tagdata=$this->db()->table('tags')->orderBy('id', 'ASC')->select();
		return $tagdata;
	}
	//»ÃµÆÉèÖÃ
	public function indexslide(){
		$slidedata=$this->db()->table('slide')->orderBy('id', 'ASC')->select();
		return $slidedata;
	}
	public function slidesave($id,$title,$imgurl,$url,$info){
		$slideok=$this->db()->update('slide-id-'.$id, array('title'=>$title,'imgurl'=>$imgurl,'url'=>$url,'info'=>$info),true);
		$this->cache()->delete('slide');
		return $slideok;
	}
	
}