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');
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
{if $fold}
|
||||
|
||||
<div class="form_wrapper">
|
||||
<form method="post" action="/admin/log/1" id="logc_form">
|
||||
<div>
|
||||
@@ -32,6 +34,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/if}
|
||||
|
||||
<div style="overflow-x:auto;">
|
||||
<table class="log">
|
||||
{foreach $log_array as $log}
|
||||
|
||||
@@ -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() {
|
||||
<form id="'+pdata[i]['uk_id']+'" class="user_mod_form" method="post" action="/admin/create/money_deposit">\
|
||||
<input type="hidden" name="mod_user_kid_uk_id" value="'+pdata[i]['uk_id']+'">\
|
||||
</form>\
|
||||
<form id="login_'+pdata[i]['uk_id']+'" class="user_mod_form" method="post" action="/admin/log/1">\
|
||||
<input type="hidden" name="login_kid" value="'+pdata[i]['uk_id']+'">\
|
||||
</form>\
|
||||
<div class="list_item clickable" id="kid_'+pdata[i]['uk_id']+'" onclick="open_kid_menu('+pdata[i]['uk_id']+')">\
|
||||
<img src="/_image/shuttlecock.png">\
|
||||
'+pdata[i]['uk_name']+'\
|
||||
@@ -111,6 +118,10 @@ function search() {
|
||||
<span>Korábbi befizetések</span>\
|
||||
<img src="/_image/stat.png">\
|
||||
</div>\
|
||||
<div class="kid_submenu" onclick="open_logins('+pdata[i]['uk_id']+')">\
|
||||
<span>Belépések</span>\
|
||||
<img src="/_image/login.png">\
|
||||
</div>\
|
||||
<div class="kid_submenu" onclick="open_preview('+pdata[i]['uk_id']+')">\
|
||||
<span>Szülői előnézet</span>\
|
||||
<img src="/_image/preview.png">\
|
||||
|
||||
Reference in New Issue
Block a user