added raphael's work

avisTrajet
Flavien Haas 6 years ago
parent 101d9dd428
commit 58e5e866a9

@ -1,29 +0,0 @@
<?php
?>
<!DOCTYPE html>
<html lang = "fr">
<head>
<meta charset = "UTF-8">
<link rel = "stylesheet" href = "avis_laisse.css">
<title>Liste des trajets</title>
</head>
<body>
<div id = "container">
<div id ="entete">
<a href = "LIEN TABLEAU DE BORD"><img id = "bouton_retour" src = "return.png" alt = "Bouton retour"></a>
<h1 class = "float" id = "titre">Avis laissés</h1>
<br>
</div>
<div id = "liste">
<hr class="separation" />
</div>
</div>
</body>
</html>

@ -0,0 +1,46 @@
/*
Crée par PALAFFRE Raphael
Fonction: Lister les avis laisses
Page CSS : avis_laisses.css
*/
body {
color:black;
background-color:white;
background-image:url(../resources/background.jpg);
background-repeat:no-repeat;
background-size:104%;
margin: 0;
font-family: Ubuntu,Helvetica,sans-serif;
}
#container{
margin : 5% 5% 5% 5%;
background-color : white;
border : 2px solid black;
}
h1{
text-align : center;
font-size : 250%;
font-weight: bold;
}
h2{
text-align : center;
font-size : 150%;
font-weight: bold;
}
#bouton_retour{
transform : rotate(45deg);
}
.etoile{
height:50px;
}
#avis_tab{
width:85%;
padding-left:15%;
}

@ -0,0 +1,89 @@
<?php
session_start();
require_once (../connexionBD.php);
require_once (../ressources/user.php);
//Si on est pas connecté redirection vers la page de connexion
if (!isset($_SESSION['mail'])) {
header('Location: ../index.php');
exit();
}
$mail = $_SESSION['mail'];
$login = getLogin($db,$mail);
$requete_commentaire = "SELECT commentaire FROM Avis WHERE Avis.mail = $mail";
$requete_dateAvis = "SELECT dateAvis FROM Avis WHERE Avis.mail = $mail";
$requete_note = "SELECT note FROM Avis WHERE Avis.mail = $mail";
$result_commentaire = pg_query_params($db, $requete_commentaire);
$resulttab_commentaire = pg_fetch_array($result_commentaire);
$result_dateAvis = pg_query_params($db, $requete_dateAvis);
$resulttab_dateAvis = pg_fetch_array($result_dateAvis);
$result_note = pg_query_params($db, $requete_note);
$resulttab_note = pg_fetch_array($result_note);
?>
<!DOCTYPE html>
<html lang = "fr">
<head>
<meta charset = "UTF-8">
<link rel = "stylesheet" href = "avis_laisses.css">
<link rel="icon" href="../ressources/favicon.ico" />
<title>Avis Laissés</title>
</head>
<body>
<div id = "container">
<div id ="entete">
<a href = "https://stri.flavien.ovh/tableauBord/tableauBord.php"><img id = "bouton_retour" src = "../resources/return.png" alt = "Bouton retour"></a>
<h1 id = "titre">Avis Laissés</h1>
<br>
</div>
<div id = "avis">
<table>
<tr>
<td id="avis_tab">
<?PHP
$i=0;
while (strlen($resulttab_commentaire)>$i){
echo "<h3 id=\"nom\"> $login </h3>"
echo "<h4 id=\"date\"> $resulttab_dateAvis[$i] </h4>"
echo "<h5 id=\"avis\"> $resulttab_dateAvis[$i] </h5>"
$i++;
}
?>
</td>
<td id="note_tab">
<?php
$j=0;
while (strlen($resulttab_note)>$j){
if ($resulttab_note[$j]==0){
echo "<img class=\"etoile\" src=\"../resources/star.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star.png\" alt=\"star\">";
}
else if ($resulttab_note[$j]==1) {
echo "<img class=\"etoile\" src=\"../resources/star_full.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star.png\" alt=\"star\">";
}
else if ($resulttab_note[$j]==2) {
echo "<img class=\"etoile\" src=\"../resources/star_full.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star_full.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star.png\" alt=\"star\">";
}
else {
echo "<img class=\"etoile\" src=\"../resources/star_full.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star_full.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star_full.png\" alt=\"star\">";
}
$i++;
}
?>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>

