打印本文 打印本文  关闭窗口 关闭窗口
一个程序下载的管理程序(二)
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005/9/10 14:36:10

    if($isdesc=="1")
   $temp_isdesc="";
   else
   $temp_isdesc="desc";
   switch($sort)
   {
   case "1":$sortby="id";break;
   case "2":$sortby="click";break;
   case "3";$sortby="title";break;
   default:$sortby="id";
   }
  if($type==""||$type==0)
  $temp="";
  else
  $temp="and type=".$type;

$rs=mysql_fetch_array(mysql_query("select count(*) from download where ".$object." like('%".$content."%') ".$temp,$cn));
$max_page=$rs[0];
if($page>=$max_page)
$page=$max_page-$pagesize;
if($page<=0)
$page=0;
$sql="select * from download  where ".$object." like('%".$content."%') ".$temp." order by ".$sortby." ".$temp_isdesc." limit ".$page.",".$pagesize;
$result=mysql_query($sql,$cn);
}
?>

<table width="100%" border="0" cellspacing="0" cellpadding="0" height="28">
  <form action=download.php?action=search&page=0&sort=<?=$sort?>&isdesc=<?=$isdesc?> method="post">
    <tr>  
      <td width="37%" height="35"><font size="2"> 符合你要求的软件总数:
        <?=$max_page;?>
        </font></td>
      <td width="63%" height="35" bordercolor="#FFFFFF"> <font size="2"> 软件查找:
        <input type="text" name="content" size="20" value="<?=$content?>">
        查找对像
        <select name="select">
          <option><font size="2">软件名称</font></option>
          <option><font size="2">简介</font></option>
        </select>
        <select name="type" >
          <option value="0">全部软件</option>
          <option selected value="<?=$type?>">当前类别</option>
        </select>
        <input type="submit" name="search" value="go">
        </font> </td>
    </tr> </form>
  </table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="38">
  <tr>  
    <td width="66%"></td>
    <td width="34%">  
      <form action="download.php?action=show&type=<?=$type?>" method="post">
        <div align="right"><font size="2">排序按:</font>  
          <select name="sort">
            <option <?if($sort==1) echo "selected";?> value="1">上传时间</option>
            <option <?if($sort==2) echo "selected";?> value="2">下载次数</option>
            <option <?if($sort==3) echo "selected";?> value="3">软件名称</option>
          </select>
          <select name="isdesc">
            <option <?if($isdesc==2) echo "selected";?>  value="2">降序</option>
            <option <?if($isdesc==1) echo "selected";?>  value="1">升序</option>
          </select>
          <input type="submit" value="go" name="submit" >
        </div>
      </form>
    </td>
  </tr>
</table>
<?


if($max_page==0&&$action!="publish")
echo "<p align=center><font size=4 color=red>对不起,没能找到你想要的记录</font></p><br>";
else
;
?>
<?if($action!="publish"){?>
<p align="right"><font size="2">
  <?if($action=="search"){?>
  <?if($page>=1){?>
  <a href=download.php?page=0&action=search&content=<?=$content?>&type=<?=$type?>&select=<?=$select?>&sort=<?=$sort?>&isdesc=<?=$isdesc?>>第一页</a>
  <?}?>
  <?if($page>=1){?>
  <a href=download.php?page=<?=$page-$pagesize;?>&action=search&content=<?=$content?>&type=<?=$type?>&select=<?=$select?>&sort=<?=$sort?>&isdesc=<?=$isdesc?>>上一页</a>
  <?}?>
  <?if($page<$max_page-$pagesize){?>
  &nbsp&nbsp<a href=download.php?page=<?=$page+$pagesize;?>&action=search&content=<?=$content?>&type=<?=$type?>&select=<?=$select?>&sort=<?=$sort?>&isdesc=<?=$isdesc?>>下一页</a>
  <?}?>
  <?if($page<$max_page-$pagesize){?>
  &nbsp&nbsp<a href=download.php?page=<?=$max_page-$pagesize;?>&action=search&content=<?=$content?>&type=<?=$type?>&select=<?=$select?>&sort=<?=$sort?>&isdesc=<?=$isdesc?>>最后页</a>
  <?}?>
  <?}?>
  <?if($action=="show"){?>
  <?if($page>=1){?>
  <a href=download.php?page=0&type=<?=$type?>&action=show&sort=<?=$sort?>&isdesc=<?=$isdesc?>>第一页</a>
  <?}?>
  <?if($page>=1){?>
  &nbsp&nbsp<a href=download.php?page=<?=$page-$pagesize;?>&type=<?=$type?>&action=show&sort=<?=$sort?>&isdesc=<?=$isdesc?>>上一页</a>
  <?}?>
  <?if($page<$max_page-$pagesize){?>
  &nbsp&nbsp<a href=download.php?page=<?=$page+$pagesize;?>&type=<?=$type?>&action=show&sort=<?=$sort?>&isdesc=<?=$isdesc?>>下一页</a>
  <?}?>
  <?if($page<$max_page-$pagesize){?>
  &nbsp&nbsp<a href=download.php?page=<?=$max_page-$pagesize;?>&type=<?=$type?>&action=show&sort=<?=$sort?>&isdesc=<?=$isdesc?>>最后页</a>
  <?}?>
  <?}?>
  </font></p>
  <?if($max_page>0){?>
<table border="1" width="100%" height="58" cellspacing="0" cellpadding="0" bordercolor="#000000">
  <tr bordercolor="#000000" bgcolor="#f0f0ff">  
    <td width="25" height="25">  
      <div align="center"><font size="2">编号</font></div>
    </td>
    <td width="41" height="25">  
      <div align="right"><font size="2">软件名</font></div>
    </td>
    <td width="539" height="25">  
      <div align="center"><font size="2">软件介绍</font></div>
    </td>
    <td width="31" height="25">  
      <div align="center"><font size="2&qu

上一页  [1] [2] [3] [4]  下一页



打印本文 打印本文  关闭窗口 关闭窗口