diff --git a/.gitignore b/.gitignore index 7a4fc65..4df4448 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ config/config.php vendor composer.json composer.lock +/src/Framework/SwiftMailerFactory.php \ No newline at end of file diff --git a/public/index.php b/public/index.php index 0c7d10d..8c8159b 100644 --- a/public/index.php +++ b/public/index.php @@ -24,8 +24,7 @@ require 'vendor/autoload.php'; $chemin = $_SERVER['DOCUMENT_ROOT']; $chemin_new = substr($chemin,0,-6); -$app = (new \Framework\App( $chemin_new .'/config/apply.php')) -//$app = (new \Framework\App( '../config/apply.php')) +$app = (new \Framework\App( $chemin_new .'config/apply.php')) ->addModule(AdminModule::class) ->addModule(ContactModule::class) ->addModule(ProductModule::class) diff --git a/public/js/connex.js b/public/js/connex.js index 85fca62..bd7bc43 100644 --- a/public/js/connex.js +++ b/public/js/connex.js @@ -1,6 +1,5 @@ -function connexion(nom_connecte, mdp) { - - $.post("/ajax/connexion.php", { +function connexion(nom_connecte, mdp, chemin) { + $.post('/models/connexion.php', { nom_connecte: nom_connecte, mdp: mdp }, function (data, status) { diff --git a/public/js/script.js b/public/js/script.js index fe77086..f344981 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -9,7 +9,7 @@ function addRecord(antenne_slug, antenne_id, nom_connecte, id_user) { var quantite = $("#quantite").val(); var prix = $("#prix").val(); // Add record - $.post("/ajax/addRecord.php", { + $.post("/models/addRecord.php", { produit: produit, image: nom_image, vendeur: vendeur, @@ -46,7 +46,7 @@ function addRecord2(antenne_slug, antenne_id, nom_connecte, id_user) { var quantite = $("#quantite").val(); var prix = $("#prix").val(); // Add record - $.post("/ajax/addRecord2.php", { + $.post("/models/addRecord2.php", { produit: produit, image: nom_image, acheteur: acheteur, @@ -75,7 +75,7 @@ function addRecord2(antenne_slug, antenne_id, nom_connecte, id_user) { // READ records function readRecords(antenne_slug, nom_connecte) { - $.get("/ajax/readRecords.php", { + $.get("/models/readRecords.php", { antenne_slug: antenne_slug, nom_connecte: nom_connecte }, function (data, status) { @@ -84,7 +84,7 @@ function readRecords(antenne_slug, nom_connecte) { } // READ records2 function readRecords2(antenne_slug, nom_connecte) { - $.get("/ajax/readRecords2.php", { + $.get("/models/readRecords2.php", { antenne_slug: antenne_slug, nom_connecte: nom_connecte }, function (data, status) { @@ -96,7 +96,7 @@ function DeleteProduits(id, antenne_slug, nom_image) { $("#hidden_antenne_slug").val(antenne_slug); var conf = confirm("Etes-vous sûr(e) de vouloir supprimer ce bien ou service ?"); if (conf == true) { - $.post("/ajax/deleteProduits.php", { + $.post("/models/deleteProduits.php", { id: id, antenne_slug: antenne_slug, nom_image: nom_image @@ -114,7 +114,7 @@ function DeleteRecherches(id, antenne_slug, nom_image) { $("#hidden_antenne_slug_r").val(antenne_slug); var conf = confirm("Etes-vous sûr(e) de vouloir supprimer ce bien ou service ?"); if (conf == true) { - $.post("/ajax/deleteRecherches.php", { + $.post("/models/deleteRecherches.php", { id_r: id, antenne_slug: antenne_slug, nom_image: nom_image @@ -132,7 +132,7 @@ function GetProduitsDetails(id, antenne_slug, nom_image) { $("#hidden_user_id").val(id); $("#hidden_antenne_slug").val(antenne_slug); $("#hidden_image_name").val(nom_image); - $.post("/ajax/readProduitsDetails.php", { + $.post("/models/readProduitsDetails.php", { id: id }, function (data, status) { @@ -153,7 +153,7 @@ function GetRecherchesDetails(id, antenne_slug, nom_image) { $("#hidden_user_id_r").val(id); $("#hidden_antenne_slug_r").val(antenne_slug); $("#hidden_image_name_r").val(nom_image); - $.post("/ajax/readRecherchesDetails.php", { + $.post("/models/readRecherchesDetails.php", { id_r: id }, function (data, status) { @@ -180,7 +180,7 @@ function UpdateProduitsDetails(nom_connecte) { // Champs cachés var id = $("#hidden_user_id").val(); var antenne_slug = $("#hidden_antenne_slug").val(); - $.post("/ajax/updateProduitsDetails.php", { + $.post("/models/updateProduitsDetails.php", { id: id, produit: produit, image: nom_image, @@ -208,7 +208,7 @@ function UpdateRecherchesDetails(nom_connecte) { var id = $("#hidden_user_id_r").val(); var antenne_slug = $("#hidden_antenne_slug_r").val(); // Update the details by requesting to the server using ajax - $.post("/ajax/updateRecherchesDetails.php", { + $.post("/models/updateRecherchesDetails.php", { id: id, produit: produit, image: nom_image, @@ -252,7 +252,7 @@ $(document).ready(function () { // requête AJAX pour copier la photo et l'afficher $.ajax({ - url: '/ajax/upload.php', + url: '/models/upload.php', type: 'post', data: fd_add, contentType: false, @@ -283,7 +283,7 @@ $(document).ready(function () { fd.append('source',source); // requête AJAX pour copier la photo et l'afficher $.ajax({ - url: '/ajax/upload.php', + url: '/models/upload.php', type: 'post', data: fd, contentType: false, diff --git a/public/ajax/addRecord.php b/public/models/addRecord.php similarity index 100% rename from public/ajax/addRecord.php rename to public/models/addRecord.php diff --git a/public/ajax/addRecord2.php b/public/models/addRecord2.php similarity index 100% rename from public/ajax/addRecord2.php rename to public/models/addRecord2.php diff --git a/public/ajax/connexion.php b/public/models/connexion.php similarity index 100% rename from public/ajax/connexion.php rename to public/models/connexion.php diff --git a/public/ajax/deleteProduits.php b/public/models/deleteProduits.php similarity index 100% rename from public/ajax/deleteProduits.php rename to public/models/deleteProduits.php diff --git a/public/ajax/deleteRecherches.php b/public/models/deleteRecherches.php similarity index 100% rename from public/ajax/deleteRecherches.php rename to public/models/deleteRecherches.php diff --git a/public/ajax/getG1PubKey.php b/public/models/getG1PubKey.php similarity index 100% rename from public/ajax/getG1PubKey.php rename to public/models/getG1PubKey.php diff --git a/public/ajax/readProduitsDetails.php b/public/models/readProduitsDetails.php similarity index 100% rename from public/ajax/readProduitsDetails.php rename to public/models/readProduitsDetails.php diff --git a/public/ajax/readRecherchesDetails.php b/public/models/readRecherchesDetails.php similarity index 100% rename from public/ajax/readRecherchesDetails.php rename to public/models/readRecherchesDetails.php diff --git a/public/ajax/readRecords.php b/public/models/readRecords.php similarity index 97% rename from public/ajax/readRecords.php rename to public/models/readRecords.php index 7526114..55ddbf5 100644 --- a/public/ajax/readRecords.php +++ b/public/models/readRecords.php @@ -1,8 +1,9 @@ '.$cle_pub_format.''; $data .= ''.$row['quantite'].''; $data .= ''.$prix.''; - if ($row['username'] == $_GET['nom_connecte'] ) { + if ($row['username'] == $nom_connecte ) { $data .= ''; $data .= ' + onclick="connexion(document.getElementById('pseudo').value,document.getElementById('mdp').value)">Valider