\&login_page, 'Continue to Register' => \®ister_page, 'Continue' => \®ister_page, 'Submit Registration' => \&process_page, 'Submit Information' => \&process_page ); $Current_Screen = param(".State") || "Default"; die "No screen for $Current_Screen" unless $States{$Current_Screen}; !> #include ./2018spring_header.iphtml #include ./db.iphtml ($screen_name eq $Current_Screen); } !> 'center'},em('REQUIRED FIELDS ARE MARKED WITH AN ASTERISK (*)')); print<Step 1 of 3

Current or past $society members, enter your email address below. Non-members, enter your email address and proceed to the registration form.


EOF ; print <

PRINTABLE REGISTRATION FORM

If you do not want to use this online registration form, you may use the printable registration form to register.

EOF } sub register_page { my $active = shift; my $reg_email = param('loginemail'); my $orderID = ''; my $member_no = ''; my $balance = 0; my $registered = 0; my $application = 0; my $renewal = 0; my $auto_renew = 0; my $registered_type = ''; my $elem = 0; my $msg = ''; my $error_msg = ''; my @reg_fields = (); my $registrant_in_db = 0; return unless $active; if (!param('loginemail')) { print p({-style=>'color: #F00'},strong('Error - Email Address is required!')); print p(''); return; } print h3({-align=>'center'},em('REQUIRED FIELDS ARE MARKED WITH AN ASTERISK (*)')); $orderID=sprintf("%02d%02d%02d%02d%02d%02d%03d",$year % 100, $mon+1,$mday,$hour,$min,$sec,sprintf("%02d", rand(1000))) if !param('id'); $sth = $main::dbh->prepare(qq{ SELECT t1.lname, t1.fname, t1.title, mail_address2, mail_address3, mail_city, mail_state, mail_zip, mail_country, phone, email, otherAssocID, fax, t1.member_id, member, NickName, balance_due, t1.title, CONCAT_WS(' ',t1.fname,t1.m_initial,t1.lname,t1.title), regtype_id,email2,auto_renewal,group_id,t1.hospital FROM member t1 LEFT JOIN registrants t2 ON t1.member_id=t2.member_id AND meeting_no=? AND workshop_no=0 WHERE email LIKE ? OR email2 LIKE ? LIMIT 1}) || $main::dbh->errstr; $sth->execute($meeting_number, $reg_email, $reg_email) || $main::dbh->errstr; @reg_fields = $sth->fetchrow; $sth->finish(); foreach $elem (@reg_fields) { $elem = encode_entities($elem); } $registrant_in_db = 1 if @reg_fields; $member = $reg_fields[14]; $member_no = $reg_fields[13]; $balance = 1 if $reg_fields[16] > 0; $registered_type = $reg_fields[19] if $reg_fields[19]; if ($reg_fields[21] || $reg_fields[22]) { $auto_renew = 1; } $sth = $main::dbh->prepare(qq{ SELECT 1 FROM registrants WHERE cancelled IS NULL AND workshop_no=0 AND meeting_no = ? AND member_id = ? LIMIT 1}) || $main::dbh->errstr; $sth->execute($meeting_number, $member_no) || $main::dbh->errstr; @fields = $sth->fetchrow; $sth->finish(); $registered = 1 if $fields[0]; if ($registrant_in_db) { $msg .= "We show you having registered for a previous $society event with this email address. If you're not $reg_fields[18], register with a different email address.

"; } SWITCH: { if (scalar @reg_fields == 0) { $msg .= "The email address provided was not found in our system. If you know you have been a member or have attended an $society meeting in the past and used this email address, please contact the $society office."; $msg .= " Join $society now by completing the membership application and save on your registration fees by registering at the member rate." if $show_application; last SWITCH; } if ($registered) { $msg .= 'You are already registered for this meeting; continue if you want to add additional activities.'; last SWITCH; } if (!$member && $balance) { $msg .= "Renew your $society membership and register at the member rate." if $show_renewal_appl; last SWITCH; } if (!$auto_renew && ($member && $balance)) { $msg .= 'Our records show you having an outstanding balance for your membership dues.'; last SWITCH; } if ($reg_fields[14] == 0) { $msg .= 'Join '.$society.' now by completing the membership application and save on your registration fees by registering at the member rate.' if $show_application; last SWITCH; } } ################## # Sold Out Items # ################## my @sold_out_numbers; my @waitlist_numbers = (); if ($get_database_soldout) { my $sth2 = ''; $sth = $main::dbh->prepare(qq{ SELECT workshop_no,total_registered,capacity,waitlist FROM meeting WHERE meeting_no = ? }); $sth->execute($meeting_number); undef(@fields); while (@fields = $sth->fetchrow_array()) { if ($fields[3]) { $sth2 = $main::dbh->prepare(qq{ SELECT COUNT(*) FROM waitlist_event WHERE meetingID=? AND workshopID=? }); $sth2->execute($meeting_number, $fields[0]); my @fields2 = $sth2->fetchrow; $sth2->finish(); push @sold_out_numbers, $fields[0] if $fields[1] + $fields2[0] >= $fields[2]; push @waitlist_numbers, $fields[0] if $fields[1] + $fields2[0] >= $fields[2]; } else { push @sold_out_numbers, $fields[0] if $fields[1] >= $fields[2]; } } $sth->finish(); } else { @sold_out_numbers = qw(7); # put WSNumbers of sold out workshops here } ##################### # Registration Types# ##################### my @reg_types; my $i = 0; my $cursor2; # @reg_types = (["T", "Testing", [1.5,1],[["SUB1", "Sub-Type 1"],["SUB2", "Sub-Type 2"]]]); # For Testing # Note -- Due to really poor planning if the reg_type does not have a sub_type but has a footnote you have to do this # @reg_types = (["T", "Testing", [1.5,1]); # For Testing # $reg_types[1][4] =1; my $SQL = "SELECT regtype_id,reg_type,regfee,earlyfee,typeDesc,access,groupID FROM reg_type WHERE status='Enabled' AND meeting_no=?"; if ($auto_renew && ($member || !$balance)) { $SQL .= " AND access='Members'"; } $SQL .= " ORDER BY access, displayOrder"; $cursor2 = $main::dbh->prepare(qq{ $SQL }); $cursor2->execute($meeting_number); while (my @db_fields = $cursor2->fetchrow) { $reg_types[$i][0] = $db_fields[0]; $reg_types[$i][1] = $db_fields[1]; $reg_types[$i][2][0] = $db_fields[2]; $reg_types[$i][2][1] = $db_fields[3]; $reg_types[$i][5] = $db_fields[4]; $reg_types[$i][6] = $db_fields[5]; $reg_types[$i][7] = $db_fields[6]; $i++; } $cursor2->finish; ##################### # Footnotes # ##################### # $reg_types[0][4]=[1]; # $reg_types[1][4]=[2]; # $reg_types[2][4]=[2,3]; # $reg_types[3][4]=[1]; # $reg_types[4][4]=[2]; # Formatting for @reg_types is (["Type1_Name_Written_to_File", "Type1_Description", [Type1_Late_Cost, Type1_Early_Cost], [["Sub_Type1_Name_Written_to_File", "Sub_Type1_Description"]], "Footnote_Number"],["Type2_Name_Written_to_File", "Type2_Description", [Type2_Late_Cost, Type2_Early_Cost]]) # i.e. (["Member","Society Member", [200, 100]],["NonMember", "Non-Member", [250, 200]]) # you can also do it this way if you like lots of lines and [] # $reg_types[0][0] = "Type1_Name_Written_to_File"; # use ONEDAY for oneday reg # $reg_types[0][1] = "Type1_Description"; # $reg_types[0][2][0] = "Type1_Late_cost"; # $reg_types[0][2][1] = "Type1_Early_cost"; # $reg_types[0][3][0][0] = "Type1_SubField1_Written_to_File"; # $reg_types[0][3][0][1] = "Type1_SubField1_Description"; # $reg_types[0][3][1][0] = "Type1_SubField2_Written_to_File"; # $reg_types[0][3][1][1] = "Type1_SubField2_Description"; # $reg_types[0][4] = ["Footnote Number"]; This is an arry in case there is more than one footnote ################# # Guest ######### ################# my @guest; my @fields2 = (); my $icounter = 0; my $sth2 = $main::dbh->prepare(qq{ SELECT workshop_no, name, FORMAT(late_fee,0), FORMAT(early_fee,0), DATE_FORMAT(start_date, '%Y%m%d'), TIME_FORMAT(start_time, '%H%i'),register_acct,CONCAT_WS(' - ',TIME_FORMAT(start_time,'%l:%i'),TIME_FORMAT(end_time,'%l:%i %p')),m.description FROM meeting m LEFT JOIN event_type et ON m.eventTypeID=et.eventID WHERE m.status='Enabled' AND et.eventType LIKE '%guest%' AND m.meeting_no=? ORDER BY workshop_no }); $sth2->execute($meeting_number); while (@fields2 = $sth2->fetchrow_array()) { $guest[$icounter][0] = $fields2[0]; $guest[$icounter][1] = "$fields2[1]"; $guest[$icounter][2][0] = "$fields2[2]"; $guest[$icounter][2][0] =~ s/,//g; $guest[$icounter][2][1] = "$fields2[3]"; $guest[$icounter][2][1] =~ s/,//g; $guest[$icounter][3] = $fields2[4] . $fields2[5]; $guest[$icounter][4] = $fields2[6]; $guest[$icounter][5] = $fields2[8]; $icounter++; } $sth2->finish(); ######################## # Accompanying Persons # ######################## my @extras; my @fields2; my $sth2 = $main::dbh->prepare(qq{ SELECT FORMAT(late_fee,0), FORMAT(early_fee,0), register_acct, name, workshop_no, DATE_FORMAT(start_date, '%Y%m%d'), TIME_FORMAT(start_time, '%H%i'),CONCAT_WS(' - ',TIME_FORMAT(start_time,'%l:%i'),TIME_FORMAT(end_time,'%l:%i %p')) FROM meeting WHERE eventTypeID=X3 AND meeting_no=? LIMIT 1 }); $sth2->execute($meeting_number); while (@fields2 = $sth2->fetchrow_array()) { $extras[0] = "$fields2[0]"; $extras[1] = "$fields2[1]"; $extras[2] = "$fields2[2]"; $extras[3] = "$fields2[3]"; $extras[4] = "$fields2[4]"; } $sth2->finish(); my @extras2; # =(0,0, 40305); my @kidsmondaynightreception; # = (30,20, 40305); # format @extras=(late_reg_price, early_reg_price, accountnumber) ################# # Reception ##### ################# my @mondaynightreception; my @fields2 = (); my $icounter = 0; my $sth2 = $main::dbh->prepare(qq{ SELECT workshop_no, name, FORMAT(late_fee,0), FORMAT(early_fee,0), DATE_FORMAT(start_date, '%Y%m%d'), TIME_FORMAT(start_time, '%H%i'),register_acct,CONCAT_WS(' - ',TIME_FORMAT(start_time,'%l:%i'),TIME_FORMAT(end_time,'%l:%i %p')),m.description FROM meeting m LEFT JOIN event_type et ON m.eventTypeID=et.eventID WHERE m.status='Enabled' AND et.eventType LIKE '%reception%' AND m.meeting_no=? ORDER BY workshop_no }); $sth2->execute($meeting_number); while (@fields2 = $sth2->fetchrow_array()) { $mondaynightreception[$icounter][0] = $fields2[0]; $mondaynightreception[$icounter][1] = "$fields2[1]"; $mondaynightreception[$icounter][2][0] = "$fields2[2]"; $mondaynightreception[$icounter][2][0] =~ s/,//g; $mondaynightreception[$icounter][2][1] = "$fields2[3]"; $mondaynightreception[$icounter][2][1] =~ s/,//g; $mondaynightreception[$icounter][3] = $fields2[4] . $fields2[5]; $mondaynightreception[$icounter][4] = $fields2[6]; $mondaynightreception[$icounter][5] = $fields2[8]; $icounter++; } $sth2->finish(); ################# # Misc etc ###### ################# my @misc; my @fields2 = (); my $icounter = 0; my $sth2 = $main::dbh->prepare(qq{ SELECT workshop_no, name, FORMAT(late_fee,0), FORMAT(early_fee,0), DATE_FORMAT(start_date, '%Y%m%d'), TIME_FORMAT(start_time, '%H%i'),register_acct,CONCAT_WS(' - ',TIME_FORMAT(start_time,'%l:%i'),TIME_FORMAT(end_time,'%l:%i %p')),m.description FROM meeting m LEFT JOIN event_type et ON m.eventTypeID=et.eventID WHERE m.status='Enabled' AND et.eventType LIKE '%other%' AND m.meeting_no=? ORDER BY workshop_no }); $sth2->execute($meeting_number); while (@fields2 = $sth2->fetchrow_array()) { $misc[$icounter][0] = $fields2[0]; $misc[$icounter][1] = "$fields2[1]"; $misc[$icounter][2][0] = "$fields2[2]"; $misc[$icounter][2][0] =~ s/,//g; $misc[$icounter][2][1] = "$fields2[3]"; $misc[$icounter][2][1] =~ s/,//g; $misc[$icounter][3] = $fields2[4] . $fields2[5]; $misc[$icounter][4] = $fields2[6]; $misc[$icounter][5] = $fields2[8]; $icounter++; } $sth2->finish(); ######################## # Reception # ######################## my @extras3; my @fields2; my $sth2 = $main::dbh->prepare(qq{ SELECT FORMAT(late_fee,0), FORMAT(early_fee,0), register_acct, name, workshop_no, DATE_FORMAT(start_date, '%Y%m%d'), TIME_FORMAT(start_time, '%H%i'),CONCAT_WS(' - ',TIME_FORMAT(start_time,'%l:%i'),TIME_FORMAT(end_time,'%l:%i %p')) FROM meeting WHERE eventTypeID=4 AND meeting_no=? LIMIT 1 }); $sth2->execute($meeting_number); while (@fields2 = $sth2->fetchrow_array()) { $extras3[0] = "$fields2[0]"; $extras3[1] = "$fields2[1]"; $extras3[2] = "$fields2[2]"; $extras3[3] = "$fields2[3]"; $extras3[4] = "$fields2[4]"; } $sth2->finish(); ####################### # Special item # ####################### my @specialitems; my @fields2; my $icounter = 0; my $sth2 = $main::dbh->prepare(qq{ SELECT workshop_no, name, FORMAT(late_fee,0), FORMAT(early_fee,0), DATE_FORMAT(start_date, '%Y%m%d'), TIME_FORMAT(start_time, '%H%i'),register_acct,CONCAT_WS(' - ',TIME_FORMAT(start_time,'%l:%i'),TIME_FORMAT(end_time,'%l:%i %p')),m.description FROM meeting m LEFT JOIN event_type et ON m.eventTypeID=et.eventID WHERE m.status='Enabled' AND et.eventType LIKE '%lunch%' AND m.meeting_no=? ORDER BY workshop_no }); $sth2->execute($meeting_number); while (@fields2 = $sth2->fetchrow_array()) { $specialitems[$icounter][0] = $fields2[0]; $specialitems[$icounter][1] = "$fields2[1] " . "(".$fields2[7].")"; $specialitems[$icounter][2][0] = "$fields2[2]"; $specialitems[$icounter][2][0] =~ s/,//g; $specialitems[$icounter][2][1] = "$fields2[3]"; $specialitems[$icounter][2][1] =~ s/,//g; $specialitems[$icounter][3] = $fields2[4] . $fields2[5]; $specialitems[$icounter][4] = $fields2[6]; $icounter++; } $sth2->finish(); ################# # Workshops etc # ################# my @workshops; my @fields2; my $icounter = 0; my $sth2 = $main::dbh->prepare(qq{ SELECT workshop_no, name, FORMAT(late_fee,0), FORMAT(early_fee,0), DATE_FORMAT(start_date, '%Y%m%d'), TIME_FORMAT(start_time, '%H%i'),register_acct,CONCAT_WS(' - ',TIME_FORMAT(start_time,'%l:%i'),TIME_FORMAT(end_time,'%l:%i %p')),m.description FROM meeting m LEFT JOIN event_type et ON m.eventTypeID=et.eventID WHERE m.status='Enabled' AND et.eventType LIKE 'workshop%' AND m.meeting_no=? ORDER BY workshop_no }); $sth2->execute($meeting_number); while (@fields2 = $sth2->fetchrow_array()) { $workshops[$icounter][0] = $fields2[0]; $workshops[$icounter][1] = "$fields2[1] " . "(".$fields2[7].")"; $workshops[$icounter][2][0] = "$fields2[2]"; $workshops[$icounter][2][0] =~ s/,//g; $workshops[$icounter][2][1] = "$fields2[3]"; $workshops[$icounter][2][1] =~ s/,//g; $workshops[$icounter][3] = $fields2[4] . $fields2[5]; $workshops[$icounter][4] = $fields2[6]; $workshops[$icounter][5] = $fields2[8]; $icounter++; } $sth2->finish(); ######## # PBLs # ######## my @pbls = (); my @fields2; my $icounter = 0; my $sth2 = $main::dbh->prepare(qq{ SELECT workshop_no, name, FORMAT(late_fee,0), FORMAT(early_fee,0), DATE_FORMAT(start_date, '%Y%m%d'), TIME_FORMAT(start_time, '%H%i'),register_acct,CONCAT_WS(' - ',TIME_FORMAT(start_time,'%l:%i'),TIME_FORMAT(end_time,'%l:%i %p')),m.description FROM meeting m LEFT JOIN event_type et ON m.eventTypeID=et.eventID WHERE m.status='Enabled' AND et.eventType LIKE 'breakfast%' AND m.meeting_no=? ORDER BY workshop_no }); $sth2->execute($meeting_number); # SELECT workshop_no, CONCAT_WS(' - ',name,speaker), IF(late_fee,FORMAT(late_fee,0),0), IF(early_fee,FORMAT(early_fee,0),0), DATE_FORMAT(start_date, '%Y%m%d'), TIME_FORMAT(start_time, '%H%i'),register_acct FROM meeting WHERE eventTypeID=2 AND meeting_no=? ORDER BY workshop_no while (@fields2 = $sth2->fetchrow_array()) { $pbls[$icounter][0] = "$fields2[0]"; $pbls[$icounter][1] = $fields2[1]; $pbls[$icounter][2][0] = "$fields2[2]"; $pbls[$icounter][2][1] = "$fields2[3]"; $pbls[$icounter][3] = $fields2[4] . $fields2[5]; $pbls[$icounter][4] = $fields2[6]; $pbls[$icounter][5] = $fields2[8]; $icounter++; } $sth2->finish(); ## Format is the same as workshops ####################### # Intensive Workshops # ####################### my @intensive_ws; #@intensive_ws=(["65", "Pediatric Pain Medicine Special Interest Group", [250, 250], "201103311000", "23006"]); # # @intensive_ws = (["1" , "Upper Extremity", [250, 200], "200204250800","40301"], ["2" , "Upper Extremity", [250, 200], "200204251300","40301"], ["3" , "Lower Extremity", [250, 200], "200204250800","40301"], ["4" , "Lower Extremity", [250, 200], "200204251300","40301"]); # # ## Format is the same as workshops ################## # Master Classes # ################## my @master_classes; # # @master_classes = (["23" , "Complications of Regional Anesthesia and Closed claim Cases", [65, 50], "200204261400","40303"], ["24" , "Making Upper Extremity Blocks Work in a Busy Clinical Practice", [65, 50], "200204261600","40303"], ["53" , "Imaging techniques for Chronic Pain Evaluation and Management", [65, 50], "200204270800","40303"], ["54" , "How to Appy Continuous Catheter Techniques for Orthopaedic Pain Management", [65, 50], "200204271000","40303"], ["55" , "Complimentary and Alternative Medical Therapies for Pain", [65, 50], "200204271400","40303"], ["56" , "New Drugs and Novel Techniques for Regional Anesthesia", [65, 50], "200204271600","40303"]); # # @master_classes = (["200", "WSNumber=200", [15, 3], "200204261400", "123"], # ["201", "WSNumber=201", [15, 2], "200204261400", "123"]); ## Format is the same as workshops #################### # Reception Guests # #################### my @guest_cost; #$guest_cost[1]="68"; #Reception guest cost -- Early reg #$guest_cost[0]="78"; #Reception guest cost -- Late reg my $gitem="33"; #WS number for reception (see Daniel) my $gaccount="40305"; # Account number for extra reception guests (see Gail) my $reception="Saturday BBQ"; # Text should read something like "I plan to attend the PSV Reception/Buffet at the Museum of Art" my $reception_guest; #="I plan to bring a guest "; ## This Really should be Intergrated with the Dinner Below ####################################################### # Dinner (different rates for each registration type) # ####################################################### my @receptions; # if (!$member || $balance) # { # @receptions = # (["1", "Mentoring Session (includes lunch from 12:00 n - 1:00 pm)", # { # "1" => [140,125], # "5" => [140,125], # "2" => [90,75], # "15" => [90,75], # "3" => [90,75], # "4" => [90,75], # "23" => [140,125], # "21" => [90,75], # "18" => [90,75], # "6" => [165,150], # "9" => [165,150], # "24" => [165,150], # "7" => [90,75], # "8" => [90,75], # "20" => [90,75], # "22" => [90,75], # "19" => [90,75] # }, "201410091300", "40303"], # ); # } # else # { # @receptions = # (["1", "Mentoring Session (includes lunch from 12:00 n - 1:00 pm)", # { # "1" => [140,125], # "5" => [140,125], # "2" => [90,75], # "15" => [90,75], # "3" => [90,75], # "4" => [90,75], # "23" => [140,125], # "21" => [90,75], # "18" => [90,75] # }, "201410091300", "40303"], # ); # } # $receptions[0][0] # WS Number # $receptions[0][1] # Dinner Title # $receptions[0][2]{Reg_Type}[0]; # late fee # $receptions[0][2]{Reg_type}[1]; # early fee # $receptions[0][3] # YYYYMMDDhhmm Start Time # $receptions[0][4] # Account Number # $receptions[0][5] # Guests Not Yet Implemented ################# # Donations ##### ################# my @donations; my @fields2 = (); my $icounter = 0; my $sth2 = $main::dbh->prepare(qq{ SELECT workshop_no, name, FORMAT(late_fee,0), FORMAT(early_fee,0), DATE_FORMAT(start_date, '%Y%m%d'), TIME_FORMAT(start_time, '%H%i'),register_acct,CONCAT_WS(' - ',TIME_FORMAT(start_time,'%l:%i'),TIME_FORMAT(end_time,'%l:%i %p')),m.description FROM meeting m LEFT JOIN event_type et ON m.eventTypeID=et.eventID WHERE m.status='Enabled' AND et.eventType LIKE '%donation%' AND m.meeting_no=? ORDER BY workshop_no }); $sth2->execute($meeting_number); while (@fields2 = $sth2->fetchrow_array()) { $donations[$icounter][0] = $fields2[0]; $donations[$icounter][1] = "$fields2[1]"; $donations[$icounter][2][0] = "$fields2[2]"; $donations[$icounter][2][0] =~ s/,//g; $donations[$icounter][2][1] = "$fields2[3]"; $donations[$icounter][2][1] =~ s/,//g; $donations[$icounter][3] = $fields2[4] . $fields2[5]; $donations[$icounter][4] = $fields2[6]; $donations[$icounter][5] = $fields2[8]; $icounter++; } $sth2->finish(); ################# # Research Fund # ################# my $research_fund; # = $society . " Educational/Research Fund Donation (The $society is a 501(c) 3 organization and your donations are tax deductible as allowed by law. All voluntary contributions will be acknowledged.)" ; # Text for the research fund my @research = ("40230", "0", "0"); ############################# # Receptions, Dinners, etc. # ############################# my @bbq; #@bbq = (["33" , "Saturday BBQ", [78, 68], "200403060000", "24500"], ["34" , "Saturday Special Children's BBQ", [20, 15], "200403070100", "24500"] ); # like Workshops, but make sure times (which are not displayed on form) are different such as to make each entry unique - this does affect display ordering ################# # Custom Fields # ################# #This doen't work...didn't have time to do custom fields. ################### # Misc. Variables # ################### my %category; # %category=("C", "Cardiologist", "S", "Surgeon", "NA", "Neither"); # use O for Other (Other will be put into cat_other field) my @footnotes; # $footnotes[1]="Join $society now and save over 40% on your registration fee."; # $footnotes[2]="You MUST complete the above membership application to select this registration category."; # $footnotes[3]="Accepted AA students may attend at the student member rate, in addition to joining AAAA at the time of registration. Student dues are \$100 for the entire term of matriculation at the AA program in which the student is enrolled."; #$footnotes[4]="Pre-registration of Workshops/Evening Sessions is available to $society members only. If space is available, sessions will be opened to non-members on site."; ################################### # Field List, and Required Fields # ################################### my %required_fields=( "ssl_email", "Meeting Confirmation Email Address", "reg_type", "Registration Type", "hospital", "Hospital/Institution", "Nickname", "First Name/Nickname for Badge" ); ## Required Fields ############################# # Main Script -- Don't Edit # ############################# my %sold_out; my %waitlist = (); foreach (@sold_out_numbers) { $sold_out{$_} = "1"; } foreach (@waitlist_numbers) { $waitlist{$_} = "1"; } my $cgi = new CGI; my $i =0; my $late_day=substr($late_reg_date, 6, 2); my $late_month=substr($late_reg_date, 4, 2)-1; my $late_year=substr($late_reg_date, 0, 4)-1900; my $cutoff_time = timelocal(59,59,23,$late_day,$late_month,$late_year); my $current_time = time; my $reduced_rate = 0; my $state = ""; if (!$registrant_in_db) { $required_fields{"ssl_first_name"} = "First Name", $required_fields{"ssl_last_name"} = "Last Name", $required_fields{"ssl_ship_to_address1"} = "Address 1", $required_fields{"ssl_ship_to_city"} = "City", $required_fields{"ssl_ship_to_state"} = "State/Providence", $required_fields{"email"} = "Primary Email Address", $required_fields{"ssl_phone"} = "Office Phone" } if ($cgi->param('reg_type')) { if ($cgi->param('reg_type') != "14" && $cgi->param('reg_type') != "30") { $required_fields{"ssl_card_number"} = "Credit Card Number", $required_fields{"exp_month"} = "Expiration Date: Month", $required_fields{"exp_year"} = "Expiration Date: Year", $required_fields{"ssl_cvv2cvc2"} = "Security Code", $required_fields{"ssl_avs_address"} = "Card Billing Address", $required_fields{"ssl_avs_zip"} = "Card Billing Zip Code" } elsif (($cgi->param('extras')) && ($cgi->param('reg_type') eq "14" || $cgi->param('reg_type') eq "30")) { $required_fields{"ssl_card_number"} = "Credit Card Number", $required_fields{"exp_month"} = "Expiration Date: Month", $required_fields{"exp_year"} = "Expiration Date: Year", $required_fields{"ssl_cvv2cvc2"} = "Security Code", $required_fields{"ssl_avs_address"} = "Card Billing Address", $required_fields{"ssl_avs_zip"} = "Card Billing Zip Code" } elsif ($cgi->param('WS201410231130A')) { $required_fields{"ssl_card_number"} = "Credit Card Number", $required_fields{"exp_month"} = "Expiration Date: Month", $required_fields{"exp_year"} = "Expiration Date: Year", $required_fields{"ssl_cvv2cvc2"} = "Security Code", $required_fields{"ssl_avs_address"} = "Card Billing Address", $required_fields{"ssl_avs_zip"} = "Card Billing Zip Code" } } if ($cgi->param('compFellowship') eq "Yes") { $required_fields{"fellowshipYear"} = "Year Fellowship Completed", $required_fields{"fellowshipLoc"} = "Fellowship Location", $required_fields{"fellowshipCity"} = "Fellowship City", $required_fields{"fellowshipState"} = "Fellowship State", $required_fields{"fellowshipSpec"} = "Specialty" } if ($cgi->param('WS201305031130A')) { $required_fields{"preference1"} = "Indicate your preference for Shoulder or Knee Lab", $required_fields{"preference2"} = "Indicate your preference of Beach Chair or Lateral Decubitus", } if ((uc($cgi->param('ssl_ship_to_country')) =~ /UNITED STATES/) || (uc($cgi->param('ssl_ship_to_country')) =~ /U\.S\./) || (uc($cgi->param('ssl_ship_to_country')) =~ /US/) || (uc($cgi->param('ssl_ship_to_country')) =~ /USA/)) { $state = $cgi->param('ssl_ship_to_state'); } elsif (uc($cgi->param('ssl_ship_to_state')) ne "INTERNATIONAL") { $state = $cgi->param('ssl_ship_to_state'); } if ($cutoff_time >= $current_time) { $reduced_rate=1; } my $early_bird = 0; my $early_bird_cutoff_time; if ($early_bird_date > 0) { my $late_day=substr($early_bird_date, 6, 2); my $late_month=substr($early_bird_date, 4, 2)-1; my $late_year=substr($early_bird_date, 0, 4)-1900; $early_bird_cutoff_time = timelocal(0,0,0,$late_day,$late_month,$late_year); } if ($early_bird_cutoff_time > $ current_time) { $early_bird=1; } if ($cgi->param('.State') eq "Continue") { my $day = sprintf "%02.0f", $mday; my $date = $month . "/" . $day . "/" . $year; my $orderID=sprintf("%02d%02d%02d%02d%02d%02d%03d",$year % 100, $mon+1,$mday,$hour,$min,$sec,sprintf("%02d", rand(1000))); my $missing = ''; my $sender = $society . " Registration Request CGI "; # my $recipient = "regforms\@societyhq.com"; my $recipient = "daniel\@societyhq.com"; my $subject = $society . " " . $form . " - " . $cgi->param('ssl_last_name') . ", ". $cgi->param('ssl_first_name'); my $cost = 0; my $regcost=0; my $j=0; my $counter = 1; my $tab=0; my $card_type = ''; my $card_type_no = substr($main::cgi->param('ssl_card_number'), -4); my $key = ""; my @text; my $subcat=$cgi->param('reg_type') . "reg_type_sub"; my @reg_types_sub=$cgi->param($subcat); # FOR NON-MEMBER TRYING 2 REG FOR MEM WORKSHOPS if ($member == "0" && (($cgi->param('SI20170303A') eq "64") && (!$cgi->param('applyingfor')))) { $required_fields{'ws3represent'} = "You have selected an option that requires membership: You MUST select the Non-Member option or joining the society by completing the membership application"; } if ((%category) && (!$cgi->param('category'))) { $required_fields{'category'} = "Category"; } my @surveys = (); my $sth3 = $main::dbh->prepare(qq{ SELECT surveyID,survey,multiSubmit FROM survey WHERE meetingID = ? }) || $main::dbh->errstr; $sth3->execute($meeting_number) || $main::dbh->errstr; while (@surveys = $sth3->fetchrow_array()) { my $surveyComplete = 0; if (!$surveys[2]) { my $sth4 = $main::dbh->prepare(qq{ SELECT 1 FROM survey_users WHERE surveyID = ? AND userEmail= ? LIMIT 1 }) || $main::dbh->errstr; $sth4->execute($surveys[0], $cgi->param('loginemail')) || $main::dbh->errstr; $surveyComplete = $sth4->fetchrow(); $sth4->finish(); } if ($surveys[2] || !$surveyComplete) { my @surQuestions = &load_questions($surveys[0]); foreach my $question (@surQuestions) { my @indivQues = &get_question($question); if ($indivQues[2] eq "7" && $indivQues[3]) { if (!$cgi->param('survfield_'.$indivQues[0])) { $required_fields{'survfield_'.$indivQues[0]} = "Survey: $indivQues[1]"; } } else { if (!$cgi->param('survfield_'.$indivQues[0]) && $indivQues[3]) { $required_fields{'survfield_'.$indivQues[0]} = "Survey: $indivQues[1]"; } if (!$cgi->param('survfield_'.$indivQues[0]) && $indivQues[3] && $cgi->param('survfield_other_'.$indivQues[0])) { delete $required_fields{'survfield_'.$indivQues[0]}; } } } } } $sth3->finish(); foreach (keys %required_fields) { if (!$cgi->param($_)) { $missing .= "
  • $required_fields{$_} is required
  • \n"; } } if ($missing) { print p({-style=>'color: #F00'},strong('Error - Required information was not provided on the submitted form. Please use the back button and correct the following:')); print "
      $missing
    \n"; print p(''); return; } if (!$auto_renew && ($member && $balance) || (!$member)) { my $cursor2 = $main::dbh->prepare(qq{ SELECT 1 FROM reg_type WHERE meeting_no=? AND regtype_id=? AND access='Members' LIMIT 1 }); $cursor2->execute($meeting_number, $cgi->param('reg_type')); my $rv = $cursor2->fetchrow; $cursor2->finish(); if ($rv && (!$cgi->param('applyingfor') || !$cgi->param('member_option'))) { if (!$member && !$balance) { $required_fields{"applyingfor"} = "You have selected a $society Member Registration Category. You must complete the membership application: Category Applying For" if $show_application; } else { $required_fields{"member_option"} = "You have selected a $society Member Registration Category. You must complete the membership renewal notice: Renewal Notice Section" if $show_renewal_appl; } } } if ((!$member) && ($cgi->param('applyingfor'))) { $required_fields{"month"} = "Date of Birth: Month"; $required_fields{"day"} = "Date of Birth: Day"; $required_fields{"year"} = "Date of Birth: Year"; } if ($cgi->param('applyingfor') eq "6" || $cgi->param('applyingfor') eq "7") { $required_fields{"gradmonth"} = "Residency/Fellowship Ends: Month"; $required_fields{"gradyear"} = "Residency/Fellowship Ends: Year"; } foreach (keys %required_fields) { if (!$cgi->param($_)) { $missing .= "
  • $required_fields{$_} is required
  • \n"; } if ($_ eq "reg_type") { for ($i=0; defined($reg_types[$i]); $i++) { # if (($reg_types[$i][0] eq $cgi->param('reg_type')) && (defined($reg_types[$i][3]))) { # if ((%category) && (!$cgi->param('category'))) { # $missing .= "
  • Category
  • \n"; # } # } } } } if (defined($donations[0])) { for ($i=0; defined($donations[$i]); $i++) { if ($cgi->param("fund$donations[$i][0]")) { if (!($cgi->param("fund$donations[$i][0]") =~ /^[0-9]*$/)) { $missing .= "
  • $donations[$i][1] amount contains non-numeric characters
  • \n"; } } } } if (defined($guest[0])) { for ($i=0; defined($guest[$i]); $i++) { if ($cgi->param("numguest$guest[$i][0]")) { if (!($cgi->param("numguest$guest[$i][0]") =~ /^[0-9]*$/)) { $missing .= "
  • Number of $guest[$i][1] contains non-numeric characters
  • \n"; } } } } if ($cgi->param('extras')) { if (!($cgi->param('extras') =~ /^[0-9]*$/)) { $missing .= "
  • Number of accompanying persons contains non-numeric characters
  • \n"; } } if ($cgi->param('extras2')) { if (!($cgi->param('extras2') =~ /^[0-9]*$/)) { $missing .= "
  • Number of guest contains non-numeric characters
  • \n"; } } if ($cgi->param('kidsmondaynightreception')) { if (!($cgi->param('kidsmondaynightreception') =~ /^[0-9]*$/)) { $missing .= "
  • Number of guest contains non-numeric characters
  • \n"; } } if (($cgi->param('month')) || ($cgi->param('day')) || ($cgi->param('year'))) { if (!($cgi->param('month') =~ /^[0-9]*$/)) { $missing .= "
  • Date of Birth: Month contains non-numeric characters
  • \n"; } if (!($cgi->param('day') =~ /^[0-9]*$/)) { $missing .= "
  • Date of Birth: Day contains non-numeric characters
  • \n"; } if (!($cgi->param('year') =~ /^[0-9]*$/)) { $missing .= "
  • Date of Birth: Year contains non-numeric characters
  • \n"; } } if (($cgi->param('gradmonth')) || ($cgi->param('gradyear'))) { if (!($cgi->param('gradmonth') =~ /^[0-9]*$/)) { $missing .= "
  • Residency/Fellowship Ends: Month contains non-numeric characters
  • \n"; } if (!($cgi->param('gradyear') =~ /^[0-9]*$/)) { $missing .= "
  • Residency/Fellowship Ends: Year contains non-numeric characters
  • \n"; } } if (($cgi->param('adultguests')) || ($cgi->param('childguests'))) { if (!($cgi->param('adultguests') =~ /^[0-9]*$/)) { $missing .= "
  • Adult guests field contains non-numeric characters
  • \n"; } if (!($cgi->param('childguests') =~ /^[0-9]*$/)) { $missing .= "
  • Child guests field contains non-numeric characters
  • \n"; } } if ($missing) { print p({-style=>'color: #F00'},strong('Error - Required information was not provided on the submitted form. Please use the back button and correct the following:')); print "
      $missing
    \n"; print p(''); } else { if (substr($main::cgi->param('ssl_card_number'),0,1) eq "3") { $card_type = "Amex"; } elsif (substr($main::cgi->param('ssl_card_number'),0,1) eq "4") { $card_type = "Visa"; } elsif (substr($main::cgi->param('ssl_card_number'),0,1) eq "5") { $card_type = "MC"; } else { $card_type = "Discover"; } my $checkNumber = "$card_type ***$card_type_no"; print '
    '; $reginfo_buffer2 = ''; $buffer = "\nREGISTRATION\n" . $society . " " . $meeting . "\n\n"; $buffer .= "OrderID: " . $orderID ."\n\n"; if($onsite) { $buffer .= "Click the link below to view your $meeting Mobile Meeting Guide.\n"; $buffer .= "Your mobile meeting guide features all your meeting information and more in the palm of your hand!\n"; $buffer .= "\nMobile Meeting Guide: http://www2.psva.org/meetings/2018spring/guide/"; $buffer .= "\n\n"; } $sth = $main::dbh->prepare(qq{ SELECT t1.lname, t1.fname, t1.title, t1.mail_address2, t1.mail_address3, t1.mail_city, t1.mail_state, t1.mail_zip, t1.mail_country, t1.phone, t1.email, otherAssocID, fax, t1.member_id, member, NickName, balance_due, t1.title, CONCAT_WS(' ',t1.fname,t1.m_initial,t1.lname,t1.title), regtype_id, t1.email2, t1.hospital FROM member t1 LEFT JOIN registrants t2 ON t1.member_id=t2.member_id AND meeting_no=? AND workshop_no=0 WHERE email LIKE ? OR email2 LIKE ? LIMIT 1 }) || $main::dbh->errstr; $sth->execute($meeting_number, $reg_email, $reg_email) || $main::dbh->errstr; @reg_fields = $sth->fetchrow; $sth->finish(); foreach $elem (@reg_fields) { $elem = encode_entities($elem); } my $tmp = $confirmation; $tmp =~ s/
    //g; $tmp =~ s/\r//g; $buffer .= "$tmp\n"; if (!$registrant_in_db) { $buffer .= "\nFirst Name: " . $cgi->param('ssl_first_name'); $buffer .= "\nLast Name: " . $cgi->param('ssl_last_name'); $buffer .= "\nTitle: " . $cgi->param('title'); $buffer .= "\nAddress1: " . $cgi->param('ssl_ship_to_address1'); $buffer .= "\nAddress2: " . $cgi->param('ssl_ship_to_address2'); $buffer .= "\nCity, State, Zip: " . $cgi->param('ssl_ship_to_city') . ", " . $cgi->param('ssl_ship_to_state') . " " . $cgi->param('ssl_ship_to_zip'); $buffer .= "\nCountry: " . $cgi->param('ssl_ship_to_country'); $buffer .= "\nOffice Phone: " . $cgi->param('ssl_phone'); $buffer .= "\nFax: " . $cgi->param('fax'); $buffer .= "\nE-mail: " . $cgi->param('email'); $buffer .= "\nABA Number: " . $cgi->param('AOANumber') if $cgi->param('AOANumber'); } else { $buffer .= "\n$reg_fields[18]"; $buffer .= "\n" . $reg_fields[4] if $reg_fields[4]; $buffer .= "\n" . $reg_fields[3] if $reg_fields[3]; $buffer .= "\n" . $reg_fields[5] . ", " . $reg_fields[6] . " " . $reg_fields[7]; $buffer .= "\n" . $reg_fields[8] if $reg_fields[8]; $buffer .= "\n\nOffice Phone: " . $reg_fields[9]; $buffer .= "\nFax: " . $reg_fields[12]; $buffer .= "\nPrimary Email: " . $reg_fields[10]; $buffer .= "\nSecondary Email: " . $reg_fields[20] if $reg_fields[20]; $buffer .= "\nABA Number: " . $reg_fields[11]; } $buffer .= "\nConfirmation Email: " . $cgi->param('ssl_email'); if ($cgi->param('category')) { $buffer .= "\nCategory: " . $cgi->param('category'); if ($cgi->param('category') eq "O") { $buffer .= " -- " . $cgi->param('cat_other'); } } $buffer .= "\n\nFirst Name/Nickname for Badge: " . $cgi->param('Nickname'); $buffer .="\nHospital/Institution: " . $cgi->param('hospital'); $buffer .= "\nAccompanying Person(s) Name(s): " . $cgi->param('accomp') if $cgi->param('accomp'); if (defined($guest[0])) { for ($i=0; defined($guest[$i]); $i++) { $buffer .= "\nName(s) for $guest[$i][1]: " . $cgi->param("accomp-$guest[$i][0]") if $cgi->param("accomp-$guest[$i][0]"); } } $buffer .= "\nDietary Restrictions? " . $cgi->param('dietary') if $cgi->param('dietary'); # $buffer .= "\n\nAre you staying at the convention hotel? " . $cgi->param('hotel'); # if ($cgi->param('hotel') eq "No") { # $buffer .= "\nReason for not staying at hotel: " . $cgi->param('nostay'); # } if (defined($misc[0])) { for ($i=0; defined($misc[$i]); $i++) { if ($cgi->param("Misc$misc[$i][0]")) { $buffer .= "\n\n$misc[$i][1]"; $buffer .= "\nSpecification: " . $cgi->param("misc-spec-$misc[$i][0]"); } } } if ($cgi->param('ADA')) { $buffer .= "\n\nADA accommodation is needed: Yes"; $buffer .= "\nSpecification: " . $cgi->param('ADASpecification'); } else { # $buffer .= "\n\nADA accommodation is needed: No"; } if ($cgi->param('preference1')) { $buffer .= "\n\nPreference for Shoulder or Knee Lab: " . $cgi->param('preference1'); } if ($cgi->param('preference2')) { $buffer .= "\nPreference of Beach Chair or Lateral Decubitus: " . $cgi->param('preference2') . "\n"; } $buffer .="\n\nRegistered as:\n"; if (!$registered) { for ($i=0; defined($reg_types[$i]); $i++) { if ($cgi->param('reg_type') eq $reg_types[$i][0]) { $buffer .= " " . $reg_types[$i][1]; $tab=length($reg_types[$i][1]); my $subtype_count=0; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= '\n"; $reginfo_buffer2 .= ''; $reginfo_buffer2 .= '\n"; } else { $buffer .=" \$"; $buffer .= $reg_types[$i][2][$reduced_rate]; $reginfo_buffer2 .= ""; $reginfo_buffer2 .= '\n"; $reginfo_buffer2 .= ''; $reginfo_buffer2 .= '\n"; $cost = $cost + $reg_types[$i][2][$reduced_rate]; $regcost=$reg_types[$i][2][$reduced_rate]; } } } #end first if $complete } if (defined($mondaynightreception[0])) { my $sth3 = $main::dbh->prepare(qq{ SELECT eventTypeDesc FROM event_type WHERE meetingID=? AND eventType LIKE 'reception%' LIMIT 1 }) || $main::dbh->errstr; $sth3->execute($meeting_number) || $main::dbh->errstr; my $sectionDesc = $sth3->fetchrow; $sth3->finish(); $buffer .= "\n\n$sectionDesc" if $sectionDesc; for ($i=0; defined($mondaynightreception[$i]); $i++) { if ($cgi->param("Rec$mondaynightreception[$i][0]")) { $buffer .= "\n" . $mondaynightreception[$i][1]; $buffer .= " \$"; # $buffer .= "\t\t\t\t \$"; $buffer .= $mondaynightreception[$i][2][$reduced_rate]; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= '\n"; $reginfo_buffer2 .= ''; $reginfo_buffer2 .= "\n"; my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,meetingID,workshopID,breakoutID,regtypeID,memberID,account,description,cost,checkNo) VALUES (?,?,?,?,?,?,?,?,?,?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$meeting_number,$mondaynightreception[$i][0],0,$cgi->param('reg_type'),$member_no,$mondaynightreception[$i][4],$meeting . ' - '.$mondaynightreception[$i][1],$mondaynightreception[$i][2][$reduced_rate],$checkNumber,) || $main::dbh->errstr(); $error_msg .= "
    Failed to add $mondaynightreception[$i][1] - mbr#: $member_no ".$rv if $rv < 1; $cost=$cost+$mondaynightreception[$i][2][$reduced_rate]; } } } if (defined($guest[0])) { $buffer .="\n\n"; for ($i=0; defined($guest[$i]); $i++) { if ($cgi->param("numguest$guest[$i][0]")) { my $guest_total = $guest[$i][2][$reduced_rate] * $cgi->param("numguest$guest[$i][0]"); $cost=$cost+$guest_total; # $buffer .= "\n$guest[$i][1] (" . $cgi->param("numguest$guest[$i][0]") . " \@ \$" . $guest[$i][2][$reduced_rate] . "/person):\t\t\t\t \$" . $guest_total . "\n"; $buffer .= "\n$guest[$i][1] (" . $cgi->param("numguest$guest[$i][0]") . " \@ \$" . $guest[$i][2][$reduced_rate] . "/person): \$" . $guest_total . "\n"; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= '\n"; $reginfo_buffer2 .= ''; $reginfo_buffer2 .= "\n"; for (my $i=0; $i < $cgi->param("numguest$guest[$i][0]"); $i++) { my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,meetingID,workshopID,breakoutID,regtypeID,memberID,account,description,cost,checkNo) VALUES (?,?,?,?,?,?,?,?,?,?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$meeting_number,$guest[$i][0],0,$cgi->param('reg_type'),$member_no,$guest[$i][4],$meeting . ' - '.$guest[$i][1],$guest[$i][2][$reduced_rate],$checkNumber,) || $main::dbh->errstr(); $error_msg .= "
    Failed to add $guest[$i][1] - mbr#: $member_no ".$rv if $rv < 1; # $cost=$cost+$guest[$i][2][$reduced_rate]; } } } } my $extra3_total = $extras3[$reduced_rate] * $cgi->param('extras3'); $cost = $cost + $extra3_total; my $extras3_total = $cgi->param('extras3'); if ($cgi->param('extras3')) { $buffer .= "\n\nI will attend the $extras3[3]"; # $buffer .= "\t\t\t\t \$"; $buffer .= " \$"; $buffer .= $extras3[$reduced_rate]; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= '\n"; $reginfo_buffer2 .= '\n"; $reginfo_buffer2 .= "\n"; for (my $i=0; $i < $extras3_total; $i++) { my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,meetingID,workshopID,breakoutID,regtypeID,memberID,account,description,cost,checkNo) VALUES (?,?,?,?,?,?,?,?,?,?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$meeting_number,$extras3[4],0,$cgi->param('reg_type'),$member_no,$extras3[2],$meeting.' - '.$extras3[3],$extras3[$reduced_rate],$checkNumber) || $main::dbh->errstr(); $error_msg .= "
    Failed to add $extras3[3] - mbr#: $member_no ".$rv if $rv < 1; $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\"$extras3[4]"; $text[2] .= "\",\"0\",\""; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $extras3[2] . "\",\""; $text[2] .= $extras3[$reduced_rate] . "\",\""; $text[2] .= $cgi->param('card_type'); $text[2] .= "\",\""; $text[2] .= "TOTALCOST\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } } my $extra_total = $extras[$reduced_rate] * $cgi->param('extras'); $cost = $cost + $extra_total; my $extras_total = $cgi->param('extras'); if ($cgi->param('extras')) { # $buffer .= "\nAccompanying Person(s): " . $cgi->param('extras') . " \@ \$" . $extras[$reduced_rate] . "/person:\t\t\t\t \$" . $extra_total . "\n"; $buffer .= "\nAccompanying Person(s): " . $cgi->param('extras') . " \@ \$" . $extras[$reduced_rate] . "/person: \$" . $extra_total . "\n"; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= '\n"; $reginfo_buffer2 .= ''; $reginfo_buffer2 .= '\n"; for (my $i=0; $i < $extras_total; $i++) { $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\"1"; $text[2] .= "\",\"0\",\""; my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,meetingID,workshopID,breakoutID,regtypeID,memberID,account,description,cost,checkNo) VALUES (?,?,?,?,?,?,?,?,?,?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$meeting_number,$extras[4],0,$cgi->param('reg_type'),$member_no,$extras[2],$meeting . ' - '.$extras[3],$extras[$reduced_rate],$checkNumber,) || $main::dbh->errstr(); $error_msg .= "
    Failed to add $extras[3] - mbr#: $member_no ".$rv if $rv < 1; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $extras[2] . "\",\""; $text[2] .= $extras[$reduced_rate] . "\",\""; $text[2] .= $cgi->param('card_type'); $text[2] .= "\",\""; $text[2] .= "TOTALCOST\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } } my $extra2_total = $extras2[$reduced_rate] * $cgi->param('extras2'); $cost = $cost + $extra2_total; my $extras2_total = $cgi->param('extras2'); if ($cgi->param('extras2')) { # $buffer .= "\nWelcome Reception: " . $cgi->param('extras2') . " Children Guest(s) \@ \$" . $extras2[$reduced_rate] . "/person:\t\t\t\t \$" . $extra2_total . "\n"; $buffer .= "\nWelcome Reception: " . $cgi->param('extras2') . " Children Guest(s) \@ \$" . $extras2[$reduced_rate] . "/person: \$" . $extra2_total . "\n"; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= "\n"; for (my $i=0; $i < $extras2_total; $i++) { $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\"2"; $text[2] .= "\",\"0\",\""; if ($update_database) { $main::dbh->do(qq{LOCK TABLES meeting WRITE}); $main::dbh->do(qq{UPDATE meeting set total_registered = total_registered + 1 WHERE meeting_no = "$meeting_number" AND workshop_no = 2 AND breakout_no = 0}); $main::dbh->do(qq{UNLOCK TABLES}); } $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $extras2[2] . "\",\""; $text[2] .= $extras2[$reduced_rate] . "\",\""; $text[2] .= $cgi->param('card_type'); $text[2] .= "\",\""; $text[2] .= "TOTALCOST\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } } my $mondaynightreceptioncost_total = $mondaynightreception[$reduced_rate] * $cgi->param('mondaynightreception'); $cost = $cost + $mondaynightreceptioncost_total; if ($cgi->param('mondaynightreception')) { my $mondaynightreception_total = 1; $buffer .= "\n\nI DO NOT plan to attend the $society Banquet and would like to donate my ticket to a resident"; # $buffer .= "\t\t\t \$"; $buffer .= " \$"; $buffer .= $mondaynightreception[$reduced_rate]; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= "\n"; for (my $i=0; $i < $mondaynightreception_total; $i++) { $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\"7"; $text[2] .= "\",\"0\",\""; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $mondaynightreception[2] . "\",\""; $text[2] .= $mondaynightreception[$reduced_rate] . "\",\""; $text[2] .= $cgi->param('card_type'); $text[2] .= "\",\""; $text[2] .= "TOTALCOST\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; if ($update_database) { $main::dbh->do(qq{LOCK TABLES meeting WRITE}); $main::dbh->do(qq{UPDATE meeting set total_registered = total_registered + 1 WHERE meeting_no = "$meeting_number" AND workshop_no = 7 AND breakout_no = 0}); $main::dbh->do(qq{UNLOCK TABLES}); } } } my $kidsmondaynightreceptioncost_total = $kidsmondaynightreception[$reduced_rate] * $cgi->param('kidsmondaynightreception'); $cost = $cost + $kidsmondaynightreceptioncost_total; my $kidsmondaynightreception_total = $cgi->param('kidsmondaynightreception'); if ($cgi->param('kidsmondaynightreception')) { $buffer .= "\nClosing Ceremony and Reception: " . $cgi->param('kidsmondaynightreception') . " Guest(s) \@ \$" . $kidsmondaynightreception[$reduced_rate] . "/person: \$" . $kidsmondaynightreceptioncost_total . "\n"; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= "\n"; for (my $i=0; $i < $kidsmondaynightreception_total; $i++) { $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\"19"; $text[2] .= "\",\"0\",\""; if ($update_database) { $main::dbh->do(qq{LOCK TABLES meeting WRITE}); $main::dbh->do(qq{UPDATE meeting set total_registered = total_registered + 1 WHERE meeting_no = "$meeting_number" AND workshop_no = 19 AND breakout_no = 0}); $main::dbh->do(qq{UNLOCK TABLES}); } $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $kidsmondaynightreception[2] . "\",\""; $text[2] .= $kidsmondaynightreception[$reduced_rate] . "\",\""; $text[2] .= $cgi->param('card_type'); $text[2] .= "\",\""; $text[2] .= "TOTALCOST\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } } if ($cgi->param('vegetarian')) { $buffer .= "\nI request vegetatrian meals\n"; $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\"7"; $text[2] .= "\",\"0\",\""; my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,meetingID,workshopID,breakoutID,regtypeID,memberID,description) VALUES (?,?,?,?,?,?,?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$meeting_number,7,0,$cgi->param('reg_type'),$member_no,$meeting.' - Vegetarian Meals') || $main::dbh->errstr(); $error_msg .= "
    Failed to add veg meal - mbr#: $member_no ".$rv if $rv < 1; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"\",\""; $text[2] .= "0\",\""; $text[2] .= $cgi->param('card_type'); $text[2] .= "\",\""; $text[2] .= "TOTALCOST\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } if ($cgi->param('kosher')) { $buffer .= "\nI require kosher meals\n"; $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\"37"; $text[2] .= "\",\"0\",\""; if ($update_database) { $main::dbh->do(qq{LOCK TABLES meeting WRITE}); $main::dbh->do(qq{UPDATE meeting set total_registered = total_registered + 1 WHERE meeting_no = "$meeting_number" AND workshop_no = 37 AND breakout_no = 0}); $main::dbh->do(qq{UNLOCK TABLES}); } $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"\",\""; $text[2] .= "0\",\""; $text[2] .= $cgi->param('card_type'); $text[2] .= "\",\""; $text[2] .= "TOTALCOST\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } if (defined($specialitems[0])) { # generate Special Items for buffer and txt files $buffer .="\n\nSpecial Items:\n"; $buffer .="\n"; my %u_dates; $u_dates{$_->[3]}++ for @specialitems; my @wsdates=sort keys %u_dates; my $k=0; my $ws_count=0; for ($i=0; defined($wsdates[$i]); $i++) { if ($cgi->param("SI$wsdates[$i]A")) { for ($j=0; defined($specialitems[$j]); $j++) { if ($cgi->param("SI$wsdates[$i]A") eq $specialitems[$j][0]) { my $Wday=substr($specialitems[$j][3], 6, 2); my $Wmonth=substr($specialitems[$j][3],4,2); $Wmonth--; my $Wyear=substr($specialitems[$j][3],0,4)-1900; my $Whour=substr($specialitems[$j][3],8,2); my $Wmin=substr($specialitems[$j][3],10,2); my $Wtime=timelocal(0,$Wmin,$Whour,$Wday,$Wmonth,$Wyear); my $Wdate = strftime("%B %d %Y -- %I:%M %p", (localtime($Wtime))); # $buffer .= "\n\n$Wdate"; my $subbuffer = "\n -- " . $specialitems[$j][1] . ":"; # my $subbuffer = $specialitems[$j][1] . ":"; $buffer .= $subbuffer; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= '\n"; $reginfo_buffer2 .= ''; # HARD CODING WORKSHOP NAME BELOW # $reginfo_buffer2 .= "\n"; # $reginfo_buffer2 .= "\n"; # my $t_count=(floor((81 - length($specialitems[$j][1]))/8+.5)-1); # my $t_count = 64 - length($specialitems[$j][1]); my $t_count =72 - length($subbuffer); for (my $tabs = 1; $tabs<=$t_count; $tabs++) { # $buffer .= "\t"; $buffer .= " "; } $buffer .= " \$"; $buffer .= $specialitems[$j][2][$reduced_rate]; # $buffer .= "\n My handicap: " . $cgi->param('handicap') . "\n"; # $buffer .= " Requested members of foursome:\n"; # $buffer .= " 1. " . $cgi->param('foursome1') . "\n"; # $buffer .= " 2. " . $cgi->param('foursome2') . "\n"; # $buffer .= " 3. " . $cgi->param('foursome3') . "\n"; $reginfo_buffer2 .= "\n"; my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,meetingID,workshopID,breakoutID,regtypeID,memberID,account,description,cost,checkNo) VALUES (?,?,?,?,?,?,?,?,?,?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$meeting_number,$specialitems[$j][0],0,$cgi->param('reg_type'),$member_no,$specialitems[$j][4],$meeting . ' - WKSHP: '.substr($specialitems[$j][1],0,20),$specialitems[$j][2][$reduced_rate],$checkNumber,) || $main::dbh->errstr(); $cost=$cost+$specialitems[$j][2][$reduced_rate]; $ws_count++; # $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\""; # $text[2] .=$specialitems[$j][0] . "\",\"0\",\""; # HARD CODING WORKSHOP NUMBER BELOW $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\"2"; $text[2] .= "\",\"0\",\""; $selected_wkshps .= $specialitems[$j][0] . " "; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $specialitems[$j][4] . "\",\""; if (($ws_count==2) && ($early_bird)) { $text[2] .= "0" . "\",\""; $buffer .= "\n\t\t\t\t\t\t\tEARLYBIRD BONUS\t-\$" . $specialitems[$j][2][$reduced_rate]; $cost=$cost-$specialitems[$j][2][$reduced_rate]; } else { $text[2] .= $specialitems[$j][2][$reduced_rate] . "\",\""; } $text[2] .= $cgi->param('card_type'); $text[2] .= "\",\""; if (($ws_count==2) && ($early_bird)) { $text[2] .= "TOTALCOST" . "\",\""; } else { $text[2] .= "TOTALCOST" . "\",\""; } $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } } if ($cgi->param("SI$wsdates[$i]B")) { for ($j=0; defined($specialitems[$j]); $j++) { if ($cgi->param("SI$wsdates[$i]B") eq $specialitems[$j][0]) { $buffer .= "\n\t (Second Choice: $specialitems[$j][1])"; } } } if ($cgi->param("SI$wsdates[$i]C")) { for ($j=0; defined($specialitems[$j]); $j++) { if ($cgi->param("SI$wsdates[$i]C") eq $specialitems[$j][0]) { $buffer .= "\n\t (Third Choice: $specialitems[$j][1])"; } } } } else { $k++; } } if ($k==$i) { $buffer .= "\tNo special items\n"; } } # end 2nd if complete if (defined($workshops[0])) { # generate workshops for buffer and txt files $buffer .="\n\nWorkshops:\n"; $buffer .="\n"; my %u_dates; $u_dates{$_->[3]}++ for @workshops; my @wsdates=sort keys %u_dates; my $k=0; my $ws_count=0; for ($i=0; defined($wsdates[$i]); $i++) { if ($cgi->param("WS$wsdates[$i]A")) { for ($j=0; defined($workshops[$j]); $j++) { if ($cgi->param("WS$wsdates[$i]A") eq $workshops[$j][0]) { my $Wday=substr($workshops[$j][3], 6, 2); my $Wmonth=substr($workshops[$j][3],4,2); $Wmonth--; my $Wyear=substr($workshops[$j][3],0,4)-1900; my $Whour=substr($workshops[$j][3],8,2); my $Wmin=substr($workshops[$j][3],10,2); my $Wtime=timelocal(0,$Wmin,$Whour,$Wday,$Wmonth,$Wyear); my $Wdate = strftime("%B %d %Y -- %I:%M %p", (localtime($Wtime))); $buffer .= "\n\n$Wdate"; my $subbuffer = "\n -- " . $workshops[$j][1] . ":"; # my $subbuffer = $workshops[$j][1] . ":"; $buffer .= $subbuffer; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= '\n"; $reginfo_buffer2 .= ''; # HARD CODING WORKSHOP NAME BELOW # $reginfo_buffer2 .= "\n"; # $reginfo_buffer2 .= "\n"; # my $t_count=(floor((81 - length($workshops[$j][1]))/8+.5)-1); # my $t_count = 64 - length($workshops[$j][1]); my $t_count =72 - length($subbuffer); for (my $tabs = 1; $tabs<=$t_count; $tabs++) { # $buffer .= "\t"; $buffer .= " "; } $buffer .= " \$"; $buffer .= $workshops[$j][2][$reduced_rate]; # $buffer .= "\n My handicap: " . $cgi->param('handicap') . "\n"; # $buffer .= " Requested members of foursome:\n"; # $buffer .= " 1. " . $cgi->param('foursome1') . "\n"; # $buffer .= " 2. " . $cgi->param('foursome2') . "\n"; # $buffer .= " 3. " . $cgi->param('foursome3') . "\n"; $reginfo_buffer2 .= "\n"; my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,meetingID,workshopID,breakoutID,regtypeID,memberID,account,description,cost,checkNo) VALUES (?,?,?,?,?,?,?,?,?,?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$meeting_number,$workshops[$j][0],0,$cgi->param('reg_type'),$member_no,$workshops[$j][4],$meeting . ' - WKSHP: '.substr($workshops[$j][1],0,20),$workshops[$j][2][$reduced_rate],$checkNumber,) || $main::dbh->errstr(); $cost=$cost+$workshops[$j][2][$reduced_rate]; $ws_count++; # $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\""; # $text[2] .=$workshops[$j][0] . "\",\"0\",\""; # HARD CODING WORKSHOP NUMBER BELOW $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\"2"; $text[2] .= "\",\"0\",\""; $selected_wkshps .= $workshops[$j][0] . " "; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $workshops[$j][4] . "\",\""; if (($ws_count==2) && ($early_bird)) { $text[2] .= "0" . "\",\""; $buffer .= "\n\t\t\t\t\t\t\tEARLYBIRD BONUS\t-\$" . $workshops[$j][2][$reduced_rate]; $cost=$cost-$workshops[$j][2][$reduced_rate]; } else { $text[2] .= $workshops[$j][2][$reduced_rate] . "\",\""; } $text[2] .= $cgi->param('card_type'); $text[2] .= "\",\""; if (($ws_count==2) && ($early_bird)) { $text[2] .= "TOTALCOST" . "\",\""; } else { $text[2] .= "TOTALCOST" . "\",\""; } $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } } if ($cgi->param("WS$wsdates[$i]B")) { for ($j=0; defined($workshops[$j]); $j++) { if ($cgi->param("WS$wsdates[$i]B") eq $workshops[$j][0]) { $buffer .= "\n\t (Second Choice: $workshops[$j][1])"; } } } if ($cgi->param("WS$wsdates[$i]C")) { for ($j=0; defined($workshops[$j]); $j++) { if ($cgi->param("WS$wsdates[$i]C") eq $workshops[$j][0]) { $buffer .= "\n\t (Third Choice: $workshops[$j][1])"; } } } } else { $k++; } } if ($k==$i) { $buffer .= "\tNo workshops\n"; } } # end 2nd if complete if (defined($pbls[0])) { # generate PBLs for buffer and text files $buffer .= "\n\nI will attend the following breakfast: \n"; my %u_dates; $u_dates{$_->[3]}++ for @pbls; my @pbldates=sort keys %u_dates; my $k=0; for ($i=0; defined($pbldates[$i]); $i++) { if ($cgi->param("PBL$pbldates[$i]A")) { for ($j=0; defined($pbls[$j]); $j++) { if ($cgi->param("PBL$pbldates[$i]A") eq $pbls[$j][0]) { my $Wday=substr($pbls[$j][3], 6, 2); my $Wmonth=substr($pbls[$j][3],4,2); $Wmonth--; my $Wyear=substr($pbls[$j][3],0,4)-1900; my $Whour=substr($pbls[$j][3],8,2); my $Wmin=substr($pbls[$j][3],10,2); my $Wtime=timelocal(0,$Wmin,$Whour,$Wday,$Wmonth,$Wyear); my $Wdate = strftime("%B %d %Y -- %I:%M %p", (localtime($Wtime))); $buffer .= "\n\n$Wdate"; # my $subbuffer .= "\n -- " . substr($pbls[$j][1],0,50) . " ... " . ":"; my $subbuffer .= "\n -- " . $pbls[$j][1] . ":"; $buffer .= $subbuffer; $reginfo_buffer2 .= "\n"; # my $t_count=(floor((81 - length($subbuffer))/8+.5)-1); my $t_count=72 - length($subbuffer); for (my $tabs = 1; $tabs<=$t_count; $tabs++) { $buffer .= " "; # $buffer .= "\t"; } $buffer .= "\t \$"; $buffer .= $pbls[$j][2][$reduced_rate]; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= "\n"; my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,meetingID,workshopID,breakoutID,regtypeID,memberID,account,description,cost,checkNo) VALUES (?,?,?,?,?,?,?,?,?,?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$meeting_number,$pbls[$j][0],0,$cgi->param('reg_type'),$member_no,$pbls[$j][4],$meeting.' - '.substr($pbls[$j][1],0,20),$pbls[$j][2][$reduced_rate],$checkNumber) || $main::dbh->errstr(); $cost=$cost+$pbls[$j][2][$reduced_rate]; $selected_wkshps .= $pbls[$j][0] . " "; $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\""; $text[2] .= $pbls[$j][0] . "\",\"0\",\""; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $pbls[$j][4] . "\",\""; $text[2] .= $pbls[$j][2][$reduced_rate] . "\",\""; $text[2] .= $cgi->param('card_type'); $text[2] .= "\",\""; $text[2] .= "TOTALCOST" . "\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } } if ($cgi->param("PBL$pbldates[$i]B")) { for ($j=0; defined($pbls[$j]); $j++) { if ($cgi->param("PBL$pbldates[$i]B") eq $pbls[$j][0]) { $buffer .= "\n\t (Second Choice: PBLD -- " . substr($pbls[$j][1],0,25) ."...)"; } } } if ($cgi->param("PBL$pbldates[$i]C")) { for ($j=0; defined($pbls[$j]); $j++) { if ($cgi->param("PBL$pbldates[$i]C") eq $pbls[$j][0]) { $buffer .= "\n\t (Third Choice: PBLD -- " . substr($pbls[$j][1],0,25) ."...)"; } } } } else { $k++; } } if ($k==$i) { # $buffer .= "\tNo pbls\n"; } } #end 3nd if $complete if (defined($intensive_ws[0])) { # generate intensive workshops for buffer and txt files $buffer .= "\n\nSpecial Interest Group - Pediatric Pain Medicine \n"; my %u_dates; $u_dates{$_->[3]}++ for @intensive_ws; my @wsdates=sort keys %u_dates; my $k=0; for ($i=0; defined($wsdates[$i]); $i++) { if ($cgi->param("IWS$wsdates[$i]A")) { for ($j=0; defined($intensive_ws[$j]); $j++) { if ($cgi->param("IWS$wsdates[$i]A") eq $intensive_ws[$j][0]) { my $Wday=substr($intensive_ws[$j][3], 6, 2); my $Wmonth=substr($intensive_ws[$j][3],4,2); $Wmonth--; my $Wyear=substr($intensive_ws[$j][3],0,4)-1900; my $Whour=substr($intensive_ws[$j][3],8,2); my $Wmin=substr($intensive_ws[$j][3],10,2); my $Wtime=timelocal(0,$Wmin,$Whour,$Wday,$Wmonth,$Wyear); my $Wdate = strftime("%B %d %Y -- %I:%M %p", (localtime($Wtime))); $buffer .= "\n\n$Wdate"; my $subbuffer .= "\n -- " . $intensive_ws[$j][1] . ":"; $buffer .= $subbuffer; # my $t_count=(floor((83 - length($intensive_ws[$j][1]))/8+.5)-1); my $t_count = 72 - length($subbuffer); for (my $tabs = 1; $tabs<=$t_count; $tabs++) { $buffer .= " "; # $buffer .= "\t"; } $buffer .= "\t \$"; $buffer .= $intensive_ws[$j][2][$reduced_rate]; $cost=$cost+$intensive_ws[$j][2][$reduced_rate]; $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\""; $text[2] .=$intensive_ws[$j][0] . "\",\"0\",\""; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $intensive_ws[$j][4] . "\",\""; $text[2] .= $intensive_ws[$j][2][$reduced_rate] . "\",\""; $text[2] .= $cgi->param('card_type'); $text[2] .= "\",\""; $text[2] .= "TOTALCOST" . "\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } } if ($cgi->param("IWS$wsdates[$i]B")) { for ($j=0; defined($intensive_ws[$j]); $j++) { if ($cgi->param("IWS$wsdates[$i]B") eq $intensive_ws[$j][0]) { $buffer .= "\n\t (Second Choice: $intensive_ws[$j][1])"; } } } if ($cgi->param("IWS$wsdates[$i]C")) { for ($j=0; defined($intensive_ws[$j]); $j++) { if ($cgi->param("IWS$wsdates[$i]C") eq $intensive_ws[$j][0]) { $buffer .= "\n\t (Third Choice: $intensive_ws[$j][1])"; } } } } else { $k++; } } if ($k==$i) { $buffer .= "\tNo PALS Course\n"; } } #end 4nd if $complete if (defined($master_classes[0])) { # generate Master Classes for buffer and txt files $buffer .= "\n\nMaster Classes: \n"; my %u_dates; $u_dates{$_->[3]}++ for @master_classes; my @wsdates=sort keys %u_dates; my $k=0; my $ws_count=0; for ($i=0; defined($wsdates[$i]); $i++) { if ($cgi->param("MC$wsdates[$i]A")) { for ($j=0; defined($master_classes[$j]); $j++) { if ($cgi->param("MC$wsdates[$i]A") eq $master_classes[$j][0]) { my $Wday=substr($master_classes[$j][3], 6, 2); my $Wmonth=substr($master_classes[$j][3],4,2); $Wmonth--; my $Wyear=substr($master_classes[$j][3],0,4)-1900; my $Whour=substr($master_classes[$j][3],8,2); my $Wmin=substr($master_classes[$j][3],10,2); my $Wtime=timelocal(0,$Wmin,$Whour,$Wday,$Wmonth,$Wyear); my $Wdate = strftime("%B %d %Y -- %I:%M %p", (localtime($Wtime))); $buffer .= "\n\n$Wdate"; my $subbuffer .= "\n -- " . substr($master_classes[$j][1],0,50) . "... :"; $buffer .= $subbuffer; # my $t_count=(floor((77 - length($master_classes[$j][0]) - length($master_classes[$j][1]))/8+.5)-1); my $t_count = 72 - length($subbuffer); for (my $tabs = 1; $tabs<=$t_count; $tabs++) { $buffer .= " "; # $buffer .= "\t"; } $buffer .= "\t \$"; $buffer .= $master_classes[$j][2][$reduced_rate]; $cost=$cost+$master_classes[$j][2][$reduced_rate]; $ws_count++; $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\""; $text[2] .=$master_classes[$j][0] . "\",\"0\",\""; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $master_classes[$j][4] . "\",\""; $text[2] .= $master_classes[$j][2][$reduced_rate] . "\",\""; $text[2] .= $cgi->param('card_type'); # if ($CyberCash) { # $text[2] .= "_C"; # } $text[2] .= "\",\""; $text[2] .= "TOTALCOST" . "\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } } } else { $k++; } } if ($k==$i) { $buffer .= "\tNo Master Classes\n"; } } #end 5nd if $complete ### Begin Reception Guests # note proper tab spacing not yet implemented if (@guest_cost) { # 6th complete (for Reception Guests) my $gcost=0; if ($cgi->param('guests')==1) { $buffer .= "\n\t--Will attend Reception \n"; $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\""; $text[2] .= $gitem . "\",\"0\",\""; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $gaccount . "\", \"" . $gcost . "\",\""; $text[2] .= $cgi->param('card_type'); # if ($CyberCash) { # $text[2] .= "_C"; # } $text[2] .= "\",\"" . $gcost . "\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; $gcost=$guest_cost[$reduced_rate]*$cgi->param('guests'); $cost=$cost+$gcost; $buffer .="Extra Reception Ticket (" . $cgi->param('guests') . "):\t\t\t\t\t\t \$" . $gcost . "\n"; $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\""; $text[2] .= $gitem . "\",\"0\",\""; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $gaccount . "\", \"" . $gcost . "\",\""; $text[2] .= $cgi->param('card_type'); # if ($CyberCash) { # $text[2] .= "_C"; # } $text[2] .= "\",\"" . $gcost . "\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } else { if ($cgi->param('attend') eq "yes") { $gcost=0; $buffer .= "\n Will attend Reception \n"; $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\""; $text[2] .= $gitem . "\",\"0\",\""; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $gaccount . "\", \"" . $gcost . "\",\""; $text[2] .= $cgi->param('card_type'); # if ($CyberCash) { # $text[2] .= "_C"; # } $text[2] .= "\",\"" . $gcost . "\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } } } # end 6th complete ### End Reception Guest ### Begin Donations if (defined($donations[0])) { for ($i=0; defined($donations[$i]); $i++) { if ($cgi->param("fund$donations[$i][0]")>0) { $cost=$cost+$cgi->param("fund$donations[$i][0]"); $buffer .= "\n\n" . $donations[$i][1]; # $buffer .= "\t\t\t\t \$"; $buffer .= " \$"; $buffer .= $cgi->param("fund$donations[$i][0]"); $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= '\n"; $reginfo_buffer2 .= ''; $reginfo_buffer2 .= "\n"; my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,meetingID,workshopID,breakoutID,regtypeID,memberID,account,description,cost,checkNo) VALUES (?,?,?,?,?,?,?,?,?,?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$meeting_number,$donations[$i][0],0,$cgi->param('reg_type'),$member_no,$donations[$i][4],$meeting . ' - '.$donations[$i][1],$cgi->param("fund$donations[$i][0]"),$checkNumber,) || $main::dbh->errstr(); $error_msg .= "
    Failed to add $donations[$i][1] - mbr#: $member_no ".$rv if $rv < 1; } } } ### END DONATIONS ### Begin Research Education Fund # Note proper tab spacing not yet implemented if (defined($research[0])) { # 7th complete for fund if ($cgi->param('fund')>0) { $cost=$cost+$cgi->param('fund'); $buffer .="\nEducation/Research Fund Donation:\t\t\t\t\t \$" . $cgi->param('fund') . "\n"; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= ''; $reginfo_buffer2 .= ''; $reginfo_buffer2 .= "\n"; my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,memberID,account,description,cost,checkNo) VALUES (?,?,?,?,?,?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$member_no,$research[0],'Education/Research Fund Donation',$cgi->param('fund'),$checkNumber,) || $main::dbh->errstr(); $error_msg .= "
    Failed to add donation - mbr#: $member_no ".$rv if $rv < 1; $text[2] .="\"" . $orderID . "\",\"" . $research[1] . "\",\""; $text[2] .= $research[2] . "\",\"0\",\""; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $research[0] . "\",\"" . $cgi->param('fund') . "\",\""; $text[2] .= $cgi->param('card_type'); # if ($CyberCash) { # $text[2] .= "_C"; # } $text[2] .= "\",\"" . "TOTALCOST" . "\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } } # End 7th complete ### End Research Education Fund ### Dinners if (defined($receptions[0])) { # 8th complete for dinners my %u_dates; $u_dates{$_->[3]}++ for @receptions; my @wsdates=sort keys %u_dates; my $k=0; my $ws_count=0; for ($i=0; defined($wsdates[$i]); $i++) { # cycle through dates if ($cgi->param("dinner$wsdates[$i]")) { # Dinner check for ($j=0; defined($receptions[$j]); $j++) { if ($receptions[$j][2]{$cgi->param('reg_type')}[$reduced_rate]) { # skip section if cost is zero # $buffer .= "\n\nLab:"; # cycle through dinners if ($cgi->param("dinner$wsdates[$i]") eq $receptions[$j][0]) { # Selected Dinner matches my $Wday=substr($receptions[$j][3], 6, 2); my $Wmonth=substr($receptions[$j][3],4,2); $Wmonth--; my $Wyear=substr($receptions[$j][3],0,4)-1900; my $Whour=substr($receptions[$j][3],8,2); my $Wmin=substr($receptions[$j][3],10,2); my $Wtime=timelocal(0,$Wmin,$Whour,$Wday,$Wmonth,$Wyear); my $Wdate = strftime("%B %d %Y -- %I:%M %p", (localtime($Wtime))); $buffer .= "\n$Wdate"; my $subbuffer .= "\n -- " . substr($receptions[$j][1],0,50); if ($receptions[$j][1] ne substr($receptions[$j][1],0,50)) { $subbuffer .= "... :"; } else { $subbuffer .= ":"; } $buffer .= $subbuffer; # my $t_count=(floor((77 - length($receptions[$j][0]) - length($receptions[$j][1]))/8+.5)-1); my $t_count = 72 - length($subbuffer); for (my $tabs = 1; $tabs<=$t_count; $tabs++) { $buffer .= " "; # $buffer .= "\t"; } $buffer .= "\t \$"; $buffer .= $receptions[$j][2]{$cgi->param('reg_type')}[$reduced_rate]; $cost=$cost+$receptions[$j][2]{$cgi->param('reg_type')}[$reduced_rate]; $reginfo_buffer2 .= "\n"; $reginfo_buffer2 .= '\n"; $reginfo_buffer2 .= ''; $reginfo_buffer2 .= '\n"; my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,meetingID,workshopID,breakoutID,regtypeID,memberID,account,description,cost,checkNo) VALUES (?,?,?,?,?,?,?,?,?,?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$meeting_number,$receptions[$j][0],0,$cgi->param('reg_type'),$member_no,$receptions[$j][4],$meeting.' - '.substr($receptions[$j][1],0,20),$receptions[$j][2]{$cgi->param('reg_type')}[$reduced_rate],$checkNumber,) || $main::dbh->errstr(); $error_msg .= "
    Failed to add $receptions[$j][1] - mbr#: $member_no ".$rv if $rv < 1; $ws_count++; $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\""; $text[2] .=$receptions[$j][0] . "\",\"0\",\""; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $receptions[$j][4] . "\",\""; $text[2] .= $receptions[$j][2]{$cgi->param('reg_type')}[$reduced_rate] . "\",\""; $text[2] .= $cgi->param('card_type'); # if ($CyberCash) { # $text[2] .= "_C"; # } $text[2] .= "\",\""; $text[2] .= "TOTALCOST" . "\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } } } } else { $k++; } } }# end 8th complete ### End Dinners my $guest_names = $cgi->param('guestnames'); if (($guest_names) && (($cgi->param('adultguests')>0) || ($cgi->param('childguests')>0))) { $buffer .="\nGuest names: " . $guest_names . "\n"; } ############################ # Calculate Membership Cost # ############################ if ($cgi->param('applyingfor')) { my $rv = ''; my $joinAcctNum = ''; my $joinType = $cgi->param('applyingfor'); my $sth2 = $main::dbh->prepare(qq{ SELECT acctNumber FROM member_type WHERE membertype_id=? LIMIT 1 }); $sth2->execute($joinType); $joinAcctNum = $sth2->fetchrow(); $sth2->finish(); my %dues_acct = ("PSV", "$joinAcctNum", "CCAS", "23010", "SPPM", "23020"); $application = 1; SWITCH: { $joinType == 1 && do { @acct_nums = ($dues_acct{"PSV"}); @acct_amts = qw(225); @acct_description = ("$newmbr_paydesc PSV Active Membership"); last SWITCH; }; $joinType == 2 && do { @acct_nums = ($dues_acct{"PSV"}); @acct_amts = qw(225); @acct_description = ("$newmbr_paydesc PSV Affiliate Membership"); last SWITCH; }; $joinType == 3 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}, $dues_acct{"SPPM"}); @acct_amts = (25, 25, 25); @acct_description = ("$newmbr_paydesc PSV International Membership","$newmbr_paydesc CCAS Membership","$newmbr_paydesc SPPM Membership"); last SWITCH; }; $joinType == 10 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}); @acct_amts = (225, 75); @acct_description = ("$newmbr_paydesc PSV Active Membership","$newmbr_paydesc CCAS Membership"); last SWITCH; }; $joinType == 11 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}); @acct_amts = (225, 75); @acct_description = ("$newmbr_paydesc PSV Affiliate Membership","$newmbr_paydesc CCAS Membership"); last SWITCH; }; $joinType == 26 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"SPPM"}); @acct_amts = (225, 50); @acct_description = ("$newmbr_paydesc PSV Active Membership","$newmbr_paydesc SPPM Membership"); last SWITCH; }; $joinType == 28 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"SPPM"}); @acct_amts = (225, 50); @acct_description = ("$newmbr_paydesc PSV Affiliate A Membership","$newmbr_paydesc SPPM Membership"); last SWITCH; }; $joinType == 27 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}, $dues_acct{"SPPM"}); @acct_amts = (225, 75, 50); @acct_description = ("$newmbr_paydesc PSV Active Membership","$newmbr_paydesc CCAS Membership","$newmbr_paydesc SPPM Membership"); last SWITCH; }; $joinType == 34 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}, $dues_acct{"SPPM"}); @acct_amts = (225, 75, 50); @acct_description = ("$newmbr_paydesc PSV Affiliate Membership","$newmbr_paydesc CCAS Membership","$newmbr_paydesc SPPM Membership"); last SWITCH; }; $joinType == 7 && do { @acct_nums = ($dues_acct{"PSV"}); @acct_amts = (50); @acct_description = ("$newmbr_paydesc Resident PSV/CCAS/SPPM Membership"); last SWITCH; }; $joinType == 6 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}, $dues_acct{"SPPM"}); @acct_amts = (50, 25, 25); @acct_description = ("$newmbr_paydesc PSV Fellow Membership","$newmbr_paydesc CCAS Membership","$newmbr_paydesc SPPM Membership"); last SWITCH; }; } my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,account,description,cost,checkNo) VALUES (?,?,?,?,?) }) || $main::dbh->errstr(); for (my $i = 0; $i < scalar @acct_nums; ++$i) { $cost += $acct_amts[$i]; $rv = $sth->execute($orderID,$acct_nums[$i],$acct_description[$i],$acct_amts[$i],$checkNumber,) || $main::dbh->errstr(); $error_msg .= "
    Failed to add new member payment $acct_description[$i] : $member_no ".$rv if $rv < 1; $text[2] .= "\"" . $orderID . "\",\"0\",\"" . "0" . "\",\"0\",\""; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $acct_nums[$i] . "\"," . $acct_amts[$i] . ",\""; $text[2] .= $cgi->param('card_type'); $text[2] .= "\"," . "TOTALCOST" . ",\""; $text[2] .= $society . "\",\""; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } $reginfo_buffer2 .= ''; my $number = $membership_cost{$cgi->param('applyingfor')}; $number =~ s/(\d)(?=(\d{3})+(\D|$))/$1\,/g; $reginfo_buffer2 .= '\n"; $reginfo_buffer2 .= ''; $reginfo_buffer2 .= '\n"; ########################## # Membership Information # ########################## $buffer .= "\n============================================================================="; $buffer .= "\nMEMBERSHIP INFORMATION\n"; $buffer .= "\nApplication for: $newmbr_paydesc " . $descriptions{$cgi->param('applyingfor')}; $buffer .= "\n\nDate of Birth: " . $cgi->param('month') . "/" . $cgi->param('day') . "/" . $cgi->param('year'); $buffer .="\nPractice Type: " . $cgi->param('practice'); $buffer .="\nResidency/Fellowship Date: " . $cgi->param('gradmonth') . "/" . $cgi->param('gradyear') if $cgi->param('gradmonth'); $buffer .= "\nGender: " . $cgi->param('gender'); } ############################ # Calculate Member Renewal # ############################ if ($cgi->param('member_option') && $cgi->param('member_option') ne "999") { my $rv = ''; my $duesAcctNum = ''; my $renewalType = $cgi->param('member_option'); my $sth2 = $main::dbh->prepare(qq{ SELECT acctNumber FROM member_type WHERE membertype_id=? LIMIT 1 }); $sth2->execute($renewalType); $duesAcctNum = $sth2->fetchrow(); $sth2->finish(); my %dues_acct = ("PSV", "$duesAcctNum", "CCAS", "23010", "SPPM", "23020"); $auto_renew = 1 if $main::cgi->param('auto_charge'); SWITCH: { $renewalType == 1 && do { @acct_nums = ($dues_acct{"PSV"}); @acct_amts = (225); @acct_description = ("$dues_paydesc PSV Active Membership"); last SWITCH; }; $renewalType == 2 && do { @acct_nums = ($dues_acct{"PSV"}); @acct_amts = (225); @acct_description = ("$dues_paydesc PSV Affiliate Membership"); last SWITCH; }; $renewalType == 3 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}, $dues_acct{"SPPM"}); @acct_amts = (25, 25, 25); @acct_description = ("$dues_paydesc PSV International Membership","$dues_paydesc CCAS Membership","$dues_paydesc SPPM Membership"); last SWITCH; }; $renewalType == 10 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}); @acct_amts = (225, 75); @acct_description = ("$dues_paydesc PSV Active Membership","$dues_paydesc CCAS Membership"); last SWITCH; }; $renewalType == 11 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}); @acct_amts = (225, 75); @acct_description = ("$dues_paydesc PSV Affiliate Membership","$dues_paydesc CCAS Membership"); last SWITCH; }; $renewalType == 26 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"SPPM"}); @acct_amts = (225, 50); @acct_description = ("$dues_paydesc PSV Active Membership","$dues_paydesc SPPM Membership"); last SWITCH; }; $renewalType == 28 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"SPPM"}); @acct_amts = (225, 50); @acct_description = ("$dues_paydesc PSV Affiliate A Membership","$dues_paydesc SPPM Membership"); last SWITCH; }; $renewalType == 27 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}, $dues_acct{"SPPM"}); @acct_amts = (225, 75, 50); @acct_description = ("$dues_paydesc PSV Active Membership","$dues_paydesc CCAS Membership","$dues_paydesc SPPM Membership"); last SWITCH; }; $renewalType == 34 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}, $dues_acct{"SPPM"}); @acct_amts = (225, 75, 50); @acct_description = ("$dues_paydesc PSV Affiliate Membership","$dues_paydesc CCAS Membership","$dues_paydesc SPPM Membership"); last SWITCH; }; $renewalType == 7 && do { @acct_nums = ($dues_acct{"PSV"}); @acct_amts = (50); @acct_description = ("$dues_paydesc Resident PSV/CCAS/SPPM Membership"); last SWITCH; }; $renewalType == 6 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}, $dues_acct{"SPPM"}); @acct_amts = (50, 25, 25); @acct_description = ("$dues_paydesc PSV Fellow Membership","$dues_paydesc CCAS Membership","$dues_paydesc SPPM Membership"); last SWITCH; }; $renewalType == 4 && do { @acct_nums = ($dues_acct{"PSV"}); @acct_amts = (50); @acct_description = ("$dues_paydesc PSV Retired Membership"); last SWITCH; }; $renewalType == 15 && do { @acct_nums = ($dues_acct{"PSV"}); @acct_amts = (175); @acct_description = ("$dues_paydesc PSV Transitional Membership"); last SWITCH; }; $renewalType == 39 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}); @acct_amts = (175, 75); @acct_description = ("$dues_paydesc PSV/CCAS Transitional Membership"); last SWITCH; }; $renewalType == 43 && do { @acct_nums = ($dues_acct{"PSV"}, $dues_acct{"CCAS"}, $dues_acct{"SPPM"}); @acct_amts = (175, 75, 50); @acct_description = ("$dues_paydesc PSV/CCAS/SPPM Transitional Membership"); last SWITCH; }; } my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,incomeID,memberID,account,description,cost,checkNo,updateExp,reactivate,newItem,mbrRenewal,autoRenew) VALUES (?,?,?,?,?,?,?,?,?,?,?,?) }) || $main::dbh->errstr; for (my $i = 0; $i < scalar @acct_nums; ++$i) { $cost += $acct_amts[$i]; $rv = $sth->execute($orderID,$renewalType,$member_no,$acct_nums[$i],$acct_description[$i],$acct_amts[$i],$checkNumber,1,1,0,1,$auto_renew) || $main::dbh->errstr(); $error_msg .= "
    Failed to add renewal info: $member_no $fields[1] ".$rv if $rv < 1; } $buffer .= "\n============================================================================="; $buffer .= "\nMEMBERSHIP RENEWAL INFORMATION\n"; $buffer .= "\n$dues_paydesc " . $descriptions{$cgi->param('member_option')}; $reginfo_buffer2 .= ''; my $number = $membership_cost{$cgi->param('member_option')}; $number =~ s/(\d)(?=(\d{3})+(\D|$))/$1\,/g; $reginfo_buffer2 .= '\n"; $reginfo_buffer2 .= ''; $reginfo_buffer2 .= '\n"; } # End Calculate Member Renwal # my $number = $cost; $number =~ s/(\d)(?=(\d{3})+(\D|$))/$1\,/g; $reginfo_buffer2 .= ''; $reginfo_buffer2 .= ''; $reginfo_buffer2 .= "
    DESCRIPTION UNIT PRICE QUANTITY TOTAL
    $reg_types[$i][1]"; for ($j=0; defined($reg_types[$i][3][$j]); $j++) { foreach my $rts (@reg_types_sub) { if ($rts eq $reg_types[$i][3][$j][0]) { $buffer .= "(" . $reg_types[$i][3][$j][1] . ")"; $tab += length($reg_types[$i][3][$j][1]) +2; $subtype_count++; } } } # my $t_count=(floor((75-$tab)/8+.5)-1); my $t_count= 64-$tab; if ($cgi->param('reg_type') eq "ONEDAY") { # $t_count = $t_count-3; $t_count = $t_count - 18; } for (my $tabs=0; $tabs<$t_count; $tabs++) { # $buffer .= "\t"; $buffer .=" "; } ### Deal with ONEDAY costs here if ($cgi->param('reg_type') eq "ONEDAY") { $regcost=$subtype_count * $reg_types[$i][2][$reduced_rate]; $cost = $cost + $regcost; $buffer .= "$subtype_count days \@ \$" . $reg_types[$i][2][$reduced_rate] . "/day= \$" . $regcost; $reginfo_buffer2 .= " $subtype_count days \@ \$" . $reg_types[$i][2][$reduced_rate] . "/day$'. $reg_types[$i][2][$reduced_rate] . "'.$subtype_count.'$'. $regcost . "
    $'. $reg_types[$i][2][$reduced_rate] . "1$'. $reg_types[$i][2][$reduced_rate] . "
    " . $mondaynightreception[$i][1] . "$'. $mondaynightreception[$i][2][$reduced_rate] . "1\$$mondaynightreception[$i][2][$reduced_rate]
    " . $guest[$i][1] . "$'. $guest[$i][2][$reduced_rate] . "' . $cgi->param("numguest$guest[$i][0]") . '\$$guest_total
    I will attend the $extras3[3]$'. $extras3[$reduced_rate] . "' . $counter++ . "\$$extra3_total
    Accompanying Person(s)$'. $extras[$reduced_rate] . "'.$cgi->param('extras').'$'. $extra_total . "
    " . $counter++ . "Welcome Reception: " . $cgi->param('extras2') . " Children Guest(s) \@ \$" . $extras2[$reduced_rate] . "/person\$$extra2_total
    " . $counter++ . "I DO NOT plan to attend the $society Banquet and would like to donate my ticket to a resident\$$mondaynightreceptioncost_total
    " . $counter++ . "Closing Ceremony and Reception: " . $cgi->param('kidsmondaynightreception') . " Guest(s) \@ \$" . $kidsmondaynightreception[$reduced_rate] . "/person\$$kidsmondaynightreceptioncost_total
    " . $specialitems[$j][1] . "$'. $specialitems[$j][2][$reduced_rate] . "1$specialitems[$j][1]\$$specialitems[$j][2][$reduced_rate]
    " . $workshops[$j][1] . "$'. $workshops[$j][2][$reduced_rate] . "1$workshops[$j][1]\$$workshops[$j][2][$reduced_rate]
    $pbls[$j][1]\$$pbls[$j][2][$reduced_rate]1\$$pbls[$j][2][$reduced_rate]
    " . $donations[$i][1] . "$'. $cgi->param("fund$donations[$i][0]") . "1\$". $cgi->param("fund$donations[$i][0]") . "
    Education/Research Fund Donation$' . $cgi->param('fund') . '1\$" . $cgi->param('fund') . "
    ".substr($receptions[$j][1],0,60)."$'. $receptions[$j][2]{$cgi->param('reg_type')}[$reduced_rate] . "1$'. $receptions[$j][2]{$cgi->param('reg_type')}[$reduced_rate] . "
    '.$newmbr_paydesc . ' ' .$descriptions{$cgi->param('applyingfor')}.'$'. $number . "1$'. $number . "
    '.$dues_paydesc .' '.$descriptions{$cgi->param('member_option')}.'$'. $number . "1$'. $number . "
    Total: $'.$number.'
    \n"; ############################################## # Totals, Cybercash, Write to file, etc # ############################################## my $sth = $main::dbh->prepare(qq{ UPDATE orderDetail set total = $cost WHERE total IS NULL AND orderID = ? }) || $main::dbh->errstr; my $rv = $sth->execute($orderID) || $main::dbh->errstr(); $error_msg .= "
    Failed to update totals: $member_no ".$rv if $rv < 1; my $exp_date = $main::cgi->param('exp_month') . $main::cgi->param('exp_year'); $buffer .= "\n============================================================================="; $buffer .= "\nTotal:\t\t\t\t\t\t\t\t\t \$" . $cost; $buffer .= "\n\nCredit Card Information"; my $new_card_no = substr($cgi->param('ssl_card_number'), 0, 2) . "********" . substr($cgi->param('ssl_card_number'), -4); # my $new_card_no = $cgi->param('ssl_card_number'); $buffer .= "\n\nCard Type: " . $card_type . "\nCard Number: " . $new_card_no . "\nExpiration. Date: " . $exp_date . "\nName on Card: " . $cgi->param('customer_name'); ########## # Survey # ########## if ($cgi->param('special')) { my $survey_buffer .="\n\n" . $cgi->param('special') ."\n"; my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,meetingID,workshopID,breakoutID,regtypeID,memberID,description) VALUES (?,?,?,?,?,?,?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$meeting_number,8,0,$cgi->param('reg_type'),$member_no,$meeting.' - Speial Accommodations') || $main::dbh->errstr(); $error_msg .= "
    Failed to add special accom - mbr#: $member_no ".$rv if $rv < 1; $text[2] .="\"" . $orderID . "\",\"" . $meeting_number . "\",\""; $text[2] .= "8" . "\",\"0\",\""; $text[2] .= $cgi->param('reg_type') . "\",\""; $text[2] .= $date . "\",\"" . $account . "\",\"" . "0" . "\",\""; $text[2] .= $cgi->param('card_type') . "*" . substr($cgi->param('ssl_card_number'), -4); $text[2] .= "\",\"" . "TOTALCOST" . "\",\""; $text[2] .= $society . "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; $buffer .= $survey_buffer; } my @surveys = (); my $sth3 = $main::dbh->prepare(qq{ SELECT surveyID,survey,multiSubmit FROM survey WHERE meetingID = ? }) || $main::dbh->errstr; $sth3->execute($meeting_number) || $main::dbh->errstr; while (@surveys = $sth3->fetchrow_array()) { my $surveyComplete = 0; if (!$surveys[2]) { my $sth4 = $main::dbh->prepare(qq{ SELECT 1 FROM survey_users WHERE surveyID = ? AND userEmail= ? LIMIT 1 }) || $main::dbh->errstr; $sth4->execute($surveys[0], $main::cgi->param('loginemail')) || $main::dbh->errstr; $surveyComplete = $sth4->fetchrow(); $sth4->finish(); } if ($surveys[2] || !$surveyComplete) { my @surQuestions = &load_questions($surveys[0]); foreach my $question (@surQuestions) { my @indivQues = &get_question($question); my $sth4 = $main::dbh->prepare(qq{ INSERT INTO survey_answers (surveyID,questionID,optionID,user,answers) VALUES (?,?,?,?,?) }) || $main::dbh->errstr(); if ($main::cgi->param('survfield_'.$indivQues[0]) && ($indivQues[2] eq "4" || $indivQues[2] eq "5" || $indivQues[2] eq "6")) { my @values = $main::cgi->param('survfield_'.$indivQues[0]); foreach my $answers (@values) { $sth4->execute($surveys[0],$indivQues[0],$answers,''.$main::cgi->param('loginemail'),"") || $main::dbh->errstr(); } if ($main::cgi->param('survfield_other_'.$indivQues[0])) { $sth4->execute($surveys[0],$indivQues[0],0,''.$main::cgi->param('loginemail'),''.$main::cgi->param('survfield_other_'.$indivQues[0])); } } else { if ($main::cgi->param('survfield_'.$indivQues[0])) { if ($indivQues[2] eq "8" || $indivQues[2] eq "9") { $sth4->execute($surveys[0],$indivQues[0],0,''.$main::cgi->param('loginemail'),''.$main::cgi->param('survfield_'.$indivQues[0])); } else { $sth4->execute($surveys[0],$indivQues[0],$main::cgi->param('survfield_'.$indivQues[0]),''.$main::cgi->param('loginemail'),''); } if ($main::cgi->param('survfield_other_'.$indivQues[0])) { $sth4->execute($surveys[0],$indivQues[0],0,''.$main::cgi->param('loginemail'),''.$main::cgi->param('survfield_other_'.$indivQues[0])); } } } } my $sth4 = $main::dbh->prepare(qq{ INSERT INTO survey_users (surveyID,userEmail) VALUES (?,?) }) || $main::dbh->errstr(); $sth4->execute($surveys[0],''.$main::cgi->param('loginemail')); $sth4->finish(); } } $sth3->finish(); if ($cgi->param('hear_about_meeting')) { my $survey_buffer .="\n\n\n\nSurvey\n"; $survey_buffer .= "How did you hear about the meeting? \n"; my @hear_about = $cgi->param('hear_about_meeting'); foreach (@hear_about) { $survey_buffer .= "\t -- $_ \n"; } $buffer .= $survey_buffer; } if ($cgi->param('vascular_track')) { my $survey2_buffer = "\n\nAre you attending this meeting this meeting because of the Vascular Track?\n"; my @vascular_track = $cgi->param('vascular_track'); foreach (@vascular_track) { $survey2_buffer .= "\t -- $_ \n"; } $buffer .= $survey2_buffer; } ## End Survey $buffer .= "\n\nRefund Policy: $refund_policy"; ################# # Write to File # ################# $text[1]="\"" . $orderID . "\",\"". $society . "\",\"" . $cgi->param('ssl_last_name') . "\",\""; $text[1] .= $cgi->param('title') . "\",\"" . $cgi->param('ssl_first_name') . "\",\""; $text[1] .= " \",\""; #Address3 field $text[1] .= $cgi->param('ssl_ship_to_address1') . "\",\"" . $cgi->param('ssl_ship_to_address2') . "\",\""; $text[1] .= $cgi->param('ssl_ship_to_city') . "\",\"" . $state . "\",\""; $text[1] .= $cgi->param('ssl_ship_to_zip') . "\",\"" . $cgi->param('ssl_ship_to_country') . "\",\""; $text[1] .= $cgi->param('ssl_phone') ."\",\"" . $cgi->param('fax') . "\",\""; $text[1] .= $cgi->param('email') . "\",\""; $text[1] .= $cgi->param('ssl_email') . "\",\""; $text[1] .= $cgi->param('AOANumber') . "\",\""; $text[1] .= $member_no . "\",\""; $text[1] .= $cgi->param('Nickname') . "\",\""; $text[1] .= $cgi->param('aap_number') . "\"\n"; my $res_end = ""; $res_end = $cgi->param('gradyear').'-'.$cgi->param('gradmonth').'-01' if $cgi->param('gradyear') && $cgi->param('gradmonth'); if (!$registrant_in_db) { my $sth = $main::dbh->prepare(qq{ REPLACE INTO orderInfo (orderID,form,amount,memberID,cardType,lname,fname,degree,address1,address2,city,state,zip,country,phone,fax,email,receiptEmail,otherAssocID,nickName,preReg,memberApp,birthdate,gender,mbrType,inDatabase,hospital,practice_type,residencydate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$form,$cost,$member_no,$card_type,$cgi->param('ssl_last_name'),$cgi->param('ssl_first_name'),''.$cgi->param('title'),''.$cgi->param('ssl_ship_to_address1'),''.$cgi->param('ssl_ship_to_address2'),''.$cgi->param('ssl_ship_to_city'),''.$state,''.$cgi->param('ssl_ship_to_zip'),''.$cgi->param('ssl_ship_to_country'),''.$cgi->param('ssl_phone'),$cgi->param('fax'),$cgi->param('email'),$cgi->param('ssl_email'),''.$cgi->param('AOANumber'),$cgi->param('Nickname'),$registered,$application,$cgi->param('year').'-'.$cgi->param('month').'-'.$cgi->param('day'),''.$cgi->param('gender'),''.$cgi->param('applyingfor'),$registrant_in_db,''.$cgi->param('hospital'),''.$cgi->param('practice'),$res_end) || $main::dbh->errstr(); $error_msg .= "
    Failed to add new registrant $meeting ".$rv if $rv < 1; } else { my $sth = $main::dbh->prepare(qq{ REPLACE INTO orderInfo (orderID,form,amount,memberID,cardType,lname,fname,receiptEmail,nickName,preReg,memberApp,birthdate,gender,mbrType,inDatabase,hospital,practice_type,residencydate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID, $form, $cost, $member_no, $card_type, ''.$cgi->param('ssl_last_name'), ''.$cgi->param('ssl_first_name'), ''.$cgi->param('ssl_email'),$cgi->param('Nickname'),$registered,$application,$cgi->param('year').'-'.$cgi->param('month').'-'.$cgi->param('day'),''.$cgi->param('gender'),''.$cgi->param('applyingfor'),$registrant_in_db,''.$cgi->param('hospital'),''.$cgi->param('practice'),$res_end) || $main::dbh->errstr(); $error_msg .= "
    Failed to add registrant ($registered) to orderInfo table $meeting ".$rv if $rv < 1; } if (!$registered) { my $sth = $main::dbh->prepare(qq{ INSERT INTO orderDetail (orderID,meetingID,workshopID,breakoutID,regtypeID,memberID,account,description,cost,checkNo,total) VALUES (?,?,?,?,?,?,?,?,?,?,?) }) || $main::dbh->errstr(); my $rv = $sth->execute($orderID,$meeting_number,0,0,$cgi->param('reg_type'),$member_no,$account,$meeting.' - Registration Fees',$regcost,$checkNumber,$cost) || $main::dbh->errstr(); $error_msg .= "
    Failed to add main mtg - mbr#: $member_no $meeting ".$rv if $rv < 1; $text[2] .= "\"" . $orderID . "\",\"" . $meeting_number . "\",\"0\",\"0\",\""; } if (!$registered) { # if ($cgi->param('category')) { # $text[2] .= $cgi->param('category'). '/' . $cgi->param('reg_type'); # } else { $text[2] .= $cgi->param('reg_type'); # } } if (!$registered) { foreach (@reg_types_sub) { $text[2] .= "/" . $_ ; } } if (!$registered) { $text[2] .= "\",\""; $text[2] .= $date . "\",\"" . $account . "\"," . $regcost . ",\""; $text[2] .= $cgi->param('card_type'); $text[2] .= "\"," . "TOTALCOST" . ",\"" . $society; $text[2] .= "\","; $text[2] .= $cgi->param('ssl_last_name'); $text[2] .= "\",\""; $text[2] .= $cgi->param('ssl_first_name'); $text[2] .= "\"\n"; } my @writefiles; $writefiles[1] = $filename . $orderID . "_1.txt"; $writefiles[2] = $filename . $orderID . "_12.txt"; my $writefile; for ($i=1; defined($text[$i]); $i++) { $text[$i] =~ s/TOTALCOST/$cost/g; } for ($i=1; $i<=2; $i++) { $writefile=$writefiles[$i]; # my $texttofile='$text' . $i; if(open(FILE, ">>$writefile")) { flock(FILE, 2); seek(FILE, 0, 2); print FILE $text[$i]; close FILE; # $main::dbh->disconnect(); } else { die "Could NOT open file $i"; } } my $bufferfile = $filename . $orderID . "_buffer"; if(open(FILE, ">$bufferfile")) { flock(FILE, 2); seek(FILE, 0, 2); print FILE $buffer; close FILE; } else { die "Could NOT write buffer file $bufferfile"; } my $wkshp_selection = $filename . $orderID . "_workshops"; $selected_wkshps =~ s/ $//; if(open(FILE, ">$wkshp_selection")) { flock(FILE, 2); seek(FILE, 0, 2); print FILE $selected_wkshps; close FILE; } # end Write to File print '

    Step 3 of 3

    '; print p("Please verify the following registration and payment information before submitting your registration. Use the back button to make corrections."); print p(''); ###Get Script Name-- $i=script_name(); my @action=split("/", $i); $i=@action; $i--; print< EOF $reginfo_buffer = '

    '; $reginfo_buffer .= $cgi->param('ssl_first_name'); $reginfo_buffer .= " " . $cgi->param('ssl_last_name'); $reginfo_buffer .= " " . $cgi->param('title') . "\n"; $reginfo_buffer .= "
    " . $cgi->param('ssl_ship_to_address1') if $cgi->param('ssl_ship_to_address1'); $reginfo_buffer .= "
    " . $cgi->param('ssl_ship_to_address2') if $cgi->param('ssl_ship_to_address2'); $reginfo_buffer .= "
    " . $cgi->param('ssl_ship_to_city') . " " . $cgi->param('ssl_ship_to_state') . " " . $cgi->param('ssl_ship_to_zip'); $reginfo_buffer .= "
    " . $cgi->param('ssl_ship_to_country'); $reginfo_buffer .= "
    " . $cgi->param('ssl_phone') if $cgi->param('ssl_phone'); $reginfo_buffer .= "
    " . $cgi->param('email') if $cgi->param('email'); $reginfo_buffer .= "

    ABA Number: " . $cgi->param('aba_number') if $cgi->param('aba_number'); $reginfo_buffer .= "

    \n"; if ($cgi->param('ssl_email')) { $reginfo_buffer .= "

    Your confirmation letter will be emailed to this email address: ". $cgi->param('ssl_email') ."

    "; } else { $reginfo_buffer .= "

    No email address was provided for delivery of your confirmation letter. Confirmation letters are sent by email only.

    \n"; } print "$reginfo_buffer"; print "$reginfo_buffer2"; my $bufferfile = $filename . $orderID . "_infobuffer"; if(open(FILE, ">$bufferfile")) { flock(FILE, 2); seek(FILE, 0, 2); print FILE $reginfo_buffer . $reginfo_buffer2; close FILE; } else { die "Could NOT write buffer file $bufferfile"; } if ($cost) { print h4('Payment Information:'); my $new_card_no2 = substr($cgi->param('ssl_card_number'), 0, 2) . "********" . substr($cgi->param('ssl_card_number'), -4); print "

    $card_type: " . $new_card_no2 . "
    \n"; print "Expiration Date: " . $exp_date . "

    \n"; } if (!$registrant_in_db) { print hidden(-name=>'ssl_last_name'); print hidden(-name=>'ssl_first_name'); print hidden(-name=>'title'); } else { print hidden(-name=>'ssl_last_name', -default=>[$reg_fields[0]]); print hidden(-name=>'ssl_first_name', -default=>[$reg_fields[1]]); print hidden(-name=>'title', -default=>[$reg_fields[2]]); } print hidden(-name=>'ssl_ship_to_address1'); print hidden(-name=>'ssl_ship_to_address2'); print hidden(-name=>'ssl_ship_to_city'); print hidden(-name=>'ssl_ship_to_state'); print hidden(-name=>'ssl_ship_to_country'); print hidden(-name=>'ssl_ship_to_zip'); print hidden(-name=>'ssl_phone'); print hidden(-name=>'ssl_email'); print hidden(-name=>'card_type', -default=>$card_type); print hidden(-name=>'ssl_card_number'); print hidden(-name=>'ssl_exp_date', -default=>[$exp_date,$exp_date]); print hidden(-name=>'ssl_cvv2cvc2'); print hidden(-name=>'ssl_avs_address'); print hidden(-name=>'customer_name'); print hidden(-name=>'auto_charge'); my $avs_zip = substr($cgi->param('ssl_avs_zip'), 0, 9); print< EOF print p(strong('Refund Policy')); print p($refund_policy); print p({-style=>'color: #F00'},strong("By clicking submit, you authorize $society to charge your credit card. Please do NOT click submit more than once or you may be charged twice.")); print '  '; print ''; print "\n"; print "
    \n"; } } else { print '

    Step 2 of 3

    '; print '

    Welcome '.$reg_fields[18].'
    Click here if you are not '.$reg_fields[18].' or you want to register with a different email address.

    '; print '
    '.$msg.'
    ' if $msg; print '

     

    '; my @countries = ("Afghanistan","Albania","Algeria","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei Darussalam Bulgaria","Burkina Faso","Burma (Myanmar)","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Rep","Chad","Chile","China","Colombia","Comoros","Congo","Congo, Democratic Republic","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Ethiopia","Fiji","Finland","France","Gabon","Gambia","Georgia","Germany","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Macedonia","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","New Zealand","Nicaragua","Niger","Nigeria","North Korea","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Rwanda","St. Kitts & Nevis","St.Lucia","St. Vincent","Samoa","San Marino","Sao Tome & Principe","Saudi Arabia","Senegal","Serbia & Montenegro","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Korea","Spain","Sri Lanka","Sudan","Suriname","Swaziland","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","The Netherlands","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","USA","Uruguay","Uzbekistan","Vanuatu","Venezuela","Vietnam","Western Sahara","Yemen","Yugoslavia","Zaire","Zambia","Zimbabwe"); ###Get Script Name-- $i=script_name(); my @action=split("/", $i); $i=@action; $i--; print<
    EOF if ($registrant_in_db) { print<
    $reg_fields[18]
     
    First Name/Nickname for Badge:*
    Hospital/Institution:*
    Meeting Confirmation Email:*

    All conference registration confirmations and important updates will be sent via email. Please make sure to set your email account to accept emails from societyhq.com and pedsanesthesia.org.

    EOF if (!$member && !$balance) { &member_app(); } if ((!$auto_renew) && (($member && $balance) || (!$member && $balance))) { &dues_notice($member_no); } print<
    EOF } else { print< First Name*: Last Name*: Degree: First Name/Nickname for Badge:* Hospital/Institution:* Address 1*: Address 2: City*: State*: Postal Code*: Country*: Office Fax: Primary Email*: Meeting Confirmation Email*:

    All conference registration confirmations and important updates will be sent via email. Please make sure to set your email account to accept emails from societyhq.com and pedsanesthesia.org.

    EOF if (%category) { print ' Category: Are you a: '; foreach (keys %category) { print ""; print ""; if ($_ eq "O") { print " "; } } print ''; } print ' '; if (!$member && !$balance) { &member_app(); } if (($member && $balance) || (!$member && $balance)) { &dues_notice($member_no); } print< EOF } print< Registration Fees EOF my $sth3 = $main::dbh->prepare(qq{ SELECT eventTypeDesc FROM event_type WHERE meetingID=? AND eventType LIKE 'Main Meeting' OR eventType LIKE 'Main Event' LIMIT 1 }) || $main::dbh->errstr; $sth3->execute($meeting_number) || $main::dbh->errstr; my $sectionDesc = $sth3->fetchrow; $sth3->finish(); print "$sectionDesc" if $sectionDesc; print "
    "; if ($registered) { print '

    You are already registered for this meeting; continue if you want to add additional activities

    '; print ''; } else { print<   EOF if (!$onsite) { print< Through
    EOF print strftime("%B %d, %Y", (localtime($cutoff_time))); !>
    After
            prepare(qq{ SELECT groupName,groupDesc FROM reg_groups WHERE groupID=? LIMIT 1 }); $sth2->execute($groupType); @fields2 = $sth2->fetchrow_array(); $sth2->finish(); print "

    $fields2[0]" if @fields2; print "
    $fields2[1]" if $fields2[1]; print '

    ' if @fields2; # if ($groupType eq "Members") # { # print '

    MEMBER FEES'; # print ' - You may select member fees if you completed the preceding membership application or renewal notice.' if !$auto_renew && (!$member || $balance); # print '

    '; # } # if ($groupType eq "Non-Members") # { # print '

    NON-MEMBER FEES

    '; # } } print "\n"; print "\t\n"; print ""; print $reg_types[$i][1]; if (defined($reg_types[$i][4])) { for (my $ii=0; defined($reg_types[$i][4][$ii]); $ii++) { print "(" . $reg_types[$i][4][$ii] . ")"; } } if (defined($reg_types[$i][5])) { print "
    ".$reg_types[$i][5]."
    "; } if (defined($reg_types[$i][3])) { print "
    "; for (my $j=0; defined($reg_types[$i][3][$j]); $j++) { print "" . $reg_types[$i][3][$j][1] . " "; } print "
    "; } print "\n"; if ($reg_types[$i][2][1] > 0) { print "\$" . $reg_types[$i][2][1] if !$onsite; } else { print "N/C" if !$onsite; } if ($reg_types[$i][0] eq "ONEDAY") { print "/day"; } print "\n" if !$onsite; if ($reg_types[$i][2][0] > 0) { print "\t\$" . $reg_types[$i][2][0]; } else { print "\tN/C"; } if ($reg_types[$i][0] eq "ONEDAY") { print "/day"; } print "\n"; print "\n"; } } print ""; for ($i=1; defined($footnotes[$i]); $i++) { print "
      ($i) " . $footnotes[$i]; } print '
    '; if (@extras3) { !> I will attend the
    Must be a PSV registrant to attend $'.$extras3[1].'' if !$onsite; !> $   prepare(qq{ SELECT eventType,eventTypeDesc FROM event_type WHERE eventType LIKE 'reception' AND meetingID=? LIMIT 1 }); $sth3->execute($meeting_number); @fields2 = $sth3->fetchrow; $sth3->finish(); print "$fields2[1]" if $fields2[1]; # print "
    "; print '
    '; for ($i=0; defined($mondaynightreception[$i]); $i++) { $sth = $main::dbh->prepare(qq{ SELECT 1 FROM registrants WHERE cancelled IS NULL AND workshop_no=? AND meeting_no = ? AND member_id = ? LIMIT 1 }) || $main::dbh->errstr; $sth->execute($mondaynightreception[$i][0], $meeting_number, $member_no) || $main::dbh->errstr; @fields = $sth->fetchrow; $sth->finish(); $rec_registered = $fields[0]; if ($rec_registered) { print '

    You are already registered for '.$mondaynightreception[0][1].'

    '; } else { if ($sold_out{$mondaynightreception[$i][0]} != "1") { print < $mondaynightreception[$i][1] EOF if (defined($mondaynightreception[$i][5])) { print "
    ".$mondaynightreception[$i][5]."
    "; } print ""; if ($mondaynightreception[$i][2][$reduced_rate] > 0) { print "\$$mondaynightreception[$i][2][1]" if !$onsite; print "\$$mondaynightreception[$i][2][0]"; } else { print "No Charge" if !$onsite; print "No Charge"; } print ""; } else { print < SOLD OUT: $mondaynightreception[$i][1] Sold Out Sold Out EOF } } } } if (@guest) { print '
    '; print ' Guest and Event Registration'; my $sth3 = $main::dbh->prepare(qq{ SELECT eventTypeDesc FROM event_type WHERE meetingID=? AND eventType LIKE 'guest%' LIMIT 1 }) || $main::dbh->errstr; $sth3->execute($meeting_number) || $main::dbh->errstr; my $sectionDesc = $sth3->fetchrow; $sth3->finish(); print "$sectionDesc" if $sectionDesc; print "
    "; for ($i=0; defined($guest[$i]); $i++) { print '
    ' if $i >= 1; print ""; if ($sold_out{$guest[$i][0]} != "1") { if ($guest[$i][2][$reduced_rate] > 0) { print ''; } else { print ''; } print "Number of $guest[$i][1]: "; if (defined($guest[$i][5])) { print "
    ".$guest[$i][5]."
    "; } if ($guest[$i][2][$reduced_rate] > 0) { print ""; print "\$$guest[$i][2][1]/person" if !$onsite; print "\$$guest[$i][2][0]/person"; } else { print ""; } print < Name(s) for $guest[$i][1]:
      EOF } else { print ''; if ($guest[$i][2][$reduced_rate] > 0) { print ''; } else { print ''; } print "SOLD OUT: $guest[$i][1]"; if ($guest[$i][2][$reduced_rate] > 0) { print ""; print "\$$guest[$i][2][1]" if !$onsite; print "\$$guest[$i][2][0]"; } else { print ""; } print ""; } } } if (@extras) { !>   Number of Accompanying Person(s): $'.$extras[1].'/person' if !$onsite; !> $/person Includes Entrance to Exhibit Hall, Reception, and Continental Breakfast.     Accompanying Person(s) Name(s): Number of Children Guests:
    Saturday Welcome Reception - Children ages 6-12 (Children age 5 and under free). $/person $/person Number of Guest:
    Closing Ceremony & Reception Guest Fee $/person $/person   Free Free $ $        
    '; my @fields2 = (); my $sth3 = $main::dbh->prepare(qq{ SELECT eventType,eventTypeDesc FROM event_type WHERE eventType LIKE '%donation%' AND meetingID=? LIMIT 1 }); $sth3->execute($meeting_number); @fields2 = $sth3->fetchrow; $sth3->finish(); print<  $fields2[0] EOF print "$fields2[1]" if $fields2[1]; print "
    "; for ($i=0; defined($donations[$i]); $i++) { print '
    ' if $i >= 1; print ""; if ($sold_out{$donations[$i][0]} != "1") { print "$donations[$i][1]"; if (defined($donations[$i][5])) { print "
    ".$donations[$i][5]."
    "; } print ""; print ".00
    (numbers only)"; print ""; # print < # Optional for $donations[$i][1]:
    #   # #EOF } else { print ''; print ''; print "SOLD OUT: $donations[$i][1]"; print ""; print ""; } } } if ($research_fund) { # research fund !>   $.00
    (numbers only)     prepare(qq{ SELECT 1 FROM registrants WHERE cancelled IS NULL AND workshop_no IN(1,2,3,4) AND meeting_no = ? AND member_id = ? LIMIT 1}) || $main::dbh->errstr; $sth->execute($meeting_number, $member_no) || $main::dbh->errstr; @fields = $sth->fetchrow; $sth->finish(); $lab_registered = 1 if $fields[0]; if ($lab_registered) { print ''; print ''; print ''; } else { !>
    Mentoring Session, Workshops and Symposium

    You are already registered for the Mentoring Session, Workshop or Symposium

    [3]}++ for @receptions; my @dinnerdates=sort keys %u_dates; my $day=0; my $month=0; my $year=0; my $hour=0; my $min=0; my $time=0; my $k=0; foreach (@dinnerdates) { # cycle through dates print "\n"; for ($i=0; defined($receptions[$i]); $i++) { # cycle through dinners if ($dinnerdates[$k]==$receptions[$i][3]) { # Date = Dinner print "\n"; print ""; for (my $j=0; defined($reg_types[$j]); $j++) { # cycle through reg types and print descriptions if ($j==0) { print "" if !$onsite; } if ($receptions[$i][2]{$reg_types[$j][0]}[1] && $receptions[$i][2]{$reg_types[$j][0]}[0]) { print ""; print "" if !$onsite; print ""; } } } } $k++; print ""; } } !>
    Mentoring Session
    Please note that Workshops and the Symposium run concurrently with the Mentoring Session. You may only attend one workshop, the Symposium OR the Mentoring Session.
         
    "; $day=substr($dinnerdates[$k], 6, 2); $month=substr($dinnerdates[$k],4,2); $month--; $year=substr($dinnerdates[$k],0,4)-1900; $hour=substr($dinnerdates[$k],8,2); $min=substr($dinnerdates[$k],10,2); $time=timelocal(0,$min,$hour,$day,$month,$year); print strftime("%B %d %Y -- %I:%M %p", (localtime($time))); print "
    $receptions[$i][1]
        Through
    ".strftime("%B %d, %Y", (localtime($cutoff_time)))."
    After
    ".strftime("%B %d, %Y", (localtime($cutoff_time)))."
     
  • $reg_types[$j][1]
  • \$$receptions[$i][2]{$reg_types[$j][0]}[1]\$$receptions[$i][2]{$reg_types[$j][0]}[0]
     
              Special Interest Group — Pediatric Pain Medicine
    [3]}++ for @intensive_ws; my @iwsdates=sort keys %u_dates; my $day=0; my $month=0; my $year=0; my $hour=0; my $min=0; my $time=0; my $k=0; foreach (@iwsdates) { print "\n"; for ($i=0; defined($intensive_ws[$i]); $i++) { if ($iwsdates[$k]==$intensive_ws[$i][3]) { if ($sold_out{$intensive_ws[$i][0]} != "1") { print "\n"; print "\n"; } else { print "\n"; print "\n"; } } } $k++; } !>
        
    "; $day=substr($iwsdates[$k], 6, 2); $month=substr($iwsdates[$k],4,2); $month--; $year=substr($iwsdates[$k],0,4)-1900; $hour=substr($iwsdates[$k],8,2); $min=substr($iwsdates[$k],10,2); $time=timelocal(0,$min,$hour,$day,$month,$year); print strftime("%B %d %Y -- %I:%M %p", (localtime($time))); print "
    $intensive_ws[$i][1]\$$intensive_ws[$i][2][1]\$$intensive_ws[$i][2][0]
    Sold Out$intensive_ws[$i][1]Sold Out
     
                    Master Classes
    Please select your 1st choice for each session [3]}++ for @master_classes; my @wsdates=sort keys %u_dates; my $day=0; my $month=0; my $year=0; my $hour=0; my $min=0; my $time=0; my $k=0; foreach (@wsdates) { print ""; for ($i=0; defined($master_classes[$i]); $i++) { if ($wsdates[$k]==$master_classes[$i][3]) { if ($sold_out{$master_classes[$i][0]} != "1") { print ""; if ($master_classes[$i][2][$reduced_rate] > 0) { print ""; } else { print ""; } } else { print ""; print ""; } } } $k++; } !>
        
    Master Class -- "; $day=substr($wsdates[$k], 6, 2); $month=substr($wsdates[$k],4,2); $month--; $year=substr($wsdates[$k],0,4)-1900; $hour=substr($wsdates[$k],8,2); $min=substr($wsdates[$k],10,2); $time=timelocal(0,$min,$hour,$day,$month,$year); print strftime("%B %d %Y -- %I:%M %p", (localtime($time))); print "
    $master_classes[$i][1]\$$master_classes[$i][2][1]\$$master_classes[$i][2][0]
    $master_classes[$i][1]
    Sold Out$master_classes[$i][1]Sold Out
     
            prepare(qq{ SELECT eventTypeDesc FROM event_type WHERE eventType LIKE '%lunch%' AND meetingID=? LIMIT 1 }) || $main::dbh->errstr; $sth3->execute($meeting_number) || $main::dbh->errstr; my $sectionDesc = $sth3->fetchrow; $sth3->finish(); !> \n"; } if (!$onsite) { print< \n"; } !> [3]}++ for @specialitems; my @sidates=sort keys %u_dates; my $day=0; my $month=0; my $year=0; my $hour=0; my $min=0; my $time=0; my $k=0; my $ii=0; foreach (@sidates) { # print "\n"; # print ""; # print ""; print "\n"; # print ''; my $si_registered = 0; my $eventDate = strftime("%Y-%m-%d", (localtime($time))); $sth = $main::dbh->prepare(qq{ SELECT 1,name,CONCAT_WS(' - ',TIME_FORMAT(m.start_time,'%l:%i'),TIME_FORMAT(m.end_time,'%l:%i %p')) FROM registrants r LEFT JOIN meeting m ON r.meeting_no=m.meeting_no AND r.workshop_no=m.workshop_no WHERE cancelled IS NULL AND m.eventTypeID=13 AND m.start_date='$eventDate' AND m.start_time LIKE '$hour:$min%' AND r.meeting_no = ? AND r.member_id = ? LIMIT 1 }) || $main::dbh->errstr; $sth->execute($meeting_number, $member_no) || $main::dbh->errstr; @fields = $sth->fetchrow; $sth->finish(); $si_registered = 1 if $fields[0]; $ii++; if ($si_registered) { print '"; print ''; } else { for ($i=0; defined($specialitems[$i]); $i++) { if ($sidates[$k]==$specialitems[$i][3]) { # sidate matches special item date if ($sold_out{$specialitems[$i][0]} != "1") { print ""; if ($u_dates{$sidates[$k]} > 1) { print "\n "; } else { print "\n"; } if ($u_dates{$sidates[$k]} > 2) { print "\n"; } else { print "\n"; } if ($specialitems[$i][2][$reduced_rate] > 0) { print ""; print "" if !$onsite; print ""; } else { print ""; } } else { print "\n"; print ""; } } # end sidate matches specialitem date } } $k++; } !>
    Special Items
     

    Earlybird Bonus: Sign up for a Workshop today and get the second workshop free"; print "
    Bonus good until " . strftime("%B %d, %Y", (localtime($early_bird_cutoff_time))) . ". Does not apply to Intensive Workshops, Master Classes or PBL Discussions
            Through
    EOF print strftime("%B %d, %Y", (localtime($cutoff_time))); !>
    After
     

    1st2nd3rd"; $day=substr($sidates[$k], 6, 2); $month=substr($sidates[$k],4,2); $month--; $year=substr($sidates[$k],0,4)-1900; $hour=substr($sidates[$k],8,2); $min=substr($sidates[$k],10,2); $time=timelocal(0,$min,$hour,$day,$month,$year); # print strftime("%A -- %B %d %Y -- %I:%M %p", (localtime($time))); # print uc(strftime("%A -- %B %d %Y", (localtime($time)))); # print "  

    No Workshop

    You are already registered for special item:

    '; print "
    • $fields[1]
      
    \ \; \ \;$specialitems[$i][1]\$$specialitems[$i][2][1]\$$specialitems[$i][2][0]
    $specialitems[$i][1]No ChargeNo Charge
    Sold Out$specialitems[$i][1]Sold Out
     
     
            prepare(qq{ SELECT eventType,eventTypeDesc FROM event_type WHERE eventType LIKE 'workshop%' AND meetingID=? LIMIT 1 }); $sth3->execute($meeting_number); @fields2 = $sth3->fetchrow; $sth3->finish(); print "" if $fields2[1]; print ''; if ($early_bird) { print "\n"; } if (!$onsite) { print< \n"; } !> [3]}++ for @workshops; my @wsdates=sort keys %u_dates; my $day=0; my $month=0; my $year=0; my $hour=0; my $min=0; my $time=0; my $k=0; my $ii=0; foreach (@wsdates) { print "\n"; print ""; print ""; print "\n"; # print ''; my $wkshp_registered = 0; my $eventDate = strftime("%Y-%m-%d", (localtime($time))); $sth = $main::dbh->prepare(qq{ SELECT 1,name,CONCAT_WS(' - ',TIME_FORMAT(m.start_time,'%l:%i'),TIME_FORMAT(m.end_time,'%l:%i %p')) FROM registrants r LEFT JOIN meeting m ON r.meeting_no=m.meeting_no AND r.workshop_no=m.workshop_no WHERE cancelled IS NULL AND m.eventTypeID=1 AND m.start_date='$eventDate' AND m.start_time LIKE '$hour:$min%' AND r.meeting_no = ? AND r.member_id = ? LIMIT 1 }) || $main::dbh->errstr; $sth->execute($meeting_number, $member_no) || $main::dbh->errstr; @fields = $sth->fetchrow; $sth->finish(); $wkshp_registered = 1 if $fields[0]; $ii++; if ($wkshp_registered) { print '"; print ''; } else { for ($i=0; defined($workshops[$i]); $i++) { if ($wsdates[$k]==$workshops[$i][3]) { # wsdate matches workshop date if ($sold_out{$workshops[$i][0]} != "1") { print ""; if ($u_dates{$wsdates[$k]} > 1) { print "\n "; } else { print "\n"; } if ($u_dates{$wsdates[$k]} > 2) { print "\n"; } else { print "\n"; } if ($workshops[$i][2][$reduced_rate] > 0) { print ""; print "" if !$onsite; print ""; } else { print ""; } } else { print "\n"; print ""; } } # end wsdate matches workshop date } } $k++; } !>
    Workshops
    $fields2[1]


    Earlybird Bonus: Sign up for a Workshop today and get the second workshop free"; print "
    Bonus good until " . strftime("%B %d, %Y", (localtime($early_bird_cutoff_time))) . ". Does not apply to Intensive Workshops, Master Classes or PBL Discussions
            Through
    EOF print strftime("%B %d, %Y", (localtime($cutoff_time))); !>
    After
     

    1st2nd3rd"; $day=substr($wsdates[$k], 6, 2); $month=substr($wsdates[$k],4,2); $month--; $year=substr($wsdates[$k],0,4)-1900; $hour=substr($wsdates[$k],8,2); $min=substr($wsdates[$k],10,2); $time=timelocal(0,$min,$hour,$day,$month,$year); # print strftime("%A -- %B %d %Y -- %I:%M %p", (localtime($time))); print uc(strftime("%A -- %B %d %Y", (localtime($time)))); print "  

    No Workshop

    You are already registered for workshop:

    '; print "
    • $fields[1] ($fields[2])
      
    \ \;\ \;$workshops[$i][1]\$$workshops[$i][2][1]\$$workshops[$i][2][0]
    $workshops[$i][1]No ChargeNo Charge
    Sold Out$workshops[$i][1]Sold Out
     
     
           
    '; !> prepare(qq{ SELECT eventTypeDesc FROM event_type WHERE meetingID=? AND eventType LIKE 'pbld%' LIMIT 1 }) || $main::dbh->errstr; $sth3->execute($meeting_number) || $main::dbh->errstr; my $sectionDesc = $sth3->fetchrow; $sth3->finish(); print "" if $sectionDesc; # print ""; print '
    Breakfast:
    $sectionDesc

    '; my %u_dates; $u_dates{$_->[3]}++ for @pbls; my @pbldates=sort keys %u_dates; my $day=0; my $month=0; my $year=0; my $hour=0; my $min=0; my $time=0; my $k=0; my $ii=0; foreach (@pbldates) { print "\n"; print ""; print "\n"; my $pbld_registered = 0; my $eventDate = strftime("%Y-%m-%d", (localtime($time))); $sth = $main::dbh->prepare(qq{ SELECT 1,name,CONCAT_WS(' - ',TIME_FORMAT(m.start_time,'%l:%i'),TIME_FORMAT(m.end_time,'%l:%i %p')) FROM registrants r LEFT JOIN meeting m ON r.meeting_no=m.meeting_no AND r.workshop_no=m.workshop_no WHERE cancelled IS NULL AND m.eventTypeID=12 AND start_time LIKE '$hour:$min%' AND start_date='$eventDate' AND r.meeting_no = ? AND r.member_id = ? LIMIT 1 }) || $main::dbh->errstr; $sth->execute($meeting_number, $member_no) || $main::dbh->errstr; @fields = $sth->fetchrow; $sth->finish(); $pbld_registered = 1 if $fields[0]; $ii++; if ($pbld_registered) { print '"; print ''; } else { for ($i=0; defined($pbls[$i]); $i++) { if ($pbldates[$k]==$pbls[$i][3]) { if ($sold_out{$pbls[$i][0]} != "1") { print "\n"; # print "\n"; # print "\n\n"; if ($pbls[$i][2][$reduced_rate] > 0) { print ""; } else { print ""; } } else { print "\n"; print ""; } } } } $k++; } !>

    "; $day=substr($pbldates[$k], 6, 2); $month=substr($pbldates[$k],4,2); $month--; $year=substr($pbldates[$k],0,4)-1900; $hour=substr($pbldates[$k],8,2); $min=substr($pbldates[$k],10,2); $time=timelocal(0,$min,$hour,$day,$month,$year); print strftime("%B %d %Y -- %I:%M %p", (localtime($time))); print "

    You are already registered for a breakfast:

    '; print "
    • $fields[1] ($fields[2])
      
    $pbls[$i][1]"; print "\$$pbls[$i][2][1]" if !$onsite; print "\$$pbls[$i][2][0]
    $pbls[$i][1]
    Sold Out$pbls[$i][1]Sold Out
    '; print ''; print ''; print ''; for ($i=0; defined($misc[$i]); $i++) { print '' if $i >= 1; print ""; if ($sold_out{$misc[$i][0]} != "1") { if ($misc[$i][2][$reduced_rate] > 0) { print '"; print "" if !$onsite; print ""; } else { print ""; } print < EOF } else { print ''; if ($misc[$i][2][$reduced_rate] > 0) { print '"; print "" if !$onsite; print ""; } else { print ""; } print ""; } } print '
    Other Registration
     

    '; } else { print ''; } print "$misc[$i][1]"; if (defined($misc[$i][5])) { print "
    ".$misc[$i][5]."
    "; } if ($misc[$i][2][$reduced_rate] > 0) { print "
    \$$misc[$i][2][1]\$$misc[$i][2][0]
    Please specify (if applicable):
     
    '; } else { print ''; } print "SOLD OUT: $misc[$i][1]"; if ($misc[$i][2][$reduced_rate] > 0) { print "\$$misc[$i][2][1]\$$misc[$i][2][0]
    '; } if (@bbq){ !>
    Saturday BBQ [3]}++ for @bbq; my @bbqdates=sort keys %u_bbqdates; my $day=0; my $month=0; my $year=0; my $hour=0; my $min=0; my $time=0; my %u_bbqdays; $u_bbqdays{substr($_->[3],0, 8)}++ for @bbq; my @bbqdays=sort keys %u_bbqdays; foreach my $bbqday (@bbqdays) { $day=substr($bbqday, 6, 2); $month=substr($bbqday,4,2); $month--; $year=substr($bbqday,0,4)-1900; $hour=substr($bbqday,8,2); $min=substr($bbqday,10,2); $time=timelocal(0,$min,$hour,$day,$month,$year); # print strftime("%B %d %Y", (localtime($time))); foreach my $times (@bbqdates) { if ($bbqday eq substr($times, 0, 8)) { foreach (@bbq) { if ($_->[3] == $times) { $day=substr($times, 6, 2); $month=substr($times,4,2); $month--; $year=substr($times,0,4)-1900; $hour=substr($times,8,2); $min=substr($times,10,2); $time=timelocal(0,$min,$hour,$day,$month,$year); print ""; print ""; } } } } } !>
       
    [0] . "\">" . $_->[1] . "\$" . $_->[2][1] . "\$" . $_->[2][0] . "
     
    prepare(qq{ SELECT surveyID,survey,multiSubmit FROM survey WHERE meetingID = ? }) || $main::dbh->errstr; $sth3->execute($meeting_number) || $main::dbh->errstr; @surveys = $sth3->fetchrow_array(); $sth3->finish(); print ''; if (@surveys) { print ''; } $sth3->execute($meeting_number); while (@surveys = $sth3->fetchrow_array()) { print < EOF my $surveyComplete = 0; my $sth4 = $main::dbh->prepare(qq{ SELECT 1 FROM survey_users WHERE surveyID = ? AND userEmail = ? LIMIT 1 }) || $main::dbh->errstr; $sth4->execute($surveys[0], $cgi->param('loginemail')) || $main::dbh->errstr; $surveyComplete = $sth4->fetchrow(); $sth4->finish(); if (!$surveys[2] && $surveyComplete) { print ""; } else { my @surQuestions = &load_questions($surveys[0]); foreach my $question (@surQuestions) { my @indivQues = &get_question($question); my @options = &get_options($question); my $checked = ''; print ""; SWITCH: for ($indivQues[2]) { /1/ && do { print ""; last SWITCH; }; /3/ && do { print ""; last SWITCH; }; /4/ && do { print ""; last SWITCH; }; /6/ && do { print ""; last SWITCH; }; /9/ && do { print ""; last SWITCH; }; } } } } $sth3->finish(); print "
    Survey
    $surveys[1]
    Survey completed! Thank you.
    $indivQues[1]"; print "
    Required Field! Please Complete!" if $indivQues[3]; print "
    "; for (my $i=0; $i
    "; for (my $i=0; $i
    "; for (my $i=0; $i
    "; for (my $i=0; $i
    "; textarea('survfield_'.$indivQues[0],''); print "
    "; !>
    Payment Information
    EOF }!>
    Card Number:
    Expiration Date: /
    Security Code:
    Card Billing Address:
    Card Billing Zip Code:
    Name on Card:
     

    Note: This is a secure transaction system. All of the information you provide is protected in transit and is processed securely. If entering your credit card information online makes you uncomfortable, you may pay by check. Checks should be made payable to $society and should be in US funds.

    If you do not receive a confirmation letter from the within 30 days of submitting your registration, please call the office to confirm that your registration material has been received.

    BACK TO FORM SELECTION PAGE'; } } } sub to_page { submit(-NAME => ".State", -VALUE => shift) } sub member_app { if (!$show_application) { return; } my $cursor = $main::dbh->prepare(qq{ SELECT omt.memberTypeID,IFNULL(optionalName,member_type),memDescription,member_dues FROM member_type mt, onsite_mem_types omt WHERE mt.membertype_id=omt.memberTypeID AND omt.eventID=? ORDER BY mt.member_type }); $cursor->execute($meeting_number); print<

    Membership Application
    (complete only if joining $society)

    Membership Category Applying For:
    EOF while (my @mbrtype = $cursor->fetchrow_array()) { print " $mbrtype[2] "; } $cursor->finish(); print<
    Date of Birth (MM/DD/YYYY): Residency/Fellowship Ends: $category[1] EOF } $cursor->finish(); print < Gender:  

    EOF } sub dues_notice { if (!$show_renewal_appl) { return; } my ($mbrID) = @_; my ($member_type) = ''; my (@fields) = (); my $cursor = $main::dbh->prepare(qq{ SELECT balance_due, member_type, mail_country,t1.membertype_id,member FROM member t1,member_type t2 WHERE t1.membertype_id=t2.membertype_id AND t1.member_id= ? LIMIT 1 }); $cursor->execute($mbrID); @fields = $cursor->fetchrow; $cursor->finish; $member_type = $fields[3]; my $member = $fields[4]; print<

    Membership Renewal Notice

    EOF if ($member && $allow_payLater) { print< EOF } my $cursor2 = $main::dbh->prepare(qq{ SELECT membertype_id,IFNULL(optionalName,member_type),memDescription,member_dues FROM member_type mt, onsite_dues_types dt WHERE mt.membertype_id=dt.memberTypeID AND eventID=? ORDER BY mt.membertype_id }); $cursor2->execute($meeting_number); while (my @mbrtype = $cursor2->fetchrow_array()) { print ""; print ""; print " $mbrtype[2] "; } $cursor->finish(); if ($member_type eq "6" || $member_type eq "7") { } else { !>

    Auto Renew Membership

    Auto Renew

    If you select "Auto Renew", your membership will automatically renew for successive one year periods until cancellation. Upon renewal, you authorize to charge the then-current membership fee amount to the payment method provided by you, for as long as you choose to remain a member. You can cancel your membership at any time by contacting the Society. '; } sub process_page { ########## # Elavon # ########## my $active = shift; return unless $active; my $elavon; my $orderID_check; my $cc_status; my $cc_redo; my $auth_code; my $error_msg; my $txn_time; my $txn_amount; my $to = $main::cgi->param('ssl_email'); my $fname = $main::cgi->param('ssl_first_name'); my $lname = $main::cgi->param('ssl_last_name'); my $address = $main::cgi->param('ssl_ship_to_address1'); my $city = $main::cgi->param('ssl_ship_to_city'); my $state = $main::cgi->param('ssl_ship_to_state'); my $zip = $main::cgi->param('ssl_ship_to_zip'); my $member_no = $main::cgi->param('ssl_invoice_number'); my $orderID = $main::cgi->param('order_code'); my $cost = $main::cgi->param('ssl_amount'); my $exp_date = $main::cgi->param('ssl_exp_date'); my $checkNumber = $main::cgi->param('card_type'); my $buffer_filename = $filename . $orderID; my ($buffer2, $buffer3) = ''; my $subject = $society . " " . $form . " " . $lname . ", ". $fname . " " . $orderID; my $recipient_subject = "$society $meeting Confirmation"; use lib '/opt/elavon/'; use ElavonCC qw (&Run_CC &CC_Error_Check &Ruggles_Mail); if ($use_elavon && $cost > 0) { ($elavon, $orderID_check, $cc_status, $cc_redo, $auth_code, $error_msg, $txn_time, $txn_amount) = Run_CC($society, $form, $orderID, $cost, $MerchantMode, $exp_date, $checkNumber, $main::cgi->param('ssl_card_number'), $main::cgi->param('customer_name'), ''.$fname, ''.$lname, ''.$address, ''.$city, ''.$state, ''.$zip, $main::cgi->param('ssl_avs_address'), $main::cgi->param('ssl_avs_zip'), $main::cgi->param('ssl_cvv2cvc2'), $member_no); $buffer = "Order Number:\t" . $orderID . "\n"; $buffer .= "Order Date:\t" . $txn_time . "\n"; $buffer .= "Auth-Code:\t" . $auth_code . "\n"; } if (open(DAT, "$buffer_filename" . "_buffer")) { while () { $buffer .= $_; } close DAT; } else { $error_msg .= "
    Could not open buffer data: $buffer_filename" . "_buffer"; } if (open(DAT, "$buffer_filename" . "_infobuffer")) { while () { $buffer3 .= $_; } close DAT; } else { $error_msg .= "
    Could not open buffer data: $buffer_filename" . "_infobuffer"; } $buffer =~ s/Card Number:\s[0-9]+/Card Number: ******/; $buffer =~ s/Security Code:\s[0-9]+/Security Code: ****/; $buffer2 = $buffer; $buffer2 =~ s/\n/
    /g; my @surveys = (); my $sth3 = $main::dbh->prepare(qq{ SELECT s.surveyID,survey FROM survey s LEFT JOIN survey_users su ON s.surveyID=su.surveyID WHERE su.surveyID IS NULL AND meetingID = ? }) || $main::dbh->errstr; $sth3->execute($meeting_number) || $main::dbh->errstr; while (@surveys = $sth3->fetchrow_array()) { my @surQuestions = &load_questions($surveys[0]); foreach my $question (@surQuestions) { if ($cgi->param('survfield_'.$question) && ref($cgi->param('survfield_'.$question)) eq 'ARRAY') { print "

    Question $question: is array

    "; } } } $sth3->finish(); if ($use_elavon) { if ($cost <= 0) { $elavon = 1; &display_receipt($orderID, "$lname, $fname"); } else { CC_Error_Check($elavon, $orderID_check, $cc_status, $cc_redo, $error_msg, $orderID, $buffer3); if ($elavon) { $cursor = $main::dbh->prepare(qq{ UPDATE orderInfo SET processDate=?,status=?,txnTime=?,approvalCode=? WHERE orderID=? LIMIT 1 }) || $main::dbh->errstr; my $rv = $cursor->execute($date,$cc_status,$txn_time,$auth_code,$orderID) || $main::dbh->errstr(); $error_msg .= "
    Failed to update orderInfo with Elevon info: ".$rv if $rv < 1; # print p('Thank you! Your credit card has been approved. A confirmation email has been sent to the email address you provided on your registration form.'); &display_receipt($orderID, "$lname, $fname"); } } } else { print "

    Your credit card will be charged: \$".$cost." once this form has been processed. Please note this is not a real-time transaction.

    "; $elavon = 1; &display_receipt($orderID, "$lname, $fname"); } if ($elavon) { $admin = '' if !$cc_admin; Ruggles_Mail($sender, $to, $recipient_subject, $society, $cost, $buffer2, $buffer, $MerchantMode, ''.$admin, "daniel\@societyhq.com"); } } !>