balance list can be sorted. balanace can be updated

This commit is contained in:
Ricsi
2017-02-18 00:14:40 +01:00
parent 9d418a2619
commit 40585222d7
3 changed files with 132 additions and 112 deletions

View File

@@ -1,27 +1,37 @@
<?php
# HA NINCS ID, AKKOR EGYENLEGLISTA
# HA VAN ID, AKKOR EMPTY
# HA VAN ID, AKKOR RENDEZÉS IS VAN
if ($this->is_id()) {
# EMPTY
# RENDEZÉS
/*
1 - egyenleg szerint növekvő
*/
$order_by = 'uk_balance ASC';
$url_postfix = '/' . $this->get_id();
}
else {
# EGYENLEG LISTA
$active_kid_assoc_array = $sql->assoc_array('select * from user_kid where uk_deleted = 0 and uk_is_active = 1 order by uk_name asc;');
$user_kids = array();
foreach ($active_kid_assoc_array as $kid) {
$new_kid = new user_kid();
$new_kid->set_user_data_by_id($kid['uk_id']);
$user_kids[] = $new_kid;
}
$smarty->assign('user_kids', $user_kids);
$smarty->display('user_balance_list.tpl');
$order_by = 'uk_name ASC';
$url_postfix = '';
}
$active_kid_assoc_array = $sql->assoc_array('select * from user_kid where uk_deleted = 0 and uk_is_active = 1 order by '. $order_by .';');
$user_kids = array();
foreach ($active_kid_assoc_array as $kid) {
$new_kid = new user_kid();
$new_kid->set_user_data_by_id($kid['uk_id']);
$user_kids[] = $new_kid;
}
$smarty->assign('user_kids', $user_kids);
$smarty->assign('url_postfix', $url_postfix);
$smarty->display('user_balance_list.tpl');
?>

View File

@@ -89,7 +89,7 @@
limit 1)
order by tr_date ASC
limit 2) elso2edzes) as 'first_two'
FROM
FROM
((SELECT
pr_training_tr_id as object_id,
timestamp(tr_date) as object_date,
@@ -108,7 +108,7 @@ FROM
WHERE
mod_user_kid_uk_id = ".$user->get_uk_id()."
and mod_deleted = 0)) actions
order by object_date ASC;
order by object_date ASC;
";
$action_assoc_array = $sql->assoc_array($action_list_query);
@@ -141,6 +141,8 @@ order by object_date ASC;
//$smarty->assign('actions', $actions);
}
}
header('Location: /admin/balance_list' . ($this->is_id()?'/'.$this->get_id():''));
?>

View File

@@ -1,3 +1,11 @@
<div class="buttons">
<a href="/admin/balance_list" class="addbutton big">Név szerinti rendezés</a>
<a href="/admin/balance_list/1" class="addbutton big">Egyenleg szerinti rendezés</a>
<a href="/admin/money_update{$url_postfix}" class="addbutton add-big">Egyenleg frissítése</a>
</div>
<div class="list">
{foreach $user_kids as $user}
<a href="#">