un peut de css et debug reservations

avisTrajet
remi.biette 6 years ago
parent 9b671fa476
commit 86b329840a

@ -7,9 +7,9 @@ Page CSS : avis_laisses.css
body { body {
color:black; color:black;
background-color:white; background-color:white;
background-attachment: fixed;
background-image:url("../ressources/image/background.jpg"); background-image:url("../ressources/image/background.jpg");
background-repeat:no-repeat; background-size:cover;
background-size:100%;
margin: 0; margin: 0;
font-family: Ubuntu,Helvetica,sans-serif; font-family: Ubuntu,Helvetica,sans-serif;
} }

@ -12,7 +12,7 @@ $mail = $_SESSION['mail'];
$login = getLogin($db,$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)); $result = pg_query_params($db, $requete, array($mail));
?> ?>

@ -8,8 +8,8 @@ body {
color:black; color:black;
background-color:white; background-color:white;
background-image:url("../ressources/image/background.jpg"); background-image:url("../ressources/image/background.jpg");
background-repeat:no-repeat; background-attachment: fixed;
background-size:104%; background-size:cover;
margin: 0; margin: 0;
font-family: Ubuntu,Helvetica,sans-serif; font-family: Ubuntu,Helvetica,sans-serif;
} }

@ -12,7 +12,7 @@ $mail = $_SESSION['mail'];
$login = getLogin($db, $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)); $result = pg_query_params($db, $requete, array($mail));
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@ -37,6 +37,7 @@ $result = pg_query_params($db, $requete, array($mail));
<div id="avis"> <div id="avis">
<table> <table>
<?php while ($row = pg_fetch_array($result)) { <?php while ($row = pg_fetch_array($result)) {
pg_query_params($db, "UPDATE Avis SET estlu = true WHERE mailemetteur = $1 AND codetrajet = $2;", array($row['mailemetteur'], $row['codetrajet']));
$nom = $row['login']; $nom = $row['login'];
$date = $row['dateavis']; $date = $row['dateavis'];
$commentaire = $row['commentaire']; $commentaire = $row['commentaire'];

@ -6,6 +6,8 @@
body{ body{
background-image:url("../ressources/image/background.jpg"); background-image:url("../ressources/image/background.jpg");
background-attachment: fixed;
background-size: cover;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
flex-direction: row; flex-direction: row;

@ -62,7 +62,6 @@ if (isset($_POST['dateDepart']) && isset($_POST['dateArrivee']) && isset($_POST[
<body> <body>
<script type="application/javascript" src="../ressources/libs/jquery-3.4.1.js"></script> <script type="application/javascript" src="../ressources/libs/jquery-3.4.1.js"></script>
<script type="application/javascript" src="../ressources/libs/jquery-ui.min.js"></script> <script type="application/javascript" src="../ressources/libs/jquery-ui.min.js"></script>
<script type="application/javascript" src="../ressources/libs/chosen.jquery.min.js"></script>
<?php require_once ("../ressources/navbarhtml.php"); ?> <?php require_once ("../ressources/navbarhtml.php"); ?>
<div id="formulaire"> <div id="formulaire">
<h1>Déposer un trajet</h1> <h1>Déposer un trajet</h1>

@ -2,8 +2,8 @@ body {
color:black; color:black;
background-color:white; background-color:white;
background-image:url("../ressources/image/background.jpg"); background-image:url("../ressources/image/background.jpg");
background-repeat:no-repeat; background-attachment: fixed;
background-size:104%; background-size:cover;
margin: 0; margin: 0;
font-family: Ubuntu,Helvetica,sans-serif; font-family: Ubuntu,Helvetica,sans-serif;
} }

@ -10,6 +10,9 @@ html, body{
} }
body{ body{
background-image: url("ressources/image/background.jpg");
background-size: cover;
background-attachment: fixed;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
flex-direction: row; flex-direction: row;

@ -10,14 +10,17 @@ html, body{
} }
body{ body{
background-image:url("../ressources/image/background.jpg");
background-attachment: fixed;
background-size: cover;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
align-items: center;
} }
#formulaire{ #formulaire{
margin-top: 3em;
background-color: white; background-color: white;
border-radius: 10px; border-radius: 10px;
padding: 4em; padding: 4em;

@ -2,8 +2,8 @@ body {
color:black; color:black;
background-color:white; background-color:white;
background-image:url("../ressources/image/background.jpg"); background-image:url("../ressources/image/background.jpg");
background-repeat:no-repeat; background-attachment: fixed;
background-size:104%; background-size:cover;
margin: 0; margin: 0;
font-family: Ubuntu,Helvetica,sans-serif; font-family: Ubuntu,Helvetica,sans-serif;
} }

@ -45,7 +45,7 @@ require_once("../ressources/navbarhtml.php");
$dest = getFin($db, $codetrajet); $dest = getFin($db, $codetrajet);
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
echo "<tr><td class='ligne'><hr class='separation'/></td><td class='info'>"; echo "<tr><td class='ligne'><hr class='separation'/></td><td class='info'>";
echo "<p>$date_depart - $source vers $dest proposé par : $login</p></td>"; echo "<p>$date_depart - ".$source['nomville']." (".$source['codepostal'].") vers ".$dest['nomville']." (".$dest['codepostal'].") proposé par : $login</p></td>";
if ($date <= $row['datearrivee']){ if ($date <= $row['datearrivee']){
echo "<td><a href='annulerTrajet.php?codetrajet=$codetrajet'>Annuler le trajet</a></td>"; echo "<td><a href='annulerTrajet.php?codetrajet=$codetrajet'>Annuler le trajet</a></td>";
} }

@ -2,8 +2,8 @@ body {
color:black; color:black;
background-color:white; background-color:white;
background-image:url("../ressources/image/background.jpg"); background-image:url("../ressources/image/background.jpg");
background-repeat:no-repeat; background-attachment: fixed;
background-size:104%; background-size:cover;
margin: 0; margin: 0;
font-family: Ubuntu,Helvetica,sans-serif; font-family: Ubuntu,Helvetica,sans-serif;
} }

@ -43,14 +43,17 @@ require_once("../ressources/navbarhtml.php");
$date = date('Y-m-d H:i:s'); $date = date('Y-m-d H:i:s');
$dest = getFin($db, $codetrajet); $dest = getFin($db, $codetrajet);
echo "<tr><td class='ligne'><hr class='separation'/></td>"; echo "<tr><td class='ligne'><hr class='separation'/></td>";
echo "<td class='info'><p>$date_depart - $source vers $dest proposé par : $login</p></td>"; echo "<td class='info'><p>$date_depart - ".$source['nomville']." (".$source['codepostal'].") vers ".$dest['nomville']." (".$dest['codepostal'].") proposé par : $login</p></td>";
if ($date <= $row['datearrivee']){ if ($date <= $row['datearrivee']){
echo "<td><a href='annulerReservation.php?codetrajet=$codetrajet'>Annuler la reservation</a></td>"; echo "<td><a href='annulerReservation.php?codetrajet=$codetrajet'>Annuler la reservation</a></td>";
} }
else{ else{
echo "<td class='info'><p>Trajet effectué</p></td>"; echo "<td class='info'><p>Trajet effectué</p></td>";
} }
if (!avisExiste($db, $mail, $codetrajet)){
echo "<td><a href='../deposer_avis/deposer_avis.php?codetrajet=$codetrajet'>Déposer un avis</a></td>"; echo "<td><a href='../deposer_avis/deposer_avis.php?codetrajet=$codetrajet'>Déposer un avis</a></td>";
}
echo "</tr>"; echo "</tr>";
} }
?> ?>

@ -2,8 +2,8 @@ body {
color:black; color:black;
background-color:white; background-color:white;
background-image:url("../ressources/image/background.jpg"); background-image:url("../ressources/image/background.jpg");
background-repeat:no-repeat; background-attachment: fixed;
background-size:104%; background-size:cover;
margin: 0; margin: 0;
font-family: Ubuntu,Helvetica,sans-serif; font-family: Ubuntu,Helvetica,sans-serif;
} }

@ -9,23 +9,25 @@ if (!isset($_SESSION['mail'])) {
exit(); exit();
} }
$mail = $_SESSION['mail']; $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'); header('Location: ../tableauBord/tableauBord.php');
exit(); exit();
} }
if (isset($_POST['lieu_depart']) && isset($_POST['lieu_arrivee']) && isset($_POST['date_heure'])) { $source = explode('%%', $_POST['villeDepart']);
$source = $_POST['lieu_depart']; $cpsource = $source[1];
$dest = $_POST['lieu_arrivee']; $source = $source[0];
$dest = explode('%%', $_POST['villeArrive']);
$cpdest = $dest[1];
$dest = $dest[0];
$date_depart = $_POST['date_heure']; $date_depart = $_POST['date_heure'];
if ($date_depart < date('Y-m-d')) { if ($date_depart < date('Y-m-d')) {
echo "Erreur date</br>"; echo "Erreur date</br>";
echo "<a href='../tableauBord/tableauBord.php'>Retour vers le tableau de bord</a>"; echo "<a href='../tableauBord/tableauBord.php'>Retour vers le tableau de bord</a>";
exit(); 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))) $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 tr.codepostal = v.codepostal AND tr.numeroetape != 1);", 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 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));
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@ -47,7 +49,7 @@ require_once("../ressources/navbarhtml.php");
alt="Bouton retour"></a> alt="Bouton retour"></a>
<h1 class="float" id="titre">Liste des trajets</h1> <h1 class="float" id="titre">Liste des trajets</h1>
<br> <br>
<h2>Trajets recherchés : <?php echo $source . " vers " . $dest; ?></h2> <h2>Trajets recherchés : <?php echo "$source ($cpsource) vers $dest ($cpdest)"; ?></h2>
</div> </div>
<div id="liste"> <div id="liste">
<table> <table>
@ -60,7 +62,7 @@ require_once("../ressources/navbarhtml.php");
$date_depart = $row['datedepart']; $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 "<tr><td class='ligne'><hr class='separation'/></td><td class='info'>"; echo "<tr><td class='ligne'><hr class='separation'/></td><td class='info'>";
echo "<p>$date_depart - $source vers $dest proposé par : $login</p></td>"; echo "<p>$date_depart - ".$source['nomvile']." (".$source['codepostal'].") vers ".$dest['nomvile']." (".$dest['codepostal'].") proposé par : $login</p></td>";
echo "<td><a href='reserver.php?codetrajet=$codetrajet'>Réserver</a></td>"; echo "<td><a href='reserver.php?codetrajet=$codetrajet'>Réserver</a></td>";
echo "</tr>"; echo "</tr>";
} }

