#!/usr/local/bin/perl print"Content-type: text/html\n\n"; # need this line for all browsers require 'ctime.pl'; $time = &ctime(time); chop($time); $time=~s/ / /g; # print"time=$time
\n"; $time=~s/ US\/Pacific//; require "cgi-lib.pl"; &ReadParse; # this is below # print"in==>
$in
\n"; $name=$in{'name'}; @name=split(/, /,$name); $first=$name[1]; $last=$name[0]; if($first eq ""){$first=" ";} if($last eq ""){$last=" ";} $residence=$in{'residence'}; $year=$in{'year'}; $work=$in{'work'}; if($year eq ""){$year=" ";} if($residence eq ""){$residence=" ";} if($name eq ""){$name=" ";} if($work eq ""){$work=" ";} if($name eq " " && $residence eq " " && $year eq " " && $work eq " "){ &header1; goto end; } if($year ne "" || $residence ne "" || $year ne "" || $work ne ""){ $cntmatches=$cntwin=$cntloss=$cnttie=0; open(FILE,'data/alumni.txt'); while(){ chomp; $_=~s/"//g; next if($_=~/^#/); @a=split(/\t/,$_); $yx=$a[0]; for $x(0..$#a){ $a[$x]=" $a[$x]"; } # print"$a[0]/$year - $a[2]/$opposing - $a[4]/$outcome - $a[7]/$coach
\n"; if($a[0]=~/$first/i && $a[1]=~/$last/i && $a[4]=~/$year/i && $a[3]=~/$residence/i && $a[9]=~/$work/i){ ++$cntmatches; } # end if } # end while $rec="$cntwin-$cntloss-$cnttie"; &header2; goto start; } start: $cnt=$cntmatches=0; open(FILE,'data/alumni.txt'); while(){ chomp; $_=~s/"//g; next if($_=~/^#/); @a=split(/\t/,$_); for $x(0..$#a){ $a[$x]=" $a[$x]"; } # print"$a[0]/$year - $a[2]/$opposing - $a[4]/$outcome - $a[7]/$coach
\n"; if($a[0]=~/$first/ && $a[1]=~/$last/ && $a[3]=~/$residence/i && $a[4]=~/$year/i && $a[9]=~/$work/i){ # if($_=~/$year\t/ && $_=~/$opposing\t/i && $_=~/$outcome\t/i && $_=~/$coach\t/i){ ++$cntmatches; print"\n"; $firstx=$a[0]; $lastx=$a[1]; $firstx=~s/^ //; $lastx=~s/^ //; print" $a[1], $a[0] $a[3] $a[4] $a[9] \n"; print"\n"; ++$cnt; } # end if } # end while if($cntmatches==0){ print" Oops!
No Matches Found for Above Search Term(s)
Go 'BACK' and try again.\n"; } &header3; sub search_general{ &header1; $cnt=0; open(FILE,'data/alumni.txt'); while(){ chomp; $_=~s/"//g; next if($_=~/^#/); @a=split(/\t/,$_); $a[6]=~s/\//-/g; $a[6]=~s/0//g; if($_=~/$text/i){ print"\n"; for $x(0..$#a){ print"$a[$x]\n"; } print"\n"; ++$cnt; } # end if $_=/$text/ } # end while } # end sub search_general sub header1{ print" Staples Soccer > Alumni Search
Alumni Advanced Search
Pick from one or more boxes.
Name Residence Graduation Year Field of Work
\n"; print" \n"; print" \n"; print" \n"; print"
©2001 Staples High School. All Rights Reserved. - Phone 203.341.0054 - Email info\@staplessoccer.com - Site by dogsname.com

\n"; } # end sub header1 sub header2{ print" Staples Soccer > Alumni Search
\n"; } # end sub header2 sub header3{ print"
Alumni Advanced Search Results
\n"; if($name ne " "){$s="$s Name=$name, ";} if($residence ne " "){$s="$s Residence=$residence, ";} if($year ne " "){$s="$s Year=$year, ";} if($work ne " "){$s="$s Work=$work, ";} $s=~s/, $//; $matches="Matches"; if($cntmatches==1){$matches="Match";} $record=""; if($cntmatches>0){ } # end if >0 print" $s
Found $cntmatches $matches $record
Name Residence Graduation Year Field of Work
Alumni Advanced Search Again
©2001 Staples High School. All Rights Reserved. - Phone 203.341.0054 - Email info\@staplessoccer.com - Site by dogsname.com

\n"; } # end sub header3 end: 1;