<?php
	if( !is_array($Project) ){
		ob_clean();
		exit("Forbidden");	
	}
?>
  
<?php

	echo '
	<table width="100%" border="0" cellpadding="1" cellspacing="1" id="table" class="table">
	<tr class="title">
		<td></td>
		<td>文件名</td>
		<td>用户</td>
		<td>来源</td>
		<td>大小</td>
		<td>位置</td>
		<td>尺寸</td>
		<td>上传时间</td>
		<td>操作</td>
	</tr>
	';

	while($row=mysql_fetch_assoc($result)){
		
		/*
		if( $row["remote"] ){
			$link = readpath(str_replace(FTP_ROOT,FTP_SITE,$row["name"]));	
			$name = str_replace(FTP_ROOT,'',$row["name"]);
		}else{
			$link = (VI_BASE.$row["name"]);
			$name = $row["name"];
		}
		*/
		
		if( $row["remote"] ){
			$link = readpath(str_replace(FTP_ROOT,FTP_SITE,$row["name"]));	
			$name = str_replace(FTP_ROOT,'',$row["name"]);
		}else{
			$name = $link = $row["name"];
		}

		echo ("<tr class='line' ".(in_array($row["type"],$Upload["image"]) && $row["size"]<102400 ?"onmouseover='Mo.Tips($(\"file-".$row["id"]."\"),event,\"tips\",\"<img src=".$row["name"] ." />\",\"click\",0,30);'":"onmouseover='Mo.Tips(null,$(\"file-".$row["id"]."\"),\"tips\",\"图片过大或非图片格式无法预览\",document,\"click\",0,30);'").">");
		
		echo "<td><input name='id' type='checkbox' class='checkbox' id='id' value='".$row["id"]."'></td>";
		
		echo ("<td title='".$row["name"]."' id='file-".$row["id"]."'><script>Mo.Tools('RsType','".$row["type"]."','?s=type&q=');</script><a id='url-".$row["id"]."' href='".$link."' target='_blank'>".format_url($row["name"],40)."</a></td>");
		echo ("<td><a href='?s=account&q=".urlencode($row["account"])."'>".$row["account"]."</a></td>");
		echo ("<td>".$row["input"]."</td>");
		echo ("<td>".GetFileSize($row["size"],"byte")."</td>");
		echo ("<td><a href='?r=".$row["remote"]."'>".$Project["attach"][$row["remote"]]."</a></td>");
		echo ("<td>".($row["width"]?$row["width"]."*".$row["height"]:"")."</td>");
		echo ("<td>".date("Y-m-d H:i:s",$row["dateline"])."</td>");
		echo ("<td align='center'><script type='text/javascript'>Mo.Tools('RsDelete','?action=delete&list=".$row["id"]."','');</script></td></tr>");
		
	}
	
	echo '
		<tr class="line">
		<td colspan="9"><a href="javascript:$(\'list\').value = setAll(\'#table tbody tr input\',true); void(0);">全选</a> / <a href="javascript:$(\'list\').value = setAll(\'#table tbody tr input\',false); void(0);">全不选</a> / <a href="javascript:$(\'list\').value = setAll(\'#table tbody tr input\',\'anti\'); void(0);">反选</a> - <a href="javascript:if(confirm(\'确定要删除所选吗?\')){formPost(\'formPost\',\'delete\');}void(0);">删除所选</a></td>
		</tr>
	</table>
	';

?>