Esempio n. 1
0
$tables = array('staff' => 'users', 'school_periods' => 'School Periods', 'school_years' => 'Marking Periods', 'school_calendars' => 'Calendars', 'report_card_grade_scales' => 'Report Card Grade Codes', 'courses' => 'Courses<b>*</b>', 'student_enrollment' => 'Students', 'report_card_comments' => 'Report Card Comment Codes', 'eligibility_activities' => 'Eligibility Activity Codes', 'attendance_codes' => 'Attendance Codes', 'student_enrollment_codes' => 'Student Enrollment Codes');
$no_school_tables = array('student_enrollment_codes' => true, 'staff' => true);
$table_list = '<TABLE align=center>';
$table_list .= '<tr><td colspan=3 class=clear></td></tr>';
$table_list .= '<tr><td colspan=3>* You <i>must</i> roll users, school periods, marking periods, calendars, and report card<br>codes at the same time or before rolling courses<BR><BR>* You <i>must</i> roll courses at the same time or before rolling report card comments<BR><BR>Red items have already have data in the next school year (They might have been rolled).<BR><BR>Rolling red items will delete already existing data in the next school year.</td></tr>';
foreach ($tables as $table => $name) {
    $exists_RET[$table] = DBGet(DBQuery('SELECT count(*) AS COUNT from ' . $table . ' WHERE SYEAR=\'' . $next_syear . '\'' . (!$no_school_tables[$table] ? ' AND SCHOOL_ID=\'' . UserSchool() . '\'' : '')));
    if ($exists_RET[$table][1]['COUNT'] > 0) {
        $table_list .= '<TR><td width=1%></td><TD width=5%><INPUT type=checkbox value=Y name=tables[' . $table . ']></TD><TD width=94%>' . $name . ' (' . $exists_RET[$table][1]['COUNT'] . ')</TD></TR>';
    } else {
        $table_list .= '<TR><td width=1%></td><TD width=5%><INPUT type=checkbox value=Y name=tables[' . $table . '] CHECKED></TD><TD width=94%>' . $name . '</TD></TR>';
    }
}
$table_list .= '</TABLE></CENTER><CENTER>';
DrawBC("School Setup > " . ProgramTitle());
if (Prompt_rollover('Confirm Rollover', 'Are you sure you want to roll the data for ' . UserSyear() . '-' . (UserSyear() + 1) . ' to the next school year?', $table_list)) {
    if ($_REQUEST['tables']['courses'] && (!$_REQUEST['tables']['staff'] && $exists_RET['staff'][1]['COUNT'] < 1 || !$_REQUEST['tables']['school_periods'] && $exists_RET['school_periods'][1]['COUNT'] < 1 || !$_REQUEST['tables']['school_years'] && $exists_RET['school_years'][1]['COUNT'] < 1 || !$_REQUEST['tables']['school_calendars'] && $exists_RET['school_calendars'][1]['COUNT'] < 1 || !$_REQUEST['tables']['report_card_grade_scales'] && $exists_RET['report_card_grade_scales'][1]['COUNT'] < 1)) {
        BackPrompt('You must roll users, school periods, marking periods, calendars, and report card codes at the same time or before rolling courses.');
    }
    if ($_REQUEST['tables']['report_card_comments'] && (!$_REQUEST['tables']['courses'] && $exists_RET['courses'][1]['COUNT'] < 1)) {
        BackPrompt('You must roll  courses at the same time or before rolling report card comments.');
    }
    if (count($_REQUEST['tables'])) {
        foreach ($_REQUEST['tables'] as $table => $value) {
            Rollover($table);
        }
    }
    DrawHeaderHome('<IMG SRC=assets/check.gif>The data have been rolled.', '<input type=button onclick=document.location.href="index.php?modfunc=logout" value="Please login again" class=btn_large >');
    unset($_SESSION['_REQUEST_vars']['tables']);
    unset($_SESSION['_REQUEST_vars']['delete_ok']);
    // --------------------------------------------------------------------------------------------------------------------------------------------------------- //
Esempio n. 2
0
    $_SESSION['total_qrt'] = $_REQUEST['total_qrt'];
    $_SESSION['total_prg'] = $_REQUEST['total_prg'];
}
if ($rolled == 0) {
    //============================
    $tables = array('staff' => 'Staff', 'school_periods' => 'School Periods', 'school_years' => 'Marking Periods', 'school_calendars' => 'Calendars', 'report_card_grade_scales' => 'Report Card Grade Codes', 'course_subjects' => 'Subjects', 'courses' => 'Courses', 'course_periods' => 'Course Periods', 'student_enrollment' => 'Students', 'report_card_comments' => 'Report Card Comment Codes', 'honor_roll' => 'Honor Roll Setup', 'attendance_codes' => 'Attendance Codes', 'student_enrollment_codes' => 'Student Enrollment Codes');
    $no_school_tables = array('student_enrollment_codes' => true, 'staff' => true);
    $required = array('staff' => true, 'school_years' => true, 'student_enrollment' => true, 'student_enrollment_codes' => true);
    $table_list = '<TABLE align=center>';
    $table_list .= '<tr><td colspan=3 class=clear></td></tr>';
    foreach ($tables as $table => $name) {
        $table_list .= '<TR><td width=1%></td><TD width=5%><INPUT type=checkbox value=Y  name=' . $table . ' CHECKED ' . ($required[$table] ? ' disabled="disabled"' : '') . ' onchange="validate_rollover(this.form,this)"></TD><TD width=94%>' . $name . '</TD></TR>';
    }
    $table_list .= '</TABLE>';
    //===============================
    if (Prompt_rollover('Confirm Rollover', 'Are you sure you want to roll the data for ' . $cur_session . ' to the next school year?', $table_list)) {
        echo "<script type='text/javascript'>back_before_roll();</script>";
    }
} else {
    Prompt_rollover_back('Rollover Completed', 'Data has been rolledover for ' . $cur_session . ' for ' . GetSchool(UserSchool()) . '');
}
foreach ($tables as $table => $name) {
    echo '<INPUT type=hidden name=hide_' . $table . ' id="chk_' . $table . '" value="' . $_REQUEST[$table] . '">';
}
echo '   
		<td align="left" valign="top">
        <TABLE><TR><TD><div id="staff"></div></TD></TR>
        <TR><TD><div id="school_periods"></div></TD></TR>
        <TR><TD><div id="school_years"></div></TD></TR>
        <TR><TD><div id="attendance_calendars"></div></TD></TR>
        <TR><TD><div id="report_card_grade_scales"></div></TD></TR>