#!/usr/bin/perl
# Copyright 2001-2009 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.
my %lex = ('Main' => 'Main',
'Error' => 'Error',
'Schedule Entry' => 'Schedule Entry',
'Schedule' => 'Schedule',
'Grade' => 'Grade',
'Term' => 'Term',
'Terms' => 'Terms',
'Day' => 'Day',
'Save' => 'Save',
'Period' => 'Period',
'Subject-Section' => 'Subject-Section',
'Add Backings' => 'Add Backings',
'Records added for' => 'Records added for',
'Contact' => 'Contact',
'Separate with Spaces' => 'Separate with Spaces',
'Additional Subjects' => 'Additional Subjects',
'Add Schedule Entries for these terms' => 'Add Schedule Entries for these terms',
'Continue' => 'Continue',
'Teacher' => 'Teacher',
'OR' => 'OR',
'Per' => 'Per',
'No Enrolled Subjects Found' => 'No Enrolled Subjects Found',
);
use DBI;
use CGI;
my $self = "schedadd.pl";
my $maxbackings = 6; # maximum number of backed classes per cycle.
#($sec, $min, $hour, $mday, $mon, $year,
# $wday, $yday, $iddst) = localtime(time);
my @tim = localtime(time);
my $year = $tim[5] + 1900;
my $month = $tim[4] + 1;
my $currdate = "$year-$month-$tim[3]";
eval require "../../etc/admin.conf";
if ( $@ ) {
print $lex{Error}. " $@ \n";
die $lex{Error}. " $@\n";
}
my $q = new CGI;
print $q->header( -charset, $charset );
my %arr = $q->Vars;
my $dsn = "DBI:$dbtype:dbname=$dbase";
my $dbh = DBI->connect($dsn,$user,$password);
# print page header.
print "$doctype\n