What a load of BS
[tpope-extra.git] / perl / sctweb
index 4b1c0b1e7ae1aeae33b0290117d3cf9632099d1c..a673d8b57938b43c78014efd868e7e918421eecf 100755 (executable)
@@ -559,7 +559,7 @@ sub do_html_schedule {
 
 sub do_html_grades {
     my @readheaders = ("Section ID", "Course Title", "Grade", "Earned  Hours", "Quality  Hours", "Quality  Points", "GPA");
-    my @showheaders = ("Section ID", "Course Title", "Grade", "Earned<br />Hours", "Quality<br />Hours", "Quality<br />Points", "GPA");
+    my @showheaders = ("Section ID", "Course Title", "Grade", "Earned<br />Hours", "Quality<br />Hours", "Quality<br />Points");
     my ($row, $lastrow);
     my $te = new HTML::TableExtract( headers => [ @readheaders ] );
     my $response = $ua->get("$url&tserve_tip_write=||WID|SID|PIN|Term&tserve_trans_config=rgrdterm.cfg"); # Valid grading terms
@@ -574,23 +574,30 @@ sub do_html_grades {
        $te->parse($response->content);
     }
     print '<table cellpadding="3" cellspacing="0">'."\n<tr><th>";
-    print join("</th><th>",@showheaders);
+    print $showheaders[0], '</th><th>';
+    print join('</th><th>',@showheaders[1 .. 5]);
     print "</th></tr>\n";
     foreach my $ts ($te->table_states) {
        foreach my $row ($ts->rows) {
            map { s/\xa0//g; s/\n/<br \/>/g; $_} @$row;
            $row->[1] = capitalize($row->[1]);
+           $row->[1] =~ s/&/&amp;/g;
            $lastrow=$row;
            next if $row->[0] =~ /:/;
            print '<tr><td>';
-           print join('</td><td>', @$row);
+           print $$row[0], '</td><td>', $$row[1], '</td>';
+           print '<td align="center">';
+           #print join('</td><td>', @$row[0 .. 1]);
+           print join('</td><td>', @$row[2 .. 5]);
            print "</td></tr>\n";
        }
     }
     print '<tr><td colspan="2">', capitalize($lastrow->[0]);
-    shift @$lastrow; shift @$lastrow;
-    print "</td><td>";
-    print join('</td><td>', @$lastrow);
+    #shift @$lastrow; shift @$lastrow;
+    print '</td><td align="center">';
+    print $$lastrow[6];
+    print '</td><td>';
+    print join('</td><td>', @$lastrow[3 .. 5]);
     print "</td></tr>\n";
     print "</table>\n";
 }