<?php

include ("config.php");

$highlight_menu = 5;
$highlight_cousu = 1;
$display_consu = true;

_post("edit_submit", "rdv_date");

if ($edit_submit)
{
  if ($rdv_date)
  {
		if (ereg("^([0-9]{2})/([0-9]{2})/([0-9]{4})$", $rdv_date, $regs) && check_date($regs[1], $regs[2], $regs[3]))
		{
	    if ($rdv->edit_rdv($_SESSION["Sid_pat"], sql_date($rdv_date)))
			{
		    header ("Location: rdv.php?action=ajout");
				exit;
			}
		}
		else
			$error = 7;
  }
  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=\"rdv_edition.php\" method=\"post\">\n";
echo "<table class=\"center\">\n";

echo "<tr>\n";
echo "<th class=\"center\" colspan=\"2\">Informations concernant un rdv</th>\n";
echo "</tr>\n";
/*
echo "<tr>\n";
echo "<td>Choix du patient</td>";
echo "<td>".$suivi->select_suivi_util($_SESSION["Sid_user"], $id_pat)."</td>";
echo "</tr>\n";
*/
echo "<tr>\n";
echo "<td class=\"r\">Date du rdv " . req() ."</td>\n";
echo "<td><input class=\"int\" type=\"text\" name=\"rdv_date\" id=\"rdv_date\" value=\"" . $rdv_date . "\" size=\"10\" maxlength=\"10\" /><span><a href=\"#\" onclick=\"return showCalendar('rdv_date', '%d/%m/%Y');\"><img class=\"cal\" src=\"img/today.png\" alt=\"Calendrier\" /></a>&nbsp;(jj/mm/aaaa)</span></td>\n";
echo "</tr>\n";

echo "<tr>\n";
echo "<td class=\"center\" colspan=\"2\">";
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=\"rdv.php\">Retour &agrave; la liste des rdv</a></p>\n";

include ("footer.php");

?>