if (strpos($existing['DAYS'], $i) !== false) { $days_conflict = true; break 2; } } } } if ($days_conflict) { $warnings[] = 'There is already a course scheduled in that period.'; } if (!$warnings) { DBQuery("INSERT INTO SCHEDULE (SYEAR,SCHOOL_ID,STUDENT_ID,START_DATE,COURSE_ID,COURSE_PERIOD_ID,MP,MARKING_PERIOD_ID) values('" . UserSyear() . "','" . UserSchool() . "','" . UserStudentID() . "','" . $date . "','" . $_REQUEST['course_id'] . "','" . $_REQUEST['course_period_id'] . "','" . $mp_RET[1]['MP'] . "','" . $mp_RET[1]['MARKING_PERIOD_ID'] . "')"); DBQuery("UPDATE COURSE_PERIODS SET FILLED_SEATS=FILLED_SEATS+1 WHERE COURSE_PERIOD_ID='" . $_REQUEST['course_period_id'] . "'"); echo "<script language=javascript>opener.document.location = 'Modules.php?modname=" . $_REQUEST['modname'] . "&time=" . time() . "'; window.close();</script>"; } elseif ($warnings) { if (PromptCourseWarning('Confirm', 'There is a conflict. Are you sure you want to add this section?', ErrorMessage($warnings, 'note'))) { DBQuery("INSERT INTO SCHEDULE (SYEAR,SCHOOL_ID,STUDENT_ID,START_DATE,COURSE_ID,COURSE_PERIOD_ID,MP,MARKING_PERIOD_ID) values('" . UserSyear() . "','" . UserSchool() . "','" . UserStudentID() . "','" . $date . "','" . $_REQUEST['course_id'] . "','" . $_REQUEST['course_period_id'] . "','" . $mp_RET[1]['MP'] . "','" . $mp_RET[1]['MARKING_PERIOD_ID'] . "')"); DBQuery("UPDATE COURSE_PERIODS SET FILLED_SEATS=FILLED_SEATS+1 WHERE COURSE_PERIOD_ID='" . $_REQUEST['course_period_id'] . "'"); echo "<script language=javascript>opener.document.location = 'Modules.php?modname=" . $_REQUEST['modname'] . "&time=" . time() . "'; window.close();</script>"; } } } } function _makeTitle($value, $column = '') { global $_CENTRE, $THIS_RET; return $value; //.' - '.$THIS_RET['COURSE_WEIGHT']; } function _makeLock($value, $column) {
} else { $time_clash_conflict = false; } } } } if ($time_clash_conflict) { $warnings[] = 'There is a period time clash.'; } # ------------------------------------ Time Clash Conflict End ----------------------------------------- # if (!$warnings) { DBQuery("INSERT INTO SCHEDULE (SYEAR,SCHOOL_ID,STUDENT_ID,START_DATE,COURSE_ID,COURSE_PERIOD_ID,MP,MARKING_PERIOD_ID) values('" . UserSyear() . "','" . UserSchool() . "','" . UserStudentID() . "','" . $date . "','" . clean_param($_REQUEST['course_id'], PARAM_INT) . "','" . clean_param($_REQUEST['course_period_id'], PARAM_INT) . "','" . clean_param($mp_RET[1]['MP'], PARAM_ALPHA) . "','" . clean_param($mp_RET[1]['MARKING_PERIOD_ID'], PARAM_INT) . "')"); DBQuery("UPDATE COURSE_PERIODS SET FILLED_SEATS=FILLED_SEATS+1 WHERE COURSE_PERIOD_ID='" . clean_param($_REQUEST['course_period_id'], PARAM_INT) . "'"); echo "<script language=javascript>opener.document.location = 'Modules.php?modname=" . clean_param($_REQUEST['modname'], PARAM_NOTAGS) . "&time=" . time() . "'; window.close();</script>"; } elseif ($warnings) { if (PromptCourseWarning('Confirm', 'There is a conflict. You cannot add this course period.', ErrorMessage($warnings, 'note'))) { DBQuery("INSERT INTO SCHEDULE (SYEAR,SCHOOL_ID,STUDENT_ID,START_DATE,COURSE_ID,COURSE_PERIOD_ID,MP,MARKING_PERIOD_ID) values('" . UserSyear() . "','" . UserSchool() . "','" . UserStudentID() . "','" . $date . "','" . clean_param($_REQUEST['course_id'], PARAM_INT) . "','" . clean_param($_REQUEST['course_period_id'], PARAM_INT) . "','" . clean_param($mp_RET[1]['MP'], PARAM_ALPHA) . "','" . clean_param($mp_RET[1]['MARKING_PERIOD_ID'], PARAM_INT) . "')"); DBQuery("UPDATE COURSE_PERIODS SET FILLED_SEATS=FILLED_SEATS+1 WHERE COURSE_PERIOD_ID='" . clean_param($_REQUEST['course_period_id'], PARAM_INT) . "'"); echo "<script language=javascript>opener.document.location = 'Modules.php?modname=" . clean_param($_REQUEST['modname'], PARAM_NOTAGS) . "&time=" . time() . "'; window.close();</script>"; } } } } function _makeTitle($value, $column = '') { global $_openSIS, $THIS_RET; return $value; //.' - '.$THIS_RET['COURSE_WEIGHT']; } function _makeLock($value, $column) {