function makeSchoolYearSelectInput($value, $name) { global $THIS_RET; if ($THIS_RET['MARKING_PERIOD_ID']) { $id = $THIS_RET['MARKING_PERIOD_ID']; } else { $id = 'new'; } $options = array(); foreach (range(UserSyear() - 6, UserSyear()) as $year) { //modif Francois: school year over one/two calendar years format $options[$year] = FormatSyear($year, Config('SCHOOL_SYEAR_OVER_2_YEARS')); } return SelectInput(trim($value), "values[{$id}][{$name}]", '', $options, false); }
foreach ($addresses as $address) { unset($_ROSARIO['DrawHeader']); if ($_REQUEST['mailing_labels'] == 'Y') { echo '<BR /><BR /><BR />'; } //modif Francois: add school logo $logo_pic = 'assets/school_logo.jpg'; $picwidth = 110; if (file_exists($logo_pic)) { echo '<TABLE><TR><TD style="width:' . $picwidth . 'px;"><img src="' . $logo_pic . '" width="' . $picwidth . '" /></TD><TD class="width-100p">'; } DrawHeader(_('Report Card')); DrawHeader($mps[key($mps)][1]['FULL_NAME'], $mps[key($mps)][1]['STUDENT_ID']); DrawHeader($mps[key($mps)][1]['GRADE_ID'], GetSchool(UserSchool())); //modif Francois: add school year DrawHeader(_('School Year') . ': ' . FormatSyear(UserSyear(), Config('SCHOOL_SYEAR_OVER_2_YEARS'))); $count_lines = 4; if ($_REQUEST['elements']['mp_absences'] == 'Y') { $count = 0; //modif Francois: fix error Invalid argument supplied for foreach() if (is_array($attendance_day_RET[$student_id][$last_mp])) { foreach ($attendance_day_RET[$student_id][$last_mp] as $abs) { $count += 1 - $abs['STATE_VALUE']; } } $mp_absences = Localize('colon', sprintf(_('Absences in %s'), GetMP($last_mp, 'TITLE'))) . ' ' . $count; } if ($_REQUEST['elements']['ytd_absences'] == 'Y') { $count = 0; //modif Francois: fix error Invalid argument supplied for foreach() if (is_array($attendance_day_RET[$student_id])) {
$handle = PDFStart($options); foreach ($RET as $student) { $calendar_RET = DBGet(DBquery("SELECT " . db_case(array("MINUTES>=" . Config('ATTENDANCE_FULL_DAY_MINUTES'), 'true', "'1.0'", "'0.5'")) . "AS POS,trim(leading '0' from to_char(SCHOOL_DATE,'MM')) AS MON,trim(leading '0' from to_char(SCHOOL_DATE,'DD')) AS DAY FROM ATTENDANCE_CALENDAR WHERE CALENDAR_ID='" . $student['CALENDAR_ID'] . "' AND SCHOOL_DATE>='" . $student['START_DATE'] . "'" . ($student['END_DATE'] ? " AND SCHOOL_DATE<='" . $student['END_DATE'] . "'" : '')), array(), array('MON', 'DAY')); $attendance_RET = DBGet(DBQuery("SELECT trim(leading '0' from to_char(ap.SCHOOL_DATE,'MM')) AS MON,trim(leading '0' from to_char(ap.SCHOOL_DATE,'DD')) AS DAY,ac.STATE_CODE,ac.SHORT_NAME FROM ATTENDANCE_PERIOD ap,ATTENDANCE_CODES ac,SCHOOL_PERIODS sp WHERE ap.STUDENT_ID='" . $student['STUDENT_ID'] . "' AND ap.PERIOD_ID=sp.PERIOD_ID AND sp.SCHOOL_ID='" . UserSchool() . "' AND sp.SYEAR='" . UserSyear() . "' AND ac.ID=ap.ATTENDANCE_CODE AND sp.ATTENDANCE='Y'"), array(), array('MON', 'DAY')); //echo '<pre>'; var_dump($calendar_RET); echo '</pre>'; echo '<TABLE class="width-100p">'; echo '<TR><TD class="width-100p center">'; echo '<TABLE style="width:96%">'; echo '<TR><TD class="width-100p center">'; echo '<span class="sizep2"><B>' . $student['FULL_NAME'] . '</B></span>'; echo '</TD><TR>'; echo '</TABLE>'; echo '<TABLE style="width:96%; border: solid 1px">'; echo '<TR class="center"><TD><B>' . _('Student Name') . '</B></TD><TD><B>ID#</B></TD><TD><B>' . _('School') . ' / ' . _('Year') . '</B></TD></TR>'; //modif Francois: school year over one/two calendar years format echo '<TR><TD class="center">' . $student['FULL_NAME'] . '</TD><TD class="center">' . $student['STUDENT_ID'] . '</TD><TD class="center">' . $school_RET[1]['TITLE'] . ' / ' . FormatSyear(UserSyear(), Config('SCHOOL_SYEAR_OVER_2_YEARS')) . '</TD></TR>'; echo '<TR><TD colspan="3"><span class="sizep1"><B>' . _('Demographics') . '</B></span><TABLE style="width:98%; margin:0 auto;" class="cellpadding-0 cellspacing-0">'; echo '<TR><TD style="text-align:right">' . ParseMLField($custom_RET[200000000][1]['TITLE']) . ': </TD><TD>' . $student['CUSTOM_200000000'] . '</TD><TD style="text-align:right">' . _('Status') . ': </TD><TD>' . _($student['STATUS']) . '</TD></TR>'; echo '<TR><TD style="text-align:right">' . ParseMLField($custom_RET[200000003][1]['TITLE']) . ': </TD><TD>' . $student['CUSTOM_200000003'] . '</TD><TD style="text-align:right">' . _('Grade Level') . ': </TD><TD>' . $student['GRADE_ID'] . '</TD></TR>'; echo '</TABLE></TD></TR>'; echo '<TR><TD colspan="3"><span class="sizep1"><B>' . _('Attendance') . '</B></span><TABLE style="width:98%; border:solid 1px; margin:0 auto;" class="cellpadding-0 cellspacing-0">'; echo '<TR class="center"><TD colspan="32"></TD><TD colspan="3"><B>' . _('MTD') . '</B></TD></TR>'; /* TRANSLATORS: Abreviation for month */ echo '<TR class="center"><TD><B>' . mb_substr(_('Month'), 0, 3) . '</B></TD>'; for ($day = 1; $day <= 31; $day++) { echo '<TD><B>' . ($day < 10 ? ' ' : '') . $day . '</B></TD>'; } /* TRANSLATORS: Abreviations for Absences, Tardy and Position */ echo '<TD><B>' . _('Abs') . '</B><TD><B>' . _('Tdy') . '</B><TD><B>' . _('Pos') . '</B></TD></TR>'; $abs_tot = $tdy_tot = $pos_tot = 0; $FY_dates = DBGet(DBQuery("SELECT START_DATE,END_DATE FROM SCHOOL_MARKING_PERIODS WHERE MP='FY' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"));
$sql = "SELECT sy.SYEAR FROM SCHOOLS sy,STAFF s WHERE sy.ID='{$_SESSION['UserSchool']}' AND s.SYEAR=sy.SYEAR AND (s.SCHOOLS IS NULL OR position(','||sy.ID||',' IN s.SCHOOLS)>0) AND s.USERNAME=(SELECT USERNAME FROM STAFF WHERE STAFF_ID='" . $_SESSION['STAFF_ID'] . "')"; } else { //modif Francois: limit school years to the years the student was enrolled //$sql = "SELECT DISTINCT sy.SYEAR FROM SCHOOLS sy,STUDENT_ENROLLMENT s WHERE s.SYEAR=sy.SYEAR"; $sql = "SELECT DISTINCT sy.SYEAR FROM SCHOOLS sy,STUDENT_ENROLLMENT s WHERE s.SYEAR=sy.SYEAR AND s.STUDENT_ID='" . $_SESSION['student_id'] . "'"; } $sql .= " ORDER BY sy.SYEAR DESC"; $years_RET = DBGet(DBQuery($sql)); } else { $years_RET = array(1 => array('SYEAR' => Config('SYEAR'))); } echo '<SELECT name="syear" onChange="document.forms[0].submit();">'; foreach ($years_RET as $year) { //modif Francois: school year over one/two calendar years format // echo '<OPTION value="'.$year['SYEAR'].'"'.((UserSyear()==$year['SYEAR'])?' SELECTED="SELECTED"':'').'>'.$year['SYEAR'].'-'.($year['SYEAR']+1).'</OPTION>'; echo '<OPTION value="' . $year['SYEAR'] . '"' . (UserSyear() == $year['SYEAR'] ? ' SELECTED="SELECTED"' : '') . '>' . FormatSyear($year['SYEAR'], Config('SCHOOL_SYEAR_OVER_2_YEARS')) . '</OPTION>'; } echo '</SELECT><BR />'; $RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,TITLE FROM SCHOOL_MARKING_PERIODS WHERE MP='QTR' AND SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' ORDER BY SORT_ORDER")); echo '<SELECT name="mp" onChange="document.forms[0].submit();">'; if (count($RET)) { if (!UserMP()) { $_SESSION['UserMP'] = $RET[1]['MARKING_PERIOD_ID']; } foreach ($RET as $quarter) { echo '<OPTION value="' . $quarter['MARKING_PERIOD_ID'] . '"' . (UserMP() == $quarter['MARKING_PERIOD_ID'] ? ' SELECTED="SELECTED"' : '') . '>' . $quarter['TITLE'] . '</OPTION>'; } } echo '</SELECT>'; if (User('PROFILE') == 'teacher') { //modif Francois: multiple school periods for a course period
function core_course_update_courses_object() { //first, gather the necessary variables global $columns, $_REQUEST, $mp_title; //then, convert variables for the Moodle object: /* list of ( object { id int //ID of the course fullname string Optional //full name shortname string Optional //course short name categoryid int Optional //category id idnumber string Optional //id number summary string Optional //summary summaryformat int Optional //summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN or 4 = MARKDOWN) format string Optional //course format: weeks, topics, social, site,.. showgrades int Optional //1 if grades are shown, otherwise 0 newsitems int Optional //number of recent items appearing on the course page startdate int Optional //timestamp when the course start numsections int Optional //(deprecated, use courseformatoptions) number of weeks/topics maxbytes int Optional //largest size of file that can be uploaded into the course showreports int Optional //are activity report shown (yes = 1, no =0) visible int Optional //1: available to student, 0:not available hiddensections int Optional //(deprecated, use courseformatoptions) How the hidden sections in the course are displayed to students groupmode int Optional //no group, separate, visible groupmodeforce int Optional //1: yes, 0: no defaultgroupingid int Optional //default grouping id enablecompletion int Optional //Enabled, control via completion and activity settings. Disabled, not shown in activity settings. completionnotify int Optional //1: yes 0: no lang string Optional //forced course language forcetheme string Optional //name of the force theme courseformatoptions Optional //additional options for particular course format list of ( object { name string //course format option name value string //course format option value } ) } ) */ //add the year to the course name $fullname = FormatSyear(UserSyear(), Config('SCHOOL_SYEAR_OVER_2_YEARS')) . ' - ' . mb_substr($mp_title, 0, mb_strlen($mp_title) - 3); //get the Moodle course ID $moodle_id = DBGet(DBQuery("SELECT moodle_id FROM moodlexrosario WHERE rosario_id='" . $_REQUEST['course_period_id'] . "' AND \"column\"='course_period_id'")); if (count($moodle_id)) { $moodle_id = (int) $moodle_id[1]['MOODLE_ID']; } else { return null; } $id = $moodle_id; $courses = array(array('id' => $id, 'fullname' => $fullname)); if (isset($columns['SHORT_NAME'])) { $shortname = $columns['SHORT_NAME']; $course['shortname'] = $shortname; } if (isset($columns['MARKING_PERIOD_ID'])) { //convert YYYY-MM-DD to timestamp $startdate = strtotime(GetMP($columns['MARKING_PERIOD_ID'], 'START_DATE')); $course['startdate'] = $startdate; } return array($courses); }
if ($table != 'FOOD_SERVICE_STAFF_ACCOUNTS') { $exists_RET[$table] = DBGet(DBQuery("SELECT count(*) AS COUNT FROM {$table} WHERE SYEAR='{$next_syear}'" . (!$no_school_tables[$table] ? " AND SCHOOL_ID='" . UserSchool() . "'" : ''))); } else { $exists_RET['FOOD_SERVICE_STAFF_ACCOUNTS'] = DBGet(DBQuery("SELECT count(*) AS COUNT FROM STAFF WHERE SYEAR='{$next_syear}' AND exists(SELECT * FROM FOOD_SERVICE_STAFF_ACCOUNTS WHERE STAFF_ID=STAFF.STAFF_ID)")); } 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').'">');
} $PCP_UserCoursePeriod = $_SESSION['UserCoursePeriod']; // save/restore for teachers foreach ($course_periods_RET as $course_period) { $course_period_id = $course_period['COURSE_PERIOD_ID']; $teacher_id = $course_period['TEACHER_ID']; if ($teacher_id) { $_ROSARIO['User'] = array(1 => array('STAFF_ID' => $teacher_id, 'NAME' => 'name', 'PROFILE' => 'teacher', 'SCHOOLS' => ',' . UserSchool() . ',', 'SYEAR' => UserSyear())); $_SESSION['UserCoursePeriod'] = $course_period_id; $extra = array('SELECT_ONLY' => 's.STUDENT_ID,s.LAST_NAME,s.FIRST_NAME', 'ORDER_BY' => 's.LAST_NAME,s.FIRST_NAME,s.MIDDLE_NAME', 'MP' => $course_period['MARKING_PERIOD_ID'], 'MPTable' => $course_period['MP']); $RET = GetStuList($extra); //echo '<pre>'; var_dump($RET); echo '</pre>'; if (count($RET)) { echo '<TABLE class="width-100p">'; //modif Francois: school year over one/two calendar years format echo '<TR><TD colspan="5" class="center"><h3>' . FormatSyear(UserSyear(), Config('SCHOOL_SYEAR_OVER_2_YEARS')) . ' - ' . $course_period['TITLE'] . '</h3></TD></TR>'; $i = 0; if ($_REQUEST['include_teacher'] == 'Y') { $teacher = $teachers_RET[$teacher_id][1]; echo '<TR><TD style="vertical-align:bottom;"><TABLE>'; if ($UserPicturesPath && (($size = @getimagesize($picture_path = $UserPicturesPath . UserSyear() . '/' . $teacher_id . '.JPG')) || $_REQUEST['last_year'] == 'Y' && $staff['ROLLOVER_ID'] && ($size = @getimagesize($picture_path = $UserPicturesPath . (UserSyear() - 1) . '/' . $staff['ROLLOVER_ID'] . '.JPG')))) { if ($size[1] / $size[0] > 172 / 130) { echo '<TR><TD style="width:130px;"><IMG SRC="' . $picture_path . '" height="172"></TD></TR>'; } else { echo '<TR><TD style="width:130px;"><IMG SRC="' . $picture_path . '" width="130"></TD></TR>'; } } else { echo '<TR><TD style="width:130px; height:172px;"></TD></TR>'; } echo '<TR><TD><span class="size-1"><B>' . $teacher['LAST_NAME'] . '</B><BR />' . $teacher['FIRST_NAME'] . '</span></TD></TR>'; echo '</TABLE></TD>';
} if ($showCreditHours) { $columns['CREDIT_HOURS'] = _('C.H.'); } if ($showMPcomments) { $columns['COMMENT'] = _('Comment'); } $listOutput_RET = array_values($listOutput_RET); array_unshift($listOutput_RET, 'start_array_to_1'); unset($listOutput_RET[0]); //var_dump($listOutput_RET);exit; echo '<BR />'; ListOutput($listOutput_RET, $columns, '.', '.', false); //School Year echo '<table class="width-100p"><tr><td>'; echo '<span><br />' . _('School Year') . ': ' . FormatSyear(UserSyear(), Config('SCHOOL_SYEAR_OVER_2_YEARS')) . '</span>'; echo '</td></tr>'; //Class Rank if ($showGrades) { if ($grade['MP_TYPE'] != 'quarter' && !empty($grade['CUM_WEIGHTED_GPA']) && !empty($grade['CUM_RANK'])) { echo '<tr><td>'; echo '<span>' . sprintf(_('GPA') . ': %01.2f / %01.0f', $grade['CUM_WEIGHTED_GPA'], $grade['GP_SCALE']) . ' – ' . _('Class Rank') . ': ' . $grade['CUM_RANK'] . ' / ' . $grade['CLASS_SIZE'] . '</span>'; echo '</td></tr>'; } } //Total Credits if ($showCredits) { if ($total_credit_attempted > 0) { echo '<tr><td>'; echo '<span>' . _('Total') . ' ' . _('Credit') . ': ' . _('Credit Attempted') . ': ' . sprintf('%01.2f', $total_credit_attempted) . ' – ' . _('Credit Earned') . ': ' . sprintf('%01.2f', $total_credit_earned) . '</span>'; echo '</td></tr>';