ÌôÕ½×î°ôµÄÁôÑÔ±¾µÄÔ´Â루Î壩

5年以前  |  阅读数:357 次  |  编程语言:PHP 
ÁoÑÔ±¾

ÁoÑÔÐÅÏ¢

<?php
require('config.php');
?>

<?php

$initial_record=0;
$sort_field='key_liuyan';
$sort_direction='DESC';

if (strlen($arr_request['initial_record']))
{
$initial_record=$arr_request['initial_record'];
$sort_field=$arr_request['sort_field'];
$sort_direction=$arr_request['sort_direction'];

}

$str_sql_all="select count(*) as number_of_records from $table_name ";

$result=mysql_db_query($db_name,$str_sql_all,$id_link);

if (!result)
{ affy_error_exit('SQL select execution has failed.');}

$record=@mysql_fetch_object($result);

$number_of_records=$record->number_of_records;

if (strlen($sort_field)==0)
{
$str_sql="select * from $table_name
limit $initial_record,$number_records_to_display ";

}

else
{

$str_sql="select * from $table_name order by $sort_field $sort_direction
limit $initial_record,$number_records_to_display ";
}

$result=mysql_db_query($db_name,$str_sql,$id_link);

if (!$result)
{ affy_error_exit('SQL select execution has failed.');}

$number_of_records_on_current_page=@mysql_num_rows($result);

if ($number_of_records<1)
{ echo '

±iÖÐûÓÐÊý¾Ý!

';}
else
{
$next_index=$initial_record+$number_records_to_display;

if ($next_index>$number_of_records)   
     $next_index=$number_of_records;   



$prev_index=$initial_record-$number_records_to_display;   

if ($prev_index<0)   
   {   
      $prev_index=0;   
   }    

}

echo "

";
echo "
";

if ($initial_record!=0)
{
$t1="initial_record=$prev_index";
$sort="sort_field=$sort_field";
$asc="sort_direction=$sort_direction";
echo "";
echo "<<Ç° $number_records_to_display ÌoÁoÑÔ
";

}

else
{
echo "|Ç°ÃaeûÓÐÁoÑÔÁË";

}

echo "

";

$t2=$initial_record+1;   

echo "±¾Ò³ÏÔʾµÚ <font color=green>$t2</font> µ½ <font color=green>$next_index</font>   

ÌoÁoÑÔ,¹²$number_of_recordsÌoÁoÑÔ";

echo "

";

if ($next_index!=$number_of_records)

{
$t1="initial_record=$next_index";
$sort="sort_field=$sort_field";
$asc="sort_direction=$sort_direction";
echo " ";
echo "ºo $number_records_to_display ÌoÁoÑÔ>>
";
}
else
{
echo "ºoÃaeûÓÐÁoÑÔÁË|";

}

echo "

";
echo "

";

?>

[ÎÒÒ²ÒªÁoÑÔ]

<table border="0",width="95%" cellspacing="0" cellpadding="0">
<?php
for ($iindex=0;$iindex<$number_of_records_on_current_page;$iindex++)
{
$record=mysql_fetch_object($result);
require('display.inc');
}

?>

"; echo "

"; echo "תµ½µÚ";

if (($number_of_records % $number_records_to_display)==0)
{
$number_of_pages=$number_of_records / $number_records_to_display;

}

else
{
$number_of_pages=($number_of_records-($number_of_records % $number_records_to_display))/$number_records_to_display+1;

}

 $sort="sort_field=$sort_field";   
 $asc="sort_direction=$sort_direction";   

for ($ii=1;$ii<=$number_of_pages;$ii++)

{
$yeshu=($ii-1)*$number_records_to_display ;
$t1="initial_record=$yeshu ";

 if ($initial_record!=$yeshu)   
   {   

     echo "<a href="$PHP_SELF?$asc&$sort&$t1 ">";   
     echo "[ $ii ]</a>";   
   }   
 else   
     echo "[ $ii ]";   

}

echo "Ò³ ¹² $number_of_pages Ò³";
echo "

";
echo "

";

?>


Ãa*ÑÁoÑÔ±¾ÓÉСÐÜÌa¹(C)¼¼ÊoÖ§³Ö

¡¾±¾ÎÄ°aeȨ¹e×÷ÕßÓe°ÂË÷Íø¹²Í¬ÓµÓУ¬ÈçÐeתÔØ£¬Çe×¢Ã÷×÷Õß¼°³o´¦¡¿

 相关文章:
PHP分页显示制作详细讲解
SSH 登录失败:Host key verification failed
获取IMSI
将二进制数据转为16进制以便显示
获取IMEI
文件下载
贪吃蛇
双位运算符
PHP自定义函数获取搜索引擎来源关键字的方法
Java生成UUID
发送邮件
年的日历图
提取后缀名
在Zeus Web Server中安装PHP语言支持
让你成为最历害的git提交人
Yii2汉字转拼音类的实例代码
再谈PHP中单双引号的区别详解
指定应用ID以获取对应的应用名称
Python 2与Python 3版本和编码的对比
php封装的page分页类完整实例