<?php $pageTitle = "Kids' Summer Camp | Old Town School of Folk Music"; require_once($_SERVER['DOCUMENT_ROOT'].'/lib/include/header_ssl_131008.php' ); require_once($_SERVER['DOCUMENT_ROOT'].'/lib/include/nav_130829.php' ); require_once($_SERVER['DOCUMENT_ROOT'].'/lib/include/authnet_acc.php' ); require_once($_SERVER['DOCUMENT_ROOT'].'/lib/include/authnet_arb.php' ); $step = ( isset( $_REQUEST["step"] ) ? $_REQUEST["step"] : 1 ); if( TRUE === $_SESSION["authenticated"] ) { if( !isset( $_SESSION["cart"] ) ) { $_SESSION["cart"] = array( "classes"=>array() ); } /* SET AN ARRAY OF CAMP CLASS OPTIONS FROM CURRENT CAMP SESSION */ $criteria = array(); $criteria["SessionID"] = 277; $params = "<query>".TagArrayIDToFMArray( $criteria, count($criteria), FALSE )."</query>"; $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 = "<cart_classes>".TagArrayIDToFMArray( $_SESSION["cart"]["classes"], "class", FALSE )."</cart_classes>"; $cart_pmt = "<cart_pmt>".ArrayToFMArray( $_SESSION["cart"]["PMT"] )."</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 = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" . "<ARBCreateSubscriptionRequest xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\">" . "<merchantAuthentication>". "<name>" . $loginname . "</name>". "<transactionKey>" . $transactionkey . "</transactionKey>". "</merchantAuthentication>". "<refId>" . $refId . "</refId>". "<subscription>". "<name>" . $name . "</name>". "<paymentSchedule>". "<interval>". "<length>". $length ."</length>". "<unit>". $unit ."</unit>". "</interval>". "<startDate>" . $nextDate . "</startDate>". "<totalOccurrences>". $totalOccurrences . "</totalOccurrences>". "<trialOccurrences>". $trialOccurrences . "</trialOccurrences>". "</paymentSchedule>". "<amount>". $amount ."</amount>". "<trialAmount>" . $trialAmount . "</trialAmount>". "<payment>". "<creditCard>". "<cardNumber>" . $cardNumber . "</cardNumber>". "<expirationDate>" . $expirationDate . "</expirationDate>". "<cardCode>" . $cardCode . "</cardCode>". "</creditCard>". "</payment>". "<billTo>". "<firstName>". $firstName . "</firstName>". "<lastName>" . $lastName . "</lastName>". "<address>" . $address . "</address>". "<city>" . $city . "</city>". "<state>" . $state . "</state>". "<zip>" . $zip . "</zip>". "</billTo>". "</subscription>". "</ARBCreateSubscriptionRequest>"; //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 = "<cart_classes>".TagArrayIDToFMArray( $_SESSION["cart"]["classes"], "class", FALSE )."</cart_classes>"; $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 = "<cart_pmt>".ArrayToFMArray( $pmt_array )."</cart_pmt>"; $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; } } } } ?> <!-- Body Content Container ================================================== --> <div id="bodywrap" class="container"> <!-- Title Row ================================================== --> <div class="fourteen columns offset-by-one row"> <h1 class="KG page">Summer Camp Registration</h1> </div> <!-- Primary Content Row ================================================== --> <div class="fourteen columns offset-by-one row"> <!-- 1481209200 is 12/8/16 9:00AM --> <?php if($step == 1) { if( isset( $missing ) && count( $missing ) > 0) { echo "<p style='font-size: 1.3em; color: #843B23;'>In order to proceed, we need some additional information from you, including:<br />"; foreach( $missing as $name ) { print " * " . $fields[$name]["display"]; } echo "</p>"; } elseif(isset($errorText)) { echo '<p style="color: #f00; font-weight: bold; font-size: .9em;">'.$errorText.'</p>'; } 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 '<h2 class="KG prox">Select the Camper</h2>'; echo '<form method="post" action="/classes/kids/camp/2017/registration/">'; echo '<input type="hidden" name="step" value="2" />'; echo '<input type="hidden" name="action" value="add" />'; /* STUDENT SELECTION */ if(count($_SESSION["webuser_relation"]) == 1) { echo '<p><strong>For Summer Camp registrations, we need to gather the child\'s name, and their birth date.</strong></p>'; echo '<input type="hidden" name="student" value="new">'; echo '<input type="hidden" name="Student_IsFamily" value="1">'; echo '<label>First Name of Student:</label><input type="text" name="Student_Name_First" value="">'; echo '<label>Last Name of Student:</label><input type="text" name="Student_Name_Last" value="">'; echo '<label>Student\'s Date of Birth (mm/dd/yyyy)</label><input type="text" name="Student_Birthdate" value=""></p>'; } elseif(count($_SESSION["webuser_relation"]) > 1) { echo '<fieldset>'; echo '<table style="width: 100%;">'; 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 '<tr>'; echo '<td style="width:5%;"><input type="radio" class="aboveage1" name="student" id="'.$relation_record.'" value="'.$relation_record.'"></td>'; echo '<td style="width:50%; padding: 5px;">'; echo '<h5 style="font-weight: 600;">'.$related_name.'&nbsp;&nbsp;('.$related_dob.')</h5>'; echo '</td>'; echo '</tr>'; } } } echo '<tr>'; echo '<td style="width:5%;"><input type="radio" class="aboveage1" name="student" value="new"></td>'; echo '<td style="width:50%; padding: 5px;"><span style="color:#B94A48;">+ Add Another Student</span>'; echo '<div id="newstudentform">'; echo '<input type="hidden" name="Student_IsFamily" value="1">'; echo '<label>Student Name:</label><input style="display:inline; width:140px;" type="text" name="Student_Name_First" value="" placeholder="First Name"><input style="display:inline; width:140px;" type="text" name="Student_Name_Last" value="" placeholder="LastName">'; echo '<label>Student\'s Date of Birth</label><input type="text" name="Student_Birthdate" value="" placeholder="MM/DD/YYYY">'; echo '</div>'; echo '</td>'; echo '</tr>'; echo '</table>'; echo '</fieldset>'; } echo '<hr />'; echo '<h2 class="KG prox">Additional Camper Information</h2>'; echo '<div class="three columns alpha"><label>Gender</label><input type="radio" name="student_gender" value="female">&nbsp;<small>F</small>&nbsp;&nbsp;<input type="radio" name="student_gender" value="male">&nbsp;<small>M</small>&nbsp;&nbsp;<input type="radio" name="student_gender" value="nonbinary">&nbsp;<small>NB</small></div>'; echo '<div class="four columns"><label>School and Grade</label><input type="text" name="student_school" value="" placeholder="Nth Grade at School Name"></div>'; echo '<div class="seven columns omega"><label>Shirt Size</label><input type="radio" name="student_shirt" value="Child XS (2-4)">&nbsp;<small>Child XS (2-4)</small>&nbsp;&nbsp;<input type="radio" name="student_shirt" value="Child S (6-8)">&nbsp;<small>Child S (6-8)</small>&nbsp;&nbsp;<input type="radio" name="student_shirt" value="Child M (10-12)">&nbsp;<small>Child M (10-12)</small>&nbsp;&nbsp;<input type="radio" name="student_shirt" value="Child L (14-16)">&nbsp;<small>Child L (14-16)</small>&nbsp;&nbsp;<br /><input type="radio" name="student_shirt" value="Adult M">&nbsp;<small>Adult M</small>&nbsp;&nbsp;<input type="radio" name="student_shirt" value="Adult L">&nbsp;<small>Adult L</small>&nbsp;&nbsp;<input type="radio" name="student_shirt" value="Adult XL">&nbsp;<small>Adult XL</small>&nbsp;&nbsp;<input type="radio" name="student_shirt" value="Adult XXL">&nbsp;<small>Adult XXL</small></div>'; /* CAMP SESSION SELECTION */ echo '<hr />'; echo '<h2 class="KG prox">Select the Camp Session(s)</h2>'; echo '<fieldset>'; echo '<table style="width: 100%;">'; 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 '<tr style="'.$rowStyle.'">'; echo '<td style="width:5%;"><input type="checkbox" name="class_request[]" id="'.$camp_classes[$class_id]["Class_ID"].'" value="'.$class_id.'"'.$camp_classes[$class_id]["disabled"].' /></td>'; echo '<td style="width:50%; padding: 5px;">'; echo '<h5 style="font-weight: 600;">'.$camp_classes[$class_id]["ClassNameDisplay"].'</h5>'; echo '<strong>'.$camp_classes[$class_id]["DateStart"].' &ndash; '.$camp_classes[$class_id]["DateEnd"].' at '.$camp_classes[$class_id]["Location"].'</strong>'; echo '<br />'.$camp_classes[$class_id]["DaytimeString"]; echo '<br /><small>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 '</td>'; echo '<td style="width:10%; text-align: right;"><strong>$'.$camp_classes[$class_id]["PriceGeneralAdmission"].'</strong></td>'; echo '</tr>'; } echo '</table>'; echo '</fieldset>'; echo '<div style="text-align: right;">'; if($_REQUEST["action"] == "back") { echo '<a style="float: left;" class="KG" href="/classes/kids/camp/2017/registration/?step=2&&action=checkout">Return to Checkout</a></p>'; } echo '<input type="submit" name="Continue" value="Add Registration to Cart"></div>'; echo '</form>'; } else { echo '<p class="lead">Registration for Summer Camp 2017 begins on Thursday, December 8th at 9:00 AM.</p>'; } } elseif($step == 2) { if( isset( $missing ) && count( $missing ) > 0) { echo "<p style='font-size: 1.3em; color: #843B23;'>In order to proceed, we need some additional information from you, including:<br />"; foreach( $missing as $name ) { print " * " . $fields[$name]["display"]; } echo "</p>"; } elseif( isset($errorText) ) { echo '<p style="font-size: 1.3em; color: #843B23;">'.$errorText.'</p>'; } echo '<h2 class="KG prox">Your Registration Choices</h2>'; echo "<table id='classes-list'>"; /* 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 '<tbody class="KG">'; echo '<tr class="title">'; echo '<td class="name" colspan="3">'; echo '<h5 style="font-weight: 600;">'.$_SESSION["cart"]["classes"][$cart_id]["ClassName"].'</h5>'; echo '<strong>Camper: '.$_SESSION["cart"]["classes"][$cart_id]["Enrollee_Name"].'</strong> | '.$_SESSION["cart"]["classes"][$cart_id]["Enrollee_DOB"].' | '.$_SESSION["cart"]["classes"][$cart_id]["Enrollee_School"].' | '.$_SESSION["cart"]["classes"][$cart_id]["Enrollee_Shirt"]; echo '</td>'; echo '<td class="price last"><h5 style="font-weight: 600;">$'.$item_price.'</h5></td>'; echo '</tr>'; echo '<tr>'; echo '<td class="dates">'.$_SESSION["cart"]["classes"][$cart_id]["DateStart"].' &ndash; '.$_SESSION["cart"]["classes"][$cart_id]["DateEnd"].'</td>'; echo '<td class="times">'.$_SESSION["cart"]["classes"][$cart_id]["DaytimeString"].'</td>'; echo '<td class="location">'.$_SESSION["cart"]["classes"][$cart_id]["Location"].'</td>'; echo '<td class="last action"><a class="KG" href="/classes/kids/camp/2017/registration/?step=2&&remove='.$cart_id.'"><small>X Remove</small></a></td>'; echo '</tr>'; echo '</tbody>'; } echo '</table>'; echo '<hr />'; echo '<div class="seven columns alpha row">'; echo '<p><small><a class="KG" href="/classes/kids/camp/2017/registration/?step=1&&action=back">&laquo; Add Additional Registrations</a></small></p>'; echo '</div>'; $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 '<div class="seven columns omega row">'; echo '<p style="float: right; font-weight: bold;" class="KG">REGISTRATION SUM: '.money_format('$%i', $_SESSION["cart"]["class_total"]).'</p>'; echo '</div>'; echo '<hr />'; echo '<form method="post" action="/classes/kids/camp/2017/registration/">'; echo '<input type="hidden" name="step" value="3" />'; echo '<h2 class="KG prox">Your Camp Parent Contract</h4>'; echo '<ul class="square">'; if( time() > 1496239200 ) //after 5/31/17 { echo "<li><small>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 '<li><small>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.</small></li>"; echo '<li><small>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.</small></li>'; echo '<li><small>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.</small></li>'; echo '</ul>'; $tocCheck = (isset($_REQUEST["TOC"]) ? "checked" : ""); echo '<p style="font-weight: bold;"><input type="checkbox" name="TOC" value="Checked" '.$tocCheck.'> I have read the above and I understand the policies regarding the camp deposit, the final payment, photograph/artwork usage, and pick-up times.</p>'; echo '<hr />'; if($_SESSION["cart"]["PMT"]["card_required"] == TRUE) { echo '<h2 class="KG prox" style="margin-bottom: 1em;">Your Payment Options</h2>'; echo '<div class="six columns alpha">'; echo '<fieldset>'; echo '<table style="width: 100%;">'; echo '<tr>'; echo '<td style="width: 60%;"><strong>REGISTRATION TOTAL:</strong></td>'; echo '<td style="width: 40%; text-align: right;"><strong>'.money_format('$%i', $_SESSION["cart"]["class_total"]).'</strong</td>'; echo '</tr>'; /* if($_SESSION["cart"]["PMT"]["account_used"] != 0) { echo '<tr>'; echo '<td style="width: 60%;">Account Balance Applied:</td>'; echo '<td style="width: 40%; text-align: right;">'.money_format('$%i', $_SESSION["cart"]["PMT"]["account_used"]).'</td>'; echo '</tr>'; } echo '<tr>'; echo '<td style="width: 60%;"><strong>ORDER TOTAL:</strong></td>'; echo '<td style="width: 40%; text-align: right;"><strong>'.money_format('$%i', $_SESSION["cart"]["PMT"]["credit_card_total"]).'</strong></td>'; echo '</tr>'; */ echo '</table>'; echo '</fieldset>'; echo '</div>'; echo '<div class="seven columns offset-by-one omega">'; echo '<fieldset>'; echo '<table style="width: 100%;">'; echo '<tr>'; echo '<td style="width:5%;"><input type="radio" class="aboveage1" name="PPA" id="complete" value="balanceComplete"></td>'; echo '<td style="width:50%; padding: 5px;">'; echo '<strong>Single Payment of '.money_format('$%i', $_SESSION["cart"]["PMT"]["credit_card_total"]).'</strong>'; echo '</td>'; echo '</tr>'; if(time() < 1495746215) { echo '<tr>'; echo '<td style="width:5%;"><input type="radio" class="aboveage1" name="PPA" id="balanceAuto" value="balanceAuto"></td>'; echo '<td style="width:50%; padding: 5px;">'; echo '<strong>2 Automatic Payments of '.money_format('$%i', $_SESSION["cart"]["PMT"]["credit_card_deposit"]).'</strong>'; echo '<br /><small>Deposit on '.date("m/d/Y", $nextDay).' and Balance on 06/01/2017.</small>'; echo '</td>'; echo '</tr>'; } if(time() < 1493647200) { echo '<tr>'; echo '<td style="width:5%;"><input type="radio" class="aboveage1" name="PPA" id="monthly" value="balanceMonthly"></td>'; echo '<td style="width:50%; padding: 5px;">'; echo '<strong>'.$_SESSION["cart"]["PMT"]["monthlyOccurrences"].' Automatic Monthly Payments of '.money_format('$%i', $_SESSION["cart"]["PMT"]["credit_card_monthly"]).'</strong>'; echo '</td>'; echo '</tr>'; } if(time() < 1495746215) { echo '<tr>'; echo '<td style="width:5%;"><input type="radio" class="aboveage1" name="PPA" id="balanceReminder" value="balanceReminder"></td>'; echo '<td style="width:50%; padding: 5px;">'; echo '<strong>Deposit Payment of '.money_format('$%i', $_SESSION["cart"]["PMT"]["credit_card_deposit"]).'</strong>'; echo '<br /><small>We\'ll contact you to make your balance payment, which is due by June 1, 2017 to maintain camp enrollment.</small>'; echo '</td>'; echo '</tr>'; } echo '</table>'; echo '</fieldset>'; echo '</div>'; echo '<hr />'; } echo '<h2 class="KG prox">Your Payment Information</h2>'; echo '<p><small>all fields are required</small></p>'; echo '<div class="seven columns alpha">'; echo '<label for="Billing_Name_First">First &amp; Last Name: </label><input type="text" name="Billing_Name_First" style="width: 90px; display: inline;" value="'.$_SESSION["webuser"]["Name_First"].'">'; echo '<input type="text" name="Billing_Name_Last" style="width: 100px; display: inline;" value="'.$_SESSION["webuser"]["Name_Last"].'">'; echo '<label for="Billing_Address_Line1">Address: </label><input type="text" name="Billing_Address_Line1" value="'.$_SESSION["webuser"]["Address_Line1"].'">'; echo '<label for="Billing_Address_City">City/State/Zip: </label><input type="text" name="Billing_Address_City" style="width: 120px; display: inline;" value="'.$_SESSION["webuser"]["Address_City"].'"> <input type="text" name="Billing_Address_State" style="width: 30px; display: inline;" value="'.$_SESSION["webuser"]["Address_State"].'"> <input type="text" name="Billing_Address_Zip" style="width: 50px; display: inline;" value="'.$_SESSION["webuser"]["Address_Zip"].'">'; echo '<label for="Billing_Phone">Phone: </label><input type="text" name="Billing_Phone" value="'.$_SESSION["webuser"]["Phone_Home"].'">'; echo '</div>'; if($_SESSION["cart"]["PMT"]["card_required"] == TRUE) { echo '<div class="seven columns omega">'; echo '<label for="Billing_CardType">Card Type: </label><select name="Billing_CardType" size="1">'; echo '<option value="Visa">Visa</option>'; echo '<option value="MasterCard">MasterCard</option>'; echo '<option value="American Express">American Express</option>'; echo '<option value="Discover">Discover</option>'; echo '</select>'; echo '<label for="Billing_CardNumber">Card Number &amp; 3-digit Card Security Code (cvv): </label><input type="text" style="width: 150px; display: inline;" name="Billing_CardNumber" value="'.$_REQUEST["Billing_CardNumber"].'"> <input type="text" name="Billing_CardCVV" style="width: 30px; display: inline;" value="">'; echo '<label>Expiration (mm/yyyy):</label><input type="text" style="width: 20px; display: inline;" name="Billing_CardExpMonth" value="'.$_REQUEST["Billing_CardExpMonth"].'"> / <input type="text" style="width: 40px; display: inline;" name="Billing_CardExpYear" value="'.$_REQUEST["Billing_CardExpYear"].'">'; echo '</div>'; } echo '<div class="eleven columns offset-by-one clearfix">'; echo '<input type="submit" name="Continue" value="Process My Order">'; echo '<a class="button" style="float: left;" href="index.php?step=1&&action=back">Back</a>'; echo '</div>'; echo '</form>'; echo '<hr />'; echo '<p><small>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.</small></p>'; echo '<hr />'; } elseif($step == 3) { echo '<h2 class="KG prox">Registration Received</h3>'; echo '<p>Your Summer Camp registration has been received by Old Town School of Folk Music. Your order number is '.$reservation_number.'</p>'; echo '<p>You will receive an email confirmation detailing your final registration status within a few minutes.</p>'; echo '<p><a class="KG" href="/account/">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. &raquo; </a></p>'; unset( $_SESSION["cart"] ); } ?> </div> <script> $(document).ready(function(){ $("#newstudentform").css("display","none"); $(".aboveage1").click(function(){ if ($('input[name=student]:checked').val() == "new" ) { $("#newstudentform").slideDown(500); //Slide Down Effect } else { $("#newstudentform").slideUp("fast"); //Slide Up Effect } }); }); </script> <!-- END Body Content Container ================================================== --> </div> <?php require_once($_SERVER['DOCUMENT_ROOT'].'/lib/include/footer_130711.php' ); ?>