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; Crée par PALAFFRE Raphael
background-color:white; Fonction: Lister les avis recus
background-image:url(background.jpg); Page CSS : avis_recu.css
background-repeat:no-repeat; */
background-size:104%;
margin: 0; body {
} color:black;
background-color:white;
#container{ background-image:url(../resources/background.jpg);
margin : 5% 5% 5% 5%; background-repeat:no-repeat;
background-color : white; background-size:104%;
border : 2px solid black; margin: 0;
} font-family: Ubuntu,Helvetica,sans-serif;
}
h1{
text-align : center; #container{
font-size : 250%; margin : 5% 5% 5% 5%;
} background-color : white;
border : 2px solid black;
h2{ }
text-align : center;
font-size : 150%; h1{
} text-align : center;
font-size : 250%;
#bouton_retour{ font-weight: bold;
transform : rotate(45deg); }
}
h2{
.separation{ text-align : center;
margin-top : 5%; font-size : 150%;
margin-left : 10%; font-weight: bold;
height: 200px; }
width : 5px;
background: black; #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 Crée par PALAFFRE Raphael
Fonction:Depot d'avis Fonction:Depot d'avis
Page PHP : deposer_avis.php Page PHP : deposer_avis.php
Page HTML : deposer_avis.html 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{
margin : 5% 15% 5% 15%; #container{
background-color : white; margin : 5% 15% 5% 15%;
border : 2px solid black; background-color : white;
} border : 2px solid black;
}
h1{
text-align : center; h1{
font-size : 250%; text-align : center;
} font-size : 250%;
font-weight: bold;
#form{ }
text-align:center;
} #form{
text-align:center;
#avis_laisse{ }
resize: none
} #avis_laisse{
resize: none
#submit{ }
margin-bottom: 1%;
} #submit{
margin-bottom: 1%;
.rating { }
direction: rtl;
} .rating {
direction: rtl;
.rating a { }
color: #aaa;
text-decoration: none; .rating a {
font-size: 3em; color: #aaa;
transition: color .4s; text-decoration: none;
} font-size: 3em;
transition: color .4s;
.rating a:hover, }
.rating a:focus,
.rating a:hover ~ a, .rating a:hover,
.rating a:focus ~ a { .rating a:focus,
color: orange; .rating a:hover ~ a,
cursor: pointer; .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 @@
<!-- <?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
--> //Si on est pas connecté redirection vers la page de connexion
if (!isset($_SESSION['mail'])) {
<?PHP header('Location: ../index.php');
exit();
require_once (connexionBD.php); }
require_once (user.php);
$mail = $_SESSION['mail'];
if (!isset($_SESSION['mail'])) {
header('Location: ../index.php'); if (isset($_GET['codeTrajet'])) {
exit(); $mail = $_SESSION['mail'];
} $avis = $_POST['avis_laisse'];
$note = $_POST['note'];
if (isset($_GET['codeTrajet'])) { $date = date("Y-m-d H:i:s");
$mail = $_SESSION['mail']; $estLu = 0;
$avis = $_POST['avis_laisse']; $codeTrajet = $_GET['codeTrajet'];
$note = $_POST['note'];
$date = date("Y-m-d H:i:s"); $requete = "INSERT INTO Avis(mailEmetteur,codeTrajet,commentaire,dateAvis,note,estLu) VALUES ($mail,$codeTrajet,$avis,$date,$note,$estLu);";
$estLu = 0;
$codeTrajet = $_GET['codeTrajet']; $envoi = pg_query($db,$requete);
$requete = "INSERT INTO Avis(mailEmetteur,codeTrajet,commentaire,dateAvis,note,estLu) VALUES ($mail,$codeTrajet,$avis,$date,$note,$estLu);"; if ($envoi == FALSE){
echo 'Erreur d\'ecriture dans la BD';
$envoi = pg_query($db,$requete); }
}
if ($envoi == FALSE){ else{
echo 'Erreur d\'ecriture dans la BD'; echo 'Erreur codeTrajet';
} }
?>
}else{ <!DOCTYPE html>
echo 'Erreur codeTrajet'; <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; Crée par PALAFFRE Raphael
background-color:white; Fonction: Lister les trajets recherché
background-image:url(background.jpg); Page PHP : liste.php
background-repeat:no-repeat; */
background-size:104%;
margin: 0; body {
} color:black;
background-color:white;
#container{ background-image:url(../resources/background.jpg);
margin : 5% 5% 5% 5%; background-repeat:no-repeat;
background-color : white; background-size:104%;
border : 2px solid black; margin: 0;
} font-family: Ubuntu,Helvetica,sans-serif;
}
h1{
text-align : center; #container{
font-size : 250%; margin : 5% 5% 5% 5%;
} background-color : white;
border : 2px solid black;
h2{ }
text-align : center;
font-size : 150%; h1{
} text-align : center;
font-size : 250%;
#bouton_retour{ font-weight: bold;
transform : rotate(45deg); }
}
h2{
.separation{ text-align : center;
margin-top : 5%; font-size : 150%;
margin-left : 10%; font-weight: bold;
height: 200px; }
width : 5px;
background: black; #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