#!/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"; $search=$in{'search'}; $text=$in{'text'}; if($search eq "general"){&search_general;goto end;} $year1=$in{'year1'}; $year2=$in{'year2'}; if($year1 eq ""){$year1="1958";} if($year2 eq ""){$year2="1962";} &header1; print" Name E-Mail Current Residence Field of Work Graduation Year \n"; $cnt=$cntmatch=0; open(FILE,'data/alumni.txt'); while(){ chomp; next if($_=~/^#/); $_=~s/"//g; @a=split(/\t/,$_); $a[0]=~s/^ //g;$a[0]=~s/ $//g; $a[1]=~s/^ //g;$a[1]=~s/ $//g; $rec[$cnt]="$a[4] $a[1] :: $_"; ++$cnt; } # end while # sort by year @rec=sort @rec; for $x(0..$#rec){ @a=split(/ :: /,$rec[$x]); $rec[$x]=$a[1]; } $cnt=$cntmatch=0; for $x(0..$#rec){ next if($_=~/^#/); @a=split(/\t/,$rec[$x]); # print"a[4]=$a[4]
\n"; # $a[6]=~s/\//-/g;$a[6]=~s/0//g; if($a[4]>=$year1 && $a[4]<=$year2){++$cntmatch;goto start;} else{ next; } start: $name="$a[1], $a[0]"; $email=$a[2]; $residence=$a[3]; $yeargrad=$a[4]; $work=$a[9]; if($name eq ""){$name="   ";} if($email eq ""){$email="   ";} if($residence eq ""){$residence="   ";} if($yeargrad eq ""){$yeargrad="   ";} if($work eq ""){$work="   ";} print" $name $email $residence $work $yeargrad \n"; ++$cnt; } # end while if($cntmatch==0){ print" Oops!
No Alumni Listings Found for Years $year1-$year2
Coming Soon! \n"; } ## try to get year correctly print" [ \n"; $x=1958; here1: $y=$x; $z=$x+4; $endlink=""; if($z<2012){ $link=""; if($year1 eq $x && $year2 eq $z){$link="";$endlink="";} if($z!=1987 && $z!=1992){print"$link$y-$z$endlink |\n";} if($z==1987){print"$link$y-$z$endlink ]
\n";} if($z==1992){print"[ $link$y-$z$endlink |\n";} } if($z==2012){ $link="
"; if($year1 eq $x && $year2 eq $z){$link="";$endlink="";} $z=2012; print"$link$y-$z$endlink ]\n"; } $x=$z+1; if($x<2012){ goto here1; } print"\n"; &header2; sub search_general{ # print"in search general\n";goto end; &header1; print" Name E-Mail Current Residence Field of Work Graduation Year \n"; $cnt=$cntmatch=0; open(FILE,'data/alumni.txt'); while(){ chomp; $_=~s/"//g; next if($_=~/^#/); @a=split(/\t/,$_); $a[0]=~s/^ //g;$a[0]=~s/ $//g; $a[1]=~s/^ //g;$a[1]=~s/ $//g; if($_=~/$text/i){ $rec[$cnt]="$a[4] $a[1] :: $_"; ++$cnt; ++$cntmatch; } } # end while @rec=sort @rec; for $x(0..$#rec){ @a=split(/ :: /,$rec[$x]); $rec[$x]=$a[1]; } for $x(0..$#rec){ @a=split(/\t/,$rec[$x]); $a[0]=~s/^ //g;$a[0]=~s/ $//g; $a[1]=~s/^ //g;$a[1]=~s/ $//g; # print"a0='$a[0]' a1='$a[1]'
\n"; $name="$a[1], $a[0]"; $email=$a[2]; $residence=$a[3]; $yeargrad=$a[4]; $work=$a[9]; if($name eq ""){$name="   ";} if($email eq ""){$email="   ";} if($residence eq ""){$residence="   ";} if($yeargrad eq ""){$yeargrad="   ";} if($work eq ""){$work="   ";} print"
$name $email $residence $work $yeargrad \n"; ++$cnt; } # end for $x if($cntmatch==0){ print" No Alumni Listings Found for Search Term $textx \n"; } ## try to get year correctly print" [ zzzzz \n"; $x=1958; here1: $y=$x; $z=$x+4; $endlink=""; if($z<2012){ $link=""; if($year1 eq $x && $year2 eq $z){$link="";$endlink="";} if($z!=1987 && $z!=1992){print"$link$y-$z$endlink |\n";} if($z==1987){print"$link$y-$z$endlink ]
\n";} if($z==1992){print"[ $link$y-$z$endlink |\n";} } if($z==2012){ $link="
"; if($year1 eq $x && $year2 eq $z){$link="";$endlink="";} $z=2012; print"$link$y-$z$endlink ]\n"; } $x=$z+1; if($x<2012){ goto here1; } print"\n"; &header2; } # end sub search_general sub header1{ print" Staples Soccer > Stats
\n"; ## try to get year correctly print" \n"; } # end sub header1 sub header2{ print"

| SEARCH

| ADVANCED SEARCH
| ADD PROFILE | EDIT PROFILE
\n"; $textx=$text; $textx=~tr/a-z/A-Z/; if($year1 eq "" && $year2 eq ""){ print" Search Term $textx
\n"; } print" [ \n"; $x=1958; here1: $y=$x; $z=$x+4; $endlink=""; if($z<2012){ $link=""; if($year1 eq $x && $year2 eq $z){$link="";$endlink="";} if($z!=1987 && $z!=1992){print"$link$y-$z$endlink |\n";} if($z==1987){print"$link$y-$z$endlink ]
\n";} if($z==1992){print"[ $link$y-$z$endlink |\n";} } if($z==2012){ $link="
"; if($year1 eq $x && $year2 eq $z){$link="";$endlink="";} $z=2012; print"$link$y-$z$endlink ]\n"; } $x=$z+1; if($x<2012){ goto here1; } print"
©2001 Staples High School. All Rights Reserved. - Phone 203.341.0054 - Email info\@staplessoccer.com - Site by dogsname.com

\n"; } # end sub header2 end; 1;