#!/usr/bin/perl
# Copyright 2001-2021 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 = ('Main' => 'Main',
'Error' => 'Error',
'Student' => 'Student',
'Continue' => 'Continue',
'Grade' => 'Grade',
'Select' => 'Select',
'No Students Found' => 'No Students Found',
'Group' => 'Group',
'Kit' => 'Kit',
'Lesson' => 'Lesson',
'Initial' => 'Initial',
'Progress' => 'Progress',
'Report' => 'Report',
'Pre-test' => 'Pre-test',
'Post-test' => 'Post-test',
'Data' => 'Data',
'Gain' => 'Gain',
'Loss' => 'Loss',
'Total Hours' => 'Total Hours',
'Percentage' => 'Percentage',
'Attendance' => 'Attendance',
'Name' => 'Name',
'Years' => 'Years',
'Date' => 'Date',
'Not Found' => 'Not Found',
);
use DBI;
use CGI;
use CGI::Session;
use Number::Format qw(:all);
use Time::JulianDay;
use Cwd;
my $self = 'lintRptProgress.pl';
my $searchinterval = 30; # How many days forward or backwards to look for pre/post tests.
my $q = new CGI;
my %arr = $q->Vars;
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";
# Yes, both the same but leave in case locations change.
my $configpath = '../..';
if ( getcwd() =~ m/tcgi/ ){ # we are in tcgi
$configpath = '../..';
}
eval require "$configpath/etc/admin.conf";
if ( $@ ) {
print qq{$lex{Error} $self: $@
\n};
die qq{$lex{Error}. "$self: $@\n};
}
eval require "$configpath/lib/libreading.pl";
if ( $@ ) {
print qq{$lex{Error} $self: $@
\n};
die qq{$lex{Error}. "$self: $@\n};
}
# Get current dir so know what CSS to display;
if ( getcwd() =~ /tcgi/ ){ # we are in tcgi
$css = $tchcss;
$homepage = $tchpage;
}
# If no session we do this about here.
print $q->header( -charset, $charset );
my $dsn = "DBI:$dbtype:dbname=$dbase";
my $dbh = DBI->connect($dsn,$user,$password);
# Page Header
my $title = "$lex{Student} $lex{Progress} $lex{Report}";
my $fulltitle = "Primary, Intermediate & Middle Years
Literacy Intervention - $title";
print qq{$doctype\n
[ $lex{Main} ]
\n}; if ( not $arr{page} ) { showStartPage(); } elsif ( $arr{page} == 1 ) { delete $arr{page}; print qq{