} } } echo '<TD valign=top>'; $columns = array('TITLE' => 'Assignment Type'); $link = array(); $link['TITLE']['link'] = "Modules.php?modname={$_REQUEST['modname']}&modfunc={$_REQUEST['modfunc']}"; $link['TITLE']['variables'] = array('assignment_type_id' => 'ASSIGNMENT_TYPE_ID'); $link['add']['link'] = "Modules.php?modname={$_REQUEST['modname']}&assignment_type_id=new"; $link['add']['first'] = 50000; // number before add link moves to top ListOutput($types_RET, $columns, 'Assignment Type', 'Assignment Types', $link, array(), $LO_options); echo '</TD>'; // ASSIGNMENTS if ($_REQUEST['assignment_type_id'] && $_REQUEST['assignment_type_id'] != 'new' && count($types_RET)) { $sql = 'SELECT ASSIGNMENT_ID,TITLE FROM gradebook_assignments WHERE (COURSE_ID=\'' . $course_id . '\' OR COURSE_PERIOD_ID=\'' . $course_period_id . '\') AND ASSIGNMENT_TYPE_ID=\'' . $_REQUEST['assignment_type_id'] . '\' AND (MARKING_PERIOD_ID=\'' . (GetCpDet($course_period_id, 'MARKING_PERIOD_ID') != '' ? UserMP() : GetMPId('FY')) . '\' OR MARKING_PERIOD_ID=' . GetMPId('FY') . ' ) ORDER BY ' . Preferences('ASSIGNMENT_SORTING', 'Gradebook') . ' DESC'; $QI = DBQuery($sql); $assn_RET = DBGet($QI); if (count($assn_RET)) { if ($_REQUEST['assignment_id'] && $_REQUEST['assignment_id'] != 'new') { foreach ($assn_RET as $key => $value) { if ($value['ASSIGNMENT_ID'] == $_REQUEST['assignment_id']) { $assn_RET[$key]['row_color'] = Preferences('HIGHLIGHT'); } } } } echo '<TD valign=top>'; $columns = array('TITLE' => 'Assignment'); $link = array(); $link['TITLE']['link'] = "Modules.php?modname={$_REQUEST['modname']}&assignment_type_id={$_REQUEST['assignment_type_id']}";
echo "<div class=break></div>"; if (AllowEdit()) { unset($_REQUEST); $_REQUEST['modname'] = 'scheduling/Schedule.php'; $_REQUEST['search_modfunc'] = 'list'; $extra['link']['FULL_NAME']['link'] = 'Modules.php?modname=scheduling/Requests.php'; $extra['link']['FULL_NAME']['variables'] = array('subject_id' => 'SUBJECT_ID', 'course_id' => 'COURSE_ID'); include 'modules/scheduling/UnfilledRequests.php'; } } if (clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'choose_course') { if (!isset($_REQUEST['confirm_cid']) || !$_REQUEST['sel_course_period']) { include "modules/scheduling/MultiCoursesforWindow.php"; } else { foreach ($_REQUEST['sel_course_period'] as $ses_cpid => $select_cpid) { DBQuery("INSERT INTO schedule (SYEAR,SCHOOL_ID,STUDENT_ID,START_DATE,MODIFIED_DATE,MODIFIED_BY,COURSE_ID,COURSE_PERIOD_ID,MP,MARKING_PERIOD_ID) values('" . UserSyear() . "','" . UserSchool() . "','" . UserStudentID() . "','" . $date . "','" . $date . "','" . User('STAFF_ID') . "','" . clean_param($_SESSION['crs_id'][$ses_cpid], PARAM_INT) . "','" . clean_param($select_cpid, PARAM_INT) . "','" . clean_param($_SESSION['mp'][$ses_cpid], PARAM_ALPHA) . "','" . clean_param(GetCpDet($ses_cpid, 'MARKING_PERIOD_ID') != '' ? $_SESSION['marking_period_id'][$ses_cpid] : GetMPId('FY'), PARAM_INT) . "')"); DBQuery('UPDATE course_periods SET FILLED_SEATS=FILLED_SEATS+1 WHERE COURSE_PERIOD_ID=\'' . clean_param($select_cpid, PARAM_INT) . '\''); } unset($_SESSION['course_period']); unset($_SESSION['crs_id']); unset($_SESSION['marking_period_id']); unset($_SESSION['mp']); echo "<script language=javascript>opener.document.location = 'Modules.php?modname=" . clean_param($_REQUEST['modname'], PARAM_NOTAGS) . "&time=" . time() . "';window.close();</script>"; } } if (clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'more_info') { $sql = 'SELECT s.COURSE_ID,s.COURSE_PERIOD_ID, s.MARKING_PERIOD_ID,s.START_DATE,s.END_DATE,s.MODIFIED_DATE,s.MODIFIED_BY, UNIX_TIMESTAMP(s.START_DATE) AS START_EPOCH,UNIX_TIMESTAMP(s.END_DATE) AS END_EPOCH,sp.PERIOD_ID, cpv.PERIOD_ID,cp.MARKING_PERIOD_ID as COURSE_MARKING_PERIOD_ID,cp.MP,sp.SORT_ORDER,
} $sql = substr($sql, 0, -1) . " WHERE STUDENT_ID='{$student_id}' AND ASSIGNMENT_ID='{$assignment_id}' AND COURSE_PERIOD_ID='{$course_period_id}'"; } elseif ($columns['POINTS'] != '' || $columns['COMMENT']) { $columns['COMMENT'] = str_replace("'", "\\'", $columns['COMMENT']); $sql = 'INSERT INTO gradebook_grades (STUDENT_ID,PERIOD_ID,COURSE_PERIOD_ID,ASSIGNMENT_ID,POINTS,COMMENT) values(\'' . clean_param($student_id, PARAM_INT) . '\',\'' . clean_param(UserPeriod(), PARAM_INT) . '\',\'' . clean_param($course_period_id, PARAM_INT) . '\',\'' . clean_param($assignment_id, PARAM_INT) . '\',\'' . $columns['POINTS'] . '\',\'' . clean_param($columns['COMMENT'], PARAM_NOTAGS) . '\')'; } if ($sql) { DBQuery($sql); DBQuery('UPDATE gradebook_assignments SET UNGRADED=2 WHERE ASSIGNMENT_ID IN (SELECT ASSIGNMENT_ID FROM gradebook_grades WHERE POINTS IS NULL OR POINTS=\'\') OR ASSIGNMENT_ID NOT IN (SELECT ASSIGNMENT_ID FROM gradebook_grades WHERE POINTS IS NOT NULL OR POINTS!=\'\')'); } } } if ($_REQUEST['student_id']) { $current_RET[$_REQUEST['student_id']] = DBGet(DBQuery('SELECT g.ASSIGNMENT_ID FROM gradebook_grades g,gradebook_assignments a WHERE a.ASSIGNMENT_ID=g.ASSIGNMENT_ID AND a.MARKING_PERIOD_ID=\'' . (GetCpDet($course_period_id, 'MARKING_PERIOD_ID') != '' ? UserMP() : GetMPId('FY')) . '\' AND g.STUDENT_ID=\'' . $_REQUEST[student_id] . '\' AND g.COURSE_PERIOD_ID=\'' . $course_period_id . '\'' . ($_REQUEST['assignment_id'] == 'all' ? '' : ' AND g.ASSIGNMENT_ID=\'' . $_REQUEST[assignment_id] . '\'')), array(), array('ASSIGNMENT_ID')); } elseif ($_REQUEST['assignment_id'] == 'all') { $current_RET = DBGet(DBQuery('SELECT g.STUDENT_ID,g.ASSIGNMENT_ID,g.POINTS FROM gradebook_grades g,gradebook_assignments a WHERE a.ASSIGNMENT_ID=g.ASSIGNMENT_ID AND a.MARKING_PERIOD_ID=\'' . (GetCpDet($course_period_id, 'MARKING_PERIOD_ID') != '' ? UserMP() : GetMPId('FY')) . '\' AND g.COURSE_PERIOD_ID=\'' . $course_period_id . '\''), array(), array('STUDENT_ID', 'ASSIGNMENT_ID')); } else { $current_RET = DBGet(DBQuery('SELECT STUDENT_ID,POINTS,COMMENT,ASSIGNMENT_ID FROM gradebook_grades WHERE ASSIGNMENT_ID=\'' . $_REQUEST[assignment_id] . '\' AND COURSE_PERIOD_ID=\'' . $course_period_id . '\''), array(), array('STUDENT_ID', 'ASSIGNMENT_ID')); } unset($_REQUEST['values']); unset($_SESSION['_REQUEST_vars']['values']); } $_SESSION['assignment_id'] = $_REQUEST['assignment_id']; $stu_RET = GetStuList($extra); $assignment_select = '<SELECT name=assignment_id onchange="document.location.href=\'Modules.php?modname=' . $_REQUEST['modname'] . '&include_inactive=' . $_REQUEST['include_inactive'] . '&assignment_id=\'+this.options[selectedIndex].value"><OPTION value="">Totals</OPTION><OPTION value="all"' . ($_REQUEST['assignment_id'] == 'all' && !$_REQUEST['student_id'] ? ' SELECTED' : '') . '>All</OPTION>'; if ($_REQUEST['student_id']) { $assignment_select .= '<OPTION value=' . $_REQUEST['assignment_id'] . ' SELECTED>' . $stu_RET[1]['FULL_NAME'] . '</OPTION>'; } foreach ($assignments_RET as $id => $assignment) { $assignment_select .= '<OPTION value=' . $id . ($_REQUEST['assignment_id'] == $id && !$_REQUEST['student_id'] ? ' SELECTED' : '') . '>' . $assignment[1]['TYPE_TITLE'] . ' - ' . $assignment[1]['TITLE'] . '</OPTION>'; }