<?php

include ("config.php");

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

include ("header.php");

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

echo "<tr>\n";
echo "<th class=\"center\" colspan=\"3\">Liste des rendez-vous</th>\n";
echo "</tr>\n";

$list_rdv = $rdv->list_rdv($_SESSION["Sid_pat"]);

if ($c = count($list_rdv))
{
  echo "<tr class=\"titre\">\n";
//  echo "<td>Nom Pr&eacute;nom</td>\n";
  echo "<td>Date</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_rdv[$i]["pat_nom"] . " " . $list_rdv[$i]["pat_prenom"] . "</td>\n";
    echo "<td>" . format_date($list_rdv[$i]["rdv_date"]) . "</td>\n";
    echo "<td class=\"action\"><a class=\"sdel\" href=\"rdv_suppression.php?id_rdv=" . $list_rdv[$i]["id_rdv"] . "\">Supprimer</a></td>\n";
    echo "</tr>\n";
  }
}
else
{
  echo "<tr>\n";
  echo "<td class=\"center error\" colspan=\"3\">Aucun rendez-vous enregistr&eacute;</td>\n";
  echo "</tr>\n";
}

echo "</table>\n";

echo "<p><a class=\"slink\" href=\"rdv_edition.php\">Nouveau rdv</a></p>\n";

echo "</div>\n";

include ("footer.php");

?>