#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
print header(),
start_html(-title=>"Street Print CD Catalog", -background=>'/images/catalogbackground.jpg');
if (param()) {
chomp(my $highres = param("highres"));
print "
NamePicture number \& name |
Color |
Pattern |
CD Number |
Printable image on cd? |
Thumbnail Image**Click to enlarge** |
";
open (DBFILE, 'scfrom.db') or die "$!";
while (my $line = ) {
chomp $line;
my @record = split /\|/, $line, 7;
$record[6] =~ tr/\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 "
| $record[0] |
$record[1] |
$record[2] |
$record[3] |
$record[6] |
 |
\n";
next;
}
}
close (DBFILE);
print "
";
} else {
print start_form();
##choose color
##choose pattern
##choose CD
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;