当前位置: 首页>>代码示例>>PHP>>正文


PHP GetParentMP函数代码示例

本文整理汇总了PHP中GetParentMP函数的典型用法代码示例。如果您正苦于以下问题:PHP GetParentMP函数的具体用法?PHP GetParentMP怎么用?PHP GetParentMP使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetParentMP函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DrawBC

#
#  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/>.
#
#***************************************************************************************
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']]);
        }
    }
开发者ID:26746647,项目名称:Belize-openSIS,代码行数:31,代码来源:GradeBreakdown.php

示例2: foreach

                 foreach ($pros as $pro) {
                     if (GetMP($pro, 'DOES_GRADES') == 'Y') {
                         $extra['extra_header_left'] .= '<TD><label><INPUT type="checkbox" name="mp_arr[]" value="' . $pro . '"> ' . GetMP($pro, 'TITLE') . '</label></TD>';
                     }
                 }
             }
             $extra['extra_header_left'] .= '<TD><label><INPUT type="checkbox" name="mp_arr[]" value="' . $qtr['MARKING_PERIOD_ID'] . '"> ' . $qtr['TITLE'] . '</label></TD>';
         }
         if (GetMP($sem, 'DOES_GRADES') == 'Y') {
             $extra['extra_header_left'] .= '<TD><label><INPUT type="checkbox" name="mp_arr[]" value="' . $sem . '"> ' . GetMP($sem, 'TITLE') . '</label></TD>';
         }
         $extra['extra_header_left'] .= '</TR>';
     }
     $extra['extra_header_left'] .= '</TABLE></TD>';
     if ($sem) {
         $fy = GetParentMP('FY', $sem);
         $extra['extra_header_left'] .= '<TD><TABLE><TR>';
         if (GetMP($fy, 'DOES_GRADES') == 'Y') {
             $extra['extra_header_left'] .= '<TD><label><INPUT type="checkbox" name="mp_arr[]" value="' . $fy . '"> ' . GetMP($fy, 'TITLE') . '</label></TD>';
         }
         $extra['extra_header_left'] .= '</TR></TABLE></TD>';
     }
     $extra['extra_header_left'] .= '</TD></TR></TABLE></TR>';
     $extra['extra_header_left'] .= '</TABLE>';
 }
 $extra['link'] = array('FULL_NAME' => false);
 $extra['SELECT'] = ",s.STUDENT_ID AS CHECKBOX";
 $extra['functions'] = array('CHECKBOX' => '_makeChooseCheckbox');
 $extra['columns_before'] = array('CHECKBOX' => '</A><INPUT type="checkbox" value="Y" name="controller" checked onclick="checkAll(this.form,this.form.controller.checked,\'st_arr\');"><A>');
 $extra['new'] = true;
 $extra['options']['search'] = false;
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:31,代码来源:FinalGrades.php

示例3: GetChildrenMP

function GetChildrenMP($mp, $marking_period_id = '0')
{
    global $_openSIS;
    switch ($mp) {
        case 'FY':
            if (!$_openSIS['GetChildrenMP']['FY']) {
                $RET = DBGet(DBQuery('SELECT MARKING_PERIOD_ID,SEMESTER_ID FROM school_quarters WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\''), array(), array('SEMESTER_ID'));
                foreach ($RET as $sem => $value) {
                    $_openSIS['GetChildrenMP'][$mp]['0'] .= ",'{$sem}'";
                    foreach ($value as $qtr) {
                        $_openSIS['GetChildrenMP'][$mp]['0'] .= ",'{$qtr['MARKING_PERIOD_ID']}'";
                    }
                }
                $_openSIS['GetChildrenMP'][$mp]['0'] = substr($_openSIS['GetChildrenMP'][$mp]['0'], 1);
            }
            return $_openSIS['GetChildrenMP'][$mp]['0'];
            break;
        case 'SEM':
            if (GetMP($marking_period_id, 'TABLE') == 'school_quarters') {
                $marking_period_id = GetParentMP('SEM', $marking_period_id);
            }
            if (!$_openSIS['GetChildrenMP']['SEM']) {
                $RET = DBGet(DBQuery('SELECT MARKING_PERIOD_ID,SEMESTER_ID FROM school_quarters WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\''), array(), array('SEMESTER_ID'));
                foreach ($RET as $sem => $value) {
                    foreach ($value as $qtr) {
                        $_openSIS['GetChildrenMP'][$mp][$sem] .= ",'{$qtr['MARKING_PERIOD_ID']}'";
                    }
                    $_openSIS['GetChildrenMP'][$mp][$sem] = substr($_openSIS['GetChildrenMP'][$mp][$sem], 1);
                }
            }
            return $_openSIS['GetChildrenMP'][$mp][$marking_period_id];
            break;
        case 'QTR':
            return "'" . $marking_period_id . "'";
            break;
        case 'PRO':
            if (!$_openSIS['GetChildrenMP']['PRO']) {
                $RET = DBGet(DBQuery('SELECT MARKING_PERIOD_ID,QUARTER_ID FROM school_progress_periods WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\''), array(), array('QUARTER_ID'));
                foreach ($RET as $qtr => $value) {
                    foreach ($value as $pro) {
                        $_openSIS['GetChildrenMP'][$mp][$qtr] .= ",'{$pro['MARKING_PERIOD_ID']}'";
                    }
                    $_openSIS['GetChildrenMP'][$mp][$qtr] = substr($_openSIS['GetChildrenMP'][$mp][$qtr], 1);
                }
            }
            return $_openSIS['GetChildrenMP'][$mp][$marking_period_id];
            break;
    }
}
开发者ID:SysBind,项目名称:opensis-ml,代码行数:49,代码来源:GetAllMP.fnc.php

示例4: DrawBC

