#!/usr/local/bin/perl -w
use DBI;
use CGI qw(:standard);
print header;
print start_html;
$ENV {'ORACLE_HOME'}= '/oracle/u01';
$host="neptune";
$sid="ora1";
$username="tayloja1";
$password="the.best";
$sport = 'basketball';
$dbh = DBI->connect( "dbi:Oracle:host=$host;sid=$sid",$username, $password)|| die "Can't connect to Oracle";
$sth = $dbh->prepare("SELECT year from compsize WHERE sport = \'$sport\'")|| die "couldn't prepareSQL statement";
$sth->execute || die "can't execute sql statement";
print "
\n";
print " \n";
print "| List of info | \n";
print "
\n";
my ($thisyear)= $sth->fetchrow_array();
$sth->finish;
print "
\n";
print "| $thisyear | \n";
print "
\n";
my @deplist = ('Business School', 'Admin/Estates', 'CEAC', 'Civ Eng', 'Combined Honours', 'CSAM', 'EEAP', 'Mod Lang', 'Mech Eng', 'Pharmacy', 'Vision Sciences');
my @sportlist = ('campus relay', 'archery', 'badminton', 'basketball', 'cricket', 'football','hockey','netball','rugby', 'snooker', 'squash','swimming', 'table tennis','tennis','tug of war', 'volleyball' );
print " \n";
print " \n";
print "| List of info | \n";
print "
\n";
$sth4 = $dbh->prepare("SELECT department from tempres WHERE year = \'$thisyear\' ORDER BY besttwelve DESC ")|| die "couldn't prepare SQL statement";
$sth4->execute || die "can't execute sql statement";
my $thisno = 0;
my @newdeplist;
while (@row2 = $sth4->fetchrow_array()) {
$newdeplist[$thisno] = $row2[0];
$thisno++;
}
print "