|
|
|
@ -21,7 +21,7 @@ if (!empty($SETTINGS["disable_registration"]) && $SETTINGS["disable_registration
|
|
|
|
|
die("Online registration is now closed.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$database->action(function($database) {
|
|
|
|
|
$database->action(function ($database) {
|
|
|
|
|
global $SETTINGS;
|
|
|
|
|
|
|
|
|
|
$database->insert("families", []);
|
|
|
|
@ -143,8 +143,8 @@ $database->action(function($database) {
|
|
|
|
|
|
|
|
|
|
switch ($people["type"][$pid]) {
|
|
|
|
|
case "camper":
|
|
|
|
|
$dueusd += 50.0;
|
|
|
|
|
echo "\nAdding $50 to the total for a camper, dueusd is $dueusd\n";
|
|
|
|
|
$dueusd += $SETTINGS["prices"]["camp"];
|
|
|
|
|
echo "\nAdding $$SETTINGS[prices][camp] to the total for a camper, dueusd is $dueusd\n";
|
|
|
|
|
$database->insert("campers", [
|
|
|
|
|
"parentname" => $people["parentname"][$pid],
|
|
|
|
|
"rank" => $people["rank"][$pid]
|
|
|
|
@ -152,7 +152,7 @@ $database->action(function($database) {
|
|
|
|
|
$camperid = $database->id();
|
|
|
|
|
break;
|
|
|
|
|
case "adult":
|
|
|
|
|
$discount = 10.0 * (strlen($days) / 2);
|
|
|
|
|
$discount = $SETTINGS["prices"]["adult_volunteer_daily_discount"] * (strlen($days) / 2);
|
|
|
|
|
$dueusd -= $discount;
|
|
|
|
|
echo "Subtracting $$discount from the total for an adult volunteer, dueusd is $dueusd\n";
|
|
|
|
|
// Add shirt charge if not working all days
|
|
|
|
@ -160,8 +160,8 @@ $database->action(function($database) {
|
|
|
|
|
// No shirt cost
|
|
|
|
|
} else if ($SETTINGS["prices"]["adult_tshirt"] !== false) {
|
|
|
|
|
if ($people["shirt"][$pid] != "NO" && (strlen($days) / 2) < $SETTINGS["prices"]["adult_tshirt"]) {
|
|
|
|
|
echo "Adding $10 for a tshirt.\n";
|
|
|
|
|
$dueusd += 10.0;
|
|
|
|
|
echo "Adding $$SETTINGS[prices][tshirt] for a tshirt.\n";
|
|
|
|
|
$dueusd += $SETTINGS["prices"]["tshirt"];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!empty($people["child_care"][$pid])) {
|
|
|
|
@ -182,8 +182,8 @@ $database->action(function($database) {
|
|
|
|
|
case "youth":
|
|
|
|
|
if ($SETTINGS["prices"]["youth_tshirt"] !== false) {
|
|
|
|
|
if ($people["shirt"][$pid] != "NO" && (strlen($days) / 2) < $SETTINGS["prices"]["youth_tshirt"]) {
|
|
|
|
|
echo "Adding $10 for a tshirt.\n";
|
|
|
|
|
$dueusd += 10.0;
|
|
|
|
|
echo "Adding $$SETTINGS[prices][tshirt] for a tshirt.\n";
|
|
|
|
|
$dueusd += $SETTINGS["prices"]["tshirt"];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$database->insert("youth", [
|
|
|
|
@ -235,6 +235,12 @@ $database->action(function($database) {
|
|
|
|
|
|
|
|
|
|
$duecard = max(0, $dueusd - $campcoupons);
|
|
|
|
|
|
|
|
|
|
// Add Stripe fees
|
|
|
|
|
// https://support.stripe.com/questions/passing-the-stripe-fee-on-to-customers
|
|
|
|
|
if ($SETTINGS["prices"]["add_stripe_fees"]) {
|
|
|
|
|
$duecard = ($duecard + 0.30) / (1 - 0.029);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "\nCost $dueusd total: $duecard to Stripe, $campcoupons as coupons\n";
|
|
|
|
|
|
|
|
|
|
if ($dueusd != $_POST['totalcharge']) {
|
|
|
|
|