2018-11-17 19:56:10 -07:00
< ? php
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License , v . 2.0 . If a copy of the MPL was not distributed with this
* file , You can obtain one at http :// mozilla . org / MPL / 2.0 /.
*/
2018-11-30 16:54:02 -07:00
2018-12-17 19:06:57 -07:00
if ( empty ( $IN_SITE )) {
die ( " Access denied. " );
}
2019-03-02 22:48:30 -07:00
$campers = [];
$adults = [];
$youth = [];
2018-11-30 16:54:02 -07:00
if ( isset ( $_SESSION [ 'familyid' ]) && $database -> has ( 'families' , [ 'familyid' => $_SESSION [ 'familyid' ]])) {
2019-03-02 22:48:30 -07:00
$campers = $database -> select ( " people " , 'personid' , [ 'AND' => [ 'familyid' => $_SESSION [ 'familyid' ], 'camperid[!]' => null ]]);
$adults = $database -> select ( " people " , 'personid' , [ 'AND' => [ 'familyid' => $_SESSION [ 'familyid' ], 'adultid[!]' => null ]]);
$youth = $database -> select ( " people " , 'personid' , [ 'AND' => [ 'familyid' => $_SESSION [ 'familyid' ], 'youthid[!]' => null ]]);
2018-11-30 16:54:02 -07:00
}
2018-11-17 19:56:10 -07:00
?>
< div class = " container mt-4 " >
2019-05-30 21:38:44 -06:00
< ? php
if ( ! empty ( $SETTINGS [ " disable_registration " ]) && $SETTINGS [ " disable_registration " ] == true ) {
2018-12-03 19:53:10 -07:00
?>
2019-03-02 22:48:30 -07:00
< div class = " card mb-4 bg-green text-light " >
2018-11-30 11:43:21 -07:00
< div class = " card-body " >
2018-11-17 19:56:10 -07:00
2018-11-30 11:43:21 -07:00
< div class = " d-flex flex-wrap justify-content-around " >
< div class = " ml-auto mr-auto pl-4 align-self-center text-center " >
2019-03-02 22:48:30 -07:00
< h1 > Day Camp Registration </ h1 >
2019-05-30 21:38:44 -06:00
2019-05-30 21:40:10 -06:00
< h3 > Online registration is now closed .</ h3 >
2018-11-30 11:43:21 -07:00
</ div >
2018-11-17 19:56:10 -07:00
</ div >
</ div >
2018-11-30 11:43:21 -07:00
</ div >
2018-11-30 15:17:31 -07:00
< ? php
2019-05-30 21:38:44 -06:00
} else {
?>
< form action = " actions/submit.php " method = " post " id = " registrationform " >
< ? php
// Add a hidden form element, to detect if the renewal session
// expired before we submitted the thing
if ( isset ( $_SESSION [ 'familyid' ])) {
?>
< input type = " hidden " name = " editing " value = " 1 " />
< ? php
}
2018-11-30 15:17:31 -07:00
?>
2019-05-30 21:38:44 -06:00
< div class = " card mb-4 bg-green text-light " >
2018-11-30 15:17:31 -07:00
< div class = " card-body " >
2019-05-30 21:38:44 -06:00
< div class = " d-flex flex-wrap justify-content-around " >
< div class = " ml-auto mr-auto pl-4 align-self-center text-center " >
< h1 > Day Camp Registration </ h1 >
</ div >
</ div >
2018-11-30 15:17:31 -07:00
</ div >
</ div >
2019-05-30 21:38:44 -06:00
2018-11-30 15:17:31 -07:00
< ? php
2019-05-30 21:38:44 -06:00
if ( ! empty ( $_GET [ 'error' ])) {
?>
< div class = " card mb-4 bg-danger text-white " >
< div class = " card-body " >
< ? php echo htmlspecialchars ( $_GET [ 'error' ]); ?>
</ div >
</ div >
< ? php
}
?>
2018-11-30 15:17:31 -07:00
2019-03-02 22:48:30 -07:00
2019-05-30 21:38:44 -06:00
<!-- Campers -->
< div class = " card mb-4 " >
< div class = " card-header bg-green text-light " >
< h3 >< i class = " fas fa-campground fa-fw " ></ i > Campers </ h3 >
</ div >
< div class = " list-group list-group-flush " id = " camper_list " >
< ? php
$persontype = " camper " ;
if ( count ( $campers ) > 0 ) {
foreach ( $campers as $personid ) {
include __DIR__ . " /template_person.php " ;
}
2018-11-30 11:43:21 -07:00
}
2019-05-30 21:38:44 -06:00
?>
</ div >
2018-11-17 19:56:10 -07:00
2019-05-30 21:38:44 -06:00
< div class = " card-body " >
< div class = " btn btn-sm btn-teal mt-1 " id = " add_camper " >
< i class = " fas fa-plus " ></ i > Add Camper
</ div >
2018-11-17 23:49:11 -07:00
</ div >
2018-11-30 11:43:21 -07:00
</ div >
2018-11-17 23:49:11 -07:00
2019-03-02 22:48:30 -07:00
2019-05-30 21:38:44 -06:00
<!-- Adults -->
< div class = " card mb-4 " >
< div class = " card-header bg-green text-light " >
< h3 >< i class = " fas fa-hiking fa-fw " ></ i > Adult Volunteers </ h3 >
</ div >
< div class = " list-group list-group-flush " id = " adult_list " >
< ? php
$persontype = " adult " ;
if ( count ( $adults ) > 0 ) {
foreach ( $adults as $personid ) {
include __DIR__ . " /template_person.php " ;
}
2019-03-02 22:48:30 -07:00
}
2019-05-30 21:38:44 -06:00
?>
2018-11-17 19:56:10 -07:00
</ div >
2019-05-30 21:38:44 -06:00
< div class = " card-body d-flex flex-wrap align-items-center " >
< div class = " btn btn-sm btn-teal mt-1 mr-4 " id = " add_adult " >
< i class = " fas fa-plus " ></ i > Add Adult
</ div >
< div >
2022-03-15 15:03:44 -06:00
< i class = " fas fa-info-circle fa-fw " ></ i > Do not register as a volunteer if you are attending with your Tiger cub , instead enter your name as the camper ' s parent / guardian .< br />
2019-05-30 21:38:44 -06:00
< i class = " fas fa-calendar-alt fa-fw " ></ i > A $ 10 discount is applied for every day an adult volunteers .< br />
2020-02-20 17:43:14 -07:00
< ? php
if ( $SETTINGS [ " prices " ][ " adult_tshirt " ] === false ) {
?>
< i class = " fas fa-tshirt fa-fw " ></ i > Shirts and patches are free for adult volunteers .
< ? php
} else {
?>
< i class = " fas fa-tshirt fa-fw " ></ i > Shirts are $ < ? php echo $SETTINGS [ " prices " ][ " tshirt " ]; ?> , or free for adults who volunteer at least <?php echo $SETTINGS["prices"]["adult_tshirt"]; ?> days.
< ? php
if ( $SETTINGS [ " prices " ][ " alone_adult_free_tshirt " ] === true ) {
?>
Shirts are also free for volunteers who are not attending with Cub Scouts .
< ? php
}
}
?>
2019-05-30 21:38:44 -06:00
</ div >
2019-03-19 13:40:09 -06:00
</ div >
2018-11-17 19:56:10 -07:00
</ div >
2019-03-02 22:48:30 -07:00
2019-05-30 21:38:44 -06:00
<!-- Youth Volunteers -->
< div class = " card mb-4 " >
< div class = " card-header bg-green text-light " >
< h3 >< i class = " fas fa-walking fa-fw " ></ i > Youth Volunteers </ h3 >
</ div >
< div class = " list-group list-group-flush " id = " youth_list " >
< ? php
$persontype = " youth " ;
if ( count ( $youth ) > 0 ) {
foreach ( $youth as $personid ) {
include __DIR__ . " /template_person.php " ;
}
2018-11-30 11:43:21 -07:00
}
2019-05-30 21:38:44 -06:00
?>
2018-11-17 19:56:10 -07:00
</ div >
2019-05-30 21:38:44 -06:00
< div class = " card-body d-flex flex-wrap align-items-center " >
< div class = " btn btn-sm btn-teal mt-1 mr-4 " id = " add_youth " >
< i class = " fas fa-plus " ></ i > Add Youth
</ div >
< div >
2020-02-20 17:43:14 -07:00
< ? php
if ( $SETTINGS [ " prices " ][ " youth_tshirt " ] === false ) {
?>
< i class = " fas fa-tshirt fa-fw " ></ i > Shirts and patches are free for youth volunteers .
< ? php
} else {
?>
< i class = " fas fa-tshirt fa-fw " ></ i > Shirts are $ < ? php echo $SETTINGS [ " prices " ][ " tshirt " ]; ?> , or free for youth who volunteer at least <?php echo $SETTINGS["prices"]["youth_tshirt"]; ?> days.
< ? php
}
?>
2019-05-30 21:38:44 -06:00
</ div >
2019-03-19 13:40:09 -06:00
</ div >
2018-11-30 11:43:21 -07:00
</ div >
2018-11-17 19:56:10 -07:00
2019-03-02 22:48:30 -07:00
2019-05-30 21:38:44 -06:00
<!-- Payment -->
< div class = " card mb-4 " >
< div class = " card-header bg-green text-light " >
< h3 >< i class = " fas fa-dollar-sign fa-fw " ></ i > Pay and Submit </ h3 >
</ div >
< div class = " card-body " >
< h4 > Total : $ < span id = " total " > 0 </ span ></ h4 >
2019-03-11 14:56:29 -06:00
2019-05-30 21:38:44 -06:00
< div class = " row " id = " payment-methods " style = " display: none; " >
< div class = " col-12 col-md-8 " >
< noscript >
< div class = " card-text text-danger mb-1 " >
< i class = " fas fa-code " ></ i > JavaScript is required to complete your payment .
</ div >
</ noscript >
< label for = " card-element " >
Credit or debit card :
</ label >
< div id = " card-element " class = " form-control " >
2019-03-11 14:56:29 -06:00
2019-05-30 21:38:44 -06:00
</ div >
< div id = " card-errors " class = " alert alert-danger d-none " ></ div >
< input type = " hidden " name = " stripeToken " id = " stripe-token " required />
< div class = " card-text text-success mb-1 " >
< i class = " fas fa-lock " ></ i > We can 't see your card info; it' s sent directly and securely from your computer to our payment processor .
</ div >
2022-04-20 14:19:43 -06:00
< ? php if ( $SETTINGS [ " prices " ][ " add_stripe_fees " ]) { ?>
< div class = " card-text text-info mb-1 " >
< i class = " fas fa-info-circle " ></ i > Credit card fees are automatically calculated and added to your total .
</ div >
< ? php } ?>
2019-03-11 14:56:29 -06:00
</ div >
2019-05-30 21:38:44 -06:00
< div class = " col-12 col-md-4 " >
< div class = " form-group " >
2025-05-21 21:16:18 -06:00
< label for = " campcoupons " > Camp Credits or Scout Bucks :</ label >
2019-05-30 21:38:44 -06:00
< div class = " input-group " >
< div class = " input-group-prepend " >
< div class = " input-group-text " >
< i class = " fas fa-dollar-sign " ></ i >
</ div >
2019-03-11 14:56:29 -06:00
</ div >
2019-05-30 21:38:44 -06:00
< input type = " number " step = " 1 " name = " campcoupons " class = " form-control " value = " 0 " />
2019-03-11 14:56:29 -06:00
</ div >
</ div >
</ div >
2019-03-02 22:48:30 -07:00
</ div >
2018-11-30 15:17:31 -07:00
2019-05-30 21:38:44 -06:00
<!-- Hi , don ' t bother tampering with this , the math is checked on the server . -->
< input type = " hidden " name = " totalcharge " value = " 0 " />
</ div >
< div class = " card-footer " >
< button type = " submit " class = " btn btn-teal " id = " savebutton " >
< span id = " savebutton-text " >
< i class = " fas fa-arrow-right " ></ i > Submit < span class = " d-none d-sm-inline " > Registration </ span >
</ span >
< span id = " savebutton-wait " class = " d-none " >
< i class = " fas fa-spinner fa-spin " ></ i > Working ...
</ span >
</ button >
</ div >
2018-11-30 11:43:21 -07:00
</ div >
2019-05-30 21:38:44 -06:00
</ form >
< ? php
}
?>
2018-11-17 23:49:11 -07:00
</ div >
2018-11-30 15:17:31 -07:00
< script src = " https://js.stripe.com/v3/ " ></ script >
< script >
2018-12-22 22:12:55 -07:00
var stripe_pubkey = '<?php echo $SETTINGS["stripe"]["pubkey"]; ?>' ;
2020-02-20 17:43:14 -07:00
// Hi, don't bother trying to change these values for a discount, the math
// is done on the server too so you'll just be wasting your time.
var prices = < ? php echo json_encode ( $SETTINGS [ " prices " ]); ?> ;
2018-11-30 15:17:31 -07:00
</ script >
2018-11-17 23:49:11 -07:00
< script src = " static/signup.js " ></ script >