<?php 
/**
* @用户信息函数类
*/
class getbook extends hon6mysql {
		public function __construct($path =''){
				parent::mysql_link();
		}
		/**/
		public function getbook($limit,$where,$order){
				$limit = isset($limit)?(" limit 0,".intval($limit)):"";
				$where = isset($where)?(" where ".$where." "):(" ");
				$order = isset($order)?(" order by  ".$order." "):(" ");
				$this->booklist = $this->query_array("select * from ".JIEQI_DB_PREFIX."_article_article".$where.$order.$limit);
				return $this->booklist;
		}
		public function getbookdate($str,$articleid){
				$articleid = isset($articleid)?intval($articleid):0;
				$this->articledate = $this->query_field("select ".$str." from ".JIEQI_DB_PREFIX."_article_article where articleid=".$articleid);
				return $this->articledate;
		}
		public function CheckAdmin($bid,$userid,$back){
				$bid = isset($bid)?intval($bid):0;
				$userid = isset($userid)?intval($userid):0;
				$this->result = 0;//初始化为非管理员
				if($userid != 0){
						if($this->getbookdate("agentid",$bid) == $userid){
								$this->result = 1;//管理员
						}
						$this->groupid = $this->query_field("select groupid from ".JIEQI_DB_PREFIX."_system_users where uid=".$userid);
						if($this->groupid == 2 or $this->groupid == 10){
								$this->result = 1;//管理员
						}
				}else{
						$this->result = 0;
				}
				if($back == "1"){
						if($this->result==0 or $this->result==""){
								return false;
						}else{
								return true;
						}
				}else{
						return $this->result;
				}
		}
}
?>