#!/usr/local/bin/perl # Where_is.pl by Carlos A. Pero # 10/14 hacked on by Ducky Sherwood # # Script to take in building abbreviation and room number, parse, locate # map file, and read in coordinates. # # Based upon CGI code: # Form-mail.pl, by Reuven M. Lerner (reuven"the-tech.mit.edu). # ------------------------------------------------------------ # Required files: # # where_is (gd binary) # ------------------------------------------------------------ # Set variables $BINDIR = "/var/info/www/httpd/cgi-bin"; $DOCROOT = "/var/info/www/docs"; $NAVROOT = "$DOCROOT/navigation"; $TMPDIR = "$NAVROOT/tmp"; $SHORTTMP = "/navigation/tmp"; $CAMPUSMAP = "north_campus"; $MAPDIR= "$NAVROOT/maps"; $GIFDIR = "$NAVROOT/floorplans"; $HTMLDIR = "$NAVROOT/floorplans"; $ISMAPDIR = "$NAVROOT/ismaps"; $PID = getppid; # Print out a content-type for HTTP/1.0 compatibility print "Content-type: text/html\n\n"; # Need to clean up old tmp files if (! opendir(TMP, $TMPDIR) ) { print "
"; if ($name eq "bldg") { $bldg = $value; } elsif ($name eq "room") { $room = $value; } } if (!$bldg) { print "Content-type: text/html\n\n"; print "
\n";
print "\n";
print "
\n";
print "Where am I on campus?
\n";
print "
Go to $longbldg{$bldg} main information page
\n";
print "Go to Campus Map
\n";
}
else {
# print a title and initial heading
# print "exec: $BINDIR/where_is.gd $MAPDIR/$FILENAME $TMPDIR/$PID $cx $cy $wh\n";
`$BINDIR/where_is.gd $MAPDIR/$FILENAME $TMPDIR/$PID $cx $cy $wh`;
print "
\n";
print "\n";
print "
\n";
}
print "Go to College of Engineering Home Page
\n";
print "Go to University of Illinois Home Page
\n";
print "
"; print "Surrounding text by\n"; print "ducky@uiuc.edu,\n"; print "maintained by\n"; print "ducky@uiuc.edu.\n"; # Hmmmmmmmmm these don't work... # unlink("$TMPDIR/$PID.gif"); # `sleep 100; rm $TMPDIR/$PID.gif &`; ############################################################################### # Arg - Big Dumb Kludgy-Hack until I can figure out how to include things over here ############################################################################### sub initBuilding { $longbldg{"edge"} = "The Void at the Edge of the Universe"; $longbldg{"ala"} = "Aero Lab A"; $longbldg{"astronomy"} = "Astronomy Building"; $longbldg{"beckman"} = "Beckman Institute"; $longbldg{"bfiedl"} = "Field - for EERL Replacement"; $longbldg{"ceram"} = "Ceramics Building"; $longbldg{"cerl"} = "Computer-Based Education Research Laboratory"; $longbldg{"csrl"} = "Computer and Systems Research Laboratory"; $longbldg{"dcl"} = "Digital Computer Laboratory"; $longbldg{"ehall"} = "Engineering Hall"; $longbldg{"equad"} = "Engineering Quadrangle"; $longbldg{"esb"} = "Engineering Systems Building"; $longbldg{"everitt"} = "Everitt Laboratory"; $longbldg{"grainger"} = "Grainger Library and Information Center"; $longbldg{"kenny"} = "Kenny Gymnasium"; $longbldg{"kenny-annex"} = "Kenny Gymnasium Annex"; $longbldg{"loomis"} = "Loomis Laboratory of Physics"; $longbldg{"meb"} = "Mechanical Engineering Building"; $longbldg{"mel"} = "Mechanical Engineering Laboratory"; $longbldg{"mmb"} = "Metallurgy and Mining Building"; $longbldg{"mrl"} = "Seitz Materials Research Laboratory"; $longbldg{"nel"} = "Nuclear Engineering Laboratory"; $longbldg{"newmark"} = "Newmark Civil Engineering Building"; $longbldg{"nrl"} = "Nuclear Radiation Laboratory"; $longbldg{"parking"} = "Springfield Parking Lot"; $longbldg{"phys1"} = "Physics House 1"; $longbldg{"phys2"} = "Physics House 2"; $longbldg{"talbot"} = "Talbot Laboratory"; $longbldg{"tb"} = "Transportation Building"; $longbldg{"tennis"} = "Tennis Courts"; $longbldg{"uni"} = "University High School"; $longbldg{"microel"} = "Microelectronics Laboratory"; $longbldg{"super"} = "Superconductivity Research Laboratory"; $longbldg{"warehouse"} = "Warehouse"; $longbldg{"wrighttrailers"} = "Wright Street Trailers"; $longbldg{"safety"} = "Public Safety"; $longbldg{"h2o"} = "Hydrosystems Laboratory"; $longbldg{"kiln"} = "Kiln House"; $longbldg{"union"} = "Illini Union"; } ############################################################################### # Write out the locator menu ############################################################################### sub writeLocatorMenu { print "