54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
<?php
|
|
|
|
|
|
if ($this->is_id()) {
|
|
# EMPTY
|
|
}
|
|
else {
|
|
# EDZÉS LISTA
|
|
|
|
$action_list_query = "
|
|
SELECT
|
|
*
|
|
FROM
|
|
((SELECT
|
|
pr_training_tr_id as object_id,
|
|
tr_date as object_date,
|
|
if(pr_training_tr_id is not null, 'training', null) as object_type
|
|
FROM
|
|
presence
|
|
JOIN training ON tr_id = pr_training_tr_id
|
|
WHERE
|
|
pr_user_kid_uk_id = ". $user->get_uk_id() . "
|
|
AND tr_deleted = 0) UNION (SELECT
|
|
mod_id,
|
|
mod_date,
|
|
if(mod_id is not null, 'money_deposit', null) as object_type
|
|
FROM
|
|
money_deposit
|
|
WHERE
|
|
mod_user_kid_uk_id = ". $user->get_uk_id() . " and mod_deleted = 0)) actions
|
|
order by object_date DESC;
|
|
";
|
|
|
|
$action_assoc_array = $sql->assoc_array($action_list_query);
|
|
|
|
$actions = array();
|
|
foreach ($action_assoc_array as $action) {
|
|
if ($action['object_type'] == 'training') {
|
|
$new_training = new training();
|
|
$new_training->set_training_data_by_id($action['object_id']);
|
|
$actions[] = $new_training;
|
|
}
|
|
elseif ($action['object_type'] == 'money_deposit') {
|
|
$new_mod = new money_deposit();
|
|
$new_mod->set_mod_data_by_id($action['object_id']);
|
|
$actions[] = $new_mod;
|
|
}
|
|
}
|
|
$smarty->assign('actions', $actions);
|
|
$smarty->display('user_diary.tpl');
|
|
|
|
}
|
|
|
|
?>
|