<?php
class noticeModel extends model{
	public $base;
	function __construct(&$base){
		parent::__construct($base);
		$this->base=$base;
		$this->table="notice";
		$this->table_all="notice_all";		
	}
	
	public function sendNotice($data){
		$data['id']=$this->setTable("notice_10")->insert($data);
		$this->setTable("notice",$data['userid'])->insert($data);
		return $data['id'];
	}
	
	public function deleteNotice($userid,$id){
		$data=$this->setTable("notice",$userid)->selectRow(array("where"=>"id=$id"));
		if($data['userid']==$userid){
			$this->setTable("notice_10")->delete("id=$id");
			$this->setTable("notice")->delete("id=$id");
		}
	}
}

?>