#!/usr/bin/perl5
$test_mode = "TRUE";
$test_mode = "FALSE";
$STYLE = "RACE";
$asknat = "hidden";
$AddTeamStuff = "Add My Team Below.";
$web_tags = '';
##############################################################################
# cigna signups
##############################################################################
require "/var/www/custom/cgi/FORMCODE.cgi" ;
require "/var/www/custom/cgi/formmisc.cgi" ;
require "/var/www/custom/cgi/errors.cgi" ;
require "/var/www/custom/cgi/CC_VER" ;
require "/var/www/custom/cgi/ChipCheck" ;
# Define Variables #
# Detailed Information Found In README File. #
$CAT = '/bin/cat' ;
$GREP = '/bin/grep' ;
$SORT = '/bin/sort' ;
$RACELIST ="/var/race/RACE_LIST" ;
$EVENTLIST ="/var/race/EventID" ;
$mailprog = '/usr/sbin/sendmail -i -t';
$mailprog1= '/usr/sbin/sendmail -i -t -fsignups@comfortinc.com';
$mailto = "signups\@comfortinc.com" ;
$memberfile = "/var/race/members/memberfile" ;
$PPfile = "/var/race/members/Pprofiles" ;
$TMFPos = 38; # Position of Fee in members file
$TMFControl = 57;
#@referers = ('www.comfortsignups.com','comfortinc.com','srnet.com');
@referers = ('*');
@recipients = &fill_recipients(@referers);
@valid_ENV = ('REMOTE_HOST','REMOTE_ADDR','REMOTE_USER','HTTP_USER_AGENT');
##############################################################################
$TableCount = 0;
@theLINE = split(/\//,$0);
for($i=0;$i<15;++$i){
$parting = $theLINE[$i];
if($parting eq ""){$scriptname = $theLINE[$i-1];$i=16;}
}
#$ENV{'QUERY_STRING'} = "2023";
if($ENV{'QUERY_STRING'}) {$scriptname .="?$ENV{'QUERY_STRING'}";}
$AddTeamStuff = " ";
#$AddTeamStuff = "";
$FORM1 = "/cgi-bin/$scriptname";
$FORM2 = "/signups/$scriptname";
$FORM2 = "/cgi-bin/$scriptname";
#require "/var/www/racedata/demo/demo/raceopts";
$formactionX = "http://www.comfortsignups.com$FORM1";
$incdir = "/var/www/racedata" ;
$customdir = "/var/www/custom" ;
$HTMLdir = "/var/www/signups/docs/html" ;
$HTMLdir = "/var/www/custom/html" ;
$CGIdir = "/var/www/signups/cgi-bin" ;
$TEAMNAMES ="/var/race/TEAMNAMES";
$TEAMNAMES ="/var/race/TeamNames";
$FlatAdd = 1 ;
$PercentAdd = 0.05 ;
$PercentMore = 0.00 ;
$TeamMemberAdd = $FlatAdd;
$TeamMemberAdd = .750 ;
$SeriesAdd = .750 ;
$Step = 1 ;
# Check Referring URL
&check_url;
# Retrieve Date
&get_date;
# Parse Form Contents
$AllUpper="TRUE";
&parse_form;
($Form{team_name},$Dummy) = split(/\, /,$Form{team_name});
($Form{CorporInd},$Dummy) = split(/\, /,$Form{CorporInd});
($Form{Teamcontrol},$Dummy) = split(/\, /,$Form{Teamcontrol});
$WaiverIsSigned = "NEED WAIVER";
if($Form{CorporInd} ne "CorpTeam"){$WaiverIsSigned = "WAIVER OK";}
#$WaiverIsSigned = "WAIVER OK";
$Form{chipcode} =~ s/ //g;
$Form{chipcode} =~ s/-//g;
$Form{chipcode} =~ tr [a-z] [A-Z] ;
$Form{NewTeamIs} =~ tr [a-z] [A-Z] ;
$Form{other_team_name} =~ tr [a-z] [A-Z];
(@Kids)=split(/\r\n/,$Form{KidsNames});
(@TeamMember)=split(/\r\n/,$Form{TeamMmbers});
(@Series)=split(/\, /,$Form{SeriesEvent});
foreach (@TeamMember){ ++$TotalTeam ;}
$TeamMemberCount = $Form{TeamMemberCount};
$Form{country} =~ tr [a-z] [A-Z] ;
$Form{address} =~ s/\'//g;
#&html_header("Computer Comfort Sign-ups","BGCOLOR=#FFFEEA");
# print " -$goodEvent - $Form{ProfileID}$Form{ProfilePassword} --";
&GetControlStuff;
$control = "$dtos-$ttos-$sdtos" ;
$Teamcontrol = "$dtos-$ttos" ;
$control =~ tr [a-z] [A-Z] ;
if($Form{credit_card_number} eq "PAPER-ENTRY") { $Form{PaperEntry} = "YES" ;}
if($Config{control} ne "") {$control = $Config{control};}
if($Form{Teamcontrol}ne "") {$Teamcontrol = $Form{Teamcontrol};}
#$control = $Config{control} ;
#print "$Teamcontrol = $Form{Teamcontrol}
" ;
#$Teamcontrol = $Form{Teamcontrol} ;
#if($Config{Action} = "continue" && ($Form{TeamLogin} ne "" && $Form{TeamPassword} ne"")){$Config{Action} = "EDIT TEAM INFO";}
$Action = $Config{Action};
$Step = "$Config{Step}$Config{step}";
##NOCC
# if ($Step == 3 && $Form{CoprorInd} eq "CorpTeam") {$Step = 4;}
if ($Step == 3 ) {$Step = 4;}
if($ENV{'QUERY_STRING'} >0) {$Form{Event}="$ENV{'QUERY_STRING'}";}
$Event = "$Form{Event}$Form{event}$Form{EVENT}";
$Event=2023;
$Form{Event}="cigna|Corporate";
$Event="cigna|Corporate";
#print "$Event -- $ENV{'QUERY_STRING'}";
&GetGoodEvent ;
if ($EventID ne "demo") {
#print "
2 $isNow - $EventStart - $EventOff";
if ($isNow < $EventStart) { ¬now("NotYet"); }
# if ($isNow > $EventStop) { ¬now("TooLate"); }
}
#print "
- 1 $dtos - $EventStart - $EventOff";
$optfile = "$incdir/$Event/raceopts" ;
$TeamFile = "$incdir/$Event/SpecialTeamList" ;
$PayPassFile = "$incdir/$Event/paypass.pw";
$PayPass = `$CAT $PayPassFile`;
#print "$optfile";
if (!-f "$optfile") { ¬now("Cannot Locate Options File"); }
&getraceopts("$optfile") ;
if( $Form{other_team_name} ne ""){
if ($AutoAddTeam ne "") {
open (OTN, ">>$TeamFile");
print OTN "$Form{other_team_name}\n";
close (OTN);
}
$Form{team_name} = $Form{other_team_name};
$Form{other_team_name} = "" ;
}
if($Form{ForcePrice} ne ""){$EventFee=$Form{ForcePrice} ;}
$ClyFyl =~ tr [a-z] [A-Z];
$STYLE =~ tr [a-z] [A-Z];
$ChipRace =~ tr [a-z] [A-Z];
if($ChipRace eq "CHECKED"){$ChipRace = "YES";}
$FreeShirt = "$tsizeC$tsizeS$tsizeM$tsizeL$tsizeXL$tsizesXXL" ;
$PProfile = "$Form{ProfileID}$Form{ProfilePassword}";
if ($PProfile && $STYLE ne "PAYMENT") {
$PProfile = "|$Form{ProfileID}|$Form{ProfilePassword}|";
$PPfile = "/var/race/members/PROFILES/$Form{ProfileID}-$Form{ProfilePassword}";
$PProfile = (`$GREP \"$PProfile\" $PPfile`);
if ($PProfile){
#print "
$PProfile
$PPfile";
($XX1,$XX2,$XX3,$lastname,$firstname,$address,$city,$state,$zip,$phone,$email,$gender,$DOBmonth,$DOBday,$DOByear,$ChipCode,$Country) = split (/\|/, $PProfile);
$isProfile = "YES";
}
}
if ($STYLE eq "PAYMENT" && $Step < 3) {
$ffg = crypt($Form{ProfilePassword},$Form{ProfileID});
#print "---$STYLE--- $Step $PProfile
$ffg $PayPass\n";
if($ffg ne $PayPass){$Form{Step} = $Step = 0;}
if ($Step > 0) {
$Config{required} = "ProfileID,ProfilePassword";
$ForcePrice = " Charge: \$";
}
}
if($Form{PaperEntry} eq "YES"){ $EventStop = "999999999999";}
if ($EventID ne "demo") {
#print "
2 $isNow - $EventStart - $EventOff";
if ($isNow < $EventStart) { ¬now("NotYet"); }
# if ($isNow > $EventStop) { ¬now("TooLate"); }
}
$EventDate = "$months[$EventMonth-1] $EventDay, $EventYear";
#if($AltFeeDate ne "" && length($AltFeeDate)==8){ $AltFeeDate .= "0000";}
#if($AltFeeDate ne "" && $isNow > $AltFeeDate){ $EventFee = $AltFee;}
if($Form{CorporInd} ne "CorpTeam"){$EventFee = $AltFee;}
if($Form{ForcePrice} ne ""){$EventFee=$Form{ForcePrice} ;}
$RACE = $EventName;
$FEE = $EventFee;
if ($Action eq "" ) { $Action = $Form{action}; }
if ($Event eq "" && $Action eq "") { ¬now("NoEvent") ; }
if ($Action eq "") { $Action = "CONTINUE"; $Step = 0 }
$Action =~ tr [a-z] [A-Z] ;
#print "a $Action -c $Config{Action}";
#&html_header("Computer Comfort Sign Ups
");
if($Action eq "ADD MY TEAM" ){require "/home/signups/www/cgi-bin/CignaTeam";}
if($Action ne "EDIT TEAM INFO") {
print "\n
$EventName
";
if ($EventID ne "demo" && $STYLE ne "PAYMENT") { print "$EventDate $EventStart"; }
}
if($Form{PaperEntry} eq "YES"){ print "
Paper Entry";}
print "
\n";
###BBB&Table_End;
###BBB&Table_Start("1");
$waiverfile = "$incdir/$Event/waiver.txt" ;
$Config{recipient} = $EventEmail;
if($Form{PaperEntry} eq "YES"){
$ForcePrice = "Event Fee: \$";
if($PaperFee ne "" && $PaperFee != $EventFee){ $EventFee = $PaperFee;}
$AskBib = "Event/Bib #:";
$AskAge = "Age On Race Day: ";
#$email = "$EventEmail";
#$email2 = "$EventEmail";
$Config{email2} = $Config{email} ;
if($FeeOverride eq "checked"){
$ForcePrice = "Event Fee: \$";
}else{
$SkipEmail = "";
$NoShirt = "";
}
}
# Check Required Fields
#print " - ST $Step -$Action ";
$EditTeam = `$CAT $incdir/$Event/TeamList/$Form{team_name}`;
# $EditTeam =~ tr [a-z] [A-Z];
($LongTeamName,$TeamIDNo,$TeamCaptain,$TeamPhone,$TeamPExt,$TeamFax,$TeamEmail,$TeamAddress,$TeamCSZ,$CompSize,$CompPart,$Filler01,$TeamPayInfo,$CaptLogin,$CaptPasswd,$TeamPasswd)=split(/\",\"/,$EditTeam);
$TeamName =~ s/\"//g;
$TeamPasswd =~ s/\"//g;
$TeamEmail =~ s/\"//g;
$TeamEmail =~ s/ //g;
$TeamName = $Form{team_name};
$LongTeamName =~ s/\"//g;
$LongTeamName =~ tr [a-z] [A-Z];
&more_required ;
if($Action eq "SEND LOGIN INFO" ){&SendPassword; $Action= "CONTINUE";$Step=0;}
if($Action eq "CONTINUE" && $Step == 24 ){&AddTeamToList;}
if($Action ne "DELETE SELECTED" ){&check_required;}
if($Action eq "EDIT TEAM INFO" ){require "/home/signups/www/cgi-bin/CignaTeam2";}
#print "$Config{required}";
$NextStep = $Config{NextStep} ;
#print "
$PProfile
$PPfile";
$PProfile = "$Form{ProfileID}$Form{ProfilePassword}";
if ($PProfile) {
$PProfile = "|$Form{ProfileID}|$Form{ProfilePassword}|";
## $PProfile = (`$GREP \"|$Form{ProfileID}|$Form{ProfilePassword}|\" $PPfile`);
$PProfile = (`$GREP \"$PProfile\" $PPfile`);
if ($PProfile){
($XX1,$XX2,$XX3,$lastname,$firstname,$address,$city,$state,$zip,$phone,$email,$gender,$DOBmonth,$DOBday,$DOByear,$ChipCode) = split (/\|/, $PProfile);
$isProfile = "YES";
}
}
$TYPE = "ON-LINE" ;
#$TYPE = "MAIL-IN" ;
if ($TYPE eq "ONLINE") { $TYPE = "ON-LINE"; }
if($Form{PaperEntry} eq "YES") {$TYPE="PAPER-ENTRY";$credit_card_number ="TESTING";}
if($Form{credit_card_number} eq "TESTING"){$TYPE = "MAIL-IN";}
if($Form{credit_card_number} eq "PAPER-ENTRY"){$TYPE = "MAIL-IN";}
#if(substr($Form{credit_card_number},0,3) eq "PO#") { $TYPE = "MAIL-IN"; }
#print " - $TYPE";
$CSVFILE = "$incdir/$Event/regfiles/$Config{control}";
if ($Action eq "DELETE SELECTED") { &DeleteSelected; }
if ($Action eq "ADD TEAM MEMBER") { &AddToTeamFile; }
#if ($Step == 5) { &DoStepFive; }
if ($Action eq "COMPLETE") {
&add_to_file;
# &mail_ack ;
exit ;
}
if ($Action eq "CONTINUE") {
if ($Form{PaperEntry} ne "YES") {$TheUrl = "s";}
if ($Step == 0) {&DoStepZero; }
if ($Step == 1 && $Form{CorporInd} eq "CorpTeam") {$Step = 2;}
if ($Step == 1) {&DoStepOne; }
if ($Step < 3 || $Step > 20) {&form_begin("form1","$FORM1");}
if ($Step == 3){
&form_begin("form1","http$TheUrl://www.comfortsignups.com/cgi-bin/$scriptname");
}
if ($Step == 4){&form_begin("form1","$FORM2"); }
if ($Step == 2) {
&Table_End;
if(-f "$incdir/$Event/TeamList.csv"){$TEAMNAMES.=" $incdir/$Event/TeamList.csv";}
print"";
$Country_List ='';
$Country_List ="";
$State_List ="";
#$State_List = '';
$State_List = '';
if(-f "/var/www/custom/html/State_list.html"){
$State_List = `$CAT /var/www/custom/html/State_list.html`;
if(-f "$incdir/$Event/state_list.txt"){@Add_States=` $CAT $incdir/$Event/state_list.txt`;}
foreach $newState (@Add_States) {
chomp($newState);
($st_opt,$st_desc) = split(/\=/,$newState);
$State_List .= ""
}
$State_List .= ""
}
$State_List ="
"; &Table_Start; $ChipRace =~ tr [a-z] [A-Z]; if($ChipRace eq "CHECKED"){$ChipRace = "YES";} $MODE1 = "DISPLAY"; # if($ChipRace eq "YES" ){&pr_chipinfo;} if ($ClyFyl eq "YES") { print "
Clydesdale/Filly ";
print "";
print "Check here only if you are male 190+ pounds ";
print "or female 140+ pounds.
\n";
}
&Table_End;
print "
$RACE\n" ; print "\$ "; print sprintf ("%5.2f",$FEE); print "
\n" ; &Table_Start; &pr_prices; if ($ForSale1){ require "/var/www/custom/cgi/forsaleitems"; &forsaleitems($optfile) ; } if ($Form{signup_type} ne "GROUP"){ # &ccgetinfo; print "\n"; }else{ print "\n"; } $require="lastname,firstname"; if($STYLE ne "PAYMENT"){ $require=$require.",gender,DOBmonth,DOBday,DOByear"; } # $require= $require.",city,state,zip,Phone,shirt_size"; $require= $require.",city,state,zip,email,email2,Phone,shirt_size"; $require= $require.",category"; if($AskCountry ne "") {$require = $require.",country";} ##### print "\n"; # if($Form{CorporInd} ne "CorpTeam"){ if($Form{CorporInd} eq "CorpTeam"){ if($Step == 23){ print "Check here"; print " to remember above the information as a "; print "Comfort Signup Profile.
"; } $CCFEE= $TOTAL; }else {&ShowTotals;} $Config{control} = $control; } if($Form{CorporInd} ne "CorpTeam") {&confirm;} $NEXT = ""; if ($Step == 4) {$NEXT="Finish";} if ($Step == 3) { $control = "$dtos-$ttos-$sdtos" ; $control =~ tr [a-z] [A-Z] ; print "\n"; print "PLEASE CHECK THE INFORMATION FOR ACCURACY"; print "| $racetitle1 | |
|---|---|
|
|