Example #1
0
     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']);
     $_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()));
         DrawHeader(($current_completed ? '<FONT COLOR=green>These grades are complete</FONT>' : '<FONT COLOR=red>Grade reporting is not open for this marking period</FONT>') . (AllowEdit() ? ' | <FONT COLOR=green>You can edit these grades</FONT>' : ' | <FONT COLOR=red>Grade reporting starts on: ' . date("M d, Y ", strtotime($grade_start_date[1]['POST_START_DATE'])) . ' and ends on : ' . date("M d, Y ", strtotime($grade_end_date[1]['POST_END_DATE'])) . '</FONT>'));
     } else {
         if ($grade_status == 'closed') {
             DrawHeader(($current_completed ? '<FONT COLOR=green>These grades are complete</FONT>' : '<FONT COLOR=red>These grades are complete</FONT>') . (AllowEdit() ? ' | <FONT COLOR=green>You can edit these grades</FONT>' : ' | <FONT COLOR=red>Grade reporting ended for this marking period on : ' . date("M d, Y ", strtotime($grade_end_date[1]['POST_END_DATE'])) . '</FONT>'));
         } else {
             if ($grade_status == 'not set yet') {
                 DrawHeader('<FONT COLOR=red>Grade reporting date has not set for this marking period</FONT>');
             }
         }
     }
 }
 if (AllowEdit()) {
     if ($_REQUEST['use_percents'] != 'true') {
         $gb_header = "<A HREF=Modules.php?modname={$_REQUEST['modname']}&include_inactive={$_REQUEST['include_inactive']}&mp={$_REQUEST['mp']}&use_percents=true&period=" . CpvId() . ">Assign Percents</A>";
     } elseif ($not_graded != true) {
         $gb_header = "<A HREF=Modules.php?modname={$_REQUEST['modname']}&include_inactive={$_REQUEST['include_inactive']}&mp={$_REQUEST['mp']}&use_percents=false&period=" . CpvId() . ">Assign Letters</A>";
     }
     if (substr($_REQUEST['mp'], 0, 1) != 'E') {
         if ($cp_type != 'custom') {
             $gb_header .= ($not_graded ? '' : ' | ') . "<A HREF=Modules.php?modname={$_REQUEST['modname']}&include_inactive={$_REQUEST['include_inactive']}&modfunc=gradebook&mp={$_REQUEST['mp']}&use_percents=true&period={$_REQUEST['period']}>Get Gradebook grades</A>";
         } else {
             $gb_header .= ($not_graded ? '' : ' | ') . "<A HREF=Modules.php?modname={$_REQUEST['modname']}&include_inactive={$_REQUEST['include_inactive']}&modfunc=gradebook&mp=" . ($_REQUEST[mp] == '' ? $full_year_mp[1]['MARKING_PERIOD_ID'] : $_REQUEST[mp]) . "&custom_cp=y&use_percents=true&period={$_REQUEST['period']}>Get Gradebook grades</A> | ";
         }
         if ($cp_type != 'custom') {
             $prev_mp = DBGet(DBQuery("SELECT MARKING_PERIOD_ID,TITLE,START_DATE FROM " . GetMP($_REQUEST['mp'], 'TABLE') . " WHERE SCHOOL_ID='" . UserSchool() . "' AND SYEAR='" . UserSyear() . "' AND START_DATE<'" . GetMP($_REQUEST['mp'], 'START_DATE') . "' ORDER BY START_DATE DESC LIMIT 1"));
             $cp_mp = DBGet(DBQuery("SELECT MP FROM  course_periods WHERE COURSE_PERIOD_ID='" . UserCoursePeriod() . "' AND SYEAR='" . UserSyear() . "' AND SCHOOL_ID='" . UserSchool() . "'"));
         }
         $cp_mp = $cp_mp[1]['MP'];
         $prev_mp = $prev_mp[1];
         if ($cp_mp == 'SEM' && $cp_type != 'custom' && $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=true&period={$_REQUEST['period']}>Get {$prev_mp['TITLE']} grades</A>";
Example #3
0
    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();
}
if ($_REQUEST['period'] == '') {
    $_REQUEST['period'] = CpvId();
}
$custom_p = 'n';
if ($_REQUEST['period'] != '' && $_REQUEST['mp'] != '') {
    $check_custom = DBGet(DBQuery('SELECT cp.MARKING_PERIOD_ID FROM course_periods cp,course_period_var cpv WHERE cp.COURSE_PERIOD_ID=cpv.COURSE_PERIOD_ID AND cpv.ID=' . $_REQUEST['period']));
    if ($check_custom[1]['MARKING_PERIOD_ID'] == '') {
        $get_syear_id = DBGet(DBQuery('SELECT MARKING_PERIOD_ID FROM school_years WHERE SYEAR=' . UserSyear() . ' AND SCHOOL_ID=' . UserSchool()));
        $_REQUEST['mp'] = $get_syear_id[1]['MARKING_PERIOD_ID'];
        $custom_p = 'y';
    }
}
//print_r($_REQUEST);
$course_period_id = UserCoursePeriod();
if ($course_period_id) {
    $course_RET = DBGet(DBQuery('SELECT cp.COURSE_ID,c.TITLE as COURSE_NAME, cp.TITLE, cp.GRADE_SCALE_ID,CREDIT(cp.COURSE_PERIOD_ID,\'' . $_REQUEST['mp'] . '\') AS CREDITS,cp.COURSE_WEIGHT FROM course_periods cp, courses c WHERE cp.COURSE_ID = c.COURSE_ID AND cp.COURSE_PERIOD_ID=\'' . $course_period_id . '\''));
}
Example #4
0
        $current_RET = DBGet(DBQuery('SELECT STUDENT_ID,POINTS,COMMENT,ASSIGNMENT_ID FROM gradebook_grades WHERE ASSIGNMENT_ID=\'' . $_REQUEST[assignment_id] . '\' AND COURSE_PERIOD_ID=\'' . $course_period_id . '\''), array(), array('STUDENT_ID', 'ASSIGNMENT_ID'));
    }
    unset($_REQUEST['values']);
    unset($_SESSION['_REQUEST_vars']['values']);
}
$_SESSION['assignment_id'] = $_REQUEST['assignment_id'];
$stu_RET = GetStuList($extra);
$assignment_select = '<SELECT name=assignment_id onchange="document.location.href=\'Modules.php?modname=' . $_REQUEST['modname'] . '&include_inactive=' . $_REQUEST['include_inactive'] . '&cpv_id=' . CpvId() . '&assignment_id=\'+this.options[selectedIndex].value"><OPTION value="">Totals</OPTION><OPTION value="all"' . ($_REQUEST['assignment_id'] == 'all' && !$_REQUEST['student_id'] ? ' SELECTED' : '') . '>All</OPTION>';
if ($_REQUEST['student_id']) {
    $assignment_select .= '<OPTION value=' . $_REQUEST['assignment_id'] . ' SELECTED>' . $stu_RET[1]['FULL_NAME'] . '</OPTION>';
}
foreach ($assignments_RET as $id => $assignment) {
    $assignment_select .= '<OPTION value=' . $id . ($_REQUEST['assignment_id'] == $id && !$_REQUEST['student_id'] ? ' SELECTED' : '') . '>' . $assignment[1]['TYPE_TITLE'] . ' - ' . $assignment[1]['TITLE'] . '</OPTION>';
}
$assignment_select .= '</SELECT>';
echo "<FORM action=Modules.php?modname=" . strip_tags(trim($_REQUEST[modname])) . "&student_id=" . strip_tags(trim($_REQUEST[student_id])) . "&cpv_id=" . CpvId() . " method=POST>";
$tmp_REQUEST = $_REQUEST;
unset($tmp_REQUEST['include_inactive']);
if (count($stu_RET) == 0 && !$_REQUEST['student_id']) {
    DrawHeaderHome($assignment_select, '', '<INPUT type=checkbox name=include_inactive value=Y' . ($_REQUEST['include_inactive'] == 'Y' ? " CHECKED onclick='document.location.href=\"" . PreparePHP_SELF($tmp_REQUEST) . "&include_inactive=\";'" : " onclick='document.location.href=\"" . PreparePHP_SELF($tmp_REQUEST) . "&include_inactive=Y\";'") . '>Include Inactive Students');
} else {
    if (!$_REQUEST['student_id']) {
        DrawHeaderHome($assignment_select, $_REQUEST['assignment_id'] ? SubmitButton('Save', '', 'class=btn_medium') : '', '<INPUT type=checkbox name=include_inactive value=Y' . ($_REQUEST['include_inactive'] == 'Y' ? " CHECKED onclick='document.location.href=\"" . PreparePHP_SELF($tmp_REQUEST) . "&include_inactive=\";'" : " onclick='document.location.href=\"" . PreparePHP_SELF($tmp_REQUEST) . "&include_inactive=Y\";'") . '>Include Inactive Students');
    } else {
        DrawHeaderHome($assignment_select, $_REQUEST['assignment_id'] ? SubmitButton('Save', '', 'class=btn_medium') : '', '');
    }
}
if (!$_REQUEST['student_id'] && $_REQUEST['assignment_id'] == 'all') {
    $options = array('yscroll' => true);
}
echo '<div style="overflow:auto; width:850px;">';