diff --git a/public/ajax/readRecords.php b/public/ajax/readRecords.php
index 174fc89..8d66f72 100644
--- a/public/ajax/readRecords.php
+++ b/public/ajax/readRecords.php
@@ -3,9 +3,8 @@ ini_set('display_errors', 0);
include '../../config/conf.php';
$antenne_slug = $_GET['antenne_slug'];
-if ($bdd === null ) {
- $bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
-}
+$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
+
// Design initial table header
$data = '
@@ -52,9 +51,7 @@ if ($bdd === null ) {
if ($row['username'] == $_GET['nom_connecte'] ) {
$data .= ')" class=\'btn btn-primary\'';
} else {
-
$data .= ')" class=\'btn btn-info\' disabled=true';
- //$('.btn-disabled').prop('disabled', true);
}
$data .= '>Mettre à jour';
$data .= '';
diff --git a/public/ajax/updateProduitsDetails.php b/public/ajax/updateProduitsDetails.php
index 381b623..86c39b8 100644
--- a/public/ajax/updateProduitsDetails.php
+++ b/public/ajax/updateProduitsDetails.php
@@ -3,11 +3,9 @@
include '../../config/conf.php';
$bdd = new \PDO("mysql:host=$host;dbname=$database_name", $username, $password);
-// check request
+
if(isset($_POST))
{
- // get values
-
$params["id"] = $_POST['id'];
$name = $_POST['produit'];
$quantite = $_POST['quantite'];
@@ -17,5 +15,4 @@ if(isset($_POST))
$requete = "UPDATE products SET name = '$name', quantite = '$quantite', prix = $prix WHERE id = :id";
$query = $bdd->prepare($requete);
$query->execute($params);
-
}
diff --git a/public/js/script.js b/public/js/script.js
index 4b68ccd..5b465fb 100644
--- a/public/js/script.js
+++ b/public/js/script.js
@@ -84,7 +84,9 @@ function DeleteProduits(id, antenne_slug) {
},
function (data, status) {
// Rechargement de la liste Biens/services
- readRecords(antenne_slug);
+ var nom_connecte = $("#nom_connecte").text();
+ // READ records on page load
+ readRecords(antenne_slug, nom_connecte);
}
);
}
diff --git a/src/Product/views/admin/products/index.twig b/src/Product/views/admin/products/index.twig
index e282bec..597814b 100644
--- a/src/Product/views/admin/products/index.twig
+++ b/src/Product/views/admin/products/index.twig
@@ -110,7 +110,7 @@
diff --git a/views/layout.twig b/views/layout.twig
index 359f716..f9471ca 100644
--- a/views/layout.twig
+++ b/views/layout.twig
@@ -2,8 +2,8 @@
{% block title "Ğ1-Marché " %}
-
+
+