#!/usr/bin/perl
$database_file = "/ims/parallel.park.org/Scripts/votedbf.dbf";
$theme_file = "/ims/parallel.park.org/Scripts/theme_dic_low.txt";
# Read theme name from command line
#
if ($#ARGV >= 0) {
# theme name
$environment = $ENV{'QUERY_STRING'};
$theme = $ENV{'QUERY_STRING'};
$theme =~ tr/+/ /;
}
else {
print "Window-target: pavilions\n";
print "Content-Type: text/html \n\n";
print "
No Theme \n";
print "No Theme Found...
\n";
print "Please, vote from a valid fair page!";
exit;
}
if (!open(D_FILE, $database_file)) {
print "Window-target: pavilions\n";
print "Content-Type: text/html \n\n";
print "No Database \n";
print "No Database Found...
\n";
print "Please, contact fairmaster";
exit;
}
else {
print "Window-target: pavilions\n";
print "Content-Type: text/html\n\n";
print "Pavilions\n";
# print " \n";
# print "\n";
print " \n";
print "\n";
print "\n";
print " | \n";
print "\n";
print "The Pavilions: view them here!
\n";
if (open(T_FILE, $theme_file)) {
while () {
if (/^$theme#([^#]*)#(.*)#(.*)/) {
$theme_name = $2;
}
}
}
close(T_FILE);
print "$theme_name\n";
print "\n";
while () {
# Pavilion#Description#Specials#URL#Old theme#New Theme#In Theme?#Country#In country?#Contact#E-mail#Comments
#
if (/^([^#]*)#([^#]*)#([^#]*)#([^#]*)#([^#]*)#([^#]*)#([^#]*)#([^#]*)#([^#]*)#([^#]*)#([^#]*)#([^#]*)/) {
$pavilion = $1;
$url = $4;
$new_theme = $6;
if ($theme eq $new_theme) {
print "- $pavilion\n";
}
}
}
print "
|
";
}
close(D_FILE);