";
print "";
print "
".$semester." ".$year."
";
print "
";
$nextdept = "";
$nextsem = "";
$nextyear = "";
print "";
if ((!$year) && ( !$semester) && ($dept) && (!$code)) {
print "
".$dept."
";
}else{
if ($code){
print "
".$code."
";
}elseif ($dept){
print "
".$dept."
";
}
}
print "
";
while ($a = db_fetch_assoc($r)) {
$url = urldecode ($a['url']);
if (($year) && ( !$semester) && (!$dept)){
print "\n";
print "\n";
print $a['semester'];
print " | \n";
print "\n";
if ($nextdept != $a['dept']) {
print $a['dept'];
$nextdept = $a['dept'];
} else {
print " ";
}
} elseif ((!$year) && ( !$semester) && ($dept)) {
if (($nextyear != $a['year']) || ($nextsem != $a['semester'])){
$color="grey";
} else {
$color="";
}
if ($color){
print " |
\n";
} else {
print "
\n";
}
print "\n";
if (($nextyear != $a['year']) || ($nextsem != $a['semester'])) {
print $a['year'];
} else {
print " ";
}
print " | \n";
print "\n";
if (($nextsem != $a['semester'])|| ($nextyear != $a['year'])) {
print $a['semester'];
$nextsem = $a['semester'];
if ($nextyear != $a['year']) {
$nextyear = $a['year'];}
} else {
print " ";
}
}elseif ((!$year) && ($semester) && ($dept)){
if ($nextyear != $a['year']){
$color="grey";
} else {
$color="";
}
if ($color){
print " |
\n";
} else {
print "
\n";
}
print "\n";
if (($nextyear != $a['year']) && ($nextsem != $a['semester'])) {
print $a['year'];
} else {
print " ";
}
if ($nextyear != $a['year']) {
$nextyear = $a['year'];
} else {
print " ";
}
}elseif ((!$year) && ($semester) && (!$dept)){
$id = $a['id'];
if ($nextyear != $a['year']){
$color="grey";
} else {
$color="";
}
if ($color){
print " |
\n";
} else {
print "
\n";
}
print "\n";
if ($nextyear != $a['year']) {
print $a['year'];
} else {
print " ";}
print " | ";
print "\n";
if (($nextyear != $a['year']) && ($nextdept != $a['dept'])) {
print $a['dept'];
$nextyear=$a['year'];
} else {
print " ";
}
}elseif (($year) && (!$semester) && ($dept)){
print " |
\n";
}elseif ((!$year) && ( !$semester) && (!$dept) && ($code)){
if ($nextyear != $a['year']){
$color="grey";
} else {
$color="";
}
if ($color){
print "
\n";
} else {
print "
\n";
}
print "\n";
if ($nextyear != $a['year']) {
print $a['year'];
}else{
print " ";
}
print " | \n";
print "\n";
if (($nextsem != $a['semester']) || ($nextyear != $a['year'])) {
print $a['semester'];
$nextsem = $a['semester'];
$nextyear=$a['year'];
}else {
print " ";
}
}else{
$id = $a['id'];
print " |
\n";
print "\n";
if ($nextdept != $a['dept']) {
print $a['dept'];
$nextdept = $a['dept'];
} else {
print " ";
}
}
print " | \n";
print "\n";
print "".$a['code']." - ".$a['title']."";
if ($ltype == 'admin'){
print " | \n";
print "
\n";
} // end while
print "";
print $np;
?>
} //end while
print "
";
// end the surrounding table
print "