function PageList($base_url,$num_items,$per_page,$start_item,$PageColor)
{
$total_pages = ceil($num_items/$per_page);
$on_page = floor($start_item / $per_page) + 1;
$page_string="<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td height=12></td></tr>";
$page_string.="<tr><td align=center height=30><font color=#343434>";
$page_string.="共 <font color=".$PageColor.">".$num_items."</font> 条信息 第 <font color=".$PageColor.">".$on_page."</font> 页 / 共 <font color=".$PageColor.">".$total_pages."</font> 页 ";
$page_string.="</td></tr><tr><td align=center><font color=#343434>";
//定义“首页”和“上一页”连接
if ($on_page > 1)
{
$page_string.="<A HREF='" . $base_url . "&StartPage=0'>[首页]</A> <a href='".$base_url."&StartPage=".(($on_page-2 )*$per_page)."'>[上一页]</a> ";
}else{
$page_string.="<span disabled>[首页] [上一页]</span> ";
}
//定义页码连接
if ($on_page<5) { $i_num=1;$i_max=10;} else{ $i_num=$on_page-4;$i_max=$on_page+5;}
for($i=$i_num;$i<$i_max;$i++){
$page_nums=($i-1)*$per_page;
if ($page_nums>=$total_pages){
continue;
}
if ($i==$on_page){
$page_string.=$i." ";
}else{
$page_string.="<a href='".$base_url."&StartPage=".$page_nums."'>[".$i."]</a> ";
}
}
//定义“尾页”和“下一页”连接
if ($on_page < $total_pages)
{
$page_string.="<a href=".$base_url."&StartPage=".($on_page * $per_page).">[下一页]</a> <A HREF=".$base_url."&StartPage=".(($total_pages-1)* $per_page).">[尾页]</A>";
}else{
$page_string.="<span disabled>[下一页] [尾页]<span>";
}
$page_string.="</td></tr></table>";
return $page_string;
}