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"];