<?php
/*
乘风下载管理系统
作者QQ：178575
作者Email：yliangcf@163.com
作者网站：http://www.qqcf.com
详细简介：http://www.qqcf.com/cfdown.htm
上面有程序在线演示，安装演示，使用疑难解答，最新版本下载等内容
因为这些内容可能时常更新，就没有放在程序里，请自己上网站查看
*/
?>
<?php
$Px=ChkStr($_GET["Px"],1);
if($Px=="") $Px="addtime";

$PageUrl = "?action=$action";

pxfilter($Px,"title,numtype,ip,ly,searchbot,agentstr,addtime");

$ip=empty($_SERVER["HTTP_X_FORWARDED_FOR"])?ChkStr($_SERVER["REMOTE_ADDR"],1):ChkStr($_SERVER["HTTP_X_FORWARDED_FOR"],1);

$Sql="select count(1) from cfdown_visit_last where 1=1";
$SqlWh="";
$Sql.=$SqlWh;

$Result=mysql_query($Sql);
$Rs=mysql_fetch_row($Result);
$Page=isset($_GET["Page"])&&intval($_GET["Page"])>0?intval($_GET["Page"]):1;
$PageSize=50;
$TotalRs=$Rs[0];
$TotalPage=ceil($TotalRs/$PageSize);
$Offset=$PageSize*($Page-1);

$Sql="select a.*,b.title from cfdown_visit_last a inner join cfdown_info b on a.infoid=b.id where 1=1";
$Sql.=$SqlWh;
$Sql.=" Order By $Px Desc,addtime Desc limit $Offset,$PageSize";

$Result=mysql_query($Sql);
?>

<table class="tb_2">
<tr>
<td>
<div class="explain">
点击标题可排序</div>
</td>
</tr>
</table>

<table class="tb_1">

  <tr class="tr_1"> 
    <td><a href="<?php echo $PageUrl?>&Px=addtime">序号</a></td>
    <td><a href="<?php echo $PageUrl?>&Px=title">标题</a></td>
    <td><a href="<?php echo $PageUrl?>&Px=numtype">类型</a></td>
    <td><a href="<?php echo $PageUrl?>&Px=ip">IP</a></td>    
    <td><a href="<?php echo $PageUrl?>&Px=ly">来源</a></td>
	<td><a href="<?php echo $PageUrl?>&Px=searchbot">爬虫</a></td>
	<td><a href="<?php echo $PageUrl?>&Px=agentstr">参数</a></td>
    <td><a href="<?php echo $PageUrl?>&Px=addtime">加入时间</a></td>
	
  </tr>
  <?php 
while ($Rs=mysql_fetch_assoc($Result))
{
?>
  <tr class="tr_2"> 
    <td><?php echo $TotalRs-$PageSize*($Page-1)-$j;$j=$j+1;?></td>
    <td style="width:200px;word-wrap: break-word;word-break:break-all;"><?php echo $Rs["title"];?>[<?php echo $Rs["infoid"];?>]</td>
    <td><?php if($Rs["numtype"]==1){echo "浏览";}else{echo "下载";}?></td>
    <td>
<?php
if($ip==$Rs["ip"])
 echo "<font color='#ff0000'>".$Rs["ip"]."</font>";
else
 echo $Rs["ip"];
?></td>
    <td style="width:200px;word-wrap: break-word;word-break:break-all;"><?php echo $Rs["ly"];?></td>
	<td>
<?php
if($Rs["searchbot"]==1)
 echo "<font color='#ff0000'>是</font>";
else
 echo "否";
?></td>
    <td style="width:320px;word-wrap: break-word;word-break:break-all;"><?php echo $Rs["agentstr"];?></td>
    <td><?php echo date("m-d H:i",strtotime($Rs["addtime"]));?></td>
  </tr>
  <?php 
} 
?>
</table>

<?php
ShowPage($TotalRs,$TotalPage,$Page,$PageUrl,$Px)
?>




