"; } if (! $scaname) { $ErrMsg .= "Please enter your SCA Name
"; } if ($ossub || $ossets) { // Check for group camping with if (! $group) { $ErrMsg .= "Please enter the name of the group you are camping with
"; } } if ($msetsus || $msetsca) { // Check for mailing address if (! $address1 || ! $city || ! $state || ! $postalcode || ! $country) { $ErrMsg .= "Please enter your complete mailing address
"; } } if (! $ossub && ! $ossets && ! $msetsus && ! $msetsca && ! $pdfsets) { $ErrMsg .= "Please choose at least one subscription option
"; } if ($pdfsets && ! $email) { $ErrMsg .= "Please enter your email address
"; } if ($ErrMsg) { // We have some missing fields print '

Please correct the following errors:

' . $ErrMsg . "

\n"; include "1.inc.php"; } Else { if (! $ossub) { $ossub = 0; } if (! $ossets) { $ossets = 0; } if (! $msetsus) { $msetsus = 0; } if (! $msetsca) { $msetsca = 0; } if (! $pdfsets) { $pdfsets = 0; } $st_ossub = sprintf("$ %6.2f", $ossub * $prices_nf['onsite']); $st_ossets = sprintf("$ %6.2f", $ossets * $prices_nf['onsiteset']); $st_msetsus = sprintf("$ %6.2f", $msetsus * $prices_nf['mailus']); $st_msetsca = sprintf("$ %6.2f", $msetsca * $prices_nf['mailcan']); $st_pdfsets = sprintf("$ %6.2f", $pdfsets * $prices_nf['pdf']); // $grandtotal = sprintf("$ %6.2f", $st_ossub + $st_ossets + $st_msetsus + $st_msetsca + $st_pdfsets); $grandtotal = sprintf("$%.2f", ($ossub * $prices_nf['onsite']) + ($ossets * $prices_nf['onsiteset']) + ($msetsus * $prices_nf['mailus']) + ($msetsca * $prices_nf['mailcan']) + ($pdfsets * $prices_nf['pdf'])); print <<< END
END; if ($extraadress) { print <<< END END; } print <<< END
Please confirm your subscription information:
Modern Name:
$name
SCA Name:
$scaname:
Street Address:
$address1
$address2
City:
$city
State/Province:
$state
Country:
$country
Postal Code:
$postalcode
Email Address:
$email
Group Camping With:
$group
 
Number of on-site subscriptions ({$prices['onsite']}):
$ossub
Number of on-site sets ({$prices['onsiteset']}):
$ossets
Number of PDF sets ({$prices['pdf']}):
$pdfsets
Number of sets to be mailed ({$prices['mailus']}):
$msetsus
 
Additional Mailing Address
$extraaddress
 
Subtotal, on-site subscriptions:
$st_ossub
Subtotal, on-site sets:
$st_ossets
Subtotal, PDF sets:
$st_pdfsets
Subtotal, mailed sets, US:
$st_msetsus
Subtotal, mailed sets, Canada:
$st_msetsca
 
Grand Total:
$grandtotal
END; } } elseif ($finish) { // build the sql statement $sql = "insert into subscriptions values(NULL,'$name','$scaname','$address1','$address2','$city',"; $sql .= "'$state','$postalcode','$country','$email','$group',now(),$ossub,$ossets,$msetsus,$msetsca,"; $sql .= "'$pdfsets','$extraaddress',0,'no')"; // Database setup info. The user should have insert privs $host = "localhost"; $dbname = "pennsicindependent_com"; $dbuser = "pi_com"; $dbpass = "6jcgGsP"; mysql_connect($host, $dbuser, $dbpass); mysql_select_db($dbname); $results = mysql_query($sql); $userid = mysql_insert_id(); if (mysql_affected_rows() < 1) { print "

There was a problem saving your subscription

\n"; // print mysql_error(); } else { print "

Your subscription has been saved. Click the button below to pay via paypal

\n

"; $grandtotal = sprintf("$%.2f", ($ossub * $prices_nf['onsite']) + ($ossets * $prices_nf['onsiteset']) + ($msetsus * $prices_nf['mailus']) + ($msetsca * $prices_nf['mailcan']) + ($pdfsets * $prices_nf['pdf'])); print <<< END

You can also mail a check to:

Pennsic Independent
2204 N 950 E
Lafayette, IN 47905

Checks should be payable to The Pennsic Independent and must arrive before July 15, 2009!

On-site subcribers, you MUST pick you your subscription card at the Pennsic Independent Office (near the barn) before you can recieve your paper. You will be able to get your paper either at the office, merchants who carry the paper or the ever present street urchins

END; if ($pdfsets > 0) { print <<< END

You MUST pay with Paypal for PDF sets. To download the PDF copies of each issue, go to http://www.pennsicindependent.com/pdfs/. You will first need to login to the PennsicIndependent.com web site using your own user name and password. This personal account will be granted access to the PDFs when payment has been received.

DO NOT SHARE THIS PASSWORD WITH ANYONE!

END; } } } else { include "1.inc.php"; } ?>