You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<!--
|
|
|
|
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';
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|