#!/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 = " \"Add"; #$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; $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""; if($TeamName ne "") { print""; print"Team: $LongTeamName "; print"Contact: $TeamCaptain"; print ""; if($Form{CorporInd} eq "CorpTeamXx"){ &PrintCorpInfo ; } print ""; } $PickType = "Your"; if($Form{CorporInd} eq "CorpTeam"){ &CorpSignup; } if ($isProfile) {print ""; } print &getTemplate('/var/www/custom/html/racereg.html'); print &getTemplate('/var/www/custom/html/racereg2.html'); print &getTemplate('/var/www/custom/html/racereg3.html'); if($SeriesID ne "") { &ShowSeries ;} print "Please Select $PickType Event category
\n"; print ""; if($Form{team_name} ne ""){ # print ""; # print "Competing as CO-ED Team Member
"; } print "
"; &Free_Shirt; &ExtraItems; if($Form{CorporInd} eq "CorpTeam"){$Step = 23; }else { if($funrun eq "checked") {&DoAskFunRun;} } print "

"; &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 "


"; print "After All Team Members Are Added, Click CONTINUE Below
"; print "
\n"; } }else{ # print "
$Step"; &form_end($Step+1); &html_footer; } } # end step =2 if ($Step > 2) { &calcage; $MODE1 = "DISPLAY"; if($Form{CorporInd} eq "CorpTeam"){ if ($Step >3 && $Step <9 ){&PrintCorpInfo ;} } if($Step < 20 && $Form{CorporInd} ne "CorpTeam"){ &Step3A ;} if ($Step == 4) { # &form_begin("form1","$FORM2"); if($Form{CorporInd} ne "CorpTeam"){ if ($Form{isProfile} && $Form{PaperEntry} ne "YES") { 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 "
\n"; print "Click the browser BACK BUTTON to go back and make any correctionsn"; print "
\n"; } if($AskCountry ne "") {$require = $require.",country";} $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"); &html_footer; } ## end Step > 2 } ## end Action = CONTINUE if ($Action eq "FINISH") { if ($Step == 5 ) { $Form{credit_card_number} = "PO#"; if (substr($Form{credit_card_number},0,3) ne "PO#") { &DoStepFive; } $FEE = $ONLINEFEE; $FEE = $EventFee; if($Form{CorporInd} eq "CorpTeam"){ $TeamMemberFees = 0; &GetTeamMembers; $FEE = $Form{TeamMemberFees}; $FEE = $TeamMemberFees; $CCFEE = $TeamMemberFees+$ServiceCharge; $TOTAL = $CCFEE; &PrintCorpInfo; } &calcage; $MODE1 = "DISPLAY"; if($Form{CorpotInd} ne "CorpTeam"){&Step3A ;} &html_footer; if ($Adjustment eq "INCLUDED") { $ServiceCharge = int($TOTAL * $DiVisor * 100)/100 + $FlatAdd ; $FEE = $TOTAL - $ServiceCharge ; $FEE =~ s/ //g; $TOTAL = $FEE ; $FEE = sprintf("%9.2f",$FEE ) ; } $Config{control} = $control; $CSVFILE = "$incdir/$Event/regfiles/$Config{control}"; if (-f "$CSVFILE") { }else { if($TYPE eq "ON-LINE" ||$Form{TestMode} eq "YES"){&make_ccdata ;&add_to_cc_file ; } if($TotalTeam > 0 || $TeamMemberCount > 0) { &DoEachTeamMember ; }else{ &do_file_stuff; } ## end if TotalTeam > 0 &send_ack; # if($Form{CorporInd} eq "CorpTeam"){ unlink ("$incdir/$Event/$Teamcontrol-$TeamName"); } if ($Form{Save_Me} eq "SAVE_ME") { &SaveMe; } if($Form{CorporInd} ne "CorpTeam"){$ack_mode = 5; &send_ack; } } # End Step 5 Finish } # End FINISH exit ; sub do_file_stuff { &make_filedata; &save_data; &add_to_file; } 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" && $Form{CorporInd} ne "CorpTeam"){ $CCFEE =$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 sprintf ("%9.2f",$CCFEE); # $require .= ",OK CheckBox"; print "\n" ; } if($Form{CorporInd} eq "CorpTeam" && $Step == 4) { print "

