コード例 #1
0
ファイル: FixGPA.php プロジェクト: 26746647/Belize-openSIS
#  See license.txt.
#
#  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());
$mps = GetAllMP('PRO', UserMP());
$mps = explode(',', str_replace("'", '', $mps));
$message = '<TABLE><TR><TD colspan=7 align=center>';
foreach ($mps as $mp) {
    if ($mp && $mp != '0') {
        $message .= '<INPUT type=radio name=marking_period_id value=' . $mp . ($mp == UserMP() ? ' CHECKED' : '') . '>' . GetMP($mp) . '<BR>';
    }
}
$message .= '</TD></TR></TABLE>';
$go = Prompt_Home('Confirm', 'When do you want to recalculate the running GPA numbers?', $message);
if ($go) {
    $students_RET = GetStuList($extra);
    DBQuery("SELECT calc_cum_gpa_mp('" . $_REQUEST['marking_period_id'] . "')");
    DBQuery("SELECT set_class_rank_mp('" . $_REQUEST['marking_period_id'] . "')");
    unset($_REQUEST['modfunc']);
    DrawHeader('<IMG SRC=assets/check.gif> The grades for ' . GetMP($_REQUEST['marking_period_id']) . ' has been recalculated.');
    Prompt('Confirm', 'When do you want to recalculate the running GPA numbers?', $message);
}
コード例 #2
0
#  This program is released under the terms of the GNU General Public License as
#  published by the Free Software Foundation, version 2 of the License.
#  See license.txt.
#
#  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("" . _('Attendance') . " > " . ProgramTitle());
$message = '<TABLE><TR><TD colspan=7 align=center>' . _('From') . ' ' . PrepareDate(DBDate(), '_min') . ' ' . _('to') . ' ' . PrepareDate(DBDate(), '_max') . '</TD></TR></TABLE>';
if (Prompt_Home(_('Confirm'), _('When do you want to recalculate the daily attendance?'), $message)) {
    $current_RET = DBGet(DBQuery('SELECT DISTINCT DATE_FORMAT(SCHOOL_DATE,\'%d-%m-%Y\') as SCHOOL_DATE FROM attendance_calendar WHERE SCHOOL_ID=\'' . UserSchool() . '\' AND SYEAR=\'' . UserSyear() . '\''), array(), array('SCHOOL_DATE'));
    $students_RET = GetStuList();
    $begin = mktime(0, 0, 0, MonthNWSwitch($_REQUEST['month_min'], 'to_num'), $_REQUEST['day_min'] * 1, $_REQUEST['year_min']) + 43200;
    $end = mktime(0, 0, 0, MonthNWSwitch($_REQUEST['month_max'], 'to_num'), $_REQUEST['day_max'] * 1, $_REQUEST['year_max']) + 43200;
    for ($i = $begin; $i <= $end; $i += 86400) {
        if ($current_RET[strtoupper(date('d-M-y', $i))]) {
            foreach ($students_RET as $student) {
                UpdateAttendanceDaily($student['STUDENT_ID'], date('d-M-y', $i));
            }
        }
    }
    unset($_REQUEST['modfunc']);
    DrawHeader('<table><tr><td><IMG SRC=assets/check.gif></td><td>' . _('The Daily Attendance for that timeframe has been recalculated.') . '</td></tr></table>');
}
コード例 #3
0
ファイル: CalcGPA.php プロジェクト: 26746647/Belize-openSIS
#
#***************************************************************************************
include '../../Redirect_modules.php';
$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('PRO', 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) {
    DBQuery("SELECT CALC_CUM_GPA_MP('" . $_REQUEST['marking_period_id'] . "')");
    DBQuery("SELECT SET_CLASS_RANK_MP('" . $_REQUEST['marking_period_id'] . "')");
    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);
}