added raphael's work

avisTrajet
Flavien Haas 5 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,36 +1,46 @@
body {
color:black;
background-color:white;
background-image:url(background.jpg);
background-repeat:no-repeat;
background-size:104%;
margin: 0;
}
#container{
margin : 5% 5% 5% 5%;
background-color : white;
border : 2px solid black;
}
h1{
text-align : center;
font-size : 250%;
}
h2{
text-align : center;
font-size : 150%;
}
#bouton_retour{
transform : rotate(45deg);
}
.separation{
margin-top : 5%;
margin-left : 10%;
height: 200px;
width : 5px;
background: black;
}
/*
Crée par PALAFFRE Raphael
Fonction: Lister les avis recus
Page CSS : avis_recu.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,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

@ -1,57 +1,59 @@
/*
Crée par PALAFFRE Raphael
Fonction:Depot d'avis
Page PHP : deposer_avis.php
Page HTML : deposer_avis.html
*/
body {
color:black;
background-color:white;
background-image:url(background.jpg);
background-repeat:no-repeat;
background-size:104%;
margin: 0;
}
#container{
margin : 5% 15% 5% 15%;
background-color : white;
border : 2px solid black;
}
h1{
text-align : center;
font-size : 250%;
}
#form{
text-align:center;
}
#avis_laisse{
resize: none
}
#submit{
margin-bottom: 1%;
}
.rating {
direction: rtl;
}
.rating a {
color: #aaa;
text-decoration: none;
font-size: 3em;
transition: color .4s;
}
.rating a:hover,
.rating a:focus,
.rating a:hover ~ a,
.rating a:focus ~ a {
color: orange;
cursor: pointer;
/*
Crée par PALAFFRE Raphael
Fonction:Depot d'avis
Page PHP : deposer_avis.php
Page HTML : deposer_avis.html
*/
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% 15% 5% 15%;
background-color : white;
border : 2px solid black;
}
h1{
text-align : center;
font-size : 250%;
font-weight: bold;
}
#form{
text-align:center;
}
#avis_laisse{
resize: none
}
#submit{
margin-bottom: 1%;
}
.rating {
direction: rtl;
}
.rating a {
color: #aaa;
text-decoration: none;
font-size: 3em;
transition: color .4s;
}
.rating a:hover,
.rating a:focus,
.rating a:hover ~ a,
.rating a:focus ~ a {
color: orange;
cursor: pointer;
}

@ -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,38 +1,75 @@
<!--
Crée par PALAFFRE Raphael
Fonction:Depot d'avis
Page HTML : deposer_avis.html
Page CSS : deposer_avis.css
-->
<?PHP
require_once (connexionBD.php);
require_once (user.php);
if (!isset($_SESSION['mail'])) {
header('Location: ../index.php');
exit();
}
if (isset($_GET['codeTrajet'])) {
$mail = $_SESSION['mail'];
$avis = $_POST['avis_laisse'];
$note = $_POST['note'];
$date = date("Y-m-d H:i:s");
$estLu = 0;
$codeTrajet = $_GET['codeTrajet'];
$requete = "INSERT INTO Avis(mailEmetteur,codeTrajet,commentaire,dateAvis,note,estLu) VALUES ($mail,$codeTrajet,$avis,$date,$note,$estLu);";
$envoi = pg_query($db,$requete);
if ($envoi == FALSE){
echo 'Erreur d\'ecriture dans la BD';
}
}else{
echo 'Erreur codeTrajet';
}
?>
<?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'];
if (isset($_GET['codeTrajet'])) {
$mail = $_SESSION['mail'];
$avis = $_POST['avis_laisse'];
$note = $_POST['note'];
$date = date("Y-m-d H:i:s");
$estLu = 0;
$codeTrajet = $_GET['codeTrajet'];
$requete = "INSERT INTO Avis(mailEmetteur,codeTrajet,commentaire,dateAvis,note,estLu) VALUES ($mail,$codeTrajet,$avis,$date,$note,$estLu);";
$envoi = pg_query($db,$requete);
if ($envoi == FALSE){
echo 'Erreur d\'ecriture dans la BD';
}
}
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,36 +1,54 @@
body {
color:black;
background-color:white;
background-image:url(background.jpg);
background-repeat:no-repeat;
background-size:104%;
margin: 0;
}
#container{
margin : 5% 5% 5% 5%;
background-color : white;
border : 2px solid black;
}
h1{
text-align : center;
font-size : 250%;
}
h2{
text-align : center;
font-size : 150%;
}
#bouton_retour{
transform : rotate(45deg);
}
.separation{
margin-top : 5%;
margin-left : 10%;
height: 200px;
width : 5px;
background: black;
/*
Crée par PALAFFRE Raphael
Fonction: Lister les trajets recherché
Page PHP : liste.php
*/
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);
}
.separation{
margin-top : 5%;
margin-left : 20%;
height: 200px;
width : 5px;
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