#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#***************************************************************************************
include '../../RedirectModulesInc.php';
DrawBC("Gradebook > " . ProgramTitle());
$i = 0;
if (!$_REQUEST['gd_mp']) {
    $mp = UserMP();
} else {
    $mp = $_REQUEST['gd_mp'];
}
$chk_qua = DBGet(DBQuery('SELECT MARKING_PERIOD_ID,SEMESTER_ID FROM school_quarters WHERE SYEAR=\'' . UserSyear() . '\' AND SCHOOL_ID=\'' . UserSchool() . '\''));
if ($chk_qua) {
    $sem = GetParentMP('SEM', UserMP());
} else {
    $sem = GetParentMP('FY', UserMP());
}
echo "<FORM action=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . " method=POST name=gd_brk_dwn id=gd_brk_dwn >";
$mp_select = "<SELECT name=mp onchange=\"window.location='Modules.php?modname={$_REQUEST['modname']}&mp='+this.options[this.selectedIndex].value;\" ><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,staff_school_relationship ssr,course_periods cp WHERE g.COURSE_PERIOD_ID=cp.COURSE_PERIOD_ID AND cp.TEACHER_ID=s.STAFF_ID AND s.STAFF_ID=ssr.STAFF_ID AND cp.SYEAR=ssr.SYEAR AND cp.SYEAR=g.SYEAR AND ssr.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']]);
        }
开发者ID:jeffthestampede,项目名称:excelsior,代码行数:31,代码来源:GradeBreakdown.php