@ -1,10 +1,17 @@
/*
Crée par PALAFFRE Raphael
Fonction: Lister les avis recus
Page CSS : avis_recu.css
*/
body { body {
color:black; color:black;
background-color:white; background-color:white;
background-image:url(background.jpg); background-image:url(../resources/background.jpg);
background-repeat:no-repeat; background-repeat:no-repeat;
background-size:104%; background-size:104%;
margin: 0; margin: 0;
font-family: Ubuntu,Helvetica,sans-serif;
} }
#container{ #container{
@ -16,21 +23,24 @@ body {
h1{ h1{
text-align : center; text-align : center;
font-size : 250%; font-size : 250%;
font-weight: bold;
} }
h2{ h2{
text-align : center; text-align : center;
font-size : 150%; font-size : 150%;
font-weight: bold;
} }
#bouton_retour{ #bouton_retour{
transform : rotate(45deg); transform : rotate(45deg);
} }
.separation{ .etoile{
margin-top : 5%; height:50px;
margin-left : 10%; }
height: 200px;
width : 5px; #avis_tab{
background: black; width:85%;
} padding-left:15%;
}

@ -0,0 +1,82 @@
<?php
session_start();
require_once (../connexionBD.php);
require_once (../ressources/user.php);
//Si on est pas connecté redirection vers la page de connexion
if (!isset($_SESSION['mail'])) {
header('Location: ../index.php');
exit();
}
$mail = $_SESSION['mail'];
$login = getLogin($db,$mail);
$requete_commentaire = "SELECT commentaire FROM Avis WHERE Avis.mail != $mail";
$requete_dateAvis = "SELECT dateAvis FROM Avis WHERE Avis.mail != $mail";
$requete_note = "SELECT note FROM Avis WHERE Avis.mail != $mail";
$requete_login = "SELECT login FROM Avis WHERE Avis.mail != $mail";
$result_commentaire = pg_query_params($db, $requete_commentaire);
$resulttab_commentaire = pg_fetch_array($result_commentaire);
$result_dateAvis = pg_query_params($db, $requete_dateAvis);
$resulttab_dateAvis = pg_fetch_array($result_dateAvis);
$result_note = pg_query_params($db, $requete_note);
$resulttab_note = pg_fetch_array($result_note);
$result_login = pg_query_params($db, $requete_login);
$resulttab_login = pg_fetch_array($result_login);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset = "UTF-8">
<link rel = "stylesheet" href = "avis_recus.css">
<link rel="icon" href="../ressources/favicon.ico" />
<title>Avis Recus</title>
</head>
<body>
<div id = "container">
<div id ="entete">
<a href = "https://stri.flavien.ovh/tableauBord/tableauBord.php"><img id = "bouton_retour" src = "../resources/return.png" alt = "Bouton retour"></a>
<h1 id = "titre">Avis Recus</h1>
<br>
</div>
<div id = "avis">
<table>
<tr>
<td id="avis_tab">
<?php
$i=0;
while (strlen($resulttab_commentaire)>$i){
echo "<h3 id=\"nom\"> $resulttab_login[$i]</h3>"
echo "<h4 id=\"date\"> $resulttab_dateAvis[$i] </h4>"
echo "<h5 id=\"avis\"> $resulttab_dateAvis[$i] </h5>"
$i++;
}
?>
</td>
<td id="note_tab">
<?php
if ($note==0){
echo "<img class=\"etoile\" src=\"../resources/star.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star.png\" alt=\"star\">";
}
elseif ($note==1){
echo "<img class=\"etoile\" src=\"../resources/star_full.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star.png\" alt=\"star\">";
}
elseif ($note==2){
echo "<img class=\"etoile\" src=\"../resources/star_full.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star_full.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star.png\" alt=\"star\">";
}
else {
echo "<img class=\"etoile\" src=\"../resources/star_full.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star_full.png\" alt=\"star\"><img class=\"etoile\" src=\"../resources/star_full.png\" alt=\"star\">";
}
?>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

