diff --git a/WEB/avis_laisses/avis_laisses.css b/WEB/avis_laisses/avis_laisses.css index b28d24b..c4a475d 100755 --- a/WEB/avis_laisses/avis_laisses.css +++ b/WEB/avis_laisses/avis_laisses.css @@ -7,9 +7,9 @@ Page CSS : avis_laisses.css body { color:black; background-color:white; + background-attachment: fixed; background-image:url("../ressources/image/background.jpg"); - background-repeat:no-repeat; - background-size:100%; + background-size:cover; margin: 0; font-family: Ubuntu,Helvetica,sans-serif; } diff --git a/WEB/avis_laisses/avis_laisses.php b/WEB/avis_laisses/avis_laisses.php index 64faea2..7cbc969 100755 --- a/WEB/avis_laisses/avis_laisses.php +++ b/WEB/avis_laisses/avis_laisses.php @@ -12,7 +12,7 @@ $mail = $_SESSION['mail']; $login = getLogin($db,$mail); -$requete = "SELECT DISTINCT Utilisateur.login, Avis.commentaire, Avis.dateavis, Avis.note FROM Utilisateur, Avis, Trajet WHERE Avis.mailemetteur = $1 AND Avis.mailemetteur = Utilisateur.mail;"; +$requete = "SELECT DISTINCT Avis.codetrajet, Utilisateur.login, Avis.commentaire, Avis.dateavis, Avis.note FROM Utilisateur, Avis, Trajet WHERE Avis.codetrajet = Trajet.codetrajet AND Avis.mailemetteur = $1 AND Trajet.mailproposition = Utilisateur.mail;"; $result = pg_query_params($db, $requete, array($mail)); ?> diff --git a/WEB/avis_recus/avis_recus.css b/WEB/avis_recus/avis_recus.css index bed344e..707b5e1 100755 --- a/WEB/avis_recus/avis_recus.css +++ b/WEB/avis_recus/avis_recus.css @@ -8,8 +8,8 @@ body { color:black; background-color:white; background-image:url("../ressources/image/background.jpg"); - background-repeat:no-repeat; - background-size:104%; + background-attachment: fixed; + background-size:cover; margin: 0; font-family: Ubuntu,Helvetica,sans-serif; } diff --git a/WEB/avis_recus/avis_recus.php b/WEB/avis_recus/avis_recus.php index 626727a..c0dc93b 100755 --- a/WEB/avis_recus/avis_recus.php +++ b/WEB/avis_recus/avis_recus.php @@ -12,7 +12,7 @@ $mail = $_SESSION['mail']; $login = getLogin($db, $mail); -$requete = "SELECT DISTINCT Utilisateur.login, Avis.commentaire, Avis.dateavis, Avis.note FROM Utilisateur, Avis, Trajet WHERE Avis.codetrajet = Trajet.codetrajet AND Trajet.mailproposition = $1 AND Trajet.mailproposition = Utilisateur.mail;"; +$requete = "SELECT DISTINCT Avis.mailemetteur, Avis.codetrajet, Utilisateur.login, Avis.commentaire, Avis.dateavis, Avis.note FROM Utilisateur, Avis, Trajet WHERE Avis.codetrajet = Trajet.codetrajet AND Trajet.mailproposition = $1 AND Avis.mailemetteur = Utilisateur.mail;"; $result = pg_query_params($db, $requete, array($mail)); ?> @@ -37,6 +37,7 @@ $result = pg_query_params($db, $requete, array($mail));
-

Déposer un trajet

