#! /usr/bin/perl
# Copyright 2001-2010 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',
'No Student(s) Found' => 'No Student(s) Found',
'View/Download' => 'View/Download',
'Student Pictures Report' => 'Student Pictures Report',
'Main' => 'Main',
'View Log File' => 'View Log File',
'Continue' => 'Continue',
'Homeroom' => 'Homeroom',
'Grade' => 'Grade',
'Leave blank for all students' => 'Leave blank for all students',
'Report Type' => 'Report Type',
'PDF' => 'PDF',
'HTML' => 'HTML',
'Pictures per Row' => 'Pictures per Row',
'Select' => 'Select',
'Students' => 'Students',
'Error' => 'Error',
'Paper Size' => 'Paper Size',
'Letter' => 'Letter',
'Legal' => 'Legal',
'A4' => 'A4',
'Font Size' => 'Font Size',
'Gray Shade' => 'Gray Shade',
'Smaller=Darker' => 'Smaller=Darker',
'No Picture' => 'No Picture',
'Separate with Spaces' => 'Separate with Spaces',
'Blank=All' => 'Blank=All',
'PDF' => 'PDF',
'Sort by' => 'Sort by',
'Full Size' => 'Full Size',
'Thumbnail' => 'Thumbnail',
'Picture' => 'Picture',
);
my $self = 'rptpicstudent1.pl';
use DBI;
use CGI;
use Cwd;
# Configurable settings
my $defaultgrayshade = '0.95'; # shading for alternate rows
my $defaultPicsPerRow = 6; # number of pictures per row.
my $heightadjust = 13; # increase page height by this amount (mm).
eval require "../../etc/admin.conf";
if ( $@ ) {
print $lex{Error}. " $@
\n";
die $lex{Error}. " $@\n";
}
eval require "../../lib/liblatex.pl";
if ( $@ ) {
print $lex{Error}. " $@
\n";
die $lex{Error}. " $@\n";
}
my $q = new CGI;
print $q->header( -charset, $charset );
my %arr = $q->Vars;
# Set location of student images.
my $imagepath;
if ( $arr{piclocation} eq $lex{'Full Size'} ) {
$imagepath = $picdir;
} else { # use thumbnails.
$imagepath = $tndir;
}
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $iddst) =
localtime(time);
$year = $year + 1900;
$wday++; $mon++;
my $currdate = "$dow[$wday], $month[$mon] $mday, $year";
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;
}
print "$doctype\n