#!/usr/bin/perl
use constant;
use strict;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
my $alumdbfile = "alumdb.csv";
my $collegedbfile = "collegedb.csv";
print <
Roncallialum.com - Alumni Search Results
HTML
open(DBFILE, $alumdbfile) or die "The file $alumdbfile could not be found.\n";
open(COLFILE, $collegedbfile) or die "The file $collegedbfile could not be found.\n";
my ($_fname, $_lname, $_school, $_major, $_year);
$_fname = param ('_fname');
$_lname = param ('_lname');
$_school = param ('_school');
$_major = param ('_major');
$_year = param ('_year');
print <
Search Results: |
HTML
my $totalmatch = 0;
my $firsttime = 1;
while()
{
# remove the top record, which is header info
if ($firsttime == 1)
{
$firsttime = 0;
next;
}
my $record = $_;
my ($lname, $fname, $school, $major, $year, $email);
# split record against tab characters
($lname, $fname, $school, $major, $year, $email) = split(/\t/, $record);
my $searchcount = 0;
my $searchfound = 0;
if ($_fname ne "")
{
$searchcount++;
if (lc($fname) =~ lc($_fname)) { $searchfound++; }
}
if ($_lname ne "")
{
$searchcount++;
if (lc($lname) =~ lc($_lname)) { $searchfound++; }
}
if ($_school ne "")
{
$searchcount++;
if (lc($school) =~ lc($_school)) { $searchfound++; }
}
if ($_major ne "")
{
$searchcount++;
if (lc($major) =~ lc($_major)) { $searchfound++; }
}
if ($_year ne "")
{
$searchcount++;
if (($year) =~ ($_year))
{
$searchfound++;
}
}
if($searchcount == 0)
{
# exit loop, nothing in search boxes
print "| Please fill in one or more fields | ";
last;
}
if($searchfound == $searchcount)
{
$totalmatch++;
my ($city, $state, $colwebaddr);
seek(COLFILE, 0, 0);
while()
{
my $colrecord = $_;
if( lc($colrecord) =~ lc($school) )
{
my $temp;
($temp, $city, $state, $colwebaddr) = split(/\t/, $colrecord);
last;
}
}
print <$lname, $fname - $year
| | $school | $city | $year |
| $major | $state | $email |
HTML
}
}
print qq(
Matches found: $totalmatch
[ Home | Alumni Search | Boards | FAQs | Links | Geeks ]
This alumni search includes technology that was designed, developed, and implemented by Michael J. Matczynski and Zingtech (www.zingtech.com).
Database content created and updated with the help of Matthew Wolff.
Any modification without prior written consent of Zingtech is strictly prohibited.
(C) 2001 Michael J. Matczynski);
print end_html();
print qq();