X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;ds=sidebyside;f=assistants%2Fbank.inc.php;h=eb04f230f993052eac4398ad2fa810e7a18fc05f;hb=90f6601d9959475df9685bae10f4e8c2193472d9;hp=5679871c7ba2a8c8362c7c19344ad5c33969cc20;hpb=048fadfc4e919831a4dc98efe65259657611cf6f;p=mirrors%2FSokoMan.git diff --git a/assistants/bank.inc.php b/assistants/bank.inc.php index 5679871..eb04f23 100644 --- a/assistants/bank.inc.php +++ b/assistants/bank.inc.php @@ -61,13 +61,17 @@ function bank_rename_account($ctx, $old, $new) { ); } -function bank_get_overview($ctx) { +function bank_get_overview($ctx,$prefix='') { global $bank_table; $accounts = bank_get_accounts($ctx); - foreach($accounts as $acc) $overview[]=array("${bank_table}_account"=>$acc,"${bank_table}_total"=>bank_get_total($ctx, $acc)); + foreach($accounts as $acc) $overview[]=array("${prefix}account"=>$acc,"${prefix}total"=>bank_get_total($ctx, $acc)); return $overview; } +if(isset($bank_json_only) && $bank_json_only) die(json_encode(array( + 'overview'=>bank_get_overview($this) +))); + if(isset($_POST['create_account'])) { bank_add_account($this, $_POST['account_name']); $this->post_redirect_get("$URL_INTERNAL","Účet byl vytvořen"); @@ -105,7 +109,7 @@ switch($SUBPATH[0]) { $result = $this->db->safe_query_fetch("SELECT SUM(${bank_table}_amount) as troughput FROM ${bank_table};"); echo("Obrat: ".$result[0]['troughput'].' '.$bank_currency); $result = $this->db->safe_query_fetch("SELECT * FROM `${bank_table}` ORDER BY ${bank_table}_time DESC;"); - echo $this->html->render_item_table(bank_get_overview($this),'bank'); + echo $this->html->render_item_table(bank_get_overview($this, $bank_table.'_'),'bank'); echo ("

Přehled transakcí

"); } else { $account=bank_name($_GET['account']); @@ -115,7 +119,7 @@ switch($SUBPATH[0]) { ?>
Převést - z účtu + z účtu na účet (pozor, dluhy se převádí opačným směrem než peníze!)

+ (pozor! zamysli se! převádíš peníze nebo dluhy?!)

Důvod: