From 37ccb2240e683084d16541fb3a7b3dd4dce369ac Mon Sep 17 00:00:00 2001 From: Ricsi Date: Sat, 18 Mar 2017 10:02:58 +0100 Subject: [PATCH] check kid's parent login from log --- _include/include_log.php | 18 ++++++++++++++---- template/templates/log.tpl | 4 ++++ template/templates/user_list.tpl | 11 +++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/_include/include_log.php b/_include/include_log.php index c8a8ae8..d584589 100644 --- a/_include/include_log.php +++ b/_include/include_log.php @@ -8,11 +8,14 @@ $logc_list_query = "SELECT * FROM log_category ORDER BY logc_title ASC"; $logc_assoc_array = $sql->assoc_array($logc_list_query); $log_categories = array(); +//jött-e újabb POST $update = false; +//lapozható-e legyen-e? +$fold = true; //POST DATA HANDLER -//ha létezik postolt logcategory és (nem létezik a cookie VAGY létezik de nem egyenlő az eddigivel) -if (isset($_REQUEST['log_category']) && (!isset($_COOKIE['log_category']) || (isset($_COOKIE['log_category']) && $_COOKIE['log_category'] != $_REQUEST['log_category']))) { +//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) +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 setcookie("log_category", $_REQUEST['log_category'], time()+60*60, '/'); @@ -20,8 +23,14 @@ if (isset($_REQUEST['log_category']) && (!isset($_COOKIE['log_category']) || (is $update = true; } +elseif (isset($_REQUEST['login_kid'])) { + //lekérjük a gyerek befizetéseit + hideoljuk a lapozót + $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) { +if (isset($_COOKIE['log_category']) && $_COOKIE['log_category'] != 'null' && !$update && !isset($_REQUEST['login_kid'])) { $condition = "WHERE log_log_category_logc_id = " . $_COOKIE['log_category']; $selected = $_COOKIE['log_category']; } @@ -38,7 +47,7 @@ if ($this->is_id()) { # LOG LIST FILTERED //50esével megyünk $from = ($this->get_id() - 1) * 50; - $log_query = "SELECT * FROM log " . (isset($condition)?$condition:"") . " ORDER BY log_date DESC LIMIT ".$from.",50;"; + $log_query = "SELECT * FROM log " . (isset($condition)?$condition:"") . " ORDER BY log_date DESC " . ($fold?"LIMIT ".$from.",50;":""); $log_count = $sql->num_of_rows("SELECT * FROM log ".(isset($condition)?$condition:"")." ORDER BY log_date DESC;"); //echo $log_count; if ($log_count <= $this->get_id()*50) { @@ -69,6 +78,7 @@ foreach ($log_assoc_array as $log_list_array) { $smarty->assign('selected', $selected); +$smarty->assign('fold', $fold); $smarty->assign('logc_array', $log_categories); $smarty->assign('log_array', $log_array); $smarty->display('log.tpl'); diff --git a/template/templates/log.tpl b/template/templates/log.tpl index 9933474..96b346c 100644 --- a/template/templates/log.tpl +++ b/template/templates/log.tpl @@ -1,3 +1,5 @@ +{if $fold} +
@@ -32,6 +34,8 @@
+{/if} +
{foreach $log_array as $log} diff --git a/template/templates/user_list.tpl b/template/templates/user_list.tpl index 49d0128..f7295dc 100755 --- a/template/templates/user_list.tpl +++ b/template/templates/user_list.tpl @@ -74,6 +74,10 @@ function open_previous_deposits(user_id) { location.href = "/admin/view_deposit/"+user_id; } +function open_logins(user_id) { + $("#login_"+user_id).submit(); +} + function search() { document.getElementById('user_list').innerHTML = 'Betöltés...'; $("#is_active").prop("disabled",true); @@ -94,6 +98,9 @@ function search() { \ \ \ + \ + \ + \
\ \ '+pdata[i]['uk_name']+'\ @@ -111,6 +118,10 @@ function search() { Korábbi befizetések\ \
\ +
\ + Belépések\ + \ +
\
\ Szülői előnézet\ \