<?php
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}
?>
<br>
<table border="0" cellspacing="1" cellpadding="1"  align="center" class="tableborder">
  <form name="form1" method="post" action="?action=clear">
  <tr>
    <td colspan="7" class="tit1"><?echo $lang['tmp.info2']?></td>

  </tr>
	<tr>
    <td class="forumrow" style="text-align:center;"><input type="submit" name="Submit" value="<? echo $lang['tmp.info35']?>" style="color: #FF0000;width:80px;height:50px;border:1px outset;"></td>
    <td colspan="6" class="forumrow"><?echo $lang['tmp.info1']?></td>
  </tr>
  <tr class="forumrow2">
    <td style="text-align:center;"><?echo $lang['tmp.info17']?></td>
    <td style="text-align:center;"><?echo $lang['tmp.info3']?></td>
    <td style="text-align:center;"><?echo $lang['tmp.info4']?></td>
    <td style="text-align:center;"><?echo $lang['tmp.info5']?></td>
    <td style="text-align:center;"><?echo $lang['tmp.info6']?></td>
    <td style="text-align:center;"><?echo $lang['tmp.info7']?></td>
    <td style="text-align:center;"><?echo $lang['tmp.info8']?></td>
  </tr>
  <?
	if(!empty($file_list)){
		if(is_array($file_list)){
			$record_start=intval($_GET['page'])*$page_size;
			$record_end=intval($_GET['page']*$page_size);
			if($_GET['page']<=0 or $_GET['page']==1){
				$record_start=0;
				$record_end=$page_size;
			}
			if($record_start>0){
				$record_start-=$page_size;
			}
			for($j=$record_start;$j<$record_end;$j++){
				if($file_list[$j]=="" or empty($file_list[$j])){
					break;
				}
				if(strpos($file_list[$j],'_')!==false){
					$userid=explode("_",$file_list[$j]);
					if($userid[0]!=''){
						$user_name=$db->scalar("select username from {$dv}user where userid={$userid[0]}");
					}
				}
  ?>
  <tr class="forumrow" style="padding:1px;">
    <td style="text-align:center;"><input type="checkbox" name="fileid[]" value="<?echo $j?>"></td>
    <td height="25" style="text-align:center;">
	<a href="<?echo $facesurl.$file_list[$j]?>" target="_blank"><?echo $file_list[$j]?></a>
	</td>
    <td height="25" style="text-align:center;"><?echo $user_name?></td>
    <td height="25" style="text-align:center;"><?echo filesize($facesdir.$file_list[$j]).$lang['tmp.info12']?></td>
    <td height="25" style="text-align:center;"><?echo gmdate("Y-m-d H:i:s",fileatime($facesdir.$file_list[$j])+getUserTimeZoneOffset())?></td>
    <td height="25" style="text-align:center;"><?echo gmdate("Y-m-d H:i:s",filectime($facesdir.$file_list[$j])+getUserTimeZoneOffset())?></td>
    <td height="25" style="text-align:center;"><a href="upuserface.php?action=del&filename=<?echo $facesdir.$file_list[$j]?>"><?echo $lang['tmp.info11']?></a></td>
  </tr>
  <?
			}
		}
	}
  ?>
  <tr>
    <td colspan="7" style="text-align:left;" class="forumrow1"><input class="button" type="submit" name="Submit" value="<?echo $lang['tmp.info9']?>">&nbsp;&nbsp;<input type="checkbox" name="allid" value="Y" onclick="un(this)"><?echo $lang['tmp.info18']?></td>
  </tr>
<?
if($page_count>0){
	$next = $page+1;
	$pre = $page-1;
	if($next==1){
		$next=2;
	}
	if($pre==-1){
		$pre=0;
	}
	if($next>$page_count){
		$next=$page_count;
	}
	if($_GET['page']==0 or $_GET['page']==""){
		if($ten_page=="" or $ten_page==0){
			$page_str=1;
		}
		else{
			$page_str=$_GET['ten_page']*10-10+1;
		}
	}
	else{
		$page_str=$_GET['page'];
	}
	$pageinfo1=$lang['tmp.info24'].$total.$lang['tmp.info25'].$page_size.$lang['tmp.info26'];
	$pageinfo2=$lang['tmp.info27'].ceil($total/$page_size).$lang['tmp.info28']."<font color=\"#ff0000\">".$page_str."</font>/".ceil($total/$page_size)."";
	$pageinfo3=$lang['tmp.info29']."&nbsp;&nbsp;";
}
?>
  <tr>
    <td colspan="7" style="text-align:right;">
<?
	echo $pageinfo1;
?>
	</td>
  </tr>
  <tr>
    <td colspan="2" style="text-align:center;">
<?
	echo $pageinfo2;
?>
	</td>
    <td colspan="3" style="text-align:left;"></td>
    <td colspan="2" style="text-align:right;height:30px;">
<?
	echo $pageinfo3;
	if($page_count>10){
		$ten_num=ceil($page_count/10);//page_count得到多少页;
	}
	//进入十页开始ten_start;
	if(intval($_GET['ten_page'])==1 or $_GET['ten_page']=="" or intval($_GET['ten_page'])==0){
		$ten_start=1;
	}
	else{
		$ten_start=$_GET['ten_page']*10+1-10;
	}
	//进入十页结束ten_end;
	$ten_end=$_GET['ten_page']*10;
	if($ten_end==0 or $ten_end==""){
		$ten_end=10;
	}
	if($ten_end>$page_count){
		$ten_end=$page_count;
	}
	$pre_ten=$_GET['ten_page']-1;
	$next_ten=$_GET['ten_page']+1;
	if($next_ten>$ten_num){
		$next_ten=$ten_num;
	}
	if($ten_num>1 and $next_ten==1){
		$next_ten=2;
	}
	if($_GET['ten_page']=="" or $_GET['ten_page']==0){
		$_GET['ten_page']=1;
	}
	if($_GET['ten_page']>1){
		echo "<a href=\"?ten_page=".$pre_ten."\" title=\"".$lang['tmp.info32']."".($_GET['ten_page']*10-10)."".$lang['tmp.info33']."\"><font color=\"#990000\">[<<]</font></a>&nbsp;";
	}
	for($i=$ten_start;$i<=$ten_end;$i++){
		if($page_str==$i){
			$color_str="<font color=\"#ff0000\">";
		}
		else{
			$color_str="<font color=\"#0000FF\">";
		}
		echo "<a href=\"?ten_page=".$_GET['ten_page']."&page=".$i."\" title=\"".$lang['tmp.info32']."".$i."".$lang['tmp.info33']."\">".$color_str."[".$i."]</font></a>&nbsp;";
	}
	if($ten_end==$page_count){
		echo "";
	}
	else{
		echo "<a href=\"?ten_page=".$next_ten."\" title=\"".$lang['tmp.info32']."".($_GET['ten_page']*10+10)."".$lang['tmp.info33']."\"><font color=\"#990000\">[>>]</font></a>";
	}
?>
&nbsp;&nbsp;
  </td>
  </tr>
  </form>
</table>