<?php
  switch($Etape)
  {
    case 0:
      if($resultat = VehiculesLocation::getAll())
      {
        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 "   <select name='NoChasis'>\n";
        foreach($resultat as $ligne)
        {
            if($ligne2 = Vehicule::getVehiculeByNoChassis(addslashes($ligne['NoChasis'])))
            {
              echo " <option value='".$ligne2['NoChasis']."'>" . str_replace(" ","&nbsp;",taille_text($ligne2['Model'], 10, 0)) . " " . str_replace(" ","&nbsp;",taille_text($ligne['NoPlaque'], 10, 0)) . " " . taille_text($ligne['NoChasis'], 20, 0) ."</option>\n";
            }
        }
        echo "  </select><BR>\n";
        echo "   <button type='submit'>Supprimer</button>\n";
        echo "  </form>\n";
      }
    break;
    case 1:
      $requette="DELETE FROM vehiculeslocation".ID_GARAGE." WHERE NoChasis='".addslashes($NoChasis)."'";
      if($resultat = Connection::executeRawQuery($requette))
      {
      }
      else
      {
        echo "KO";
      }
    break;
  }
?>
