<?php 
require_once('session.php');
require_once('../fun/funsql.php'); 
require_once('../fun/funlogic.php');
$fp=openfile('../cache/config.txt');
$fps=explode(",,",$fp);
if (isset($_GET["rel"])){$rel=$_GET["rel"];}else{$rel="";}
$dir='/upfile/image/';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $fps[0] ?> - 图片列表</title>
<link href="css_body.css" rel="stylesheet" type="text/css" />
</head>
<script>
function win(){

   window.opener.document.all.imgs.innerText=document.getElementById("imgs").value;
   //window.opener.document.all.bb.innerText=document.getElementById("sex").value;

   window.close();
}
</script>
<script type="text/javascript" src="../fun/adminjs.js"></script>
<body>
<?php if($rel==''){?>
<div class='bodytitle'><div class='bodytitleleft'></div><div class='bodytitletxt'><?php echo '..'.$dir; ?>列表</div></div>
<table width="96%" border="0" cellpadding="0" cellspacing="0" align="center" style="margin-bottom:8px;display:block" id="td1" >
<tr> 
<td>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#E2F5BC" class="sysinfo">
<tr align="center"> 
<td  height="25" bgcolor="#FFFFFF" align="left">名称</td>
<td bgcolor="#FFFFFF" align="left">属性</td>
<td bgcolor="#FFFFFF" align="left">大小</td>
<td bgcolor="#FFFFFF" align="left">修改时间</td>
<td bgcolor="#FFFFFF" align="left">管理</td>
</tr>

<?php 
$dp=listdir('..'.$dir,2);
$dps=explode(",,",$dp);
$dpi=0;
while($dpi<(count($dps)-1)){
?>
<div id="img<?php echo $dpi; ?>" style=" display:none"><img src="<?php echo '..'.$dir.'/'.$dps[$dpi]; ?>" /></div>
<tr align="center"> 
<td  height="25" bgcolor="#FFFFFF" align="left"><img src="images/htm.gif"><a href="#" onmouseout="closediv('img<?php echo $dpi; ?>')" onmousemove="showdiv('img<?php echo $dpi; ?>')" onclick="win()"><?php echo $dps[$dpi];?></a><input type="hidden" id="imgs" value="<?php echo $fps[1].$dir.$dps[$dpi] ?>" /></td>
<td bgcolor="#FFFFFF" align="left"><?php echo filetype('..'.$dir.'/'.$dps[$dpi]); ?></td>
<td bgcolor="#FFFFFF" align="left"><?php echo (filesize('..'.$dir.'/'.$dps[$dpi])/1000)."KB"; ?></td>
<td bgcolor="#FFFFFF" align="left"><?php echo date("Y-m-d H:i:s",filectime('..'.$dir.'/'.$dps[$dpi])); ?></td>
<td bgcolor="#FFFFFF" align="left"><a href="upfilelist.php?rel=file_del&id=<?php echo '..'.$dir.$dps[$dpi]; ?>">删除</a></td>
</tr>
<?php 
$dpi+=1;
}?>

</table>
</td>
</tr>
</table>
<?php }?>
<?php 
if($rel=='file_del'){
  $id=$_GET["id"];
  @unlink($id);
  echo tanshow("","upfilelist.php");
}
?>

<?php mysql_close();?>
</body>
</html>