<?php
  switch($Etape)
  {
    case 0:
      echo "  <form name='info'>\n";
      echo "   <input type='hidden' name='Type' value=$Type>\n";
      echo "   <input type='hidden' name='Sous_Type' value=$Sous_Type>\n";
      echo "   <input type='hidden' name='Etape' value='1'>\n";
      echo "<TABLE border=1>\n";
      echo "   <TR><TH>NoCatLoc</TH><TD><input type='texte' name='NoCatLoc'></TD></TR>\n";
      echo "   <TR><TH>Nom</TH><TD><input type='text' name='Description'></TD></TR>\n";
      echo "   <TR><TH>Prêt</TH><TD><input type='checkbox' name='Pret' value='1'></TD></TR>\n";
      echo "</TABLE>\n";
      echo "   <button type='submit'>Créer</button>\n";
      echo "  </form>\n";
    break;
    case 1:
      if(!isset($Pret))
      {
        $Pret=0;
      }
      $requette = "INSERT INTO catloc (NoCatLoc, Description, Pret) VALUES ('$NoCatLoc', '$Description', '$Pret')";
      if ($resultat = Connection::executeRawQuery($requette))
      {
      }
      else
      {
        echo "<big>Ce no existe déjà</big>";
      }
    break;
  }
?>
