56 lines
1.0 KiB
PHP
56 lines
1.0 KiB
PHP
<?php
|
|
|
|
|
|
# STATISZTIKÁK
|
|
|
|
if ($this->is_id()) {
|
|
|
|
# ADOTT STAT MEGJELENÍTÉSE
|
|
# nem lehet rá univerzális megoldást adni, mindegyiknél más kell majd
|
|
# todo: stat_group-ok és stat_value-k
|
|
|
|
if (1 == $this->get_id()) {
|
|
$balance_query = "
|
|
select
|
|
(select
|
|
sum(mod_sum)
|
|
from
|
|
money_deposit where mod_deleted = 0) - (select
|
|
sum(mox_sum)
|
|
from
|
|
money_expense where mox_deleted = 0) as diff
|
|
from dual;
|
|
";
|
|
|
|
$balance = $sql->single_variable($balance_query);
|
|
|
|
$smarty->assign('balance',$balance);
|
|
$smarty->display('stat_balance.tpl');
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
# STAT LISTA
|
|
|
|
$stat_query = "SELECT * FROM statistics WHERE stat_deleted = 0 ORDER BY stat_order ASC;";
|
|
$stat_assoc_array = $sql->assoc_array($stat_query);
|
|
|
|
$stats = array();
|
|
foreach ($stat_assoc_array as $stat) {
|
|
$new_stat = new stat();
|
|
$new_stat->set_stat_data_by_id($stat['stat_id']);
|
|
$stats[] = $new_stat;
|
|
}
|
|
|
|
$smarty->assign('stats',$stats);
|
|
$smarty->display('stat_list.tpl');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|