44 lines
1.0 KiB
PHP
44 lines
1.0 KiB
PHP
<?php
|
|
|
|
$log_count = $sql->num_of_rows("SELECT * FROM log ORDER BY log_date DESC;");
|
|
|
|
$previous_link = true;
|
|
$next_link = true;
|
|
|
|
if ($this->is_id()) {
|
|
# LOG LIST FILTERED
|
|
//50esével megyünk
|
|
$from = ($this->get_id() - 1) * 50;
|
|
$log_query = "SELECT * FROM log ORDER BY log_date DESC LIMIT ".$from.",50;";
|
|
//echo $log_count;
|
|
if ($log_count <= $this->get_id()*50) {
|
|
$next_link = 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));
|
|
}
|
|
else {
|
|
# LOG LIST
|
|
header("Location: /admin/log/1");
|
|
/*
|
|
$log_query = "SELECT * FROM log ORDER BY log_date DESC LIMIT 50;";
|
|
$previous_link = false;
|
|
$smarty->assign('next_id', '2');
|
|
*/
|
|
}
|
|
|
|
$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('log_array', $log_array);
|
|
$smarty->display('log.tpl');
|
|
|
|
?>
|