"; &form_begin("Done","$FORM1"); print "
\n"; }else{ print "\n\n" ; # print "\n"; print "\n"; print "\n"; 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}"); } if(($Form{CorporInd} eq "CorpTeam" && $NextStep == 1) || ($Form{CorporInd} ne "CorpTeam" && $NextStep != 1)) { 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 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 .= "
"; # $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.";} if($CloseLink ne ""){ $error="$error
More Information";} } if ($error eq 'NoEvent') { $error = " NOT a valid Event."; } print "$error"; &error_footer; print " 22 $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"; if($Step > 0 && $Step <3){ $Config{required} .= ",team_name";} if($Step == 1 && $TeamPasswd ne "" && $Action ne "EDIT TEAM INFO"){ # $Config{required} .= ",RegPasswd"; if($TeamPasswd ne "" && $TeamPasswd ne $Form{RegPasswd} && $Form{RegPasswd} ne ""){ $Config{required} .= ",Invalid Registration Password"; $Config{required} .= ",Team Contact is:, $TeamCaptain, $TeamPhone, $TeamEmail"; } if($TeamPasswd ne "" && $Form{RegPasswd} eq ""){ $Config{required} .= ",This Team Requires A Registration Password"; $Config{required} .= ",Team Contact is:, $TeamCaptain, $TeamPhone, $TeamEmail"; } # if($TeamPasswd ne $Form{RegPasswd} && $Form{RegPasswd} ne ""){ $Config{required} .= ",Invalid Password";} } # } &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 ) { if ( $Form{PaperEntry} ne "YES" && $TeamPayMethod ne "PXO") { 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 { if($Form{CorporInd} eq "CorpTeam"){ $Config{'required'} = ""; $require=""; } if($Form{CoprorInd} ne "CorpTeam"){ ##NOCC NL 3 ### $Config{'required'} .= ",cardfirstname,cardlastname" ; ### $Config{'required'} .= ",cardaddress,cardcity" ; ### $Config{'required'} .= ",cardstate,cardzip" ; } # $Config{'required'} .= ",cardemail" ; } if($Form{credit_card_number} eq "TESTING" || substr($Form{credit_card_number},0,3) eq "PO#") { $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"; } if($Form{CoprorInd} ne "CorpTeam"){ ##NOCC NL 2 ### $Config{'required'} .= ",credit_card_type,credit_card_number,card_expire_month,card_expire_year"; ### if($STYLE ne "PAYMENXT"){$Config{'required'} .=",ccvcode";} } } if(length($Form{card_expire_month}) == 1){ $Form{card_expire_month} = "0".$Form{card_expire_month}; } $Config{'required'} .=",OK CheckBox"; } if ($Form{teammember} eq "YES") { $Config{'required'} .= ",team_name" ; } if($Action eq "SEND LOGIN INFO" ){$Config{required} ="team_name";} if($Action eq "EDIT TEAM INFO" ){$Config{required} ="TeamLogin,TeamPassword$Config{required}";} 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 (substr($Config{required},0,1) eq ",") { $Config{required} = substr($Config{required},1); } } sub Step3A { $RACE = $racetitle1 = $EventName; $Phone = "$Form{Phone}"; $TOTAL = $FEE; 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"; if($Form{CorporInd} eq "CorpTeam"){ if($Step > 2 ){&ShowTotals; return;} print"Team Contact Information
\n"; #print "COMPANY $Form{CompanyName}
"; print " TEAM $Form{team_name}"; } print "
\n" ; 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";
print "CHIP: $Form{chipcode}";
if ($Form{chipcode} eq "" ) { print "NONE" ; }
print "\n";
}
print "
"; print "" ; print "
   EMAIL: $Config{email}\n
