#!/usr/bin/perl $test_mode = "TRUE"; $test_mode = "FALSE"; $STYLE = "RACE"; $asknat = "hidden"; ############################################################################## # singmeup ############################################################################## 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" ; #@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;} } if($ENV{'QUERY_STRING'}) {$scriptname .="?$ENV{'QUERY_STRING'}";} $FORM1 = "/signup/$scriptname"; $FORM1 = "/cgi-bin/$scriptname"; $FORM2 = "/cgi-bin/$scriptname"; #require "/var/www/racedata/demo/demo/raceopts"; $formactionX = "http://www.comfortsignups.com$FORM1"; $incdir = "/var/www/racedata" ; $incdir = "/home/signups/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 = .50 ; $Step = 1 ; $AskForChip ="YES"; $Trust_Logo = "YES"; # Check Referring URL &check_url; # Retrieve Date &get_date; # Parse Form Contents $AllUpper="TRUE"; &parse_form; if($Form{Event} == 2023 || $Form{Event} eq 'cigna|Corporate'){ print "Location: http://www.comfortsignups.com/cgi-bin/cigna \n\n"; exit; } #if($Form{Event} == 2023 || $Form{Event} eq 'cigna|Corporate'){require "cigna";exit;} #$WaiverIsSigned = "NEED WAIVER"; #if( $Form{agreement} ne ""){$WaiverIsSigned = "WAIVER OK";} $Form{other_team_name} =~ tr [a-z] [A-Z]; (@Kids)=split(/\r\n/,$Form{KidsNames}); (@TeamMember)=split(/\r\n/,$Form{TeamMembers}); (@Series)=split(/\, /,$Form{SeriesEvent}); foreach (@TeamMember){ ++$TotalTeam ;} $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} --"; $sdlname = $Form{lastname}; $sdfname = $Form{firstname}; $sdfname =~ s/ //g; $sdfname =~ s/\.//g; $sdfname =~ s/\'//g; $sdlname =~ s/ //g; $sdlname =~ s/\.//g; $sdlname =~ s/\'//g; $sdtos = substr($sdlname,0,1); $sdtos .= substr($sdlname,length($sdlname)-1,1); $sdtos .= substr($sdfname,0,1); $control = "$dtos-$ttos-$sdtos" ; $control =~ tr [a-z] [A-Z] ; if($Form{credit_card_number} eq "PAPER-ENTRY") { $Form{PaperEntry} = "YES" ;} if($Config{control} eq "") {$Config{control} = $control;} $Action = $Config{Action}; $Step = "$Config{Step}$Config{step}"; if($ENV{'QUERY_STRING'} >0) {$Form{Event}="$ENV{'QUERY_STRING'}";} $Event = "$Form{Event}$Form{event}$Form{EVENT}"; #print "$Event -- $ENV{'QUERY_STRING'}"; if ($Event eq "") { ¬now("NoEvent"); } $goodEvent = (`$GREP \"|$Event|\" $EVENTLIST`); if ($goodEvent) { chop $goodEvent; ($fil1,$IDnum,$IDp1,$IDp2) = split(/\|/,$goodEvent); if($Event == $IDnum) {$Event = "$IDp1|$IDp2" ;} # $goodEvent = substr($goodEvent,1); # $Event = substr($goodEvent,index($goodEvent,"|")+1); } $goodEvent = (`$GREP \"$Event|\" $RACELIST`); if (!$goodEvent) { ¬now("NoEvent") ; } ($CompanyID,$EventID,$EventName,$EventTown,$EventState,$EventDTOS,$EventContact,$EventxEmail,$EventPhone,$EventOn,$TimeOn,$EventOff,$TimeOff,$filler1,$filler2,$SeriesID) =split(/\|/, $goodEvent); $goodEvent = (`$GREP \"$CompanyID|\" $memberfile | $GREP \"|ACTIVE|\"`); if (!$goodEvent) { ¬now("NoEvent") ; } ($XX1,$CompanyID,$XX3,$XX4,$CompanyContact,$CompanyPhone,$EventEmail,$CompanyName,$CompanyAddress1,$CompanyAddress2,$CompanyAddress3,$filler1,$filler2,$COSTATUS,$SeriesIDx) =split(/\|/, $goodEvent); #&html_header("$EventName"); #print "$dtos - $EventOn - $EventOff"; #$TimeOff="2400"; $EventStart = "$EventOn$TimeOn"; $EventStop = "$EventOff$TimeOff"; $EventStart = "$EventOn"."0000"; $EventStop = "$EventOff"."2400"; $isNow = "$dtos".substr($ttos,0,4); $Event =~ s/\|/\//g ; #$incdir .= "$Event" ; if ("$Form{lastname}" eq "BOULTON" && "$Form{firstname}" eq "BENN") { &html_header ; print "$CompanyID --- $EventID --
"; # print "$goodEvent"; &return_html ; } if ($ENV{REMOTE_ADDR} eq "216.107.209.01"){ $EventStart=20000000;$EventStop=999999999999;} if (index($ENV{QUERY_STRING},"TestMode=YES" || $Form{PaperEntry} eq "YES")>0){ $EventStart=20000000;$EventStop=999999999999;} if($Form{PaperEntry} eq "YES"){ $EventStop = "999999999999";} if (index($ENV{QUERY_STRING},"TestMode=YES")>0){ }else{ #print "Registration Services are Temporary Unavailable.\n"; #print "
We expect to return service by 8:00 am Saturday (7-11-2009)\n"; #print "
We are sory for any inconvenience.\n"; #exit; } $Reg_Start = $EventStart; $Reg_Stop = $EventStop; $Reg_Count = `$GREP -c "-" $incdir/$Event/REGDATA.csv`; $optfile = "$incdir/$Event/raceopts" ; $TeamFile = "$incdir/$Event/SpecialTeamList" ; $PayPassFile = "$incdir/$Event/paypass.pw"; $PayPass = `$CAT $PayPassFile`; chomp $PayPass; if (!-f "$optfile") { ¬now("Cannot Locate Options File"); } #require "$optfile"; &getraceopts("$optfile") ; if($MaxReg > 0 && $Reg_Count >= $MaxReg && $Form{PaperEntry} ne "YES"){¬now("This Event Is Full");} if($Form{category} ne ""){ ($CatName,$CatCode,$CatBib,$CatTeamSize,$CatFee,$CGchangedate,$CGnewfee)= split(/\|/,$Form{category}); $EventFee = $CatFee; $AltFee = $CGnewfee; $AltFeeDate = $CGchangedate; ($EventTempName)= split(/\(/,$CatName); $EventName = "$EventName $EventTempName"; } 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} ;} $ChipRace =~ tr [a-z] [A-Z]; if($ChipRace eq "CHECKED"){$ChipRace = "YES";} $ClyFyl =~ tr [a-z] [A-Z]; $STYLE =~ tr [a-z] [A-Z]; $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
$PayPass - $ffg - \n"; if($ffg ne $PayPass){$Form{Step} = $Step = 0;} #print " $Step "; if ($Step > 0) { #print " ok "; $Config{required} = "ProfileID,ProfilePassword"; $ForcePrice = " Charge: \$"; } } # if ($Form{lastname} eq "BOULTON" && $Form{firstname} eq "BENN") { $isNow = "200304040800";} if($Form{PaperEntry} eq "YES"){ $EventStop = "999999999999";} if ($EventID ne "demo") { if ($isNow < $Reg_Start) { ¬now("NotYet"); } if ($isNow > $Reg_Stop) { ¬now("TooLate"); } } #print "$isNow -- $EventStart "; $EventDate = "$months[$EventMonth-1] $EventDay, $EventYear"; if($AltFeeDate ne "" && length($AltFeeDate)==8){ $AltFeeDate .= "0000";} if($AltFeeDate ne "" && $isNow > $AltFeeDate){ $EventFee = $AltFee;} if($Form{ForcePrice} ne ""){$EventFee=$Form{ForcePrice} ;} $RACE = $EventName; $FEE = $EventFee; if ($Action eq "" ) { $Action = $Form{action}; } $Action =~ tr [a-z] [A-Z] ; if ($Event eq "" && $Action eq "") { ¬now("NoEvent") ; } if ($Action eq "") { $Action = "CONTINUE"; $Step = 0 } &html_header("Computer Comfort Sign Ups"); print "
$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 &more_required ; &check_required; $NextStep = $Config{NextStep} ; #print "
$PProfile
$PPfile"; $PProfile = "$Form{ProfileID}$Form{ProfilePassword}"; if ($PProfile) { $PProfile = "|$Form{ProfileID}|$Form{ProfilePassword}|"; # $Form{ProfileID} =~ tr [a-z] [A-Z] ; # $Form{ProfilePassword} =~ tr [a-z] [A-Z] ; ## $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" ; 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";} $CSVFILE = "$incdir/$Event/regfiles/$Config{control}"; if ($Step == 5) { if ($TYPE eq "ON-LINE") { if($Form{credit_card_number} eq "TESTING"){ $Form{TestMode} = "YES"; $test_mode ="TRUE"; }else { &CC_Verify; $last4 = "XXXX-XXXX-XXXX-".substr($cardnumber,length($cardnumber)-4,4) ; } } # else {$FEE = $MAILINFEE; } $Responce_Code = 0 ; if($Form{credit_card_number} eq "TESTING") {$Responce_Code = 1;} if($Form{PaperEntry} eq "YES") {$Responce_Code = 1;} ## removed @()'s from here foreach (@Series){(@SerEV)=split(/\|/,$_);$TOTAL = $TOTAL +$SerEV[2]; } foreach (@Kids){$TOTAL = $TOTAL +$funrunfee; } #foreach (@TeamMember){print "$_ 1"; $TOTAL = $TOTAL +$FEE +$TeamMemberAdd; ++$FlatAdd; } $CCFEE = $FEE+$TOTAL+$ServiceCharge; $CCFEE = $ONLINEFEE+$TOTAL+$OnLineCharge ; $CCFEE = $Form{CCFEE} ; if ($Form{lastname} eq "BENN BOULTON" && $Form{firstname} eq "BENN BOULTON") { $CCFEE = "1.00" ; } #$Form{firstname} = $RunnerFirst; #$Form{lastname} = $RunnerLast; if($Form{TestMode} ne "YES" && $test_mode eq "FALSE") { print "
$TYPE - $test_modeProcessing Please Wait

