fixes for coach preview + log display

This commit is contained in:
Ricsi
2017-04-25 23:17:14 +02:00
parent 3a97c7081a
commit 017abf1c7a
4 changed files with 17 additions and 18 deletions

View File

@@ -15,6 +15,7 @@ $fold = true;
//POST DATA HANDLER
//ha nem a gyerek belépéseit kérjük le ÉS létezik postolt logcategory és (nem létezik a cookie VAGY létezik de nem egyenlő az eddigivel)
$selected = "";
if (!isset($_REQUEST['login_kid']) && isset($_REQUEST['log_category']) && (!isset($_COOKIE['log_category']) || (isset($_COOKIE['log_category']) && $_COOKIE['log_category'] != $_REQUEST['log_category']))) {
if ($_REQUEST['log_category'] != 'null') $condition = "WHERE log_log_category_logc_id = " . $_REQUEST['log_category'];
//beállítjuk a cookie-t, rövid élettartammal
@@ -28,7 +29,6 @@ elseif (isset($_REQUEST['login_kid'])) {
$condition = "WHERE log_log_category_logc_id = 3 and log_user_id = " . $_REQUEST['login_kid'];
$fold = false;
}
//COOKIE HANDLER - igazából ide kell a condition leírása
if (isset($_COOKIE['log_category']) && $_COOKIE['log_category'] != 'null' && !$update && !isset($_REQUEST['login_kid'])) {
$condition = "WHERE log_log_category_logc_id = " . $_COOKIE['log_category'];
@@ -55,6 +55,20 @@ if ($this->is_id()) {
}
$smarty->assign('next_id', ($next_link?$this->get_id()+1:false));
$smarty->assign('previous_id', ($this->get_id()>1?$this->get_id()-1:false));
$log_assoc_array = $sql->assoc_array($log_query);
$log_array = array();
foreach ($log_assoc_array as $log_list_array) {
$current_log = new log();
$current_log->set_log_data_by_id($log_list_array['log_id']);
$log_array[] = $current_log;
}
$smarty->assign('selected', $selected);
$smarty->assign('fold', $fold);
$smarty->assign('logc_array', $log_categories);
$smarty->assign('log_array', $log_array);
$smarty->display('log.tpl');
}
else {
# LOG LIST
@@ -66,21 +80,6 @@ else {
*/
}
$log_assoc_array = $sql->assoc_array($log_query);
$log_array = array();
foreach ($log_assoc_array as $log_list_array) {
$current_log = new log();
$current_log->set_log_data_by_id($log_list_array['log_id']);
$log_array[] = $current_log;
}
$smarty->assign('selected', $selected);
$smarty->assign('fold', $fold);
$smarty->assign('logc_array', $log_categories);
$smarty->assign('log_array', $log_array);
$smarty->display('log.tpl');
?>