if (isset($_POST['lieu_depart']) && isset($_POST['lieu_arrivee']) && isset($_POST['date_heure'])) {
if (isset($_POST['lieu_depart']) && isset($_POST['lieu_arrivee']) && isset($_POST['date_heure'])) {
$source = $_POST['lieu_depart'];
$source = $_POST['lieu_depart']; //Recuperation des valeurs passé par le form
$dest = $_POST['lieu_arrivee'];
$dest = $_POST['lieu_arrivee'];
$date_depart = $_POST['date_heure'];
$date_depart = $_POST['date_heure'];
if ($date_depart <date('Y-m-d')){
if ($date_depart <date('Y-m-d')){//Verificationdedate
echo "Erreur date</br>";
echo "Erreur date</br>";
echo "<ahref='../tableauBord/tableauBord.php'>Retour vers le tableau de bord</a>";
echo "<ahref='../tableauBord/tableauBord.php'>Retour vers le tableau de bord</a>";
exit();
exit();
}
}
}
}
//Requete de selection des trajets a affiché
$result = pg_query_params($db, "(SELECT DISTINCT ut.login, ta.codetrajet, ta.datedepart FROM ville v, traverser tr, utilisateur ut, trajet ta WHERE DATE(ta.datedepart) = DATE($3) AND ta.estannule = false AND ta.codetrajet = tr.codetrajet AND ta.mailproposition = ut.mail AND tr.nomVille = v.nomVille AND tr.codepostal = v.codepostal AND tr.numeroetape = (SELECT MIN(numeroetape) FROM traverser WHERE LOWER(nomVille) = LOWER($1)))
$result = pg_query_params($db, "(SELECT DISTINCT ut.login, ta.codetrajet, ta.datedepart FROM ville v, traverser tr, utilisateur ut, trajet ta WHERE DATE(ta.datedepart) = DATE($3) AND ta.estannule = false AND ta.codetrajet = tr.codetrajet AND ta.mailproposition = ut.mail AND tr.nomVille = v.nomVille AND tr.codepostal = v.codepostal AND tr.numeroetape = (SELECT MIN(numeroetape) FROM traverser WHERE LOWER(nomVille) = LOWER($1)))
INTERSECT (SELECT DISTINCT ut.login, ta.codetrajet, ta.datedepart FROM ville v, traverser tr, utilisateur ut, trajet ta WHERE DATE(ta.datedepart) = DATE($3) AND ta.estannule = false AND ta.codetrajet = tr.codetrajet AND ta.mailproposition = ut.mail AND tr.nomVille = v.nomVille AND tr.codepostal = v.codepostal AND tr.numeroetape = (SELECT MAX(numeroetape) FROM traverser WHERE LOWER(nomVille) = LOWER($2)));", array($source, $dest, $date_depart));
INTERSECT (SELECT DISTINCT ut.login, ta.codetrajet, ta.datedepart FROM ville v, traverser tr, utilisateur ut, trajet ta WHERE DATE(ta.datedepart) = DATE($3) AND ta.estannule = false AND ta.codetrajet = tr.codetrajet AND ta.mailproposition = ut.mail AND tr.nomVille = v.nomVille AND tr.codepostal = v.codepostal AND tr.numeroetape = (SELECT MAX(numeroetape) FROM traverser WHERE LOWER(nomVille) = LOWER($2)));", array($source, $dest, $date_depart));
@ -42,7 +50,7 @@ INTERSECT (SELECT DISTINCT ut.login, ta.codetrajet, ta.datedepart FROM ville v,