Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <link rel="stylesheet" href="style.css"/>
- <title> Choix de la place </title>
- </head>
- <body>
- <table width="867px" bgcolor="white" align="center">
- <tr>
- <td><img src="bandeau.jpg"></td>
- </tr>
- <tr>
- <td><span class="menuInactif">Bienvenue</span> <span class="menuInactif">Réservation</span> <span class="menuActif">Choix de la place</span> <span class="menuInactif">Paiement</span> <span class="menuInactif">Confirmation</span></td>
- </tr>
- <tr>
- <td height="400px" align="center">
- <?php
- if($_POST['Nom']=="" || $_POST['Prenom']==""|| $_POST['Adresse']==""|| $_POST['CodePostal']==""|| $_POST['Ville']==""|| $_POST['Telephone']==""|| $_POST['E-mail']==""){
- echo "Tous les champs sont obligatoires !";
- echo "<a href=\"Reservation Parking.php\"> </br> </br> </br> Recommencer ";
- } else {
- session_start();
- $_SESSION['Nom']=$_POST['Nom'];
- $dateResa=$_POST['Annee']."-".$_POST['Mois']."-".$_POST['Jour'];
- $_SESSION['DateR']=$dateResa;
- $_SESSION['Formule']=$_POST['Formule'];
- $_SESSION['Prenom']=$_POST['Prenom'];
- $_SESSION['Adresse']=$_POST['Adresse'];
- $_SESSION['Ville']=$_POST['Ville'];
- $_SESSION['E-mail']=$_POST['E-mail'];
- $_SESSION['Telephone']=$_POST['Telephone'];
- $_SESSION['cp']=$_POST['CodePostal'];
- $db=mysql_connect("172.20.100.100","root","vinci");
- mysql_select_db("oparking", $db);
- $requete="Select numPlace from Place";
- $resultat=mysql_query($requete);
- while($ligne=mysql_fetch_array($resultat)){
- if($_POST['Formule']=="M"){
- $requete2="select * from Reservation where (formule='M' OR formule='J') and dateR='".$dateResa."' and numPlace=".$ligne['numPlace'];
- $resultat2=mysql_query($requete2);
- if(mysql_num_rows($resultat2)==0){
- echo <p class="dispo">"<a href='paiement.php?numP=".$ligne['numPlace']."'>".$ligne['numPlace']. "</a>"</p>;
- } else {
- echo <p class="pasdispo">$ligne['numPlace']</p>;
- }
- }
- if($_POST['Formule']=="A"){
- $requete2="select * from Reservation where (formule='A' OR formule='J') and dateR='".$dateResa."' and numPlace=".$ligne['numPlace'];
- $resultat2=mysql_query($requete2);
- if(mysql_num_rows($resultat2)==0){
- echo <p class="dispo">"<a href='paiement.php?numP=".$ligne['numPlace']."'>".$ligne['numPlace']. "</a>"</p>;
- } else {
- echo <p class="pasdispo">$ligne['numPlace']</p>;
- }
- }
- if($_POST['Formule']=="J"){
- $requete2="select * from Reservation where (formule='M' OR formule='J' OR formule='A') and dateR='".$dateResa."' and numPlace=".$ligne['numPlace'];
- $resultat2=mysql_query($requete2);
- if(mysql_num_rows($resultat2)==0){
- echo <p class="dispo">"<a href='paiement.php?numP=".$ligne['numPlace']."'>".$ligne['numPlace']. "</a>"</p>;
- } else {
- echo <p class="pasdispo">$ligne['numPlace']</p>;
- }
- }
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment