#! /usr/bin/perl
# Copyright 2001-2009 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 = ('Report' => 'Report',
'Main' => 'Main',
'Transcript' => 'Transcript',
'Edit Transcripts' => 'Edit Transcripts',
'Transcripts Report' => 'Transcripts Report',
'Transcripts' => 'Transcripts',
'Transcript of Marks' => 'Transcript of Marks',
'No Quality Score for' => 'No Quality Score for',
'Report Card' => 'Report Card',
'Term' => 'Term',
'Credits Earned' => 'Credits Earned',
'Credits Attempted' => 'Credits Attempted',
'Reqd' => 'Reqd',
'Earned' => 'Earned',
'Total' => 'Total',
'Approved by' => 'Approved by',
'Transcript is official when sealed' => 'Transcript is official when sealed',
'Phone' => 'Phone',
'Fax' => 'Fax',
'Requirements Complete' => 'Requirements Complete',
'Printed' => 'Printed',
'No Records Found' => 'No Records Found',
'No Records Selected' => 'No Records Selected',
'Entry Error' => 'Entry Error',
'No Student(s) Found' => 'No Student(s) Found',
'Graduation~Requirements' => 'Graduation~Requirements',
'Semester GPA' => 'Semester GPA',
'Cum GPA' => 'Cum GPA',
'Diploma Awarded on' => 'Graduation date:',
'View/Download' => 'View/Download',
'View Log File' => 'View Log File',
'Grade' => 'Grade',
'Homeroom' => 'Homeroom',
'DOB' => 'DOB',
'Lastname/Lastname,Firstname/Initials/StudentNumber' =>
'Lastname/Lastname,Firstname/Initials/StudentNumber',
'Select Student' => 'Select Student',
'Select Group' => 'Select Group',
'Continue' => 'Continue',
'Code' => 'Code',
'Subject' => 'Subject',
'Credit' => 'Credit',
'Area' => 'Area',
'Error' => 'Error',
'Letter' => 'Letter',
'Legal' => 'Legal',
'A4' => 'A4',
'Paper Size' => 'Paper Size',
);
my $self = 'rpttranscript.pl';
# Configuration Format Variables
my $blockwidth = '70mm'; # 2.5in
my $col1 = '15mm'; # '0.60in';
my $col2 = '37mm'; # '1.45in';
my $col3 = '9mm'; #'0.35in';
my $col4 = '5.1mm'; #'0.20in';
$grayscale = '0.93';
my $maxlines = 35; # begin splitting into separate tables after this...
use DBI;
use CGI;
use Number::Format qw(:subs);
# Read config variables
eval require "../../etc/admin.conf";
if ( $@ ) {
print $lex{Error}. ": $@
\n";
die $lex{Error}. ": $@\n";
}
eval require "../../etc/transcript.conf";
if ( $@ ) {
print $lex{Error}. ": $@
\n";
die $lex{Error}. ": $@
\n";
}
# filter latex function
eval require "../../lib/liblatex.pl";
if ( $@ ) {
print $lex{Error}. ": $@
\n";
die $lex{Error}. ": $@\n";
}
# CONFIG VALUES - to go in transcript.conf
my $t_showMark = 1; # show mark on pdf transcript, rather than letter grade.
my $voffset = '-18mm';
my $hoffset = '-18mm';
$t_pagesize{'letterpaper'} = {( 'textwidth' => '190mm',
'textheight' => '254mm',
)};
$t_pagesize{'legalpaper'} = {( 'textwidth' => '203mm',
'textheight' => '333mm',
)};
$t_pagesize{'a4paper'} = {( 'textwidth' => '184mm',
'textheight' => '272mm',
)};
my $q = new CGI;
print $q->header( -charset, $charset );
my %arr = $q->Vars;
my $fmt = new Number::Format(-decimal_fill => '1', -decimal_digits => '2');
# Set Paper Size, text width and height
my ($papersize, $textwidth, $textheight );
if ( $arr{papersize} eq $lex{Letter} ) {
$papersize = 'letterpaper';
} elsif ( $arr{papersize} eq $lex{Legal} ) {
$papersize = 'legalpaper';
} elsif ( $arr{papersize} eq $lex{A4} ) {
$papersize = 'a4paper';
}
$textwidth = $t_pagesize{$papersize}->{textwidth};
$textheight = $t_pagesize{$papersize}->{textheight};
#print "Papersize: $papersize TW: $textwidth TH: $textheight
\n";
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday,
$iddst) = localtime(time);
$year = $year + 1900;
$mon++;
$wday++;
my $currdate = "$dow[$wday], $month[$mon] $mday, $year";
my $shortname = "transcript$$";
my $filename = "$shortname.tex";
my $logfile = "pdflog$$.txt";
my $dsn = "DBI:$dbtype:dbname=$dbase";
my $dbh = DBI->connect($dsn,$user,$password);
if (not $arr{startflag} ) {
$offset = 2;
} elsif ( $arr{startflag} == 1 ) {
$offset = 1;
}
print "$doctype\n
'. $lex{'Entry Error'}. ': '. $lex{'No Student(s) Found'}; print ".
\n"; print "