--- db2gantt.cgi 2002/09/23 08:45:36 1.23 +++ db2gantt.cgi 2002/12/02 17:14:48 1.26 @@ -36,14 +36,25 @@ #--- no user servicable parts below this line -# time range - -$int_t = m_round($int_t); +my $q=new CGI; my ($from_t,$to_t) = (time()-$int_t,time()); -$to_t = param('to_t') if (param('to_t')); $from_t = param('from_t') if (param('from_t')); +$to_t = param('to_t') if (param('to_t')); + +if (param('f-1')) { + $from_t = $from_t - param('int_f-1') || $int_t; +} elsif (param('f+1')) { + $from_t = $from_t + param('int_f+1') || $int_t; +} elsif (param('t-1')) { + $to_t = $from_t - param('int_t-1') || $int_t; +} elsif (param('t+1')) { + $to_t = $from_t + $int_t; +} + +# time range +$int_t = m_round($int_t); # round to nearest minute sub m_round { @@ -70,7 +81,7 @@ $im->transparent($back); my $col = path_info(); $col =~ s,/,,g; my ($r,$g,$b) = split(/,/,$col); - my $col = $im->colorAllocate($r,$g,$b); + $col = $im->colorAllocate($r,$g,$b); $im->fill(0,0,$col); print "Content-Length: ",length($im->png),"\n\n"; binmode STDOUT; @@ -78,6 +89,9 @@ exit; } +# open DBI connection +my $dbh = DBI->connect("DBI:Pg:dbname=gantt","","") || die $DBI::errstr; + print "Content-type: text/html Cache-Control: max-age=60, must-revalidate @@ -98,33 +112,43 @@ '; } -print "
"; +print " +