\n"); } else { header("Content-type: text/html; charset=utf-8"); } ?> Check My Grades

Fill in the information below to see what grades I have recorded for you so far in the course.

Be sure to let me know right away about any discrepancies between what you see here and the grades you think I should have recorded.

Enter your 4-digit student ID:

You did not enter your four-digit College ID number.\n"; } else { // Generate lookup results $gradesFile = @fopen("../../Grades/2007_09/CS-081_1T3RA_2956-Table 1.csv", "r"); if (! $gradesFile) { echo "

Unable to read grades file.
$php_errormsg

\n"; } else { $fstat = fstat($gradesFile); echo "

Grades were last updated ".date("Y-m-d h:m a", $fstat['mtime'])."

\n"; $headings = fgetcsv($gradesFile); // Heading[0] must be student id number // Heading[1] and Heading[2] must contain student's name, with 'first' and 'last' indicating which is which $firstNameIndex = 1; $lastNameIndex = 2; if (preg_match("/.*last.*/i", $headings[1])) { $firstNameIndex = 2; $lastNameIndex = 1; } unset($studentValues); while (!feof($gradesFile)) { $info = fgetcsv($gradesFile); if ($info[0] != $_POST['idNum']) continue; $studentValues = $info; break; } if (isset($studentValues)) { $firstName = $studentValues[$firstNameIndex]; $lastName = $studentValues[$lastNameIndex]; echo "

Grades for $firstName $lastName:

\n"; ?> \n"; } } ?>
ItemGradeT-Score
".$headings[$i]."".$studentValues[$i]."