#!/usr/bin/perl
# Copyright 2001-2020 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 = ('Staff' => 'Staff',
'Main' => 'Main',
'Eoy' => 'Eoy',
'Staff Member' => 'Staff Member',
'Error' => 'Error',
'Absence' => 'Absence',
'Reason' => 'Reason',
'Day' => 'Day',
'Part' => 'Part',
'Date' => 'Date',
'AM' => 'AM',
'PM' => 'PM',
'All Day' => 'All Day',
'Record Exists' => 'Record Exists',
'Skipping' => 'Skipping',
'Record Updated' => 'Record Updated',
'Absent' => 'Absent',
'Continue' => 'Continue',
'Out of Range' => 'Out of Range',
'Invalid Date' => 'Invalid Date',
'Missing' => 'Missing',
'Other' => 'Other',
'Late' => 'Late',
'Audit' => 'Audit',
'Record Stored' => 'Record Stored',
'Edit' => 'Edit',
);
use DBI;
use CGI;
use Time::JulianDay;
my @dayparts; # put in translated values, if necessary.
foreach my $dp ( 'AM', 'PM', 'All Day' ) {
push @dayparts, $lex{$dp};
}
my $self = 'staffabsEdit.pl';
eval require "../../etc/admin.conf";
if ( $@ ) {
print $lex{Error}. ": $@
\n";
die $lex{Error}. ": $@\n";
}
# Load audit write function
eval require "../../lib/libaudit.pl";
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);
$dbh->{mysql_enable_utf8} = 1;
my @tim = localtime(time);
my $year = $tim[5] + 1900;
my $month = $tim[4] + 1;
my $day = $tim[3];
if (length($month) == 1){ $month = "0".$month;}
if (length($day) == 1){ $day = "0".$day;}
my $currdate = "$year-$month-$day";
# Print Page Header
my $title = "$lex{Edit} $lex{Staff} $lex{Absence}";
print qq{$doctype\n