array() ); } /* SET AN ARRAY OF CAMP CLASS OPTIONS FROM CURRENT CAMP SESSION */ $criteria = array(); $criteria["SessionID"] = 277; $params = "".TagArrayIDToFMArray( $criteria, count($criteria), FALSE ).""; $class_result = RunScript( "ClassListMulti", $params ); if( isset( $class_result->error_code ) ) { $error_code = $class_result->error_code; } else { $classes = $class_result->fm_records; $camp_classes = array(); foreach($classes as $class) { $camp_classes[$class->getField("__kp_ClassID")]["Class_ID"] = $class->getField( "__kp_ClassID" ); $camp_classes[$class->getField("__kp_ClassID")]["Course_ID"] = $class->getField( "_kf_CourseID" ); $camp_classes[$class->getField("__kp_ClassID")]["begin_dob"] = strtotime($class->getField( "z_BirthdateEarliest" )); $camp_classes[$class->getField("__kp_ClassID")]["end_dob"] = strtotime($class->getField( "z_BirthdateLatest" )); $camp_classes[$class->getField("__kp_ClassID")]["Group"] = $class->getField( "Group" ); $camp_classes[$class->getField("__kp_ClassID")]["ClassType"] = $class->getField( "Type" ); $camp_classes[$class->getField("__kp_ClassID")]["ClassName"] = $class->getField( "ClassName" ); $camp_classes[$class->getField("__kp_ClassID")]["ClassNameDisplay"] = $class->getField( "ProgramAlpha" ); $camp_classes[$class->getField("__kp_ClassID")]["DateStart"] = $class->getField( "DateStart" ); $camp_classes[$class->getField("__kp_ClassID")]["DateEnd"] = $class->getField( "DateEnd" ); $camp_classes[$class->getField("__kp_ClassID")]["TimeStart"] = $class->getField( "TimeStart" ); $camp_classes[$class->getField("__kp_ClassID")]["TimeEnd"] = $class->getField( "TimeEnd" ); $camp_classes[$class->getField("__kp_ClassID")]["Location"] = $class->getField( "Location" ); $camp_classes[$class->getField("__kp_ClassID")]["ProgramLevel"] = $class->getField( "ProgramLevel" ); $camp_classes[$class->getField("__kp_ClassID")]["DaytimeString"] = $class->getField( "ThumbPath" ); $camp_classes[$class->getField("__kp_ClassID")]["z_SeatsAvailable"] = $class->getField( "z_SeatsAvailable" ); $camp_classes[$class->getField("__kp_ClassID")]["disabled"] = ($class->getField( "z_SeatsAvailable" ) <1 ? " disabled=\"disabled\"" : ""); $camp_classes[$class->getField("__kp_ClassID")]["PriceGeneralAdmission"] = $class->getField( "PriceGeneralAdmission" ); } function cmp($a, $b) { return $a["ProgramLevel"] - $b["ProgramLevel"]; } usort($camp_classes, "cmp"); } } else { header( "Location: https://www.oldtownschool.org/account/?signin=".urlencode($_SERVER['REQUEST_URI']) ); exit; } if($step == 2 && isset($_REQUEST["remove"])) { $dropClass = $_REQUEST["remove"]; unset($_SESSION["cart"]["classes"][$dropClass]); } elseif($step == 2 && $_REQUEST["action"] != "checkout") { if("" == $_REQUEST["student"] || "" == $_REQUEST["class_request"]) { $step = 1; $errorText = "Please select both a student and a camp session before proceeding."; } else { if( isset( $_REQUEST["student"] ) && ("new" != $_REQUEST["student"]) ) { $student_array_id = $_REQUEST["student"]; } else { $fields = array( "Student_Name_First"=>array( "required"=>TRUE, "display"=>"First Name" ), "Student_Name_Last"=>array( "required"=>TRUE, "display"=>"Last Name" ), "Student_Birthdate"=>array( "required"=>TRUE, "display"=>"Birth Date" ), "Student_IsFamily"=>array( "required"=>FALSE, "display"=>"Student Info " ) ); $checkout = array(); $missing = array(); validate_form( $fields, $checkout, $missing ); if( isset( $missing ) && (count( $missing ) > 0) ) { $step = 1; } else { $checkout["Purchaser_ID"] = $_SESSION["webuser"]["FLK_ID"]; $new_folk_fields = arrayToFMArray( $checkout ); $folk_result = RunScript( "Add_Folk", $new_folk_fields ); $new_folk = array(); $records = $folk_result->fm_records; $new_folk_record = $records[0]; $new_folk["relation_id"] = $new_folk_record->getField( "__kp_FolkID" ); $new_folk["relation_name"] = $new_folk_record->getField( "Name_Full" ); $new_folk["relation_current"] = $new_folk_record->getField( "z_IsActiveStudent" ); $new_folk["relation_clrs"] = $new_folk_record->getField( "z_CLREnrolleeCount" ); $new_folk["relation_dob"] = $new_folk_record->getField( "Birthdate" ); $_SESSION["webuser_relation"][] = $new_folk; $student_array_id = array_pop( array_keys( $_SESSION["webuser_relation"])); } } if(!empty($_REQUEST["student_shirt"])) { $_SESSION["webuser_relation"][$student_array_id]["relation_shirt"] = $_REQUEST["student_shirt"]; } if(!empty($_REQUEST["student_school"])) { $_SESSION["webuser_relation"][$student_array_id]["relation_school"] = $_REQUEST["student_school"]; } if(!empty($_REQUEST["student_gender"])) { $_SESSION["webuser_relation"][$student_array_id]["relation_gender"] = $_REQUEST["student_gender"]; } /* LOOP ARRAY OF CHECKED CLASSES TO VALIDATE AGE, THEN ADD TO CART */ foreach($_REQUEST["class_request"] as $class_request) { if(strtotime($_SESSION["webuser_relation"][$student_array_id]["relation_dob"]) > $camp_classes[$class_request]["end_dob"] ) { $errorText = "The student is too young for the camp session you have selected."; $step = 1; } elseif(strtotime($_SESSION["webuser_relation"][$student_array_id]["relation_dob"]) < $camp_classes[$class_request]["begin_dob"]) { $errorText = "The student is too old for the camp session you have selected."; $step = 1; } else { $class_add = array(); $class_add["Class_ID"] = $camp_classes[$class_request]["Class_ID"]; $class_add["ClassName"] = $camp_classes[$class_request]["ClassName"]; $class_add["Location"] = $camp_classes[$class_request]["Location"]; $class_add["DateStart"] = $camp_classes[$class_request]["DateStart"]; $class_add["DateEnd"] = $camp_classes[$class_request]["DateEnd"]; $class_add["DaytimeString"] = $camp_classes[$class_request]["DaytimeString"]; $class_add["Enrollee_ID"] = $_SESSION["webuser_relation"][$student_array_id]["relation_id"]; $class_add["Enrollee_Name"] = $_SESSION["webuser_relation"][$student_array_id]["relation_name"]; $class_add["Enrollee_School"] = $_SESSION["webuser_relation"][$student_array_id]["relation_school"]; $class_add["Enrollee_Shirt"] = $_SESSION["webuser_relation"][$student_array_id]["relation_shirt"]; $class_add["Enrollee_Gender"] = $_SESSION["webuser_relation"][$student_array_id]["relation_gender"]; $class_add["Enrollee_DOB"] = $_SESSION["webuser_relation"][$student_array_id]["relation_dob"]; $class_add["Purchaser_ID"] = $_SESSION["webuser"]["FLK_ID"]; $class_add["Price"] = $camp_classes[$class_request]["PriceGeneralAdmission"]; $class_add["Price_Deposit"] = $camp_classes[$class_request]["PriceGeneralAdmission"]/2; $_SESSION["cart"]["classes"][] = $class_add; $class_array_id = array_pop( array_keys( $_SESSION["cart"]["classes"])); $token_request = arrayToFMArray( $_SESSION["cart"]["classes"][$class_array_id] ); $token_result = RunScript( "Create_Token", $token_request ); if( isset( $token_result->error_code ) ) { $error_token = $token_result->error_code; } else { $new_token = array(); $tokens = $token_result->fm_records; $new_token_record = $tokens[0]; $_SESSION["cart"]["classes"][$class_array_id]["Token_ID"] = $new_token_record->getField( "__kp_WebOrderClassID_n" ); } } } } } elseif($step == 3) { if( $_SESSION["cart"]["PMT"]["card_required"] == TRUE ) { $fields = array( "TOC"=>array( "required"=>TRUE, "display"=>"Parent Contract Agreement" ), "PPA"=>array( "required"=>TRUE, "display"=>"Payment Option Selection" ), "Billing_Name_First"=>array( "required"=>TRUE, "display"=>"First Name" ), "Billing_Name_Middle_Initial"=>array( "required"=>FALSE, "display"=>"Middle Initial" ), "Billing_Name_Last"=>array( "required"=>TRUE, "display"=>"Last Name" ), "Billing_Address_Line1"=>array( "required"=>TRUE, "display"=>"Address Line 1" ), "Billing_Address_Line2"=>array( "required"=>FALSE, "display"=>"Address Line 2" ), "Billing_Address_City"=>array( "required"=>TRUE, "display"=>"City" ), "Billing_Address_State"=>array( "required"=>TRUE, "display"=>"State" ), "Billing_Address_Zip"=>array( "required"=>TRUE, "display"=>"Zip Code" ), "Billing_Phone"=>array( "required"=>TRUE, "display"=>"Phone Number" ), "Billing_Email"=>array( "required"=>FALSE, "display"=>"Email Address" ), "Billing_CardType"=>array( "required"=>TRUE, "display"=>"Credit Card Type" ), "Billing_CardNumber"=>array( "required"=>TRUE, "display"=>"Credit Card Number" ), "Billing_CardCVV"=>array( "required"=>TRUE, "display"=>"Credit Card Security Code" ), "Billing_CardExpMonth"=>array( "required"=>TRUE, "display"=>"Credit Card Expiration Month" ), "Billing_CardExpYear"=>array( "required"=>TRUE, "display"=>"Credit Card Expiration Year" ), ); } elseif( $_SESSION["cart"]["PMT"]["card_required"] == FALSE ) { $fields = array( "TOC"=>array( "required"=>TRUE, "display"=>"Parent Contract Agreement" ), "Billing_Name_First"=>array( "required"=>TRUE, "display"=>"First Name" ), "Billing_Name_Middle_Initial"=>array( "required"=>FALSE, "display"=>"Middle Initial" ), "Billing_Name_Last"=>array( "required"=>TRUE, "display"=>"Last Name" ), "Billing_Address_Line1"=>array( "required"=>TRUE, "display"=>"Address Line 1" ), "Billing_Address_Line2"=>array( "required"=>FALSE, "display"=>"Address Line 2" ), "Billing_Address_City"=>array( "required"=>TRUE, "display"=>"City" ), "Billing_Address_State"=>array( "required"=>TRUE, "display"=>"State" ), "Billing_Address_Zip"=>array( "required"=>TRUE, "display"=>"Zip Code" ), "Billing_Phone"=>array( "required"=>TRUE, "display"=>"Phone Number" ), "Billing_Email"=>array( "required"=>FALSE, "display"=>"Email Address" ) ); } $checkout = array(); $missing = array(); validate_form( $fields, $checkout, $missing ); $cardExpireTime = mktime(0, 0, 0, $_REQUEST["Billing_CardExpMonth"], 31, $_REQUEST["Billing_CardExpYear"]); if(isset( $missing ) && (count( $missing ) > 0)) { $step = "2"; } elseif($checkout["PPA"] == "balanceComplete" || $checkout["PPA"] == "balanceReminder") { if( $_SESSION["cart"]["PMT"]["card_required"] == TRUE ) { $_SESSION["cart"]["PMT"]["credit_card_total"] = ($checkout["PPA"] == "balanceComplete" ? $_SESSION["cart"]["PMT"]["credit_card_total"] : $_SESSION["cart"]["PMT"]["credit_card_deposit"]); $post_url = "https://secure.authorize.net/gateway/transact.dll"; $post_values = array( "x_login" => "4mnG9v466Dbd", "x_tran_key" => "46B63sD9s84Qmv4d", "x_version" => "3.1", "x_delim_data" => "TRUE", "x_delim_char" => "|", "x_relay_response" => "FALSE", "x_type" => "AUTH_CAPTURE", "x_method" => "CC", "x_card_num" => $_POST['Billing_CardNumber'], "x_exp_date" => $_POST['Billing_CardExpMonth'] . $_POST['Billing_CardExpYear'], "x_card_code" => $_POST['Billing_CardCVV'], "x_amount" => $_SESSION["cart"]["PMT"]["credit_card_total"], "x_description" => "Old Town School Summer Camp Registration", "x_first_name" => $_POST['Billing_Name_first'], "x_last_name" => $_POST['Billing_Name_Last'], "x_address" => $_POST['Billing_Address_Line1'], "x_state" => $_POST['Billing_Address_State'], "x_zip" => $_POST['Billing_Address_Zip'], "x_customer_ip" => $_SERVER['REMOTE_ADDR'], "x_cust_id" => $_SESSION["webuser"]["FLK_ID"] ); $post_string = ""; foreach( $post_values as $key => $value ) { $post_string .= "$key=" . urlencode( $value ) . "&"; } $post_string = rtrim( $post_string, "& " ); $request = curl_init($post_url); curl_setopt($request, CURLOPT_HEADER, 0); curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); curl_setopt($request, CURLOPT_POSTFIELDS, $post_string); curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); $post_response = curl_exec($request); curl_close ($request); $response_array = explode($post_values["x_delim_char"],$post_response); } if("1" === $response_array[0] || $_SESSION["cart"]["PMT"]["card_required"] == FALSE) { if(isset ($response_array)) { $_SESSION["cart"]["PMT"]["auth_code"] = $response_array[4]. " | ".$response_array[6]; $_SESSION["cart"]["PMT"]["ref_num"] = $_POST['Billing_CardType'].substr($_POST['Billing_CardNumber'], -4); } $params_array = array( "trp_flk_id"=>$_SESSION["webuser"]["FLK_ID"], "cart_checkout_billing"=>$checkout ); $params = ArrayToFMArray( $params_array ); $cart_classes = "".TagArrayIDToFMArray( $_SESSION["cart"]["classes"], "class", FALSE ).""; $cart_pmt = "".ArrayToFMArray( $_SESSION["cart"]["PMT"] ).""; $weborder_result = RunScript( "Checkout_2017_Camp", $params.$cart_classes.$cart_pmt ); if( isset( $weborder_result->error_code ) ) { echo "Error performing checkout in FM. " . $weborder_result->error_code; } else { $weborder_records = & $weborder_result->fm_records; $weborder_record = $weborder_records[0]; $reservation_number = $weborder_record->getField( "__kp_TransactionPaymentID" ); $confirmation = "affirmative"; } } else { $errorText = "Our apologies, we're having trouble processing your credit card. Our payment processor is giving us the following message: ".$response_array[3]; $step = 2; } } elseif($checkout["PPA"] == "balanceAuto" || $checkout["PPA"] == "balanceMonthly") { if(1496289600 > $cardExpireTime) { $errorText = "Our apologies, but the expiration date on the credit card used for automatic payments must be beyond the date of the final payment."; $step = "2"; } else { //gather other required variables for hand off to Authorize $refId = $_SESSION["webuser"]["FLK_ID"]; //MAX 20 chars $nextDay = mktime(0,0,0,date("m"),date('d')+1,date("Y")); $nextDate = date("Y-m-d", $nextDay); //YYYY-MM-DD $startDate = new DateTime($nextDate); if($checkout["PPA"] == "balanceAuto") { $amount = $_SESSION["cart"]["PMT"]["credit_card_deposit"]; $unit = "days"; $totalOccurrences = 2; $balanceDate = new DateTime("2017-06-01"); $interval = $startDate->diff($balanceDate); $length = $interval->days; } else { $amount = $_SESSION["cart"]["PMT"]["credit_card_monthly"]; $unit = "months"; $totalOccurrences = $_SESSION["cart"]["PMT"]["monthlyOccurrences"]; $length = "1"; } $name = $checkout['Billing_Name_First']." ".$checkout['Billing_Name_Last']." ".$nextDate; $trialOccurrences = 0; //0 = None. MAX = 99 $trialAmount = 0; //0 = None $cardNumber = $_POST["Billing_CardNumber"]; // $expirationDate = $_POST["Billing_CardExpYear"]."-".$_POST["Billing_CardExpMonth"]; //YYYY-MM $cardCode = $_POST["Billing_CardCVV"]; $firstName = $checkout['Billing_Name_First']; $lastName = $checkout['Billing_Name_Last']; $address = $checkout['Billing_Address_Line1']; $zip = $checkout['Billing_Address_Zip']; $state = $checkout['Billing_Address_State']; $city = $checkout['Billing_Address_City']; //build xml to post $content = "" . "" . "". "" . $loginname . "". "" . $transactionkey . "". "". "" . $refId . "". "". "" . $name . "". "". "". "". $length ."". "". $unit ."". "". "" . $nextDate . "". "". $totalOccurrences . "". "". $trialOccurrences . "". "". "". $amount ."". "" . $trialAmount . "". "". "". "" . $cardNumber . "". "" . $expirationDate . "". "" . $cardCode . "". "". "". "". "". $firstName . "". "" . $lastName . "". "
" . $address . "
". "" . $city . "". "" . $state . "". "" . $zip . "". "
". "
". "
"; //send the xml via curl $response = send_request_via_curl($host,$path,$content); list ($refId, $resultCode, $code, $text, $subscriptionId) = parse_return($response); if ("Ok" == $resultCode) { $params_array = array( "trp_flk_id"=>$_SESSION["webuser"]["FLK_ID"], "cart_checkout_billing"=>$checkout ); $params = ArrayToFMArray( $params_array ); $cart_classes = "".TagArrayIDToFMArray( $_SESSION["cart"]["classes"], "class", FALSE ).""; $pmt_array = array(); $pmt_array["Amount"] = $amount; $pmt_array["subscription_id"] = $subscriptionId; $pmt_array["length"] = $length; $pmt_array["date_start"] = date("m/d/Y", $nextDay); $pmt_array["occurrences"] = $totalOccurrences; $pmt_array["unit"] = $unit; $pmt_array["sub_name"] = $name; $pmt_array["ref_num"] = $_POST['Billing_CardType'].substr($_POST['Billing_CardNumber'], -4); $pmt_array["account_used"] = $_SESSION["cart"]["PMT"]["account_used"]; $pmt_array["credit_card_deposit"] = $_SESSION["cart"]["PMT"]["credit_card_deposit"]; $cart_pmt = "".ArrayToFMArray( $pmt_array ).""; $weborder_result = RunScript( "Checkout_2017_Camp_ppa", $params.$cart_classes.$cart_pmt ); $confirmationtext = "The first payment for your registration will be processed on ".$pmt_array["date_start"].". "; } else { $error_code = 28; $step = 2; } } } } ?>

Summer Camp Registration

0) { echo "

In order to proceed, we need some additional information from you, including:
"; foreach( $missing as $name ) { print " * " . $fields[$name]["display"]; } echo "

"; } elseif(isset($errorText)) { echo '

'.$errorText.'

'; } if( time() > 1481209200 || $_SERVER['REMOTE_ADDR'] == "192.168.1.139" || $_SERVER['REMOTE_ADDR'] == "192.168.1.165" || $_SERVER['REMOTE_ADDR'] == "73.247.106.213") { echo '

Select the Camper

'; echo '
'; echo ''; echo ''; /* STUDENT SELECTION */ if(count($_SESSION["webuser_relation"]) == 1) { echo '

For Summer Camp registrations, we need to gather the child\'s name, and their birth date.

'; echo ''; echo ''; echo ''; echo ''; echo '

'; } elseif(count($_SESSION["webuser_relation"]) > 1) { echo '
'; echo ''; foreach( array_keys( $_SESSION["webuser_relation"] ) as $relation_record) { if($_SESSION["webuser_relation"][$relation_record]["relation_level"] != "Adult") { $related_id = $_SESSION["webuser_relation"][$relation_record]["relation_id"]; if($related_id != $_SESSION["webuser"]["FLK_ID"]) { $related_name = $_SESSION["webuser_relation"][$relation_record]["relation_name"]; $related_dob = $_SESSION["webuser_relation"][$relation_record]["relation_dob"]; echo ''; echo ''; echo ''; echo ''; } } } echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
'.$related_name.'  ('.$related_dob.')
'; echo '
+ Add Another Student'; echo '
'; echo ''; echo ''; echo ''; echo '
'; echo '
'; echo '
'; } echo '
'; echo '

Additional Camper Information

'; echo '
 F   M   NB
'; echo '
'; echo '
 Child XS (2-4)   Child S (6-8)   Child M (10-12)   Child L (14-16)  
 Adult M   Adult L   Adult XL   Adult XXL
'; /* CAMP SESSION SELECTION */ echo '
'; echo '

Select the Camp Session(s)

'; echo '
'; echo ''; foreach( array_keys( $camp_classes ) as $class_id ) { $rowStyle = ($camp_classes[$class_id]["Class_ID"] == 109720 || $camp_classes[$class_id]["Class_ID"] == 109721 ? "border-bottom: none;" : "border-bottom: 1px solid #ccc;"); echo ''; echo ''; echo ''; echo ''; echo ''; } echo '
'; echo '
'.$camp_classes[$class_id]["ClassNameDisplay"].'
'; echo ''.$camp_classes[$class_id]["DateStart"].' – '.$camp_classes[$class_id]["DateEnd"].' at '.$camp_classes[$class_id]["Location"].''; echo '
'.$camp_classes[$class_id]["DaytimeString"]; echo '
for kids born between '.date("m/d/y", $camp_classes[$class_id]["begin_dob"]).' and '.date("m/d/y", $camp_classes[$class_id]["end_dob"]); echo '
$'.$camp_classes[$class_id]["PriceGeneralAdmission"].'
'; echo '
'; echo '
'; if($_REQUEST["action"] == "back") { echo 'Return to Checkout

'; } echo '
'; echo '
'; } else { echo '

Registration for Summer Camp 2017 begins on Thursday, December 8th at 9:00 AM.

'; } } elseif($step == 2) { if( isset( $missing ) && count( $missing ) > 0) { echo "

In order to proceed, we need some additional information from you, including:
"; foreach( $missing as $name ) { print " * " . $fields[$name]["display"]; } echo "

"; } elseif( isset($errorText) ) { echo '

'.$errorText.'

'; } echo '

Your Registration Choices

'; echo ""; /* LOOP CART ARRAY FOR DISPLAY AND TO SUM FOR PAYMENT */ $_SESSION["cart"]["class_total"] = 0; foreach( array_keys( $_SESSION["cart"]["classes"] ) as $cart_id ) { $item_price = $_SESSION["cart"]["classes"][$cart_id]["Price"]; $item_deposit = $_SESSION["cart"]["classes"][$cart_id]["Price_Deposit"]; $item_sub = $_SESSION["cart"]["classes"][$cart_id]["Price_Deposit"]; $_SESSION["cart"]["class_total"] += $item_price; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; } echo '
'; echo '
'.$_SESSION["cart"]["classes"][$cart_id]["ClassName"].'
'; echo 'Camper: '.$_SESSION["cart"]["classes"][$cart_id]["Enrollee_Name"].' | '.$_SESSION["cart"]["classes"][$cart_id]["Enrollee_DOB"].' | '.$_SESSION["cart"]["classes"][$cart_id]["Enrollee_School"].' | '.$_SESSION["cart"]["classes"][$cart_id]["Enrollee_Shirt"]; echo '
$'.$item_price.'
'.$_SESSION["cart"]["classes"][$cart_id]["DateStart"].' – '.$_SESSION["cart"]["classes"][$cart_id]["DateEnd"].''.$_SESSION["cart"]["classes"][$cart_id]["DaytimeString"].''.$_SESSION["cart"]["classes"][$cart_id]["Location"].'X Remove
'; echo '
'; echo ''; $cart_subtotal = $_SESSION["cart"]["class_total"]; /* if( $_SESSION["webuser"]["z_AccountBalance"] > $cart_subtotal ) { $_SESSION["cart"]["PMT"]["account_used"] = $cart_subtotal; } else { $_SESSION["cart"]["PMT"]["account_used"] = $_SESSION["webuser"]["z_AccountBalance"]; } */ $_SESSION["cart"]["PMT"]["account_used"] = 0; $credit_card_total = $cart_subtotal - $_SESSION["cart"]["PMT"]["account_used"]; if( $credit_card_total < 0 ) { $_SESSION["cart"]["PMT"]["credit_card_total"] = 0; } else { $_SESSION["cart"]["PMT"]["credit_card_total"] = $credit_card_total; } if( $credit_card_total <= 0 ) { $_SESSION["cart"]["PMT"]["card_required"] = FALSE; } else { $_SESSION["cart"]["PMT"]["card_required"] = TRUE; } //Set payment option values if(time() < 1483282800) //1/1/2017, 9:00:00 AM { $_SESSION["cart"]["PMT"]["monthlyOccurrences"] = 6; } elseif(time() < 1485961200) //2/1/2017, 9:00:00 AM { $_SESSION["cart"]["PMT"]["monthlyOccurrences"] = 5; } elseif(time() < 1488380400) //3/1/2017, 9:00:00 AM { $_SESSION["cart"]["PMT"]["monthlyOccurrences"] = 4; } elseif(time() < 1491055200) //4/1/2017, 9:00:00 AM { $_SESSION["cart"]["PMT"]["monthlyOccurrences"] = 3; } else { $_SESSION["cart"]["PMT"]["monthlyOccurrences"] = 2; } $_SESSION["cart"]["PMT"]["credit_card_deposit"] = $_SESSION["cart"]["PMT"]["credit_card_total"]/2; $_SESSION["cart"]["PMT"]["credit_card_monthly"] = ceil($_SESSION["cart"]["PMT"]["credit_card_total"]/$_SESSION["cart"]["PMT"]["monthlyOccurrences"]); $nextDay = mktime(0,0,0,date("m"),date('d')+1,date("Y")); $nextDate = date("Y-m-d", $nextDay); //YYYY-MM-DD $startDate = new DateTime($nextDate); $balanceDate = new DateTime("2017-06-01"); $interval = $startDate->diff($balanceDate); $length = $interval->days; echo '
'; echo '

REGISTRATION SUM: '.money_format('$%i', $_SESSION["cart"]["class_total"]).'

'; echo '
'; echo '
'; echo '
'; echo ''; echo '

Your Camp Parent Contract

'; echo '
    '; if( time() > 1496239200 ) //after 5/31/17 { echo "
  • The camp payment is nonrefundable and nontransferable. For all camp registrations that take place after May 31, 2017, complete payment is due at the time of registration. "; } else { echo '
  • 50% of camp payment ('.money_format('$%i', $_SESSION["cart"]["PMT"]["credit_card_deposit"]).') is a nonrefundable and nontransferable deposit. Final payment is due by June 1, 2017. If the final payment is not made by June 1, your child\'s spot in the camp is forfeited and the deposit remains nonrefundable and nontransferable.'; } echo "After June 26, 2017 the final payments for Camp Session 1 and Teen Camp Session 1 are nonrefundable and nontransferable. After August 7, 2017, the final payment for Fiddle Camp is nonrefundable and nontransferable. After July 10, 2017, the final payment for Teen Camp Session 2 is nonrefundable and nontransferable. After July 17, 2017, the final payment for Camp Session 2 and Teen Camp Session 3 are nonrefundable and nontransferable.
  • "; echo '
  • I understand that by registering my child for summer camp, I give my permission for the Old Town School of Folk Music to photograph my child in the context of the camp day and to post these photographs on Old Town School marketing materials, such as the Old Town School website and catalog. I also give permission for my child’s Old Town School camp performances and artwork to be posted on viable and safe Internet viewing sites, such as YouTube. I understand that children’s names are never posted, and the School never gives any information to outside agents or solicitors.
  • '; echo '
  • I understand that my child is to be picked up in a timely manner from summer camp (for Arts Camp ages 4-6 pickup between 12:00 pm and 12:10 pm; for Arts Camp ages 7-11 pickup between 3:00 pm and 3:10 pm; for Teen Arts Camp pickup between 3:00 pm and 3:10 pm; for Fiddle Camp pickup between 3:00 pm and 3:10 pm). If my child is attending the extended hours program, my child is to be picked up by 5:00 pm. If my child is picked up after the appropriate time, I agree to pay a $20 fee for every 5 minutes that my child is picked up late.
  • '; echo '
'; $tocCheck = (isset($_REQUEST["TOC"]) ? "checked" : ""); echo '

I have read the above and I understand the policies regarding the camp deposit, the final payment, photograph/artwork usage, and pick-up times.

'; echo '
'; if($_SESSION["cart"]["PMT"]["card_required"] == TRUE) { echo '

Your Payment Options

'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; /* if($_SESSION["cart"]["PMT"]["account_used"] != 0) { echo ''; echo ''; echo ''; echo ''; } echo ''; echo ''; echo ''; echo ''; */ echo '
REGISTRATION TOTAL:'.money_format('$%i', $_SESSION["cart"]["class_total"]).''; echo '
Account Balance Applied:'.money_format('$%i', $_SESSION["cart"]["PMT"]["account_used"]).'
ORDER TOTAL:'.money_format('$%i', $_SESSION["cart"]["PMT"]["credit_card_total"]).'
'; echo '
'; echo '
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; if(time() < 1495746215) { echo ''; echo ''; echo ''; echo ''; } if(time() < 1493647200) { echo ''; echo ''; echo ''; echo ''; } if(time() < 1495746215) { echo ''; echo ''; echo ''; echo ''; } echo '
'; echo 'Single Payment of '.money_format('$%i', $_SESSION["cart"]["PMT"]["credit_card_total"]).''; echo '
'; echo '2 Automatic Payments of '.money_format('$%i', $_SESSION["cart"]["PMT"]["credit_card_deposit"]).''; echo '
Deposit on '.date("m/d/Y", $nextDay).' and Balance on 06/01/2017.'; echo '
'; echo ''.$_SESSION["cart"]["PMT"]["monthlyOccurrences"].' Automatic Monthly Payments of '.money_format('$%i', $_SESSION["cart"]["PMT"]["credit_card_monthly"]).''; echo '
'; echo 'Deposit Payment of '.money_format('$%i', $_SESSION["cart"]["PMT"]["credit_card_deposit"]).''; echo '
We\'ll contact you to make your balance payment, which is due by June 1, 2017 to maintain camp enrollment.'; echo '
'; echo '
'; echo '
'; echo '
'; } echo '

Your Payment Information

'; echo '

all fields are required

'; echo '
'; echo ''; echo ''; echo ''; echo ' '; echo ''; echo '
'; if($_SESSION["cart"]["PMT"]["card_required"] == TRUE) { echo '
'; echo ''; echo ' '; echo ' / '; echo '
'; } echo '
'; echo ''; echo 'Back'; echo '
'; echo ''; echo '
'; echo '

Security of your confidential information: If you choose to take advantage of an automated payment plan, Old Town School does not store your credit card data. Your credit card information is stored securely by our electronic gateway provider, Authorize.net. Authorize.net is compliant with the Payment Card Industry Data Security Standard ("PCI DSS") as a Level 1 service provider. PCI DSS is the bankcard industry\'s most stringent security standard.

'; echo '
'; } elseif($step == 3) { echo '

Registration Received

'; echo '

Your Summer Camp registration has been received by Old Town School of Folk Music. Your order number is '.$reservation_number.'

'; echo '

You will receive an email confirmation detailing your final registration status within a few minutes.

'; echo '

Your account page will now include links to Camp Information Packets for you, and to a Camper Information form we ask you to fill out for us prior to June 1, 2017. »

'; unset( $_SESSION["cart"] ); } ?>