|
|
@ -1,4 +1,5 @@
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
//Importation des fichiers necessaires au fonctionnement
|
|
|
|
session_start();
|
|
|
|
session_start();
|
|
|
|
require_once ("../connexionBD.php");
|
|
|
|
require_once ("../connexionBD.php");
|
|
|
|
require_once ("../ressources/user.php");
|
|
|
|
require_once ("../ressources/user.php");
|
|
|
@ -8,10 +9,14 @@ if (!isset($_SESSION['mail'])) {
|
|
|
|
header('Location: ../index.php');
|
|
|
|
header('Location: ../index.php');
|
|
|
|
exit();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Recuperation de la variables de session
|
|
|
|
$mail = $_SESSION['mail'];
|
|
|
|
$mail = $_SESSION['mail'];
|
|
|
|
|
|
|
|
|
|
|
|
$login = getLogin($db,$mail);
|
|
|
|
$login = getLogin($db,$mail);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Création et envoie de la requete SQL
|
|
|
|
$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 Utilisateur.login, Avis.commentaire, Avis.dateavis, Avis.note FROM Utilisateur, Avis, Trajet WHERE Avis.mailemetteur = $1 AND Avis.mailemetteur = Utilisateur.mail;";
|
|
|
|
$result = pg_query_params($db, $requete, array($mail));
|
|
|
|
$result = pg_query_params($db, $requete, array($mail));
|
|
|
|
|
|
|
|
|
|
|
@ -34,7 +39,7 @@ $result = pg_query_params($db, $requete, array($mail));
|
|
|
|
|
|
|
|
|
|
|
|
<div id = "container">
|
|
|
|
<div id = "container">
|
|
|
|
|
|
|
|
|
|
|
|
<div id ="entete">
|
|
|
|
<div id ="entete"> <-- Entete de la page -->
|
|
|
|
<a href = "../tableauBord/tableauBord.php"><img id = "bouton_retour" src = "../ressources/image/return.png" alt = "Bouton retour"></a>
|
|
|
|
<a href = "../tableauBord/tableauBord.php"><img id = "bouton_retour" src = "../ressources/image/return.png" alt = "Bouton retour"></a>
|
|
|
|
<h1 id = "titre">Avis Laissés</h1>
|
|
|
|
<h1 id = "titre">Avis Laissés</h1>
|
|
|
|
<br>
|
|
|
|
<br>
|
|
|
@ -43,20 +48,20 @@ $result = pg_query_params($db, $requete, array($mail));
|
|
|
|
<div id = "avis">
|
|
|
|
<div id = "avis">
|
|
|
|
<table>
|
|
|
|
<table>
|
|
|
|
<?php
|
|
|
|
<?php
|
|
|
|
while ($row = pg_fetch_array($result)) {
|
|
|
|
while ($row = pg_fetch_array($result)) { //Stockage des resultats des requete SQL
|
|
|
|
$nom = $row['login'];
|
|
|
|
$nom = $row['login'];
|
|
|
|
$date = $row['dateavis'];
|
|
|
|
$date = $row['dateavis'];
|
|
|
|
$commentaire = $row['commentaire'];
|
|
|
|
$commentaire = $row['commentaire'];
|
|
|
|
$note = $row['note'];
|
|
|
|
$note = $row['note'];
|
|
|
|
echo "<tr>";
|
|
|
|
echo "<tr>";
|
|
|
|
echo "<td class='avis_tab'>";
|
|
|
|
echo "<td class='avis_tab'>"; //Affichage sous forme de tableau pour la mise en page
|
|
|
|
echo "<h3 id='nom'>$nom</h3>";
|
|
|
|
echo "<h3 id='nom'>$nom</h3>";
|
|
|
|
echo "<h4 id='date'>".explode(' ',$date)[0]."</h4>";
|
|
|
|
echo "<h4 id='date'>".explode(' ',$date)[0]."</h4>";
|
|
|
|
echo "<h5 id='avis'>$commentaire</h5>";
|
|
|
|
echo "<h5 id='avis'>$commentaire</h5>";
|
|
|
|
echo "</td>";
|
|
|
|
echo "</td>";
|
|
|
|
echo "<td id='note_tab'>";
|
|
|
|
echo "<td id='note_tab'>";
|
|
|
|
$i=0;
|
|
|
|
$i=0;
|
|
|
|
while ($i<intval($note)){
|
|
|
|
while ($i<intval($note)){ //Affichage de la note laisses
|
|
|
|
echo "<img class='etoile' src='../ressources/image/star_full.png' alt='star'>";
|
|
|
|
echo "<img class='etoile' src='../ressources/image/star_full.png' alt='star'>";
|
|
|
|
$i++;
|
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|