#!/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 = ('Attendance Records' => 'Attendance Records',
'Main' => 'Main',
'Home Room' => 'Home Room',
'Please Log In' => 'Please Log In',
'Student' => 'Student',
'Date' => 'Date',
'Period' => 'Period',
'Reason' => 'Reason',
'Edit' => 'Edit',
'Delete' => 'Delete',
'Duration' => 'Duration',
'Error' => 'Error',
);
use DBI;
use CGI qw/escape unescape/;
use CGI::Session;
eval require "../etc/admin.conf";
if ( $@ ) {
print $lex{Error}. ": $@
\n";
die $lex{Error}. ": $@\n";
}
my $dsn = "DBI:$dbtype:dbname=$dbase";
my $dbh = DBI->connect($dsn,$user,$password);
my $q = CGI->new;
my %arr = $q->Vars; # Get passed values
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $iddst) = localtime(time);
$year = $year + 1900;
$mon++;
$wday++;
my $currdate = "$dow[$wday], $month[$mon] $mday, $year";
# Setup Session
my $session = new CGI::Session("driver:$dbtype;serializer:FreezeThaw",
undef,{Handle => $dbh}) or die CGI::Session->errstr;
# Get Session Values (a defined userid means it was passed)
my $userid;
if ( not $session->param('logged_in') ){
$userid = $session->param('userid');
print $q->header( -charset, $charset );
printHtmlHeader();
print "