function getOfferingTimeTable($sid) { $temp = getStu_offeringBySid($sid); $timeTable = array(); //#1.遍历该学生所选的offering,将该学生的课程时间放入一个临时的表里 while ($row = mysql_fetch_array($temp)) { //print_r($row); $offeringResult = getOfferingById($row['oid']); $offeringRow = mysql_fetch_array($offeringResult); // print_r($offeringRow); $timeTable = setOfferingTimeTable($offeringRow, $timeTable); } return $timeTable; }
<a href="javascript:history.back()">back</a> <a href="displayCourse.php">home page</a> <!--</div>--> </p> <?php } else { //echo "xx"; $temp = getStu_offeringBySid($sid); $timeTable = array(); //#1.遍历该学生所选的offering,将该学生的课程时间放入一个临时的表里 while ($row = mysql_fetch_array($temp)) { //print_r($row); $offeringResult = getOfferingById($row['oid']); $offeringRow = mysql_fetch_array($offeringResult); // print_r($offeringRow); $timeTable = setOfferingTimeTable($offeringRow, $timeTable); } // print_r($timeTable); if (isOccupied($lecOid, $timeTable) == true) { // echo 1; if ($labOid != null) { if (isOccupied($labOid, $timeTable) == true) { // echo 1; saveStu_offering($sid, $cid, $lecOid, 2015); $cidL = $cid . "L"; saveStu_offering($sid, $cidL, $labOid, 2015); } else { $error[$count] = $cid . " lab offering time is occupied"; $count++; } } else {