\n"; &New_Table; require "/var/www/custom/cgi/authnet.pl"; $email_notice = "FALSE"; $email_notice = "TRUE"; if (-f $CSVFILE) { $Responce_Code = 1; $Responce_Text = "Transaction Processed";} else { if ($test_mode eq "FALSE" && $TYPE eq "ON-LINE") {;&process_trans;} } print "$Responce_Text
\n"; } if($Responce_Code != 1 || $test_mode eq "FAIL") { $Action = "CONTINUE"; $NEXT = ""; $Step = 4; &error("$Responce_Text

Card Declined
Click your Browser's BACK button
and make sure the information is correct
or use a different credit card.") ; } } if ($Action eq "CONTINUE") { $Form{chipcode} =~ s/ //g; $Form{chipcode} =~ s/-//g; $Form{chipcode} =~ tr [a-z] [A-Z] ; if ($Step == 0) { &form_begin("form1","$FORM1"); if($STYLE eq "PAYMENT" && $NoPaymentPassword ne "YES"){ print "Enter Your Payment ID and Password
"; }else{ # if($CompanyID eq "cigna"){&AskSigningUp;} print "If you have a Comfort Signups
"; print "participant profile enter information
"; } print "ID: "; &FORM_input("text","ProfileID","",10); print "Password: "; &FORM_input("password","ProfilePassword","",10); if($STYLE ne "PAYMENT"){ # print "
NOTE: Due to error, all profiles saved before"; # print "
April 13th 2007, were lost. Sorry!
"; print "

"; print "If you DO NOT have a profile, you can save one
"; print "at the end of the registration process.
"; } &form_end("1") ; &html_footer; exit; } } if ($Action eq "COMPLETE") { &add_to_file; # &mail_ack ; exit ; } if ($Action eq "CONTINUE") { if ($Step == 1) { if ($isProfile) { print "Welcome back $firstname $lastname
\n"; } &help_script; &form_begin("form1","$FORM1"); &get_waiver_ok; # $CorpSignup ="checked"; # if($SeriesID ne "") { &ShowSeries ;} if($CorpSignup eq "checked") { &AskSigningUp; } &form_end($Step+1); &html_footer; } if ($Step == 2) { &Table_End; &form_begin("form1","$FORM1"); if ($Form{signup_type} eq "GROUP") { $Group = "YES" ; print ""; } &FORM_input("hidden","PaperEntry","$Form{PaperEntry}"); if ($isProfile) {print ""; } if($Form{CorporInd} eq "CorpTeam"){ print"Please Enter Company Contact/Captian Information\n"; print "

Company Name\n";
    print "Team Name   
