<?php
/**
* FILE_NAME : open_onefile.php
*
* @copyright Copyright (c) 2009 - 2010 www.dali.edu.cn
* @author DaLi University 2009 Graduation Design
* @package 文件选择框
* @subpackage
* @version Mon Oct 26 14:09:42 GMT 2009
*/

define('IN_WEB', TRUE);
	
require_once( str_replace('\\', '/', dirname(__FILE__)). '/include/global.php');

/* act操作项的初始化 */
if (empty($_REQUEST['act'])) {
    $_REQUEST['act'] = 'show';
} else {
    $_REQUEST['act'] = trim($_REQUEST['act']);
}

/*------------------------------------------------------ */
//-- 显示缩略图列表
/*------------------------------------------------------ */
if ($_REQUEST['act'] == 'show')
{
	$sql = $query = $filelist = '';
	
	$sql = "SELECT * FROM {$dbprefix}attachments";
	$query = $DB->query($sql);
	while ($row = $DB->fetch_array($query))
	{
		$row['size'] = formatbyte($row['size'],2);
		$filelist[] = $row;
	}
	
	$smarty->assign("css_root", $css_root);
	$smarty->assign("filelist", $filelist);
	
	$smarty->display("open_onefile.html");
}
?>