<?php

include ("config.php");

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

_request("id_couv");
_post("couv_nom", "edit_submit");

if (empty($edit_submit) && $info_couv = $menu->get_couv_soc($id_couv))
	$couv_nom = $info_couv["couv_nom"];

if ($edit_submit)
{
	if ($couv_nom)
	{
		if ($menu->edit_couv_soc($id_couv, $couv_nom))
			header ("Location: couverture.php?action=ajout");
	}
	else
		$error = 2;
}

include ("header.php");

if (!empty($error))
{
	if (is_int($error)) 
		echo "<p class=\"center error\">" . $error_list[$error] . "</p>\n";
	else
		echo "<p class=\"center error\">" . $error . "</p>\n";
}

echo "<p class=\"center\">(" . req() . ") Champs &agrave; remplir obligatoirement</p>\n";

echo "<div id=\"form-menu\">\n";
echo "<form action=\"couverture_edition.php\" method=\"post\">\n";
echo "<table class=\"center\">\n";

echo "<tr>\n";
echo "<th class=\"center\" colspan=\"2\">Informations concernant une couverture sociale</th>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class=\"r\"><label for=\"couv_nom\">Nom</label> " . req() . "</td>\n";
echo "<td><input type=\"text\" class=\"int\" name=\"couv_nom\" id=\"couv_nom\" value=\"" . $couv_nom . "\" /></td>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class=\"center\" colspan=\"2\">";
echo "<input type=\"hidden\" name=\"id_couv\" value=\"" . $id_couv . "\" />";
echo "<input class=\"inb\" type=\"submit\" name=\"edit_submit\" value=\"Enregistrer\" />";
echo "</td>\n";
echo "</tr>\n";

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

echo "<p><a class=\"slink\" href=\"couverture.php\">Retour &agrave; la liste des couvertures sociales</a></p>\n";

include ("footer.php");

?>