#!/usr/bin/perl $digmasterbasedirectory = "../"; $figdir = $digmasterbasedirectory; use CGI qw(:cgi-lib); do ReadParse(); print "Content-type: text/html\n\n"; print "Museum Search Engine\n"; print "\n"; $tempk= $in{keyword}; $tempd = $in{db}; ($thedatabase = $tempd) =~ tr/A-Z/a-z/; ($thekeyword = $tempk) =~ tr/A-Z/a-z/; $database = $digmasterbasedirectory . "museum.tab"; $linewidth = 300; $figdir = "../"; $altdir = $figdir . "jpgs"; $virtual = "../"; open (DBF , $database) || die "Can't open $database: $!\n"; print "Museum Keyword Search\n"; print "\n"; print "\n"; print < Cobb Virtual Museum Figurine Index

EOT print "

Cobb Museum Keyword Search for \"$in{keyword}\"

\n"; print "

Searching $thedatabase ...

\n"; print "
\n"; ##################################################################################### # Search Database and find matches print "
\n"; print "\n"; SEARCH: while () { ($collection,$object,$short,$date,$height,$width,$depth,$notes,$type,$diameter) = split(/\t/); $dig =~ tr/A-Z/a-z/; ($tempshort = $short) =~ tr/A-Z/a-z/; ($tempdesc = $type) =~ tr/A-Z/a-z/; if ($tempdesc =~ $thekeyword || $tempshort =~ $thekeyword && $thekeyword ne '') { print "\t\n"; print "\n"; ############################################################################# # Now print text info in new table column print "\n"; # print "\n"; print "\t\n"; print "\t\n"; print "\n"; $found = 1; } } print "
"; print "\n"; if (-e "$figdir/icons/$collection-$object.gif") { print "\n"; } ############################################################################## # Put in icons to show data available print "\n"; if ($short ne "") { print "\"\"\n"; } if (-e "$figdir/jpgs/$collection-$object.jpg") { print "\"\"\n"; } if (-e "$figdir/movs/$collection-$object.mov" || -e "$figdir/movs/$collection-$object-full.mov") { print "
\"\"\n"; } print "
\n"; print "Collection: $collection
\n"; print "\n"; print "Object: $object \n"; print "

\n"; print "$short\n"; print "

"; # print "$desc\n"; # print "
\n"; # print "\n"; print "\t
\n"; print "
\n"; ###################################################################################### # If there was no match in the database... ###################################################################################### if ($found == 0) { print "
Sorry, the keyword $thekeyword did not match any descriptions in the database.\n"; print <
Keyword to search for:

EOT } ###################################################################################### # Finish the page if something WAS found... ###################################################################################### else { print "

\n"; print <

Keyword to search for:

Enter another keyword to search for.

EOF }