mercoledì 8 giugno 2011

Prenotazione hotel

<html>
 <head>
  <title>Gestione prenotazione hotel</title>
 </head>
 <body bgcolor="00ff00">
  <h2><center>Effettuare selezione e inviare form</center></h2><P>
  <form action="gestioneprenotazione.php" method="POST">
   NOME: <input type="text" name=prinum width=50%><br>
   COGNOME: <input type="text" name=secnum width=50%><br>
   NUMERO TELEFONO: <input type="text" name=ternum width=50%><br>
   E-MAIL: <input type="text" name=quartnum width=50%><p>
   <hr width=100%>
   <center><h4>localit&agrave turistiche</center></h4>
   <input type=radio name="rmeta" value=passeggiare checked> passeggiare a Parigi<p>
   <input type=radio name="rmeta" value=escursione > escursione a Losanna<p>
   <input type=radio name="rmeta" value=settimana > settimana bianca a Livigno<p>
   <hr width=100%>

   <center><h4>tipo di albergo</h4></center>
   <input type=radio name="htipo" value=2 checked> hotel a 2 stelle<p>
   <input type=radio name="htipo" value=3> hotel a 3 stelle<p>
   <input type=radio name="htipo" value=4> hotel a 4 stelle<p>
   <hr width=100%>

   <center><h4>Componenti aggiuntivi</h4></center>
   <input type="checkbox" name="cd" value=doccia/vasca checked> doccia o vasca da bagno<p>
   <input type="checkbox" name="cm" value=vista> vista sul mare<p>
   <input type="checkbox" name="cc" value=cassaforte> cassaforte<p>

   <input type=submit value=invia>
   <input type=reset value=cancella>
  </form>
 </body>
</html>


<html>
 <head>
  <title>Gestione prenotazione hotel</title>
 </head>
 <body bgcolor="00ff00">
  <h2><center>prenotazione eseguita</center></h2>
   <?php
   //inizializzazione delle variabili
   $prinum=$_POST['prinum'];
   $secnum=$_POST['secnum'];
   $ternum=$_POST['ternum'];
   $quartnum=$_POST['quartnum'];

   echo "$prinum <br>";
   echo "$secnum<br>";
   echo "$ternum<br>";
   echo "$quartnum <p>";

   // seconda inizializzazione delle variabili
   $rmeta=$_POST['rmeta'];
   $htipo=$_POST['htipo'];
   echo "desiderate andare a $rmeta in ";
   echo "un hotel $htipo stelle <p>";

   //terza inizializzazione delle variabili
   $cd=$_POST['cd'];
   $cm=$_POST['cm'];
   $cc=$_POST['cc'];

   if($cd=="" and $cm=="" and $cc=="")echo "ATTENZIONE !!!!!";
   else {
    if($cd)
    echo "camera con $cd, sovrapprezzo di 10 euro/giorno <p>";
    if($cm)
    echo "camera con $cm, sovrapprezzo di 15 euro/giorno <p>";
    if($cc)
    echo "camera con $cc, sovrapprezzo di 3 euro/giorno <p>";
   }
  ?>
 </body>
</html>

Nessun commento:

Posta un commento