" ;
print "" ;
print "
"; print "$Form{CoEd} $Form{category} \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} " ; print "$LongTeamName" ; if ($Form{team_name} eq "") { print "NONE" ; } print "
"; print "Contact: $TeamCaptain - $TeamPhone"; if($TeamPExt ne ""){print "ext $TeamPExt";} print " - $TeamEmail"; print "
"; } if ($Form{KidsNames} ne ""){ print "
Kids Fun Run \n"; # (@Kids)=split(/\r\n/,$Form{KidsNames}); $TotalKids = 0; foreach (@Kids){print sprintf("%-30s %5.2f
\n",$_,$funrunfee); ++$TotalKids;} #print sprintf("Total Fun Run 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" ; &ShowTotals; } # end sub Step3A sub ShowTotals { #$Adjustment = "ADD"; &ForSaleItems; &CalcServiceCharge; print "\n" ; print "\n" ; print "\n" ; if ($TotalTeam > 0) { print "\n"; print "",$TotalTeam*($FEE+0)); # if($Form{CoprorInd} eq "CorpTeam"){$TOTAL = 0;} # $TOTAL = $TOTAL + ($TotalTeam*($FEE+0)); $FEE = $TOTAL; } if ($TotalKids > 0) {&DoTheKids1;} &DoTheSeries1; if ($TYPE eq "ON-LINE" || $Form{credit_card_number} eq "TESTING") { if ($TOTAL > $FEE){ print ""; } if ($ServiceCharge > 0 && $Adjustment eq "ADD" ) { print ""; } } if($Form{CoprorInd} eq "CorpTeam"){$TOTAL = $FEE;} print ""; if ($Action eq "FINISH" && $Form{CorporInd} ne "CorpTeam"){ if ($TeamPayInfo eq "") { $TeamPayInfo = "Please See Your Team Contact Person To Arange Payment"; } print ""; } $XTYPE = $TYPE ; print "
"; if($TeamMemberCount > 0) {print "($TeamMemberCount) ";$TOTAL = $FEE;} print "$RACE "; if($TotalTeam == 0){print sprintf ("\$%5.2f",$FEE);} print "
Team Members Fees ($TotalTeam)"; print sprintf("%7.2f
SUB TOTAL:\$"; print sprintf ("%9.2f",$TOTAL); print "
Service Charge:\$"; print sprintf ("%9.2f",$ServiceCharge); print "
TOTAL DUE:$CorporInd \$"; print sprintf ("%9.2f",$TOTAL+$ServiceCharge); print "
"; print "$TeamPayInfo"; print "
\n" ; if($Form{CoprorInd} ne "CorpTeam"){ ##NOCC NL 10 if (1 == 2) { ### if ( ($TYPE eq "ON-LINE" || $Form{credit_card_number} ne "TESTING") && $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" && $Form{CorporInd} ne "CorpTeam"){ &Thank_You; &show_waiver; print "

PLEASE PRINT THIS PAGE FOR YOUR RECORDS
"; if($STYLE eq "PAYMENT"){&JustGetPayment; } } } sub Thank_You { print "

I wish to support the Elliot with a donation.


"; return; print ""; } sub CalcServiceCharge { $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 ($Adjustment eq "ADD") { if($ServiceCharge < $MinServiceCharge) {$ServiceCharge = $MinServiceCharge;} } } 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); $esize = $esize +1; if($Form{other_1} eq "" && $Step == 2) { print " $evalue"; } if($Form{other_1} ne "" && $Step > 2) { print "
$evalue


";} } print "\n"; 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 "
"; 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 "
"; } 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"){print "$evalue ";} print ""; if($etype eq "checkbox"){print "$evalue";} print " $eextra "; } 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; 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 { &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 { if($Form{PaperEntry} eq "YES" && $SkipEmail eq "checked") {return;} # if($Form{CorporInd} eq "CorpTeam"){$Config{'email'} = $TeamEmail;} # if($Form{CorporInd} eq "CorpTeam"){$Config{'email'} = $TeamEmail;} #print "tme $TeamMemberEmail - CE $Config{email}"; # if($ack_mode == 4 ){$Config{'email'} = $TeamMemberEmail;} if($Form{CorporInd} ne "CorpTeam" && $ack_mode == 5){$Config{'email'} = $TeamEmail;} # print "- - SND $Config{email} -am $ack_mode i- $Form{CorporInd}
"; if ( $Config{'email'} eq ""){return;} open(MAIL,"|$mailprog -f$EventEmail"); $MODE1 = "MAIL" ; select MAIL ; print "To: $Config{'email'}\n"; # print "Cc: $Config{'recipient'}\n"; print "From: $Config{'email'}\n"; # print "Content-type: text/html\n" ; print "Subject: $racetitle1\n\n" ; # print STDOUT "$Config{email} - $EventxEmail"; #print STDOUT " OK HERE -";exit; # select ; # $prhead = 0; # &html_header; if($ack_mode == 5){print "Cigna Registration For:\n\n";} print "$Form{firstname} " ; print "$Form{lastname}\n" ; print "$Form{address}\n" ; print "$Form{city}, " ; print "$Form{state} " ; print "$Form{zip}\n" ; if($ack_mode == 3){print "($TeamMemberCount) members for Team $LongTeamName\n";} print "$racetitle1\n" ; print "Confirmation # $Config{control}\n\n" ; if($ack_mode == 4){&DoNeedWaiver;} # print "Confirmation # $dtos-$ttos\n\n" ; print "$EventDesc\n\n"; # $MODE1="DISPLAY"; if ($ChipRace eq "YES"){&pr_chipinfo;} 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 signature { # open (SIG,"/var/www/virts/gsrs/mwrr/signature.txt") ; open (SIG,"/var/www/custom/html/signature.txt") ; while () {print "$_" ; } close (SIG); } sub DoNeedWaiver{ if($WaiverIsSigned eq "WAIVER OK"){ return; } print "\nYou have been registered for the $racetitle1 \n"; print "as part of the $LongTeamName team\n\n"; print "Before you can participate in this event you will need to read and accept the\n"; print "conditions and waiver for this event.\n\n"; print "Click or copy the link below in to your browsers URL address box to complete the waiver process.\n\n"; print "http://www.comfortsignups.com/cgi-bin/waiveraccept?Event=$CompanyID|$EventID\n"; } sub do_alert { print "\n"; } sub ccgetinfo{ open (CCI, "/var/www/custom/html/ccgetinfo1.htm"); $CCIMode = 1; while () { # if(index($_,"") > -1) {$CCIMode = 0;} if($CCIMode == 1) {print "$_"; } # if(index($_,"") > -1) {$CCIMode = 1;} } 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";} @TheTeams = `$SORT -u -f $TeamFile $TEAMNAMES `; if($TheTeams[0] ne "") { print "$TeamTitle
"; print ""; if ($isNow < $EventStop){ print "
If Your Team Is Not Listed, Click => $AddTeamStuff"; } print "
"; if($AskOtherTeam ne ""){ print "
Other(if not in above list)"; print "
You will be designated at Team/Group contact for the new team."; } #print " more info\n"; print""; } sub pr_prices { if ($SeriesID eq "" && $Form{CorporInd} ne "XXCorpTeam") { $ServiceCharge = sprintf ("%9.2f",($EventFee+$FlatAdd) * $PercentAdd) ; print ""; if ($Adjustment eq "ADD") { print "Service Charges Will Be Added In Next Step:"; } print "\n"; $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") { print "
";} if($SeriesID){ print " One or more of these events";}else{print "This event";} print " uses the ChampionChip timing and scoring system.\n"; if ($MODE1 eq "DISPLAY") { print "
"; print "If you own your own ChampionChip and plan to use it at this event, put the code in the space below."; print "
"; print "
"; print ""; } print "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") { print "
"; } print "THE CHIP IS MANDATORY IN ORDER TO BE TIMED.\n"; if ($MODE1 eq "DISPLAY") { print "
"; } print "The Chip you receive MUST BE RETURNED or you will charged with a \$35.00 replacement fee.\n\n"; if ($MODE1 eq "DISPLAY") { print "
"; } } 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"; 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";} } 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); # if($Form{CoEd} eq ""){$Form{CoEd} = "$Form{gender}"; } $ccinvoice = "$dtos$ttos"; $csvline = "\"" ; $csvline = $csvline. "$dtos\",\"" ; $csvline = $csvline. "$ttos\",\"" ; $csvline = $csvline. "$RACE\",\"" ; $csvline = $csvline. "$TYPE\",\"" ; $csvline = $csvline. "$Form{EventIDNum}\",\"" ; $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. "$LongTeamName\",\"" ; #$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. "$Form{category}\",\"" ; $csvline = $csvline. "$WaiverIsSigned\",\"" ; $csvline = $csvline. "$Form{CoEd}\",\"" ; $csvline = $csvline. "\"" ; } sub add_to_file { # if ($Form{lastname} eq "" ){return;} if ($Group eq "YES" || $Form{signup_type} eq "GROUP") { open (CSV, ">>$incdir/$Event/GRPDATA.csv"); }else{ open (CSV, ">>$incdir/$Event/REGDATA.csv"); } print CSV "$csvline\n" ; close (CSV); if ($TotalKids > 0) {&add_to_funrun_file ; } } sub add_to_funrun_file { $dtos = substr($Config{control},0,8); $ttos = substr($Config{control},9,6); open (CSV, ">>$incdir/$Event/FUNRUN.csv"); foreach (@Kids){ ($expm,$expy)= split(/\//,$cardexpire) ; ($KLast,$KFirst,$KAge,$KGender) = split( /\,/,$_); print CSV "\"$dtos\",\"" ; print CSV "$ttos\",\"" ; # print CSV "\"$Config{control}\",\"" ; print CSV "FUN RUN\",\"" ; 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 "\n"; } close (CSV); } sub make_ccdata { $CCFEE = sprintf ("%9.2f",$TOTAL+$ServiceCharge); $CCFEE = sprintf ("%9.2f",$CCFEE); $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 ; $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."\"0\","; # $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."\"0\","; # $ccinfoline = $ccinfoline."\"$TOTAL\"," ; $ccinfoline = $ccinfoline."\"$ServiceCharge \"," ; $ccinfoline = $ccinfoline."\"$Address_VCode\","; $ccinfoline = $ccinfoline."\"\","; $ccinfoline = $ccinfoline."\"$LongTeamName\","; $ccinfoline = $ccinfoline."\"\""; } sub add_to_cc_file { # if ($Form{lastname} eq "" ){return;} 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 { if ($TYPE eq "ON-LINE") { &SaveToCCfile;} &SaveToREGfile; } sub SaveToCCfile { # if ($Form{lastname} eq "" ){return;} $CCFILE = "$incdir/$Event/ccfiles/$Config{control}"; open (CC, ">>$CCFILE"); # print CC "\"S\",\"$cardnumber\",\"$cardexpire\",\"$CCFEE\","; print CC "$ccinfoline,$csvline\n"; close (CC) ; } sub SaveToREGfile { # if ($Form{lastname} eq "" ){return;} if ($Group eq "YES" || $Form{signup_type} eq "GROUP") { $CSVFILE = "$incdir/$Event/grpfiles/$Config{control}"; }else{ $CSVFILE = "$incdir/$Event/regfiles/$Config{control}"; } open (CSV, ">> $CSVFILE") ; print CSV "$csvline\n" ; close (CSV); } 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 $PickType 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"; } 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 " or "; print "Multiple Team Members."; print "
"; print ""; &teamnames; } sub CorpSignup { #$TotCurrent = `$GREP -c -h "$LongTeamName" $incdir/$Event/REGDATA.csv`; $TotCurrent = `$GREP -c -h "$TeamName" $incdir/$Event/REGDATA.csv`; print "
"; $TeamMemberCount = 0; print ""; print "
"; if ($TotCurrent > 0 ){ print "
Currently Registered Team Member Information
"; print ""; print "
Total: $TeamMemberCount
"; } print "
"; #$LastEntered = `$GREP -c -h "," $incdir/$Event/$Teamcontrol-$TeamName`; if ($LastEntered > 0){ $TeamMemberCount = 0; print "This Session Id=$Teamcontrol
"; print ""; # print ""; # print "
Total: $TeamMemberCount"; # print sprintf(" - \$%20.2f",$TeamMemberCount*$FEE) ; print "
Total: $TeamMemberCount"; print sprintf(" - \$%20.2f",$TeamMemberFees) ; } print "
"; print "\n\n"; #print "\n"; # print "Up-load team members from CSV file: this will append to the current file"; print "
"; print ""; print ""; print "Enter A New Team Member's Informaton Below"; $PickType = "This Member's"; &FORM_input("hidden","PaperEntry","$Form{PaperEntry}"); } } sub GetTeamMembers { $TeamName= $Form{team_name}; $TeamMemberFees = 0; $TeamMemberCount= 0; $TotCurrent =`$CAT -c -h $incdir/$Event/$Teamcontrol-$TeamName`; if ($LastEntered > 0 || $Step == 5) { foreach (`$CAT $incdir/$Event/$Teamcontrol-$TeamName`){ ++$TeamMemberCount; (@TMData) = split(/\",\"/,$_); $TMData[0] =~ s/\"//; $TeamMemberFees = $TeamMemberFees + $TMData[$TMFPos]; if ($Step < 5) { print"\n"; } if ($Step == 5){ $csvline = $_; chop $csvline; $Config{control} = $TMData[$TMFControl]; $TeamMemberEmail = $TMData[12]; if (!-f "$incdir/$Event/regfiles/$Config{control}"){ &SaveToREGfile; &add_to_file; $ack_mode = 4; $Form{firstname} = $TMData[6] ; $Form{lastname} = $TMData[5]; $Form{address} = $TMData[7]; $Form{city} = $TMData[8] ; $Form{state} = $TMData[9]; $Form{zip} = $TMData[10]; &send_ack } } } } } # print "\n"; # &getraceopts("$optfile") ; # if($Form{ForcePrice} ne ""){$EventFee=$Form{ForcePrice} ;} #} sub AddToTeamFile { &calcage; # print "-RDA $wrk"; &GetControlStuff; $HoldControl = $Config{control}; $Config{control} = $control ; #"$dtos-$ttos-"; $TeamName = $Form{team_name}; $T_COMPANY = $LongTeamName; $T_ADDRESS = $TeamAddress ; $T_CSZ = $TeamCSZ; $T_CONTACT = $TeamCaptain; $T_EMAIL = $TeamEmail ; $T_PHONE = $TeamPhone ; $TOTAL = $FEE; $Phone = $Form{Phone}; &make_ccdata ; &do_file_stuff; $ack_mode = 4; &send_ack; $Config{control} = "$HoldControl"; $email = $Phone= ""; $Step = 1; $TeamName = $Form{team_name}; $Action = "CONTINUE" ; } sub GetControlStuff { $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); $sdtos =~ tr [a-z] [A-Z] ; } sub DeleteSelected { $TeamName = $Form{team_name}; $DeleteIt = int($Form{DeleteIt}); $OldTFile = "$incdir/$Event/$Teamcontrol-$TeamName"; $NewTFile = "$OldTFile-NEW"; #print "--TFILES-- $OldTFile -- $NewTFile"; open(OLDT, "<$OldTFile"); open(NEWT, ">$NewTFile"); $ThisTOne = 1; while (){ (@TMData) = split(/\",\"/,$_); $TMData[0] =~ s/\"//; # if($DeleteIt != $ThisTOne){ print NEWT $_ ; } if($DeleteIt != "$TMData[0]$TMData[1]"){ print NEWT $_ ; } ++$ThisTOne; } close(OLDT); close(NEWT); unlink("$OldTFile"); system("mv $NewTFile $OldTFile"); $Step = 1; $TeamName = $Form{team_name}; $Action = "CONTINUE" ; } sub AddTeamToList { $Form{Step} = $Step = 4; $require = ""; $Config{required} = "team_name"; $FEE = $FEE * $Form{TeamMemberCount}; print "\n"; # print "Add Team To List"; } sub TeamListDone { } sub DoStepZero { print "

Corporate Team Members

"; print "
";
	 print `$CAT $incdir/$Event/Message1.txt`;
	 print "
\n"; &form_begin("form1","$FORM1"); print "\n"; print "\n"; # print "This Sign-up is for Corporate Teams Members Only!
\n"; # print "If you want to Sign-Up as an Individual Participant "; # print " Click Here"; # print ""; # print "

Click Here To Sign-up As An INDIVIDUAL"; # print "
(Not Part Of A Corporate Team)

"; &New_Table("Ask Signup" , "border=1") ; print "\n\n"; print ""; print ""; # print "I am signing up ....
"; # print "Just Me\n"; # print " or "; # print "Multiple Team Members."; print ""; #print "Individual (Just Me) signups are not available at this time
"; #print "while adjustments are being made.

"; #print "This message will be removed when availability is restored."; print "

"; print "Corporate Team Registration Fees will not be accepted online.
"; print "Team Captains should collect their Team's Registration
"; print "Fees and send ONE check, made payable to:
"; print "    CIGNA/Elliot 5K"; print "
Send to:
"; print " CIGNA HealthCare
"; print " Two College Park Drive
"; print " Hooksett, NH 03106.
"; # 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); # print "
"; # print "\n\n"; # print "If you DO NOT have a profile, you can save one
"; # print "at the end of the registration process.
"; print ""; print "\n\n"; # print "
"; #if($CompanyID eq "cigna"){&AskSigningUp;} &teamnames; print "\n"; if ($isNow < $EventStop){ print "
I am signing up ....
"; print "Just Me\n"; print " or "; print "Multiple Team Members."; print "

Team Registration Password "; print " (If required)\n" ; print "
\n"; print "
\n"; } print "

"; print "Team Captain Login. (To Change Team Information)
\n"; # print "
\n"; print "Login:   "; print "Password:\n"; print "
\n"; # print "

"; print "    
"; print "
"; print ""; &form_end("1") ; &html_footer; exit; } sub DoStepOne { if ($isProfile) { print "Welcome back $firstname $lastname
\n"; } &help_script; &form_begin("form1","$FORM1"); print ""; if ($Form{CorporInd} ne "CorpTeam"){&get_waiver_ok; } &form_end($Step+1); &html_footer; exit; } sub DoStepFive { $last4 = "XXXX-XXXX-XXXX-".substr($cardnumber,length($cardnumber)-4,4) ; 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 (@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" ; } if($Form{TestMode} ne "YES" && $test_mode eq "FALSE") { print "
Processing 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.") ; } } # end Step = 5 sub DoAskFunRun { &Table_Start; print "

Kids Fun Run: Ages $funrunage Fee: \$$funrunfee each

"; print "I would also like to signup the following children for the Kids Fun Run"; 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 children
\n"; print "Please enter LASTNAME,FIRSTNAME,AGE,GENDER seperated by commas:
\n"; print "Example: SMITH,TOM,6,M
\n"; print "
\n"; print "Please enter one name on each line.\n"; &Table_End; } sub GetGoodEvent { 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,$EventContact,$EventPhone,$EventEmail,$CompanyName,$CompanyAddress1,$CompanyAddress2,$CompanyAddress3,$filler1,$filler2,$COSTATUS,$SeriesIDx) =split(/\|/, $goodEvent); &html_header("Computer Comfort Sign-ups","BGCOLOR=#FFFEEA"); # $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" ; # print "$isNow - $EventOn - $EventOff"; if ("$Form{lastname}" eq "BOULTON" && "$Form{firstname}" eq "BENNY") { # &html_header ; # print "$CompanyID --- $EventID --
"; # &return_html ; } if ($ENV{REMOTE_ADDR} eq "216.107.209.01"){ $EventStart=20000000;$EventStop=999999999999;} if (index($ENV{QUERY_STRING},"TestMode=YES")>0){ $EventStart=20000000;$EventStop=999999999999;} $racetitle1 = $EventName; } sub DoEachTeamMember { #print "Do Each Team Member"; #print " TMC $TeamMemberCount"; if ($TotalTeam > 0){ &TotalTeamAdd ;} if ($TeamMemberCount > 0){ &InsertTeamData ;} } sub InsertTeamData { # print "Insert Team Data"; $ack_mode = 3; } sub TotalTeamAdd{ $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 ; } ## end if INCLUDED (@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}= ""; &do_file_stuff; } ## end Foreach team member } sub PrintCorpInfo { print "
"; print "$LongTeamName
\n"; print "$TeamCaptain
\n"; print "$TeamAddress
\n"; print "$TeamCSZ
\n"; print "$TeamPhone
\n"; print "$TeamEmail
\n"; print "

"; } sub DoTheKids1 { print "Total Fun Run Fees\n"; print ""; print sprintf("%7.2f",$TotalKids*$funrunfee); $TOTAL = $TOTAL + ($TotalKids*$funrunfee); $FEE = $TOTAL; } sub DoTheSeries1 { #(@Series)=split(/\, /,$Form{SeriesEvent}); foreach (@Series){ (@SerEV)=split(/\|/,$_); $TOTAL = $TOTAL +$SerEV[2]; $SeriesAdd = $SeriesAdd +1; print "\n$SerEV[3]"; print ""; print sprintf ("\$%5.2f",$SerEV[2]); } } sub SendPassword { if($Form{team_name} eq ""){print "
You did not select your Team Name
"; }else{ if($TeamEmail eq ""){ print "
Unable to locate Team Contact Email.
"; print "Please contact Support\@comfortsignups.com"; }else{ print "
Password Sent to $TeamEmail\n"; } open(MAIL,"|$mailprog -fSignups\@comfortinc.com"); select MAIL; print "To: $TeamEmail\n"; # print "From: $EventEmail\n"; print "Bcc: support\@comfortsignups.com\n"; print "Subject: $racetitle1 Login Information\n\n" ; print "A request was made for the team login information\n\n"; print "Here is the Comfort Signups Team Login Information\n"; print "for the $EventName Event\n\n"; print "Team: $LongTeamName\n"; print "Login: $CaptLogin\n"; print "Password: $CaptPasswd\n"; select STDOUT ; close (MAIL); } print "

"; print "

or Click you Browser's Back Button"; exit; }