From: Thomas Mudrunka Date: Sat, 25 May 2013 20:39:06 +0000 (+0200) Subject: Posledni cilovy ucet X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=048fadfc4e919831a4dc98efe65259657611cf6f;p=mirrors%2FSokoMan.git Posledni cilovy ucet --- diff --git a/assistants/bank.inc.php b/assistants/bank.inc.php index 449249b..5679871 100644 --- a/assistants/bank.inc.php +++ b/assistants/bank.inc.php @@ -26,6 +26,13 @@ function bank_get_accounts($ctx, $all=false) { return $accounts; } +function bank_get_last_to($ctx, $account) { + global $bank_table; + $account=$ctx->db->quote(bank_name($account)); + $fetch = $ctx->db->safe_query_fetch("SELECT ${bank_table}_to FROM ${bank_table} WHERE ${bank_table}_from=$account ORDER BY ${bank_table}_time DESC LIMIT 1;"); + return $fetch[0][$bank_table.'_to']; +} + function bank_add_account($ctx, $name) { bank_transaction($ctx, $name, $name, "Created account \"$name\""); } @@ -110,7 +117,14 @@ switch($SUBPATH[0]) { Převést z účtu na účet (pozor, dluhy se převádí opačným směrem než peníze!)

Důvod: