#!/usr/bin/perl
#=========================================================================
# CSEE Course Database Processor
#
# File: courses.cgi
# Author(s): Hank Burton (WHB), Literati Information Technology
#
# This script reads the CSEE courses database file created by the
# DB_Manager application and processes the database for the courses
# that have sites related to the current class offerings.
#
# Parameters: -- none --
#
# 05-76-98 (WHB) : created
#=========================================================================
#=========================================================================
# OutputClasses
#
# Displays a list of courses w/current course links.
#
# Parameters:
# 0 : set of courses to display -- cs, cpe, or ee
# 1 : title of course group to display; HTML formatting allowed
#
# 05-07-98 (WHB): created
#=========================================================================
sub OutputClasses {
print "
$_[1]";
open COURSES, "grep $_[0] ../DB_Manager/Data_files/courses.data |";
COURSES: while ( ) {
($xCourse, $xSyllabus, $xCurrent) = split /\|/, $_;
$_ = $xCourse;
if ( "$xCurrent" ne "" and /$_[0]/i ) {
print "" . uc $xCourse . " ";
}
last COURSES if $isMatch;
}
close COURSES;
print " | ";
}
#=========================================================================
$|=1;
require("../cgi-bin/cgi-lib.pl") || die "require cgi-lib.pl died";
require("../cgi-bin/csee-lib.pl") || die "require csee-lib.pl died";
require("../cgi-bin/ls-lib.pl") || die "require ls-lib.pl died";
&CheckCGIExecute;
#
# Process CGI Parameters -------------------------------------------------
#
&ReadParse(*in);
#
# Begin CGI Output -------------------------------------------------------
#
&litBeginHTMLOutput;
&DisplayFile("../common/header.html");
print <
|
The courses listed below have WWW areas for the current or recent
semester course offerings. Not all courses may be listed. If there
is a course missing from this list or if a link is invalid,
notify the site administrator
for any changes.
|
EOT
#
# Read and Search the Courses Database -----------------------------------
#
&OutputClasses("cpe", "Computer
Engineering");
&OutputClasses("cs", "Computer
Science");
&OutputClasses("ee", "Electrical
Engineering");
#
# Finish CGI Output -------------------------------------------------------
#
print <
EOT
&DisplayFile("../common/footer.html");
1; # exit program