<?php
include_once("core/main.php");
if( !check_user_class($config["admmenu"]["downloads_pending"]["class"]) ) exit;
if( !check_module("downloads") ) die( "module not enabled" );

$index_page = false;
$page_name = $lang["DOWNLOAD_PENDING"];

draw_header();

theme_draw_centerbox_open( $lang["DOWNLOAD_PENDING"] );

$stmt = "select id, date, name from {$config["prefix"]}_downloads where active='N' order by date";
$ret = db_query( $stmt );
if( !$ret ) print "<div class=\"error\">".$lang["ERROR_04"]."<br>".db_error()."</div>";
else {
	if( db_num_rows($ret) > 0 )
	{
		echo "<table width=\"100%\" border=0 cellpadding=2 cellspacing=0>\n";
		$item = 0;
		while( $row = db_fetch_array( $ret ) )
		{
			$item = ($item % 2)+1;
			echo "<tr><td class=\"row{$item}\">"
				."<a href=\"adm_downloads.php?id={$row["id"]}\">".show_date($row["date"])." - {$row["name"]}</a></td></tr>\n";
		}
		echo "</table>";
	} else {
		print $lang["DOWNLOAD_PENDING_NONE"];
	}
	db_free_result( $ret );
}
theme_draw_centerbox_close();

draw_footer();
?>