#! /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.
my %lex = ('Main' => 'Main',
'Continue' => 'Continue',
'Grade' => 'Grade',
'Error' => 'Error',
'Common Math Assessment' => 'Common Math Assessment',
'Report' => 'Report',
'Name' => 'Name',
'Tests' => 'Tests',
'No Students Found' => 'No Students Found',
'Last,First/Last/Initials/Studnum' => 'Last,First/Last/Initials/Studnum',
'Search' => 'Search',
'Show Withdrawn' => 'Show Withdrawn',
'Attendance' => 'Attendance',
'View' => 'View',
);
my $self = 'cmaRpt9.pl'; # individual student report.
use DBI;
use CGI;
use Cwd;
use Number::Format qw(:all);
use Time::JulianDay;
my @strands = qw(P N SS SP);
my %strandnames = ('P' => 'Patterns and Relations',
'N' => 'Numbers and Operations',
'SS' => 'Shape and Space',
'SP' => 'Stats and Prob'
);
=head
my %colormap = ( 1 => '#822',
2 => '#BB1',
3 => '#228',
4 => '#282'
);
=cut
my %colormap = ( 1 => 'r',
2 => 'y',
3 => 'b',
4 => 'g'
);
my $configpath = '../../..';
my $linkpath = '../../attendance'; # for links to rptattstud1.pl
if ( getcwd() =~ /tcgi/ ){ # we are in tcgi
$configpath = '../..';
$linkpath = '..';
}
eval require "$configpath/etc/admin.conf";
if ( $@ ) {
print $lex{Error}. " $@
\n";
die $lex{Error}. " $@\n";
}
my $q = new CGI;
print $q->header( -charset, $charset );
my %arr = $q->Vars;
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $iddst) = localtime(time);
$year = $year + 1900;
$wday++; $mon++;
my $currsdate = "$year-$mon-$mday";
my $currdate = "$dow[$wday], $month[$mon] $mday, $year";
my $currjd = julian_day( split('-', $currsdate) );
# setup values for links to student attendance report (studattrpt1.pl)
my ($sy,$ey) = split('-', $schoolyear); # global config
my $endmonth = "$year-$mon"; # based on current month.
my $startmonth = "$sy-08";
my $dsn = "DBI:$dbtype:dbname=$dbase";
my $dbh = DBI->connect($dsn,$user,$password);
$dbh->{mysql_enable_utf8} = 1;
# Get current dir so know what CSS to display;
if ( getcwd() =~ /tcgi/ ){ # we are in tcgi
$css = $tchcss;
$homepage = $tchpage;
}
my $title = "$lex{Report} 9 - Student Report - $schoolname";
print qq{$doctype\n
$lex{Name} | $lex{Grade} | $lex{Tests} | $lex{Attendance} | }; print qq{|
---|---|---|---|---|
$wd $lastname, $firstname}; print qq{ ($studnum) | $grade | }; # Attendance/Enrollment Link print qq{\n}; # Tests print qq{ | $testcount | \n}; if ( $testcount ) { print qq{\n}; } print qq{ |
$lex{'No Students Found'} |