#!/usr/bin/perl
# Copyright 2001-2022 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.
use DBI;
use CGI;
use Number::Format qw(round);
my %lex = ('Missing Days' => 'Missing Days',
'or' => 'or',
'Start Date' => 'Start Date',
'End Date' => 'End Date',
'Continue' => 'Continue',
'Days Open' => 'Days Open',
'Ethnic Category' => 'Ethnic Category',
'Students' => 'Students',
'Student-Days' => 'Student-Days',
'Absent' => 'Absent',
'Enrolled' => 'Enrolled',
'Percentage' => 'Percentage',
'Attendance' => 'Attendance',
'Periods per Day' => 'Periods per Day',
'Error' => 'Error',
'Ethnic Attendance' => 'Ethnic Attendance',
'Date' => 'Date',
'Days' => 'Days',
'Main' => 'Main',
);
eval require "../../etc/admin.conf";
if ( $@ ) {
print $lex{Error}. " $@
\n";
die $lex{Error}. " $@\n";
}
my $periods;
# Find largest Periods per Day (PPD) and use that.
foreach my $pd (keys %g_ppd) { # %g_ppd defined in admin.conf
if ( $g_ppd{$pd} > $periods ) { $periods = $g_ppd{$pd}; }
}
my ($sec, $min, $hour, $mday, $mon, $year, $wday,
$yday, $iddst) = localtime(time);
$year = $year + 1900;
$mon++;
$wday++;
my $currdate = "$year-$mon-$mday";
my $q = new CGI;
print $q->header( -charset, $charset );
my %arr = $q->Vars;
my $title = $lex{'Ethnic Attendance'};
print qq{$doctype\n
$lex{'Start Date'}: $startdate }; print qq{$lex{'End Date'}: $enddate \n}; print qq{$lex{Days}: $days\n }; print qq{$lex{'Periods per Day'}: $periods
\n}; # Print Attendance Table head print qq{$lex{'Ethnic Category'} | }; print qq{$lex{Students} $lex{Enrolled} | \n};
print qq{$lex{'Student-Days'} $lex{Absent} | \n};
print qq{$lex{'Student-Days'} $lex{Enrolled} | \n};
print qq{$lex{Percentage} $lex{Attendance} |
---|---|---|---|---|
$key | $ethnic{$key} | \n}; print qq{$daysabsent | $daysenrol | }; print qq{$percent |