diff --git a/WEB/deposerTrajet/depotTrajet.css b/WEB/deposerTrajet/depotTrajet.css
new file mode 100644
index 0000000..8d7babf
--- /dev/null
+++ b/WEB/deposerTrajet/depotTrajet.css
@@ -0,0 +1,96 @@
+*{
+ font-family: "Arial";
+ padding: 0;
+ margin: 0;
+}
+
+body{
+ display: flex;
+ flex-wrap: wrap;
+ flex-direction: row;
+ justify-content: center;
+ align-items: center;
+}
+
+h1{
+ font-size: 2em;
+ text-align: center;
+ margin-bottom: 3em;
+}
+
+.villeSelect, .villeText{
+ box-sizing: border-box;
+ margin-bottom: 0.7em;
+}
+
+.villeText{
+ width: 20%;
+}
+
+.villeSelect{
+ margin-bottom: 0.7em;
+ margin-left: 2%;
+ width: 33%;
+}
+
+#supprimerEtape{
+ display: none;
+}
+
+#boutonEtape{
+ margin-top: 1.5em;
+ display: flex;
+ flex-wrap: wrap;
+ flex-direction: row;
+ justify-content: space-between;
+}
+
+#submit{
+ margin-top: 1em;
+ margin-left: 50%;
+ transform: translate(-50%);
+}
+
+#formulaire{
+ background-color: white;
+ border-radius: 10px;
+ padding: 4em;
+ width: 40%;
+}
+
+.form{
+ box-sizing: border-box;
+ width: 55%;
+ margin-bottom: 0.7em;
+}
+
+.button{
+ cursor: pointer;
+ font-weight: bold;
+ padding: 8px;
+ color: white;
+ background-color: rgb(65, 154, 28);
+ border-radius: 5em;
+ border: none;
+}
+
+.line{
+ display: flex;
+ flex-wrap: wrap;
+ flex-direction: row;
+ justify-content: left;
+ width: 100%;
+}
+
+.error{
+ margin-top: 1em;
+ color: red;
+ text-align: center;
+}
+
+.label{
+ box-sizing: border-box;
+ font-size: 1.1em;
+ width: 45%;
+ min-width: 8em;
+}
diff --git a/WEB/deposerTrajet/depotTrajet.js b/WEB/deposerTrajet/depotTrajet.js
new file mode 100644
index 0000000..3f199d4
--- /dev/null
+++ b/WEB/deposerTrajet/depotTrajet.js
@@ -0,0 +1,55 @@
+$(document).ready(function () {
+ //copy options
+ let options = $('#villeDepart option').clone();
+ //react on keyup in textbox
+ $('#villeDepartText').keyup(function () {
+ let val = $(this).val().toString().toLowerCase();
+ $('#villeDepart').empty();
+ //take only the options containing your filter text or all if empty
+ options.filter(function (idx, el) {
+ return val === '' || $(el).text().toLowerCase().indexOf(val) >= 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..e296b1b
--- /dev/null
+++ b/WEB/deposerTrajet/depotTrajet.php
@@ -0,0 +1,180 @@
+$modele";
+ }
+
+}
+
+//Afficher les voitures dans un select
+function afficherVilles($db)
+{
+ $villes = getListeVilles($db);
+ while ($row = pg_fetch_array($villes)) {
+ $nom = $row['nomville'];
+ $cp = $row['codepostal'];
+ echo "";
+ }
+}
+
+function printError()
+{
+ if (isset($_GET['error'])) {
+ $erreur = getError($_GET['error']);
+ echo "$erreur
";
+ }
+}
+
+function getError($code)
+{
+ switch ($code) {
+ case 1:
+ return "Erreur lors de la vérification des étapes.";
+ case 2:
+ return "Erreur lors de la vérification des dates.";
+ case 3:
+ return "Ce compte n'est pas associé à la voiture sélectionnée.";
+ case 4:
+ return "Erreur lors de l'enregistrement du trajet.";
+
+ }
+}
+
+require_once('../connexionBD.php');
+require_once('../ressources/trajet.php');
+
+session_start();
+//Utilisateur connecté
+if (!isset($_SESSION['mail'])) {
+ header('Location: ../index.php');
+ exit();
+}
+$mail = $_SESSION['mail'];
+//Tester que tous les champs ont été renseignés
+if (isset($_POST['dateDepart']) && isset($_POST['dateArrivee']) && isset($_POST['voiture']) && isset($_POST['villeDepart']) && isset($_POST['nbEtapes']) && isset($_POST['etape1'])) {
+ //Récupérer tous les $_POST en variables
+ $nbEtapes = htmlspecialchars(pg_escape_string($_POST['nbEtapes']));
+ $dateDepart = htmlspecialchars(pg_escape_string($_POST['dateDepart']));
+ $dateArrivee = htmlspecialchars(pg_escape_string($_POST['dateArrivee']));
+ $voiture = htmlspecialchars(pg_escape_string($_POST['voiture']));
+ $villeDepart = htmlspecialchars(pg_escape_string($_POST['villeDepart']));
+ $arrEtapes = array();
+ $i=1;
+ //Ajouter les étapes à un tableau
+ array_push($arrEtapes, htmlspecialchars(pg_escape_string($_POST['villeDepart'])));
+ while (isset($_POST['etape'.$i])){
+ array_push($arrEtapes, htmlspecialchars(pg_escape_string($_POST['etape'.$i])));
+ $i++;
+ }
+ //Vérifie le nombre d'étapes entré par l'utilisateur
+ if (count($arrEtapes) == 0 || intval($nbEtapes)<1 || intval($nbEtapes) != count($arrEtapes)){
+ header('Location: depotTrajet.php?error=1');
+ exit();
+ }
+ //Vérifie que les dates entrées par l'utilisateur ne se chevauchent pas et sont correctes
+ if (!checkDates($db, $mail, $dateDepart, $dateArrivee)){
+ header('Location: depotTrajet.php?error=2');
+ exit();
+ }
+ //Vérifie la voiture de l'utilisateur est correcte
+ if (!checkVoiture($db, $mail, $voiture)){
+ header('Location: depotTrajet.php?error=3');
+ exit();
+ }
+ //Creer le trajet en bd
+ $result = creerTrajet($db, $mail, $dateDepart, $dateArrivee, $voiture);
+ if ($result){
+ $codeTrajet = pg_fetch_array($result)[0];
+ //Creer les etapes en bd
+ $result = creerEtapes($db, $codeTrajet, $arrEtapes);
+ }
+ if (!$result){
+ header('Location: depotTrajet.php?error=4');
+ exit();
+ }
+
+}
+
+?>
+
+
+
+
+
+
+
+ Déposer un trajet
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WEB/ressources/libs/jquery-3.4.1.js b/WEB/ressources/libs/jquery-3.4.1.js
new file mode 100644
index 0000000..773ad95
--- /dev/null
+++ b/WEB/ressources/libs/jquery-3.4.1.js
@@ -0,0 +1,10598 @@
+/*!
+ * jQuery JavaScript Library v3.4.1
+ * https://jquery.com/
+ *
+ * Includes Sizzle.js
+ * https://sizzlejs.com/
+ *
+ * Copyright JS Foundation and other contributors
+ * Released under the MIT license
+ * https://jquery.org/license
+ *
+ * Date: 2019-05-01T21:04Z
+ */
+( function( global, factory ) {
+
+ "use strict";
+
+ if ( typeof module === "object" && typeof module.exports === "object" ) {
+
+ // For CommonJS and CommonJS-like environments where a proper `window`
+ // is present, execute the factory and get jQuery.
+ // For environments that do not have a `window` with a `document`
+ // (such as Node.js), expose a factory as module.exports.
+ // This accentuates the need for the creation of a real `window`.
+ // e.g. var jQuery = require("jquery")(window);
+ // See ticket #14549 for more info.
+ module.exports = global.document ?
+ factory( global, true ) :
+ function( w ) {
+ if ( !w.document ) {
+ throw new Error( "jQuery requires a window with a document" );
+ }
+ return factory( w );
+ };
+ } else {
+ factory( global );
+ }
+
+// Pass this if window is not defined yet
+} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+
+// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
+// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
+// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
+// enough that all such attempts are guarded in a try block.
+"use strict";
+
+var arr = [];
+
+var document = window.document;
+
+var getProto = Object.getPrototypeOf;
+
+var slice = arr.slice;
+
+var concat = arr.concat;
+
+var push = arr.push;
+
+var indexOf = arr.indexOf;
+
+var class2type = {};
+
+var toString = class2type.toString;
+
+var hasOwn = class2type.hasOwnProperty;
+
+var fnToString = hasOwn.toString;
+
+var ObjectFunctionString = fnToString.call( Object );
+
+var support = {};
+
+var isFunction = function isFunction( obj ) {
+
+ // Support: Chrome <=57, Firefox <=52
+ // In some browsers, typeof returns "function" for HTML