Fix: Correction plantage lors ajout charges si le libelle contient des quot.

Fix: Utilisation des $_POST au lieu des variables non initialisées.
This commit is contained in:
Laurent Destailleur 2004-05-09 17:55:16 +00:00
parent 150021cf1d
commit 50e19ba363

View File

@ -47,13 +47,13 @@ function valeur($sql)
/* /*
* * Ajout d'une charge sociale
*/ */
if ($action == 'add') if ($action == 'add')
{ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, amount) "; $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, amount) ";
$sql .= " VALUES ($type,'$libelle','$date',$amount);"; $sql .= " VALUES (".$_POST["type"].",'".addslashes($_POST["libelle"])."','".$_POST["date"]."','".$_POST["amount"]."');";
if (! $db->query($sql) ) if (! $db->query($sql) )
{ {
@ -61,6 +61,10 @@ if ($action == 'add')
} }
} }
/*
* Suppression d'une charge sociale
*/
if ($_GET["action"] == 'del') if ($_GET["action"] == 'del')
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."chargesociales where rowid='".$_GET["id"]."'"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."chargesociales where rowid='".$_GET["id"]."'";
@ -71,6 +75,7 @@ if ($_GET["action"] == 'del')
} }
} }
$year=$_GET["year"]; $year=$_GET["year"];
$filtre=$_GET["filtre"]; $filtre=$_GET["filtre"];