<?
@session_start();
@include('inc/header.php');
@include('inc/main_left.php')
?>

<div class="mian-r">
  <div class="content">
    <table cellspacing="0" >
      <tr class="table_bar">
        <td>提交时间</td>
        <td>提交者</td>
        <td align="center"></td>
        <td>被黑页面</td>
        <td>查看快照</td>
      </tr>
<?
if(!$_GET['var']){echo "<script>location.href='index.php'</script>";exit; }
$a_page_num=50;
$start_page=$_GET['page']?($_GET['page']-1)*$a_page_num:0;
$start_page=substr($start_page,0,4);

$query_sql='';
$count_sql='';
$type=substr($_GET['type'],0,6);
$var=$_GET['var'];
if(!get_magic_quotes_gpc())
{
	$var=addslashes($_GET['var']);
}
switch($type)
	{
		case 'ip':
		$var=substr($var,0,15);
		$count_sql="select tj_ip from `hacked_pages` where tj_ip='$var' and pending=1";
		$query_sql="select * from hacked_pages where pending=1 and tj_ip='$var' order by id desc limit $start_page,$a_page_num";
		break;
		case 'domain':
		$var=substr($var,0,25);
		$count_sql="select tj_domain from `hacked_pages` where tj_domain='$var' and pending=1 ";
		$query_sql="select * from hacked_pages where pending=1 and tj_domain='$var' order by id desc limit $start_page,$a_page_num";
		break;
		case 'team':
		$var=substr($var,0,21);
		$count_sql="select tj_team from `hacked_pages` where tj_team='$var' and pending=1 ";
		$query_sql="select * from hacked_pages where pending=1 and tj_team='$var' order by id desc limit $start_page,$a_page_num";
		break;
		default:
		$var=substr($var,0,21);
		$count_sql="select tj_name from `hacked_pages` where tj_name='$var' and pending=1 ";
		$query_sql="select * from hacked_pages where pending=1 and tj_name='$var' order by id desc limit $start_page,$a_page_num";
	}

$total_num=@mysql_num_rows(@mysql_query($count_sql));
$total_pages=ceil($total_num/$a_page_num);
@$query=mysql_query($query_sql);
while(@$row=mysql_fetch_array($query))
{
	$page=$row['id'].md5($row['id']);
	$tj_date=date("Y-m-d",$row['tj_date']);
	$tj_name=htmlspecialchars($row['tj_name']);
    $tj_hacked_url=htmlspecialchars($row['tj_hacked_url']);
    $tj_pr=$row['tj_pr'];
	if(!is_numeric($tj_pr)&&$tj_pr>9){$tj_pr=0;}
?>
      <tr>
        <td width="12%"><?=$tj_date?></td>
        <td width="14%"><a href="search.php?var=<?=$tj_name?>"><?=$tj_name?></a></td>
        <td width="4%" align="center"><strong style="color:#f00; font-family:Arial"></strong></td>
        <td width="58%" style="word-break:break-all"><a href="<?=$tj_hacked_url?>" target="_blank"><?=$tj_hacked_url?></a></td>
        <td width="12%"><a href="snapshot.php?p=<?=$page?>" target="_blank">查看快照</a></td>
      </tr>
      <? }?>
      <tr>
        <td colspan=4 align=right>
          <? @include('inc/get_page.php');?></td>
      </tr>
        </tr>
      
    </table>
  </div>
</div>
<!--/main-r-->

<? include('inc/footer.php');?>