source: trunk/web/addons/toga/search.php @ 138

Last change on this file since 138 was 138, checked in by bastiaans, 19 years ago

web/addons/toga/templates/search_results.tpl:

  • Setup for search results template

web/addons/toga/templates/overview.tpl:

  • Misc testing stuff for remembering filter order

web/addons/toga/templates/search.tpl:

  • Template for search

web/addons/toga/index.php:

  • Testing stuff from remembering filter order
  • Do not add filters in a search window

web/addons/toga/overview.php:

  • Extra test field for filterorder

web/addons/toga/search.php:

  • First good setup for search page

web/addons/toga/libtoga.php:

  • Added class TarchDbase? for searching SQL dbase for archived jobs
  • Added TarchRrd? for future generation of RRD Graphs for archived jobs
  • Cleaned up old RRD file generation code (we can graph on the fly!)
File size: 1.7 KB
Line 
1<?php
2
3global $clustername, $tpl;
4
5function validateFormInput() {
6        global $clustername, $tpl, $id, $user, $name, $start_from_time, $start_to_time, $queue;
7        global $end_from_time, $end_to_time;
8
9        $error = 0;
10
11        $none_set = 0;
12
13        //if( $id == '' or $user == '' or $name == '' or $start_from_time == '' or $start_to_time == '' or $queue == '' or $end_from_time == '' or $end_to_time == '') $none_set = 1;
14
15        //if (!isset($id) and !isset($user) and !isset($start_from_time) and !isset($start_to_time) and !isset($end_from_time) and !isset($end_to_time) and !isset($queue) ) $none_set = 0;
16
17        if( $none_set ) {
18                $error = 1;
19                $error_msg = "<FONT COLOR=\"red\"><B>No search criteria set!</B></FONT>";
20        }
21
22        // doe checks en set error en error_msg in case shit
23
24        if( $error) {
25                $tpl->assign( "form_error_msg", $error_msg );
26                return 0;
27        } else {
28                return 1;
29        }
30}
31
32function makeSearchPage() {
33        global $clustername, $tpl, $id, $user, $name, $start_from_time, $start_to_time, $queue;
34        global $end_from_time, $end_to_time;
35
36        $tpl->assign( "cluster", $clustername );
37        $tpl->assign( "id_value", $id );
38        $tpl->assign( "user_value", $user );
39        $tpl->assign( "queue_value", $queue );
40        $tpl->assign( "name_value", $name );
41        $tpl->assign( "start_from_value", rawurldecode( $start_from_time ) );
42        $tpl->assign( "start_to_value", rawurldecode( $start_to_time ) );
43        $tpl->assign( "end_from_value", rawurldecode( $end_from_time ) );
44        $tpl->assign( "end_to_value", rawurldecode( $end_to_time ) );
45
46        if( validateFormInput() ) {
47
48                $tdb = new TarchDbase();
49                $tdb->searchDbase( $id, $queue, $user, $name, $start_from_time, $start_to_time, $end_from_time, $end_to_time );
50                $tpl->assign( "search_results", "templates/search_results.tpl" );
51
52                // show search results
53
54        }
55}
56?>
Note: See TracBrowser for help on using the repository browser.