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

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

draw_header();

theme_draw_centerbox_open( $lang["LINKS_PENDING"] );

$stmt = "select id, name from {$config["prefix"]}_links where active='N' order by id desc";
$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_links.php?id={$row["id"]}\">{$row["name"]}</a></td></tr>\n";
		}
		echo "</table>";
	} else {
		print $lang["LINKS_PENDING_NONE"];
	}
	db_free_result( $ret );
}
theme_draw_centerbox_close();

draw_footer();
?>