|
$cor_q = "";
$secfac_q = "";
$sechrs_q = "";
if(isset($_REQUEST["subject"])) {
$cor_q=sprintf( " SELECT subject.code, ".
" course.number, ".
" course.title, ".
" course.description ".
" FROM subject, course ".
" WHERE %s AND ".
" subject.subjectid=course.subjectid ",
strlen($_REQUEST["subject"])?" subject.code='".addslashes($_REQUEST["subject"])."'":" (subject.code='ARTH' OR subject.code='HIST') ");
if(isset($_REQUEST["h"]) && $_REQUEST["h"]!=0) {
$cor_q.=sprintf(" AND substr(course.number,1,1)='%s' ",addslashes($_REQUEST["h"])/100);
}
$cor_q.=sprintf(" ORDER BY subject.code, course.number ");
} else if(isset($_REQUEST["type"])) {
$cor_q=sprintf( " SELECT subject.code, ".
" course.number, ".
" course.title, ".
" course.description ".
" FROM subject, course ".
" WHERE (subject.code='ARTH' OR subject.code='HIST') AND ".
" subject.subjectid=course.subjectid ");
switch($_REQUEST["type"]) {
case "graduate":
$cor_q.=sprintf(" AND substr(course.number,1,1)>'4' ");
break;
case "undergraduate":
$cor_q.=sprintf(" AND substr(course.number,1,1)<'5' ");
break;
default:
break;
}
$cor_q.=sprintf(" ORDER BY subject.code, course.number ");
} else {
?>
Course
descriptions are the more general course descriptions that
appear in the Mason catalog. The catalog information provided
is for your convenience from the College of Arts and Sciences
and is not meant to replace the official catalog available
from the university in hard copy and at http://www.gmu.edu/catalog/.
Catalog
descriptions may be listed by level, subject code, or searched
by course title or faculty name. See navigation to the right
for more information.
}
if(strlen($cor_q)) {
list($usec,$sec) = explode(" ",microtime());
$float_begin = (float)$usec + (float)$sec;
$cor_ret = pg_exec($dbconn,$cor_q);
if($cor_ret==FALSE) {
exit("Database Error");
}
list($usec,$sec) = explode(" ",microtime());
$float_end = (float)$usec + (float)$sec;
printf("\n\n\n\n\n",$cor_q,$float_end-$float_begin);
for($s=0;$s%s %s: %s ",
$cor_subject_code,
$cor_course_number,
$cor_course_title);
printf("%s
",$cor_course_desc);
}
}
?>
|