/[omni_gantt]/db2gantt.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /db2gantt.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by dpavlin, Mon Dec 2 14:35:17 2002 UTC revision 1.26 by dpavlin, Mon Dec 2 17:14:48 2002 UTC
# Line 36  my $min_l = 3;                 # min length of bar seg Line 36  my $min_l = 3;                 # min length of bar seg
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());
# Line 90  if (path_info()) { Line 89  if (path_info()) {
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    
# Line 251  my $sql = "select start,finish,specifica Line 253  my $sql = "select start,finish,specifica
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    
# Line 335  while(my $row = $sth->fetchrow_hashref) Line 338  while(my $row = $sth->fetchrow_hashref)
338                  # init vars for next line                  # init vars for next line
339                  ($fix_s,$fix_d) = (0,0); # init fix vars for bar                  ($fix_s,$fix_d) = (0,0); # init fix vars for bar
340    
341                  html_spec if ($curr_spec ne "");                  if ($curr_spec ne "") {
342                            $curr_spec =~ s/ +/ /g;
343                            html_spec;
344                    }
345    
346                  $curr_t = $from_t;      # init timeline                  $curr_t = $from_t;      # init timeline
347                  $curr_spec = $row->{specification};                  $curr_spec = $row->{specification};
# Line 428  print "</table>"; Line 434  print "</table>";
434    
435    
436  # label and usage  # label and usage
 $len_t = 50; # disable bar scaling  
437    
438  print "<hr>\nColors for statuses and usage (#):\n";  print "<hr>\nColors for statuses and usage (#):\n";
439  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";
440    my $max = 0;
441    foreach my $status (keys %count) {
442            $max = $count{$status} if ($count{$status} > $max);
443    }
444    $len_t = $max ; # disable bar scaling
445    
446  foreach my $status (keys %count) {  foreach my $status (keys %count) {
447  #foreach my $status (keys %cols) {  #foreach my $status (keys %cols) {
448          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 "");
# Line 441  foreach my $status (keys %count) { Line 452  foreach my $status (keys %count) {
452          # then display number (wrongly).          # then display number (wrongly).
453  }  }
454  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>";
   

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.26