diff --git a/WEB/deposer_avis/deposer_avis.css b/WEB/deposer_avis/deposer_avis.css index a93218d..8e10682 100755 --- a/WEB/deposer_avis/deposer_avis.css +++ b/WEB/deposer_avis/deposer_avis.css @@ -2,8 +2,8 @@ body { color:black; background-color:white; background-image:url("../ressources/image/background.jpg"); - background-repeat:no-repeat; - background-size:104%; + background-attachment: fixed; + background-size:cover; margin: 0; font-family: Ubuntu,Helvetica,sans-serif; } diff --git a/WEB/index.css b/WEB/index.css index 63d68a5..c42d44f 100644 --- a/WEB/index.css +++ b/WEB/index.css @@ -10,6 +10,9 @@ html, body{ } body{ + background-image: url("ressources/image/background.jpg"); + background-size: cover; + background-attachment: fixed; display: flex; flex-wrap: wrap; flex-direction: row; diff --git a/WEB/inscription/inscription.css b/WEB/inscription/inscription.css index 63d68a5..4c6d7e4 100644 --- a/WEB/inscription/inscription.css +++ b/WEB/inscription/inscription.css @@ -10,14 +10,17 @@ html, body{ } body{ + background-image:url("../ressources/image/background.jpg"); + background-attachment: fixed; + background-size: cover; display: flex; flex-wrap: wrap; flex-direction: row; justify-content: center; - align-items: center; } #formulaire{ + margin-top: 3em; background-color: white; border-radius: 10px; padding: 4em; diff --git a/WEB/listeTrajetPublie/liste_trajet_publie.css b/WEB/listeTrajetPublie/liste_trajet_publie.css index f1ac27d..5f73cc6 100644 --- a/WEB/listeTrajetPublie/liste_trajet_publie.css +++ b/WEB/listeTrajetPublie/liste_trajet_publie.css @@ -2,8 +2,8 @@ body { color:black; background-color:white; background-image:url("../ressources/image/background.jpg"); - background-repeat:no-repeat; - background-size:104%; + background-attachment: fixed; + background-size:cover; margin: 0; font-family: Ubuntu,Helvetica,sans-serif; } diff --git a/WEB/listeTrajetPublie/liste_trajet_publie.php b/WEB/listeTrajetPublie/liste_trajet_publie.php index 3080e05..66c0e16 100644 --- a/WEB/listeTrajetPublie/liste_trajet_publie.php +++ b/WEB/listeTrajetPublie/liste_trajet_publie.php @@ -45,7 +45,7 @@ require_once("../ressources/navbarhtml.php"); $dest = getFin($db, $codetrajet); $date = date('Y-m-d H:i:s'); echo "
"; + echo "

$date_depart - ".$source['nomville']." (".$source['codepostal'].") vers ".$dest['nomville']." (".$dest['codepostal'].") proposé par : $login

"; if ($date <= $row['datearrivee']){ echo ""; } diff --git a/WEB/listeTrajetReserve/liste_trajet_reserve.css b/WEB/listeTrajetReserve/liste_trajet_reserve.css index 01ca29c..4a67ada 100644 --- a/WEB/listeTrajetReserve/liste_trajet_reserve.css +++ b/WEB/listeTrajetReserve/liste_trajet_reserve.css @@ -2,8 +2,8 @@ body { color:black; background-color:white; background-image:url("../ressources/image/background.jpg"); - background-repeat:no-repeat; - background-size:104%; + background-attachment: fixed; + background-size:cover; margin: 0; font-family: Ubuntu,Helvetica,sans-serif; } diff --git a/WEB/listeTrajetReserve/liste_trajet_reserve.php b/WEB/listeTrajetReserve/liste_trajet_reserve.php index 2a52dcf..ebcfe45 100644 --- a/WEB/listeTrajetReserve/liste_trajet_reserve.php +++ b/WEB/listeTrajetReserve/liste_trajet_reserve.php @@ -43,14 +43,17 @@ require_once("../ressources/navbarhtml.php"); $date = date('Y-m-d H:i:s'); $dest = getFin($db, $codetrajet); echo ""; - echo ""; + echo ""; + if ($date <= $row['datearrivee']){ echo ""; } else{ echo ""; } - echo ""; + if (!avisExiste($db, $mail, $codetrajet)){ + echo ""; + } echo ""; } ?> diff --git a/WEB/liste_trajets/liste_trajet.css b/WEB/liste_trajets/liste_trajet.css index 70937cf..ae5220c 100755 --- a/WEB/liste_trajets/liste_trajet.css +++ b/WEB/liste_trajets/liste_trajet.css @@ -2,8 +2,8 @@ body { color:black; background-color:white; background-image:url("../ressources/image/background.jpg"); - background-repeat:no-repeat; - background-size:104%; + background-attachment: fixed; + background-size:cover; margin: 0; font-family: Ubuntu,Helvetica,sans-serif; } diff --git a/WEB/liste_trajets/liste_trajet.php b/WEB/liste_trajets/liste_trajet.php index 63466f0..579c9cc 100755 --- a/WEB/liste_trajets/liste_trajet.php +++ b/WEB/liste_trajets/liste_trajet.php @@ -9,23 +9,25 @@ if (!isset($_SESSION['mail'])) { exit(); } $mail = $_SESSION['mail']; -if (!(isset($_POST['lieu_depart']) && isset($_POST['lieu_arrivee']) && isset($_POST['date_heure']))){ +if (!(isset($_POST['villeDepart']) && isset($_POST['villeArrive']) && isset($_POST['date_heure']))) { header('Location: ../tableauBord/tableauBord.php'); exit(); } -if (isset($_POST['lieu_depart']) && isset($_POST['lieu_arrivee']) && isset($_POST['date_heure'])) { - $source = $_POST['lieu_depart']; - $dest = $_POST['lieu_arrivee']; - $date_depart = $_POST['date_heure']; - if ($date_depart < date('Y-m-d')){ - echo "Erreur date
"; - echo "Retour vers le tableau de bord"; - exit(); - } +$source = explode('%%', $_POST['villeDepart']); +$cpsource = $source[1]; +$source = $source[0]; +$dest = explode('%%', $_POST['villeArrive']); +$cpdest = $dest[1]; +$dest = $dest[0]; +$date_depart = $_POST['date_heure']; +if ($date_depart < date('Y-m-d')) { + echo "Erreur date
"; + echo "Retour vers le tableau de bord"; + exit(); } -$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 LOWER(v.nomville) = LOWER($2) AND tr.codepostal = v.codepostal AND tr.numeroetape != 1);", array($source, $dest, $date_depart)); +$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) AND codepostal = $4)) +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 LOWER(v.nomville) = LOWER($2) AND v.codepostal = $5 AND tr.codepostal = v.codepostal AND tr.numeroetape != 1);", array($source, $dest, $date_depart, $cpsource, $cpdest)); ?> @@ -47,7 +49,7 @@ require_once("../ressources/navbarhtml.php"); alt="Bouton retour">

