diff options
author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-12 10:20:29 +0000 |
---|---|---|
committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-11-12 10:20:29 +0000 |
commit | c0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a (patch) | |
tree | 43b9a3f70cc15cfcc674fafbd0c8a3829417331e /frontends/php/screenconf.php | |
parent | d7d135227396a5b3cede974e94c25032a1bc69d2 (diff) | |
download | zabbix-c0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a.tar.gz zabbix-c0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a.tar.xz zabbix-c0c1b50df1ec73e0cd6b72c7cc10197e6cc44a0a.zip |
- [DEV-66] added sorting to screens (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@4996 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/screenconf.php')
-rw-r--r-- | frontends/php/screenconf.php | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/frontends/php/screenconf.php b/frontends/php/screenconf.php index 46ec8d65..c70f4d97 100644 --- a/frontends/php/screenconf.php +++ b/frontends/php/screenconf.php @@ -67,6 +67,7 @@ include_once "include/page_header.php"; ); check_fields($fields); + validate_sort_and_sortorder(); $config = $_REQUEST['config'] = get_request('config', 0); @@ -246,12 +247,17 @@ include_once "include/page_header.php"; show_table_header(S_SCREENS_BIG); $table = new CTableInfo(S_NO_SCREENS_DEFINED); - $table->SetHeader(array(S_NAME,S_DIMENSION_COLS_ROWS,S_SCREEN)); - - $result=DBselect('select screenid,name,hsize,vsize from screens where '.DBin_node('screenid'). - " order by name"); - while($row=DBfetch($result)) - { + $table->SetHeader(array( + make_sorting_link(S_NAME,'s.name'), + make_sorting_link(S_DIMENSION_COLS_ROWS,'size'), + S_SCREEN)); + + $result=DBselect('SELECT s.screenid,s.name,s.hsize,s.vsize,(s.hsize*s.vsize) as size '. + ' FROM screens s '. + ' WHERE '.DBin_node('s.screenid'). + order_by('s.name,size','s.screenid')); + while($row=DBfetch($result)){ + if(!screen_accessiable($row["screenid"], PERM_READ_WRITE)) continue; $table->AddRow(array( @@ -275,13 +281,19 @@ include_once "include/page_header.php"; show_table_header(S_SLIDESHOWS_BIG); $table = new CTableInfo(S_NO_SLIDESHOWS_DEFINED); - $table->SetHeader(array(S_NAME,S_DELAY,S_COUNT_OF_SLIDES)); - - $db_slides = DBselect('select s.slideshowid, s.name, s.delay, count(*) as cnt '. - ' from slideshows s left join slides sl on sl.slideshowid=s.slideshowid '. - ' where '.DBin_node('s.slideshowid'). - ' group by s.slideshowid,s.name,s.delay '. - ' order by s.name,s.slideshowid'); + $table->SetHeader(array( + make_sorting_link(S_NAME,'s.name'), + make_sorting_link(S_DELAY,'s.delay'), + make_sorting_link(S_COUNT_OF_SLIDES,'cnt') + )); + + $db_slides = DBselect('SELECT s.slideshowid, s.name, s.delay, count(*) as cnt '. + ' FROM slideshows s '. + ' left join slides sl on sl.slideshowid=s.slideshowid '. + ' WHERE '.DBin_node('s.slideshowid'). + ' GROUP BY s.slideshowid,s.name,s.delay '. + order_by('s.name,s.delay,cnt','s.slideshowid')); + while($slide_data = DBfetch($db_slides)) { if(!slideshow_accessiable($slide_data['slideshowid'], PERM_READ_WRITE)) continue; |