#! /usr/bin/perl
# Copyright 2001-2020 Leslie Richardson
# This file is part of Open Admin for Schools.
# This is a DUAL RUN script. It runs in /tcgi and also /cgi/repcard.
# Outline: This prints a full xtab report for a single grade/class. All
# objectives are perpendicular.
# Outline: 1) Find all the students in the group (class/section/grade).
# 2) Loop through all eval records for the selected term to find all
# of the subjects.
# 3) Load all subjects into a 2D array. Baseref->Arrayptr1->[0], etc.
# Order by subjsec, name of subject, then any objectives next (start
# at array index 2)
my %lex = ('Year End' => 'Year End',
'Report' => 'Report',
'Missing' => 'Missing',
'Group' => 'Group',
'Grade' => 'Grade',
'Homeroom' => 'Homeroom',
'View/Download' => 'View/Download',
'Download' => 'Download',
'File' => 'File',
'Teacher' => 'Teacher',
'Principal' => 'Principal',
'View Log File' => 'View Log File',
'Report Card' => 'Report Card',
'Main' => 'Main',
'Missing' => 'Missing',
'Short Subject Descriptions' => 'Short Subject Descriptions',
'Note' => 'Note',
'Page' => 'Page',
'Trm' => 'Trm',
'Term' => 'Term',
'No Student(s) Found' => 'No Student(s) Found',
'Y' => 'Y',
'Error' => 'Error',
'Continue' => 'Continue',
'Select by' => 'Select by',
'Paper Size' => 'Paper Size',
'Letter' => 'Letter',
'A4' => 'A4',
'Legal' => 'Legal',
'Student(s)' => 'Student(s)',
'Output' => 'Output',
'Combine failed' => 'Combine failed',
'End' => 'End',
);
my $self = 'rptfinalsumm.pl';
use DBI;
use CGI;
use Cwd;
use Number::Format qw(:all);
# Constants
# These two settings control the vertical height of the header.
my $objectivelength = 36; # number of characters to truncate objectives to.
my $offset = "25mm"; # Strut length in print_header fn.
my $maxstudents = 32; # Number of student rows per page; if you adjust above,
# this may have to change also.
my $maxlegalcols = 16; # maximum number of columns per printed page.
my $maxlettercols = 16;
# Get current dir so know what path for config files.
my $configpath;
if (getcwd() =~ /tcgi/){ # we are in tcgi
$configpath = '..'; # go back one to get to etc.
} else {
$configpath = '../..'; # go back two to get to etc.
}
eval require "$configpath/etc/admin.conf";
if ( $@ ) {
print $lex{Error}. ": $@
\n";
die $lex{Error}. ": $@\n";
}
eval require "$configpath/etc/repcard.conf";
if ( $@ ) {
print $lex{Error}. ": $@
\n";
die $lex{Error}. ": $@\n";
}
eval require "$configpath/lib/liblatex.pl";
if ( $@ ) {
print $lex{Error}. ": $@
\n";
die $lex{Error}. ": $@\n";
}
eval require "$configpath/lib/libattend.pl";
if ( $@ ) {
print $lex{Error}. ": $@
\n";
die $lex{Error}. ": $@\n";
}
# Get current dir so know what CSS to display;
if (getcwd() =~ /tcgi/){ # we are in tcgi
$css = $tchcss;
}
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday,
$iddst) = localtime(time);
$year = $year + 1900;
$mon++;
$wday++;
my $currlongdate = "$dow[$wday], $month[$mon] $mday, $year";
my $currdate = "$month[$mon] $year"; # $mday removed
if (length($mon) == 1){ $mon = '0'.$mon;}
if (length($mday) == 1){ $mday = '0'.$mday;}
my $currsdate = "$year-$mon-$mday";
my $dsn = "DBI:$dbtype:dbname=$dbase";
my $dbh = DBI->connect($dsn,$user,$password);
$dbh->{mysql_enable_utf8} = 1;
my $q = new CGI;
print $q->header( -charset, $charset );
my %arr = $q->Vars;
my $term = $arr{term};
# Print the Page Header
my $title = "$lex{'Year End'} $lex{Report}";
print qq{$doctype\n