本文整理汇总了PHP中GetMP函数的典型用法代码示例。如果您正苦于以下问题:PHP GetMP函数的具体用法?PHP GetMP怎么用?PHP GetMP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetMP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _makeMP
function _makeMP($marking_period_id, $column)
{
if (!($mp_title = GetMP($marking_period_id, 'TITLE'))) {
$mp_title = $marking_period_id;
}
return $mp_title;
}
示例2: _makeExtra
function _makeExtra($value, $title = '')
{
global $THIS_RET;
if ($THIS_RET['WITH_TEACHER_ID']) {
$return .= Localize('colon', _('With')) . ' ' . GetTeacher($THIS_RET['WITH_TEACHER_ID']) . '<BR>';
}
if ($THIS_RET['NOT_TEACHER_ID']) {
$return .= Localize('colon', _('Not With')) . ' ' . GetTeacher($THIS_RET['NOT_TEACHER_ID']) . '<BR>';
}
if ($THIS_RET['WITH_PERIOD_ID']) {
$return .= Localize('colon', _('On')) . ' ' . GetPeriod($THIS_RET['WITH_PERIOD_ID']) . '<BR>';
}
if ($THIS_RET['NOT_PERIOD_ID']) {
$return .= Localize('colon', _('Not On')) . ' ' . GetPeriod($THIS_RET['NOT_PERIOD_ID']) . '<BR>';
}
if ($THIS_RET['PRIORITY']) {
$return .= Localize('colon', _('Priority')) . ' ' . $THIS_RET['PRIORITY'] . '<BR>';
}
if ($THIS_RET['MARKING_PERIOD_ID']) {
$return .= Localize('colon', _('Marking Period')) . ' ' . GetMP($THIS_RET['MARKING_PERIOD_ID']) . '<BR>';
}
return $return;
}
示例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: BackPrompt
}
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';
foreach ($_REQUEST['student'] as $student_id => $yes) {
if (!$current_RET[$student_id]) {
if (!$request_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\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);
DBQuery("UPDATE COURSE_PERIODS SET FILLED_SEATS=FILLED_SEATS+1 WHERE COURSE_PERIOD_ID='" . $_SESSION['MassSchedule.php']['course_period_id'] . "'");
$request_exists = false;
$note = "That course has been added to the selected students' schedules.";
} else {
$select_stu = DBGet(DBQuery("SELECT FIRST_NAME,LAST_NAME FROM STUDENTS WHERE STUDENT_ID='" . $student_id . "'"));
示例5: DrawHeader
DrawHeader($period_select);
}
echo '</FORM>';
unset($_openSIS['DrawHeader']);
$_openSIS['allow_edit'] = AllowEdit($_REQUEST['modname']);
$_openSIS['User'] = array(1 => array('STAFF_ID' => UserStaffID(), 'NAME' => GetTeacher(UserStaffID()), 'USERNAME' => GetTeacher(UserStaffID(), '', 'USERNAME'), 'PROFILE' => 'teacher', 'SCHOOLS' => ',' . UserSchool() . ',', 'SYEAR' => UserSyear()));
include 'modules/' . $_REQUEST['include'];
} else {
if ($incl_page != 'attendance/MissingAttendance.php') {
if (!$_SESSION['take_mssn_attn']) {
if (!isset($_REQUEST['process'])) {
$period_select = "Choose Period: <SELECT name=period onChange='this.form.submit();'>";
$period_select .= "<OPTION value='na' selected>N/A</OPTION>";
foreach ($RET as $period) {
//
$period_select .= "<OPTION value={$period['ID']}" . (CpvId() == $period['ID'] ? ' SELECTED' : '') . ">" . $period['SHORT_NAME'] . ($period['MARKING_PERIOD_ID'] != $fy_id ? ' ' . GetMP($period['MARKING_PERIOD_ID'], 'SHORT_NAME') : '') . (strlen($period['DAYS']) < 5 ? ' ' . $period['DAYS'] : '') . ' - ' . $period['COURSE_TITLE'] . "</OPTION>";
//
if (CpvId() == $period['ID']) {
$_SESSION['UserPeriod'] = $period['PERIOD_ID'];
}
}
$period_select .= "</SELECT>";
}
}
}
$profile = DBGet(DBQuery('SELECT PROFILE FROM staff WHERE STAFF_ID=' . UserID()));
if ($profile[1]['PROFILE'] == "admin") {
DrawHeader($period_select);
}
echo '</FORM><BR>';
unset($_openSIS['DrawHeader']);
示例6: array
//DrawHeader($course_period['TEACHER'],$course_period['COURSE_TITLE'].' '.GetPeriod($course_period['PERIOD_ID']).($course_period['MARKING_PERIOD_ID']!="$fy_id"?' - '.GetMP($course_period['MARKING_PERIOD_ID']):'').(strlen($course_period['DAYS'])<5?' - '.$course_period['DAYS']:''));
//DrawHeader(GetSchool(UserSchool()),ProperDate(DBDate()));
$_openSIS['User'] = array(1 => array('STAFF_ID' => $course_period['TEACHER_ID'], 'NAME' => 'name', 'PROFILE' => 'teacher', 'SCHOOLS' => ',' . UserSchool() . ',', 'SYEAR' => UserSyear()));
$_SESSION['UserCoursePeriod'] = $course_period['COURSE_PERIOD_ID'];
echo "<table width=100% style=\" font-family:Arial; font-size:12px;\" >";
echo "<tr><td style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">Teacher Class List</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br />Powered by openSIS</td></tr><tr><td colspan=2 style=\"border-top:1px solid #333;\"> </td></tr></table>";
echo "<table >";
echo '<table border=0>';
echo '<tr><td>Teacher Name:</td>';
echo '<td>' . $course_period['TEACHER'] . '</td></tr>';
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') {
示例7: DBQuery
DBQuery('UPDATE student_gpa_calculated g
INNER JOIN (
SELECT s.student_id,
SUM(s.weighted_gp/sc.reporting_gp_scale)/COUNT(*) AS cum_weighted_factor,
SUM(s.unweighted_gp/s.gp_scale)/COUNT(*) AS cum_unweighted_factor
FROM student_report_card_grades s
INNER JOIN schools sc ON sc.id=s.school_id
WHERE s.marking_period_id=\'' . $stu_val['MARKING_PERIOD_ID'] . '\' AND s.course_period_id IS NULL AND s.gpa_cal=\'Y\' AND
s.student_id=\'' . $stu_val['STUDENT_ID'] . '\') gg ON gg.student_id=g.student_id
SET g.cum_unweighted_factor=gg.cum_unweighted_factor
WHERE g.student_id=\'' . $stu_val['STUDENT_ID'] . '\'');
$stu_gpa_cal = DBGet(DBQuery('SELECT COUNT(*) AS COUNT FROM student_gpa_calculated WHERE marking_period_id=\'' . $stu_val['MARKING_PERIOD_ID'] . '\' AND student_id=\'' . $stu_val['STUDENT_ID'] . '\''));
if ($stu_gpa_cal[1]['COUNT'] != 0) {
DBQuery('UPDATE student_gpa_calculated SET gpa=\'' . $res[1]['GPA'] . '\', weighted_gpa=\'' . $res[1]['WEIGHTED_GPA'] . '\',unweighted_gpa=\'' . $res[1]['UNWEIGHTED_GPA'] . '\' WHERE marking_period_id=\'' . $stu_val['MARKING_PERIOD_ID'] . '\' AND student_id=\'' . $stu_val['STUDENT_ID'] . '\'');
} else {
DBQuery('INSERT INTO student_gpa_calculated(student_id,marking_period_id,mp,gpa,weighted_gpa,unweighted_gpa,grade_level_short)
VALUES(\'' . $stu_val['STUDENT_ID'] . '\',\'' . $stu_val['MARKING_PERIOD_ID'] . '\',\'' . $stu_val['MARKING_PERIOD_ID'] . '\',\'' . $res[1]['GPA'] . '\',\'' . $res[1]['WEIGHTED_GPA'] . '\',
\'' . $res[1]['unweighted_gpa'] . '\',\'' . $res[1]['GRADE_LEVEL_SHORT'] . '\')');
}
}
DBQuery('CREATE TEMPORARY table temp_cum_gpa AS
SELECT * FROM student_report_card_grades srcg WHERE credit_attempted=
(SELECT MAX(credit_attempted) FROM student_report_card_grades srcg1 WHERE srcg.course_period_id=srcg1.course_period_id and srcg.student_id=srcg1.student_id AND srcg1.course_period_id IS NOT NULL)
GROUP BY course_period_id,student_id,marking_period_id
UNION SELECT * FROM student_report_card_grades WHERE course_period_id IS NULL AND report_card_grade_id IS NULL');
DBQuery('SELECT CALC_CUM_GPA_MP(\'' . $_REQUEST['mp'] . '\')');
DBQuery('SELECT SET_CLASS_RANK_MP(\'' . $_REQUEST['mp'] . '\')');
unset($_REQUEST['modfunc']);
echo '<br/><table><tr><td width="38"><img src="assets/icon_ok.png" /></td><td valign="middle"><span style="font-size:14px;">The grades for ' . GetMP($_REQUEST['mp']) . ' has been recalculated.</span></td></tr></table>';
示例8: 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>';
示例9: str_replace
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 = '';
示例10: GetMP
$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);
echo '</FORM>';
/*
$sql = "SELECT s.STAFF_ID,CONCAT(s.LAST_NAME,', ',s.FIRST_NAME) AS FULL_NAME,sp.TITLE,cp.PERIOD_ID
FROM STAFF s,COURSE_PERIODS cp,SCHOOL_PERIODS sp
WHERE
sp.PERIOD_ID = cp.PERIOD_ID AND cp.GRADE_SCALE_ID IS NOT NULL
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 GRADES_COMPLETED ac WHERE ac.STAFF_ID=cp.TEACHER_ID AND ac.MARKING_PERIOD_ID='$_REQUEST[mp]' AND ac.PERIOD_ID=sp.PERIOD_ID)
";
示例11: ErrorMessage
echo '</FORM>';
ErrorMessage(array(_('You cannot take attendance for this period on this day.')), 'fatal');
}
$qtr_id = GetCurrentMP('QTR', $date, false);
if (!$qtr_id) {
echo '<FORM action="Modules.php?modname=' . $_REQUEST['modname'] . '&table=' . $_REQUEST['table'] . '" method="POST">';
DrawHeader(PrepareDate($date, '_date', false, array('submit' => true)));
echo '</FORM>';
ErrorMessage(array(_('The selected date is not in a school quarter.')), 'fatal');
}
// if running as a teacher program then rosario[allow_edit] will already be set according to admin permissions
if (!isset($_ROSARIO['allow_edit'])) {
// allow teacher edit if selected date is in the current quarter or in the corresponding grade posting period
$current_qtr_id = GetCurrentMP('QTR', DBDate(), false);
$time = strtotime(DBDate('postgres'));
if (($current_qtr_id && $qtr_id == $current_qtr_id || GetMP($qtr_id, 'POST_START_DATE') && $time <= strtotime(GetMP($qtr_id, 'POST_END_DATE'))) && ($program_config['ATTENDANCE_EDIT_DAYS_BEFORE'][1]['VALUE'] == null || strtotime($date) <= $time + $program_config['ATTENDANCE_EDIT_DAYS_BEFORE'][1]['VALUE'] * 86400) && ($program_config['ATTENDANCE_EDIT_DAYS_AFTER'][1]['VALUE'] == '' || strtotime($date) >= $time - $program_config['ATTENDANCE_EDIT_DAYS_AFTER'][1]['VALUE'] * 86400)) {
$_ROSARIO['allow_edit'] = true;
}
}
$current_Q = "SELECT ATTENDANCE_TEACHER_CODE,STUDENT_ID,ADMIN,COMMENT,COURSE_PERIOD_ID,ATTENDANCE_REASON FROM {$table} t WHERE SCHOOL_DATE='{$date}' AND PERIOD_ID='" . UserPeriod() . "'" . ($table == 'LUNCH_PERIOD' ? " AND TABLE_NAME='{$_REQUEST['table']}'" : '');
$current_RET = DBGet(DBQuery($current_Q), array(), array('STUDENT_ID'));
if ($_REQUEST['attendance'] && $_POST['attendance']) {
foreach ($_REQUEST['attendance'] as $student_id => $value) {
if ($current_RET[$student_id]) {
$sql = "UPDATE {$table} SET ATTENDANCE_TEACHER_CODE='" . mb_substr($value, 5) . "',COURSE_PERIOD_ID='" . UserCoursePeriod() . "'";
if ($current_RET[$student_id][1]['ADMIN'] != 'Y') {
$sql .= ",ATTENDANCE_CODE='" . mb_substr($value, 5) . "'";
}
if ($_REQUEST['comment'][$student_id]) {
$sql .= ",COMMENT='" . trim($_REQUEST['comment'][$student_id]) . "'";
}
示例12: array
$columns += array('POINTS' => 'Points', 'LETTER_GRADE' => 'Grade', 'COMMENT' => 'Comment');
$handle = PDFStart();
foreach ($RET as $student) {
$student_points = $total_points = $percent_weights = array();
unset($_openSIS['DrawHeader']);
echo "<table width=100% style=\" font-family:Arial; font-size:12px;\" >";
echo "<tr><td width=105>" . DrawLogo() . "</td><td style=\"font-size:15px; font-weight:bold; padding-top:20px;\">" . GetSchool(UserSchool()) . "<div style=\"font-size:12px;\">Student Progress Report</div></td><td align=right style=\"padding-top:20px;\">" . ProperDate(DBDate()) . "<br/>Powered by openSIS</td></tr><tr><td colspan=3 style=\"border-top:1px solid #333;\"> </td></tr></table>";
echo '<table border=0 style=\\"font-size:12px;\\">';
echo "<tr><td>Student Name:</td>";
echo "<td>" . $student['FULL_NAME'] . "</td></tr>";
echo "<tr><td>ID:</td>";
echo "<td>" . $student['STUDENT_ID'] . " </td></tr>";
echo "<tr><td>Grade:</td>";
echo "<td>" . $student['GRADE_ID'] . " </td></tr>";
echo "<tr><td>Marking Period:</td>";
echo "<td>" . GetMP(UserMP()) . " </td></tr>";
echo '</table>';
#if($_REQUEST['mailing_labels']=='Y')
#############################
$MP_TYPE_RET = DBGet(DBQuery('SELECT MP_TYPE FROM marking_periods WHERE MARKING_PERIOD_ID=' . UserMP() . ' LIMIT 1'));
$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 = '';
示例13: substr
$periods_list = '(' . substr($periods_list, 1) . ')';
foreach ($_REQUEST['student'] as $student_id => $yes) {
$students_list .= ",'" . $student_id . "'";
}
$students_list = '(' . substr($students_list, 1) . ')';
$current_RET = DBGet(DBQuery('SELECT STUDENT_ID,PERIOD_ID,SCHOOL_DATE,ATTENDANCE_CODE FROM attendance_period WHERE EXTRACT(MONTH FROM SCHOOL_DATE)=\'' . $_REQUEST['month'] * 1 . '\' AND EXTRACT(YEAR FROM SCHOOL_DATE)=\'' . $_REQUEST[year] . '\' AND PERIOD_ID IN ' . $periods_list . ' AND STUDENT_ID IN ' . $students_list . ''), array(), array('STUDENT_ID', 'SCHOOL_DATE', 'PERIOD_ID'));
foreach ($_REQUEST['student'] as $student_id => $yes) {
foreach ($_REQUEST['dates'] as $date => $yes) {
$current_mp = GetCurrentMP('QTR', $date);
if (!$current_mp) {
$current_mp = GetCurrentMP('SEM', $date);
}
if (!$current_mp) {
$current_mp = GetCurrentMP('FY', $date);
}
$all_mp = GetAllMP(GetMPTable(GetMP($current_mp, 'TABLE')), $current_mp);
/*$course_periods_RET = DBGet(DBQuery("SELECT s.COURSE_PERIOD_ID,cp.PERIOD_ID FROM schedule s,course_periods cp,attendance_calendar ac,school_periods sp WHERE sp.PERIOD_ID=cp.PERIOD_ID AND ac.SCHOOL_DATE='".date('Y-m-d',strtotime($date))."' AND ac.CALENDAR_ID=cp.CALENDAR_ID AND (ac.BLOCK=sp.BLOCK OR sp.BLOCK IS NULL) AND s.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID AND s.STUDENT_ID='$student_id' AND cp.PERIOD_ID IN $periods_list AND cp.DOES_ATTENDANCE='Y' AND (ac.SCHOOL_DATE BETWEEN s.START_DATE AND s.END_DATE OR (s.END_DATE IS NULL AND ac.SCHOOL_DATE>=s.START_DATE)) AND position(substring('UMTWHFS' FROM DAYOFWEEK(ac.SCHOOL_DATE) FOR 1) IN cp.DAYS)>0 AND cp.MARKING_PERIOD_ID IN ($all_mp) AND s.MARKING_PERIOD_ID IN ($all_mp) AND NOT (cp.HALF_DAY='Y' AND (SELECT STATE_CODE FROM attendance_codes WHERE ID='$_REQUEST[absence_code]')='H')"),array(),array('PERIOD_ID'));*/
$course_periods_RET = DBGet(DBQuery('SELECT s.COURSE_PERIOD_ID,cpv.PERIOD_ID FROM schedule s,course_periods cp,course_period_var cpv,attendance_calendar ac,school_periods sp WHERE sp.PERIOD_ID=cpv.PERIOD_ID AND cp.COURSE_PERIOD_ID=cpv.COURSE_PERIOD_ID AND ac.SCHOOL_DATE=\'' . date('Y-m-d', strtotime($date)) . '\' AND ac.CALENDAR_ID=cp.CALENDAR_ID AND (ac.BLOCK=sp.BLOCK OR sp.BLOCK IS NULL) AND s.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID AND s.STUDENT_ID=' . $student_id . ' AND cpv.PERIOD_ID IN ' . $periods_list . ' AND cpv.DOES_ATTENDANCE=\'Y\' AND (ac.SCHOOL_DATE BETWEEN s.START_DATE AND s.END_DATE OR (s.END_DATE IS NULL AND ac.SCHOOL_DATE>=s.START_DATE)) AND position(substring(\'UMTWHFS\' FROM DAYOFWEEK(ac.SCHOOL_DATE) FOR 1) IN cpv.DAYS)>0 AND cp.MARKING_PERIOD_ID IN (' . $all_mp . ') AND s.MARKING_PERIOD_ID IN (' . $all_mp . ') AND NOT (cp.HALF_DAY=\'Y\' AND (SELECT STATE_CODE FROM attendance_codes WHERE ID=\'' . optional_param('absence_code', '', PARAM_NUMBER) . '\')=\'H\')'), array(), array('PERIOD_ID'));
foreach ($_REQUEST['period'] as $period_id => $yes) {
if (!$current_RET[$student_id][$date][$period_id]) {
$course_period_id = $course_periods_RET[$period_id][1]['COURSE_PERIOD_ID'];
if ($course_period_id) {
/*$sql = "INSERT INTO attendance_period (STUDENT_ID,SCHOOL_DATE,PERIOD_ID,MARKING_PERIOD_ID,COURSE_PERIOD_ID,ATTENDANCE_CODE,ATTENDANCE_TEACHER_CODE,ATTENDANCE_REASON,ADMIN)
values('$student_id','$date','$period_id','$current_mp','$course_period_id','$_REQUEST[absence_code]','$_REQUEST[absence_code]','$_REQUEST[absence_reason]','Y')";*/
$sql = 'INSERT INTO attendance_period (STUDENT_ID,SCHOOL_DATE,PERIOD_ID,MARKING_PERIOD_ID,COURSE_PERIOD_ID,ATTENDANCE_CODE,ATTENDANCE_TEACHER_CODE,ATTENDANCE_REASON,ADMIN)values(\'' . $student_id . '\',\'' . $date . '\',\'' . $period_id . '\',\'' . $current_mp . '\',\'' . $course_period_id . '\',\'' . optional_param('absence_code', '', PARAM_NUMBER) . '\',\'' . optional_param('absence_code', '', PARAM_NUMBER) . '\',\'' . optional_param('absence_reason', '', PARAM_SPCL) . '\',\'Y\')';
DBQuery($sql);
}
} else {
/*$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'";
*/
示例14: calcSeats1
function calcSeats1($period, &$total_seats, &$filled_seats)
{
if ($_REQUEST['include_child_mps']) {
$mps = GetChildrenMP($period['MP'], $period['MARKING_PERIOD_ID']);
if ($period['MP'] == 'FY' || $period['MP'] == 'SEM') {
$mps = "'{$period['MARKING_PERIOD_ID']}'" . ($mps ? ',' . $mps : '');
}
} else {
$mps = "'" . $period['MARKING_PERIOD_ID'] . "'";
}
foreach (explode(',', $mps) as $mp) {
$mp = trim($mp, "'");
$seats = DBGet(DBQuery("SELECT max((SELECT count(1) FROM SCHEDULE ss JOIN STUDENT_ENROLLMENT sem ON (sem.STUDENT_ID=ss.STUDENT_ID AND sem.SYEAR=ss.SYEAR) WHERE ss.COURSE_PERIOD_ID='{$period['COURSE_PERIOD_ID']}' AND (ss.MARKING_PERIOD_ID='{$mp}' OR ss.MARKING_PERIOD_ID IN (" . GetAllMP(GetMP($mp, 'MP'), $mp) . ")) AND (ac.SCHOOL_DATE>=ss.START_DATE AND (ss.END_DATE IS NULL OR ac.SCHOOL_DATE<=ss.END_DATE)) AND (ac.SCHOOL_DATE>=sem.START_DATE AND (sem.END_DATE IS NULL OR ac.SCHOOL_DATE<=sem.END_DATE)))) AS FILLED_SEATS FROM ATTENDANCE_CALENDAR ac WHERE ac.CALENDAR_ID='{$period['CALENDAR_ID']}' AND ac.SCHOOL_DATE BETWEEN " . db_case(array("(CURRENT_DATE>'" . GetMP($mp, 'END_DATE') . "')", 'TRUE', "'" . GetMP($mp, 'START_DATE') . "'", 'CURRENT_DATE')) . " AND '" . GetMP($mp, 'END_DATE') . "'"));
if ($_REQUEST['include_child_mps']) {
if ($total_seats[$mp] !== false) {
if ($period['TOTAL_SEATS']) {
$total_seats[$mp] += $period['TOTAL_SEATS'];
} else {
$total_seats[$mp] = false;
}
}
if ($filled_seats !== false) {
if ($seats[1]['FILLED_SEATS'] != '') {
$filled_seats[$mp] += $seats[1]['FILLED_SEATS'];
} else {
$filled_seats[$mp] = false;
}
}
} else {
if ($total_seats !== false) {
if ($period['TOTAL_SEATS']) {
$total_seats += $period['TOTAL_SEATS'];
} else {
$total_seats = false;
}
}
if ($filled_seats !== false) {
if ($seats[1]['FILLED_SEATS'] != '') {
$filled_seats += $seats[1]['FILLED_SEATS'];
} else {
$filled_seats = false;
}
}
}
}
}
示例15: DBQuery
DBQuery("SELECT SET_CLASS_RANK_MP('" . $_REQUEST['marking_period_id'] . "')");
//DBQuery("DELETE FROM STUDENT_GPA_CALCULATED WHERE MARKING_PERIOD_ID='".$_REQUEST['marking_period_id']."'");
// DBQuery("INSERT INTO STUDENT_GPA_CALCULATED
// (STUDENT_ID,MARKING_PERIOD_ID,WEIGHTED_GPA,GPA)
// SELECT sgr.STUDENT_ID,sgr.MARKING_PERIOD_ID,sgr.GPA_POINTS_WEIGHTED/sgr.DIVISOR/'$_REQUEST[weight]',
// sgr.GPA_POINTS/sgr.DIVISOR FROM STUDENT_GPA_RUNNING sgr,STUDENT_ENROLLMENT ssm
// WHERE
// sgr.STUDENT_ID=ssm.STUDENT_ID AND (('".DBDate()."' BETWEEN ssm.START_DATE AND ssm.END_DATE OR ssm.END_DATE IS NULL) AND '".DBDate()."'>=ssm.START_DATE)
// AND ssm.SYEAR='".UserSyear()."' AND sgr.MARKING_PERIOD_ID='".$_REQUEST['marking_period_id']."' AND ssm.SCHOOL_ID='".UserSchool()."'
// ");
// $gpa_RET = DBGet(DBQuery("SELECT sgc.STUDENT_ID,ssm.GRADE_ID,sgc.$_REQUEST[rank] AS CUM_GPA FROM STUDENT_GPA_CALCULATED sgc,STUDENT_ENROLLMENT ssm WHERE sgc.STUDENT_ID=ssm.STUDENT_ID AND ssm.SCHOOL_ID='".UserSchool()."' AND ssm.SYEAR='".UserSyear()."' AND (('".DBDate()."' BETWEEN ssm.START_DATE AND ssm.END_DATE OR ssm.END_DATE IS NULL) AND '".DBDate()."'>=ssm.START_DATE) ORDER BY sgc.$_REQUEST[rank] DESC"),array(),array('GRADE_ID'));
// if(count($gpa_RET))
// {
// foreach($gpa_RET as $grade)
// {
// $i = 0;
// foreach($grade as $student)
// {
// $i++;
// if($prev_gpa!=$student['CUM_GPA'])
// $rank = $i;
//
// DBQuery("UPDATE STUDENT_GPA_CALCULATED SET CLASS_RANK='$rank' WHERE STUDENT_ID='$student[STUDENT_ID]' AND MARKING_PERIOD_ID='".$_REQUEST['marking_period_id']."'");
// $prev_gpa = $student['CUM_GPA'];
// }
// }
// }
unset($_REQUEST['delete_ok']);
DrawHeader('<table><tr><td><IMG SRC=assets/check.gif></td><td>GPA and class rank for ' . GetMP($_REQUEST['marking_period_id']) . ' has been calculated.</td></tr></table>');
Prompt('GPA Calculation', 'Calculate GPA and Class Rank', $table);
}