@ -8,10 +8,11 @@ Page HTML : deposer_avis.html
body { body {
color:black; color:black;
background-color:white; background-color:white;
background-image:url(background.jpg); background-image:url(../resources/background.jpg);
background-repeat:no-repeat; background-repeat:no-repeat;
background-size:104%; background-size:104%;
margin: 0; margin: 0;
font-family: Ubuntu,Helvetica,sans-serif;
} }
#container{ #container{
@ -23,6 +24,7 @@ body {
h1{ h1{
text-align : center; text-align : center;
font-size : 250%; font-size : 250%;
font-weight: bold;
} }
#form{ #form{

@ -1,56 +0,0 @@
<!--
Crée par PALAFFRE Raphael
Fonction:Depot d'avis
Page PHP : deposer_avis.php
Page CSS : deposer_avis.css
-->
<!DOCTYPE html>
<html lang = "fr">
<head>
<meta charset = "UTF-8">
<link rel = "stylesheet" href = "deposer_avis.css">
<title>Deposer un avis</title>
</head>
<body>
<div id = "container">
<div id ="entete">
<h1 id = "titre">Deposer un avis</h1>
</div>
<div id = "form">
<form id="formulaire_avis" action="deposer_avis.php" method="post">
<div>
<textarea id="avis_laisse" name="avis_laisse" form="formulaire_avis" rows="10" cols="100" placeholder="Avis"></textarea>
</div>
<h2>NOTE</h2>
<div class="rating">
<input type="radio" name="note" id="note5" value="5"/>
<a href="#5" label for ="note5" title="Donner 5 étoile"></a>
<input type="radio" name="note" id="note4" value="4"/>
<a href="#4" label for ="note4" title="Donner 4 étoiles"></a>
<input type="radio" name="note" id="note3" value="3"/>
<a href="#3" label for ="note3" title="Donner 3 étoiles"></a>
<input type="radio" name="note" id="note2" value="2"/>
<a href="#2" label for ="note2" title="Donner 2 étoiles"></a>
<input type="radio" name="note" id="note1" value="1"/>
<a href="#1" label for ="note1" title="Donner 1 étoiles"></a>
</div>
</br>
<div>
<input type="submit" value="Valider" id="submit">
</div>
</form>
</div>
</div>
</body>
</html>

@ -1,22 +1,18 @@
<!-- <?php
Crée par PALAFFRE Raphael session_start();
Fonction:Depot d'avis require_once (../connexionBD.php);
Page HTML : deposer_avis.html require_once (../ressources/user.php);
Page CSS : deposer_avis.css
-->
<?PHP
require_once (connexionBD.php);
require_once (user.php);
//Si on est pas connecté redirection vers la page de connexion
if (!isset($_SESSION['mail'])) { if (!isset($_SESSION['mail'])) {
header('Location: ../index.php'); header('Location: ../index.php');
exit(); exit();
} }
$mail = $_SESSION['mail'];
if (isset($_GET['codeTrajet'])) { if (isset($_GET['codeTrajet'])) {
$mail = $_SESSION['mail']; $mail = $_SESSION['mail'];
$avis = $_POST['avis_laisse']; $avis = $_POST['avis_laisse'];
$note = $_POST['note']; $note = $_POST['note'];
$date = date("Y-m-d H:i:s"); $date = date("Y-m-d H:i:s");
@ -30,9 +26,50 @@ if (isset($_GET['codeTrajet'])) {
if ($envoi == FALSE){ if ($envoi == FALSE){
echo 'Erreur d\'ecriture dans la BD'; echo 'Erreur d\'ecriture dans la BD';
} }
}else{
echo 'Erreur codeTrajet';
} }
else{
echo 'Erreur codeTrajet';
}
?> ?>
<!DOCTYPE html>
<html lang = "fr">
<head>
<!--
Crée par PALAFFRE Raphael
Fonction:Depot d'avis
Page PHP : deposer_avis.php
Page CSS : deposer_avis.css
-->
<meta charset = "UTF-8">
<link rel = "stylesheet" href = "deposer_avis.css">
<link rel="icon" href="../ressources/favicon.ico" />
<title>Deposer un avis</title>
</head>
<body>
<div id = "container">
<div id ="entete">
<h1 id = "titre">Deposer un avis</h1>
</div>
<div id = "form">
<form id="formulaire_avis" action="deposer_avis.php" method="post">
<div>
<textarea id="avis_laisse" name="avis_laisse" form="formulaire_avis" rows="10" cols="100" placeholder="Avis"></textarea>
</div>
<h2>NOTE</h2>
<div class="rating">
<input type="radio" name="note" id="note3" value="3"/>
<a href="#3" label for ="note3" title="Donner 3 étoiles"></a>
<input type="radio" name="note" id="note2" value="2"/>
<a href="#2" label for ="note2" title="Donner 2 étoiles"></a>
<input type="radio" name="note" id="note1" value="1"/>
<a href="#1" label for ="note1" title="Donner 1 étoiles"></a>
</div>
<br>
<div>
<input type="submit" value="Valider" id="submit">
</div>
</form>
</div>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

@ -1,33 +0,0 @@
<?php
$source = "Toulouse";
$dest = "Albi";
?>
<!DOCTYPE html>
<html lang = "fr">
<head>
<meta charset = "UTF-8">
<link rel = "stylesheet" href = "liste.css">
<title>Liste des trajets</title>
</head>
<body>
<div id = "container">
<div id ="entete">
<a href = "LIEN TABLEAU DE BORD"><img id = "bouton_retour" src = "return.png" alt = "Bouton retour"></a>
<h1 class = "float" id = "titre">Liste des trajets</h1>
<br>
<h2>Trajets recherchés : <?php echo $source ?> --> <?php echo $dest ?> </h2>
</div>
<div id = "liste">
<hr class="separation" />
</div>
</div>
</body>
</html>

@ -1,10 +1,17 @@
/*
Crée par PALAFFRE Raphael
Fonction: Lister les trajets recherché
Page PHP : liste.php
*/
body { body {
color:black; color:black;
background-color:white; background-color:white;
background-image:url(background.jpg); background-image:url(../resources/background.jpg);
background-repeat:no-repeat; background-repeat:no-repeat;
background-size:104%; background-size:104%;
margin: 0; margin: 0;
font-family: Ubuntu,Helvetica,sans-serif;
} }
#container{ #container{
@ -16,11 +23,13 @@ body {
h1{ h1{
text-align : center; text-align : center;
font-size : 250%; font-size : 250%;
font-weight: bold;
} }
h2{ h2{
text-align : center; text-align : center;
font-size : 150%; font-size : 150%;
font-weight: bold;
} }
#bouton_retour{ #bouton_retour{
@ -29,8 +38,17 @@ h2{
.separation{ .separation{
margin-top : 5%; margin-top : 5%;
margin-left : 10%; margin-left : 20%;
height: 200px; height: 200px;
width : 5px; width : 5px;
background: black; background: black;
} }
#ligne{
padding-left:10%;
width: 33%;
}
#info{
width: 60%;
}

@ -0,0 +1,73 @@
<?php
session_start();
require_once (../connexionBD.php);
//Si on est pas connecté redirection vers la page de connexion
if (!isset($_SESSION['mail'])) {
header('Location: ../index.php');
exit();
}
$mail = $_SESSION['mail'];
/*
Crée par PALAFFRE Raphael
Fonction: Lister les trajets recherché
Page CSS : liste.css
Donnée en entrée : lieu_depart, lieu_arrivee et date_heure <- recherche.php
Donnée en sortie : $login et $codeTrajet -> contact.php
*/
$source=$_POST['lieu_depart'];
$dest=$_POST['lieu_arrivee'];
$date_depart=$_POST['date_heure'];
$requete="SELECT codeTrajet, dateDepart, dateArrivee, mailProposition FROM Trajet WHERE Trajet.dateDepart=$date_depart AND (SELECT codeTrajet FROM Traverser WHERE nomVille=$source AND nomVille=$dest)=Trajet.codeTrajet;";
$envoi = pg_query($db,$requete);
if ($envoi == FALSE){
echo 'Erreur !';
}
?>
<!DOCTYPE html>
<html lang = "fr">
<head>
<meta charset = "UTF-8">
<link rel = "stylesheet" href = "liste_trajet.css">
<link rel="icon" href="../ressources/favicon.ico" />
<title>Liste des trajets</title>
</head>
<body>
<div id = "container">
<div id ="entete">
<a href = "../tableauBord/tableauBord.php"><img id = "bouton_retour" src = "../resources/return.png" alt = "Bouton retour"></a>
<h1 class = "float" id = "titre">Liste des trajets</h1>
<br>
<h2>Trajets recherchés : <?php echo $source." --> ".$dest; ?></h2>
</div>
<div id = "liste">
<table>
<tr>
<td id="ligne">
<hr class="separation" />
</td>
<td id="info">
<?php echo "$date_depart - $source --> $dest : $login";
//sourcedest recupéré avec le code du trajet, afficher plusieurs avec un while
?>
</td>
<td id="reserver">
<form action="contact.php" method="POST">
<?php
echo "<input type=\"hidden\" name=\"login\" value=\"$login\"/>";
echo "<input type=\"hidden\" name=\"codeTrajet\" value=\"$codeTrajet\"/>";
?>
<input type="submit" value="Reserver">
</form>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Loading…
Cancel
Save