@ -5,7 +5,11 @@ function verifierTrajet($db, $mail, $codetrajet){
if (!$trajet){ if (!$trajet){
return false; 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"); require_once("../connexionBD.php");

@ -42,13 +42,13 @@ html, body{
} }
body{ body{
background-attachment: fixed;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
background-image: url("../ressources/image/background.jpg"); background-image: url("../ressources/image/background.jpg");
background-size : cover; background-size : cover;
background-position: center, center;
} }
#formulaire{ #formulaire{

@ -1,49 +1,91 @@
*{ *{
font-family: "Arial"; font-family: "Arial";
padding: 0;
margin: 0;
} }
.centrage { body{
text-align: center; background-attachment: fixed;
font-size: 20px; 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; text-align: center;
margin-bottom: 3em;
}
.villeSelect, .villeText{
box-sizing: border-box;
margin-bottom: 0.7em;
} }
br { .villeText{
line-height: 50px; width: 20%;
} }
body { .villeSelect{
color: black; margin-bottom: 0.7em;
background-color: white; margin-left: 2%;
background-image: url("../ressources/image/background.jpg"); width: 33%;
background-repeat: no-repeat;
background-size: 104%;
margin: 0;
} }
#container { #submit{
margin: 5% 15% 2% 15%; margin-top: 1em;
margin-left: 50%;
transform: translate(-50%);
}
#formulaire{
background-color: white; background-color: white;
border: 2px solid black; border-radius: 10px;
padding: 4em;
width: 40%;
} }
h1 { .form{
text-align: center; box-sizing: border-box;
font-size: 250%; width: 55%;
margin-bottom: 0.7em;
} }
#form { .button{
text-align: center; 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{ .error{
margin-top: 1em;
color: red; color: red;
text-align: center; text-align: center;
} }
.label{
box-sizing: border-box;
font-size: 1.1em;
width: 45%;
min-width: 8em;
}