示例5: DBGet

}
if (clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'gradebook') {
    if ($_REQUEST['mp']) {
        $config_RET = DBGet(DBQuery('SELECT TITLE,VALUE FROM program_user_config WHERE USER_ID=\'' . User('STAFF_ID') . '\' AND SCHOOL_ID=\'' . UserSchool() . '\' AND PROGRAM=\'Gradebook\''), array(), array('TITLE'));
        if (count($config_RET)) {
            foreach ($config_RET as $title => $value) {
                $programconfig[User('STAFF_ID')][$title] = $value[1]['VALUE'];
            }
        } else {
            $programconfig[User('STAFF_ID')] = true;
        }
        $_openSIS['_makeLetterGrade']['courses'][$course_period_id] = DBGet(DBQuery('SELECT DOES_BREAKOFF,GRADE_SCALE_ID FROM course_periods WHERE COURSE_PERIOD_ID=\'' . $course_period_id . '\''));
        $_SESSION['ROUNDING'] = $programconfig[User('STAFF_ID')]['ROUNDING'];
        include '_makeLetterGrade.fnc.php';
        if (false && GetMP($_REQUEST['mp'], 'TABLE') == 'school_semesters') {
            $points_RET = DBGet(DBQuery('SELECT STUDENT_ID,MARKING_PERIOD_ID FROM student_report_card_grades WHERE COURSE_PERIOD_ID=\'' . $course_period_id . '\' AND MARKING_PERIOD_ID IN (' . GetAllMP('SEM', $_REQUEST['mp']) . ",'E" . GetParentMP('SEM', UserMP()) . '\')'), array(), array('STUDENT_ID'));
        }
        if (GetMP($_REQUEST['mp'], 'TABLE') == 'school_quarters' || GetMP($_REQUEST['mp'], 'TABLE') == 'school_progress_periods') {
            // the 'populate the form' approach does not require that we get precisely the right students because nothing is modified here
            // so we don't need to filter on enrollment dates - in fact, for include_inactive we want 'em all anyway
            if ($programconfig[User('STAFF_ID')]['WEIGHT'] == 'Y') {
                $points_RET = DBGet(DBQuery('SELECT DISTINCT s.STUDENT_ID,gt.ASSIGNMENT_TYPE_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\' OR gg.POINTS IS NULL  OR (ga.due_date <  (select DISTINCT ssm.start_date  from student_enrollment ssm where ssm.STUDENT_ID=s.STUDENT_ID AND ssm.SYEAR=\'' . UserSyear() . '\' AND ssm.SCHOOL_ID=' . UserSchool() . ' AND (ssm.START_DATE IS NOT NULL AND (CURRENT_DATE<=ssm.END_DATE OR CURRENT_DATE>=ssm.END_DATE OR  ssm.END_DATE IS NULL)) order by ssm.start_date desc limit 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=\'' . 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  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\' OR gg.POINTS IS NULL  OR (ga.due_date <  (select DISTINCT ssm.start_date  from student_enrollment ssm where ssm.STUDENT_ID=s.STUDENT_ID AND ssm.SYEAR=\'' . UserSyear() . '\' AND ssm.SCHOOL_ID=' . UserSchool() . ' AND (ssm.START_DATE IS NOT NULL AND (CURRENT_DATE<=ssm.END_DATE OR CURRENT_DATE>=ssm.END_DATE OR  ssm.END_DATE IS NULL)) order by ssm.start_date desc limit 1
)  ) ', "'0'", 'ga.POINTS')) . ') AS PARTIAL_TOTAL,
开发者ID:26746647,项目名称:openSIS,代码行数:31,代码来源:InputFinalGrades.php

示例6: GetChildrenMP

function GetChildrenMP($mp, $marking_period_id = '0')
{
    global $_ROSARIO;
    switch ($mp) {
        case 'FY':
            if (!$_ROSARIO['GetChildrenMP']['FY']) {
                $RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,PARENT_ID FROM SCHOOL_MARKING_PERIODS WHERE MP='QTR' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"), array(), array('PARENT_ID'));
                foreach ($RET as $sem => $value) {
                    $_ROSARIO['GetChildrenMP'][$mp]['0'] .= ",'{$sem}'";
                    foreach ($value as $qtr) {
                        $_ROSARIO['GetChildrenMP'][$mp]['0'] .= ",'{$qtr['MARKING_PERIOD_ID']}'";
                    }
                }
                $_ROSARIO['GetChildrenMP'][$mp]['0'] = mb_substr($_ROSARIO['GetChildrenMP'][$mp]['0'], 1);
            }
            return $_ROSARIO['GetChildrenMP'][$mp]['0'];
            break;
        case 'SEM':
            if (GetMP($marking_period_id, 'MP') == 'QTR') {
                $marking_period_id = GetParentMP('SEM', $marking_period_id);
            }
            if (!$_ROSARIO['GetChildrenMP']['SEM']) {
                $RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,PARENT_ID FROM SCHOOL_MARKING_PERIODS WHERE MP='QTR' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"), array(), array('PARENT_ID'));
                foreach ($RET as $sem => $value) {
                    foreach ($value as $qtr) {
                        $_ROSARIO['GetChildrenMP'][$mp][$sem] .= ",'{$qtr['MARKING_PERIOD_ID']}'";
                    }
                    $_ROSARIO['GetChildrenMP'][$mp][$sem] = mb_substr($_ROSARIO['GetChildrenMP'][$mp][$sem], 1);
                }
            }
            return $_ROSARIO['GetChildrenMP'][$mp][$marking_period_id];
            break;
        case 'QTR':
            return "'" . $marking_period_id . "'";
            break;
        case 'PRO':
            if (!$_ROSARIO['GetChildrenMP']['PRO']) {
                $RET = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,PARENT_ID FROM SCHOOL_MARKING_PERIODS WHERE MP='PRO' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"), array(), array('PARENT_ID'));
                foreach ($RET as $qtr => $value) {
                    foreach ($value as $pro) {
                        $_ROSARIO['GetChildrenMP'][$mp][$qtr] .= ",'{$pro['MARKING_PERIOD_ID']}'";
                    }
                    $_ROSARIO['GetChildrenMP'][$mp][$qtr] = mb_substr($_ROSARIO['GetChildrenMP'][$mp][$qtr], 1);
                }
            }
            return $_ROSARIO['GetChildrenMP'][$mp][$marking_period_id];
            break;
    }
}
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:49,代码来源:GetAllMP.fnc.php

示例7: Widgets


//.........这里部分代码省略.........
                    }
                    $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') . '&nbsp;' . $term . ' ' . _('Between') . ' </b>' . $_REQUEST['absences_low'] . ' &amp; ' . $_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 />&nbsp;' . _('YTD') . '</label>&nbsp; <label><INPUT type="radio" name="absences_term" value="SEM">&nbsp;' . GetMP(GetParentMP('SEM', UserMP()), 'SHORT_NAME') . '</label>&nbsp; <label><INPUT type="radio" name="absences_term" value="QTR">&nbsp;' . GetMP(UserMP(), 'SHORT_NAME') . '</label></TD><TD>' . _('Between') . ' <INPUT type="text" name="absences_low" size="3" maxlength="5"> &amp; <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
                            /*$extra['SELECT'] .= ',sgc.WEIGHTED_GPA,sgc.UNWEIGHTED_GPA';
                            		$extra['columns_after']['WEIGHTED_GPA'] = _('Weighted GPA');
                            		$extra['columns_after']['UNWEIGHTED_GPA'] = _('Unweighted GPA');*/
                            $extra['SELECT'] .= ',sms.CUM_WEIGHTED_FACTOR,sms.CUM_UNWEIGHTED_FACTOR';
                            $extra['columns_after']['CUM_WEIGHTED_FACTOR'] = _('Weighted GPA');
                            $extra['columns_after']['CUM_UNWEIGHTED_FACTOR'] = _('Unweighted GPA');
                        }
                        /*if(mb_strpos($extra['FROM'],'STUDENT_GPA_CALCULATED sgc')===false)
                        		{
                        			$extra['FROM'] .= ",STUDENT_GPA_CALCULATED sgc";
                        			$extra['WHERE'] .= " AND sgc.STUDENT_ID=s.STUDENT_ID AND sgc.MARKING_PERIOD_ID='".$_REQUEST['gpa_term']."'";
                        		}*/
                        if (mb_strpos($extra['FROM'], 'STUDENT_MP_STATS sms') === false) {
                            $extra['FROM'] .= ",STUDENT_MP_STATS sms";
                            $extra['WHERE'] .= " AND sms.STUDENT_ID=s.STUDENT_ID AND sms.MARKING_PERIOD_ID='" . $_REQUEST['gpa_term'] . "'";
                        }
                        //$extra['WHERE'] .= " AND sgc.".(($_REQUEST['weighted']=='Y')?'WEIGHTED_':'')."GPA BETWEEN '$_REQUEST[gpa_low]' AND '$_REQUEST[gpa_high]' AND sgc.MARKING_PERIOD_ID='".$_REQUEST['gpa_term']."'";
                        $extra['WHERE'] .= " AND sms.CUM_" . ($_REQUEST['weighted'] == 'Y' ? '' : 'UN') . "WEIGHTED_FACTOR*(SELECT GP_SCALE FROM REPORT_CARD_GRADE_SCALES WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "') BETWEEN '{$_REQUEST['gpa_low']}' AND '{$_REQUEST['gpa_high']}'";
                        if (!$extra['NoSearchTerms']) {
                            $_ROSARIO['SearchTerms'] .= '<b>' . ($_REQUEST['gpa_weighted'] == 'Y' ? _('Weighted GPA') . ' ' : _('Unweighted GPA') . ' ') . Localize('colon', _('Between')) . ' </b>' . $_REQUEST['gpa_low'] . ' &amp; ' . $_REQUEST['gpa_high'] . '<BR />';
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:67,代码来源:Widgets.fnc.php

示例8: Widgets

function Widgets($item, $allow_widget = false)
{
    global $extra, $_openSIS;
    if (!is_array($extra['functions'])) {
        $extra['functions'] = array();
    }
    if (User('PROFILE') == 'admin' || User('PROFILE') == 'teacher' || $allow_widget) {
        switch ($item) {
            case 'course':
                if (User('PROFILE') == 'admin' || $allow_widget) {
                    if ($_REQUEST['w_course_period_id']) {
                        if ($_REQUEST['w_course_period_id_which'] == 'course') {
                            $course = DBGet(DBQuery('SELECT c.TITLE AS COURSE_TITLE,cp.TITLE,cp.COURSE_ID FROM course_periods cp,courses c WHERE c.COURSE_ID=cp.COURSE_ID AND cp.COURSE_PERIOD_ID=\'' . $_REQUEST['w_course_period_id'] . '\''));
                            $extra['FROM'] .= ',schedule w_ss';
                            $extra['WHERE'] .= ' AND w_ss.STUDENT_ID=s.STUDENT_ID AND w_ss.SYEAR=ssm.SYEAR AND w_ss.SCHOOL_ID=ssm.SCHOOL_ID AND w_ss.COURSE_ID=\'' . $course[1]['COURSE_ID'] . '\' AND (\'' . DBDate() . '\' BETWEEN w_ss.START_DATE AND w_ss.END_DATE OR w_ss.END_DATE IS NULL)';
                            $_openSIS['SearchTerms'] .= '<font color=gray><b>Course: </b></font>' . $course[1]['COURSE_TITLE'] . '<BR>';
                        } else {
                            $extra['FROM'] .= ',schedule w_ss';
                            $extra['WHERE'] .= ' AND w_ss.STUDENT_ID=s.STUDENT_ID AND w_ss.SYEAR=ssm.SYEAR AND w_ss.SCHOOL_ID=ssm.SCHOOL_ID AND w_ss.COURSE_PERIOD_ID=\'' . $_REQUEST['w_course_period_id'] . '\' AND (\'' . DBDate() . '\' BETWEEN w_ss.START_DATE AND w_ss.END_DATE OR w_ss.END_DATE IS NULL)';
                            $course = DBGet(DBQuery('SELECT c.TITLE AS COURSE_TITLE,cp.TITLE,cp.COURSE_ID FROM course_periods cp,courses c WHERE c.COURSE_ID=cp.COURSE_ID AND cp.COURSE_PERIOD_ID=\'' . $_REQUEST['w_course_period_id'] . '\''));
                            $_openSIS['SearchTerms'] .= '<font color=gray><b>Course Period: </b></font>' . $course[1]['COURSE_TITLE'] . ': ' . $course[1]['TITLE'] . '<BR>';
                        }
                    }
                    $extra['search'] .= "<TR><TD align=right width=120>Course</TD><TD><DIV id=course_div></DIV> <A HREF=# onclick='window.open(\"ForWindow.php?modname=miscellaneous/ChooseCourse.php\",\"\",\"scrollbars=yes,resizable=yes,width=800,height=400\");'><SMALL>Choose</SMALL></A></TD></TR>";
                }
                break;
            case 'request':
                if (User('PROFILE') == 'admin' || $allow_widget) {
                    // 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'] . '\'';
                            $_openSIS['SearchTerms'] .= '<font color=gray><b>Request: </b></font>' . $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'] . '\') ';
                            $_openSIS['SearchTerms'] .= '<font color=gray><b>Missing Request: </b></font>' . $course[1]['TITLE'] . '<BR>';
                        }
                    }
                    $extra['search'] .= "<TR><TD align=right width=120>Request</TD><TD><DIV id=request_div></DIV> <A HREF=# onclick='window.open(\"ForWindow.php?modname=miscellaneous/ChooseRequest.php\",\"\",\"scrollbars=yes,resizable=yes,width=800,height=400\");'><SMALL>Choose</SMALL></A></TD></TR>";
                }
                break;
            case 'absences':
                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;
                    }
                    $_openSIS['SearchTerms'] .= '<font color=gray><b>Days Absent ' . $term . ' between: </b></font>' . $_REQUEST['absences_low'] . ' &amp; ' . $_REQUEST['absences_high'] . '<BR>';
                }
                $extra['search'] .= "<TR><TD align=right width=120>Days Absent<BR><INPUT type=radio name=absences_term value=FY checked>YTD<INPUT type=radio name=absences_term value=SEM>" . GetMP(GetParentMP('SEM', UserMP()), 'SHORT_NAME') . "<INPUT type=radio name=absences_term value=QTR>" . GetMP(UserMP(), 'SHORT_NAME') . "</TD><TD>Between <INPUT type=text name=absences_low size=3 class=cell_small maxlength=5> &amp; <INPUT type=text name=absences_high size=3 maxlength=5 class=cell_small></TD></TR>";
                break;
            case 'gpa':
                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']) {
                        $extra['SELECT'] .= ',sgc.GPA,sgc.weighted_gpa, sgc.unweighted_gpa';
                        $extra['columns_after']['GPA'] = 'GPA';
                    }
                    if (strpos($extra['FROM'], 'student_gpa_calculated sgc') === false) {
                        $extra['FROM'] .= ',student_gpa_calculated sgc';
                        $extra['WHERE'] .= ' AND sgc.STUDENT_ID=s.STUDENT_ID AND sgc.MARKING_PERIOD_ID=\'' . $_REQUEST['gpa_term'] . '\'';
                    }
                    $extra['WHERE'] .= ' AND sgc.GPA BETWEEN \'' . $_REQUEST[gpa_low] . '\' AND \'' . $_REQUEST[gpa_high] . '\' AND sgc.MARKING_PERIOD_ID=\'' . $_REQUEST['gpa_term'] . '\'';
                    $_openSIS['SearchTerms'] .= '<font color=gray><b>' . ($_REQUEST['gpa_weighted'] == 'Y' ? 'Weighted ' : '') . 'GPA between: </b></font>' . $_REQUEST['gpa_low'] . ' &amp; ' . $_REQUEST['gpa_high'] . '<BR>';
                }
                if (is_numeric($_REQUEST['cgpa_low']) && is_numeric($_REQUEST['cgpa_high'])) {
                    if ($_REQUEST['cgpa_low'] > $_REQUEST['cgpa_high']) {
                        $temp = $_REQUEST['cgpa_high'];
                        $_REQUEST['cgpa_high'] = $_REQUEST['cgpa_low'];
                        $_REQUEST['cgpa_low'] = $temp;
                    }
                    if ($_REQUEST['cgpa']) {
                        $extra['SELECT'] .= ',sgr.CGPA';
                        $extra['columns_after']['CGPA'] = 'CGPA';
                    }
                    //
                    if (strpos($extra['FROM'], 'student_gpa_runnings sgr') === false) {
//.........这里部分代码省略.........
开发者ID:jicheng17,项目名称:fh,代码行数:101,代码来源:WidgetsFnc.php

示例9: DBGet

    }
}
if (clean_param($_REQUEST['modfunc'], PARAM_ALPHAMOD) == 'gradebook') {
    if ($_REQUEST['mp']) {
        $config_RET = DBGet(DBQuery("SELECT TITLE,VALUE FROM PROGRAM_USER_CONFIG WHERE USER_ID='" . User('STAFF_ID') . "' AND PROGRAM='Gradebook'"), array(), array('TITLE'));
        if (count($config_RET)) {
            foreach ($config_RET as $title => $value) {
                $programconfig[User('STAFF_ID')][$title] = $value[1]['VALUE'];
            }
        } else {
            $programconfig[User('STAFF_ID')] = true;
        }
        $_openSIS['_makeLetterGrade']['courses'][$course_period_id] = DBGet(DBQuery("SELECT DOES_BREAKOFF,GRADE_SCALE_ID FROM COURSE_PERIODS WHERE COURSE_PERIOD_ID='" . $course_period_id . "'"));
        include '_makeLetterGrade.fnc.php';
        if (false && GetMP($_REQUEST['mp'], 'TABLE') == 'SCHOOL_SEMESTERS') {
            $points_RET = DBGet(DBQuery("SELECT STUDENT_ID,MARKING_PERIOD_ID FROM STUDENT_REPORT_CARD_GRADES WHERE COURSE_PERIOD_ID='" . $course_period_id . "' AND MARKING_PERIOD_ID IN (" . GetAllMP('SEM', $_REQUEST['mp']) . ",'E" . GetParentMP('SEM', UserMP()) . "')"), array(), array('STUDENT_ID'));
        }
        if (GetMP($_REQUEST['mp'], 'TABLE') == 'SCHOOL_QUARTERS' || GetMP($_REQUEST['mp'], 'TABLE') == 'SCHOOL_PROGRESS_PERIODS') {
            // the 'populate the form' approach does not require that we get precisely the right students because nothing is modified here
            // so we don't need to filter on enrollment dates - in fact, for include_inactive we want 'em all anyway
            if ($programconfig[User('STAFF_ID')]['WEIGHT'] == 'Y') {
                $points_RET = DBGet(DBQuery("SELECT DISTINCT s.STUDENT_ID,gt.ASSIGNMENT_TYPE_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='" . 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                       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='" . 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,                         FINAL_GRADE_PERCENT"), 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'];
开发者ID:26746647,项目名称:Belize-openSIS,代码行数:31,代码来源:InputFinalGrades.php

示例10: Widgets

function Widgets($item, $allow_widget = false)
{
    global $extra, $_openSIS;
    if (!is_array($extra['functions'])) {
        $extra['functions'] = array();
    }
    if (User('PROFILE') == 'admin' || User('PROFILE') == 'teacher' || $allow_widget) {
        switch ($item) {
            case 'course':
                if (User('PROFILE') == 'admin' || $allow_widget) {
                    if ($_REQUEST['w_course_period_id']) {
                        if ($_REQUEST['w_course_period_id_which'] == 'course') {
                            $course = DBGet(DBQuery("SELECT c.TITLE AS COURSE_TITLE,cp.TITLE,cp.COURSE_ID FROM COURSE_PERIODS cp,COURSES c WHERE c.COURSE_ID=cp.COURSE_ID AND cp.COURSE_PERIOD_ID='" . $_REQUEST['w_course_period_id'] . "'"));
                            $extra['FROM'] .= ",SCHEDULE w_ss";
                            $extra['WHERE'] .= " AND w_ss.STUDENT_ID=s.STUDENT_ID AND w_ss.SYEAR=ssm.SYEAR AND w_ss.SCHOOL_ID=ssm.SCHOOL_ID AND w_ss.COURSE_ID='" . $course[1]['COURSE_ID'] . "' AND ('" . DBDate() . "' BETWEEN w_ss.START_DATE AND w_ss.END_DATE OR w_ss.END_DATE IS NULL)";
                            $_openSIS['SearchTerms'] .= '<font color=gray><b>Course: </b></font>' . $course[1]['COURSE_TITLE'] . '<BR>';
                        } else {
                            $extra['FROM'] .= ",SCHEDULE w_ss";
                            $extra['WHERE'] .= " AND w_ss.STUDENT_ID=s.STUDENT_ID AND w_ss.SYEAR=ssm.SYEAR AND w_ss.SCHOOL_ID=ssm.SCHOOL_ID AND w_ss.COURSE_PERIOD_ID='" . $_REQUEST['w_course_period_id'] . "' AND ('" . DBDate() . "' BETWEEN w_ss.START_DATE AND w_ss.END_DATE OR w_ss.END_DATE IS NULL)";
                            $course = DBGet(DBQuery("SELECT c.TITLE AS COURSE_TITLE,cp.TITLE,cp.COURSE_ID FROM COURSE_PERIODS cp,COURSES c WHERE c.COURSE_ID=cp.COURSE_ID AND cp.COURSE_PERIOD_ID='" . $_REQUEST['w_course_period_id'] . "'"));
                            $_openSIS['SearchTerms'] .= '<font color=gray><b>Course Period: </b></font>' . $course[1]['COURSE_TITLE'] . ': ' . $course[1]['TITLE'] . '<BR>';
                        }
                    }
                    #	$extra['search'] .= "<TR><TD align=right width=120>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\");'><SMALL>Choose</SMALL></A></TD></TR>";
                    $extra['search'] .= "<TR><TD align=right width=120>Course</TD><TD><DIV id=course_div></DIV> <A HREF=# onclick='window.open(\"for_window.php?modname=misc/ChooseCourse.php\",\"\",\"scrollbars=yes,resizable=yes,width=800,height=400\");'><SMALL>Choose</SMALL></A></TD></TR>";
                }
                break;
            case 'request':
                if (User('PROFILE') == 'admin' || $allow_widget) {
                    // 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'] . "'";
                            //"' AND sr.COURSE_WEIGHT='".$_REQUEST['request_course_weight']."'";
                            $_openSIS['SearchTerms'] .= '<font color=gray><b>Request: </b></font>' . $course[1]['TITLE'] . '<BR>';
                            //.' - '.$_REQUEST['request_course_weight'].'<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'] . "') ";
                            //."' AND sr.COURSE_WEIGHT='".$_REQUEST['request_course_weight']."') ";
                            $_openSIS['SearchTerms'] .= '<font color=gray><b>Missing Request: </b></font>' . $course[1]['TITLE'] . '<BR>';
                            //.' - '.$_REQUEST['request_course_weight'].'<BR>';
                        }
                    }
                    #		$extra['search'] .= "<TR><TD align=right width=120>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\");'><SMALL>Choose</SMALL></A></TD></TR>";
                    $extra['search'] .= "<TR><TD align=right width=120>Request</TD><TD><DIV id=request_div></DIV> <A HREF=# onclick='window.open(\"for_window.php?modname=misc/ChooseRequest.php\",\"\",\"scrollbars=yes,resizable=yes,width=800,height=400\");'><SMALL>Choose</SMALL></A></TD></TR>";
                }
                break;
            case 'absences':
                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;
                    }
                    $_openSIS['SearchTerms'] .= '<font color=gray><b>Days Absent ' . $term . ' between: </b></font>' . $_REQUEST['absences_low'] . ' &amp; ' . $_REQUEST['absences_high'] . '<BR>';
                }
                $extra['search'] .= "<TR><TD align=right width=120>Days Absent<BR><INPUT type=radio name=absences_term value=FY checked>YTD<INPUT type=radio name=absences_term value=SEM>" . GetMP(GetParentMP('SEM', UserMP()), 'SHORT_NAME') . "<INPUT type=radio name=absences_term value=QTR>" . GetMP(UserMP(), 'SHORT_NAME') . "</TD><TD>Between <INPUT type=text name=absences_low size=3 class=cell_small maxlength=5> &amp; <INPUT type=text name=absences_high size=3 maxlength=5 class=cell_small></TD></TR>";
                break;
            case 'gpa':
                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']) {
                        $extra['SELECT'] .= ',sgc.WEIGHTED_GPA,sgc.UNWEIGHTED_GPA';
                        $extra['columns_after']['WEIGHTED_GPA'] = 'Weighted GPA';
                        $extra['columns_after']['UNWEIGHTED_GPA'] = 'Unweighted GPA';
                    }
                    if (strpos($extra['FROM'], 'STUDENT_GPA_CALCULATED sgc') === false) {
                        $extra['FROM'] .= ",STUDENT_GPA_CALCULATED sgc";
                        $extra['WHERE'] .= " AND sgc.STUDENT_ID=s.STUDENT_ID AND sgc.MARKING_PERIOD_ID='" . $_REQUEST['gpa_term'] . "'";
                    }
                    $extra['WHERE'] .= " AND sgc." . ($_REQUEST['weighted'] == 'Y' ? 'WEIGHTED_' : '') . "GPA BETWEEN '{$_REQUEST['gpa_low']}' AND '{$_REQUEST['gpa_high']}' AND sgc.MARKING_PERIOD_ID='" . $_REQUEST['gpa_term'] . "'";
                    $_openSIS['SearchTerms'] .= '<font color=gray><b>' . ($_REQUEST['gpa_weighted'] == 'Y' ? 'Weighted ' : '') . 'GPA between: </b></font>' . $_REQUEST['gpa_low'] . ' &amp; ' . $_REQUEST['gpa_high'] . '<BR>';
                }
                $extra['search'] .= "<TR><TD align=right width=120>GPA<BR><INPUT type=checkbox name=gpa_weighted value=Y>Weighted<BR><INPUT type=radio name=gpa_term value=CUM checked>Cumulative<INPUT type=radio name=gpa_term value=" . GetParentMP('SEM', UserMP()) . ">" . GetMP(GetParentMP('SEM', UserMP()), 'SHORT_NAME') . "<INPUT type=radio name=gpa_term value=" . UserMP() . ">" . GetMP(UserMP(), 'SHORT_NAME') . "</TD><TD>Between<INPUT type=text name=gpa_low class=cell_small size=3 maxlength=5> &amp; <INPUT type=text name=gpa_high size=3 maxlength=5 class=cell_small></TD></TR>";
                break;
            case 'class_rank':
                if (is_numeric($_REQUEST['class_rank_low']) && is_numeric($_REQUEST['class_rank_high'])) {
                    if ($_REQUEST['class_rank_low'] > $_REQUEST['class_rank_high']) {
//.........这里部分代码省略.........
开发者ID:26746647,项目名称:Belize-openSIS,代码行数:101,代码来源:Widgets.fnc.php

示例11: Widgets


//.........这里部分代码省略.........
                        }
                    }
                    $extra['search'] .= "<TR><TD align=right width=120>" . _('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\");'><SMALL>" . _('Choose') . "</SMALL></A></TD></TR>";
                }
                break;
            case 'absences':
                if ($CentreModules['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']) {
                            $_CENTRE['SearchTerms'] .= '<font color=gray><b>' . _('Days Absent') . '&nbsp;' . $term . ' ' . _('Between') . ' </b></font>' . $_REQUEST['absences_low'] . ' &amp; ' . $_REQUEST['absences_high'] . '<BR>';
                        }
                    }
                    $extra['search'] .= "<TR><TD align=right width=120>" . _('Days Absent') . "<BR><INPUT type=radio name=absences_term value=FY checked><small>YTD</small><INPUT type=radio name=absences_term value=SEM><small>" . GetMP(GetParentMP('SEM', UserMP()), 'SHORT_NAME') . "</small><INPUT type=radio name=absences_term value=QTR><small>" . GetMP(UserMP(), 'SHORT_NAME') . "</small></TD><TD><small>" . _('Between') . "</small> <INPUT type=text name=absences_low size=3 maxlength=5> <small>&amp;</small> <INPUT type=text name=absences_high size=3 maxlength=5></TD></TR>";
                }
                break;
            case 'gpa':
                if ($CentreModules['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']) {
                            $extra['SELECT'] .= ',sgc.WEIGHTED_GPA,sgc.UNWEIGHTED_GPA';
                            $extra['columns_after']['WEIGHTED_GPA'] = _('Weighted GPA');
                            $extra['columns_after']['UNWEIGHTED_GPA'] = _('Unweighted GPA');
                        }
                        if (strpos($extra['FROM'], 'STUDENT_GPA_CALCULATED sgc') === false) {
                            $extra['FROM'] .= ",STUDENT_GPA_CALCULATED sgc";
                            $extra['WHERE'] .= " AND sgc.STUDENT_ID=s.STUDENT_ID AND sgc.MARKING_PERIOD_ID='" . $_REQUEST['gpa_term'] . "'";
                        }
                        $extra['WHERE'] .= " AND sgc." . ($_REQUEST['weighted'] == 'Y' ? 'WEIGHTED_' : '') . "GPA BETWEEN '{$_REQUEST['gpa_low']}' AND '{$_REQUEST['gpa_high']}' AND sgc.MARKING_PERIOD_ID='" . $_REQUEST['gpa_term'] . "'";
                        if (!$extra['NoSearchTerms']) {
                            $_CENTRE['SearchTerms'] .= '<font color=gray><b>' . ($_REQUEST['gpa_weighted'] == 'Y' ? 'Weighted ' : '') . Localize('colon', _('GPA between')) . ' </b></font>' . $_REQUEST['gpa_low'] . ' &amp; ' . $_REQUEST['gpa_high'] . '<BR>';
                        }
                    }
                    $extra['search'] .= "<TR><TD align=right width=120>GPA<BR><INPUT type=checkbox name=gpa_weighted value=Y><small>" . _('Weighted') . "</small><BR><INPUT type=radio name=gpa_term value=CUM checked><small>" . _('Cumulative') . "</small><INPUT type=radio name=gpa_term value=" . GetParentMP('SEM', UserMP()) . "><small>" . GetMP(GetParentMP('SEM', UserMP()), 'SHORT_NAME') . "</small><INPUT type=radio name=gpa_term value=" . UserMP() . "><small>" . GetMP(UserMP(), 'SHORT_NAME') . "</small></TD><TD><small>" . _('Between') . "</small> <INPUT type=text name=gpa_low size=3 maxlength=5> <small>&amp;</small> <INPUT type=text name=gpa_high size=3 maxlength=5></TD></TR>";
                }
                break;
            case 'class_rank':
                if ($CentreModules['Grades']) {
                    if (is_numeric($_REQUEST['class_rank_low']) && is_numeric($_REQUEST['class_rank_high'])) {
                        if ($_REQUEST['class_rank_low'] > $_REQUEST['class_rank_high']) {
                            $temp = $_REQUEST['class_rank_high'];
开发者ID:linil,项目名称:centreSIS,代码行数:67,代码来源:Widgets.fnc.php

示例12: DrawBC

#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#***************************************************************************************
include '../../Redirect_modules.php';
DrawBC("Grades >> " . ProgramTitle());
$mp_RET = DBGet(DBQuery('SELECT MP FROM course_periods WHERE course_period_id = \'' . UserCoursePeriod() . '\''));
if ($mp_RET[1]['MP'] == 'SEM') {
    $sem = GetParentMP('SEM', UserMP());
    $pros = GetChildrenMP('PRO', UserMP());
}
if ($mp_RET[1]['MP'] == 'FY') {
    $sem = GetParentMP('SEM', UserMP());
    if ($sem) {
        $fy = GetParentMP('FY', $sem);
    } else {
        $fy = GetParentMP('FY', UserMP());
    }
    $pros = GetChildrenMP('PRO', UserMP());
}
if ($mp_RET[1]['MP'] == 'QTR') {
    $pros = GetChildrenMP('PRO', UserMP());
}
// if the UserMP has been changed, the REQUESTed MP may not work
if (!$_REQUEST['mp'] || strpos($str = "'" . UserMP() . "','" . $sem . "','" . $fy . "'," . $pros, "'" . ltrim($_REQUEST['mp'], 'E') . "'") === false) {
    $_REQUEST['mp'] = UserMP();
}
//echo $_REQUEST['mp'];
//$mps_select = "<SELECT name=mp onChange='this.form.submit();'>";
$mps_select = "<SELECT name=mp onChange=\"window.location='Modules.php?modname=" . $_REQUEST['modname'] . "&mp=' + this.options[this.selectedIndex].value;\">";
if ($pros != '') {
    foreach (explode(',', str_replace("'", '', $pros)) as $pro) {
开发者ID:26746647,项目名称:openSIS,代码行数:31,代码来源:InputEffortGrades.php

示例13: DBGet

<?php

$semester_comments = 0;
//$_CENTRE['allow_edit'] = true;
if ($_REQUEST['modfunc'] == 'update') {
    $existing_RET = DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENT_MP_COMMENTS WHERE STUDENT_ID='" . UserStudentID() . "' AND SYEAR='" . UserSyear() . "' AND MARKING_PERIOD_ID='" . ($semester_comments ? GetParentMP('SEM', UserMP()) : UserMP()) . "'"));
    if (!$existing_RET) {
        DBQuery("INSERT INTO STUDENT_MP_COMMENTS (SYEAR,STUDENT_ID,MARKING_PERIOD_ID) values('" . UserSyear() . "','" . UserStudentID() . "','" . ($semester_comments ? GetParentMP('SEM', UserMP()) : UserMP()) . "')");
    }
    SaveData(array('STUDENT_MP_COMMENTS' => "STUDENT_ID='" . UserStudentID() . "' AND SYEAR='" . UserSyear() . "' AND MARKING_PERIOD_ID='" . ($semester_comments ? GetParentMP('SEM', UserMP()) : UserMP()) . "'"), '', array('COMMENT' => _('Comment')));
    //unset($_SESSION['_REQUEST_vars']['modfunc']);
    //unset($_SESSION['_REQUEST_vars']['values']);
}
if (!$_REQUEST['modfunc']) {
    $comments_RET = DBGet(DBQuery("SELECT COMMENT FROM STUDENT_MP_COMMENTS WHERE STUDENT_ID='" . UserStudentID() . "' AND SYEAR='" . UserSyear() . "' AND MARKING_PERIOD_ID='" . ($semester_comments ? GetParentMP('SEM', UserMP()) : UserMP()) . "'"));
    echo '<TABLE>';
    echo '<TR>';
    echo '<TD valign=bottom>';
    echo '<b>' . $mp['TITLE'] . ' ' . _('Comments') . '</b><BR>';
    echo '<TEXTAREA id=textarea name=values[STUDENT_MP_COMMENTS][' . UserStudentID() . '][COMMENT] cols=66 rows=22' . (AllowEdit() ? '' : ' readonly') . ' onkeypress="document.getElementById(\'chars_left\').innerHTML=(1121-this.value.length); if(this.value.length>1121) {document.getElementById(\'chars_left\').innerHTML=\'' . _('Fewer than 0') . '\'}">';
    echo $comments_RET[1]['COMMENT'];
    echo '</TEXTAREA>';
    echo '<table><tr><td><IMG SRC=assets/comment_button.gif onload="document.getElementById(\'chars_left\').innerHTML=1121-document.getElementById(\'textarea\').value.length";></td><td><small><div id=chars_left>1121</div></small></td><td><small>' . _('characters remaining.') . '<small></td></tr></table>';
    echo '</TD>';
    //echo '<TR><TD align=center><INPUT type=submit value=Save></TD></TR>';
    echo '</TR></TABLE>';
    echo "<br><b>* " . Localize('colon', _('If more than one teacher will be adding comments for this student')) . "</b><br>";
    echo "<ul><li>" . _('Type your name above the comments you enter.') . "</li>";
    echo "<li>" . _('Leave space for other teachers to enter their comments.') . "</li></ul>";
    $_REQUEST['category_id'] = '4';
    $separator = '<hr>';
开发者ID:linil,项目名称:centreSIS,代码行数:31,代码来源:Comments.inc.php

示例14: DBGet

<?php

//modif Francois: add School Configuration
$program_config = DBGet(DBQuery("SELECT * FROM PROGRAM_CONFIG WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' AND PROGRAM='students'"), array(), array('TITLE'));
//$_ROSARIO['allow_edit'] = true;
if ($_REQUEST['modfunc'] == 'update') {
    $existing_RET = DBGet(DBQuery("SELECT STUDENT_ID FROM STUDENT_MP_COMMENTS WHERE STUDENT_ID='" . UserStudentID() . "' AND SYEAR='" . UserSyear() . "' AND MARKING_PERIOD_ID='" . ($program_config['STUDENTS_SEMESTER_COMMENTS'][1]['VALUE'] ? GetParentMP('SEM', UserMP()) : UserMP()) . "'"));
    if (!$existing_RET) {
        DBQuery("INSERT INTO STUDENT_MP_COMMENTS (SYEAR,STUDENT_ID,MARKING_PERIOD_ID) values('" . UserSyear() . "','" . UserStudentID() . "','" . ($program_config['STUDENTS_SEMESTER_COMMENTS'][1]['VALUE'] ? GetParentMP('SEM', UserMP()) : UserMP()) . "')");
    }
    SaveData(array('STUDENT_MP_COMMENTS' => "STUDENT_ID='" . UserStudentID() . "' AND SYEAR='" . UserSyear() . "' AND MARKING_PERIOD_ID='" . ($program_config['STUDENTS_SEMESTER_COMMENTS'][1]['VALUE'] ? GetParentMP('SEM', UserMP()) : UserMP()) . "'"), '', array('COMMENT' => _('Comment')));
    //unset($_SESSION['_REQUEST_vars']['modfunc']);
    //unset($_SESSION['_REQUEST_vars']['values']);
}
if (empty($_REQUEST['modfunc'])) {
    $comments_RET = DBGet(DBQuery("SELECT COMMENT FROM STUDENT_MP_COMMENTS WHERE STUDENT_ID='" . UserStudentID() . "' AND SYEAR='" . UserSyear() . "' AND MARKING_PERIOD_ID='" . ($program_config['STUDENTS_SEMESTER_COMMENTS'][1]['VALUE'] ? GetParentMP('SEM', UserMP()) : UserMP()) . "'"));
    echo '<TABLE>';
    echo '<TR>';
    echo '<TD style="vertical-align:bottom;">';
    echo '<b>' . $mp['TITLE'] . ' ' . _('Comments') . '</b><BR />';
    //modif Francois: remove maxlength limitation as it is not technically needed
    echo '<TEXTAREA id="textarea" name="values[STUDENT_MP_COMMENTS][' . UserStudentID() . '][COMMENT]" cols="66" rows="27"' . (AllowEdit() ? '' : ' readonly') . '>';
    echo $comments_RET[1]['COMMENT'];
    echo '</TEXTAREA>';
    echo '</TD>';
    echo '</TR></TABLE>';
    echo '<BR /><b>* ' . Localize('colon', _('If more than one teacher will be adding comments for this student')) . '</b><BR />';
    echo '<ul><li>' . _('Type your name above the comments you enter.') . '</li></ul>';
    //echo '<li>'._('Leave space for other teachers to enter their comments.').'</li></ul>';
    $_REQUEST['category_id'] = '4';
    $separator = '<hr>';
开发者ID:fabioassuncao,项目名称:rosariosis,代码行数:31,代码来源:Comments.inc.php


注:本文中的GetParentMP函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。