#!/eng/local/bin/perl # table maker require '/home/top/hfranks/perl/ASCIITable.pm'; # database hack require "../mysql_handeler.pl"; require "../template.pl"; #new table $t = new Text::ASCIITable; $user="hfranks"; @id=mysql_handeler('select uid from users_student where name="'.$user.'";'); $uid=$id[1]; #mysql statements @res=mysql_handeler('select * from EECS2550 where uid="'.$uid.'";'); chomp @res; #column title @top=split(/ /, shift(@res)); #remove 2 unwanted auto_increment fields shift (@top); shift (@top); $t->setCols(\@top); #get rows foreach $line (@res){ chomp $line; @ary = split(/ /, $line); #remove two unwanted auto_increment fields shift (@ary); shift (@ary); $t->addRow(@ary); } #print it #normal ascii output #$cOntent .= $t->draw(); #advanced html output $cOntent.=$t->draw( ['','','',''], #
['','','
','
'], ['','','',''], ['
','
'], ['','
','',''], ); my $template = "../template.html"; my %gTokens=(); my $key=""; $gTokens{"$key"} = $cOntent; &SendTemplate($template,%gTokens);