#!/usr/bin/perl
# Copyright 2001-2008 Leslie Richardson
# This file is part of Open Admin for Schools.
# Open Admin for Schools is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
# Description: Grade based subject enrollment. List all the students
# for all the subjects in that grade. Deselect those that you don't
# have in those subjects.
my $self = 'enroladdgr.pl';
my %lex = ('Enrol Students by Grade' => 'Enrol Students by Grade',
'Main' => 'Main',
'Report Card' => 'Report Card',
'Please enter a Grade' => 'Please enter a Grade',
'Missing starting/ending reporting periods' =>
'Missing starting/ending reporting periods',
'for the following subjects' => 'for the following subjects',
'Subjects' => 'Subjects',
'Subject Enrollment' => 'Subject Enrollment',
'Students' => 'Students',
'Continue' => 'Continue',
'Terms' => 'Terms',
'Your records are now stored' => 'Your records are now stored',
'Grade' => 'Grade',
'Record exists for Term' => 'Record exists for Term',
'for' => 'for',
'Your records are now stored' => 'Your records are now stored',
'There was an error storing your data' => 'There was an error storing your data',
'Please contact' => 'Please contact',
'Please record the following error' => 'Please record the following error',
'Error' => 'Error',
'Checked' => 'Checked',
'Please Select Subjects to Add' => 'Please Select Subjects to Add',
'Teacher' => 'Teacher',
);
use DBI;
use CGI;
eval require "../../etc/admin.conf";
if ( $@ ) {
print $lex{Error}. " $@
\n";
die $lex{Error}. " $@\n";
}
my $q = new CGI;
print $q->header;
my %arr = $q->Vars;
my $grade = $arr{grade};
my $checked = $arr{checked};
my $dsn = "DBI:$dbtype:dbname=$dbase";
my $dbh = DBI->connect($dsn,$user,$password);
# Print Page Header
print "$doctype\n
". $lex{Grade}. " $grade "; print $lex{'Students'}. " $studrows
\n"; print "\n"; exit; } #---------------- sub showStartPage { #---------------- print "