Ignore:
Timestamp:
06/14/05 16:51:35 (19 years ago)
Author:
bastiaans
Message:

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:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/addons/toga/search.php

    r130 r138  
    33global $clustername, $tpl;
    44
    5 function makeSearchPage() {
    6         global $clustername;
     5function validateFormInput() {
     6        global $clustername, $tpl, $id, $user, $name, $start_from_time, $start_to_time, $queue;
     7        global $end_from_time, $end_to_time;
    78
    8         $tr = new TarchRrd();
    9         $tr->makeJobRrds( $clustername, 'gb-r1n1.irc.sara.nl', 'testje', 1114936341, 1115015563 );
    10         // bla!
     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        }
    1130}
    1231
     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}
    1356?>
Note: See TracChangeset for help on using the changeset viewer.