<?php

include ("config.php");

$highlight_menu = 4;
$highlight_sous_menu = 1;
$display_menu = true;

include ("header.php");

echo "<div id=\"list-menu\">\n";
echo "<table class=\"pad list\">\n";

echo "<tr>\n";
echo "<th class=\"center\" colspan=\"2\">Liste des modules</th>\n";
echo "</tr>\n";

$list_module = $menu->list_module();

if ($c = count($list_module))
{
	echo "<tr class=\"titre\">\n";
	echo "<td>Nom</td>\n";
	echo "<td>Action</td>\n";
	echo "</tr>\n";

	for ($i = 0; $i < $c; $i++)
	{
		echo "<tr" . ($i % 2 == 0 ? "" : " class=\"inter\"") . ">\n";
		echo "<td>" . $list_module[$i]["mod_nom"] . "</td>\n";
		echo "<td class=\"action\"><a class=\"slink\" href=\"module_edition.php?id_mod=" . $list_module[$i]["id_mod"] . "\">Modifier</a> <a class=\"sdel\" href=\"module_suppression.php?id_mod=" . $list_module[$i]["id_mod"] . "\">Supprimer</a></td>\n";
		echo "</tr>\n";
	}
}
else
{
	echo "<tr>\n";
	echo "<td class=\"center error\" colspan=\"2\">Aucun module enregistr&eacute;</td>\n";
	echo "</tr>\n";
}

echo "</table>\n";
echo "</div>\n";

echo "<p><a class=\"slink\" href=\"module_edition.php\">Ajouter un module</a></p>\n";

include ("footer.php");

?>