#!/usr/bin/perl -w use strict; use CGI qw(:standard); print header(), start_html(-title=>"Street Print CD Catalog", -background=>'/images/catalogbackground.jpg'); print "

"; if (param()) { chomp(my $color = param("color")); chomp(my $pattern = param("pattern")); chomp(my $cd_number = param("cdnumber")); chomp(my $highres = param("highres")); print p(h4('You searched for:'),br(), h5("Color : $color"), h5("Pattern : $pattern"), h5("Cd Number : $cd_number"), h5 ("Printable Images : $highres")); print ""; open (DBFILE, 'scfrom.db') or die "$!"; while (my $line = ) { chomp $line; my @record = split /\|/, $line, 7; for ($record[6]) { s/\r\n//; } ## $record[0] is name, 1 => color, 2 => pattern, 3 => cd, 4 => thumbnail picture, 5=> screen res picture, 6=> yes or no high res. if( $color eq "Any" || $record[1] =~ /^$color$/i and $pattern eq "Any" || $record[2] =~ /^$pattern$/i and $cd_number eq "Any" || $record[3] =~ /^$cd_number$/i and $highres eq "Any" || $record[6] =~ /^$highres$/i ) { print "\n"; next; } } close (DBFILE); print "

Name

Picture number
\& name

Color

Pattern

CD Number

Printable image on cd?

Thumbnail Image

**Click to enlarge**
$record[0]$record[1]$record[2]$record[3]$record[6]
"; } else { print start_form(); print p('What Color do you want? ', popup_menu('color', ['Any', 'Brick', 'Terracotta','Burnt Sienna','Hunter Green','Safety Blue','White', 'Bedrock','Slate','Sierra', 'Granite'])); print p('What Pattern do you want? ', popup_menu('pattern', ['Any', 'Offset Brick','Herringbone','Herr. Diagonal','Ashlar Slate','British Cobble','Frisco Cobble','Random Stone','Eurofan', 'Accent Circle'])); print p('What CD/Type of Photo do you want? ', popup_menu(-name=>'cdnumber', -default=>'Any', -values=>[qw(Any 1 2 3 4 5 6 7 8 9 10 11 12)], -labels=>{Any=>'Any CD', 1=>'CD1 : Municipal RoadWays', 2=>'CD2 : Municipal Crosswalks', 3=>'CD3 : Municipal Entrance Ways', 4=>'CD4 : Municipal Traffic Calming', 5=>'CD5: Municipal Walkways', 6=>'CD6 : Municipal Walkways', 7=>'CD7 : Residential Driveways', 8=>'CD8 : Residential Walkways', 9=>'CD9 : Residential Entrance Ways', 10=>'CD10 : Accents and Misc.', 11=>'CD11 : Commercial Business/Parking Lots', 12=>'CD12 : Commercial Entrance Ways'})); print p('Do you want high res printable images only? (Availible on the CDs)', popup_menu(-name=>'highres', -default=>'Any', -values=>[qw(Any Yes)], -labels=>{Any=>'All Images', Yes=>'Only with High res'})); print p(submit("Find"), reset("Reset")); print end_form; } print end_html;