@ -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
});
});

@ -10,6 +10,7 @@ function getError($code)
session_start(); session_start();
require_once('../ressources/verifconnecte.php'); require_once('../ressources/verifconnecte.php');
require_once('../ressources/trajet.php');
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@ -26,41 +27,44 @@ require_once('../ressources/verifconnecte.php');
require_once("../ressources/navbarhtml.php"); require_once("../ressources/navbarhtml.php");
?> ?>
<div id="container"> <div id="container">
<div id="entete"> <div id="formulaire">
<h1>Rechercher trajet</h1><br/> <h1>Rechercher trajet</h1>
</div>
<div class="global bord">
<form method="post" action="../liste_trajets/liste_trajet.php"> <form method="post" action="../liste_trajets/liste_trajet.php">
<div class="line">
<label> <label class="label" for="villeDepart">Ville de départ : </label>
<input name="lieu_depart" type="text" placeholder="Lieu de départ" class="centrage" required> <input type="text" class="form, villeText" name="villeDepartText" id="villeDepartText">
<br/> <select class="form, villeSelect" name="villeDepart" id="villeDepart" required>
<br/> <option selected></option>
</label> <?php afficherVilles($db); ?>
</select>
<label> </div>
<input name="lieu_arrivee" type="text" placeholder="Lieu d'arrivée" class="centrage" required> <div id="villeEtapeDiv" class="line">
<br/> <label class="label" for="villeArrive">Etape : </label>
<br/> <input type="text" class="form, villeText" id="villeArriveText" name="villeArriveText">
</label> <select class="form, villeSelect" name="villeArrive" id="villeArrive" required>
<option selected></option>
<label> <?php afficherVilles($db); ?>
<input name="date_heure" type="date" placeholder="Date et heure de départ" class="centrage" </select>
</div>
<div class="line">
<label class="label" for="date">Date départ : </label>
<input id="date" class="form" name="date_heure" type="date" placeholder="Date et heure de départ" class="centrage"
required> required>
<br/> </div>
</label>
<br/> <br/>
<label> <label>
<input id="submit" name="submit" type="submit" value="Rechercher" class="centrage"> <input id="submit" class="button" name="submit" type="submit" value="Rechercher" required>
</label> </label>
</form> </form>
</div>
<?php <?php
if (isset($_GET['error'])) { if (isset($_GET['error'])) {
echo "<p class='error'>" . getError($_GET['error']) . "</p>"; echo "<p class='error'>" . getError($_GET['error']) . "</p>";
} }
?> ?>
</div> </div>
</div>
</body> </body>
<script type="application/javascript" src="../ressources/libs/jquery-3.4.1.js"></script>
<script type="application/javascript" src="../ressources/libs/jquery-ui.min.js"></script>
<script src="recherche.js"></script>
</html> </html>

