Correction affichage des boutons d'action suite à une suppression de bien/service
This commit is contained in:
parent
a4643f5890
commit
f9237f38d2
|
@ -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 = '<table class="table table-bordered table-striped">
|
||||
<tr style="color: black;">
|
||||
|
@ -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 .= '</button>';
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
|
||||
<button type="button" class="btn btn-primary"
|
||||
onclick="addRecord('{{ antenne_slug }}','{{ current_user().username }}',' {{ current_user().id }}')">Ajouter</button>
|
||||
onclick="addRecord('{{ antenne_slug }}','{{ current_user().username }}','{{ current_user().id }}')">Ajouter</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>{% block title "Ğ1-Marché " %}</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css"
|
||||
integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
|
||||
<!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css"-->
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootswatch/4.3.1/sandstone/bootstrap.min.css">
|
||||
<link rel="shortcut icon" type="image/x-icon" href="\images\favicon.ico">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Bree+Serif&display=swap">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Kalam&display=swap">
|
||||
|
|
Loading…
Reference in New Issue