}
else {
$this->openPage = 1;
$this->query .= " LIMIT 0,$this->resultPerPage";
}
$this->resultpage = mysql_query($this->query);
}
/*
@param - 总记录数
@param -
每页记录数
*/
function findPages($total,$perpage)
{
$pages = intval($total/$perpage);
if($total%$perpage > 0) $pages++;
return $pages;
}
/*
显示分页
*/
function displayPaging()
{
$self = $_SERVER['PHP_SELF'];
if($this->openPage<=0) {
$next = 2;
}
else {
$next = $this->openPage+1;
}
$prev = $this->openPage-1;
$last = $this->pages;
if($this->openPage > 1) {
echo "<a href=$self?page=1>First</a> ";
echo "<a href=$self?page=$prev>Prev</a> ";
}
else {
echo "First ";
echo "Prev ";
}
for($i=1;$i<=$this->pages;$i++) {
if($i == $this->openPage)