@ -88,7 +88,7 @@ function checkVoiture($db, $mail, $matricule)
function getTrajetsProposes($db, $mail) 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) { if ($result) {
$row = pg_fetch_array($result); $row = pg_fetch_array($result);
return $row[0]; return $row[0];
@ -98,7 +98,7 @@ function getTrajetsProposes($db, $mail)
function getTrajetsReserves($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) { if ($result) {
$row = pg_fetch_array($result); $row = pg_fetch_array($result);
return $row[0]; return $row[0];
@ -158,20 +158,20 @@ function afficherVilles($db)
function getDepart($db, $codetajet) 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; $return = false;
if ($result) { if ($result) {
$return = pg_fetch_array($result)[0]; $return = pg_fetch_array($result);
} }
return $return; return $return;
} }
function getFin($db, $codetajet) 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; $return = false;
if ($result) { if ($result) {
$return = pg_fetch_array($result)[0]; $return = pg_fetch_array($result);
} }
return $return; 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;
}
?> ?>

@ -4,6 +4,12 @@
font-family: "Arial"; font-family: "Arial";
} }
body {
background-image: url("../ressources/image/background.jpg");
background-size: cover;
background-attachment: fixed;
}
h1 { h1 {
font-size: 3em; font-size: 3em;
text-align: center; text-align: center;
@ -20,9 +26,11 @@ h1{
} }
#tableauBord { #tableauBord {
border-radius: 10px;
background-color: white;
margin: 2em; margin: 2em;
padding: 1em; padding: 1em;
width: 100%; width: 70%;
} }
#divImgProfil { #divImgProfil {
@ -42,6 +50,21 @@ h1{
border-radius: 10px; border-radius: 10px;
} }
.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 { #trajet {
margin-top: 2em; margin-top: 2em;
display: flex; display: flex;
@ -52,23 +75,6 @@ h1{
width: 100%; 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%; margin-left: 10%;
} }

@ -23,8 +23,8 @@ require_once ('../ressources/verifconnecte.php');
<img id="imgProfil" src="<?php echo getPathImgProfilTableau($mail); ?>"> <img id="imgProfil" src="<?php echo getPathImgProfilTableau($mail); ?>">
</div> </div>
<div id="trajet"> <div id="trajet">
<a class="btnTrajet" href="../deposerTrajet/depotTrajet.php">Déposer un trajet</a> <a class="button" href="../deposerTrajet/depotTrajet.php">Déposer un trajet</a>
<a id="btnTrajet2" class="btnTrajet" href="../recherche/recherche.php">Rechercher un trajet</a> <a id="btnTrajet2" class="button" href="../recherche/recherche.php">Rechercher un trajet</a>
</div> </div>
<div id="recap"> <div id="recap">
<div class="recapLine"> <div class="recapLine">

Loading…
Cancel
Save