#!/usr/bin/perl # Copyright 2001-2006 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. use DBI; use CGI; my %lex = ('View Date Records' => 'View Date Records', 'Eoy' => 'Eoy', 'Main' => 'Main', 'Dates' => 'Dates', 'School Year' => 'School Year', 'School Start' => 'School Start', 'School End' => 'School End', 'Term' => 'Term', 'Start' => 'Start', 'End' => 'End', 'Date' => 'Date', 'Type' => 'Type', 'Description' => 'Description', 'Day In Cycle?' => 'Day In Cycle?', 'Grade Grouping' => 'Grade Grouping', ); my $q = new CGI; print $q->header; my %arr = $q->Vars; # Read config variables unless (require "../../etc/admin.conf") { print "Cannot read admin.conf!"; die "Cannot read admin.conf!"; } my $dsn = "DBI:$dbtype:dbname=$dbase"; my $dbh = DBI->connect($dsn,$user,$password); my $sth = $dbh->prepare("select * from dates order by date"); $sth->execute; if ($DBI::errstr) { print $DBI::errstr; die;} my $rows = $sth->rows; print "$doctype\n
| ". $lex{'School Year'}. " $schoolyear |
| ". $lex{'School Start'}. " $schoolstart |
| ". $lex{'School End'}. " $schoolend |
\n";
print " ". $lex{'Grade Grouping'}. " $trm\n";
for my $t (1..$#{ $g_termstart{$trm} } ) {
print $lex{Term}. " $t : $g_termstart{$trm}[$t] - ";
print "$g_termend{$trm}[$t] |
| ". $lex{Term}. " $trm: $g_termstart{$trm}\n"; print "- $g_termend{$trm} |
| ". $lex{Date}. " | ". $lex{Type}. " | "; print $lex{Description}. " 1 | ". $lex{Description}. " 2 | \n"; print $lex{'Day In Cycle?'}. " |
|---|---|---|---|---|
| $arr[1] | $arr[2] | $arr[3] | \n"; print "$arr[4] | $arr[5] |