diff --git a/dbd/sql/mysql/data/system_page.sql b/dbd/sql/mysql/data/system_page.sql
index 2b1c377..aaba211 100644
--- a/dbd/sql/mysql/data/system_page.sql
+++ b/dbd/sql/mysql/data/system_page.sql
@@ -24,7 +24,7 @@ INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`,
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (61, 42, 'list', 'files', 60, 0, 0, '#tab_files', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files&action=tab&name=${folder}', 'init_saimod_sys_files_list', '\\SYSTEM\\SAI\\saimod_sys_files');
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (70, 42, 'log', 'log', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log', 'init_saimod_sys_log', '\\SYSTEM\\SAI\\saimod_sys_log');
-INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (71, 42, 'list', 'log', 70, 0, 0, '#tab_log', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=filter&filter=${filter}', 'init_saimod_sys_log_log', '\\SYSTEM\\SAI\\saimod_sys_log');
+INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (71, 42, 'list', 'log', 70, 0, 0, '#tab_log', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=filter&filter=${filter}&search=${search}&page=${page}', 'init_saimod_sys_log_log', '\\SYSTEM\\SAI\\saimod_sys_log');
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (72, 42, 'stats', 'log', 70, 0, 1, '#tab_log', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=stats', 'init_saimod_sys_log_stats', '\\SYSTEM\\SAI\\saimod_sys_log');
INSERT INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (73, 42, 'error', 'log', 70, 0, 1, '#tab_log', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_log&action=error&error=${error}', '', '');
diff --git a/dbd/sql/mysql/data/system_sai_api.sql b/dbd/sql/mysql/data/system_sai_api.sql
index 92686e6..de5765f 100644
--- a/dbd/sql/mysql/data/system_sai_api.sql
+++ b/dbd/sql/mysql/data/system_sai_api.sql
@@ -47,6 +47,8 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (200, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_log', 'action', NULL);
--
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (201, 42, 3, 200, 'filter', 'filter', 'STRING');
+INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (202, 42, 3, 200, 'filter', 'search', 'STRING');
+INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (203, 42, 3, 200, 'filter', 'page', 'UINT0');
--
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (210, 42, 3, 200, 'error', 'error', 'INT');
--
diff --git a/dbd/sql/mysql/data/system_text.sql b/dbd/sql/mysql/data/system_text.sql
index f690036..dc66e75 100644
--- a/dbd/sql/mysql/data/system_text.sql
+++ b/dbd/sql/mysql/data/system_text.sql
@@ -267,6 +267,7 @@
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_placeholder_search', 'enUS', 'I\'m searching for...', 0, 0, '2015-04-15 18:29:16', '0000-00-00 00:00:00');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_placeholder_search', 'basic');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_placeholder_search', 'sai_todo');
+ INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_placeholder_search', 'sai_log');
DELETE FROM `system_text` WHERE id = 'basic_progress';
DELETE FROM `system_text_tag` WHERE id = 'basic_progress';
@@ -302,6 +303,7 @@
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_rows', 'frFR', 'lignes', 3, 3, '2015-04-20 16:33:19', '2015-04-20 16:33:19');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_rows', 'basic');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_rows', 'sai_log');
+ INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_rows', 'sai_todo');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_rows', 'sai_security');
DELETE FROM `system_text` WHERE id = 'basic_save';
@@ -463,6 +465,7 @@
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_search', 'basic');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_search', 'sai_security');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_search', 'sai_todo');
+ INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_search', 'sai_log');
DELETE FROM `system_text` WHERE id = 'basic_send_email';
DELETE FROM `system_text_tag` WHERE id = 'basic_send_email';
@@ -591,6 +594,14 @@
INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_priority', 'enUS', 'Priority', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_priority', 'basic');
INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_priority', 'sai_todo');
+
+ DELETE FROM `system_text` WHERE id = 'basic_page';
+ DELETE FROM `system_text_tag` WHERE id = 'basic_page';
+ INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_page', 'deDE', 'Seite', 1, 1, '2015-04-16 23:11:18', '2015-04-16 16:48:36');
+ INSERT INTO `system_text` (`id`, `lang`, `text`, `author`, `author_edit`, `time_create`, `time_edit`) VALUES ('basic_page', 'enUS', 'Page', 2, 1, '2015-04-16 23:11:18', '2015-04-16 23:11:18');
+ INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_page', 'basic');
+ INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_page', 'sai_todo');
+ INSERT INTO `system_text_tag` (`id`, `tag`) VALUES ('basic_page', 'sai_log');
-- SAI
DELETE FROM `system_text` WHERE id = 'sai_api_title';
diff --git a/sai/modules/saimod_sys_log/js/saimod_sys_log.js b/sai/modules/saimod_sys_log/js/saimod_sys_log.js
index 8124a49..61d10f9 100644
--- a/sai/modules/saimod_sys_log/js/saimod_sys_log.js
+++ b/sai/modules/saimod_sys_log/js/saimod_sys_log.js
@@ -8,11 +8,18 @@ function init_saimod_sys_log() {
});
};
+function register_search(){
+ $('#btn_search').click(function(){
+ system.load($(this).attr('state')+$('#input_search').val(),true);
+ });
+}
+
function init_saimod_sys_log_log() {
$("#sai_mod_log_table").tablesorter();
$('#tabs_log li').each(function(){
$(this).removeClass('active');});
$('#menu_loglist').parent().addClass('active');
+ register_search();
}
function init_saimod_sys_log_stats() {
diff --git a/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_FILTER.php b/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_FILTER.php
index d3a4d77..e75ca91 100644
--- a/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_FILTER.php
+++ b/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_FILTER.php
@@ -10,12 +10,13 @@ class SYS_SAIMOD_LOG_FILTER extends \SYSTEM\DB\QP {
' ON '.\SYSTEM\DBD\system_log::NAME_PG.'.'.\SYSTEM\DBD\system_log::FIELD_USER.
' = '.\SYSTEM\DBD\system_user::NAME_PG.'.'.\SYSTEM\DBD\system_user::FIELD_ID.
' WHERE '.\SYSTEM\DBD\system_log::FIELD_CLASS.' LIKE $1'.
-' ORDER BY '.\SYSTEM\DBD\system_log::FIELD_TIME.' DESC, '.\SYSTEM\DBD\system_log::NAME_PG.'."'.\SYSTEM\DBD\system_log::FIELD_ID.'" DESC LIMIT 100;',
+' ORDER BY '.\SYSTEM\DBD\system_log::FIELD_TIME.' DESC, '.\SYSTEM\DBD\system_log::NAME_PG.'."'.\SYSTEM\DBD\system_log::FIELD_ID.'" DESC;',
//mys
'SELECT * FROM '.\SYSTEM\DBD\system_log::NAME_MYS.
' LEFT JOIN '.\SYSTEM\DBD\system_user::NAME_MYS.
' ON '.\SYSTEM\DBD\system_log::NAME_MYS.'.'.\SYSTEM\DBD\system_log::FIELD_USER.
' = '.\SYSTEM\DBD\system_user::NAME_MYS.'.'.\SYSTEM\DBD\system_user::FIELD_ID.
' WHERE '.\SYSTEM\DBD\system_log::FIELD_CLASS.' LIKE ?'.
-' ORDER BY '.\SYSTEM\DBD\system_log::FIELD_TIME.' DESC, '.\SYSTEM\DBD\system_log::NAME_MYS.'.'.\SYSTEM\DBD\system_log::FIELD_ID.' DESC LIMIT 100;'
+' AND ('.\SYSTEM\DBD\system_log::FIELD_MESSAGE.' LIKE ? OR '.\SYSTEM\DBD\system_log::FIELD_FILE.' LIKE ? OR '.\SYSTEM\DBD\system_log::FIELD_IP.' LIKE ?)'.
+' ORDER BY '.\SYSTEM\DBD\system_log::FIELD_TIME.' DESC, '.\SYSTEM\DBD\system_log::NAME_MYS.'.'.\SYSTEM\DBD\system_log::FIELD_ID.' DESC;'
);}}
diff --git a/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_FILTER_COUNT.php b/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_FILTER_COUNT.php
index 70d04e7..3d24f35 100644
--- a/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_FILTER_COUNT.php
+++ b/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_FILTER_COUNT.php
@@ -11,7 +11,7 @@ class SYS_SAIMOD_LOG_FILTER_COUNT extends \SYSTEM\DB\QP {
//mys
'SELECT COUNT(*) as count'.
' FROM '.\SYSTEM\DBD\system_log::NAME_MYS.
-' WHERE '.\SYSTEM\DBD\system_log::FIELD_CLASS.
-' LIKE ?;'
+' WHERE '.\SYSTEM\DBD\system_log::FIELD_CLASS.' LIKE ?'.
+' AND ('.\SYSTEM\DBD\system_log::FIELD_MESSAGE.' LIKE ? OR '.\SYSTEM\DBD\system_log::FIELD_FILE.' LIKE ? OR '.\SYSTEM\DBD\system_log::FIELD_IP.' LIKE ?);'
);}}
diff --git a/sai/modules/saimod_sys_log/saimod_sys_log.php b/sai/modules/saimod_sys_log/saimod_sys_log.php
index 39755fc..4793647 100644
--- a/sai/modules/saimod_sys_log/saimod_sys_log.php
+++ b/sai/modules/saimod_sys_log/saimod_sys_log.php
@@ -292,37 +292,41 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule {
$vars = array_merge($vars,\SYSTEM\PAGE\text::tag(\SYSTEM\DBD\system_text::TAG_SAI_LOG));
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_error.tpl'), $vars);}
- public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_filter($filter = "%"){
- $filter_ = $filter;
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_log_action_filter($filter = "%",$search="%",$page=0){
$filter = str_replace('\\', '\\\\', $filter);
- $count = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTER_COUNT::Q1(array($filter));
- $res = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTER::QQ(array($filter));
- $table='';
- while($r = $res->next()){
- //print_r($r);
+ $count = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTER_COUNT::Q1(array($filter,$search,$search,$search))['count'];
+ $vars = array();
+ $vars['filter'] = $filter;
+ $vars['search'] = $search;
+ $vars['page'] = $page;
+ $res = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTER::QQ(array($filter,$search,$search,$search));
+ $vars['table'] = '';
+ $count_filtered = 0;
+ $res->seek(100*$page);
+ while(($r = $res->next()) && ($count_filtered < 100)){
$r['class_row'] = self::tablerow_class($r['class']);
$r['time'] = \SYSTEM\time::time_ago_string(strtotime($r['time']));
$r['message'] = htmlspecialchars(substr($r['message'],0,255));
$r['request_uri'] = htmlspecialchars($r['request_uri']);
- $table .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl'),$r);
+ $vars['table'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl'),$r);
+ $count_filtered++;
}
- $vars = array();
- $vars['count'] = $count['count'];
- $vars['error_filter'] = self::generate_error_filters($filter_);
+ $vars['pagination'] = '';
+ for($i=0;$i < ceil($count/100);$i++){
+ $data = array('page' => $i,'search' => $search, 'filter' => $filter, 'active' => ($i == $page) ? 'active' : '');
+ $vars['pagination'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_pagination.tpl'), $data);
+ }
+ $vars['count'] = $count_filtered.'/'.$count;
+ $vars['error_filter'] = '';
+ $res = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTERS::QQ();
+ while($row = $res->next()){
+ $data = array('active' => ($filter == $row['class'] ? 'active' : ''), 'filter' => $row['class'], 'search' => $search);
+ $vars['error_filter'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_error_filter.tpl'),$data);}
$vars['active'] = ($filter == '%' ? 'active' : '');
- $vars['table'] = $table;
$vars = array_merge($vars, \SYSTEM\PAGE\text::tag(\SYSTEM\DBD\system_text::TAG_SAI_LOG));
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl'),$vars);
}
- private static function generate_error_filters($filter){
- $res = \SYSTEM\DBD\SYS_SAIMOD_LOG_FILTERS::QQ();
- $result = '';
- while($row = $res->next()){
- $result .= '
'.$row['class'].' ';}
- return $result;
- }
-
public static function sai_mod__SYSTEM_SAI_saimod_sys_log(){
$vars = \SYSTEM\PAGE\text::tag(\SYSTEM\DBD\system_text::TAG_SAI_LOG);
$vars['PICPATH'] = \SYSTEM\WEBPATH(new \SYSTEM\PSAI(), 'modules/saimod_sys_log/img/');
diff --git a/sai/modules/saimod_sys_log/tpl/saimod_sys_log_error_filter.tpl b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_error_filter.tpl
new file mode 100644
index 0000000..e0322b9
--- /dev/null
+++ b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_error_filter.tpl
@@ -0,0 +1 @@
+${filter}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl
index 1e11627..8428a17 100644
--- a/sai/modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl
+++ b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_filter.tpl
@@ -1,25 +1,26 @@
- ${basic_rows}: ${count}
+
${basic_rows}: ${count} ${basic_page}: ${page}
-
-
- ${time_ago}
- ${table_class}
- ${table_message}
- ${table_file}
- ${table_line}
- ${table_ip}
- ${table_url}
- ${table_user}
- ${table_querytime}
-
-
-
- ${table}
-
+
+ ${time_ago}
+ ${table_class}
+ ${table_message}
+ ${table_file}
+ ${table_line}
+ ${table_ip}
+ ${table_url}
+ ${table_user}
+ ${table_querytime}
+
+ ${table}
+
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_log/tpl/saimod_sys_log_pagination.tpl b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_pagination.tpl
new file mode 100644
index 0000000..8fc22b9
--- /dev/null
+++ b/sai/modules/saimod_sys_log/tpl/saimod_sys_log_pagination.tpl
@@ -0,0 +1 @@
+${page}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js b/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js
index 9e82f7b..33d6472 100644
--- a/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js
+++ b/sai/modules/saimod_sys_todo/js/saimod_sys_todo.js
@@ -22,7 +22,7 @@ function init_saimod_sys_todo() {
function register_search(){
$('#btn_search').click(function(){
- system.load($(this).attr('state')+$('#input_search').val()+$(this).attr('state2'),true);
+ system.load($(this).attr('state')+$('#input_search').val(),true);
});
}
diff --git a/sai/modules/saimod_sys_todo/tpl/todo_list.tpl b/sai/modules/saimod_sys_todo/tpl/todo_list.tpl
index 29ce010..e79e11e 100644
--- a/sai/modules/saimod_sys_todo/tpl/todo_list.tpl
+++ b/sai/modules/saimod_sys_todo/tpl/todo_list.tpl
@@ -7,10 +7,10 @@
${basic_generated}
${basic_user}
${basic_report}
- ${basic_search}
+ ${basic_search}
- Rows: ${count} Page: ${page}
+ ${basic_rows}: ${count} ${basic_page}: ${page}
${time_ago}
diff --git a/sai/modules/saimod_sys_todo/tpl/todo_list_pagination.tpl b/sai/modules/saimod_sys_todo/tpl/todo_list_pagination.tpl
index 9748ade..9ba0130 100644
--- a/sai/modules/saimod_sys_todo/tpl/todo_list_pagination.tpl
+++ b/sai/modules/saimod_sys_todo/tpl/todo_list_pagination.tpl
@@ -1 +1 @@
-${page}
\ No newline at end of file
+${page}
\ No newline at end of file