Successfully opened file: $file

\n"; // $data will contain all of the records from our text file. $data = fread($courses, filesize($file)); fclose($courses); // $lines will be an array by line. $lines = explode("\n", $data); // Check to see if the last line is blank (Emacs produces these) $lastline = array_pop($lines); if ($lastline != "") { array_push($lines, $lastline); } $title = array_shift($lines); // This loop should execute once for each quarter while (count($lines) > 0) { $quarter = array(); // First line of the quarter should be the name of the current // quarter. We want to store this off in a different array. $head = array_shift($lines); array_push($names, $head); while ($lines[0] != "") { array_push ($quarter, split("[ \t]+", array_shift($lines), 4)); } array_shift($lines); array_multisort ($quarter); reset($quarter); array_push($quarters, $quarter); } } $quarters = array(); $names = array(); get_data ($title,$names,$quarters,$year); echo "

$title

\n"; if ($cyear == $year) { echo "

$pyear Course Offerings (Projected)

"; } while (list($curr, $quarter) = each($quarters)) { // Need to use array pointers rather than shifts here. // Bah. // echo "

Current Pointer: $curr

\n"; echo "

$names[$curr]

\n"; echo ''; echo "\n"; echo "\n"; // echo "\"\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; //echo "\n"; $colors = array("#E3E3E3", "#D0D0D0"); $cur = 0; while (list($key, $record) = each($quarter)) { echo ""; while (list($key, $field) = each($record)) { if ($key == 0 ) { $next_course = $field; echo "\n"; } elseif ($key == 3) { if (ereg ("TITLE:", $field)) { $junk=split('TITLE:',$field,2); $field2=array_pop($junk); echo ""; } else { echo ""; } } elseif ($key == 1 ) { echo "\n"; } else { echo "\n"; } } echo "\n"; $cur++; $cur %= 2; } echo "
CourseCreditsInstructorDescription
$field$field2"; }else { echo "$course_title[$next_course]"; } if (ereg ("CANCELLED" , $field)) { echo " (CANCELLED)$credit[$next_course]$field
\n"; } ?>