From 9b31642804522d383c328bf8b155e71e727c7ec6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Nov 2004 20:45:52 +0000 Subject: [PATCH] Fix: Corrections pour register_globals=off Doc: Documentation doxygen --- htdocs/compta/bank/categ.php | 56 ++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 0ce0c8b7168..ea3d73a607d 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -20,6 +20,14 @@ * $Source$ * */ + +/*! + \file htdocs/compta/bank/categ.php + \ingroup compta + \brief Page ajout de catégories banaires + \version $Revision$ +*/ + require("./pre.inc.php"); $user->getrights('compta'); @@ -29,33 +37,34 @@ if (!$user->admin && !$user->rights->compta->bank) llxHeader(); -if ($action == 'add') + +/* + * Actions ajout catégorie + */ +if ($_POST["action"] == 'add') { - if ($credit > 0) - { - $amount = $credit ; - } - else - { - $amount = - $debit ; - } - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_categ (label) VALUES ('$label')"; - $result = $db->query($sql); - - if (!$result) - { - print $db->error(); - print "

$sql"; + if ($_POST["label"]) { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_categ (label) VALUES ('".$_POST["label"]."')"; + $result = $db->query($sql); + + if (!$result) + { + dolibarr_print_error($db); + } } } -print_titre("Catégories"); + +/* + * Affichage liste des catégories + */ + +print_titre($langs->trans("Categories")); print '

'; print ""; -print ''; +print '
'; print ''; -print ''; +print ''; print "\n"; $sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_categ ORDER BY label"; @@ -79,7 +88,12 @@ if ($result) } $db->free(); } -print ""; + +/* + * Affichage ligne ajout de catégorie + */ +$var=!$var; +print ""; print ""; print ""; print "
Num'.$langs->trans("Description").''.$langs->trans("Ref").''.$langs->trans("Label").'
 trans("Add")."\"
";