From 27b5740b5c0b8fbd4f21c964f31089aadc13b0f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Fri, 5 Nov 2010 19:01:23 +0100 Subject: [PATCH] Update web view --- www/User.php | 6 +++--- www/index.php | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/www/User.php b/www/User.php index 63fba66..87eea4f 100644 --- a/www/User.php +++ b/www/User.php @@ -47,9 +47,9 @@ class User function IsAccountBlocked($id) { - foreach($this->accounts as $i => $ac) - if ($ac->id == $id) - return $ac["blocked"] == "1"; + foreach($this->accounts as $i => $account) + if ($account["id"] == "$id") + return $account["blocked"] == "1"; return false; } diff --git a/www/index.php b/www/index.php index a9dc96a..aad419e 100644 --- a/www/index.php +++ b/www/index.php @@ -107,15 +107,12 @@ while($operation = $operations->fetchArray()) if ($date <= $cur_date) $accounts[$operation["account"]]["cur"] += $operation["amount"]; - if ($operation["transfert"] != "" && ($operation["amount"] < 0 - || $_SESSION["user"]->IsAccountBlocked($operation["account"]))) + if (!($operation["transfert"] == "" || ($operation["amount"] > 0 && $_SESSION["user"]->IsAccountBlocked($operation["account"])))) continue; if ($operation["transfert"] != "") - { $operation["amount"] = -$operation["amount"]; - } if ($operation["amount"] < 0) {