diff --git a/WEB/Recherche.css b/WEB/Recherche.css
index bfb70ff..21aa5d2 100644
--- a/WEB/Recherche.css
+++ b/WEB/Recherche.css
@@ -1,34 +1,27 @@
.centrage{
text-align : center;
font-size: 20px;
- }
+}
.global {
- position: absolute; /* postulat de départ */
+ position: absolute; /* postulat de départ */
top: 45%; left: 50%; /* à 50%/50% du parent référent */
transform: translate(-50%, -50%); /* décalage de 50% de sa propre taille */
text-align : center;
-
- }
+}
.fort {
-
- font-weight: bold;
+ font-weight: bold;
text-align : center;
text-decoration: underline;
font-size : 30px;
+}
- }
-
.bord{
-
- border-radius: 20px;
- border-left: 2px solid black;
- border-right: 2px solid black;
- border-top: 2px solid black;
- border-bottom: 2px solid black;
- padding : 20px 80px 60px 80px;
-
- }
-
-
\ No newline at end of file
+ border-radius: 20px;
+ border-left: 2px solid black;
+ border-right: 2px solid black;
+ border-top: 2px solid black;
+ border-bottom: 2px solid black;
+ padding : 20px 80px 60px 80px;
+}
diff --git a/WEB/connectionBD.php b/WEB/connectionBD.php
deleted file mode 100644
index 8ee39c4..0000000
--- a/WEB/connectionBD.php
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
diff --git a/WEB/connexionBD.php b/WEB/connexionBD.php
new file mode 100644
index 0000000..4a25d3a
--- /dev/null
+++ b/WEB/connexionBD.php
@@ -0,0 +1,7 @@
+
diff --git a/WEB/deconnexion.php b/WEB/deconnexion.php
index c4dfb65..3941d16 100644
--- a/WEB/deconnexion.php
+++ b/WEB/deconnexion.php
@@ -1,21 +1,11 @@
= 0;
+ }).appendTo('#villeDepart');//add it to list
+ });
+
+ //copy options
+ let optionsEtape = $('#villeEtape option').clone();
+ //react on keyup in textbox
+ $('#villeEtapeText').keyup(function () {
+ let val = $(this).val().toString().toLowerCase();
+ $('#villeEtape').empty();
+ //take only the options containing your filter text or all if empty
+ optionsEtape.filter(function (idx, el) {
+ return val === '' || $(el).text().toLowerCase().indexOf(val) >= 0;
+ }).appendTo('#villeEtape');//add it to list
+ });
+
+ $("#ajoutEtape").click(function () {
+ let depart = $("#villeDepart");
+ let etape = $("#villeEtape");
+ let nbEtape = $("#nbEtapes");
+ if(etape.val() != null && etape.val() !== "" && depart.val() != null && depart.val() !== ""){
+ let option = $("#villeEtape option:selected");
+ let numero = (parseInt(nbEtape.val()));
+ $(this).parent().before("
" +
+ "Etape " + numero + " :" +
+ "" +
+ "
");
+ nbEtape.attr('value', parseInt(nbEtape.val())+1);
+ //$("#supprimerEtape").css("display", "initial");
+ $("#supprimerEtape").show();
+ }
+ });
+
+ $("#supprimerEtape").click(function () {
+ let etape = $(".etape:last");
+ let nbEtape = $("#nbEtapes");
+ if (parseInt(nbEtape.val())>0){
+ etape.remove();
+ nbEtape.attr('value', parseInt(nbEtape.val())-1);
+ if (parseInt(nbEtape.val())<=1){
+ //$("#supprimerEtape").css("display", "none");
+ $("#supprimerEtape").hide();
+ }
+ }
+ });
+});
\ No newline at end of file
diff --git a/WEB/deposerTrajet/depotTrajet.php b/WEB/deposerTrajet/depotTrajet.php
new file mode 100644
index 0000000..ad06b0e
--- /dev/null
+++ b/WEB/deposerTrajet/depotTrajet.php
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+ Déposer un trajet
+
+
+
+
+
+
+
+
+
diff --git a/WEB/deposer_avis/deposer_avis.css b/WEB/deposer_avis/deposer_avis.css
index 8531f3e..7930696 100644
--- a/WEB/deposer_avis/deposer_avis.css
+++ b/WEB/deposer_avis/deposer_avis.css
@@ -1,3 +1,10 @@
+/*
+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;
@@ -33,16 +40,18 @@ h1{
.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;
-}
+}
\ No newline at end of file
diff --git a/WEB/deposer_avis/deposer_avis.html b/WEB/deposer_avis/deposer_avis.html
index 5c84a0f..aede655 100644
--- a/WEB/deposer_avis/deposer_avis.html
+++ b/WEB/deposer_avis/deposer_avis.html
@@ -1,3 +1,10 @@
+
+
@@ -18,15 +25,24 @@
+
NOTE
- ☆☆☆☆☆
+
+
+
+
diff --git a/WEB/deposer_avis/deposer_avis.php b/WEB/deposer_avis/deposer_avis.php
index e69de29..039b31d 100644
--- a/WEB/deposer_avis/deposer_avis.php
+++ b/WEB/deposer_avis/deposer_avis.php
@@ -0,0 +1,38 @@
+
+
+
\ No newline at end of file
diff --git a/WEB/index_inscription.css b/WEB/index.css
similarity index 100%
rename from WEB/index_inscription.css
rename to WEB/index.css
diff --git a/WEB/index.php b/WEB/index.php
index d1f8b73..d959a89 100644
--- a/WEB/index.php
+++ b/WEB/index.php
@@ -1,71 +1,35 @@
$erreur";
- }
-}
-
-function getError($code){
- switch ($code){
- case 1:
- return "Adresse mail ou mot de passe invalide.";
- }
-}
-
-function authentification($mail, $password){
- global $db;
- $result = pg_query_params($db, "SELECT * FROM Utilisateur WHERE mail = $1;", array($mail));
- if ($result){
- $row = pg_fetch_array($result);
- return (strcmp($row["passwd"], $password)) == 0;
- }
- return false;
-}
-
-function init(){
- global $db;
- session_start();
-
- /*if(isset($_COOKIE['mail']) && isset($_COOKIE['password'])){
- if (authentification($_COOKIE['mail'], $_COOKIE['mail'])){
- $_SESSION['mail'] = $_COOKIE['mail'];
+session_start();
+require_once("connexionBD.php");
+require_once ('./ressources/user.php');
+
+if(!isset($_SESSION['mail'])){
+ if (isset($_POST['mail_field'])){
+
+ $mail = strtolower(htmlentities(pg_escape_string ($_POST['mail_field'])));
+ $password = htmlentities(pg_escape_string($_POST['password']));
+ $result = authentification($db, $mail, $password);
+ if($result) {
+ $_SESSION['mail'] = $mail;
+ header('Location: tableauBord/tableauBord.php');
+ exit();
}
- }*/
- if(!isset($_SESSION['mail'])){
- if (isset($_POST['mail_field'])){
-
- $mail = strtolower(htmlentities(pg_escape_string ($_POST['mail_field'])));
- $password = htmlentities(pg_escape_string($_POST['password']));
- $result = authentification($mail, $password);
- if($result) {
- $_SESSION['mail'] = $mail;
- header('Location: tableauBord/tableauBord.php');
- exit();
- }
- else {
- header('Location: index.php?error=1');
- exit();
- }
+ else {
+ header('Location: index.php?error=1');
+ exit();
}
}
- else{
- header('Location: tableauBord/tableauBord.php');
- exit();
- }
}
-
+else{
+ header('Location: tableauBord/tableauBord.php');
+ exit();
+}
?>
-
+
Bienvenue sur Upssi'Covoit
@@ -82,13 +46,13 @@ function init(){
$erreur";
}
?>
- Si vous n'avez pas de compte cliquez ici.
+ Si vous n'avez pas de compte cliquez ici.
-
\ No newline at end of file
+
diff --git a/WEB/inscription.php b/WEB/inscription.php
deleted file mode 100644
index 8c5a3a7..0000000
--- a/WEB/inscription.php
+++ /dev/null
@@ -1,182 +0,0 @@
-$erreur";
- }
-}
-
-function getError($code){
- switch ($code){
- case 1:
- return "L'adresse mail est invalide.";
- case 2:
- return "Cette adresse est déjà associée à un compte.";
- case 3:
- return "Ce login est déjà associé à un compte.";
- case 4:
- return "Le fichier envoyé doit être une image au format PNG.";
- case 5:
- return "La taille de l'image ne doit pas dépasser 2 MB.";
- case 6:
- return "Erreur lors de la création du compte.";
-
- }
-}
-
-function isMailUnique($mail){
- global $db;
- $result = pg_query_params($db, "SELECT * FROM Utilisateur WHERE mail = $1;", array($mail));
- if($result){
- $row = pg_fetch_array($result);
- return (strcmp($row['mail'], $mail) != 0);
- }
- return false;
-}
-
-function isLoginUnique($login){
- global $db;
- $result = pg_query_params($db, "SELECT * FROM Utilisateur WHERE login = $1;", array($login));
- if($result){
- $row = pg_fetch_array($result);
- return (strcmp($row['login'], $login) != 0);
- }
- return false;
-}
-
-function creerUtilisateur($mail, $password, $prenom, $nom, $login, $phone, $dateN){
- global $db;
- $result = pg_query_params($db, "INSERT INTO Utilisateur VALUES ($1, $2, $3, $4, $5, $6, to_date($7, 'YYYY/MM/DD'), false);", array($mail, $password, $prenom, $nom, $login, $phone, $dateN));
- return $result;
-}
-
-function uploadAvatar($mail){
- if(isset($_FILES['avatar']) and $_FILES['avatar']['name'] != "") {
- $target_file = "imageProfil/$mail.png";
- $file_tmp = $_FILES['avatar']['tmp_name'];
- $extension = end(explode('.', $_FILES['avatar']['name']));
- $check = getimagesize($file_tmp);
- if($check === false or !in_array($extension, array('png'))) {
- header('Location: inscription.php?error=4');
- exit();
- }
- else if ($_FILES['avatar']['size'] > 2 * 1024 * 1024){
- header('Location: inscription.php?error=5');
- exit();
- }
- else{
- move_uploaded_file($file_tmp, $target_file);
- }
- }
-}
-
-
-function init(){
- session_start();
- if(!isset($_SESSION['mail'])){
- if ($_SERVER['REQUEST_METHOD'] == 'POST' && empty($_POST) && empty($_FILES) && $_SERVER['CONTENT_LENGTH'] > 0 ){
- echo "PHP a ignoré les données POST à cause d'une requête dépassant post_max_size (".ini_get('post_max_size').").
";
- exit();
- }
- if(isset($_POST['mail_field'])){
- $login = htmlentities(pg_escape_string ($_POST['login_field']));
- $password = htmlentities(pg_escape_string ($_POST['password']));
- $prenom = htmlentities(pg_escape_string ($_POST['prenom']));
- $nom = htmlentities(pg_escape_string ($_POST['nom']));
- $dateN = htmlentities(pg_escape_string ($_POST['dateN']));
- $mail = strtolower(htmlentities(pg_escape_string ($_POST['mail_field'])));
- $phone = htmlentities(pg_escape_string ($_POST['phone']));
-
- if(!filter_var($mail, FILTER_VALIDATE_EMAIL)){
- header('Location: inscription.php?error=1');
- exit();
- }
- elseif(!isMailUnique($mail)){
- header('Location: inscription.php?error=2');
- exit();
- }
- elseif(!isLoginUnique($login)){
- header('Location: inscription.php?error=3');
- exit();
- }
- else{
- uploadAvatar($mail);
- $result = creerUtilisateur($mail, $password, $prenom, $nom, $login, $phone, $dateN);
- if($result){
- header('Location: index.php');
- }
- else{
- header('Location: inscription.php?error=6');
- }
- }
-
- }
- }
- else{
- header('Location: tableauBord/tableauBord.php');
- }
-}
-
-?>
-
-
-
-
-
- Inscription
-
-
-
-
-
-
\ No newline at end of file
diff --git a/WEB/inscription/inscription.css b/WEB/inscription/inscription.css
new file mode 100644
index 0000000..63d68a5
--- /dev/null
+++ b/WEB/inscription/inscription.css
@@ -0,0 +1,109 @@
+*{
+ margin: 0;
+ padding: 0;
+ font-family: "Arial";
+ font-size: 1em;
+}
+
+html, body{
+ height: 100%;
+}
+
+body{
+ display: flex;
+ flex-wrap: wrap;
+ flex-direction: row;
+ justify-content: center;
+ align-items: center;
+}
+
+#formulaire{
+ background-color: white;
+ border-radius: 10px;
+ padding: 4em;
+ width: 40%;
+}
+
+#enregistrer{
+ margin-top: 1em;
+ text-align: center;
+}
+
+h1{
+ text-align: center;
+}
+
+form{
+ margin-top: 3em;
+}
+
+.form{
+ box-sizing: border-box;
+ width: 55%;
+ border: 1px solid grey;
+ margin-bottom: 0.7em;
+}
+
+#avatar{
+ border-style: none;
+}
+
+.button{
+ cursor: pointer;
+ font-weight: bold;
+ padding: 8px;
+ color: white;
+ background-color: rgb(65, 154, 28);
+ border-radius: 5em;
+ border: none;
+}
+
+.button:hover{
+ background-color: rgb(48, 112, 20);
+ border-color: rgb(48, 112, 20);
+}
+
+.button:disabled{
+ cursor: not-allowed;
+ background-color: grey;
+}
+
+#submit{
+ margin-top: 1em;
+ margin-left: 50%;
+ transform: translate(-50%);
+}
+
+.line{
+ display: flex;
+ flex-wrap: wrap;
+ flex-direction: row;
+ justify-content: left;
+ width: 100%;
+}
+
+#error{
+ margin-bottom: 1em;
+}
+
+.error{
+ color: red;
+ text-align: center;
+}
+
+label{
+ box-sizing: border-box;
+ font-size: 1.1em;
+ width: 45%;
+ min-width: 8em;
+}
+
+h1{
+ font-size: 2em;
+}
+
+button{
+ color: forestgreen;
+ border-color: forestgreen;
+ border-radius: 5em;
+}
diff --git a/WEB/inscription.js b/WEB/inscription/inscription.js
similarity index 100%
rename from WEB/inscription.js
rename to WEB/inscription/inscription.js
diff --git a/WEB/inscription/inscription.php b/WEB/inscription/inscription.php
new file mode 100644
index 0000000..e431f2d
--- /dev/null
+++ b/WEB/inscription/inscription.php
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+ Inscription
+
+
+
+
+
+
diff --git a/WEB/profil/admin.php b/WEB/profil/admin.php
new file mode 100644
index 0000000..5f16aad
--- /dev/null
+++ b/WEB/profil/admin.php
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+ Administration
+
+
+
+