| '.$langs->trans("Ref").' | ';
print '';
if ($_GET["account"])
{
- if (! preg_match('/,/',$_GET["account"]))
+ if (! preg_match('/,/', $id))
{
print $form->showrefnav($acct, 'ref', $linkback, 1, 'ref');
}
else
{
$bankaccount=new Account($db);
- $listid=explode(',',$_GET["account"]);
- foreach($listid as $key => $id)
+ $listid=explode(',', $id);
+ foreach($listid as $key => $aId)
{
- $bankaccount->fetch($id);
+ $bankaccount->fetch($aId);
$bankaccount->label=$bankaccount->ref;
print $bankaccount->getNomUrl(1);
if ($key < (count($listid)-1)) print ', ';
@@ -166,7 +169,7 @@ print ' |
';
// Label
print '| '.$langs->trans("Label").' | ';
print '';
-if ($_GET["account"])
+if (! empty($id))
{
print $acct->label;
}
@@ -254,7 +257,8 @@ $sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= " WHERE b.fk_account = ba.rowid";
$sql.= " AND ba.entity = ".$conf->entity;
-if ($_GET["account"]) $sql.= " AND b.fk_account IN (".$_GET["account"].")";
+if (! empty($id))
+ $sql.= " AND b.fk_account IN (".$db->escape($id).")";
$resql=$db->query($sql);
if ($resql)
@@ -273,8 +277,6 @@ print "";
print "\n\n";
-$db->close();
-
llxFooter();
-
+$db->close();
?>
diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php
index 61e73c4a9a3..64ad316dc24 100644
--- a/htdocs/compta/bank/index.php
+++ b/htdocs/compta/bank/index.php
@@ -1,7 +1,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur
- * Copytight (C) 2005-2009 Regis Houssin
+ * Copytight (C) 2005-2012 Regis Houssin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,7 +35,7 @@ $langs->load("categories");
if ($user->societe_id) $socid=$user->societe_id;
$result=restrictedArea($user,'banque');
-$statut=isset($_GET["statut"])?$_GET["statut"]:'';
+$statut=GETPOST('statut');
diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php
index f7389344721..b6e655db021 100644
--- a/htdocs/compta/bank/rappro.php
+++ b/htdocs/compta/bank/rappro.php
@@ -37,14 +37,15 @@ $langs->load("bills");
if (! $user->rights->banque->consolidate) accessforbidden();
-
+$action=GETPOST('action', 'alpha');
+$id=GETPOST('account', 'int');
/*
* Actions
*/
// Conciliation
-if ($user->rights->banque->consolidate && $_POST["action"] == 'rappro')
+if ($action == 'rappro' && $user->rights->banque->consolidate)
{
// Definition, nettoyage parametres
$num_releve=trim($_POST["num_releve"]);
@@ -77,7 +78,7 @@ if ($user->rights->banque->consolidate && $_POST["action"] == 'rappro')
/*
* Action suppression ecriture
*/
-if ($_GET["action"] == 'del')
+if ($action == 'del')
{
$accline=new AccountLine($db);
$accline->fetch($_GET["rowid"]);
@@ -127,13 +128,13 @@ $paymentsupplierstatic=new PaiementFourn($db);
$paymentvatstatic=new TVA($db);
$acct = new Account($db);
-$acct->fetch($_GET["account"]);
+$acct->fetch($id);
$now=dol_now();
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type as type";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
-$sql.= " WHERE rappro=0 AND fk_account=".$_GET["account"];
+$sql.= " WHERE rappro=0 AND fk_account=".$acct->id;
$sql.= " ORDER BY dateo ASC";
$sql.= " LIMIT 1000"; // Limit to avoid page overload
@@ -163,7 +164,7 @@ if ($resql)
$var=True;
$num = $db->num_rows($resql);
- print_fiche_titre($langs->trans("Reconciliation").': '.$acct->label.'');
+ print_fiche_titre($langs->trans("Reconciliation").': '.$acct->label.'');
print ' ';
dol_htmloutput_mesg($mesg);
@@ -172,7 +173,7 @@ if ($resql)
$nbmax=5;
$liste="";
$sql = "SELECT DISTINCT num_releve FROM ".MAIN_DB_PREFIX."bank";
- $sql.= " WHERE fk_account=".$_GET["account"]." AND num_releve IS NOT NULL";
+ $sql.= " WHERE fk_account=".$acct->id." AND num_releve IS NOT NULL";
$sql.= $db->order("num_releve","DESC");
$sql.= $db->plimit($nbmax+1);
print $langs->trans("LastAccountStatements").' : ';
@@ -186,7 +187,7 @@ if ($resql)
$objr = $db->fetch_object($resqlr);
$last_releve = $objr->num_releve;
$i++;
- $liste='num_releve.'">'.$objr->num_releve.' '.$liste;
+ $liste=''.$objr->num_releve.' '.$liste;
}
if ($numr >= $nbmax) $liste="... ".$liste;
print $liste;
@@ -199,10 +200,10 @@ if ($resql)
}
- print ' |