36 |
|
|
37 |
#--- no user servicable parts below this line |
#--- no user servicable parts below this line |
38 |
|
|
|
my $dbh = DBI->connect("DBI:Pg:dbname=gantt","","") || die $DBI::errstr; |
|
39 |
my $q=new CGI; |
my $q=new CGI; |
40 |
|
|
41 |
my ($from_t,$to_t) = (time()-$int_t,time()); |
my ($from_t,$to_t) = (time()-$int_t,time()); |
89 |
exit; |
exit; |
90 |
} |
} |
91 |
|
|
92 |
|
# open DBI connection |
93 |
|
my $dbh = DBI->connect("DBI:Pg:dbname=gantt","","") || die $DBI::errstr; |
94 |
|
|
95 |
print "Content-type: text/html |
print "Content-type: text/html |
96 |
Cache-Control: max-age=60, must-revalidate |
Cache-Control: max-age=60, must-revalidate |
97 |
|
|
253 |
"; |
"; |
254 |
|
|
255 |
my $sth = $dbh->prepare($sql) || die "sql: $sql ".$dbh->errstr; |
my $sth = $dbh->prepare($sql) || die "sql: $sql ".$dbh->errstr; |
256 |
|
print STDERR "sql: $sql\n" if ($debug); |
257 |
|
|
258 |
my %spec; # specification hash |
my %spec; # specification hash |
259 |
|
|
289 |
$last_var = $v; |
$last_var = $v; |
290 |
} |
} |
291 |
} |
} |
292 |
|
# fix division by zero |
293 |
|
$max_use++ if ($max_use == 0); |
294 |
my $h = $last_var / $max_use * $height; |
my $h = $last_var / $max_use * $height; |
295 |
my $c = 255 - int (255 * $last_var / $max_use); |
my $c = 255 - int (255 * $last_var / $max_use); |
296 |
print color_bar($len,"$c,$c,$c","$last_var concurrent jobs",1,$h+1) if ($len); |
print color_bar($len,"$c,$c,$c","$last_var concurrent jobs",1,$h+1) if ($len); |
340 |
# init vars for next line |
# init vars for next line |
341 |
($fix_s,$fix_d) = (0,0); # init fix vars for bar |
($fix_s,$fix_d) = (0,0); # init fix vars for bar |
342 |
|
|
343 |
html_spec if ($curr_spec ne ""); |
if ($curr_spec ne "") { |
344 |
|
$curr_spec =~ s/ +/ /g; |
345 |
|
html_spec; |
346 |
|
} |
347 |
|
|
348 |
$curr_t = $from_t; # init timeline |
$curr_t = $from_t; # init timeline |
349 |
$curr_spec = $row->{specification}; |
$curr_spec = $row->{specification}; |
436 |
|
|
437 |
|
|
438 |
# label and usage |
# label and usage |
|
$len_t = 50; # disable bar scaling |
|
439 |
|
|
440 |
print "<hr>\nColors for statuses and usage (#):\n"; |
print "<hr>\nColors for statuses and usage (#):\n"; |
441 |
print "<table border=0><tr bgcolor=#e0e0e0><th>status</th><th>#</th><th>color</th></tr>\n"; |
print "<table border=0><tr bgcolor=#e0e0e0><th>status</th><th>#</th><th>color</th></tr>\n"; |
442 |
|
my $max = 0; |
443 |
|
foreach my $status (keys %count) { |
444 |
|
$max = $count{$status} if ($count{$status} > $max); |
445 |
|
} |
446 |
|
$len_t = $max ; # disable bar scaling |
447 |
|
|
448 |
foreach my $status (keys %count) { |
foreach my $status (keys %count) { |
449 |
#foreach my $status (keys %cols) { |
#foreach my $status (keys %cols) { |
450 |
print "<tr bgcolor=#e0e0e0><td><small>$status</small></td><td><small>",$count{$status}*1,"</small></td><td>",bar($count{$status},$status),"</td></tr>\n" if ($status ne ""); |
print "<tr bgcolor=#e0e0e0><td><small>$status</small></td><td><small>",$count{$status}*1,"</small></td><td>",bar($count{$status},$status),"</td></tr>\n" if ($status ne ""); |
454 |
# then display number (wrongly). |
# then display number (wrongly). |
455 |
} |
} |
456 |
print "</table></form>\n<p>Reload <a href=\"",$q->url(-relative=>1),"\">current</a> or see <a href=\"db2gantt_help.html\">help</a>.</p></body></html>"; |
print "</table></form>\n<p>Reload <a href=\"",$q->url(-relative=>1),"\">current</a> or see <a href=\"db2gantt_help.html\">help</a>.</p></body></html>"; |
|
|
|