From 048fadfc4e919831a4dc98efe65259657611cf6f Mon Sep 17 00:00:00 2001 From: Thomas Mudrunka Date: Sat, 25 May 2013 22:39:06 +0200 Subject: [PATCH] Posledni cilovy ucet --- assistants/bank.inc.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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: -- 2.30.2