\n"; if(-f "$incdir/$Event/TeamList.csv"){$TEAMNAMES.=" $incdir/$Event/TeamList.csv";} # if($CompanyID eq "cigna"){$TEAMNAMES.=" $incdir/Corporate/TeamList.csv";} &teamnames; $CorpBypassOn = ""; } print""; if($Form{CorporInd} eq "CorpTeam"){ print"Team Contact Information\n"; } $Country_List =''; $Country_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 ="
"; if ($STYLE eq "TICKETS" || $STYLE eq "CONCERT"){ $CorpBypassOn = ""; } if ($STYLE ne "PAYMENT"){ print &getTemplate('/var/www/custom/html/racereg.html'); print &getTemplate('/var/www/custom/html/racereg2.html'); print &getTemplate('/var/www/custom/html/racereg3.html'); } else { print &getTemplate('/var/www/custom/html/payments.html'); } print ''; if($SeriesID ne "") { &ShowSeries ;} # if($WaveStart ne "") { $EvCatCnt = 0; # foreach (`$CAT $incdir/$Event/category.txt`) { # if($EvCatCnt == 0){ # print "Please Select Your Event Category
\n"; # print "";} foreach (`$CAT $incdir/$Event/category.txt`) { if($EvCatCnt == 0){ print "\n"; print "\n"; $EvCatCnt = 1; } chop $_; ($CatName,$CatCode,$CatBib,$CatTeamSize,$CatFee,$CGchangedate,$CGnewfee)= split(/\|/,$_); if($CGchangedate ne "" && length($CGchangedate)==8){ $CGchangedate .= "0000";} if($CGchangedate ne "" && $isNow > $CGchangedate){ $CatFee = $CGnewfee;} ($CatName,$CatExtra)= split(/\(/,$CatName); if($CatExtra ne '') {$CatExtra = "($CatExtra";} print ""; print "\n"; print "\n"; } if($EvCatCnt == 1){print "
"; print "Please Select Your Event Category
\n"; print "
\n"; print "$CatName $CatExtra \$$CatFee\n
";} &Free_Shirt; &ExtraItems; if($Form{CorporInd} eq "CorpTeam"){&CorpSignup;} &Table_Start; if($funrun eq "checked" && $Form{CorporInd} ne "CorpTeam"){ $funRunDisplay = "Kids Fun Run: "; if($funRunTitle ne "") {$funRunDisplay = "$funRunTitle";} if($funrunage ne "") {$funRunDisplay = "$funRunDisplay Ages: $funrunage ";} if($funrunfee ne "") {$funRunDisplay = "$funRunDisplay Fee: \$$funrunfee each";} print "

$funRunDisplay

"; $funRunMessage = `$CAT $incdir/$Event/raceopts-frmessage`; chomp $funRunMessage ; if($funRunMessage ne ""){ $funRunMessage =~ s/\n/\\n/g; print "$funRunMessage"; }else{ print "I would also like to signup the following family members.
\n"; print " I am the Parent or Legal Gardian of the names listed
\n"; print " and I agree to the same conditions of the wavier for these people.
\n"; } print "

Please enter
LAST NAME,FIRST NAME,AGE(on Race Day),GENDER(M or F)"; if ($FreeShirt) {print ",Shirt Size(as listed above)"; } print " seperated by commas:

\n"; print "(Example: Smith,Tom,6,M"; if ($FreeShirt) {print ",Small"; } print ")
\n"; if ($EventID eq "demo" || $RACE eq "DEMO RACE EVENT") { print "\n"; if ($FreeShirt) {print "\n";} print "\n\n"; print ""; print ""; print ""; print ""; if ($FreeShirt) { print ""; } print "
Last NameFirst NameAge
(Event Day)
GenderShirt Size
M "; print "F
\n"; } print "
\n"; print "Please enter one name on each line.\n"; #print ""; ###&Table_End; } print "

"; &Table_Start; $ChipRace =~ tr [a-z] [A-Z]; if($ChipRace eq "CHECKED"){$ChipRace = "YES";} $MODE1 = "DISPLAY"; if($ChipRace eq "YES" && $Form{CorporInd} ne "CorpTeam"){&pr_chipinfo;} if ($ClyFyl eq "YES") { print "

Clydesdale/Filly "; print "Check here only if you are male 190+ pounds or female 140+ pounds.
\n"; } if($UseTeams eq "checked" && $Form{CorporInd} ne "CorpTeam"){ &teamnames; } if ($Form{signup_type} eq "BYPASS"){ open (ST2,"/$incdir/$Event/bypassoptions.htm"); while () { print $_ ; } close (ST2); } #print "\n"; # print ""; # print sprintf("\$%9.2f ",$EventFee ); # print ""; &Table_End; if($EvCatCnt == 0){ if($STYLE eq "TICKETS"){$rpalign="center";}else{$rpalign="left";} print "

$RACE\n" ; if($FEE > 0){ print "\$ "; print sprintf ("%5.2f",$FEE); } print "

\n" ; } &Table_Start; &pr_prices; $FSIStop= ""; if ($ForSale1 ne "" or $FSIStop ne ""){ 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" && $STYLE ne "TICKETS"){$require=$require.",gender,DOBmonth,DOBday,DOByear";} $require= $require.",city,state,zip,email,email2,Phone,shirt_size"; if(-s "$incdir/$Event/category.txt") {$require= $require.",category";} if($AskCountry ne "") {$require = $require.",country";} print "\n"; &form_end($Step+1); &html_footer; } if ($Step > 2) { &calcage; $MODE1 = "DISPLAY"; &Step3A ; if ($Step == 4) { &form_begin("form1","$FORM2"); if (!$Form{isProfile} && $Form{PaperEntry} ne "YES" && $STYLE ne "PAYMENT") { print "

Check here to"; print " remember above the information as a "; print "Comfort Signup Profile.

"; } if($TYPE eq "ON-LINE") { &ccgetinfo; } }else{ if ($Form{PaperEntry} ne "YES") {$TheUrl = "s";} &form_begin("form1","http$TheUrl://www.comfortsignups.com/cgi-bin/$scriptname"); } &confirm; # &pr_form_fields; $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
\n"; print "Click the browser BACK BUTTON to go back and make any corrections
\n"; } $require="lastname,firstname"; if($STYLE ne "PAYMENT" && $STYLE ne "TICKETS"){$require=$require.",gender,DOBmonth,DOBday,DOByear";} $require= $require.",city,state,zip,email,email2,Phone,shirt_size"; if($AskCountry ne "") {$require = $require.",country";} # $require="lastname,firstname,gender,DOBmonth,DOBday,DOByear,city,state,zip,email,email2,Phone,shirt_size"; $sdlname = $Form{lastname}; $sdfname = $Form{firstname}; $sdfname =~ s/ //g; $sdfname =~ s/\.//g; $sdlname =~ s/ //g; $sdlname =~ s/\.//g; $sdtos = substr($sdlname,0,1); $sdtos .= substr($sdlname,length($sdlname)-1,1); $sdtos .= substr($sdfname,0,1); # $sdtos .= substr($dtos,6); $control = "$dtos-$ttos-$sdtos" ; $control =~ tr [a-z] [A-Z] ; # print ""; &form_end($Step+1,"$NEXT"); } } if ($Action eq "FINISH") { if ($Step == 5) { # $TYPE="ON-LINE"; # &FORMinput("hidden","RaceDayAge","0"); $FEE = $ONLINEFEE; $FEE = $EventFee; if ($Form{team_name} eq "NONE") { $Form{team-name} == "" ;} if ($Form{Group} eq "YES" || $Form{Group} eq "ON") { $Group = "YES"; $FEE = $MAILINFEE; $TYPE="MAIL-IN"; } # if ($TYPE eq "ON-LINE") { # &CC_Verify; # $last4 = "XXXX-XXXX-XXXX-".substr($cardnumber,length($cardnumber)-4,4) ; # }else {$FEE = $MAILINFEE; } &calcage; $MODE1 = "DISPLAY"; &Step3A ; if ($Form{lastname} eq "BOULTON" && $Form{firstname} eq "BENN") { print "$Form{EventID}
--"; &return_html ; } &html_footer; # if ($TYPE eq "ON-LINE") { &ccgetinfo; } # if ($TYPE eq "MAIL-IN") { $Step = 4; } if ($Adjustment eq "INCLUDED") { if($Address_VCode eq "Y"){ $PercentMore = 0;} $TeamMemberAdd = 0; $DiVisor = $PercentAdd+$PercentMore ; $ServiceCharge = int($TOTAL * $DiVisor * 100)/100 + $FlatAdd ; if ($CompanyID eq "prponh" && $ServiceCharge == 2.05){ # $ServiceCharge = 2.00 ; } if ($TotalTeam > 1) { $ServiceCharge = int($TOTAL*$DiVisor * 100)/100 + ($FlatAdd*$TotalTeam) ; } if($ServiceCharge < $MinServiceCharge) {$ServiceCharge = $MinServiceCharge;} $FEE = $TOTAL - $ServiceCharge ; $FEE =~ s/ //g; $TOTAL = $FEE ; $FEE = sprintf("%9.2f",$FEE ) ; } $CSVFILE = "$incdir/$Event/regfiles/$Config{control}"; if (-f "$CSVFILE") { }else { $RunnerFirst = $Form{firstname}; $RunnerLast = $Form{lastname}; if($SeriesAdd > 0) { $X_Event = $Event; # (@Series)=split(/\, /,$Form{SeriesEvent}); foreach (@Series){ (@SerEV)=split(/\|/,$_);$Event = "$SerEV[0]/$SerEV[1]"; $TOTAL = $SerEV[2]; $RACE = $SerEV[3]; if ($SerEV[4] eq "ADD"){ $ServiceCharge = (($TOTAL +$FlatAdd) * $PercentAdd)+$FlatAdd ; }else{ $DiVisor = $PercentAdd+$PercentMore ; $ServiceCharge = int($TOTAL * $DiVisor * 100)/100 + $FlatAdd ; } if($ServiceCharge < $MinServiceCharge) {$ServiceCharge = $MinServiceCharge;} if($TYPE eq "ON-LINE"){&make_ccdata ;&add_to_cc_file ; } if ($CompanyID eq 'nedin'){ print " Ta ";} &do_file_stuff; } $TOTAL = $EventFee; } if($TYPE eq "ON-LINE"){&make_ccdata ;&add_to_cc_file ; } if($TotalTeam > 0) { $X_TOTAL = $TOTAL ; $X_SERVICECHARGE = $ServiceCharge; $T_COMPANY = $Form{CompanyName} ; $T_ADDRESS = $Form{address} ; $T_CSZ = "$Form{city} $Form{state} $Form{zip}" ; $T_CONTACT = "$Form{firstname} $Form{lastname}"; $T_EMAIL = $Config{email} ; $T_PHONE = "$Phone $Form{phone2}" ; foreach (@TeamMember){ if ($Adjustment eq "INCLUDED") { $TOTAL = $FEE; $FlatAdd = $TeamMemberAdd; if($Address_VCode eq "Y"){ $PercentMore = 0;} $DiVisor = $PercentAdd+$PercentMore ; $ServiceCharge = int($TOTAL * $DiVisor * 100)/100 + $FlatAdd ; $FEE = $TOTAL - $ServiceCharge ; $FEE =~ s/ //g; $TOTAL = $FEE ; $FEE = sprintf("%9.2f",$FEE ) ; }else { $TOTAL= $EventFee; $ServiceCharge = (($TOTAL +$TeamMemberAdd) * $PercentAdd)+$TeamMemberAdd ; # $TOTAL = $TOTAL - $ServiceCharge ; } (@tmemberinfo) = split(/\^/,$_); $Form{firstname}=$tmemberinfo[0]; $Form{lastname}=$tmemberinfo[1]; $Form{gender}=$tmemberinfo[2]; $Form{RaceDayAge} = $tmemberinfo[3]; $Form{city}=$tmemberinfo[4]; $Form{state}=$tmemberinfo[5]; $Form{shirt_size}=$tmemberinfo[6]; $Form{Chipcode}= $tmemberinfo[7]; #$Form{team_name} .= $Form{CompanyTeam}; $Form{zip}= ""; if ($CompanyID eq 'nedin'){ print " Tb ";} &do_file_stuff; } }else{ if ($CompanyID eq 'nedin'){ print " Tc ";} &do_file_stuff; } #if($Form{PaperEntry} eq "YES"){ print "";exit;} &send_ack; if ($Form{Save_Me} eq "SAVE_ME") { &SaveMe; } # &do_alert; } } } exit ; sub do_file_stuff { if ($CompanyID eq 'nedin'){ print " T1 ";} &make_filedata; if ($CompanyID eq 'nedin'){ print " T3 ";} &add_to_file; if ($CompanyID eq 'nedin'){ print " T2 ";} &save_data; if ($CompanyID eq 'nedin'){ print " T4 ";} } sub form_begin { local($formname,$formaction) = @_; print "
\n"; #print "\n"; } sub form_end { $NextStep = $_[0]; $Caption = $_[1]; if ($Caption eq "") {$Caption = "Continue";} if ($NextStep == 0){ $NextStep= $Step +1 ; } if ($Caption eq "Finish"){ $CCFEE =sprintf ("%9.2f",$TOTAL+$ServiceCharge); print "PLEASE CHECK THE INFORMATION FOR ACCURACY
\n"; print "
click your back button to go back and make changes"; print "

"; print "Check here if everything is ok."; print "

"; print "Total Cost = \$"; print "$CCFEE"; $require .= ",OK CheckBox"; print "\n" ; } print "\n" ; # print "\n"; print "\n"; print "\n"; if ($NextStep == 2){ &FORM_input("hidden","ProfileID","$Form{ProfileID}"); &FORM_input("hidden","ProfilePassword","$Form{ProfilePassword}"); } print "

\n"; if ($Caption eq "Finish") { print "CLICK FINISH ONLY ONCE
"; } print "
\n"; } sub parse_form { # Define the configuration associative array. # %Config = ('recipient','', 'subject','', 'email','', 'realname','', 'redirect','', 'Step','', 'background','', 'control','', 'vlink_color','', 'NextStep','', 'alink_color','', 'title','', 'sort','', 'print_config','', 'required','', 'env_report','', 'return_link_title','', 'return_link_url','', 'print_blank_fields','', 'missing_fields_redirect','', 'Action','', 'ContactEmail','', 'email2','', 'XontactEmail',''); # print " METHOD = $ENV{'REQUEST_METHOD'}" ; if ($ENV{'REQUEST_METHOD'} eq 'GET') { # Split the name-value pairs @pairs = split(/&/, $ENV{'QUERY_STRING'}); } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); $buffer .= "&RaceDayAge=0"; # Split the name-value pairs @pairs = split(/&/, $buffer); } else { # &Login ; &error('request_method'); } # For each name-value pair: # foreach $pair (@pairs) { # Split the pair up into individual variables. # local($name, $value) = split(/=/, $pair); # Decode the form encoding on the name and value variables. # # v1.92: remove null bytes # $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $name =~ tr/\0//d; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/\0//d; # $value =~ s/\,//g; # If the field name has been specified in the %Config array, it will # # return a 1 for defined($Config{$name}}) and we should associate # # this value with the appropriate configuration variable. If this # # is not a configuration form field, put it into the associative # # array %Form, appending the value with a ', ' if there is already a # # value present. We also save the order of the form fields in the # # @Field_Order array so we can use this order for the generic sort. # if (defined($Config{$name})) { $Config{$name} = $value; } else { if ($Form{$name} ne '') { $Form{$name} = "$Form{$name}, $value"; } else { push(@Field_Order,$name); if($name eq "TeamMembers"){ $value =~ tr [a-z] [A-Z] ; $value =~ s/\,/^/g;} if($name ne "KidsNames"){ $value =~ s/\,/ /g; } # $value =~ tr [a-z] [A-Z] ; $Form{$name} = $value; } } } # The next six lines remove any extra spaces or new lines from the # # configuration variables, which may have been caused if your editor # # wraps lines after a certain length or if you used spaces between field # # names or environment variables. # $Config{'required'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g; $Config{'required'} =~ s/(\s+)?\n+(\s+)?//g; $Config{'env_report'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g; $Config{'env_report'} =~ s/(\s+)?\n+(\s+)?//g; $Config{'print_config'} =~ s/(\s+|\n)?,(\s+|\n)?/,/g; $Config{'print_config'} =~ s/(\s+)?\n+(\s+)?//g; # Split the configuration variables into individual field names. # @Env_Report = split(/,/,$Config{'env_report'}); @Print_Config = split(/,/,$Config{'print_config'}); # ACCESS CONTROL FIX: Only allow ENV variables in @valid_ENV in # # @Env_Report for security reasons. # foreach $env_item (@Env_Report) { foreach $valid_item (@valid_ENV) { if ( $env_item eq $valid_item ) { push(@temp_array, $env_item) } } } @Env_Report = @temp_array; } sub check_required { # Localize the variables used in this subroutine. # local($require, @error); # The following insures that there were no newlines in any fields which # # will be used in the header. # @Required = split(/,/,$Config{'required'}); if ($Config{'subject'} =~ /(\n|\r)/m || $Config{'email'} =~ /(\n|\r)/m || $Config{'realname'} =~ /(\n|\r)/m || $Config{'recipient'} =~ /(\n|\r)/m) { &error('invalid_headers'); } if (!$Config{'recipient'}) { if (!defined(%Form)) { &error('bad_referer') } else { &error('no_recipient') } } else { # This block of code requires that the recipient address end with # # a valid domain or e-mail address as defined in @recipients. # $valid_recipient = 0; foreach $send_to (split(/,/,$Config{'recipient'})) { foreach $recipient (@recipients) { if ($send_to =~ /$recipient$/i) { push(@send_to,$send_to); last; } } } if ($send_to < 0) { &error('no_recipient') } $Config{'recipient'} = join(',',@send_to); } # For each require field defined in the form: # foreach $require (@Required) { if ($require eq 'cardemail' && !&check_email($Form{$require})) { push(@error,$require); } # If the required field is the email field, the syntax of the email # # address if checked to make sure it passes a valid syntax. # if ($require eq 'email' && !&check_email($Config{$require})) { push(@error,$require); } # Otherwise, if the required field is a configuration field and it # # has no value or has been filled in with a space, send an error. # elsif (defined($Config{$require})) { if ($Config{$require} eq '') { push(@error,$require); } } # If it is a regular form field which has not been filled in or # # filled in with a space, flag it as an error field. # elsif (!defined($Form{$require}) || $Form{$require} eq '') { push(@error,$require); } } # If any error fields have been found, send error message to the user. # if (@error) { &error('missing_fields', @error) } } sub notnow { # Localize variables and assign subroutine input. # local($error,@error_fields) = @_; &html_header; &error_header; if ($error eq 'NotYet') { $error = " Sorry
$EventName
Registrations Are Not Activated Yet."; $error .= "
Please come back after "; if($TimeOn >1159) { $error .= substr($TimeOn,0,2) -12; }else{ $error .= substr($TimeOn,0,2); } $error .= ":".substr($TimeOn,2,2); if($TimeOn <1159) {$error .= "am";}else{$error .= "pm";} $error .= " on "; $error .= substr($EventOn,4,2)."/"; $error .= substr($EventOn,6,2)."/"; $error .= substr($EventOn,0,4); } if ($error eq 'TooLate') { $error = " Sorry
$EventName
Online Registrations Are CLOSED.
"; if($RaceDayReg eq "YES"){ $error="$error You can still register on race day at the event.";} if($CloseLink ne ""){ $error="$error
More Information";} } if ($error eq 'NoEvent') { $error = " NOT a valid Event."; } print "$error"; &error_footer; print "$isNow - $EventStart - $EventStop"; exit; } sub error_header { &html_header("","bgcolor=#FFFFFF text=#000000"); print <<"(END ERROR HTML)";
$racetitle1
(END ERROR HTML) } sub error_footer{ print <<"(END ERROR HTML)";
Customized Forms by Benn Boulton of Computer comfort Inc.
(END ERROR HTML) } sub register { } sub get_type { #$TYPE = $Form{racetype}; ($RACE,$XYPE,$FEE1,$FEE2) = split(/\|/,$Form{racetype}); $FEE = $FEE1 ; if ($tmon == $RACEmonth && $year == $RACEyear && $mday >= $FEE2day && $FEE == $FEE1){ $FEE=$FEE2; } } sub calcage { if($Form{AskAge} ne ""){ $Form{DOByear} = $EventYear - $Form{AskAge}; $Form{DOBmonth} = "-"; $Form{DOBday} = "-"; } $wrk = $EventYear - $Form{DOByear}; if ($Form{DOBmonth} > $EventMonth ) { $wrk = $wrk -1; } if ($Form{DOBmonth} == $EventMonth && $Form{DOBday} > $EventDay) { $wrk = $wrk -1; } $Form{RaceDayAge} = $wrk ; if($wrk < $MinAge){&error('Invalid Entry',"Invalid Entry, You Must be $MinAge To Participat."); } } sub more_required { #print "$Form{CorporInd} 12335"; if($Form{CorporInd} eq "CorpTeam"){ $Form{gender}=$Form{DOBmonth}=$Form{DOBday}=$Form{DOByear}= "xxxx";} &calcage; if (length($Form{DOByear}) > 0 && length($Form{DOByear}) < 4) { $Config{required} .= "DOB YEAR must be 4 digits"; } if (length($Form{chipcode}) > 0 ) { &CheckChip("$Form{chipcode}"); if($errcode != 0){ $Config{required} .= ",Chip Code: - $strChip - is not a valid chip Code. "; # &error("- $strChip - is not a valid chip Code. "); } } if ($Step == 5 && $Form{PaperEntry} ne "YES") { if ($Form{useabove} eq "YES") { $Form{cardfirstname} =$Form{firstname} ; $Form{cardlastname} = $Form{lastname} ; $Form{cardaddress} = $Form{address} ; $Form{cardcity} = $Form{city} ; $Form{cardstate} = $Form{state} ; $Form{cardzip} = $Form{zip} ; $Form{cardemail} = $Config{email} ; }else { $Config{'required'} .= ",cardfirstname,cardlastname" ; $Config{'required'} .= ",cardaddress,cardcity" ; $Config{'required'} .= ",cardstate,cardzip" ; $Config{'required'} .= ",cardemail" ; } if($Form{credit_card_number} eq "TESTING") { $Form{credit_card_type} = "VISA"; $Form{card_expire_month} = "12"; $Form{card_expire_year} = $year; $Form{ccvcode} = "123"; $Form{TestMode} = "YES"; $test_mode = "TRUE"; $Responce_Code = 1 ; # $dtos="TESTING"; $ttos="TESTING"; $Config{control}="TESTING"; } $Config{'required'} .= ",credit_card_type,credit_card_number,card_expire_month,card_expire_year"; if($STYLE ne "PAYMENT"){$Config{'required'} .=",ccvcode";} if(length($Form{card_expire_month}) == 1){ $Form{card_expire_month} = "0".$Form{card_expire_month}; } } if ($Form{teammember} eq "YES") { $Config{'required'} .= ",team_name" ; } if ($Form{team_name} eq "" && $Form{teammember} eq "YES") { $Form{team_name} = "Other" ; } if ($Form{team_name} eq "Other") { $Config{'required'} .= ",other_team_name" ; }else{ } #if($Form{Group}) { $Config{required} .= GroupName,GroupPasswd";} if($Form{lastname} eq "BENN" && $Form{firstname} eq "BOULTON") { $Config{required} = "email" ; } if($Config{email} ne $Config{email2}) { $Config{required} = "E-mail: The two email entries do NOT match";} if($Step == 3 && $STYLE eq "TICKETS" && $Form{ForSale1} + $Form{ForSale2} + $Form{ForSale3} + $Form{ForSale4} + $Form{ForSale5} + $Form{ForSale6} + $Form{ForSale7} + $Form{ForSale8} + $Form{ForSale9} + $Form{ForSale10} == 0 ) { $Config{required} .= ",Pleas Select Items To Purchase.";} if (substr($Config{required},0,1) eq ",") { $Config{required} = substr($Config{required},1); } } sub Step3A { $RACE = $racetitle1 = $EventName; $Phone = "$Form{Phone}"; $TOTAL = $FEE; if ($Action eq "FINISH" && $EventID ne "demo") { if($BarCodeIt eq "YES"){ print "
"; } } print "
\n" ; if ($Action eq "FINISH"){print "PLEASE PRINT THIS PAGE FOR YOUR RECORDS
"; } print "
\n"; if ($Action eq "FINISH" && $EventID ne "demo") { #print ""; print "$Config{control} \n" ; } print "$Form{GroupName}"; print "
\n"; print "
\n" ; if($Form{CorporInd} eq "CorpTeam"){ print"Team Contact Information
\n"; print "COMPANY $Form{CompanyName}
"; print " TEAM $Form{TeamName}"; } print "
"; print "\n"; print "\n"; print "
" ; print "" ; print "
" ;
print "    NAME: $Form{lastname}, $Form{firstname} $Form{initial}\n" ;
print " ADDRESS: $Form{address}\n" ;
print "          $Form{city},  $Form{state}  $Form{zip}\n" ;
#print  "\n";
print " COUNTRY: $Form{country}\n"; 
print " PHONE #: $Phone\n" ;
print "
\n"; if ($STYLE eq "RACE" && $Form{CorporInd} ne "CorpTeam") { print "
" ;
if($Form{EventIDNum} ne ""){print " NUM: $Form{EventIDNum}\n" ;}
print "      $Form{nationality}\n";
print "      $Form{gender}";
print " AGE: $Form{RaceDayAge}\n" ;
print "      (on race day)\n" ;
print " DOB: $Form{DOBmonth}\/$Form{DOBday}\/$Form{DOByear}\n";

if($ChipRace eq "YES" && $AskForChip eq "YES"){
print "CHIP: $Form{chipcode}";
if ($Form{chipcode} eq "" ) { print "NONE" ; }
}
print "\n";
}
print "
"; print "" ; print "
   EMAIL: $Config{email}\n
" ;
print "" ;
print "
"; #print "$Form{category}\n"; #print "\n$CatName\n"; print "\n"; if ($STYLE eq "RACE" && $Form{shirt_size} ne "none") { print "Shirt Size: $Form{shirt_size}
\n"; } print "
\n"; print "
" ;
#print "" ;
#print "(If you own your own Champion-Chip and plan to use it at the race, put the code in the spaces below.)\n" ;
print "" ;
&ExtraItems;
if ($Form{clyfil}) {
  print " I am a ";
  if ($Form{gender} eq "MALE" ) { print "Clydesdale - man 190"; 
    }else {print "Filly - women 140";}
  print " pounds or above.
\n"; } if ($UseTeams eq "checked") { print "Team Name "; print ""; print "$Form{team_name} $Form{other_team_name}" ; if ($Form{team_name} eq "") { print "NONE" ; } print "
"; } if ($Form{KidsNames} ne ""){ # print "
Kids Fun Run \n"; print "
Additional Signups \n"; # (@Kids)=split(/\r\n/,$Form{KidsNames}); $TotalKids = 0; foreach (@Kids){print sprintf("%-30s %5.2f
\n",$_,$funrunfee); ++$TotalKids;} #print sprintf("Total Additional Fees \$%5.2f
\n",$funrunfee*$TotalKids); } if ($Form{TeamMembers} ne ""){ $TotalTeam = 0; print "
Team Members \n"; print "\n"; if ($FreeShirt) {print ""; } if($ChipRace eq "YES"){ print "";} print " "; # (@TeamMember)=split(/\r\n/,$Form{TeamMembers}); foreach (@TeamMember){ ++$TotalTeam ; (@tmemberinfo) = split(/\^/,$_); print ""; print "\n"; print "\n"; print "\n"; print "\n"; if ($FreeShirt) {print ""; } if($ChipRace eq "YES"){ print "";} print ""; sprintf("%-50s %5.2f
\n",$tmemberinfo[0],$FEE); } print "
Name(first and last)GenderAgeTown/StateShirtChip
$tmemberinfo[0] $tmemberinfo[1]$tmemberinfo[2]$tmemberinfo[3]$tmemberinfo[4], $tmemberinfo[5]$tmemberinfo[6]$tmemberinfo[7]
\n"; if($TotalTeam < $MinTeamSize){ &error('missing_fields',"You must have at least $MinTeamSize members."); } } print "
"; print ""; print "
\n" ; $tbpalign=''; if($STYLE eq "TICKETS"){ print "
$RACE

\n" ; $tbpalign='align=right'; } print "\n" ; if($STYLE ne "TICKETS"){ print "\n" ; print "\n" ; } if ($TotalTeam > 0) {print "\n"; print "",$TotalTeam*($FEE+0)); $TOTAL = 0; $TOTAL = $TOTAL + ($TotalTeam*($FEE+0)); $FEE = $TOTAL; } if ($TotalKids > 0) {print "\n"; print "",$TotalKids*$funrunfee); $TOTAL = $TOTAL + ($TotalKids*$funrunfee); $FEE = $TOTAL; } #(@Series)=split(/\, /,$Form{SeriesEvent}); foreach (@Series){ (@SerEV)=split(/\|/,$_); $TOTAL = $TOTAL +$SerEV[2]; $SeriesAdd = $SeriesAdd +1; print "\n"; print ""; } if ($ServiceCharge > 0 ) { print ""; } } #if ($Form{firstname} eq "BENNY"){print "-ADJ- $Adjustment SC $ServiceCharge";} #if ($TOTAL+$ServiceCharge > $FEE){ print ""; # if ($Action eq "FINISH" && $BarCodeIt eq "YES") { # print ""; # } # } $XTYPE = $TYPE ; print "
$RACE\n" ; print " "; if($TotalTeam == 0 && $FEE > 0){print sprintf ("\$%5.2f",$FEE);} print "
Team Members Fees ($TotalTeam)"; print sprintf("%7.2f
Total Additional Fees"; print sprintf("%7.2f
$SerEV[3]"; print sprintf ("\$%5.2f",$SerEV[2]); } &ForSaleItems; if ($TYPE eq "ON-LINE") { $ServiceCharge = 0 ; $Adjustment =~ tr [a-z] [A-Z] ; if ($Adjustment eq "ADD"){ $Add1 =$FlatAdd +$SeriesAdd; if ($TotalTeam > 0) {$Add1 =($TotalTeam)*($TeamMemberAdd/1) ;} $ServiceCharge = (($TOTAL +$Add1) * $PercentAdd)+$Add1 ; if ($CompanyID eq "prponh" && $ServiceCharge == 2.05){ # $ServiceCharge = 2.00 ; } if($ServiceCharge < $MinServiceCharge) {$ServiceCharge = $MinServiceCharge;} } if ($TOTAL > $FEE){ print "
SUB TOTAL:\$"; print sprintf ("%9.2f",$TOTAL); print "
Service Charge:\$"; print sprintf ("%9.2f",$ServiceCharge); print "
TOTAL DUE:\$"; print sprintf ("%9.2f",$TOTAL+$ServiceCharge); print "
"; # print "


"; # print "

\n" ; if ($TYPE eq "ON-LINE" && $Action eq "FINISH") { print "

"; print "\n" ; print " Card: $Form{ccType} $last4 "; print "\n" ; print "Expire: $cardexpire "; print "
Your Credit Card statement will show a charge from
"; print "Computer Comfort Signups"; print " or Event/Race Signups"; print "
"; } print "
\n" ; if ($TYPE eq "MAIL-IN" && $Step == 4) { &checkto ; } if ($MODE1 eq "DISPLAY" && $TYPE eq "MAIL-IN" && $Step == 3) { &waiverok ; &signature ; } print "" ; #print "\n"; if ($Action eq "FINISH"){ if($CompanyID eq "cigna"){ print "

I wish to support the Elliot with a donation.


"; } &show_waiver; if($BarCodeIt eq "YES"){ # print "

"; } print "

PLEASE PRINT THIS PAGE FOR YOUR RECORDS
"; if($STYLE eq "PAYMENT"){ print " Again
"; print "

"; print ""; print ""; print ""; print ""; print "
"; } } } sub print_file(file_name){ open (FE,"$incdir/$Event/$filename") ; while () { print "$_"; } close (FE) ; } sub ExtraItems { $Ex_match = "_"."$S_match"; #print "1 $Ex_match
"; if($S_match == 0){$Ex_match = "";} foreach $exitm (`$GREP "Extra[1-9]=" $optfile`){ ($xtr,$edata) =split(/\=/,$exitm); ($etype,$etext,$evalue,$extra) = split(/\|/,$edata); if ($$xtra ne ""){ if ($etype eq "text"){print "$etsxt ";} print ""; print "--$$xtr
"; print "$exitm"; } } if($Extra01 ne "") { ($etype,$evalue,$esize,$eextra2)= split(/\|/,$Extra1); if($Form{other_1} eq "" && $Step == 2) { print " $evalue"; } if($Form{other_1} ne "" && $Step > 2) { print "
$evalue


";} } print "\n"; if (1 == 2) { if($Extra1 ne "") { ($etype,$evalue,$esize,$eextra)= split(/\|/,$Extra1); $esize = $esize +1; if($Form{other_1} eq "" && $Step == 2) { if($etype eq "text"){print "$evalue ";} print ""; if($etype eq "checkbox"){print " $evalue";} print " $eextra \n"; } if($Form{other_1} ne "" && $Step > 2) { print "
"; if ($etype eq "text") { print "$evalue "; } print "$Form{other_1}


"; } print "
"; } if($Extra2 ne "") { ($etype,$evalue,$esize,$eextra)= split(/\|/,$Extra2); $esize = $esize +1; if($Form{other_2} eq "" && $Step == 2) { print "
\n"; if($etype eq "text"){print "$evalue ";} print ""; print " $eextra "; } if($Form{other_2} ne "" && $Step > 2) { print "
"; if ($etype eq "text") {print "$evalue ";} print "$Form{other_2}


"; } print "
"; } } #1==2 if($Extra1 ne "") {&ExtraItems2("other_1",$Extra1);} if($Extra2 ne "") {&ExtraItems2("other_2",$Extra2);} if($Extra3 ne "") {&ExtraItems2("other_3",$Extra3);} if($Extra4 ne "") {&ExtraItems2("other_4",$Extra4);} } # end of sub ExtraItems sub ExtraItems2 { $ThisVal = $_[0]; $ExtraData = $_[1]; ($etype,$evalue,$esize,$eextra)= split(/\|/,$_[1]); $esize = $esize +1; if($Form{$_[0]} eq "" && $Step == 2) { print "
"; if ($etype eq "text" || $etype eq "checkbox"){ if($etype eq "text"){print "$evalue ";} print ""; if($etype eq "checkbox"){print "$evalue";} print " $eextra "; } else{ print "$ExtraData
"; } } if($Form{$_[0]} ne "" && $Step > 2) { print "
"; if ($etype eq "text") {print "$evalue ";} print "$Form{$_[0]}


"; } # print "
\n"; } # end of sub ExtraItems2 sub ForSaleItems { $ForSaleTotal = 0 ; # for ($i=1;$i<=$FORSALEITEMS;$i++){ for ($i=1;$i<=10;$i++){ $x = "ForSale$i" ; if ($Form{$x}) {&additem("$Form{$x}","ForSale$i"); } } } sub additem { $qty = $_[0]; $itemx =$_[1]; $ITEM = `$GREP $itemx $optfile` ; $ITEM = "$$itemx" ; ($ctrl,$itm,$price) = split (/\|/,$ITEM); # $price = $_[2]; # print "$ForSale1 $qty, $itm, $price -
"; $itmtotal = $price*$qty; $TOTAL = $TOTAL + $itmtotal; $ForSaleTotal = $ForSaleTotal + $itmtotal; if($STYLE eq "TICKETS"){$fntAdj='+0';}else{$fntAdj='-1'} print "$qty - $itm "; print "\$ "; print sprintf("%5.2f",$price*$qty); print ""; } sub checkto { print "
Please make checks payable to: $checkto
" ; if ($XTYPE eq "RACE DAY") { print "
Please bring this form to sign up at the event
"; } else { print "Send check and signed form to:
$sendto
"; } print "
\n" ; } sub get_waiver_ok { if (-s "$waiverfile"){ &show_waiver ; print "

\n"; print " I agree to conditions of waiver."; print "
"; $require = "agreement"; } } sub show_waiver { print ""; #"; open (WAIV,"$waiverfile") ; while () {print "$_" ; } close (WAIV); print ""; } sub waiverok { print "" ; &show_waiver; if ($TYPE eq "ON-LINE") { print "
[ X ] Yes!" ; }else { print "

(please check here)[   ] " ; } print "I agree to waiver"; if ($TYPE eq "ON-LINE") { print " and to have my credit card charged" ; } print ".\n"; print "
" ; } sub send_ack_old { if($Form{PaperEntry} eq "YES" && $SkipEmail eq "checked") {return;} open(MAIL,"|$mailprog -f$EventxEmail"); $MODE1 = "MAIL" ; select MAIL ; print "To: $Config{'email'}\n"; print "From: $Config{'email'}\n"; print "Subject: $racetitle1\n\n" ; print "$Form{firstname} " ; print "$Form{lastname}\n" ; print "$Form{address}\n" ; print "$Form{city}, " ; print "$Form{state} " ; print "$Form{zip}\n" ; print "$racetitle1\n" ; print "Confirmation # $Config{control}\n\n" ; print "$EventDesc\n\n"; if ($ChipRace eq "YES"){&pr_chipinfo;} if($TYPE eq "ON-LINE") { print "Your Credit Card Statemnet will show a charge from\n"; print "COMPUTER COMFORT SIGNUPS.\n\n"; } print "Event contact:\n"; print "$EventContact\n"; print "$EventxEmail\n"; print "$EventPhone\n"; if ($TYPE eq "ON-LINE") { open (NOTICE, "$incdir/$Event/ccnotice"); } else { open (NOTICE, "$incdir/$Event/mailnotice"); } while () { print MAIL $_; } close (NOTICE); close (MAIL); $MODE1 = "DISPLAY" ; select STDOUT ; } sub send_ack { if($Form{PaperEntry} eq "YES" && $SkipEmail eq "checked") {return;} $email_text = ''; $email_cc = ''; $email_file = ''; $email_to = "$Config{'email'}"; $email_from = "$Config{'email'}"; $email_subject= "$racetitle1" ; $email_text .= "$Form{firstname} $Form{lastname}\n" ; $email_text .= "$Form{address}\n" ; $email_text .= "$Form{city}, $Form{state} $Form{zip}\n" ; $email_text .= "$racetitle1\n" ; $email_text .= "Confirmation # $Config{control}\n\n" ; $email_text .= "$EventDesc\n\n"; $MODE1 = "MAIL" ; if ($ChipRace eq "YES"){&pr_chipinfo;$email_text .= $chipinfotext;} $MODE1 = "DISPLAY" ; if($TYPE eq "ON-LINE") { $email_text .= "Your Credit Card Statemnet will show a charge from\n"; $email_text .= "COMPUTER COMFORT SIGNUPS.\n\n"; } $email_text .= "Event contact:\n"; $email_text .= "$EventContact\n"; $email_text .= "$EventxEmail\n"; $email_text .= "$EventPhone\n"; if ($TYPE eq "ON-LINE") { open (NOTICE, "$incdir/$Event/ccnotice"); } else { open (NOTICE, "$incdir/$Event/mailnotice"); } while () { $email_text .= $_; } close (NOTICE); } sub signature { open (SIG,"/var/www/custom/html/signature.txt") ; while () {print "$_" ; } close (SIG); } sub do_alert { print "\n"; } sub ccgetinfo{ open (CCI, "/var/www/custom/html/ccgetinfo1.htm"); while () { print "$_";} close (CCI) ; } sub teamnames { #print"
"; #print "

"; #print "
If you are a member of a team select here
\n"; #print "\n"; if($USATFTeams eq "" ){ $TEAMNAMES ="";} if(-f "$incdir/$Event/TeamList.csv"){$TEAMNAMES.=" $incdir/$Event/TeamList.csv";} # if($CompanyID eq "cigna"){$TEAMNAMES.=" $incdir/Corporate/TeamList.csv";} @TheTeams = `$SORT -u -f $TeamFile $TEAMNAMES `; if($TheTeams[0] ne "") { print "
$TeamTitle
"; print ""; if($AskOtherTeam ne ""){ print "
Other(if not in above list)"; if($CorpSignup ne ""){ print "
You will be designated as Team/Group contact for the new team."; } } #print " more info\n"; print"
"; } sub pr_prices { if ($SeriesID eq "") { # $ServiceCharge = sprintf ("%9.2f",($EventFee+$FlatAdd) * $PercentAdd) ; print ""; if ($Adjustment ne "INCLUDED") { $ServiceCharge = sprintf ("%9.2f",($EventFee+$FlatAdd) * $PercentAdd) ; if ($CompanyID eq "prponh" && $ServiceCharge == 2.05){ # $ServiceCharge = 2.00 ; } print "Service Charges Will Be Added In Next Step:\n"; } if($EvCatCnt == 0){ $TOTAL = sprintf("%9.2f",$FEE+$ServiceCharge); # print "TOTAL:\$$TOTAL\n"; } } print "
\n"; } sub pr_form_fields { foreach $field (@Field_Order) { local $fname = &clean_html($field); # &FORM_input("hidden","$fname","$Form{$field}"); print "\n"; } } sub pr_chipinfo { #if ($MODE1 eq "DISPLAY") { $chipinfotext .= "
";} $chipinfotext = ''; if($SeriesID){ $chipinfotext .= " One or more of these events";}else{$chipinfotext .= "This event";} $chipinfotext .= " uses the ChampionChip timing and scoring system.\n"; if ($MODE1 eq "DISPLAY") { $chipinfotext .= ""; if ($AskForChip eq "YES"){ $chipinfotext .= "
"; $chipinfotext .= "If you own your own ChampionChip and plan to use it at this event, put the code in the space below."; $chipinfotext .= "
"; $chipinfotext .= "
"; $chipinfotext .= ""; } $chipinfotext .= "If you do not have your own Chip, you will be given one when you register and receive your race bib.\n"; } if ($MODE1 eq "DISPLAY") { $chipinfotext .= "
"; } $chipinfotext .= "THE CHIP IS MANDATORY IN ORDER TO BE TIMED.\n"; if ($MODE1 eq "DISPLAY") { $chipinfotext .= "
"; } $chipinfotext .= "The Chip you receive MUST BE RETURNED or you will charged with a \$35.00 replacement fee.\n\n"; if ($MODE1 eq "DISPLAY") { print "$chipinfotext
"; } } sub help_script { print <<"(OPTIONS)";
(OPTIONS) } sub confirm { print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n" ; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; (@Series)=split(/\, /,$Form{SeriesEvent}); $S_matchadd = 0; foreach (@Series){ ++$S_matchadd ; $S_shirt = "shirt_size$S_matchadd"; $S_extra1 = "other_1_$S_matchadd"; $S_extra2 = "other_2_$S_matchadd"; $S_extra3 = "other_3_$S_matchadd"; $S_extra4 = "other_4_$S_matchadd"; $S_extra5 = "other_5_$S_matchadd"; $S_extra = "|$Form{$S_shirt}|$Form{$S_extra1}|$Form{$S_extra2}|"; $S_extra .="$Form{$S_extra3}|$Form{$S_extra4}|$Form{$S_extra5}|"; #$ $S_Shirt = #print "1 $S_shirt 2 $S_extra
"; print "\n";} if ($Step > 3) { print "\n"; } } sub confirm2 { print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } sub make_filedata { $dtos = substr($Config{control},0,8); $ttos = substr($Config{control},9,6); $GENDER = substr($Form{gender},0,1); $ccinvoice = "$dtos$ttos"; $csvline = "\"" ; #$csvline = $csvline. "$dtos\",\"" ; $csvline = $csvline. "$today\",\"" ; $csvline = $csvline. "$ttos\",\"" ; $csvline = $csvline. "$RACE\",\"" ; $csvline = $csvline. "$TYPE\",\"" ; $csvline = $csvline. "$Form{EventIDNum}\",\"" ; #$csvline = $csvline. "$TOTAL+$ServiceCharge \",\"" ; $csvline = $csvline. "$Form{chipcode}\",\"" ; $csvline = $csvline. "$Form{lastname}\",\"" ; $csvline = $csvline. "$Form{firstname}\",\"" ; $csvline = $csvline. "$Form{address}\",\"" ; $csvline = $csvline. "$Form{city}\",\"" ; $csvline = $csvline. "$Form{state}\",\"" ; $csvline = $csvline. "$Form{zip}\",\"" ; $csvline = $csvline. "$Phone\",\"" ; $csvline = $csvline. "$Config{email}\",\"" ; $csvline = $csvline. "$GENDER\",\"" ; $csvline = $csvline. "$Form{RaceDayAge}\",\"" ; $csvline = $csvline. "$Form{DOBmonth}\",\"" ; $csvline = $csvline. "$Form{DOBday}\",\"" ; $csvline = $csvline. "$Form{DOByear}\",\"" ; $csvline = $csvline. "$Form{clyfil}\",\"" ; $csvline = $csvline. "$Form{shirt_size}\",\"" ; $csvline = $csvline. "$Form{team_name}\",\"" ; $csvline = $csvline. "$Form{CompanyName}\",\"" ; $csvline = $csvline. "$Form{GroupID}\",\"" ; $csvline = $csvline. "$Form{DLnumber}\",\"" ; $csvline = $csvline. "$Form{other_1}\",\"" ; $csvline = $csvline. "$Form{other_2}\",\"" ; $csvline = $csvline. "$Form{other_3}\",\"" ; $csvline = $csvline. "$Form{other_4}\",\"" ; $csvline = $csvline. "$Form{other_5}\",\"" ; $csvline = $csvline. "$Form{other_6}\",\"" ; $csvline = $csvline. "$Form{other_7}\",\"" ; $csvline = $csvline. "$Form{other_8}\",\"" ; $csvline = $csvline. "$Form{other_9}\",\"" ; $csvline = $csvline. "$Form{other_10}\",\"" ; $csvline = $csvline. "$Form{phone2}\",\"" ; $csvline = $csvline. "$Form{country}\",\"" ; $csvline = $csvline. "$Form{nationality}\",\"" ; $csvline = $csvline. "$TOTAL\",\"" ; $csvline = $csvline. "$ServiceCharge\",\"" ; $csvline = $csvline. "$ForSaleTotal\",\"" ; $csvline = $csvline. "$Form{ForSale1}\",\"" ; $csvline = $csvline. "$Form{ForSale2}\",\"" ; $csvline = $csvline. "$Form{ForSale3}\",\"" ; $csvline = $csvline. "$Form{ForSale4}\",\"" ; $csvline = $csvline. "$Form{ForSale5}\",\"" ; $csvline = $csvline. "$Form{ForSale6}\",\"" ; $csvline = $csvline. "$Form{ForSale7}\",\"" ; $csvline = $csvline. "$Form{ForSale8}\",\"" ; $csvline = $csvline. "$Form{ForSale9}\",\"" ; $csvline = $csvline. "$Form{ForSale10}\",\"" ; $csvline = $csvline. "$T_COMPANY\",\"" ; $csvline = $csvline. "$T_ADDRESS\",\"" ; $csvline = $csvline. "$T_CSZ\",\"" ; $csvline = $csvline. "$T_CONTACT\",\"" ; $csvline = $csvline. "$T_EMAIL\",\"" ; $csvline = $csvline. "$T_PHONE\",\"" ; $csvline = $csvline. "$Config{control}\",\""; $csvline = $csvline. "$CatCode\",\"" ; $csvline = $csvline. "$CatName\",\"" ; $csvline = $csvline. "\"" ; } sub make_additional_data_line { $dtos = substr($Config{control},0,8); $ttos = substr($Config{control},9,6); $Add_csvline = "\"" ; $Add_csvline .= "$today\",\"" ; $Add_csvline .= "$ttos\",\"" ; $Add_csvline .= "$RACE\",\"" ; $Add_csvline .= "$TYPE\",\"" ; $Add_csvline .= "$KEventIDNum\",\"" ; #$Add_csvline .= "$TOTAL+$ServiceCharge \",\"" ; $Add_csvline .= "$Kchipcode\",\"" ; $Add_csvline .= "$KLast\",\"" ; $Add_csvline .= "$KFirst\",\"" ; $Add_csvline .= "$Form{address}\",\"" ; $Add_csvline .= "$Form{city}\",\"" ; $Add_csvline .= "$Form{state}\",\"" ; $Add_csvline .= "$Form{zip}\",\"" ; $Add_csvline .= "$Phone\",\"" ; $Add_csvline .= "$Config{email}\",\"" ; $Add_csvline .= "$KGender\",\"" ; $Add_csvline .= "$KAge\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "$KShirt\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "$Kother_1\",\"" ; $Add_csvline .= "$Kother_2\",\"" ; $Add_csvline .= "$Kother_3\",\"" ; $Add_csvline .= "$Kother_4\",\"" ; $Add_csvline .= "$Kother_5\",\"" ; $Add_csvline .= "$Kother_6\",\"" ; $Add_csvline .= "$Kother_7\",\"" ; $Add_csvline .= "$Kother_8\",\"" ; $Add_csvline .= "$Kother_9\",\"" ; $Add_csvline .= "$Kother_10\",\"" ; $Add_csvline .= "$Form{phone2}\",\"" ; $Add_csvline .= "$Form{country}\",\"" ; $Add_csvline .= "$Form{nationality}\",\"" ; $Add_csvline .= "$funrunfee\",\"" ; $Add_csvline .= "$KServicecharge\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "\",\"" ; $Add_csvline .= "$T_ADDRESS\",\"" ; $Add_csvline .= "$T_CSZ\",\"" ; $Add_csvline .= "$T_CONTACT\",\"" ; $Add_csvline .= "$T_EMAIL\",\"" ; $Add_csvline .= "$T_PHONE\",\"" ; $Add_csvline .= "$Config{control}-$KidCount\",\""; $Add_csvline .= "$Kcategory\",\"" ; $Add_csvline .= "\"" ; } sub add_to_file { if ($CompanyID eq 'nedin'){ print " T5 ";} if ($Group eq "YES" || $Form{signup_type} eq "GROUP") { open (CSV, ">>$incdir/$Event/GRPDATA.csv"); if ($CompanyID eq 'nedin'){ print " T6 ";} }else{ if ($CompanyID eq 'nedin'){ print " T7 ";} open (CSV, ">>$incdir/$Event/REGDATA.csv"); } if ($CompanyID eq 'nedin'){ print " T8 $incdir/$Event / $csvline ";} print CSV "$csvline\n" ; close (CSV); if ($TotalKids > 0) {&add_to_funrun_file ; } #if ($TYPE eq "ON-LINE") { &add_to_cc_file ; } } sub add_to_funrun_file { $dtos = substr($Config{control},0,8); $ttos = substr($Config{control},9,6); open (CSV, ">>$incdir/$Event/FUNRUN.csv"); $KidCount = 1; foreach (@Kids){ $KidCount++ ; ($expm,$expy)= split(/\//,$cardexpire) ; ($KLast,$KFirst,$KAge,$KGender,$KShirt) = split( /\,/,$_); if (1==2){ print CSV "\"$dtos\",\"" ; print CSV "$ttos\",\"" ; # print CSV "\"$Config{control}\",\"" ; print CSV "$RACE\",\"" ; print CSV "$TYPE\",\"" ; print CSV "$KLast\",\"" ; print CSV "$KFirst\",\"" ; print CSV "$KAge\",\"" ; print CSV "$KGender\",\"" ; print CSV "$funrunfee\",\"" ; print CSV "$Form{lastname}\",\"" ; print CSV "$Form{firstname}\",\"" ; print CSV "$Form{address}\",\"" ; print CSV "$Form{city}\",\"" ; print CSV "$Form{state}\",\"" ; print CSV "$Form{zip}\",\"" ; print CSV "$Phone\",\"" ; print CSV "$Config{email}\",\"" ; print CSV "$KShirt\"" ; print CSV "\n"; } &make_additional_data_line; # open (r_CSV, ">>$incdir/$Event/REGDATA.csv"); print CSV "$Add_csvline\n" ; # close (r_CSV); } close (CSV); } sub make_ccdata { $CCFEE = sprintf ("%9.2f",$TOTAL+$ServiceCharge); $CCFEE =~ s/ //g; $cardexpire = substr($cardexpire,0,3) . substr($cardexpire,5,2) ; $cardnumber =$Form{credit_card_number} ; $namepart1 = $Form{firstname}; $namepart2 = $Form{lastname}; ($expm,$expy)= split(/\//,$cardexpire) ; if (length($expm) == 1) {$expm = "0".$expm ;} if (length($expm) == 1) {$expm = "0".$expm ;} $expyr = substr($expy,length($expy),2) ; $cardnumber =~ s/ //g ; $cardnumber =~ s/_//g ; $cardnumber =~ s/-//g ; $ec_cardnumber = encode2($cardnumber); $dtos = substr($Config{control},0,8); $ttos = substr($Config{control},9,6); $ccinvoice = "$dtos$ttos"; $infodata = "$EventID|$Form{cardholdername}|$Form{cardemail}|$Phone"; $infopart1 =substr($infodata,0,17); $infopart2 = substr($infodata,17,10); $infopart3 = substr($infodata,27,20); $infopart4 = substr($infodata,47,20); # $ccinfoline = $ccinfoline."\$Form{cardholdername}\",";" $ccinfoline = $ccinfoline."\"$ccinvoice\","; $ccinfoline = $ccinfoline."\"$RACE\","; $ccinfoline = $ccinfoline."\"$CCFEE\","; $ccinfoline = $ccinfoline."\"CC\","; $ccinfoline = $ccinfoline."\"\","; $ccinfoline = $ccinfoline."\"$Approval_Code\","; $ccinfoline = $ccinfoline."\"$Transaction_ID\","; $ccinfoline = $ccinfoline."\"$cardnumber\","; $ccinfoline = $ccinfoline."\"$cardexpire\","; $ccinfoline = $ccinfoline."\"$Config{control}\","; $ccinfoline = $ccinfoline."\"$Form{cardfirstname}\"," ; $ccinfoline = $ccinfoline."\"$Form{cardlastname}\"," ; $ccinfoline = $ccinfoline."\"$Form{firstname} $Form{lastname}\"," ; $ccinfoline = $ccinfoline."\"$Form{cardaddress}\","; $ccinfoline = $ccinfoline."\"$Form{cardcity}\"," ; $ccinfoline = $ccinfoline."\"$Form{cardstate}\"," ; $ccinfoline = $ccinfoline."\"$Form{cardzip}\","; $ccinfoline = $ccinfoline."\"$Phone\"," ; $ccinfoline = $ccinfoline."\"$Form{cardemail}\","; $ccinfoline = $ccinfoline."\"$Form{ccvcode}\","; $ccinfoline = $ccinfoline."\"$TOTAL+$ServiceCharge \"," ; $ccinfoline = $ccinfoline."\"$Transaction_ID\","; $ccinfoline = $ccinfoline."\"$Approval_Code\","; $ccinfoline = $ccinfoline."\"$TOTAL\"," ; $ccinfoline = $ccinfoline."\"$ServiceCharge \"," ; $ccinfoline = $ccinfoline."\"$Address_VCode\","; $ccinfoline = $ccinfoline."\"-$First_4--$Last_4-\","; $ccinfoline = $ccinfoline."\"\""; } sub add_to_cc_file { open (CC, ">>$incdir/$Event/CCDATA.csv"); print CC "$ccinfoline\n"; close (CC) ; } sub SaveMe { print "saving profile $PID - $ttos
\n"; $PID = substr($Form{firstname},0,3).substr($Form{lastname},0,3).$Form{state} ; $csvline = "|$PID|$ttos" ; $csvline = $csvline. "|$Form{lastname}" ; $csvline = $csvline. "|$Form{firstname}" ; $csvline = $csvline. "|$Form{address}" ; $csvline = $csvline. "|$Form{city}" ; $csvline = $csvline. "|$Form{state}" ; $csvline = $csvline. "|$Form{zip}" ; $csvline = $csvline. "|$Phone" ; $csvline = $csvline. "|$Config{email}" ; $csvline = $csvline. "|$Form{gender}" ; $csvline = $csvline. "|$Form{DOBmonth}" ; $csvline = $csvline. "|$Form{DOBday}" ; $csvline = $csvline. "|$Form{DOByear}" ; $csvline = $csvline. "|$Form{chipcode}"; $csvline = $csvline. "||||" ; #open (SM, ">>/var/race/members/Pprofiles"); open (SM, ">/var/race/members/PROFILES/$PID-$ttos"); print SM "$csvline\n"; close (SM) ; open(MAIL,"|$mailprog1"); print MAIL "To: $Config{'email'}\n"; print MAIL "From: Signups\@comfortinc.com (Comfort Signups)\n"; print MAIL "Subject: $racetitle1\n\n" ; print MAIL "Comfort Signups Profile\n\n"; print MAIL "Profile ID: $PID\n"; print MAIL "Password: $ttos\n" ; print MAIL "$Form{firstname} " ; print MAIL "$Form{lastname}\n" ; print MAIL "$Form{address}\n" ; print MAIL "$Form{city}, " ; print MAIL "$Form{state} " ; print MAIL "$Form{zip}\n" ; print MAIL "$Phone\n" ; print MAIL "$Config{email}\n" ; print MAIL "$Form{gender}\n" ; print MAIL "$Form{DOBmonth}/" ; print MAIL "$Form{DOBday}/" ; print MAIL "$Form{DOByear}\n" ; print MAIL "\n"; print MAIL "Thank you for creating a Comfort Signups profile.\n\n"; close (MAIL); } sub save_data { #$TYPE = "ON-LINE"; if ($TYPE eq "ON-LINE") { $CC1FILE = "$incdir/$Event/ccfiles/$Config{control}"; open (CC, ">>$CC1FILE"); if ($CompanyID eq 'nedin'){ print " CC1 ";} # print CC "\"S\",\"$cardnumber\",\"$cardexpire\",\"$CCFEE\","; print CC "$ccinfoline,$csvline\n"; close (CC) ; } if ($Group eq "YES" || $Form{signup_type} eq "GROUP") { $CSVFILE = "$incdir/$Event/grpfiles/$Config{control}"; }else{ $CSVFILE = "$incdir/$Event/regfiles/$Config{control}"; if ($CompanyID eq 'nedin'){ print " RG1=$CSVFILE
";} } open (CSV, ">> $CSVFILE") ; print CSV "$csvline\n" ; close (CSV); #print "CC $CC1FILE
CSV $CSVFILE
"; if (!-f "$CSVFILE" && !-f "$CCFILE"){&error("There was a problem saving your information!

Please contact Support at 603 865-7352 ASAP

$CCFILE
$CSVFILE");} } sub Free_Shirt { $FreeShirt = "$tsizeC$tsizeS$tsizeM$tsizeL$tsizeXL$tsizesXXL" ; print "
\n"; if($SeriesID ne "") { print "
Not all of the above events may offer "; print "free shirts, for thoose that do...
"; # $ShirtSizes = "S M L XL XXL "; }else{ $ShirtSizes = ""; if ($tsizeS) { $ShirtSizes .= "S "; } if ($tsizeM) { $ShirtSizes .= "M "; } if ($tsizeL) { $ShirtSizes .= "L "; } if ($tsizeXL) { $ShirtSizes .= "XL "; } if ($tsizeXXL) { $ShirtSizes .= "XXL "; } if ($tsizeC) { $ShirtSizes .= "Child"; } } if ($ShirtSizes ne "" ) { &PickShirt; }else{ &FORM_input("hidden","shirt_size","none"); } print "

\n"; } sub PickShirt { if($S_match == 0){$S_match = "";} $RButton = "Please Select Your Free Shirt Size For This Event.
" ; $PickShirt = ""; }else{print "
no shirt ";} print "
"; if($tsizeS ||$SeriesID1 ne ""){print "$RButton value=Small>Small\n"; } print ""; if($tsizeM ||$SeriesID1 ne ""){print "$RButton value=Medium>Medium\n"; } print ""; if($tsizeL ||$SeriesID1 ne ""){print "$RButton value=Large>Large\n"; } print ""; if($tsizeXL ||$SeriesID1 ne ""){print "$RButton value=X-Large>XLarge\n"; } print ""; if($tsizeXXL ||$SeriesID1 ne ""){print"$RButton value=XX-Large>XXLarge\n"; } if ($ShirtNote ne ""){print "
$ShirtNote\n";} print "
"; if($tsizeC){print "$RButton value=Child>Child\n"; } if($Form{PaperEntry} eq "YES" && $NoShirt eq "checked") { print"$RButton value=no-shirt checked>No Shirt\n"; } # print "
\n"; } sub AskSigningUp { &New_Table("Ask Signup") ; print "I am signing up ....
"; print "Just Me\n"; print "
\n"; print "Complete Team."; # print "
"; &teamnames; } sub CorpSignup { print "
"; print " The above information is the team contact.
\n"; print ""; print "Please Enter
"; print "First Name, Last Name, Gender, Age, Town, State"; if ($FreeShirt) {print ", Shirt Size"; } print ""; if($ChipRace eq "YES"){ print ", Chip Code (if member has his/her own ChampionChip)";} print "
of each team member
\n"; print "
\n"; print " example: Benn,Boulton,M,35,Newport,NH"; if ($FreeShirt) {print ",L "; if($ChipRace eq "YES"){ print ",??????? (???????= 7 diget chip code)";} print "
Shirt sizes are $ShirtSizes"; } print "
"; print ""; print "If person above is also on the team, please re-enter below.
"; print "
"; print "Minimun Team Members is $MinTeamSize
\n"; print "
\n"; } sub ShowSeries { $RACELIST ="/var/race/RACE_LIST" ; $SeriesList = `$GREP "$SeriesID|" /var/race/SeriesList`; ($SerID,$SeriesName,$SeriesOff,$SeriesRule) = split(/\|/,$SeriesList); if($dtos > $SeriesOff){$SeriesID=""; return;} $X_Comp = "xx$CompanyID"; $X_Event = $EventID; $S_match=0; foreach (`$SORT -t '|' -k 5.1 $RACELIST |$GREP "|ACTIVE|$SeriesID|" `){ ($S_Comp,$S_Event,$S_Name,$S_Town,$S_State,$S_EVDate,$REST) = split(/\|/,$_); if($dtos < $S_EVDate) { #if($X_Comp ne $S_Comp && $X_Event ne $S_Event) { if ($S_match == 0) { print "
This Event is part of the "; print "$SeriesName.
"; print "You may also sign up for...
\n"; print "$SeriesRule
"; print "\n"; #$S_match=1; } ++$S_match; &getraceopts("$incdir/$S_Comp/$S_Event/raceopts") ; $SeriesID=$SerID; $S_Date = "$months[$EventMonth-1] $EventDay, $EventYear"; print " "; print " "; print sprintf("",$EventFee ); print "\n"; #} } } print "
\n"; if($X_Comp ne $S_Comp && $X_Event ne $S_Event) { print ""; }else { print "-X-"; --$S_match; print ""; #print ""; } print " $EventName"; &PickShirt; &ExtraItems; print " $S_Town, "; print "$S_State$S_Date\$%9.2f "; # print "$S_match"; # &PickShirt; # &Free_Shirt; print "
\n"; &getraceopts("$optfile") ; if($Form{ForcePrice} ne ""){$EventFee=$Form{ForcePrice} ;} } sub send_the_email{ $mwrrmessage=$mwrrmessage."New Signup\n\n$csvline"; $mwrrto = "Racetime\@gsrs.com"; $mwrrfrom = "Signups\@comfortsignups.com"; $mwrrsubject = "Late/Free MWRR SIGNUP"; $mwrrfile = "$CSVFILE"; $mwrrfilename= "$outputfile"; # $mailparms = "-f$mwrrfrom"; $boundaryline= "NextPart_csvfile"; use MIME::Lite; my $msg = MIME::Lite->new( From => "$email_from", To => "$email_to", Cc => "$email_cc", Subject => "$email_subject", Type => 'multipart/mixed' ); $msg->attach( Type => 'TEXT', Data => "$email_text" ); if($email_file ne '') { $msg->attach( Type => 'application/octet-stream', Path => "$email_file", Filename => "$email_filename" ); } $msg->send; }