From 2549d98d1f54eb4dce41af7919169266cd1a7c71 Mon Sep 17 00:00:00 2001 From: stan Date: Tue, 15 Apr 2008 13:34:46 +0000 Subject: [PATCH] Bug 476 - Added pagination at bottom of events list as well as top. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2385 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm_html_view_events.php | 221 +++++++++++++++++++++--------------- 1 file changed, 131 insertions(+), 90 deletions(-) diff --git a/web/zm_html_view_events.php b/web/zm_html_view_events.php index 7463432be..8f26087b7 100644 --- a/web/zm_html_view_events.php +++ b/web/zm_html_view_events.php @@ -51,6 +51,106 @@ if ( $filter['sql'] ) $events_sql .= $filter['sql']; } $events_sql .= " order by $sort_column $sort_order"; + +function getPagination( $pages, $page ) +{ + global $view, $filter, $sort_query, $limit; + + $max_shortcuts = 5; + + ob_start(); + if ( $pages <= 1 ) + { + // Nothing + } + else + { + if ( $page ) + { + if ( $page < 0 ) + $page = 1; + if ( $page > $pages ) + $page = $pages; + + if ( $page > 1 ) + { + if ( false && $page > 2 ) + { +?> +<< + +< + +  + +-  - + $pages ) + break; + $pages_used[$new_page] = true; + array_push( $new_pages, $new_page ); + } + if ( !isset($pages_used[$pages]) ) + array_push( $new_pages, $pages ); + + foreach ( $new_pages as $new_page ) + { +?> +  + +> + +>> + @@ -286,11 +386,14 @@ function viewEvents( form, name ) + + -    - - $pages ) - $page = $pages; - - if ( $page > 1 ) - { - if ( false && $page > 2 ) - { -?> -<< - -< - -  - --  - - $pages ) - break; - $pages_used[$new_page] = true; - array_push( $new_pages, $new_page ); - } - if ( !isset($pages_used[$pages]) ) - array_push( $new_pages, $pages ); - - foreach ( $new_pages as $new_page ) - { -?> -  - -> - ->> - - -  + +  + + - - + + - - + + + + + + + +
 
+
 
 
+ + + + + +