本文整理汇总了PHP中UserMP函数的典型用法代码示例。如果您正苦于以下问题:PHP UserMP函数的具体用法?PHP UserMP怎么用?PHP UserMP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UserMP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ProperDate
$date_select .= '<OPTION value="' . $i . '"' . ($i + 86400 >= $start_time && $i - 86400 <= $start_time ? ' SELECTED="SELECTED"' : '') . '>' . ProperDate(date('Y.m.d', $i)) . ' - ' . ProperDate(date('Y.m.d', $i + 1 + ($END_DAY - $START_DAY) * 60 * 60 * 24)) . '</OPTION>';
}
}
DrawHeader(_('Timeframe') . ': <SELECT name="start_date">' . $date_select . '</SELECT> - ' . _('Period') . ': ' . $period_select, SubmitButton(_('Go')));
echo '</FORM>';
//modif Francois: multiple school periods for a course period
/*$sql = "SELECT s.LAST_NAME||', '||s.FIRST_NAME AS FULL_NAME,sp.TITLE,cp.PERIOD_ID,s.STAFF_ID
FROM STAFF s,COURSE_PERIODS cp,SCHOOL_PERIODS sp
WHERE
sp.PERIOD_ID = cp.PERIOD_ID
AND cp.TEACHER_ID=s.STAFF_ID AND cp.MARKING_PERIOD_ID IN (".GetAllMP('QTR',UserMP()).")
AND cp.SYEAR='".UserSyear()."' AND cp.SCHOOL_ID='".UserSchool()."' AND s.PROFILE='teacher'
".(($_REQUEST['period'])?" AND cp.PERIOD_ID='$_REQUEST[period]'":'')."
AND NOT EXISTS (SELECT '' FROM ELIGIBILITY_COMPLETED ac WHERE ac.STAFF_ID=cp.TEACHER_ID AND ac.PERIOD_ID = sp.PERIOD_ID AND ac.SCHOOL_DATE BETWEEN '$start_date' AND '$end_date')
";*/
$sql = "SELECT s.LAST_NAME||', '||s.FIRST_NAME AS FULL_NAME,sp.TITLE,cpsp.PERIOD_ID,s.STAFF_ID \n\t\tFROM STAFF s,COURSE_PERIODS cp,SCHOOL_PERIODS sp,COURSE_PERIOD_SCHOOL_PERIODS cpsp \n\t\tWHERE \n\t\t\tcp.COURSE_PERIOD_ID=cpsp.COURSE_PERIOD_ID AND \n\t\t\tsp.PERIOD_ID = cpsp.PERIOD_ID\n\t\t\tAND cp.TEACHER_ID=s.STAFF_ID AND cp.MARKING_PERIOD_ID IN (" . GetAllMP('QTR', UserMP()) . ")\n\t\t\tAND cp.SYEAR='" . UserSyear() . "' AND cp.SCHOOL_ID='" . UserSchool() . "' AND s.PROFILE='teacher'\n\t\t\t" . ($_REQUEST['period'] ? " AND cpsp.PERIOD_ID='{$_REQUEST['period']}'" : '') . "\n\t\t\tAND NOT EXISTS (SELECT '' FROM ELIGIBILITY_COMPLETED ac WHERE ac.STAFF_ID=cp.TEACHER_ID AND ac.PERIOD_ID = sp.PERIOD_ID AND ac.SCHOOL_DATE BETWEEN '{$start_date}' AND '{$end_date}')\n\t\t";
$RET = DBGet(DBQuery($sql), array(), array('STAFF_ID', 'PERIOD_ID'));
$i = 0;
if (count($RET)) {
foreach ($RET as $staff_id => $periods) {
$i++;
$staff_RET[$i]['FULL_NAME'] = $periods[key($periods)][1]['FULL_NAME'];
foreach ($periods as $period_id => $period) {
$staff_RET[$i][$period_id] = '<IMG SRC="assets/x.png" height="24">';
}
}
}
$columns = array('FULL_NAME' => _('Teacher'));
if (!$_REQUEST['period']) {
foreach ($periods_RET as $period) {
$columns[$period['PERIOD_ID']] = $period['TITLE'];
示例2: DBGet
unset($_SESSION['UserMP']);
$_SESSION['UserSchool'] = $period['SCHOOL_ID'];
$_SESSION['UserPeriod'] = $period['PERIOD_ID'];
}
}
echo "</SELECT><BR>";
*/
}
$RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,TITLE FROM school_quarters WHERE 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' : '') . ">" . $quarter['TITLE'] . "</OPTION>";
}
}
echo "</SELECT>";
echo '</FORM>';
if (UserStudentID() && User('PROFILE') != 'parent' && User('PROFILE') != 'student') {
$RET = DBGet(DBQuery("SELECT FIRST_NAME,LAST_NAME,MIDDLE_NAME,NAME_SUFFIX FROM students WHERE STUDENT_ID='" . UserStudentID() . "'"));
//echo '<TABLE border=0 cellpadding=0 cellspacing=0 width=100%><TR><TD width=19 valign=middle><A HREF=Side.php?student_id=new&modcat='.$_REQUEST['modcat'].'><IMG SRC=assets/x.gif height=17 border=0></A></TD><TD ><B><A HREF=Modules.php?modname=Students/Student.php&student_id='.UserStudentID().' target=body><font color=#FFFFFF size=-2>'.$RET[1]['FIRST_NAME'].' '.($RET[1]['MIDDLE_NAME']?$RET[1]['MIDDLE_NAME'].' ':'').$RET[1]['LAST_NAME'].' '.$RET[1]['NAME_SUFFIX'].'</font></A></B></TD></TR></TABLE>';
echo '<TABLE border=0 cellpadding=0 cellspacing=0 width=100%><TR><TD width=19 valign=middle><A HREF=Side.php?student_id=new&modcat=' . optional_param('modcat', '', PARAM_SPCL) . '><IMG SRC=assets/x.gif height=17 border=0></A></TD><TD ><B><A HREF=Modules.php?modname=Students/Student.php&student_id=' . UserStudentID() . ' target=body><font color=#FFFFFF size=-2>' . $RET[1]['FIRST_NAME'] . ' ' . ($RET[1]['MIDDLE_NAME'] ? $RET[1]['MIDDLE_NAME'] . ' ' : '') . $RET[1]['LAST_NAME'] . ' ' . $RET[1]['NAME_SUFFIX'] . '</font></A></B></TD></TR></TABLE>';
}
if (UserStaffID() && User('PROFILE') == 'admin') {
if (UserStudentID()) {
echo '<IMG SRC=assets/pixel_trans.gif height=2>';
}
$RET = DBGet(DBQuery("SELECT FIRST_NAME,LAST_NAME FROM staff WHERE STAFF_ID='" . UserStaffID() . "'"));
//echo '<TABLE border=0 cellpadding=0 cellspacing=0 width=100%><TR><TD bgcolor=#336633 width=19 valign=middle><A HREF=Side.php?staff_id=new&modcat='.$_REQUEST['modcat'].'><IMG SRC=assets/x.gif height=17 border=0></A></TD><TD bgcolor=#336633><B><A HREF=Modules.php?modname=Users/User.php&staff_id='.UserStaffID().' target=body><font color=#FFFFFF size=-2>'.$RET[1]['FIRST_NAME'].' '.$RET[1]['LAST_NAME'].'</font></A></B></TD></TR></TABLE>';
示例3: DrawBC
# 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/>.
#
#***************************************************************************************
include '../../Redirect_modules.php';
DrawBC("Gradebook > " . ProgramTitle());
if (!$_REQUEST['mp']) {
$_REQUEST['mp'] = UserMP();
}
$sem = GetParentMP('SEM', UserMP());
echo "<FORM action=Modules.php?modname={$_REQUEST['modname']} method=POST>";
$mp_select = "<SELECT name=mp onchange='document.forms[0].submit();'><OPTION value=" . UserMP() . ">" . GetMP(UserMP()) . "</OPTION><OPTION value=" . $sem . ($sem == $_REQUEST['mp'] ? ' SELECTED' : '') . ">" . GetMP($sem) . "</OPTION><OPTION value=E" . $sem . ('E' . $sem == $_REQUEST['mp'] ? ' SELECTED' : '') . ">" . GetMP($sem) . ' Exam</OPTION></SELECT>';
DrawHeaderHome($mp_select);
echo '</FORM>';
$sql = "SELECT CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) as FULL_NAME,s.STAFF_ID,g.REPORT_CARD_GRADE_ID FROM STUDENT_REPORT_CARD_GRADES g,STAFF s,COURSE_PERIODS cp WHERE g.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID AND cp.TEACHER_ID=s.STAFF_ID AND cp.SYEAR=s.SYEAR AND cp.SYEAR=g.SYEAR AND cp.SYEAR='" . UserSyear() . "' AND g.MARKING_PERIOD_ID='" . $_REQUEST['mp'] . "'";
$grouped_RET = DBGet(DBQuery($sql), array(), array('STAFF_ID', 'REPORT_CARD_GRADE_ID'));
$grades_RET = DBGet(DBQuery("SELECT rg.ID,rg.TITLE FROM REPORT_CARD_GRADES rg,REPORT_CARD_GRADE_SCALES rs WHERE rg.SCHOOL_ID='" . UserSchool() . "' AND rg.SYEAR='" . UserSyear() . "' AND rs.ID=rg.GRADE_SCALE_ID ORDER BY rs.SORT_ORDER,rs.ID,rg.BREAK_OFF IS NOT NULL DESC,rg.BREAK_OFF DESC,rg.SORT_ORDER"));
if (count($grouped_RET)) {
foreach ($grouped_RET as $staff_id => $grades) {
$i++;
$teachers_RET[$i]['FULL_NAME'] = $grades[key($grades)][1]['FULL_NAME'];
foreach ($grades_RET as $grade) {
$teachers_RET[$i][$grade['ID']] = count($grades[$grade['ID']]);
}
}
}
$columns = array('FULL_NAME' => 'Teacher');
示例4: foreach
if (count($config_RET)) {
foreach ($config_RET as $title => $value) {
$programconfig[User('STAFF_ID')][$title] = $value[1]['VALUE'];
}
} else {
$programconfig[User('STAFF_ID')] = true;
}
include 'ProgramFunctions/_makeLetterGrade.fnc.php';
$course_period_id = UserCoursePeriod();
$course_id = DBGet(DBQuery("SELECT COURSE_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . UserCoursePeriod() . "'"));
$course_id = $course_id[1]['COURSE_ID'];
$grades_RET = DBGet(DBQuery("SELECT ID,TITLE,GPA_VALUE FROM REPORT_CARD_GRADES WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'"), array(), array('ID'));
if ($programconfig[User('STAFF_ID')]['WEIGHT'] == 'Y') {
$points_RET = DBGet(DBQuery("SELECT DISTINCT ON (s.STUDENT_ID,gt.ASSIGNMENT_TYPE_ID) s.STUDENT_ID, gt.ASSIGNMENT_TYPE_ID,sum(" . db_case(array('gg.POINTS', "'-1'", "'0'", 'gg.POINTS')) . ") AS PARTIAL_POINTS,sum(" . db_case(array('gg.POINTS', "'-1'", "'0'", 'ga.POINTS')) . ") AS PARTIAL_TOTAL, gt.FINAL_GRADE_PERCENT FROM STUDENTS s JOIN SCHEDULE ss ON (ss.STUDENT_ID=s.STUDENT_ID AND ss.COURSE_PERIOD_ID='{$course_period_id}') JOIN GRADEBOOK_ASSIGNMENTS ga ON ((ga.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID OR ga.COURSE_ID='{$course_id}' AND ga.STAFF_ID='" . User('STAFF_ID') . "') AND ga.MARKING_PERIOD_ID" . ($programconfig[User('STAFF_ID')]['ELIGIBILITY_CUMULITIVE'] == 'Y' ? " IN (" . GetChildrenMP('SEM', UserMP()) . ")" : "='" . UserMP() . "'") . ") LEFT OUTER JOIN GRADEBOOK_GRADES gg ON (gg.STUDENT_ID=s.STUDENT_ID AND gg.ASSIGNMENT_ID=ga.ASSIGNMENT_ID AND gg.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID),GRADEBOOK_ASSIGNMENT_TYPES gt WHERE gt.ASSIGNMENT_TYPE_ID=ga.ASSIGNMENT_TYPE_ID AND gt.COURSE_ID='{$course_id}' AND ((ga.ASSIGNED_DATE IS NULL OR CURRENT_DATE>=ga.ASSIGNED_DATE) AND (ga.DUE_DATE IS NULL OR CURRENT_DATE>=ga.DUE_DATE) OR gg.POINTS IS NOT NULL) GROUP BY s.STUDENT_ID,ss.START_DATE,gt.ASSIGNMENT_TYPE_ID,gt.FINAL_GRADE_PERCENT"), array(), array('STUDENT_ID'));
} else {
$points_RET = DBGet(DBQuery("SELECT DISTINCT ON (s.STUDENT_ID) s.STUDENT_ID,'-1' AS ASSIGNMENT_TYPE_ID,sum(" . db_case(array('gg.POINTS', "'-1'", "'0'", 'gg.POINTS')) . ") AS PARTIAL_POINTS,sum(" . db_case(array('gg.POINTS', "'-1'", "'0'", 'ga.POINTS')) . ") AS PARTIAL_TOTAL,'1' AS FINAL_GRADE_PERCENT FROM STUDENTS s JOIN SCHEDULE ss ON (ss.STUDENT_ID=s.STUDENT_ID AND ss.COURSE_PERIOD_ID='{$course_period_id}') JOIN GRADEBOOK_ASSIGNMENTS ga ON ((ga.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID OR ga.COURSE_ID='{$course_id}' AND ga.STAFF_ID='" . User('STAFF_ID') . "') AND ga.MARKING_PERIOD_ID" . ($programconfig[User('STAFF_ID')]['ELIGIBILITY_CUMULITIVE'] == 'Y' ? " IN (" . GetChildrenMP('SEM', UserMP()) . ")" : "='" . UserMP() . "'") . ") LEFT OUTER JOIN GRADEBOOK_GRADES gg ON (gg.STUDENT_ID=s.STUDENT_ID AND gg.ASSIGNMENT_ID=ga.ASSIGNMENT_ID AND gg.COURSE_PERIOD_ID=ss.COURSE_PERIOD_ID) WHERE ((ga.ASSIGNED_DATE IS NULL OR CURRENT_DATE>=ga.ASSIGNED_DATE) AND (ga.DUE_DATE IS NULL OR CURRENT_DATE>=ga.DUE_DATE) OR gg.POINTS IS NOT NULL) GROUP BY s.STUDENT_ID,ss.START_DATE "), array(), array('STUDENT_ID'));
}
if (count($points_RET)) {
foreach ($points_RET as $student_id => $student) {
$total = $total_percent = 0;
foreach ($student as $partial_points) {
if ($partial_points['PARTIAL_TOTAL'] != 0) {
$total += $partial_points['PARTIAL_POINTS'] * $partial_points['FINAL_GRADE_PERCENT'] / $partial_points['PARTIAL_TOTAL'];
$total_percent += $partial_points['FINAL_GRADE_PERCENT'];
}
}
if ($total_percent != 0) {
$total /= $total_percent;
}
$grade = $grades_RET[_makeLetterGrade($total, 0, 0, 'ID')][1];
if ($grade['GPA_VALUE'] == '0' || !$grade['GPA_VALUE']) {
示例5: DrawHeader
$prev_mp = $prev_mp[1];
if ($prev_mp) {
$gb_header .= " | <A HREF=Modules.php?modname={$_REQUEST['modname']}&include_inactive={$_REQUEST['include_inactive']}&modfunc=grades&mp={$_REQUEST['mp']}&prev_mp={$prev_mp['MARKING_PERIOD_ID']}&use_percents=false>Get {$prev_mp['TITLE']} Grades</A>";
$gb_header .= " | <A HREF=Modules.php?modname={$_REQUEST['modname']}&include_inactive={$_REQUEST['include_inactive']}&modfunc=comments&mp={$_REQUEST['mp']}&prev_mp={$prev_mp['MARKING_PERIOD_ID']}&use_percents=false>Get {$prev_mp['TITLE']} Comments</A>";
}
}
$bar = ' | ';
if (substr($_REQUEST['mp'], 0, 1) == 'E' && $not_graded == true) {
$bar = '';
}
$gb_header .= "{$bar}<A HREF=Modules.php?modname={$_REQUEST['modname']}&include_inactive={$_REQUEST['include_inactive']}&modfunc=clearall&mp={$_REQUEST['mp']}&use_percents={$_REQUEST['use_percents']}>Clear All</A>";
}
DrawHeader($gb_header, $tipmessage);
} else {
DrawHeader($course_title);
DrawHeader(GetMP(UserMP()));
}
$columns = array('FULL_NAME' => 'Student', 'STUDENT_ID' => 'Student ID');
if ($_REQUEST['include_inactive'] == 'Y') {
$columns += array('ACTIVE' => 'School Status', 'ACTIVE_SCHEDULE' => 'Course Status');
}
if ($_REQUEST['use_percents'] != 'true') {
$columns += array('GRADE_PERCENT' => 'Percent', 'REPORT_CARD_GRADE' => 'Assign Grade');
} elseif ($not_graded) {
$columns += array('GRADE_PERCENT' => 'Assign Percent');
} else {
$columns += array('REPORT_CARD_GRADE' => 'Grade', 'GRADE_PERCENT' => 'Assign Percent');
}
/////////////////sg customization/////////////////////
if ($course_RET[1]['USE_STANDARDS'] == "Y") {
$columns += array('STANDARDS' => 'Standards');
示例6: DBQuery
include '../../Redirect_modules.php';
echo '<div id="calculating" style="display: none; padding-top:20px; padding-bottom:15px;"><img src="assets/missing_attn_loader.gif" /><br/><br/><br/><span style="color:#c90000;"><span style=" font-size:15px; font-weight:bold;">Please wait.</span><br /><span style=" font-size:12px;">Calculating GPA . Do not click anywhere.</span></span></div>
<div id="resp" style="font-size:14px"></div>';
$QI = DBQuery("SELECT PERIOD_ID,TITLE FROM school_periods WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' ORDER BY SORT_ORDER ");
$RET = DBGet($QI);
$SCALE_RET = DBGet(DBQuery('SELECT * from schools where ID = \'' . UserSchool() . '\''));
DrawBC("Gradebook > " . ProgramTitle());
$mps = GetAllMP(GetMPTable(GetMP(UserMP(), 'TABLE')), UserMP());
$mps = explode(',', str_replace("'", '', $mps));
$table = '<TABLE><TR><TD valign=top><TABLE>
</TR>
<TD align=right valign=top><font color=gray>Calculate GPA for</font></TD>
<TD>';
foreach ($mps as $mp) {
if ($mp != '0') {
$table .= '<INPUT type=radio name=marking_period_id value=' . $mp . ($mp == UserMP() ? ' CHECKED' : '') . '>' . GetMP($mp) . '<BR>';
}
}
$table .= '</TD>
</TR>
<TR>
<TD colspan = 2 align=center><font color=gray>GPA based on a scale of ' . $SCALE_RET[1]['REPORTING_GP_SCALE'] . '</TD>
</TR>' . '</TABLE></TD><TD width=350><small>GPA calculation modifies existing records.<BR><BR>Weighted and unweighted GPA is calculated by dividing the weighted and unweighted grade points configured for each letter grade (assigned in the Report Card Codes setup program) by the base grading scale specified in the school setup. </small></TD></TR></TABLE>';
//$go = Prompt_Home('GPA Calculation','Calculate GPA and Class Rank',$table);
//if($go)
//{
if (!$_REQUEST['modfunc']) {
echo "<FORM name=sav id=sav action=Modules.php?modname={$_REQUEST['modname']}&modfunc=save method=POST>";
PopTable_wo_header('header');
echo '<CENTER><h4>Calculate GPA and Class Rank</CENTER></h4><br/>';
echo '<center>' . $table . '</center>';
示例7: DrawBC
$period_select .= "<OPTION value={$period['PERIOD_ID']}" . ($_REQUEST['period'] == $period['PERIOD_ID'] ? ' SELECTED' : '') . ">" . $period['TITLE'] . "</OPTION>";
}
$period_select .= "</SELECT>";
DrawBC("Eligibility > " . ProgramTitle());
echo "<FORM name=teach_comp id=teach_comp action=Modules.php?modname={$_REQUEST['modname']} method=POST>";
$begin_year = DBGet(DBQuery("SELECT min(unix_timestamp(SCHOOL_DATE)) as SCHOOL_DATE FROM ATTENDANCE_CALENDAR WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'"));
$begin_year = $begin_year[1]['SCHOOL_DATE'];
if ($start && $begin_year) {
$date_select = "<OPTION value={$start}>" . date('M d, Y', $start) . ' - ' . date('M d, Y', $end) . '</OPTION>';
for ($i = $start - 60 * 60 * 24 * 7; $i >= $begin_year; $i -= 60 * 60 * 24 * 7) {
$date_select .= "<OPTION value={$i}" . ($i + 86400 >= $start_time && $i - 86400 <= $start_time ? ' SELECTED' : '') . ">" . date('M d, Y', $i) . ' - ' . date('M d, Y', $i + 1 + ($END_DAY - $START_DAY) * 60 * 60 * 24) . '</OPTION>';
}
}
DrawHeaderHome('<SELECT name=start_date>' . $date_select . '</SELECT>' . $period_select, '<INPUT type=submit class=btn_medium value=Go onclick=\'formload_ajax("teach_comp");\'>');
echo '</FORM>';
$sql = "SELECT CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) AS FULL_NAME,sp.TITLE,cp.PERIOD_ID,s.STAFF_ID \n\t\tFROM STAFF s,COURSE_PERIODS cp,SCHOOL_PERIODS sp \n\t\tWHERE \n\t\t\tsp.PERIOD_ID = cp.PERIOD_ID\n\t\t\tAND cp.TEACHER_ID=s.STAFF_ID AND cp.MARKING_PERIOD_ID IN (" . GetAllMP('QTR', UserMP()) . ")\n\t\t\tAND cp.SYEAR='" . UserSyear() . "' AND cp.SCHOOL_ID='" . UserSchool() . "' AND s.PROFILE='teacher'\n\t\t\t" . ($_REQUEST['period'] ? " AND cp.PERIOD_ID='{$_REQUEST['period']}'" : '') . "\n\t\t\tAND NOT EXISTS (SELECT '' FROM ELIGIBILITY_COMPLETED ac WHERE ac.STAFF_ID=cp.TEACHER_ID AND ac.PERIOD_ID = sp.PERIOD_ID AND ac.SCHOOL_DATE BETWEEN '" . date('Y-m-d', $start_time) . "' AND '" . date('Y-m-d', $start_time + 60 * 60 * 24 * 7) . "')";
$RET = DBGet(DBQuery($sql), array(), array('STAFF_ID', 'PERIOD_ID'));
$i = 0;
if (count($RET)) {
foreach ($RET as $staff_id => $periods) {
$i++;
$staff_RET[$i]['FULL_NAME'] = $periods[key($periods)][1]['FULL_NAME'];
foreach ($periods as $period_id => $period) {
$staff_RET[$i][$period_id] = '<IMG SRC=assets/x.gif>';
}
}
}
$columns = array('FULL_NAME' => 'Teacher');
if (!$_REQUEST['period']) {
foreach ($periods_RET as $period) {
$columns[$period['PERIOD_ID']] = $period['TITLE'];
示例8: unset
unset($total_asgnpoints);
$course_title = $course['COURSE'];
$course_id = $course['COURSE_ID'];
$course_period_id = $course['COURSE_PERIOD_ID'];
$course_period_title = DBGet(DBQuery('SELECT TITLE FROM course_periods WHERE COURSE_PERIOD_ID=\'' . $course_period_id . '\' '));
echo '<table border=0 style=\\"font-size:12px;\\">';
echo "<tr><td>Course:</td><td>" . $course_title . "</td></tr>";
echo "<tr><td>Course Period:</td><td>" . $course_period_title[1]['TITLE'] . "</td></tr>";
if ($programconfig[User('STAFF_ID')]['WEIGHT'] == 'Y') {
$sql = 'SELECT ' . $course_period_id . ' as COURSE_PERIOD_ID,a.TITLE,a.ASSIGNED_DATE,a.DUE_DATE, t.ASSIGNMENT_TYPE_ID, t.FINAL_GRADE_PERCENT,g.POINTS,a.POINTS AS TOTAL_POINTS,g.COMMENT,g.POINTS AS LETTER_GRADE,CASE WHEN (a.ASSIGNED_DATE IS NULL OR CURRENT_DATE>=a.ASSIGNED_DATE) AND (a.DUE_DATE IS NULL OR CURRENT_DATE>=a.DUE_DATE) THEN \'Y\' ELSE NULL END AS DUE FROM gradebook_assignment_types t,gradebook_assignments a
LEFT OUTER JOIN gradebook_grades g ON (a.ASSIGNMENT_ID=g.ASSIGNMENT_ID AND g.STUDENT_ID=\'' . $student['STUDENT_ID'] . '\' AND g.COURSE_PERIOD_ID=\'' . $course_period_id . '\')
WHERE a.ASSIGNMENT_TYPE_ID=t.ASSIGNMENT_TYPE_ID AND (a.COURSE_PERIOD_ID=\'' . $course_period_id . '\' OR a.COURSE_ID=\'' . $course_id . '\' ) AND t.COURSE_ID=\'' . $course_id . '\' AND a.MARKING_PERIOD_ID=\'' . UserMP() . '\'';
} else {
$sql = 'SELECT ' . $course_period_id . ' as COURSE_PERIOD_ID,a.TITLE,a.ASSIGNED_DATE,a.DUE_DATE,\'-1\' AS ASSIGNMENT_TYPE_ID,\'1\' AS FINAL_GRADE_PERCENT,g.POINTS,a.POINTS AS TOTAL_POINTS,g.COMMENT,g.POINTS AS LETTER_GRADE,CASE WHEN (a.ASSIGNED_DATE IS NULL OR CURRENT_DATE>=a.ASSIGNED_DATE) AND (a.DUE_DATE IS NULL OR CURRENT_DATE>=a.DUE_DATE) THEN \'Y\' ELSE NULL END AS DUE FROM gradebook_assignments a
LEFT OUTER JOIN gradebook_grades g ON (a.ASSIGNMENT_ID=g.ASSIGNMENT_ID AND g.STUDENT_ID=\'' . $student['STUDENT_ID'] . '\' AND g.COURSE_PERIOD_ID=\'' . $course_period_id . '\')
WHERE (a.COURSE_PERIOD_ID=\'' . $course_period_id . '\' OR a.COURSE_ID=\'' . $course_id . '\') AND a.MARKING_PERIOD_ID=\'' . UserMP() . '\'';
}
if ($_REQUEST['exclude_notdue'] == 'Y') {
$sql .= ' AND ((a.ASSIGNED_DATE IS NULL OR CURRENT_DATE>=a.ASSIGNED_DATE) AND (a.DUE_DATE IS NULL OR CURRENT_DATE>=DUE_DATE) OR g.POINTS IS NOT NULL)';
}
if ($_REQUEST['exclude_ec'] == 'Y') {
$sql .= ' AND (a.POINTS!=\'0\' OR g.POINTS IS NOT NULL AND g.POINTS!=\'-1\')';
}
$sql .= ' AND a.DUE_DATE>=\'' . $student['START_DATE'] . '\' ORDER BY a.ASSIGNMENT_ID';
$grades_RET = DBGet(DBQuery($sql), array('ASSIGNED_DATE' => '_removeSpaces', 'DUE_DATE' => '_removeSpaces', 'TITLE' => '_removeSpaces', 'POINTS' => '_makeExtra', 'LETTER_GRADE' => '_makeExtra'));
$sum_points = $sum_percent = 0;
foreach ($percent_weights as $assignment_type_id => $percent) {
$sum_points += $student_points[$assignment_type_id] * $percent_weights[$assignment_type_id] / $total_points[$assignment_type_id];
$sum_percent += $percent;
$total_stpoints += $student_points[$assignment_type_id];
$total_asgnpoints += $total_points[$assignment_type_id];
示例9: DBQuery
$QI = DBQuery("SELECT PERIOD_ID,TITLE FROM SCHOOL_PERIODS WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' ORDER BY SORT_ORDER ");
$period_RET = DBGet($QI);
$period_select = "<SELECT name=period onChange='this.form.submit();'><OPTION value=''>All</OPTION>";
foreach ($period_RET as $period) {
$period_select .= "<OPTION value={$period['PERIOD_ID']}" . ($_REQUEST['period'] == $period['PERIOD_ID'] ? ' SELECTED' : '') . ">" . $period['TITLE'] . "</OPTION>";
}
$period_select .= "</SELECT>";
$mp_select = "<SELECT name=mp onChange='this.form.submit();'>";
if ($pros != '') {
foreach (explode(',', str_replace("'", '', $pros)) as $pro) {
if (GetMP($pro, 'DOES_GRADES') == 'Y') {
$mp_select .= "<OPTION value=" . $pro . ($pro == $_REQUEST['mp'] ? ' SELECTED' : '') . ">" . GetMP($pro) . "</OPTION>";
}
}
}
$mp_select .= "<OPTION value=" . UserMP() . (UserMP() == $_REQUEST['mp'] ? ' SELECTED' : '') . ">" . GetMP(UserMP()) . "</OPTION>";
if (GetMP($sem, 'DOES_GRADES') == 'Y') {
$mp_select .= "<OPTION value={$sem}" . ($sem == $_REQUEST['mp'] ? ' SELECTED' : '') . ">" . GetMP($sem) . "</OPTION>";
}
if (GetMP($sem, 'DOES_EXAM') == 'Y') {
$mp_select .= "<OPTION value=E{$sem}" . ('E' . $sem == $_REQUEST['mp'] ? ' SELECTED' : '') . ">" . GetMP($sem) . " Exam</OPTION>";
}
if (GetMP($fy, 'DOES_GRADES') == 'Y') {
$mp_select .= "<OPTION value=" . $fy . ($fy == $_REQUEST['mp'] ? ' SELECTED' : '') . ">" . GetMP($fy) . "</OPTION>";
}
if (GetMP($fy, 'DOES_EXAM') == 'Y') {
$mp_select .= "<OPTION value=E" . $fy . ('E' . $fy == $_REQUEST['mp'] ? ' SELECTED' : '') . ">" . GetMP($fy) . " Exam</OPTION>";
}
$mp_select .= '</SELECT>';
echo "<FORM action=Modules.php?modname={$_REQUEST['modname']} method=POST>";
DrawHeaderHome($mp_select . ' - ' . $period_select);
示例10: Widgets
//.........这里部分代码省略.........
$extra['search'] .= '<TR><TD style="text-align:right; width:120px:">' . _('Course') . "</TD><TD><DIV id=course_div></DIV> <A HREF=# onclick='window.open(\"Modules.php?modname=misc/ChooseCourse.php\",\"\",\"scrollbars=yes,resizable=yes,width=800,height=400\");'>" . _('Choose') . '</A></TD></TR>';
}
break;
case 'request':
if ($RosarioModules['Scheduling'] && User('PROFILE') == 'admin') {
// PART OF THIS IS DUPLICATED IN PrintRequests.php
if ($_REQUEST['request_course_id']) {
$course = DBGet(DBQuery("SELECT c.TITLE FROM COURSES c WHERE c.COURSE_ID='" . $_REQUEST['request_course_id'] . "'"));
if (!$_REQUEST['not_request_course']) {
$extra['FROM'] .= ",SCHEDULE_REQUESTS sr";
$extra['WHERE'] .= " AND sr.STUDENT_ID=s.STUDENT_ID AND sr.SYEAR=ssm.SYEAR AND sr.SCHOOL_ID=ssm.SCHOOL_ID AND sr.COURSE_ID='" . $_REQUEST['request_course_id'] . "' ";
if (!$extra['NoSearchTerms']) {
$_ROSARIO['SearchTerms'] .= '<b>' . Localize('colon', _('Request')) . ' </b>' . $course[1]['TITLE'] . '<BR />';
}
} else {
$extra['WHERE'] .= " AND NOT EXISTS (SELECT '' FROM SCHEDULE_REQUESTS sr WHERE sr.STUDENT_ID=ssm.STUDENT_ID AND sr.SYEAR=ssm.SYEAR AND sr.COURSE_ID='" . $_REQUEST['request_course_id'] . "' ) ";
if (!$extra['NoSearchTerms']) {
$_ROSARIO['SearchTerms'] .= '<b>' . Localize('colon', _('Missing Request')) . ' </b>' . $course[1]['TITLE'] . '<BR />';
}
}
}
$extra['search'] .= '<TR><TD style="text-align:right; width:120px">' . _('Request') . '</TD><TD><DIV id="request_div"></DIV> <A HREF="#" onclick=\'window.open("Modules.php?modname=misc/ChooseRequest.php","","scrollbars=yes,resizable=yes,width=800,height=400");\'>' . _('Choose') . '</A></TD></TR>';
}
break;
case 'absences':
if ($RosarioModules['Attendance']) {
if (is_numeric($_REQUEST['absences_low']) && is_numeric($_REQUEST['absences_high'])) {
if ($_REQUEST['absences_low'] > $_REQUEST['absences_high']) {
$temp = $_REQUEST['absences_high'];
$_REQUEST['absences_high'] = $_REQUEST['absences_low'];
$_REQUEST['absences_low'] = $temp;
}
if ($_REQUEST['absences_low'] == $_REQUEST['absences_high']) {
$extra['WHERE'] .= " AND (SELECT sum(1-STATE_VALUE) AS STATE_VALUE FROM ATTENDANCE_DAY ad WHERE ssm.STUDENT_ID=ad.STUDENT_ID AND ad.SYEAR=ssm.SYEAR AND ad.MARKING_PERIOD_ID IN (" . GetChildrenMP($_REQUEST['absences_term'], UserMP()) . ")) = '{$_REQUEST['absences_low']}'";
} else {
$extra['WHERE'] .= " AND (SELECT sum(1-STATE_VALUE) AS STATE_VALUE FROM ATTENDANCE_DAY ad WHERE ssm.STUDENT_ID=ad.STUDENT_ID AND ad.SYEAR=ssm.SYEAR AND ad.MARKING_PERIOD_ID IN (" . GetChildrenMP($_REQUEST['absences_term'], UserMP()) . ")) BETWEEN '{$_REQUEST['absences_low']}' AND '{$_REQUEST['absences_high']}'";
}
switch ($_REQUEST['absences_term']) {
case 'FY':
$term = _('this school year to date');
break;
case 'SEM':
$term = _('this semester to date');
break;
case 'QTR':
$term = _('this marking period to date');
break;
}
if (!$extra['NoSearchTerms']) {
$_ROSARIO['SearchTerms'] .= '<b>' . _('Days Absent') . ' ' . $term . ' ' . _('Between') . ' </b>' . $_REQUEST['absences_low'] . ' & ' . $_REQUEST['absences_high'] . '<BR />';
}
}
//modif Francois: add <label> on radio
$extra['search'] .= '<TR><TD style="text-align:right; width:120px:">' . _('Days Absent') . '<BR /><label><INPUT type="radio" name="absences_term" value="FY" checked /> ' . _('YTD') . '</label> <label><INPUT type="radio" name="absences_term" value="SEM"> ' . GetMP(GetParentMP('SEM', UserMP()), 'SHORT_NAME') . '</label> <label><INPUT type="radio" name="absences_term" value="QTR"> ' . GetMP(UserMP(), 'SHORT_NAME') . '</label></TD><TD>' . _('Between') . ' <INPUT type="text" name="absences_low" size="3" maxlength="5"> & <INPUT type="text" name="absences_high" size="3" maxlength="5"></TD></TR>';
}
break;
case 'gpa':
if ($RosarioModules['Grades']) {
if (is_numeric($_REQUEST['gpa_low']) && is_numeric($_REQUEST['gpa_high'])) {
if ($_REQUEST['gpa_low'] > $_REQUEST['gpa_high']) {
$temp = $_REQUEST['gpa_high'];
$_REQUEST['gpa_high'] = $_REQUEST['gpa_low'];
$_REQUEST['gpa_low'] = $temp;
}
if ($_REQUEST['list_gpa']) {
//modif Francois: remove STUDENT_GPA_CALCULATED table
示例11: unset
if (clean_param($_REQUEST['modfunc'], PARAM_ALPHA) == 'add') {
$flag = true;
if ($_REQUEST['subject_id'] == 0) {
echo "<font color='red'>" . "Please select a subject" . "</font>";
unset($_REQUEST['modfunc']);
} else {
if ($_REQUEST['course_id'] == 0) {
echo "<font color='red'>" . "Please select a course" . "</font>";
unset($_REQUEST['modfunc']);
} else {
$course_id = paramlib_validation($colmn = PERIOD_ID, $_REQUEST['course_id']);
$course_weight = substr($_REQUEST['course'], strpos($_REQUEST['course'], '-') + 1);
//$subject_id = DBGet(DBQuery("SELECT SUBJECT_ID FROM courses WHERE COURSE_ID='".$course_id."'"));
$subject_id = $_REQUEST['subject_id'];
$mp_id = DBGet(DBQuery('SELECT MARKING_PERIOD_ID FROM school_years WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\''));
$mp_id = UserMP();
$same_course_check = DBGet(DBQuery('SELECT COURSE_ID FROM schedule_requests WHERE STUDENT_ID=\'' . UserStudentID() . '\' AND SYEAR=\'' . UserSyear() . '\''));
foreach ($same_course_check as $key => $same_course) {
if ($same_course['COURSE_ID'] == $course_id) {
$flag = false;
}
}
if ($flag) {
DBQuery('INSERT INTO schedule_requests (SYEAR,SCHOOL_ID,STUDENT_ID,SUBJECT_ID,COURSE_ID,MARKING_PERIOD_ID) values(\'' . UserSyear() . '\',\'' . UserSchool() . '\',\'' . UserStudentID() . '\',\'' . $subject_id . '\',\'' . $course_id . '\',\'' . $mp_id . '\')');
} else {
echo "<font color='red'><b>" . "You have already requested for this course" . "</b></font>";
}
unset($_REQUEST['modfunc']);
}
}
}
示例12: IN
$MP_TYPE = $MP_TYPE_RET[1]['MP_TYPE'];
if ($MP_TYPE == 'year') {
$MP_TYPE = 'FY';
} else {
if ($MP_TYPE == 'semester') {
$MP_TYPE = 'SEM';
} else {
if ($MP_TYPE == 'quarter') {
$MP_TYPE = 'QTR';
} else {
$MP_TYPE = '';
}
}
}
if ($_REQUEST['period_id']) {
$sql = "SELECT\r\n cp.TITLE as COURSE_PERIOD,sp.TITLE as PERIOD,cp.PERIOD_ID, cp.COURSE_PERIOD_ID\r\n FROM\r\n SCHEDULE s,COURSES c,COURSE_PERIODS cp,SCHOOL_PERIODS sp\r\n WHERE\r\n s.COURSE_ID = c.COURSE_ID AND s.COURSE_ID = cp.COURSE_ID\r\n AND s.COURSE_PERIOD_ID = cp.COURSE_PERIOD_ID AND cp.PERIOD_ID = sp.PERIOD_ID AND cp.DOES_ATTENDANCE='Y'\r\n AND s.SYEAR = c.SYEAR AND cp.MARKING_PERIOD_ID IN (" . GetAllMP($MP_TYPE, UserMP()) . ")\r\n AND s.STUDENT_ID='" . UserStudentID() . "' AND s.SYEAR='" . UserSyear() . "'\r\n AND ('" . date('Y-m-d', strtotime(DBDate())) . "' BETWEEN s.START_DATE AND s.END_DATE OR s.END_DATE IS NULL)\r\n ORDER BY sp.SORT_ORDER\r\n ";
$schedule_RET = DBGet(DBQuery($sql));
$sql = "SELECT ap.SCHOOL_DATE,ap.COURSE_PERIOD_ID,ac.SHORT_NAME,ac.STATE_CODE,ac.DEFAULT_CODE FROM ATTENDANCE_PERIOD ap,ATTENDANCE_CODES ac WHERE ap.SCHOOL_DATE BETWEEN '" . date('Y-m-d', strtotime($start_date)) . "' AND '" . date('Y-m-d', strtotime($end_date)) . "' AND ap.ATTENDANCE_CODE=ac.ID AND ap.STUDENT_ID='" . UserStudentID() . "'";
$attendance_RET = DBGet(DBQuery($sql), array(), array('SCHOOL_DATE', 'COURSE_PERIOD_ID'));
} else {
$schedule_RET[1] = array('COURSE_PERIOD' => 'Daily Attendance', 'COURSE_PERIOD_ID' => '0');
$attendance_RET = DBGet(DBQuery("SELECT ad.SCHOOL_DATE,'0' AS COURSE_PERIOD_ID,ad.STATE_VALUE AS STATE_CODE," . db_case(array('ad.STATE_VALUE', "'0.0'", "'A'", "'1.0'", "'P'", "'H'")) . " AS SHORT_NAME FROM ATTENDANCE_DAY ad WHERE ad.SCHOOL_DATE BETWEEN '" . date('Y-m-d', strtotime($start_date)) . "' AND '" . date('Y-m-d', strtotime($end_date)) . "' AND ad.STUDENT_ID='" . UserStudentID() . "'"), array(), array('SCHOOL_DATE', 'COURSE_PERIOD_ID'));
}
$i = 0;
if (count($schedule_RET)) {
foreach ($schedule_RET as $course) {
$i++;
$student_RET[$i]['TITLE'] = $course['COURSE_PERIOD'];
foreach ($cal_RET as $value) {
$student_RET[$i][$value['SHORT_DATE']] = _makePeriodColor($attendance_RET[$value['SCHOOL_DATE']][$course['COURSE_PERIOD_ID']][1]['SHORT_NAME'], $attendance_RET[$value['SCHOOL_DATE']][$course['COURSE_PERIOD_ID']][1]['STATE_CODE'], $attendance_RET[$value['SCHOOL_DATE']][$course['COURSE_PERIOD_ID']][1]['DEFAULT_CODE']);
}
示例13: DBGet
$begin_year = DBGet(DBQuery('SELECT min(unix_timestamp(SCHOOL_DATE)) as SCHOOL_DATE FROM attendance_calendar WHERE SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\''));
$begin_year = $begin_year[1]['SCHOOL_DATE'];
if ($start && $begin_year) {
$date_select = "<OPTION value={$start}>" . date('M d, Y', $start) . ' - ' . date('M d, Y', $end) . '</OPTION>';
for ($i = $start - 60 * 60 * 24 * 7; $i >= $begin_year; $i -= 60 * 60 * 24 * 7) {
$date_select .= "<OPTION value={$i}" . ($i + 86400 >= $start_time && $i - 86400 <= $start_time ? ' SELECTED' : '') . ">" . date('M d, Y', $i) . ' - ' . date('M d, Y', $i + 1 + ($END_DAY - $START_DAY) * 60 * 60 * 24) . '</OPTION>';
}
}
DrawHeaderHome('<SELECT name=start_date>' . $date_select . '</SELECT>' . $period_select, '<INPUT type=submit class=btn_medium value=' . _('Go') . ' onclick=\'formload_ajax("teach_comp");\'>');
echo '</FORM>';
$mp = GetAllMP('QTR', UserMP());
if (!isset($mp)) {
$mp = GetAllMP('SEM', UserMP());
}
if (!isset($mp)) {
$mp = GetAllMP('FY', UserMP());
}
/*
$sql = "SELECT CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) AS FULL_NAME,sp.TITLE,cp.PERIOD_ID,s.STAFF_ID
FROM staff s,course_periods cp,school_periods sp
WHERE
sp.PERIOD_ID = cp.PERIOD_ID
AND cp.TEACHER_ID=s.STAFF_ID AND cp.MARKING_PERIOD_ID IN (".GetAllMP('QTR',UserMP()).")
AND cp.SYEAR='".UserSyear()."' AND cp.SCHOOL_ID='".UserSchool()."' AND s.PROFILE='teacher'
".((optional_param('period','',PARAM_SPCL))?" AND cp.PERIOD_ID='".optional_param('period','',PARAM_SPCL)."'":'')."
AND NOT EXISTS (SELECT '' FROM eligibility_completed ac WHERE ac.STAFF_ID=cp.TEACHER_ID AND ac.PERIOD_ID = sp.PERIOD_ID AND ac.SCHOOL_DATE BETWEEN '".date('Y-m-d',$start_time)."' AND '".date('Y-m-d',$start_time+60*60*24*7)."')";
*/
$sql = 'SELECT CONCAT(s.LAST_NAME,\', \',s.FIRST_NAME) AS FULL_NAME,sp.TITLE,cp.PERIOD_ID,s.STAFF_ID
FROM staff s,course_periods cp,school_periods sp
WHERE
sp.PERIOD_ID = cp.PERIOD_ID
示例14: DBGet
if (GetMP($pro, 'POST_START_DATE')) {
if (!$_REQUEST['mp']) {
$_REQUEST['mp'] = $pro;
$current_RET = DBGet(DBQuery('SELECT g.STUDENT_ID,g.REPORT_CARD_GRADE_ID,g.REPORT_CARD_COMMENT_ID,g.COMMENT FROM student_report_card_grades g,course_periods cp WHERE cp.COURSE_PERIOD_ID=g.COURSE_PERIOD_ID AND cp.COURSE_PERIOD_ID=' . $course_period_id . ' AND g.MARKING_PERIOD_ID=\'' . $_REQUEST['mp'] . '\''), array(), array('STUDENT_ID'));
}
$pro_grading = true;
$pro_select .= "<OPTION value=" . $pro . ($pro == $_REQUEST['mp'] ? ' SELECTED' : '') . ">" . GetMP($pro) . "</OPTION><OPTION value=" . $sem . ('E' . $sem == $_REQUEST['mp'] ? ' SELECTED' : '') . ">" . GetMP($sem) . ' Exam</OPTION>';
}
}
//bjj keeping search terms
$PHP_tmp_SELF = PreparePHP_SELF();
echo "<FORM action={$PHP_tmp_SELF} method=POST>";
$mps_select = "<SELECT name=mp onChange='this.form.submit();'>";
if (GetMP(UserMP(), 'POST_START_DATE')) {
$mps_select .= "<OPTION value=" . UserMP() . ">" . GetMP(UserMP()) . "</OPTION>";
} elseif ($_REQUEST['mp'] == UserMP()) {
$_REQUEST['mp'] = $sem;
}
if (GetMP($sem, 'POST_START_DATE')) {
$mps_select .= "<OPTION value=" . $sem . ($sem == $_REQUEST['mp'] ? ' SELECTED' : '') . ">" . GetMP($sem) . "</OPTION>";
}
if ($pro_grading) {
$mps_select .= $pro_select;
}
$mps_select .= '</SELECT>';
DrawHeader($mps_select);
}
Widgets('course');
//Widgets('gpa');
//Widgets('class_rank');
Widgets('letter_grade');
示例15: DBQuery
$QI = DBQuery("SELECT PERIOD_ID,TITLE FROM SCHOOL_PERIODS WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' ORDER BY SORT_ORDER ");
$RET = DBGet($QI);
//modif Francois: fix bug scale for the working year
$SCALE_RET = DBGet(DBQuery("SELECT * from schools where ID = '" . UserSchool() . "' AND SYEAR='" . UserSyear() . "'"));
DrawHeader(ProgramTitle());
$mps = GetAllMP('PRO', UserMP());
$mps = explode(',', str_replace("'", '', $mps));
//modif Francois: add translation
$table = '<TABLE><TR><TD class="valign-top"><TABLE>
<TR>
<TD style="text-align:right; vertical-align: top;"><span style="color:gray">' . _('Calculate GPA for') . '</span></TD>
<TD>';
foreach ($mps as $mp) {
if ($mp != '0') {
//modif Francois: add <label> on radio
$table .= '<label><INPUT type="radio" name="marking_period_id" value="' . $mp . '"' . ($mp == UserMP() ? ' checked' : '') . '> ' . GetMP($mp) . '</label><BR />';
}
}
$table .= '</TD>
</TR>
<TR>
<TD colspan="2" class="center"><span style="color:gray">' . sprintf(_('GPA based on a scale of %d'), $SCALE_RET[1]['REPORTING_GP_SCALE']) . '</span></TD>
</TR>' . '</TABLE></TD><TD style="width:350px;">' . _('GPA calculation modifies existing records.') . '<BR /><BR />' . _('Weighted and unweighted GPA is calculated by dividing the weighted and unweighted grade points configured for each letter grade (assigned in the Report Card Codes setup program) by the base grading scale specified in the school setup.') . ' </TD></TR></TABLE>';
$go = Prompt(_('GPA Calculation'), _('Calculate GPA and Class Rank'), $table);
if ($go) {
//modif Francois: waiting message
echo '<BR />';
PopTable('header', _('Calculating GPA and class rank'));
echo '<span class="center"><DIV id="statusDIV"><IMG SRC="assets/spinning.gif"> ' . _('Calculating ...') . ' </DIV></span>';
PopTable('footer');
ob_flush();