Changeset 142


Ignore:
Timestamp:
06/16/05 14:12:15 (18 years ago)
Author:
bastiaans
Message:

web/addons/toga/libtoga.php:

  • Fixed typo

web/addons/toga/search.php:

  • Timebased searching works now
Location:
trunk/web/addons/toga
Files:
2 edited

Legend:

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

    r141 r142  
    120120                        if( $start_from_time )
    121121                                $query_args[] = "job_start_timestamp >= $start_from_time";
    122                         if( $start_end_time )
     122                        if( $start_to_time )
    123123                                $query_args[] = "job_start_timestamp <= $start_to_time";
    124124                        if( $end_from_time )
  • trunk/web/addons/toga/search.php

    r141 r142  
    102102function makeDate( $time ) {
    103103        return strftime( "%a %d %b %Y %H:%M:%S", $time );
     104}
     105
     106function datetimeToEpoch( $datetime ) {
     107
     108        $datetime_fields = explode( ' ', $datetime );
     109
     110        $date = $datetime_fields[0];
     111        $time = $datetime_fields[1];
     112
     113        $date_fields = explode( '-', $date );
     114
     115        $days = $date_fields[0];
     116        $months = $date_fields[1];
     117        $years = $date_fields[2];
     118
     119        $time_fields = explode( ':', $time );
     120        reset( $time_fields );
     121
     122        print_r( $time_fields );
     123
     124        $hours = $time_fields[0];
     125        $minutes = $time_fields[1];
     126        $seconds = $time_fields[2];
     127
     128        $timestamp = mktime( $hours, $minutes, $seconds, $months, $days, $years );
     129
     130        return $timestamp;
    104131}
    105132
     
    150177                $tpl->newBlock( "search_results" );
    151178                $tdb = new TarchDbase();
     179                if( $start_from_time ) $start_from_time = datetimeToEpoch( $start_from_time );
     180                if( $start_to_time ) $start_to_time = datetimeToEpoch( $start_to_time );
     181                if( $end_from_time ) $end_from_time = datetimeToEpoch( $end_from_time );
     182                if( $end_to_time ) $end_to_time = datetimeToEpoch( $end_to_time );
    152183                $search_ids = $tdb->searchDbase( $id, $queue, $user, $name, $start_from_time, $start_to_time, $end_from_time, $end_to_time );
    153184
Note: See TracChangeset for help on using the changeset viewer.