Liste des trajets


-

Trajets recherchés :

+

Trajets recherchés :


"; - echo "

$date_depart - $source vers $dest proposé par : $login

Annuler le trajet

$date_depart - $source vers $dest proposé par : $login

$date_depart - ".$source['nomville']." (".$source['codepostal'].") vers ".$dest['nomville']." (".$dest['codepostal'].") proposé par : $login

Annuler la reservation

Trajet effectué

Déposer un avisDéposer un avis
@@ -58,9 +60,9 @@ require_once("../ressources/navbarhtml.php"); $source = getDepart($db, $codetrajet); $dest = getFin($db, $codetrajet); $date_depart = $row['datedepart']; - if (checkPlacesVoiture($db, $codetrajet) && $date_depart >= date('Y-m-d H:i:s')){ + if (checkPlacesVoiture($db, $codetrajet) && $date_depart >= date('Y-m-d H:i:s')) { echo ""; + echo "

$date_depart - ".$source['nomvile']." (".$source['codepostal'].") vers ".$dest['nomvile']." (".$dest['codepostal'].") proposé par : $login

"; echo ""; echo ""; } diff --git a/WEB/liste_trajets/reserver.php b/WEB/liste_trajets/reserver.php index a204c9d..f521a61 100644 --- a/WEB/liste_trajets/reserver.php +++ b/WEB/liste_trajets/reserver.php @@ -5,7 +5,11 @@ function verifierTrajet($db, $mail, $codetrajet){ if (!$trajet){ return false; } - return checkReservations($db, $mail, $codetrajet) && checkPlacesVoiture($db, $codetrajet) && !strcmp($mail, $trajet['mailproposition']); + $trajet = pg_fetch_array($trajet); + if (strcmp($mail, $trajet['mailproposition']) == 0){ + return false; + } + return checkReservations($db, $mail, $codetrajet) && checkPlacesVoiture($db, $codetrajet); } require_once("../connexionBD.php"); diff --git a/WEB/profil/profil.css b/WEB/profil/profil.css index d549f29..7c92a8a 100644 --- a/WEB/profil/profil.css +++ b/WEB/profil/profil.css @@ -42,13 +42,13 @@ html, body{ } body{ + background-attachment: fixed; display: flex; flex-wrap: wrap; flex-direction: row; justify-content: center; background-image: url("../ressources/image/background.jpg"); background-size : cover; - background-position: center, center; } #formulaire{ diff --git a/WEB/recherche/recherche.css b/WEB/recherche/recherche.css index fbc186d..5e69e56 100644 --- a/WEB/recherche/recherche.css +++ b/WEB/recherche/recherche.css @@ -1,49 +1,91 @@ *{ font-family: "Arial"; + padding: 0; + margin: 0; } -.centrage { - text-align: center; - font-size: 20px; +body{ + background-attachment: fixed; + background-image:url("../ressources/image/background.jpg"); + background-size: cover; + display: flex; + justify-content: center; + flex-direction: column; } -.global { +#container{ + margin-top: 3em; + display: flex; + justify-content: center; +} +h1{ + font-size: 2em; text-align: center; + margin-bottom: 3em; +} +.villeSelect, .villeText{ + box-sizing: border-box; + margin-bottom: 0.7em; } -br { - line-height: 50px; +.villeText{ + width: 20%; } -body { - color: black; - background-color: white; - background-image: url("../ressources/image/background.jpg"); - background-repeat: no-repeat; - background-size: 104%; - margin: 0; +.villeSelect{ + margin-bottom: 0.7em; + margin-left: 2%; + width: 33%; +} + +#submit{ + margin-top: 1em; + margin-left: 50%; + transform: translate(-50%); } -#container { - margin: 5% 15% 2% 15%; +#formulaire{ background-color: white; - border: 2px solid black; + border-radius: 10px; + padding: 4em; + width: 40%; } -h1 { - text-align: center; - font-size: 250%; +.form{ + box-sizing: border-box; + width: 55%; + margin-bottom: 0.7em; } -#form { - text-align: center; +.button{ + cursor: pointer; + font-weight: bold; + padding: 8px; + color: white; + background-color: rgb(65, 154, 28); + border-radius: 5em; + border: none; +} + +.line{ + display: flex; + flex-wrap: wrap; + flex-direction: row; + justify-content: left; + width: 100%; } .error{ + margin-top: 1em; color: red; text-align: center; } - +.label{ + box-sizing: border-box; + font-size: 1.1em; + width: 45%; + min-width: 8em; +} diff --git a/WEB/recherche/recherche.js b/WEB/recherche/recherche.js new file mode 100644 index 0000000..5f47871 --- /dev/null +++ b/WEB/recherche/recherche.js @@ -0,0 +1,25 @@ +$(document).ready(function () { + //copy options + let options = $('#villeDepart option').clone(); + //react on keyup in textbox + $('#villeDepartText').keyup(function () { + let val = $(this).val().toString().toLowerCase(); + $('#villeDepart').empty(); + //take only the options containing your filter text or all if empty + options.filter(function (idx, el) { + return val === '' || $(el).text().toLowerCase().indexOf(val) >= 0; + }).appendTo('#villeDepart');//add it to list + }); + + //copy options + let optionsArrive = $('#villeArrive option').clone(); + //react on keyup in textbox + $('#villeArriveText').keyup(function () { + let val = $(this).val().toString().toLowerCase(); + $('#villeArrive').empty(); + //take only the options containing your filter text or all if empty + optionsArrive.filter(function (idx, el) { + return val === '' || $(el).text().toLowerCase().indexOf(val) >= 0; + }).appendTo('#villeArrive');//add it to list + }); +}); \ No newline at end of file diff --git a/WEB/recherche/recherche.php b/WEB/recherche/recherche.php index 5454213..e018207 100644 --- a/WEB/recherche/recherche.php +++ b/WEB/recherche/recherche.php @@ -10,6 +10,7 @@ function getError($code) session_start(); require_once('../ressources/verifconnecte.php'); +require_once('../ressources/trajet.php'); ?> @@ -26,41 +27,44 @@ require_once('../ressources/verifconnecte.php'); require_once("../ressources/navbarhtml.php"); ?>
-
-

Rechercher trajet


-
-
+
+

Rechercher trajet

- - - - - -
+
+ + + +
+
+ + -
- +

+ " . getError($_GET['error']) . "

"; + } + ?>
- " . getError($_GET['error']) . "

"; - } - ?>
- + + + diff --git a/WEB/ressources/trajet.php b/WEB/ressources/trajet.php index b7900ab..39d6e56 100644 --- a/WEB/ressources/trajet.php +++ b/WEB/ressources/trajet.php @@ -88,7 +88,7 @@ function checkVoiture($db, $mail, $matricule) function getTrajetsProposes($db, $mail) { - $result = pg_query_params($db, "SELECT COUNT(*) from Trajet WHERE mailProposition = $1 AND estAnnule = false AND datearrivee >= $2;", array($mail, date('Y-m-d H:i:s'))); + $result = pg_query_params($db, "SELECT COUNT(*) from Trajet WHERE mailProposition = $1 AND estAnnule = false AND datedepart >= $2;", array($mail, date('Y-m-d H:i:s'))); if ($result) { $row = pg_fetch_array($result); return $row[0]; @@ -98,7 +98,7 @@ function getTrajetsProposes($db, $mail) function getTrajetsReserves($db, $mail) { - $result = pg_query_params($db, "SELECT COUNT(*) FROM trajet tr, reserver re WHERE re.codetrajet = tr.codetrajet AND mailutilisateur = $1 AND tr.estannule = false AND re.estannule = false AND tr.datearrivee >= $2;", array($mail, date('Y-m-d H:i:s'))); + $result = pg_query_params($db, "SELECT COUNT(*) FROM trajet tr, reserver re WHERE re.codetrajet = tr.codetrajet AND mailutilisateur = $1 AND tr.estannule = false AND re.estannule = false AND tr.datedepart >= $2;", array($mail, date('Y-m-d H:i:s'))); if ($result) { $row = pg_fetch_array($result); return $row[0]; @@ -158,20 +158,20 @@ function afficherVilles($db) function getDepart($db, $codetajet) { - $result = pg_query_params($db, "SELECT v.nomVille FROM ville v, traverser tr WHERE tr.nomVille = v.nomVille AND tr.codepostal = v.codepostal AND tr.codetrajet = $1 AND tr.numeroetape = (SELECT MIN(numeroetape) FROM traverser WHERE codetrajet = $1);", array($codetajet)); + $result = pg_query_params($db, "SELECT * FROM ville v, traverser tr WHERE tr.nomVille = v.nomVille AND tr.codepostal = v.codepostal AND tr.codetrajet = $1 AND tr.numeroetape = (SELECT MIN(numeroetape) FROM traverser WHERE codetrajet = $1);", array($codetajet)); $return = false; if ($result) { - $return = pg_fetch_array($result)[0]; + $return = pg_fetch_array($result); } return $return; } function getFin($db, $codetajet) { - $result = pg_query_params($db, "SELECT v.nomVille FROM ville v, traverser tr WHERE tr.nomVille = v.nomVille AND tr.codepostal = v.codepostal AND tr.codetrajet = $1 AND tr.numeroetape = (SELECT MAX(numeroetape) FROM traverser WHERE codetrajet = $1);", array($codetajet)); + $result = pg_query_params($db, "SELECT * FROM ville v, traverser tr WHERE tr.nomVille = v.nomVille AND tr.codepostal = v.codepostal AND tr.codetrajet = $1 AND tr.numeroetape = (SELECT MAX(numeroetape) FROM traverser WHERE codetrajet = $1);", array($codetajet)); $return = false; if ($result) { - $return = pg_fetch_array($result)[0]; + $return = pg_fetch_array($result); } return $return; } @@ -200,4 +200,12 @@ function getErrorDepotTrajet($code) } } +function avisExiste($db, $mail, $codetrajet){ + $result = pg_query_params($db, "SELECT COUNT(*) FROM Avis WHERE mailemetteur = $1 AND codetrajet = $2;", array($mail, $codetrajet)); + if(!$result){ + return false; + } + return pg_fetch_array($result)[0] != 0; +} + ?> \ No newline at end of file diff --git a/WEB/tableauBord/tableauBord.css b/WEB/tableauBord/tableauBord.css index 8b52ca5..7f83626 100644 --- a/WEB/tableauBord/tableauBord.css +++ b/WEB/tableauBord/tableauBord.css @@ -1,16 +1,22 @@ -*{ +* { margin: 0; padding: 0; font-family: "Arial"; } -h1{ +body { + background-image: url("../ressources/image/background.jpg"); + background-size: cover; + background-attachment: fixed; +} + +h1 { font-size: 3em; text-align: center; text-decoration: underline; } -#content{ +#content { min-width: 320px; width: 100%; display: flex; @@ -19,20 +25,22 @@ h1{ align-items: center; } -#tableauBord{ +#tableauBord { + border-radius: 10px; + background-color: white; margin: 2em; padding: 1em; - width: 100%; + width: 70%; } -#divImgProfil{ +#divImgProfil { width: 100%; display: flex; flex-wrap: nowrap; justify-content: center; } -#imgProfil{ +#imgProfil { background-color: white; margin-top: 2.5em; width: 60%; @@ -42,7 +50,22 @@ h1{ border-radius: 10px; } -#trajet{ +.button{ + text-decoration: none; + cursor: pointer; + font-weight: bold; + padding: 12px; + color: white; + background-color: rgb(65, 154, 28); + border-radius: 5em; + border: none; +} + +.button:hover{ + background-color: rgb(80, 174, 48); +} + +#trajet { margin-top: 2em; display: flex; flex-wrap: wrap; @@ -52,35 +75,18 @@ h1{ width: 100%; } -.btnTrajet{ - display: flex; - flex-wrap: nowrap; - justify-content: center; - align-items: center; - text-decoration: none; - padding: 0.4em; - color: black; - background-color: lightgray; - border: 1px solid black; - -} - -.btnTrajet:hover{ - background-color: grey; -} - -#btnTrajet2{ +#btnTrajet2 { margin-left: 10%; } -#recap{ +#recap { margin-top: 2.5em; width: 50%; margin-left: 50%; transform: translate(-50%); } -.recapLine{ +.recapLine { margin-bottom: 1.5em; display: flex; flex-wrap: nowrap; @@ -89,11 +95,11 @@ h1{ width: 100%; } -.recapIcon{ +.recapIcon { width: 50px; height: 50px; } -p{ +p { margin-left: 10%; } diff --git a/WEB/tableauBord/tableauBord.php b/WEB/tableauBord/tableauBord.php index 2bfd203..3376831 100644 --- a/WEB/tableauBord/tableauBord.php +++ b/WEB/tableauBord/tableauBord.php @@ -23,8 +23,8 @@ require_once ('../ressources/verifconnecte.php');
- Déposer un trajet - Rechercher un trajet + Déposer un trajet + Rechercher un trajet

"; - echo "

$date_depart - $source vers $dest proposé par : $login

Réserver