#!/usr/local/bin/perl
{ # Start Main
#
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
#
# Take the basic working version of results and convert it to do two things:
#
# 1) Using a parameter produce the results for only 1 year
# 2) Using a parameter produce the results for 10 years
#
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
#
use strict;
use English;
use DBI();
use CGI ':standard';
use vars qw/ $sigerr $directory $serverIP $cgi /;
use vars qw/ $dbh $sth_ressl /;
$cgi = CGI->new();
$serverIP = "213.171.218.245";
print header;
print start_html('The John Davey Pages2 - Country Select');
print '';
print '';
print '';
print 'The John Davey Pages';
print '';
print '';
print '
';
print '';
print 'The information on this page kindly supplied by John Davey (Copyright © 2003-2006 John Davey)
Click Here for details of how to contact him';
print '
';
print '
';
#
# Connect to the database.
#
$dbh = DBI->connect("DBI:mysql:database=JDthedatabase;host=$serverIP" , "JD_User", "Us3r",
{
RaiseError=>0,
PrintError=>0,
AutoCommit=>1,
HandleError=>\&dbierrorlog
})
or die "Unable to open database:
$DBI::errstr
";
#
# Find which countries have results
#
$sth_ress1 = $dbh->prepare( q{ SELECT r.country FROM results r GROUP by country; } ) or die $dbh->errstr;
$sth_ress1->execute() or die $dbh->errstr;
if ($sth_ress1->rows == 0)
{
print "
No Results records found
";
}
else
{
$sth_ress1->bind_columns( \$r_Country );
$r = 0;
while ( $sth_ress1->fetch() )
{
$countries[$r] = $r_Country;
$countries[$r] = "GP" if ($r_Country eq "XXX");
$r++;
}
}
print start_form;
print "
Please choose Category (GP, etc) ";
print popup_menu(-name=>'Country', -values=>\@countries), p;
print "
Please select Year ";
print popup_menu(-name=>'Year', -values=>[1971, 1972]), p;
print submit;
print end_form;
}
sub do_report()
{
The John Davey National Championships Pages Home
The John Davey National Championship Pages