#!/usr/bin/perl require '/web/www.aip.com.au/htdocs/admin/contact.conf'; require '/web/www.aip.com.au/htdocs/admin/common.pl'; use CGI qw/:standard/; $displayGames = ""; $indexSkellFile = "directory.html"; $gamesSkellFile = "template.html"; $newGamesTime = "0"; print header; $uid = param('uid'); if ($uid) { &displayGame($uid); } else { &list(); } sub displayGame { open(FILE, "$gamesSkellFile"); @lines = ; close(FILE); $uid = $_[0]; @fields = &getFields; @entry = &getEntry($uid); # Modify each of the optional fields $index = &getFieldIndex("Other Admin Locations"); if ($entry[$index]) { $entry[$index] =<

Other Major
Administrative Locations:
$entry[$index] EndOfENTRY ; } $index = &getFieldIndex("Fax"); if ($entry[$index]) { $entry[$index] =<

Facsimile: $entry[$index]   EndOfENTRY ; } $index = &getFieldIndex("Email"); if ($entry[$index]) { $entry[$index] =<

Email: $entry[$index]   EndOfENTRY ; } $index = &getFieldIndex("website"); if ($entry[$index]) { $entry[$index] =<

Website: $entry[$index]   EndOfENTRY ; } if ($entry[9] || $entry[10] || $entry[11] || $entry[12] || $entry[13] || $entry[14] || $entry[15]) { if ($entry[13]) { $entry[13] = "Tel: $entry[13]
\n"; } if ($entry[14]) { $entry[14] = "Fax: $entry[14]
\n"; } if ($entry[15]) { $entry[15] = "Email: $entry[15]\n"; } $holders1 =< $entry[10]
$entry[11]
$entry[12]
$entry[13] $entry[14] $entry[15] EndOfENTRY ; } if ($entry[16] || $entry[17] || $entry[18] || $entry[19] || $entry[20] || $entry[21] || $entry[22]) { if ($entry[20]) { $entry[20] = "Tel: $entry[20]
\n"; } if ($entry[21]) { $entry[21] = "Fax: $entry[21]
\n"; } if ($entry[22]) { $entry[22] = "Email: $entry[22]\n"; } $holders2 =< $entry[16]
$entry[17]
$entry[18]
$entry[19]
$entry[20] $entry[21] $entry[22] EndOfENTRY ; } if ($entry[23] || $entry[24] || $entry[25] || $entry[26] || $entry[27] || $entry[28] || $entry[29]) { if ($entry[27]) { $entry[27] = "Tel: $entry[27]
\n"; } if ($entry[28]) { $entry[28] = "Fax: $entry[28]
\n"; } if ($entry[29]) { $entry[29] = "Email: $entry[29]\n"; } $holders3 =< $entry[23]
$entry[24]
$entry[25]
$entry[26]
$entry[27] $entry[28] $entry[29] EndOfENTRY ; } if ($entry[30] || $entry[31] || $entry[32] || $entry[33] || $entry[34] || $entry[35] || $entry[36]) { if ($entry[34]) { $entry[34] = "Tel: $entry[34]
\n"; } if ($entry[35]) { $entry[35] = "Fax: $entry[35]
\n"; } if ($entry[36]) { $entry[36] = "Email: $entry[36]\n"; } $contact =<

Corporate Contact: $entry[30]
$entry[31]
$entry[32]
$entry[33]
$entry[34] $entry[35] $entry[36] EndOfENTRY ; } foreach $line (@lines) { $x = 0; $line =~ s/\$Holders1/$holders1/g; $line =~ s/\$Holders2/$holders2/g; $line =~ s/\$Holders3/$holders3/g; $line =~ s/\$Contact/$contact/g; foreach $field (@fields) { $line =~ s/\$$field/$entry[$x]/g; $x++; } print "$line"; # $entries .= "$line"; } # open the indexSkellFile and display the index # open(FILE, "$indexSkellFile"); # @lines = ; # close(FILE); # foreach $line (@lines) { # $line =~ s/\$entries/$entries/; # print $line; # } } sub list { $script = $ENV{"SCRIPT_NAME"}; # foreach game entry get the link %db = &openDB; @uids = keys %db; foreach $id (@uids) { $name = &getEntryField($id, "Company Name", %db); $name =~ s/\'/\\\'/g; $entries .= "$name
\n"; } # open the indexSkellFile and display the index open(FILE, "$indexSkellFile"); @lines = ; close(FILE); foreach $line (@lines) { $line =~ s/\$entries/$entries/; print $line; } }