From 017abf1c7a0fe3f0239575b1783d6845df8e732c Mon Sep 17 00:00:00 2001 From: Ricsi Date: Tue, 25 Apr 2017 23:17:14 +0200 Subject: [PATCH] fixes for coach preview + log display --- _class/class_log.php | 2 +- _include/include_log.php | 31 +++++++++++++++---------------- index.php | 0 template/templates/nav.tpl | 2 +- 4 files changed, 17 insertions(+), 18 deletions(-) mode change 100755 => 100644 index.php diff --git a/_class/class_log.php b/_class/class_log.php index 25da96e..98034f1 100644 --- a/_class/class_log.php +++ b/_class/class_log.php @@ -117,7 +117,7 @@ class log { elseif (strstr($this->get_log_category()->get_logc_name(), 'delete')) return 'delete'; elseif (strstr($this->get_log_category()->get_logc_name(), 'update')) return 'edit'; elseif (in_array($this->get_log_category()->get_logc_name(), array('training_close', 'training_open'))) return 'lock'; - elseif (in_array($this->get_log_category()->get_logc_name(), array('admin_login', 'admin_logout', 'kid_login', 'kid_logout'))) return 'login'; + elseif (in_array($this->get_log_category()->get_logc_name(), array('admin_login', 'admin_logout', 'kid_login', 'kid_logout', 'coach_login', 'coach_logout'))) return 'login'; } public function set_log_data_by_id($_log_id) { diff --git a/_include/include_log.php b/_include/include_log.php index d584589..aa706c6 100644 --- a/_include/include_log.php +++ b/_include/include_log.php @@ -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'); - ?> \ No newline at end of file diff --git a/index.php b/index.php old mode 100755 new mode 100644 diff --git a/template/templates/nav.tpl b/template/templates/nav.tpl index 1464cdf..9ee00c7 100755 --- a/template/templates/nav.tpl +++ b/template/templates/nav.tpl @@ -41,7 +41,7 @@
  • - + Kijelentkezés