
Physics and Astronomy
Class Schedule
error_reporting(0) ;
function get_sem($myname,$myid,$dataset, $my_odd){
$get_num=mysql_numrows($dataset) ;
if ( $get_num != 0 ){
$loop=0 ;
while ($loop < $get_num) { // loop through section numbers
//$my_course=mysql_result($dataset,$loop,"callnum") . " " . mysql_result($dataset,$loop,"class");
$my_course=mysql_result($dataset,$loop,"class") ;
$my_title=mysql_result($dataset,$loop,"title") ;
$my_credit=mysql_result($dataset,$loop,"credit") ;
$my_call=mysql_result($dataset,$loop,"callnum") ;
$my_stimes=mysql_result($dataset,$loop,"starttime") ;
$my_etimes= mysql_result($dataset,$loop,"endtime") ;
$my_days=mysql_result($dataset,$loop,"dayofweek") ;
$my_room=mysql_result($dataset,$loop,"room") ;
$my_teach=mysql_result($dataset,$loop,"shortname") ;
$my_url=mysql_result($dataset,$loop,"url") ;
$my_is_child=mysql_result($dataset,$loop,"is_child");
$my_description=mysql_result($dataset,$loop,"discription");
$my_islab=mysql_result($dataset,$loop,"islab");
$my_isrec=mysql_result($dataset,$loop,"isrec");
$my_enroll_lab=mysql_result($dataset,$loop,"enroll_lab");
$my_enroll_lect=mysql_result($dataset,$loop,"enroll_lect");
$my_lab=mysql_result($dataset, $loop, "lab");
//echo "$my_description\nxx\n";
// echo "$my_stimes\n" ;
$temp1 = explode( ":", $my_stimes ) ;
$temp4 = explode( ":", $my_etimes ) ;
if ( $my_stimes != $my_etimes ) {
$my_times = date( 'g:i', mktime($temp1[0], $temp1[1], $temp1[2],12,1,2007 )) . " - " . date( 'g:i A',mktime( $temp4[0], $temp4[1], $temp4[2],12,1,2007 ) );
}
else {
$my_times = "See Dept.";
}
if ( $my_stimes == "23:59:00" ) { $my_times = "On-Line Course"; }
if ( $loop == 0 ) {
$d_course = $my_course;
$d_title = $my_title ;
$d_credit = $my_credit ;
if ( $my_call == $my_is_child )
{ //echo "HEKO\n";
$d_call .= "
$my_is_child" ;
} else if ( $my_is_child != '' ){
$d_call = $my_is_child ; } else {
$d_call = $my_call;
}
$d_times = $my_times ;
$d_days = $my_days ;
$d_room = $my_room ;
if ( $my_url != "" && $my_teach != 'exam' && $my_teach != 'staff' ) {
$d_teach = "" . $my_teach . "" ;
} else { $d_teach = $my_teach ; }
}
else { // loop not 0
$d_times .= "
$my_times" ; $d_days .= "
$my_days" ; $d_room .= "
$my_room" ; if ( $my_call == $my_is_child ) { //echo "HEKO\n"; $d_call .= "
$my_is_child" ; } else if ( $my_lab && $my_enroll_lab ) { $d_call .= "
$my_is_child" ; } else { $d_call .= "
$my_is_child" ; } if ( $my_url != "" && $my_teach != 'exam' && $my_teach != 'staff' ) { $d_teach .= "
" . $my_teach . "" ; } else { $d_teach .= "
$my_teach" ; } } $loop++; } // end while through section if ( ($d_course == "MATS 4010") && ($d_call == $my_is_child) ) { // echo "HEKO $d_call\n
"; $d_call = " $my_call" ; } echo "$d_course
$d_title
$d_credit
$d_call
$d_times
$d_days
$d_room
$d_teach \n" ; ;
} // end if not zero
} // end function
$today= date("Y-m-d") ;
$user="classes";
$password="take_me";
$database="class_sched";
$link = mysql_connect('localhost', $user, $password);
$db_selected = mysql_select_db($database, $link) ;
if ( !$db_selected ) {
die( "Unable to select database");
}
$query="SELECT * FROM semester WHERE enddate > '$today' AND id != '1' order by id ASC" ;
$result=mysql_query($query) ;
$result_sems=$result ;
$num=mysql_numrows($result) ;
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id") ;
$name=mysql_result($result,$i,"name") ;
$query2="SELECT DISTINCT sched.callnum from sched, course WHERE sched.coursenum = course.class AND sched.semester= '$id' ORDER by course.class ASC, sched.callnum ASC";
$result2=mysql_query($query2) ;
$num2=mysql_num_rows($result2) ;
if ( $num2 != 0 ) {
echo "
" ;
$i++;
}
echo "
" ;
$start_sem = mysql_result($result_sems,0,'id');
$my_buildings = "SELECT DISTINCT SUBSTRING_INDEX(room, ' ', 1) AS room from sched WHERE room != '' AND semester >= '$start_sem' order by room ASC" ;
$build_result=mysql_query($my_buildings) ;
$build_num=mysql_numrows($build_result) ;
$build=0 ;
while ($build < $build_num ) {
$one_building=mysql_result($build_result,$build,"room") ;
$my_location = "SELECT * FROM buildings where short = '$one_building'";
$locate_result= mysql_query($my_location) ;
$short=mysql_result($locate_result,0,"short");
$name=mysql_result($locate_result,0,"name");
$url=mysql_result($locate_result,0,"url");
echo "
";
mysql_close() ;
?>
$my_times" ; $d_days .= "
$my_days" ; $d_room .= "
$my_room" ; if ( $my_call == $my_is_child ) { //echo "HEKO\n"; $d_call .= "
$my_is_child" ; } else if ( $my_lab && $my_enroll_lab ) { $d_call .= "
$my_is_child" ; } else { $d_call .= "
$my_is_child" ; } if ( $my_url != "" && $my_teach != 'exam' && $my_teach != 'staff' ) { $d_teach .= "
" . $my_teach . "" ; } else { $d_teach .= "
$my_teach" ; } } $loop++; } // end while through section if ( ($d_course == "MATS 4010") && ($d_call == $my_is_child) ) { // echo "HEKO $d_call\n
"; $d_call = " $my_call" ; } echo "
$nameThe complete schedule of BGSU classes for $name is also available online.
\n"; $odd_or_even=0 ; echo "
|
Key to building names. (See the
campus map or the link below to see where they are.)
$short | "; echo $name ; echo " | |