From 50e19ba3630c4d88ae6fa7f2b36e14f400f57b01 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 9 May 2004 17:55:16 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20Correction=20plantage=20lors=20ajout=20c?= =?UTF-8?q?harges=20si=20le=20libelle=20contient=20des=20quot.=20Fix:=20Ut?= =?UTF-8?q?ilisation=20des=20$=5FPOST=20au=20lieu=20des=20variables=20non?= =?UTF-8?q?=20initialis=E9es.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/sociales/index.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 815f32bcf1a..60b2b426da8 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -47,13 +47,13 @@ function valeur($sql) /* - * + * Ajout d'une charge sociale */ if ($action == 'add') { $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) ) { @@ -61,6 +61,10 @@ if ($action == 'add') } } +/* + * Suppression d'une charge sociale + */ + if ($_GET["action"] == 'del') { $sql = "DELETE FROM ".MAIN_DB_PREFIX."chargesociales where rowid='".$_GET["id"]."'"; @@ -71,6 +75,7 @@ if ($_GET["action"] == 'del') } } + $year=$_GET["year"]; $filtre=$_GET["filtre"];