=mysqli_num_rows($result)) return false; if (is_string($field) && !(strpos($field,".")===false)) { $t_field=explode(".",$field); $field=-1; $t_fields=mysqli_fetch_fields($result); for ($id=0;$idtable==$t_field[0] && $t_fields[$id]->name==$t_field[1]) { $field=$id; break; } } if ($field==-1) return false; } mysqli_data_seek($result,$row); $line=mysqli_fetch_array($result); return isset($line[$field])?$line[$field]:false; } 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 = mysqli_connect('127.0.0.1', $user, $password, $database); $db_selected = mysqli_select_db( $link, $database ) ; if ( !$db_selected ) { die( "Unable to select database"); } $query="SELECT * FROM semester WHERE enddate > '$today' AND id != '1' order by id ASC" ; $result=mysqli_query($link, $query) ; $result_sems=$result ; $num=mysqli_num_rows($result) ; echo "\n
\n"; $i=0; while ($i < $num) { $id= mysqli_result($result,$i,"id") ; $name=mysqli_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=mysqli_query($link, $query2) ; $num2=mysqli_num_rows($result2) ; if ( $num2 != 0 ) { echo "\n" ; echo "

$name

The complete schedule of BGSU classes for $name is also available online.

 

\n"; $odd_or_even=0 ; echo "

\n" ; } $x=0 ; while ($x < $num2) { $odd_or_even = 1-$odd_or_even ; $my_callnum=mysqli_result($result2,$x,"callnum") ; // $query3="SELECT * from sched LEFT JOIN course ON sched.coursenum = course.class LEFT JOIN instructors ON sched.teacher = instructors.initials LEFT JOIN semester ON sched.semester = semester.id WHERE sched.callnum = '$my_callnum' AND sched.semester= '$id' ORDER BY sched.id" ; $query3="SELECT * from sched LEFT JOIN course ON sched.coursenum = course.class LEFT JOIN instructors ON sched.teacher = instructors.initials LEFT JOIN semester ON sched.semester = semester.id LEFT JOIN descriptions ON sched.coursenum = descriptions.class WHERE sched.callnum = '$my_callnum' AND sched.semester= '$id' ORDER BY sched.id"; $result3=mysqli_query($link, $query3) ; get_sem($name, $id, $result3, $odd_or_even) ; echo "\n\n"; $x++ ; } echo "
Course Title Cr Call# Time Days Room Instructor
 
" ; echo "
" ; $i++; } echo "

Key to building names. (See the campus map or the link below to see where they are.)

" ; $start_sem = mysqli_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=mysqli_query($link, $my_buildings) ; $build_num=mysqli_num_rows($build_result) ; $build=0 ; while ($build < $build_num ) { $one_building=mysqli_result($build_result,$build,"room") ; $my_location = "SELECT * FROM buildings where short = '$one_building'"; $locate_result= mysqli_query($link, $my_location) ; $short=mysqli_result($locate_result,0,"short"); $name=mysqli_result($locate_result,0,"name"); $url=mysqli_result($locate_result,0,"url"); echo ""; $build++ ; } // buildings echo "
$short "; echo $name ; echo "
 
"; mysqli_close() ; ?>