} echo '</table>'; //echo '<div style="font-size:18px; font-weight:bold; ">'.Config('TITLE').' Student Schedule</div><div style="height:20px;"></div>'; //echo '<div>'.$courses[1]['FULL_NAME'].' - #'.$courses[1]['STUDENT_ID']. '</div>'; //echo '<div>'.$courses[1]['GRADE_ID'].' Grade</div>'; //echo '<div>'.ProperDate($date),$_REQUEST['mp_id']?GetMP($_REQUEST['mp_id']):''.'</div>'; ListOutputPrint($courses, $columns, '' . _('Course') . '', '' . _('Courses') . '', array(), array(), array('center' => false, 'print' => false)); echo '<div style="page-break-before: always;"> </div><!-- NEW PAGE -->'; } } PDFStop($handle); } else { BackPrompt(_('No Students were found.')); } } else { BackPrompt(_('You must choose at least one student.')); } } if (!$_REQUEST['modfunc']) { DrawBC("" . _('Scheduling') . " >> " . ProgramTitle()); if ($_REQUEST['search_modfunc'] == 'list') { $mp_RET = DBGet(DBQuery('SELECT MARKING_PERIOD_ID,TITLE,SORT_ORDER,1 AS TBL FROM school_years WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' UNION SELECT MARKING_PERIOD_ID,TITLE,SORT_ORDER,2 AS TBL FROM school_semesters WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' UNION SELECT MARKING_PERIOD_ID,TITLE,SORT_ORDER,3 AS TBL FROM school_quarters WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' ORDER BY TBL,SORT_ORDER')); $mp_select = '<SELECT name=mp_id><OPTION value="">' . _('N/A') . ''; foreach ($mp_RET as $mp) { $mp_select .= '<OPTION value=' . $mp['MARKING_PERIOD_ID'] . '>' . $mp['TITLE']; } $mp_select .= '</SELECT>'; echo "<meta charset='UTF-8'><FORM name=sch id=sch action=for_export.php?modname={$_REQUEST['modname']}&head_html=Student+Schedules+Report&modfunc=save&include_inactive={$_REQUEST['include_inactive']}&_openSIS_PDF=true method=POST target=_blank>"; #$extra['header_right'] = '<INPUT type=submit value=\'Create Schedules for Selected Students\'>'; PopTable_wo_header('header'); $extra['extra_header_left'] = '<TABLE>';
foreach ($_REQUEST['values']['STUDENT_ENROLLMENT'][UserStudentID()] as $column => $value) { $sql .= "{$column}='" . str_replace(''', "''", $value) . "',"; } $sql = mb_substr($sql, 0, -1) . " WHERE STUDENT_ID='" . UserStudentID() . "' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"; DBQuery($sql); } } else { if ($_REQUEST['assign_student_id']) { $student_id = $_REQUEST['assign_student_id']; if (count(DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE STUDENT_ID='{$student_id}'")))) { BackPrompt(_('That RosarioSIS ID is already taken. Please select a different one.')); } } elseif (empty($_REQUEST['students']['FIRST_NAME']) || empty($_REQUEST['students']['LAST_NAME']) || empty($_REQUEST['values']['STUDENT_ENROLLMENT']['new']['GRADE_ID'])) { BackPrompt(_('Please fill in the required fields')); } elseif ($_REQUEST['moodle_create_student'] && empty($_REQUEST['students']['USERNAME'])) { BackPrompt(_('Please fill in the required fields')); } else { do { $student_id = DBGet(DBQuery('SELECT ' . db_seq_nextval('STUDENTS_SEQ') . ' AS STUDENT_ID ' . FROM_DUAL)); $student_id = $student_id[1]['STUDENT_ID']; } while (count(DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE STUDENT_ID='" . $student_id . "'")))); } $sql = "INSERT INTO STUDENTS "; $fields = 'STUDENT_ID,'; $values = "'" . $student_id . "',"; foreach ($_REQUEST['students'] as $column => $value) { if ($column == 'USERNAME' && $value) { if (DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE USERNAME='******'"))) { $value = ''; } }
break; case 'QTR': $fields .= 'SEMESTER_ID,'; $values .= '\'' . $_REQUEST['semester_id'] . '\','; break; case 'PRO': $fields .= 'QUARTER_ID,'; $values .= '\'' . $_REQUEST['quarter_id'] . '\','; break; } $go = false; foreach ($columns as $column => $value) { $value = paramlib_validation($column, trim($value)); if ($column == 'START_DATE' || $column == 'END_DATE' || $column == 'POST_START_DATE' || $column == 'POST_END_DATE') { if (!VerifyDate($value) && $value != '') { BackPrompt('Not all of the dates were entered correctly.'); } } if ($value) { if ($column == 'START_DATE' && $columns['START_DATE'] != '') { if (strtotime($dates['START_DATE']) <= strtotime($columns['START_DATE'])) { $fields .= $column . ','; $values .= '\'' . str_replace("'", "''", str_replace("\\'", "''", $value)) . '\','; $go = true; } else { $err_msg = "Start date cannot be earlier than {$nm} start date"; $_REQUEST['marking_period_id'] = 'new'; break 2; } } if ($column == 'END_DATE' && $columns['END_DATE'] != '') {
$password = $this_school_mod['PASSWORD']; $this_school_RET = DBGet(DBQuery("SELECT * FROM staff_school_info WHERE STAFF_ID=" . $_REQUEST[staff_id])); $this_school = $this_school_RET[1]; if (isset($_REQUEST['staff']['PROFILE']) && $_REQUEST['staff']['PROFILE'] != $profile_RET[1]['PROFILE_ID']) { if ($_REQUEST['staff']['PROFILE'] == 'admin') { $_REQUEST['staff']['PROFILE_ID'] = '1'; } elseif ($_REQUEST['staff']['PROFILE'] == 'teacher') { $_REQUEST['staff']['PROFILE_ID'] = '2'; } elseif ($_REQUEST['staff']['PROFILE'] == 'parent') { $_REQUEST['staff']['PROFILE_ID'] = '4'; } } if ($_REQUEST['staff']['USERNAME'] && $_REQUEST['staff']['USERNAME'] != $profile_RET[1]['USERNAME']) { $existing_staff = DBGet(DBQuery('SELECT ssr.SYEAR FROM staff s,staff_school_relationship ssr WHERE s.STAFF_ID=ssr.STAFF_ID AND s.USERNAME=\'' . $_REQUEST['staff']['USERNAME'] . '\' AND ssr.SYEAR=(SELECT SYEAR FROM staff_school_relationship WHERE STAFF_ID=\'' . $_REQUEST[staff_id] . '\')')); if (count($existing_staff)) { BackPrompt('A user with that username already exists for the ' . $existing_staff[1]['SYEAR'] . ' school year. Choose a different username and try again.'); } } if (count($_REQUEST['month_staff'])) { foreach ($_REQUEST['month_staff'] as $column => $value) { $_REQUEST['staff'][$column] = $_REQUEST['day_staff'][$column] . '-' . $_REQUEST['month_staff'][$column] . '-' . $_REQUEST['year_staff'][$column]; if ($_REQUEST['staff'][$column] == '--') { $_REQUEST['staff'][$column] = ''; } elseif (!VerifyDate($_REQUEST['staff'][$column])) { unset($_REQUEST['staff'][$column]); $note = "The invalid date could not be saved. "; } } } unset($_REQUEST['day_staff']); unset($_REQUEST['month_staff']);
if (optional_param('modfunc', '', PARAM_NOTAGS) == 'save') { if ($_REQUEST['activity_id']) { $current_RET = DBGet(DBQuery('SELECT STUDENT_ID FROM student_eligibility_activities WHERE ACTIVITY_ID=\'' . $_SESSION['activity_id'] . '\' AND SYEAR=\'' . UserSyear() . '\''), array(), array('STUDENT_ID')); foreach ($_REQUEST['student'] as $student_id => $yes) { if (!$current_RET[$student_id]) { /*$sql = "INSERT INTO student_eligibility_activities (SYEAR,STUDENT_ID,ACTIVITY_ID) values('".UserSyear()."','".$student_id."','".$_REQUEST['activity_id']."')";*/ $sql = 'INSERT INTO student_eligibility_activities (SYEAR,STUDENT_ID,ACTIVITY_ID) values(\'' . UserSyear() . '\',\'' . $student_id . '\',\'' . optional_param('activity_id', '', PARAM_SPCL) . '\')'; DBQuery($sql); } } unset($_REQUEST['modfunc']); $note = "That activity has been added to the selected students."; } else { BackPrompt('You must choose an activity.'); } } DrawBC("Extracurricular > " . ProgramTitle()); if ($note) { DrawHeader('<table><tr><td><IMG SRC=assets/check.gif></td><td class=notice_msg>' . $note . '</td></tr></table>'); } if ($_REQUEST['search_modfunc'] == 'list') { echo "<FORM name=addact id=addact action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save METHOD=POST>"; #DrawHeader('',SubmitButton('Add Activity to Selected Students')); #echo '<BR>'; echo '<CENTER><TABLE cellpadding=6><TR><TD align=right><b>Activity</b></TD>'; echo '<TD>'; $activities_RET = DBGet(DBQuery('SELECT ID,TITLE FROM eligibility_activities WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\'')); echo '<SELECT name=activity_id><OPTION value="">N/A</OPTION>'; if (count($activities_RET)) {
if ($mps[$last_mp][1]['COMMENT_TITLE']) { $grades_RET[$i]['COMMENT'] .= $sep . $mps[$last_mp][1]['COMMENT_TITLE']; } } } } if (count($_REQUEST['mp_arr']) == 1) { $link['remove']['link'] = PreparePHP_SELF($_REQUEST, array(), array('modfunc' => 'delete')); $link['remove']['variables'] = array('student_id' => 'STUDENT_ID', 'course_period_id' => 'COURSE_PERIOD_ID', 'marking_period_id' => 'MARKING_PERIOD_ID'); } ListOutput($grades_RET, $columns, '.', '.', $link); } else { BackPrompt(_('No Students were found.')); } } else { BackPrompt(_('You must choose at least one student and one marking period')); } } if (!$_REQUEST['modfunc']) { DrawHeader(ProgramTitle()); if ($_REQUEST['search_modfunc'] == 'list') { $_CENTRE['allow_edit'] = true; echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save&include_inactive={$_REQUEST['include_inactive']} method=POST>"; $extra['header_right'] = SubmitButton(_('Create Grade Lists for Selected Students')); $attendance_codes = DBGet(DBQuery("SELECT SHORT_NAME,ID FROM ATTENDANCE_CODES WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND (DEFAULT_CODE!='Y' OR DEFAULT_CODE IS NULL) AND TABLE_NAME='0'")); $extra['extra_header_left'] = '<TABLE>'; $extra['extra_header_left'] .= '<TR><TD colspan=2><b>' . Localize('colon', _('Include on Grade List')) . '</b></TD></TR>'; $extra['extra_header_left'] .= '<TR><TD></TD><TD><TABLE>'; $extra['extra_header_left'] .= '<TR>'; $extra['extra_header_left'] .= '<TD><INPUT type=checkbox name=elements[teacher] value=Y CHECKED>' . _('Teacher') . '</TD>'; $extra['extra_header_left'] .= '<TD></TD>';
if ($value) { $fields .= $column . ','; $values .= "'" . $value . "',"; $go = true; } } $sql .= '(' . mb_substr($fields, 0, -1) . ') values(' . mb_substr($values, 0, -1) . ')'; } // CHECK TO MAKE SURE ONLY ONE MP & ONE GRADING PERIOD IS OPEN AT ANY GIVEN TIME $dates_RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM SCHOOL_MARKING_PERIODS WHERE MP='{$_REQUEST['mp_term']}' AND (true=false" . ($columns['START_DATE'] ? " OR '" . $columns['START_DATE'] . "' BETWEEN START_DATE AND END_DATE" : '') . ($columns['END_DATE'] ? " OR '" . $columns['END_DATE'] . "' BETWEEN START_DATE AND END_DATE" : '') . ($columns['START_DATE'] && $columns['END_DATE'] ? " OR START_DATE BETWEEN '" . $columns['START_DATE'] . "' AND '" . $columns['END_DATE'] . "'\n\t\t\t\tOR END_DATE BETWEEN '" . $columns['START_DATE'] . "' AND '" . $columns['END_DATE'] . "'" : '') . ") AND SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'" . ($id != 'new' ? " AND SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' AND MARKING_PERIOD_ID!='{$id}'" : ''))); $posting_RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM SCHOOL_MARKING_PERIODS WHERE MP='{$_REQUEST['mp_term']}' AND (true=false" . ($columns['POST_START_DATE'] ? " OR '" . $columns['POST_START_DATE'] . "' BETWEEN POST_START_DATE AND POST_END_DATE" : '') . ($columns['POST_END_DATE'] ? " OR '" . $columns['POST_END_DATE'] . "' BETWEEN POST_START_DATE AND POST_END_DATE" : '') . ($columns['POST_START_DATE'] && $columns['POST_END_DATE'] ? " OR POST_START_DATE BETWEEN '" . $columns['POST_START_DATE'] . "' AND '" . $columns['POST_END_DATE'] . "'\n\t\t\t\tOR POST_END_DATE BETWEEN '" . $columns['POST_START_DATE'] . "' AND '" . $columns['POST_END_DATE'] . "'" : '') . ") AND SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'" . ($id != 'new' ? " AND MARKING_PERIOD_ID!='{$id}'" : ''))); if (count($dates_RET)) { BackPrompt(sprintf(_('The beginning and end dates you specified for this marking period overlap with those of "%s".'), GetMP($dates_RET[1]['MARKING_PERIOD_ID'])) . " " . _("Only one marking period can be open at any time.")); } if (count($posting_RET)) { BackPrompt(sprintf(_('The grade posting dates you specified for this marking period overlap with those of "%s".'), GetMP($posting_RET[1]['MARKING_PERIOD_ID'])) . " " . _("Only one grade posting period can be open at any time.")); } if ($go) { DBQuery($sql); } } else { $error = ErrorMessage(array(_('Please enter a valid Sort Order.'))); } } unset($_REQUEST['tables']); unset($_SESSION['_REQUEST_vars']['tables']); } if ($_REQUEST['modfunc'] == 'delete' & AllowEdit()) { $extra = array(); switch ($_REQUEST['mp_term']) { case 'FY':
} if ($next_school != '') { DBQuery("UPDATE STUDENT_ENROLLMENT SET NEXT_SCHOOL='" . $next_school . "' WHERE SYEAR='" . UserSyear() . "' AND STUDENT_ID IN (" . substr($students, 1) . ") "); } if ($calendar) { DBQuery("UPDATE STUDENT_ENROLLMENT SET CALENDAR_ID='" . $calendar . "' WHERE SYEAR='" . UserSyear() . "' AND STUDENT_ID IN (" . substr($students, 1) . ") "); } if (!$note) { $note = '<IMG SRC=assets/check.gif>' . _('The specified information was applied to the selected students.'); } unset($_REQUEST['modfunc']); unset($_REQUEST['values']); unset($_SESSION['_REQUEST_vars']['modfunc']); unset($_SESSION['_REQUEST_vars']['values']); } else { BackPrompt(_('You must choose at least one field and one student')); } } DrawHeader(ProgramTitle()); if (!$_REQUEST['modfunc']) { $extra['link'] = array('FULL_NAME' => false); $extra['SELECT'] = ",CAST (NULL AS CHAR(1)) AS CHECKBOX"; if ($_REQUEST['search_modfunc'] == 'list') { echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save METHOD=POST>"; DrawHeader('', SubmitButton(_('Save'))); echo '<BR>'; if ($_REQUEST['category_id']) { $fields_RET = DBGet(DBQuery("SELECT ID,TITLE,TYPE,SELECT_OPTIONS FROM CUSTOM_FIELDS WHERE CATEGORY_ID='{$_REQUEST['category_id']}'"), array(), array('TYPE')); } else { $fields_RET = DBGet(DBQuery("SELECT ID,TITLE,TYPE,SELECT_OPTIONS FROM CUSTOM_FIELDS"), array(), array('TYPE')); }
} $sql = substr($sql, 0, -1) . " WHERE STAFF_ID='" . UserStaffID() . "'"; if (User('PROFILE') == 'admin') { DBQuery($sql); } } else { if ($_REQUEST['staff']['PROFILE'] == 'admin') { $_REQUEST['staff']['PROFILE_ID'] = '1'; } elseif ($_REQUEST['staff']['PROFILE'] == 'teacher') { $_REQUEST['staff']['PROFILE_ID'] = '2'; } elseif ($_REQUEST['staff']['PROFILE'] == 'parent') { $_REQUEST['staff']['PROFILE_ID'] = '3'; } $existing_staff = DBGet(DBQuery("SELECT 'exists' FROM STAFF WHERE USERNAME='******'staff']['USERNAME'] . "' AND SYEAR='" . UserSyear() . "'")); if (count($existing_staff)) { BackPrompt(_('A user with that username already exists for the current school year.') . ' ' . _('Choose a different username and try again.')); } $staff_id = DBGet(DBQuery('SELECT ' . db_seq_nextval('STAFF_SEQ') . ' AS STAFF_ID' . FROM_DUAL)); $staff_id = $staff_id[1]['STAFF_ID']; $sql = "INSERT INTO STAFF "; $fields = 'SYEAR,STAFF_ID,'; $values = "'" . UserSyear() . "','" . $staff_id . "',"; if (basename($_SERVER['PHP_SELF']) == 'index.php') { $fields .= 'PROFILE,'; $values = "'" . Config('SYEAR') . "'" . substr($values, strpos($values, ',')) . "'none',"; } foreach ($_REQUEST['staff'] as $column => $value) { if ($value) { $fields .= $column . ','; $values .= "'" . str_replace("\\'", "''", $value) . "',"; }
$_REQUEST[$var] = $students_RET['1'][$val]; } } if (!is_array($students_RET[1]['STUDENT_ID'])) { $_SESSION['student_id'] = $students_RET[1]['STUDENT_ID']; if (User('PROFILE') == 'admin') { $_SESSION['UserSchool'] = $students_RET[1]['LIST_SCHOOL_ID']; } if (User('PROFILE') == 'teacher') { $_SESSION['UserSchool'] = $students_RET[1]['SCHOOL_ID']; } echo '<script language=JavaScript>parent.side.location="' . $_SESSION['Side_PHP_SELF'] . '?modcat="+parent.side.document.forms[0].modcat.value;</script>'; unset($_REQUEST['search_modfunc']); } if ($_REQUEST['modname'] != $_REQUEST['next_modname']) { $modname = $_REQUEST['next_modname']; if (strpos($modname, '?')) { $modname = substr($_REQUEST['next_modname'], 0, strpos($_REQUEST['next_modname'], '?')); } if (strpos($modname, '&')) { $modname = substr($_REQUEST['next_modname'], 0, strpos($_REQUEST['next_modname'], '&')); } if ($_REQUEST['modname']) { $_REQUEST['modname'] = $modname; } include 'modules/' . $modname; } } else { BackPrompt('No students were found.'); } }
<?php DrawHeader(ProgramTitle()); Widgets('activity'); Widgets('course'); Widgets('eligibility'); Search('student_id', $extra); if ($_REQUEST['modfunc'] == 'add' && AllowEdit()) { //modif Francois: fix bug add the same activity more than once $activity_RET = DBGet(DBQuery("SELECT ACTIVITY_ID FROM STUDENT_ELIGIBILITY_ACTIVITIES WHERE STUDENT_ID='" . UserStudentID() . "' AND ACTIVITY_ID='" . $_REQUEST['new_activity'] . "' AND SYEAR='" . UserSyear() . "'")); if (count($activity_RET)) { BackPrompt(_('The activity you selected is already assigned to this student!')); } DBQuery("INSERT INTO STUDENT_ELIGIBILITY_ACTIVITIES (STUDENT_ID,ACTIVITY_ID,SYEAR) values('" . UserStudentID() . "','" . $_REQUEST['new_activity'] . "','" . UserSyear() . "')"); unset($_REQUEST['modfunc']); } if ($_REQUEST['modfunc'] == 'remove' && AllowEdit()) { if (DeletePrompt(_('Activity'))) { DBQuery("DELETE FROM STUDENT_ELIGIBILITY_ACTIVITIES WHERE STUDENT_ID='" . UserStudentID() . "' AND ACTIVITY_ID='" . $_REQUEST['activity_id'] . "' AND SYEAR='" . UserSyear() . "'"); unset($_REQUEST['modfunc']); } } if (UserStudentID() && !$_REQUEST['modfunc']) { $start_end_RET = DBGet(DBQuery("SELECT TITLE,VALUE FROM PROGRAM_CONFIG WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND PROGRAM='eligibility' AND TITLE IN ('START_DAY','END_DAY')")); if (count($start_end_RET)) { foreach ($start_end_RET as $value) { ${$value}['TITLE'] = $value['VALUE']; } } switch (date('D')) { case 'Mon':
if ($exists_RET[$table][1]['COUNT'] > 0) { //modif Francois: add <label> on checkbox $table_list .= '<TR><TD><label><INPUT type="checkbox" value="Y" name="tables[' . $table . ']"><span style="color:grey"> ' . $name . ' (' . $exists_RET[$table][1]['COUNT'] . ')</span></label></TD></TR>'; } else { $table_list .= '<TR><TD><label><INPUT type="checkbox" value="Y" name="tables[' . $table . ']" checked /> ' . $name . '</label></TD></TR>'; } } $table_list .= '</TABLE><BR />' . '* ' . _('You <i>must</i> roll users, school periods, marking periods, calendars, attendance codes, and report card codes at the same time or before rolling courses.') . '<BR /><BR />* ' . _('You <i>must</i> roll enrollment codes at the same time or before rolling students.') . '<BR /><BR />* ' . _('You <i>must</i> roll courses at the same time or before rolling report card comments.') . '<BR /><BR />' . _('Greyed items have already have data in the next school year (They might have been rolled).') . '<BR /><BR />' . _('Rolling greyed items will delete already existing data in the next school year.'); DrawHeader(ProgramTitle()); //modif Francois: school year over one/two calendar years format if (Prompt(_('Confirm') . ' ' . _('Rollover'), sprintf(_('Are you sure you want to roll the data for %s to the next school year?'), FormatSyear(UserSyear(), Config('SCHOOL_SYEAR_OVER_2_YEARS'))), $table_list)) { if ($_REQUEST['tables']['COURSES'] && (!$_REQUEST['tables']['STAFF'] && $exists_RET['STAFF'][1]['COUNT'] < 1 || !$_REQUEST['tables']['SCHOOL_PERIODS'] && $exists_RET['SCHOOL_PERIODS'][1]['COUNT'] < 1 || !$_REQUEST['tables']['SCHOOL_MARKING_PERIODS'] && $exists_RET['SCHOOL_MARKING_PERIODS'][1]['COUNT'] < 1 || !$_REQUEST['tables']['ATTENDANCE_CALENDARS'] && $exists_RET['ATTENDANCE_CALENDARS'][1]['COUNT'] < 1 || !$_REQUEST['tables']['REPORT_CARD_GRADES'] && $exists_RET['REPORT_CARD_GRADES'][1]['COUNT'] < 1)) { BackPrompt(_('You <i>must</i> roll users, school periods, marking periods, calendars, and report card codes at the same time or before rolling courses.')); } if ($_REQUEST['tables']['REPORT_CARD_COMMENTS'] && (!$_REQUEST['tables']['COURSES'] && $exists_RET['COURSES'][1]['COUNT'] < 1)) { BackPrompt(_('You <i>must</i> roll courses at the same time or before rolling report card comments.')); } if (count($_REQUEST['tables'])) { foreach ($_REQUEST['tables'] as $table => $value) { //if($exists_RET[$table][1]['COUNT']>0) // DBQuery("DELETE FROM $table WHERE SYEAR='".$next_syear."'".(!$no_school_tables[$table]?" AND SCHOOL_ID='".UserSchool()."'":'')); Rollover($table); } } echo '<FORM action="Modules.php?modname=' . $_REQUEST['modname'] . '" method="POST">'; // DrawHeader('<IMG SRC=assets/check.png>'._('The data have been rolled.'),'<INPUT type=submit value="'._('OK').'">'); //modif Francois: Moodle integrator echo $moodleError; echo '<div class="updated"><IMG SRC="assets/check.png" class="alignImg"> ' . _('The data have been rolled.'), '<INPUT type="submit" value="' . _('OK') . '" /></div>'; echo '</FORM>'; unset($_SESSION['_REQUEST_vars']['tables']);
$sql = substr($sql, 0, -1) . " WHERE STUDENT_ID='" . UserStudentID() . "'"; DBQuery($sql); } if (count($_REQUEST['values']['STUDENT_ENROLLMENT'][UserStudentID()])) { $sql = "UPDATE STUDENT_ENROLLMENT SET "; foreach ($_REQUEST['values']['STUDENT_ENROLLMENT'][UserStudentID()] as $column => $value) { $sql .= "{$column}='" . str_replace("\\'", "''", str_replace(''', "''", $value)) . "',"; } $sql = substr($sql, 0, -1) . " WHERE STUDENT_ID='" . UserStudentID() . "' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"; DBQuery($sql); } } else { if ($_REQUEST['assign_student_id']) { $student_id = $_REQUEST['assign_student_id']; if (count(DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE STUDENT_ID='{$student_id}'")))) { BackPrompt(_('That Centre ID is already taken. Please select a different one.')); } } else { do { $student_id = DBGet(DBQuery('SELECT ' . db_seq_nextval('STUDENTS_SEQ') . ' AS STUDENT_ID ' . FROM_DUAL)); $student_id = $student_id[1]['STUDENT_ID']; } while (count(DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE STUDENT_ID='" . $student_id . "'")))); } $sql = "INSERT INTO STUDENTS "; $fields = 'STUDENT_ID,'; $values = "'" . $student_id . "',"; foreach ($_REQUEST['students'] as $column => $value) { if ($column == 'USERNAME' && $value) { if (DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE USERNAME='******'", "''", $value) . "'"))) { $value = ''; }
foreach ($link['FULL_NAME']['variables'] as $var => $val) { $_REQUEST[$var] = $staff_RET['1'][$val]; } } if (!is_array($staff_RET[1]['STAFF_ID'])) { $_SESSION['staff_id'] = $staff_RET[1]['STAFF_ID']; echo '<script type="text/javascript">parent.side.location="' . $_SESSION['Side_PHP_SELF'] . '?modcat="+parent.side.document.forms[0].modcat.value;</script>'; unset($_REQUEST['search_modfunc']); } if ($_REQUEST['modname'] != $_REQUEST['next_modname']) { $modname = $_REQUEST['next_modname']; if (mb_strpos($modname, '?')) { $modname = mb_substr($_REQUEST['next_modname'], 0, mb_strpos($_REQUEST['next_modname'], '?')); } if (mb_strpos($modname, '&')) { $modname = mb_substr($_REQUEST['next_modname'], 0, mb_strpos($_REQUEST['next_modname'], '&')); } if ($_REQUEST['modname']) { $_REQUEST['modname'] = $modname; } //modif Francois: security fix, cf http://www.securiteam.com/securitynews/6S02U1P6BI.html if (mb_substr($modname, -4, 4) != '.php' || mb_strpos($modname, '..') !== false || !is_file('modules/' . $modname)) { HackingLog(); } else { include 'modules/' . $modname; } } } else { BackPrompt(_('No Users were found.')); } }
echo '</TABLE>'; echo '<TABLE width=80%>'; echo '<TR><TD width=65%><FONT size=1><BR></TD></TR>'; echo '<TR><TD><FONT size=4>' . $student['TEACHER'] . '<BR></FONT><FONT size=0>Teacher</FONT></TD>'; echo '<TD><FONT size=3>' . $mp_RET[1]['TITLE'] . '<BR></FONT><FONT size=0>Marking Period</FONT></TD></TR>'; echo '<TR><TD><FONT size=4>' . $school_info_RET[1]['PRINCIPAL'] . '<BR></FONT><FONT size=0>Principal</FONT></TD>'; echo '<TD><FONT size=3>' . date('F j, Y', strtotime($mp_RET[1]['END_DATE'])) . '<BR></FONT><FONT size=0>Date</FONT></TD></TR>'; echo '</TABLE>'; echo '</CENTER>'; echo "<div style=\"page-break-before: always;\"></div>"; echo '<!-- NEW PAGE -->'; } PDFStop($handle); } } else { BackPrompt('You must choose at least one student'); } } elseif ($_REQUEST['modfunc'] == 'save') { echo '<font color=red>First setup the Honor Roll(grades->Setup->Honor Roll Setup)..</font>'; } if (!$_REQUEST['modfunc']) { if ($_REQUEST['search_modfunc'] == 'list') { $sem = GetParentMP('SEM', UserMP()); $fy = GetParentMP('FY', $sem); $pros = GetChildrenMP('PRO', UserMP()); if ($fy) { $gradedmp = DBGet(DBQuery('SELECT count(*) as GRADES from student_report_card_grades where marking_period_id=' . $fy . '')); } if (!$gradedmp[1]['GRADES'] && $sem) { $gradedmp = DBGet(DBQuery('SELECT count(*) as GRADES from student_report_card_grades where marking_period_id=' . $sem . '')); $mp = $sem;
foreach ($tables as $table => $name) { $exists_RET[$table] = DBGet(DBQuery('SELECT count(*) AS COUNT from ' . $table . ' WHERE SYEAR=\'' . $next_syear . '\'' . (!$no_school_tables[$table] ? ' AND SCHOOL_ID=\'' . UserSchool() . '\'' : ''))); if ($exists_RET[$table][1]['COUNT'] > 0) { $table_list .= '<TR><td width=1%></td><TD width=5%><INPUT type=checkbox value=Y name=tables[' . $table . ']></TD><TD width=94%>' . $name . ' (' . $exists_RET[$table][1]['COUNT'] . ')</TD></TR>'; } else { $table_list .= '<TR><td width=1%></td><TD width=5%><INPUT type=checkbox value=Y name=tables[' . $table . '] CHECKED></TD><TD width=94%>' . $name . '</TD></TR>'; } } $table_list .= '</TABLE></CENTER><CENTER>'; DrawBC("School Setup > " . ProgramTitle()); if (Prompt_rollover('Confirm Rollover', 'Are you sure you want to roll the data for ' . UserSyear() . '-' . (UserSyear() + 1) . ' to the next school year?', $table_list)) { if ($_REQUEST['tables']['courses'] && (!$_REQUEST['tables']['staff'] && $exists_RET['staff'][1]['COUNT'] < 1 || !$_REQUEST['tables']['school_periods'] && $exists_RET['school_periods'][1]['COUNT'] < 1 || !$_REQUEST['tables']['school_years'] && $exists_RET['school_years'][1]['COUNT'] < 1 || !$_REQUEST['tables']['school_calendars'] && $exists_RET['school_calendars'][1]['COUNT'] < 1 || !$_REQUEST['tables']['report_card_grade_scales'] && $exists_RET['report_card_grade_scales'][1]['COUNT'] < 1)) { BackPrompt('You must roll users, school periods, marking periods, calendars, and report card codes at the same time or before rolling courses.'); } if ($_REQUEST['tables']['report_card_comments'] && (!$_REQUEST['tables']['courses'] && $exists_RET['courses'][1]['COUNT'] < 1)) { BackPrompt('You must roll courses at the same time or before rolling report card comments.'); } if (count($_REQUEST['tables'])) { foreach ($_REQUEST['tables'] as $table => $value) { Rollover($table); } } DrawHeaderHome('<IMG SRC=assets/check.gif>The data have been rolled.', '<input type=button onclick=document.location.href="index.php?modfunc=logout" value="Please login again" class=btn_large >'); unset($_SESSION['_REQUEST_vars']['tables']); unset($_SESSION['_REQUEST_vars']['delete_ok']); // --------------------------------------------------------------------------------------------------------------------------------------------------------- // } function Rollover($table) { global $next_syear; switch ($table) {
/*$sql = "UPDATE ATTENDANCE_PERIOD SET ATTENDANCE_CODE='$_REQUEST[absence_code]',ATTENDANCE_TEACHER_CODE='$_REQUEST[absence_code]',ATTENDANCE_REASON='$_REQUEST[absence_reason]',ADMIN='Y' WHERE STUDENT_ID='$student_id' AND SCHOOL_DATE='$date' AND PERIOD_ID='$period_id'"; */ $sql = "UPDATE ATTENDANCE_PERIOD SET ATTENDANCE_CODE='" . optional_param('absence_code', '', PARAM_NUMBER) . "',ATTENDANCE_TEACHER_CODE='" . optional_param('absence_code', '', PARAM_NUMBER) . "',ATTENDANCE_REASON='" . optional_param('absence_reason', '', PARAM_SPCL) . "',ADMIN='Y'\r\n\t\t\t\t\t\t\t\tWHERE STUDENT_ID='{$student_id}' AND SCHOOL_DATE='{$date}' AND PERIOD_ID='{$period_id}'"; DBQuery($sql); } } $val = optional_param('absence_reason', '', PARAM_SPCL); //UpdateAttendanceDaily($student_id,$date,($_REQUEST['absence_reason']?$_REQUEST['absence_reason']:false)); UpdateAttendanceDaily($student_id, $date, $val ? $val : false); } } unset($_REQUEST['modfunc']); $note = LANG_RECORDS_ADDED_CONFIRMATION; } else { BackPrompt(LANG_CHOOSE_STUDENT_ERROR); } } if (!$_REQUEST['modfunc']) { $extra['link'] = array('FULL_NAME' => false); $extra['SELECT'] = ",NULL AS CHECKBOX"; //if($_REQUEST['search_modfunc']=='list') if (optional_param('search_modfunc', '', PARAM_NOTAGS) == 'list') { echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save METHOD=POST>"; PopTable_wo_header('header'); echo '<BR>'; echo '<CENTER><TABLE><TR><TD align=right>Add absence to periods</TD>'; echo '<TD><TABLE><TR>'; $periods_RET = DBGet(DBQuery("SELECT SHORT_NAME,PERIOD_ID FROM SCHOOL_PERIODS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND EXISTS (SELECT * FROM COURSE_PERIODS WHERE PERIOD_ID=SCHOOL_PERIODS.PERIOD_ID AND DOES_ATTENDANCE='Y') ORDER BY SORT_ORDER")); foreach ($periods_RET as $period) { echo '<TD><INPUT type=CHECKBOX value=Y name=period[' . $period['PERIOD_ID'] . ']>' . $period['SHORT_NAME'] . '</TD>';
if ($value) { $fields .= $column . ','; $values .= "'" . str_replace("\\'", "''", $value) . "',"; $go = true; } } $sql .= '(' . substr($fields, 0, -1) . ') values(' . substr($values, 0, -1) . ')'; } // CHECK TO MAKE SURE ONLY ONE MP & ONE GRADING PERIOD IS OPEN AT ANY GIVEN TIME $dates_RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM {$table} WHERE (true=false" . ($columns['START_DATE'] ? " OR '" . $columns['START_DATE'] . "' BETWEEN START_DATE AND END_DATE" : '') . ($columns['END_DATE'] ? " OR '" . $columns['END_DATE'] . "' BETWEEN START_DATE AND END_DATE" : '') . ($columns['START_DATE'] && $columns['END_DATE'] ? " OR START_DATE BETWEEN '" . $columns['START_DATE'] . "' AND '" . $columns['END_DATE'] . "'\n\t\t\t\tOR END_DATE BETWEEN '" . $columns['START_DATE'] . "' AND '" . $columns['END_DATE'] . "'" : '') . ") AND SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'" . ($id != 'new' ? " AND SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' AND MARKING_PERIOD_ID!='{$id}'" : ''))); $posting_RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM {$table} WHERE (true=false" . ($columns['POST_START_DATE'] ? " OR '" . $columns['POST_START_DATE'] . "' BETWEEN POST_START_DATE AND POST_END_DATE" : '') . ($columns['POST_END_DATE'] ? " OR '" . $columns['POST_END_DATE'] . "' BETWEEN POST_START_DATE AND POST_END_DATE" : '') . ($columns['POST_START_DATE'] && $columns['POST_END_DATE'] ? " OR POST_START_DATE BETWEEN '" . $columns['POST_START_DATE'] . "' AND '" . $columns['POST_END_DATE'] . "'\n\t\t\t\tOR POST_END_DATE BETWEEN '" . $columns['POST_START_DATE'] . "' AND '" . $columns['POST_END_DATE'] . "'" : '') . ") AND SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'" . ($id != 'new' ? " AND MARKING_PERIOD_ID!='{$id}'" : ''))); if (count($dates_RET)) { BackPrompt('The beginning and end dates you specified for this marking period overlap with those of ' . GetMP($dates_RET[1]['MARKING_PERIOD_ID']) . ". Only one marking period can be open at any time."); } if (count($posting_RET)) { BackPrompt('The grade posting dates you specified for this marking period overlap with those of ' . GetMP($posting_RET[1]['MARKING_PERIOD_ID']) . ". Only one grade posting period can be open at any time."); } if ($go) { DBQuery($sql); } } // ---------------------- Insert & Update End ------------------------------ // unset($_REQUEST['tables']); unset($_SESSION['_REQUEST_vars']['tables']); } if ($_REQUEST['modfunc'] == 'delete') { $extra = array(); switch ($table) { case 'SCHOOL_YEARS': $name = 'year'; $parent_term = '';
$extra['SELECT'] .= ',ssm.NEXT_SCHOOL,ssm.CALENDAR_ID,ssm.SYEAR,ssm.SCHOOL_ID AS SCHOOL_NUMBER,s.*'; if ($_REQUEST['fields']['FIRST_INIT']) { $extra['SELECT'] .= ',SUBSTR(s.FIRST_NAME,1,1) AS FIRST_INIT'; } if ($_REQUEST['fields']['GIVEN_NAME']) { $extra['SELECT'] .= ",s.LAST_NAME||', '||s.FIRST_NAME||' '||coalesce(s.MIDDLE_NAME,' ') AS GIVEN_NAME"; } if ($_REQUEST['fields']['COMMON_NAME']) { $extra['SELECT'] .= ",s.LAST_NAME||', '||s.FIRST_NAME AS COMMON_NAME"; } if (!$extra['functions']) { $extra['functions'] = array('NEXT_SCHOOL' => '_makeNextSchool', 'CALENDAR_ID' => '_makeCalendar', 'SCHOOL_ID' => 'GetSchool', 'SCHOOL_NUMBER' => 'GetSchool', 'PARENTS' => 'makeParents', 'LAST_LOGIN' => 'makeLogin'); } if ($_REQUEST['search_modfunc'] == 'list') { if (empty($_REQUEST['fields'])) { BackPrompt(_('You must choose at least one field')); } if (!$fields_list) { //modif Francois: disable mailing address display if (Config('STUDENTS_USE_MAILING')) { $fields_list = array('FULL_NAME' => _('Last, First M'), 'FIRST_NAME' => _('First Name'), 'FIRST_INIT' => _('First Name Initial'), 'LAST_NAME' => _('Last Name'), 'MIDDLE_NAME' => _('Middle Name'), 'NAME_SUFFIX' => _('Suffix'), 'STUDENT_ID' => _('RosarioSIS ID'), 'GRADE_ID' => _('Grade Level'), 'SCHOOL_ID' => _('School'), 'SCHOOL_NUMBER' => _('School Number'), 'NEXT_SCHOOL' => _('Rolling / Retention Options'), 'CALENDAR_ID' => _('Calendar'), 'USERNAME' => _('Username'), 'START_DATE' => _('Enrollment Start Date'), 'END_DATE' => _('Enrollment End Date'), 'ENROLLMENT_SHORT' => _('Enrollment Code'), 'DROP_SHORT' => _('Drop Code'), 'ADDRESS' => _('Address'), 'CITY' => _('City'), 'STATE' => _('State'), 'ZIPCODE' => _('Zip Code'), 'PHONE' => _('Home Phone'), 'MAIL_ADDRESS' => _('Mailing Address'), 'MAIL_CITY' => _('Mailing City'), 'MAIL_STATE' => _('Mailing State'), 'MAIL_ZIPCODE' => _('Mailing Zipcode'), 'PARENTS' => _('Contacts')); } else { $fields_list = array('FULL_NAME' => _('Last, First M'), 'FIRST_NAME' => _('First Name'), 'FIRST_INIT' => _('First Name Initial'), 'LAST_NAME' => _('Last Name'), 'MIDDLE_NAME' => _('Middle Name'), 'NAME_SUFFIX' => _('Suffix'), 'STUDENT_ID' => _('RosarioSIS ID'), 'GRADE_ID' => _('Grade Level'), 'SCHOOL_ID' => _('School'), 'SCHOOL_NUMBER' => _('School Number'), 'NEXT_SCHOOL' => _('Rolling / Retention Options'), 'CALENDAR_ID' => _('Calendar'), 'USERNAME' => _('Username'), 'START_DATE' => _('Enrollment Start Date'), 'END_DATE' => _('Enrollment End Date'), 'ENROLLMENT_SHORT' => _('Enrollment Code'), 'DROP_SHORT' => _('Drop Code'), 'ADDRESS' => _('Address'), 'CITY' => _('City'), 'STATE' => _('State'), 'ZIPCODE' => _('Zip Code'), 'PHONE' => _('Home Phone'), 'PARENTS' => _('Contacts')); } if ($extra['field_names']) { $fields_list += $extra['field_names']; } $fields_list['PERIOD_ATTENDANCE'] = _('Teacher'); $periods_RET = DBGet(DBQuery("SELECT TITLE,PERIOD_ID FROM SCHOOL_PERIODS WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' ORDER BY SORT_ORDER")); foreach ($periods_RET as $period) { $fields_list['PERIOD_' . $period['PERIOD_ID']] = $period['TITLE'] . ' ' . _('Teacher') . ' - ' . _('Room');
$handle = PDFStart(); foreach ($staffs as $staff) { $last_deposit = DBGet(DBQuery("SELECT (SELECT sum(AMOUNT) FROM FOOD_SERVICE_STAFF_TRANSACTION_ITEMS WHERE TRANSACTION_ID=fst.TRANSACTION_ID) AS AMOUNT,to_char(fst.TIMESTAMP,'YYYY-MM-DD') AS DATE FROM FOOD_SERVICE_STAFF_TRANSACTIONS fst WHERE fst.SHORT_NAME='DEPOSIT' AND fst.STAFF_ID='" . $staff['STAFF_ID'] . "' AND SYEAR='" . UserSyear() . "' ORDER BY fst.TRANSACTION_ID DESC LIMIT 1"), array('DATE' => 'ProperDate')); $last_deposit = $last_deposit[1]; if ($staff['BALANCE'] < $minimum) { reminder($staff, $school, $target, $last_deposit, $minimum_note); } elseif ($staff['BALANCE'] < 0) { reminder($staff, $school, $target, $last_deposit, $negative_note); } elseif ($staff['BALANCE'] < $warning) { reminder($staff, $school, $target, $last_deposit, $warning_note); } echo '<!-- NEED 3in -->'; } PDFStop($handle); } else { BackPrompt(_('You must choose at least one user')); } } if (!$_REQUEST['modfunc'] || $_REQUEST['modfunc'] == 'list') { if ($_REQUEST['search_modfunc'] == 'list') { echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save&_CENTRE_PDF=true method=POST>"; DrawHeader('', SubmitButton(_('Create Reminders for Selected Users'))); } $extra['link'] = array('FULL_NAME' => false); $extra['SELECT'] = ",s.STAFF_ID AS CHECKBOX"; $extra['functions'] = array('CHECKBOX' => '_makeChooseCheckbox'); $extra['columns_before'] = array('CHECKBOX' => '</A><INPUT type=checkbox value=Y checked name=controller onclick="checkAll(this.form,this.form.controller.checked,\'st_arr\');"><A>'); $extra['new'] = true; $extra['options']['search'] = false; StaffWidgets('fsa_balance_warning'); StaffWidgets('fsa_status');
$_REQUEST['assignment_id'] = $id; } elseif ($table == 'GRADEBOOK_ASSIGNMENT_TYPES') { $id = DBGet(DBQuery("SELECT " . db_seq_nextval('GRADEBOOK_ASSIGNMENT_TYPES_SEQ') . ' AS ID ' . FROM_DUAL)); $id = $id[1]['ID']; $fields = "ASSIGNMENT_TYPE_ID,STAFF_ID,COURSE_ID,"; $values = $id . ",'" . User('STAFF_ID') . "','{$course_id}',"; $_REQUEST['assignment_type_id'] = $id; } $go = false; if (!$columns['COURSE_ID'] && $_REQUEST['table'] == 'GRADEBOOK_ASSIGNMENTS') { $columns['COURSE_ID'] = 'N'; } foreach ($columns as $column => $value) { if ($column == 'DUE_DATE' || $column == 'ASSIGNED_DATE') { if (!VerifyDate($value)) { BackPrompt(_('Some dates were not entered correctly.')); } } elseif ($column == 'COURSE_ID' && $value == 'Y') { $value = $course_id; } elseif ($column == 'COURSE_ID') { $column = 'COURSE_PERIOD_ID'; $value = UserCoursePeriod(); } elseif ($column == 'FINAL_GRADE_PERCENT' && $table == 'GRADEBOOK_ASSIGNMENT_TYPES') { $value = ereg_replace('[^0-9.]', '', $value) / 100; } if ($value != '') { $fields .= $column . ','; $values .= "'" . str_replace("\\'", "''", $value) . "',"; $go = true; } }
//DBQuery("DELETE FROM SCHEDULE WHERE STUDENT_ID='".UserStudentID()."' AND END_DATE IS NOT NULL AND END_DATE<START_DATE"); //DBQuery("DELETE FROM SCHEDULE WHERE STUDENT_ID='".$student_id."' AND COURSE_PERIOD_ID='".$_SESSION['MassDrops.php']['course_period_id']."'"); DBQuery("UPDATE SCHEDULE SET END_DATE='" . $END_DATE . "' WHERE STUDENT_ID='" . clean_param($student_id, PARAM_INT) . "' AND COURSE_PERIOD_ID='" . clean_param($_SESSION['MassDrops.php']['course_period_id'], PARAM_INT) . "'"); DBQuery("CALL SEAT_FILL()"); //DBQuery("UPDATE COURSE_PERIODS SET FILLED_SEATS=(FILLED_SEATS-1) WHERE COURSE_PERIOD_ID='".$_SESSION['MassDrops.php']['course_period_id']."'"); } } # } //DBQuery("UPDATE COURSE_PERIODS SET FILLED_SEATS=FILLED_SEATS-'".count($_REQUEST['student'])."' WHERE COURSE_PERIOD_ID='".$_SESSION['MassDrops.php']['course_period_id']."'"); /* DBQuery("UPDATE COURSE_PERIODS SET FILLED_SEATS=FILLED_SEATS-1 WHERE COURSE_PERIOD_ID='".$_SESSION['MassDrops.php']['course_period_id']."'");*/ DBQuery("CALL SEAT_COUNT()"); unset($_REQUEST['modfunc']); unset($_SESSION['MassDrops.php']); $note = "That course has been dropped from the selected students' schedules."; } else { BackPrompt('You must choose a Course'); } } if ($_REQUEST['modfunc'] != 'choose_course') { DrawBC("Scheduling > " . ProgramTitle()); if ($_REQUEST['search_modfunc'] == 'list') { echo "<FORM name=ww id=ww action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save method=POST>"; #DrawHeader('',SubmitButton('Drop Course for Selected Students')); PopTable_wo_header('header'); echo '<TABLE><TR><TD>Course to Drop</TD><TD><DIV id=course_div>'; if ($_SESSION['MassDrops.php']) { $course_title = DBGet(DBQuery("SELECT TITLE FROM COURSES WHERE COURSE_ID='" . $_SESSION['MassDrops.php']['course_id'] . "'")); $course_title = $course_title[1]['TITLE']; $period_title = DBGet(DBQuery("SELECT TITLE FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . $_SESSION['MassDrops.php']['course_period_id'] . "'")); $period_title = $period_title[1]['TITLE']; echo "{$course_title}<BR>{$period_title}";
<?php include_once 'modules/Scheduling/functions.inc.php'; if ($_REQUEST['modfunc'] == 'save') { if ($_SESSION['MassRequests.php']) { $current_RET = DBGet(DBQuery("SELECT STUDENT_ID FROM SCHEDULE_REQUESTS WHERE COURSE_ID='" . $_REQUEST['MassRequests.php']['course_id'] . "' AND SYEAR='" . UserSyear() . "'"), array(), array('STUDENT_ID')); foreach ($_REQUEST['student'] as $student_id => $yes) { if (!$current_RET[$student_id]) { $sql = "INSERT INTO SCHEDULE_REQUESTS (REQUEST_ID,SYEAR,SCHOOL_ID,STUDENT_ID,SUBJECT_ID,COURSE_ID,MARKING_PERIOD_ID,WITH_TEACHER_ID,NOT_TEACHER_ID,WITH_PERIOD_ID,NOT_PERIOD_ID)\n\t\t\t\t\t\t\tvalues(" . db_seq_nextval('SCHEDULE_REQUESTS_SEQ') . ",'" . UserSyear() . "','" . UserSchool() . "','" . $student_id . "','" . $_SESSION['MassRequests.php']['subject_id'] . "','" . $_SESSION['MassRequests.php']['course_id'] . "',NULL,'" . $_REQUEST['with_teacher_id'] . "','" . $_REQUEST['without_teacher_id'] . "','" . $_REQUEST['with_period_id'] . "','" . $_REQUEST['without_period_id'] . "')"; DBQuery($sql); } } unset($_REQUEST['modfunc']); $note = _('This course has been added as a request for the selected students.'); } else { BackPrompt(_('You must choose a course.')); } } if ($_REQUEST['modfunc'] != 'choose_course') { DrawHeader(ProgramTitle()); if ($_REQUEST['search_modfunc'] == 'list') { echo "<FORM action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save method=POST>"; DrawHeader('', SubmitButton(_('Add Request to Selected Students'))); echo '<BR><CENTER><TABLE bgcolor=' . Preferences('COLOR') . '><TR><TD align=right>' . _('Request to Add') . '</TD><TD><DIV id=course_div>'; if ($_SESSION['MassRequests.php']) { $course_title = DBGet(DBQuery("SELECT TITLE FROM COURSES WHERE COURSE_ID='" . $_SESSION['MassRequests.php']['course_id'] . "'")); $course_title = $course_title[1]['TITLE']; echo "{$course_title}"; } echo '</DIV>' . "<A HREF=# onclick='window.open(\"Modules.php?modname={$_REQUEST['modname']}&modfunc=choose_course\",\"\",\"scrollbars=yes,resizable=yes,width=800,height=400\");'>" . _("Choose a Course") . "</A></TD></TR>"; echo '<TR><TD align=right valign=top>' . _('With') . '</TD><TD>';
echo '<tr><td>Course Program Name:</td>'; echo '<td>' . $course_period['COURSE_TITLE'] . '</td></tr>'; echo '<tr><td>Course Period Name:</td>'; echo '<td>' . GetPeriod($course_period['PERIOD_ID']) . '</td></tr>'; echo '<tr><td>Marking Period:</td>'; echo '<td>' . GetMP($course_period['MARKING_PERIOD_ID']) . '</td></tr>'; echo '</table>'; $extra = $first_extra; $extra['MP'] = $course_period['MARKING_PERIOD_ID']; include 'modules/misc/Export.php'; echo "<div style=\"page-break-before: always;\"></div>"; } $_SESSION['UserCoursePeriod'] = $PCL_UserCoursePeriod; PDFStop($handle); } else { BackPrompt('You must choose at least one course period.'); } } if (!$_REQUEST['modfunc']) { DrawBC("Scheduling > " . ProgramTitle()); if (User('PROFILE') != 'admin') { $_REQUEST['search_modfunc'] = 'list'; } if ($_REQUEST['search_modfunc'] == 'list' || $_REQUEST['search_modfunc'] == 'select') { $_REQUEST['search_modfunc'] = 'select'; #$extra['header_right'] = '<INPUT type=submit value=\'Create Class Lists for Selected Course Periods\'>'; $extra['extra_header_left'] = '<TABLE>'; $extra['extra_header_left'] .= '<TR><TD><INPUT type=checkbox name=include_inactive value=Y>Include Inactive Students</TD></TR>'; $extra['extra_header_left'] .= '</TABLE>'; $Search = 'mySearch'; include 'modules/misc/Export.php';
$sql = "UPDATE STUDENT_ENROLLMENT SET "; foreach ($_REQUEST['values']['STUDENT_ENROLLMENT'][UserStudentID()] as $column_name => $value) { if ($column_name == 'START_DATE' || $column_name == 'END_DATE') { $sql .= "{$column_name}='" . str_replace("\\'", "''", date('Y-m-d', strtotime($value))) . "',"; } else { $sql .= "{$column_name}='" . str_replace("\\'", "''", str_replace(''', "''", $value)) . "',"; } } $sql = substr($sql, 0, -1) . " WHERE STUDENT_ID='{$_REQUEST['student_id']}' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"; DBQuery($sql); } } else { if ($_REQUEST['assign_student_id']) { $student_id = $_REQUEST['assign_student_id']; if (count(DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE STUDENT_ID='{$student_id}'")))) { BackPrompt('That Student ID is already taken. Please select a different one.'); } } else { do { $student_id = DBGet(DBQuery('SELECT ' . db_seq_nextval('STUDENTS_SEQ') . ' AS STUDENT_ID ' . FROM_DUAL)); $student_id = $student_id[1]['STUDENT_ID']; } while (count(DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENTS WHERE STUDENT_ID='{$student_id}'")))); } $sql = "INSERT INTO STUDENTS "; $fields = 'STUDENT_ID,'; $values = "'{$student_id}',"; foreach ($_REQUEST['students'] as $column => $value) { if ($value) { $fields .= $column . ','; if ($column == 'PASSWORD') { $values .= "'" . str_replace("\\'", "''", md5($value)) . "',";
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. #************************************************************************** if (!$_REQUEST['modfunc'] && $_REQUEST['search_modfunc'] != 'list') { unset($_SESSION['MassSchedule.php']); } if ($_REQUEST['modfunc'] == 'save') { if ($_SESSION['MassSchedule.php']) { $start_date = $_REQUEST['day'] . '-' . $_REQUEST['month'] . '-' . $_REQUEST['year']; if (!VerifyDate($start_date)) { BackPrompt('The date you entered is not valid'); } $course_mp = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . $_SESSION['MassSchedule.php']['course_period_id'] . "'")); $course_mp = $course_mp[1]['MARKING_PERIOD_ID']; $course_mp_table = GetMPTable(GetMP($course_mp, 'TABLE')); if ($course_mp_table != 'FY' && $course_mp != $_REQUEST['marking_period_id'] && strpos(GetChildrenMP($course_mp_table, $course_mp), "'" . $_REQUEST['marking_period_id'] . "'") === false) { // BackPrompt("You cannot schedule a student into that course during the marking period that you chose. This course meets on ".GetMP($course_mp).'.'); ShowErr("You cannot schedule a student into that course during the marking period that you chose. This course meets on " . GetMP($course_mp) . '.'); for_error(); } $mp_table = GetMPTable(GetMP($_REQUEST['marking_period_id'], 'TABLE')); $current_RET = DBGet(DBQuery("SELECT STUDENT_ID FROM SCHEDULE WHERE COURSE_PERIOD_ID='" . $_SESSION['MassSchedule.php']['course_period_id'] . "' AND SYEAR='" . UserSyear() . "' AND (('" . $start_date . "' BETWEEN START_DATE AND END_DATE OR END_DATE IS NULL) AND '" . $start_date . "'>=START_DATE)"), array(), array('STUDENT_ID')); $request_RET = DBGet(DBQuery("SELECT STUDENT_ID FROM SCHEDULE_REQUESTS WHERE WITH_PERIOD_ID=(SELECT PERIOD_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . $_SESSION['MassSchedule.php']['course_period_id'] . "') AND SYEAR='" . UserSyear() . "' AND COURSE_ID='" . $_SESSION['MassSchedule.php']['course_id'] . "'"), array(), array('STUDENT_ID')); $check_seats = DBGet(DBQuery("SELECT (TOTAL_SEATS - FILLED_SEATS) AS AVAILABLE_SEATS FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . $_SESSION['MassSchedule.php']['course_period_id'] . "'")); $check_seats = $check_seats[1]['AVAILABLE_SEATS']; $no_seat = 'There is no available seats in this period.<br>Please increase the "Total Seats" from Scheduling>>Setup>Courses';
if (!$_REQUEST['elements']['grade_type']) { echo '<span style="font-size:13px; font-weight:bold;"></span>'; echo '<!-- NEW PAGE -->'; echo "<div style=\"page-break-before: always;\"></div>"; } } } } } #################end####################################### PDFStop($handle); } else { BackPrompt('Missing grades or No Students were found.'); } } else { BackPrompt('You must choose at least one student and marking period.'); } } if (!$_REQUEST['modfunc']) { DrawBC("Gradebook >> " . ProgramTitle()); if ($_REQUEST['search_modfunc'] == 'list') { echo "<FORM action=ForExport.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&modfunc=save&include_inactive=" . strip_tags(trim($_REQUEST[include_inactive])) . "&_openSIS_PDF=true&head_html=Student+Report+Card method=POST target=_blank>"; $attendance_codes = DBGet(DBQuery("SELECT SHORT_NAME,ID FROM attendance_codes WHERE SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "' AND (DEFAULT_CODE!='Y' OR DEFAULT_CODE IS NULL) AND TABLE_NAME='0'")); $extra['extra_header_left'] = '<TABLE>'; $extra['extra_header_left'] .= '<TR><TD colspan=2><b>Include on Report Card:</b></TD></TR>'; $extra['extra_header_left'] .= '<TR><TD></TD><TD><TABLE>'; $extra['extra_header_left'] .= '<TD><INPUT type=checkbox name=elements[teacher] value=Y CHECKED>Teacher</TD>'; $extra['extra_header_left'] .= '<TD><INPUT type=checkbox name=elements[signature] value=Y>Include Signature Line</TD>'; $extra['extra_header_left'] .= '</TR><TR>'; $extra['extra_header_left'] .= '<TD><INPUT type=checkbox name=elements[comments] value=Y CHECKED>Comments</TD>'; $extra['extra_header_left'] .= '<TD><INPUT type=checkbox name=elements[percents] value=Y>Percents</TD>';
} } if ($cols == 0 && $rows == 0) { } else { while ($cols != 0 && $cols < $max_cols) { echo '<td width="33.3%" height="86" align="center" valign="middle"> </td>'; $cols++; } if ($cols == $max_cols) { echo '</tr>'; } echo '</table>'; } PDFstop($handle); } else { BackPrompt(_('No Students were found.')); } } } if (!$_REQUEST['modfunc']) { DrawBC("" . _('Students') . " >> " . ProgramTitle()); if ($_REQUEST['search_modfunc'] == 'list') { echo "<FORM action=for_export.php?modname={$_REQUEST['modname']}&modfunc=save&include_inactive={$_REQUEST['include_inactive']}&_search_all_schools={$_REQUEST['_search_all_schools']}" . (User('PROFILE') == 'admin' ? "&w_course_period_id_which={$_REQUEST['w_course_period_id_which']}&w_course_period_id={$_REQUEST['w_course_period_id']}" : '') . "&_openSIS_PDF=true method=POST target=_blank>"; //$extra['header_right'] = '<INPUT type=submit value=\'Create Labels for Selected Students\'>'; $extra['extra_header_left'] = '<TABLE style="margin-top:-30px;">'; $extra['extra_header_left'] .= '<TR><TD><b>' . _('Include on Labels:') . '</b></TD></TR>'; if (User('PROFILE') == 'admin') { if ($_REQUEST['w_course_period_id_which'] == 'course_period' && $_REQUEST['w_course_period_id']) { $course_RET = DBGet(DBQuery('SELECT CONCAT(s.FIRST_NAME,' . ' ' . ',s.LAST_NAME) AS TEACHER,cp.ROOM FROM staff s,course_periods cp WHERE s.STAFF_ID=cp.TEACHER_ID AND cp.COURSE_PERIOD_ID=\'' . $_REQUEST[w_course_period_id] . '\'')); $extra['extra_header_left'] .= '<TR><TD><INPUT type=checkbox name=teacher value=Y>' . _('Teacher') . ' (' . $course_RET[1]['TEACHER'] . ')</TD></TR>'; $extra['extra_header_left'] .= '<TR><TD><INPUT type=checkbox name=room value=Y>' . _('Room') . ' (' . $course_RET[1]['ROOM'] . ')</TD></TR>';
<?php include_once 'modules/Scheduling/functions.inc.php'; if (!$_REQUEST['modfunc'] && $_REQUEST['search_modfunc'] != 'list') { unset($_SESSION['MassSchedule.php']); } if (isset($_REQUEST['modfunc']) && $_REQUEST['modfunc'] == 'save') { if ($_SESSION['MassSchedule.php']) { if (!empty($_REQUEST['student'])) { $start_date = $_REQUEST['day'] . '-' . $_REQUEST['month'] . '-' . $_REQUEST['year']; if (VerifyDate($start_date)) { $course_mp = DBGet(DBQuery("SELECT MARKING_PERIOD_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . $_SESSION['MassSchedule.php']['course_period_id'] . "'")); $course_mp = $course_mp[1]['MARKING_PERIOD_ID']; $course_mp_table = GetMP($course_mp, 'MP'); if ($course_mp_table != 'FY' && $course_mp != $_REQUEST['marking_period_id'] && mb_strpos(GetChildrenMP($course_mp_table, $course_mp), "'" . $_REQUEST['marking_period_id'] . "'") === false) { BackPrompt(_('You cannot schedule a student into this course during this marking period.') . ' ' . sprintf(_('This course meets on %s.'), GetMP($course_mp))); } $mp_table = GetMP($_REQUEST['marking_period_id'], 'MP'); $current_RET = DBGet(DBQuery("SELECT STUDENT_ID FROM SCHEDULE WHERE COURSE_PERIOD_ID='" . $_SESSION['MassSchedule.php']['course_period_id'] . "' AND SYEAR='" . UserSyear() . "' AND (('" . $start_date . "' BETWEEN START_DATE AND END_DATE OR END_DATE IS NULL) AND '" . $start_date . "'>=START_DATE)"), array(), array('STUDENT_ID')); foreach ($_REQUEST['student'] as $student_id => $yes) { if (!$current_RET[$student_id]) { $sql = "INSERT INTO SCHEDULE (SYEAR,SCHOOL_ID,STUDENT_ID,COURSE_ID,COURSE_PERIOD_ID,MP,MARKING_PERIOD_ID,START_DATE)\n\t\t\t\t\t\t\t\t\tvalues('" . UserSyear() . "','" . UserSchool() . "','" . $student_id . "','" . $_SESSION['MassSchedule.php']['course_id'] . "','" . $_SESSION['MassSchedule.php']['course_period_id'] . "','" . $mp_table . "','" . $_REQUEST['marking_period_id'] . "','" . $start_date . "')"; DBQuery($sql); //modif Francois: Moodle integrator $moodleError .= Moodle($_REQUEST['modname'], 'enrol_manual_enrol_users'); } } $note[] = _('This course has been added to the selected students\' schedules.'); } else { $error[] = _('The date you entered is not valid'); }