=strlen($string)) return $string; for($i=0; $i<$length; $i++) if (ord($string[$i]) > 128) $i++; return substr($string,0,$i).'..'; } //分页 function page_1($pagesql,$page=1,$pagesize=10){ $page=(int)$page<1?1:$page; $result=mysql_query($pagesql); @$numrows=mysql_num_rows($result); $url=basename($HTTP_SERVER_VARS['PHP_SELF']).'?'.$_SERVER['QUERY_STRING']; $url=preg_replace('/[&]?page=[\w]*[&]?/i','',$url); $pages=$numrows%$pagesize==0?$numrows/$pagesize:(int)($numrows/$pagesize)+1; if($pages==0 or $pages=="") return; $pagestr=''; if($page>$pages){ echo ""; return; } $first=1; $prev=$page-1; $next=$page+1; $last=$pages; if($page>$pages){ echo ""; return; } $pagestr=$pagestr."每页".$pagesize."条/共".$numrows."条 第".$page."页/共".$pages."页"; if ($page==1){ $pagestr=$pagestr." 【首页】"; $pagestr=$pagestr." 【上一页】"; } if ($page>1){ $pagestr=$pagestr." 【首页】"; $pagestr=$pagestr." 【上一页】"; } if ($page==$pages){ $pagestr=$pagestr." 【下一页】"; $pagestr=$pagestr." 【末页】"; } if ($page<$pages){ $pagestr=$pagestr." 【下一页】"; $pagestr=$pagestr." 【末页】"; } $pagestr=$pagestr."转到 "; return $pagestr; } //分页 function page_2($pagesql,$page=1,$pagesize=10){ $page=(int)$page<1?1:$page; $result=mysql_query($pagesql); $numrows=mysql_num_rows($result); $url=basename($HTTP_SERVER_VARS['PHP_SELF']).'?'.$_SERVER['QUERY_STRING']; $url=preg_replace('/[&]?page=[\w]*[&]?/i','',$url); $pages=$numrows%$pagesize==0?$numrows/$pagesize:(int)($numrows/$pagesize)+1; if($pages==0 or $pages=="") return; $pagestr=''; if($page>$pages){ echo ""; return; } $first=1; $prev=$page-1; $next=$page+1; $last=$pages; if($page>$pages){ echo ""; return; } $pagestr=$pagestr."每页".$pagesize."条/共".$numrows."条 "; if ($page==1){ $pagestr=$pagestr." 【首页】"; $pagestr=$pagestr." 【上一页】"; } if ($page>1){ $pagestr=$pagestr." 【首页】"; $pagestr=$pagestr." 【上一页】"; } for($p=1;$p<$pages+1;$p++) { if($page==$p) { $str="[".$p."] "; } else { $str="[".$p."]"; } $pagestr=$pagestr."".$str.""; } if ($page==$pages){ $pagestr=$pagestr." 【下一页】"; $pagestr=$pagestr." 【末页】"; } if ($page<$pages){ $pagestr=$pagestr." 【下一页】"; $pagestr=$pagestr." 【末页】"; } return $pagestr; } ?> 安徽安科余良卿药业有限公司
精工良药 福泽百姓
余良卿故事

Yu Liangqing's Story


    Fatal error: Call to undefined function page_1() in /webHome/host8170497/www/wh_more.php on line 117