Mettre à jour 'WEB/avis_laisses/avis_laisses.php'
This commit is contained in:
parent
78eac17d42
commit
65b1254997
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
//Importation des fichiers necessaires au fonctionnement
|
||||
session_start();
|
||||
require_once ("../connexionBD.php");
|
||||
require_once ("../ressources/user.php");
|
||||
@ -8,10 +9,14 @@ if (!isset($_SESSION['mail'])) {
|
||||
header('Location: ../index.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
//Recuperation de la variables de session
|
||||
$mail = $_SESSION['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;";
|
||||
$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 ="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>
|
||||
<h1 id = "titre">Avis Laissés</h1>
|
||||
<br>
|
||||
@ -43,20 +48,20 @@ $result = pg_query_params($db, $requete, array($mail));
|
||||
<div id = "avis">
|
||||
<table>
|
||||
<?php
|
||||
while ($row = pg_fetch_array($result)) {
|
||||
while ($row = pg_fetch_array($result)) { //Stockage des resultats des requete SQL
|
||||
$nom = $row['login'];
|
||||
$date = $row['dateavis'];
|
||||
$commentaire = $row['commentaire'];
|
||||
$note = $row['note'];
|
||||
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 "<h4 id='date'>".explode(' ',$date)[0]."</h4>";
|
||||
echo "<h5 id='avis'>$commentaire</h5>";
|
||||
echo "</td>";
|
||||
echo "<td id='note_tab'>";
|
||||
$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'>";
|
||||
$i++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user