check kid's parent login from log
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user