#! /usr/bin/perl
# Copyright 2001-2019 Leslie Richardson
# 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.
# Check for any missing homeroom attendance up to end date.
my %lex = ('Attendance Report' => 'Attendance Report',
'Main' => 'Main',
'Attendance' => 'Attendance',
'Periods Per Day' => 'Periods Per Day',
'View/Download' => 'View/Download',
'View Log File' => 'View Log File',
'Last Name' => 'Last Name',
'First' => 'First',
'Middle' => 'Middle',
'Birthdate' => 'Birthdate',
'Status' => 'Status',
'Reserve' => 'Reserve',
'Mother' => 'Mother',
'School Days' => 'School Days',
'Error' => 'Error',
'Date' => 'Date',
'Paper Size' => 'Paper Size',
'Letter' => 'Letter',
'Legal' => 'Legal',
'A4' => 'A4',
'Continue' => 'Continue',
'Records per Page' => 'Records per Page',
'Not Defined' => 'Not Defined',
'Grade' => 'Grade',
'Student' => 'Student',
'Not Found' => 'Not Found',
'Band' => 'Band',
'Font Size' => 'Font Size',
'Group' => 'Group',
'HTML' => 'HTML',
'Homeroom' => 'Homeroom',
'PDF' => 'PDF',
'Separate with Spaces' => 'Separate with Spaces',
'Report Type' => 'Report Type',
'Year End' => 'Year End',
'Total' => 'Total',
'Percent' => 'Percent',
'Days' => 'Days',
'Enrolled' => 'Enrolled',
'Show Withdrawn Students' => 'Show Withdrawn Students',
'End Date' => 'End Date',
'Missing' => 'Missing',
'Teacher' => 'Teacher',
'Course' => 'Course',
'View' => 'View',
'Details' => 'Details',
'Period' => 'Period',
);
use DBI;
use CGI;
use Number::Format qw(:all);
use Time::JulianDay;
use Cwd;
# Constants
my $self = 'rptatttch2.pl';
# Get current dir so know what path for config files.
my $configpath;
my $teachermode;
if ( getcwd() =~ /tcgi/ ){ # we are in tcgi
$teachermode = 1;
$configpath = '..'; # go back one to get to etc.
} else {
$configpath = '../..'; # go back two to get to etc.
}
# main config file
eval require "$configpath/etc/admin.conf";
if ( $@ ) {
print $lex{Error}. ": $@
\n";
die $lex{Error}. ": $@\n";
}
eval require "$configpath/lib/libattend.pl";
if ( $@ ) {
print $lex{Error}. ": $@
\n";
die $lex{Error}. ": $@\n";
}
#eval require "$configpath/lib/liblatex.pl";
#if ( $@ ) {
# print $lex{Error}. ": $@
\n";
# die $lex{Error}. ": $@\n";
#}
my $dsn = "DBI:mysql:$dbase";
$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 $currsdate = "$year-$month-$day";
my $currdate = "$month[$month] $day, $year";
my $q = new CGI;
my %arr = $q->Vars;
print $q->header( -charset, $charset );
# Get current dir so know what CSS to display and shift to teacher settings.
if ( getcwd() =~ /tcgi/ ) { # we are in tcgi
$css = $tchcss;
$homepage = $tchpage;
$downloaddir = $tchdownloaddir;
$webdownloaddir = $tchwebdownloaddir;
}
# HTML Header
my $title = "$lex{Teacher} $lex{'Attendance Report'} 2 (Homeroom Attendance Check)";
print qq{$doctype\n
$lex{Teacher} | $lex{Homeroom} | $lex{Missing} | |
---|---|---|---|
$firstname $lastname | $homeroom | \n}; # Check that Teacher attendance was done up to this date. my $res = checkAttEntry( $enddate, $homeroom ); print qq{$res | \n}; print qq{\n}; print qq{ |