fixes for coach preview + log display
This commit is contained in:
@@ -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(), 'delete')) return 'delete';
|
||||||
elseif (strstr($this->get_log_category()->get_logc_name(), 'update')) return 'edit';
|
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('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) {
|
public function set_log_data_by_id($_log_id) {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ $fold = true;
|
|||||||
|
|
||||||
//POST DATA HANDLER
|
//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)
|
//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 (!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'];
|
if ($_REQUEST['log_category'] != 'null') $condition = "WHERE log_log_category_logc_id = " . $_REQUEST['log_category'];
|
||||||
//beállítjuk a cookie-t, rövid élettartammal
|
//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'];
|
$condition = "WHERE log_log_category_logc_id = 3 and log_user_id = " . $_REQUEST['login_kid'];
|
||||||
$fold = false;
|
$fold = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//COOKIE HANDLER - igazából ide kell a condition leírása
|
//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'])) {
|
if (isset($_COOKIE['log_category']) && $_COOKIE['log_category'] != 'null' && !$update && !isset($_REQUEST['login_kid'])) {
|
||||||
$condition = "WHERE log_log_category_logc_id = " . $_COOKIE['log_category'];
|
$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('next_id', ($next_link?$this->get_id()+1:false));
|
||||||
$smarty->assign('previous_id', ($this->get_id()>1?$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 {
|
else {
|
||||||
# LOG LIST
|
# 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');
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="logout_mobile">
|
<li class="logout_mobile">
|
||||||
<a href="/{$page}/logout">
|
<a href="{if $page == 'preview' || $page == 'coach_preview'}#{else}/{$page}/logout{/if}">
|
||||||
<span class="name">
|
<span class="name">
|
||||||
Kijelentkezés
|
Kijelentkezés
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user