diff --git a/database.mwb b/database.mwb index c859bfc..11189fc 100644 Binary files a/database.mwb and b/database.mwb differ diff --git a/lib/Child.lib.php b/lib/Child.lib.php deleted file mode 100644 index bde67bd..0000000 --- a/lib/Child.lib.php +++ /dev/null @@ -1,114 +0,0 @@ -get('people', ["familyid", "name", "birthday", "graduated"], ['personid' => $id]); - - $this->id = $id; - $this->familyid = $info['familyid']; - $this->name = $info['name']; - $this->birthday = strtotime($info['birthday']); - $this->graduated = $info['graduated'] == 1; - - return $this; - } - - public function save() { - global $database; - if (is_int($this->id) && $database->has("people", ['personid' => $this->id])) { - $database->update("people", ["name" => $this->name, "birthday" => date("Y-m-d", $this->birthday), "graduated" => $this->graduated], ['personid' => $this->id]); - } else { - $database->insert("people", ["familyid" => $this->familyid, "name" => $this->name, "birthday" => date("Y-m-d", $this->birthday), "graduated" => $this->graduated]); - $this->id = $database->id(); - } - } - - public static function exists(int $cid, int $fid = null) { - global $database; - if (is_null($fid)) { - return $database->has("people", [ - 'personid' => $cid - ]); - } - return $database->has("people", ["AND" => [ - 'familyid' => $fid, - 'personid' => $cid - ]]); - } - - public function getID(): int { - return $this->id; - } - - public function getFamilyID(): int { - return $this->familyid; - } - - public function getFamily(): Family { - return (new Family())->load($this->familyid); - } - - public function getName(): string { - return $this->name; - } - - /** - * Get the person's birth date as a UNIX timestamp. - * @return int - */ - public function getBirthday(): int { - return $this->birthday; - } - - public function isGraduated(): bool { - return $this->graduated == true; - } - - public function setName(string $name) { - $this->name = $name; - } - - /** - * Set the person's birth date to either a UNIX timestamp or a date string. - * @param int $timestamp - * @param string $date A string parseable by strtotime(). - */ - public function setBirthday(int $timestamp = null, string $date = null) { - if (is_null($timestamp) && !is_null($date)) { - $this->birthday = strtotime($date); - } else if (!is_null($timestamp) && is_null($date)) { - $this->birthday = $timestamp; - } - } - - public function setGraduated(bool $graduated) { - $this->graduated = $graduated; - } - - public function setFamilyID(int $id) { - $this->familyid = $id; - } - - public function setFamily(Family $f) { - $this->familyid = $f->getID(); - } - -} diff --git a/lib/Family.lib.php b/lib/Family.lib.php deleted file mode 100644 index be35c46..0000000 --- a/lib/Family.lib.php +++ /dev/null @@ -1,291 +0,0 @@ -has("families", ['familyid' => $familyid])) { - $this->id = $familyid; - } else { - throw new Exception("No such family exists."); - } - - $f = $database->get("families", [ - 'familyid (id)', - 'familyname (name)', - 'phone', - 'email', - 'newsletter_method (newsletter)', - 'address', - 'city', - 'state', - 'zip', - 'father_name (father)', - 'mother_name (mother)', - 'photo_permission (photo)', - 'expires', - 'private' - ], [ - "familyid" => $this->id - ]); - - $children = $database->select("people", 'personid', ["familyid" => $this->id]); - - $this->name = $f['name']; - $this->father = $f['father']; - $this->mother = $f['mother']; - $this->phone = $f['phone']; - $this->email = $f['email']; - $this->address = $f['address']; - $this->city = $f['city']; - $this->state = $f['state']; - $this->zip = $f['zip']; - $this->photo = $f['photo'] == 1; - $this->newsletter = $f['newsletter']; - $this->expires = strtotime($f['expires']); - $this->private = $f['private'] == 1; - - foreach ($children as $c) { - $this->children[] = (new Child())->load($c); - } - - return $this; - } - - public function save() { - global $database; - if (is_int($this->id) && $database->has("families", ['familyid' => $this->id])) { - $database->update("families", [ - "familyname" => $this->getName(), - "father_name" => $this->getFather(), - "mother_name" => $this->getMother(), - "phone" => $this->getPhone(), - "email" => $this->getEmail(), - "address" => $this->getAddress(), - "city" => $this->getCity(), - "state" => $this->getState(), - "zip" => $this->getZip(), - "photo_permission" => $this->getPhotoPermission(), - "newsletter_method" => $this->getNewsletter(), - "expires" => date("Y-m-d", $this->getExpires()), - "private" => $this->getPrivate() - ], [ - "familyid" => $this->id - ]); - } else { - $database->insert("families", [ - "familyname" => $this->getName(), - "father_name" => $this->getFather(), - "mother_name" => $this->getMother(), - "phone" => $this->getPhone(), - "email" => $this->getEmail(), - "address" => $this->getAddress(), - "city" => $this->getCity(), - "state" => $this->getState(), - "zip" => $this->getZip(), - "photo_permission" => $this->getPhotoPermission(), - "newsletter_method" => $this->getNewsletter(), - "expires" => date("Y-m-d", $this->getExpires()), - "private" => $this->getPrivate() - ]); - $this->id = $database->id(); - } - - for ($i = 0; $i < count($this->children); $i++) { - $this->children[$i]->setFamilyID($this->id); - $this->children[$i]->save(); - } - } - - public function getID() { - return $this->id; - } - - public function getName(): string { - return $this->name; - } - - public function getFather(): string { - return $this->father; - } - - public function getMother(): string { - return $this->mother; - } - - public function getPhone(): string { - return $this->phone; - } - - public function getEmail(): string { - return $this->email; - } - - public function getAddress(): string { - return $this->address; - } - - public function getCity(): string { - return $this->city; - } - - public function getState(): string { - return $this->state; - } - - public function getZip(): string { - return $this->zip; - } - - public function getPhotoPermission(): bool { - return $this->photo == true; - } - - public function getNewsletter(): int { - return $this->newsletter; - } - - public function getChildren(): array { - return $this->children; - } - - public function getExpires(): int { - return $this->expires; - } - - public function getPrivate(): bool { - return $this->private == true; - } - - - - public function setName(string $name) { - $this->name = $name; - } - - public function setFather(string $name) { - $this->father = $name; - } - - public function setMother(string $name) { - $this->mother = $name; - } - - public function setPhone(string $phone) { - $phone = preg_replace("/[^0-9]/", "", $phone); - if (strlen($phone) == 11) { - $phone = preg_replace("/^1/", "", $phone); - } - if (strlen($phone) != 10) { - throw new Exception("Enter a valid 10-digit phone number."); - } - $this->phone = $phone; - } - - public function setEmail(string $email) { - $email = strtolower($email); - if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { - throw new Exception("The email address looks wrong."); - } - $this->email = $email; - } - - public function setAddress(string $address) { - $this->address = $address; - } - - public function setCity(string $city) { - $this->city = $city; - } - - /** - * Set the state, in two-character form. - * @param string $state - * @throws Exception - */ - public function setState(string $state) { - $state = strtoupper($state); - if (!preg_match("/^[A-Z]{2}$/", $state)) { - throw new Exception("Select a valid state."); - } - $this->state = strtoupper($state); - } - - public function setZip(string $zip) { - if (!preg_match("/^[0-9]{5}(-?[0-9]{4})?$/", $zip)) { - throw new Exception("Enter a valid five or nine digit US ZIP code."); - } - $this->zip = $zip; - } - - public function setPhotoPermission(bool $perm) { - $this->photo = $perm; - } - - public function setNewsletter(int $newsletter) { - if (!is_int($newsletter) || !($newsletter == 1 || $newsletter == 2 || $newsletter == 3)) { - throw new Exception("Invalid newsletter preference."); - } - $this->newsletter = $newsletter; - } - - public function setChildren(array $children) { - $this->children = $children; - } - - public function addChild(Child $child) { - $this->children[] = $child; - } - - /** - * Set the membership expiration date to either a UNIX timestamp or a date - * string. - * @param int $timestamp - * @param string $date A string parseable by strtotime(). - */ - public function setExpires(int $timestamp = null, string $date = null) { - if (is_null($timestamp) && !is_null($date)) { - $this->expires = strtotime($date); - } else if (!is_null($timestamp) && is_null($date)) { - $this->expires = $timestamp; - } - } - - public function setPrivate(bool $private) { - $this->private = $private; - } - -} diff --git a/nbproject/project.xml b/nbproject/project.xml index 0ab2e4f..75ab9c3 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -3,7 +3,7 @@ org.netbeans.modules.php.project - MembershipPortal + CampPortal diff --git a/public/actions/submitmembership.php b/public/actions/submit.php similarity index 97% rename from public/actions/submitmembership.php rename to public/actions/submit.php index c8f17f5..bfebe35 100644 --- a/public/actions/submitmembership.php +++ b/public/actions/submit.php @@ -8,24 +8,18 @@ require_once __DIR__ . "/../../lib/requiredpublic.php"; -require_once __DIR__ . "/../../lib/Family.lib.php"; -require_once __DIR__ . "/../../lib/Child.lib.php"; require_once __DIR__ . "/../../lib/Email.lib.php"; +var_export($_POST); +die(); + function errorBack(string $errormsg) { header("Location: ../?page=signup&error=" . htmlentities($errormsg)); die($errormsg); } -if (empty($_POST['agree_terms'])) { - errorBack("You must agree to HACHE's policy."); -} - -$family = new Family(); -$renewal = false; - if (!empty($_SESSION['familyid']) && $database->has("families", ['familyid' => $_SESSION['familyid']])) { - $family = (new Family())->load($_SESSION['familyid']); + $family = $_SESSION['familyid']; $renewal = true; } else if (!empty($_POST['renewing'])) { // Session expired, but we're renewing, so kick them back to verification diff --git a/public/index.php b/public/index.php index 17c1ec2..82777dd 100644 --- a/public/index.php +++ b/public/index.php @@ -7,15 +7,9 @@ require_once __DIR__ . "/../lib/requiredpublic.php"; -$page = "entry.php"; +$page = "signup.php"; if (!empty($_GET['page'])) { switch ($_GET['page']) { - case "renew": - $page = "renew.php"; - break; - case "verify": - $page = "verify.php"; - break; case "signup": $page = "signup.php"; break; @@ -32,9 +26,12 @@ if (!empty($_GET['page'])) { <?php echo $SETTINGS["site_title"]; ?> + + - + + -
-
-
-
- -
- HACHE: Helena Area Christian Home Educators - -

Renew Your Membership

- -
-

- Please enter your email address below. You'll be - sent a verification code. This is to ensure nobody - else can view or change your family's information. -

- - time()) { - $msg = " This membership isn't expiring until " . date("F j, Y", $_GET['exp'] * 1) . " and cannot be renewed yet."; - } else { - // Somebody is screwing with the URL - // for some reason - $msg = " This membership isn't close enough to expiration and cannot be renewed yet."; - } - break; - } - } - if ($msg != "") { - ?> -
- -
- - -
-
-
- - - -
- -
- -
-
-
-
-
-
-
-
\ No newline at end of file diff --git a/public/parts/signup.php b/public/parts/signup.php index ae117da..c96926b 100644 --- a/public/parts/signup.php +++ b/public/parts/signup.php @@ -9,58 +9,33 @@ if (empty($IN_SITE)) { die("Access denied."); } -$familyname = ""; -$fathername = ""; -$mothername = ""; -$streetaddress = ""; -$city = ""; -$state = ""; -$zip = ""; -$phone = ""; -$email = ""; -$newsletter_method = ""; - -$children = []; +$campers = []; +$adults = []; +$youth = []; if (isset($_SESSION['familyid']) && $database->has('families', ['familyid' => $_SESSION['familyid']])) { - $familyinfo = $database->get("families", ['familyname', 'phone', 'email', 'address', 'city', 'state', 'zip', 'father_name (fathername)', 'mother_name (mothername)', 'newsletter_method'], ['familyid' => $_SESSION['familyid']]); - $children = $database->select("people", 'personid', ['familyid' => $_SESSION['familyid']]); - $familyname = $familyinfo['familyname']; - $fathername = $familyinfo['fathername']; - $mothername = $familyinfo['mothername']; - $streetaddress = $familyinfo['address']; - $city = $familyinfo['city']; - $state = $familyinfo['state']; - $zip = $familyinfo['zip']; - $phone = $familyinfo['phone']; - $email = $familyinfo['email']; - $newsletter_method = $familyinfo['newsletter_method']; + $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]]); } ?>
-
+ - + -
+
- HACHE: Helena Area Christian Home Educators
- Membership Renewal"; - } else { - echo "

Membership Application

"; - } - ?> +

Day Camp Registration

@@ -78,393 +53,97 @@ if (isset($_SESSION['familyid']) && $database->has('families', ['familyid' => $_ } ?> + +
-
-

Basic Information

+
+

Campers

-
- -
- - "Family Name (Last Name)", - "icon" => "fas fa-users", - "name" => "familyname", - "maxlength" => 100, - "value" => $familyname, - "error" => "Enter your last name." - ], - [ - "label" => "Father's Name", - "icon" => "fas fa-male", - "name" => "fathername", - "maxlength" => 255, - "value" => $fathername, - "error" => "Enter the father's name." - ], - [ - "label" => "Mother's Name", - "icon" => "fas fa-female", - "name" => "mothername", - "maxlength" => 255, - "value" => $mothername, - "error" => "Enter the mother's name." - ], - [ - "label" => "Street Address", - "icon" => "fas fa-home", - "name" => "streetaddress", - "maxlength" => 500, - "value" => $streetaddress, - "error" => "Enter your address." - ], - [ - "label" => "City", - "icon" => "fas fa-city", - "name" => "city", - "maxlength" => 255, - "width" => 3, - "value" => $city, - "error" => "Enter your city." - ], - [ - "label" => "State", - "icon" => "fas fa-flag", - "name" => "state", - "type" => "select", - "value" => $state, - "error" => "Choose a state.", - "options" => [ - 'MT' => 'Montana', - 'AL' => 'Alabama', - 'AK' => 'Alaska', - 'AZ' => 'Arizona', - 'AR' => 'Arkansas', - 'CA' => 'California', - 'CO' => 'Colorado', - 'CT' => 'Connecticut', - 'DE' => 'Delaware', - 'DC' => 'District of Columbia', - 'FL' => 'Florida', - 'GA' => 'Georgia', - 'HI' => 'Hawaii', - 'ID' => 'Idaho', - 'IL' => 'Illinois', - 'IN' => 'Indiana', - 'IA' => 'Iowa', - 'KS' => 'Kansas', - 'KY' => 'Kentucky', - 'LA' => 'Louisiana', - 'ME' => 'Maine', - 'MD' => 'Maryland', - 'MA' => 'Massachusetts', - 'MI' => 'Michigan', - 'MN' => 'Minnesota', - 'MS' => 'Mississippi', - 'MO' => 'Missouri', - 'MT' => 'Montana', - 'NE' => 'Nebraska', - 'NV' => 'Nevada', - 'NH' => 'New Hampshire', - 'NJ' => 'New Jersey', - 'NM' => 'New Mexico', - 'NY' => 'New York', - 'NC' => 'North Carolina', - 'ND' => 'North Dakota', - 'OH' => 'Ohio', - 'OK' => 'Oklahoma', - 'OR' => 'Oregon', - 'PA' => 'Pennsylvania', - 'RI' => 'Rhode Island', - 'SC' => 'South Carolina', - 'SD' => 'South Dakota', - 'TN' => 'Tennessee', - 'TX' => 'Texas', - 'UT' => 'Utah', - 'VT' => 'Vermont', - 'VA' => 'Virginia', - 'WA' => 'Washington', - 'WV' => 'West Virginia', - 'WI' => 'Wisconsin', - 'WY' => 'Wyoming' - ], - "width" => 2 - ], - [ - "label" => "ZIP/Postal Code", - "icon" => "fas fa-mail-bulk", - "name" => "zip", - "maxlength" => 10, - "width" => 3, - "value" => $zip, - "pattern" => "[0-9]{5}(-?[0-9]{4})?", - "error" => "Enter a valid 5 or 9 digit ZIP code." - ], - [ - "label" => "Phone Number", - "icon" => "fas fa-phone", - "name" => "phone", - "type" => "tel", - "maxlength" => 20, - "value" => $phone, - "pattern" => "[0-9]{10}", - "error" => "Enter a 10-digit phone number (numbers only)." - ], - [ - "label" => "Email", - "icon" => "fas fa-at", - "name" => "email", - "maxlength" => 255, - "type" => "email", - "value" => $email, - "error" => "Enter your email address." - ], - [ - "label" => "Newsletter Preference", - "icon" => "fas fa-newspaper", - "name" => "newsletter_method", - "type" => "select", - "value" => $newsletter_method, - "options" => [ - "1" => "Email ($25)", - "2" => "Paper ($35)", - "3" => "Email and Paper ($35)" - ], - "error" => "Choose a newsletter option." - ] - ]; - - foreach ($textboxes as $item) { - ?> - -
"> -
- -
-
- -
- - " - name="" - class="form-control" - placeholder="" - aria-label="" - maxlength="" - - pattern="" - - - value="" - required /> - - - -
- -
-
-
-
- - + 0) { + foreach ($campers as $personid) { + include __DIR__ . "/template_person.php"; } - ?> - -
- -
-

- The membership fees (determined by your newsletter - preference) cover costs of the following: - phone; website; postage; distribution of newsletters and - directories; publication of materials; library; and other - HACHE related activities. Dues are reduced as of March 1st. - HACHE will not restrict membership based on inability to - pay. HACHE does not mandate curriculum choices or the - manner in which curriculum is administered. We do encourage - all members to follow and adhere to MT laws governing home - schooling. -

+ } else { + include __DIR__ . "/template_person.php"; + } + ?>
-
-
-
-

Children

-
-
-

- Please list your children's first names and birth dates. This - information will appear in our members’ directory. Members - agree that they will NOT make this information public. - -

- 0) { - foreach ($children as $childid) { - include __DIR__ . "/template_child_entry.php"; - } - } else { - include __DIR__ . "/template_child_entry.php"; - } - ?> -
- -
- Add another -
- +
+ Add another
+ +
-
-

Consent

+
+

Adult Volunteers

+
+
+ 0) { + foreach ($adults as $personid) { + include __DIR__ . "/template_person.php"; + } + } else { + include __DIR__ . "/template_person.php"; + } + ?>
-
- -
-

HACHE members occasionally take pictures of students during - home school functions and activities. These photos may be - used in HACHE displays, brochures, website, etc. -

I give permission for my photos to be included in such displays: - - - - - - - - -

-
- - +
+
+ Add another
-
-
+ +
-
-

- - - - - Activities -

+
+

Youth Volunteers

- -
- -
-

HACHE is an all-volunteer organization. Listed below are events - and activities that may occur throughout the year. If you are - interested in helping with one or more of these events please - select any and all events of interest so we can get you in touch - with the member in charge of said event. Please feel free to - contact Steering Committee members or the newsletter editor with - ideas for field trips and or other activities that may be - enjoyed by all. (Not all of these events are specifically - HACHE events, but rather events HACHE supported events our - members have participated in and enjoyed in past years.) -

- +
select('events', ['eventid (id)', 'event (name)']); - - $eventcount = count($events); - - $cola = []; - $colb = []; - - for ($i = 0; $i < $eventcount; $i++) { - if ($i % 2 === 0) { - $cola[] = $events[$i]; - } else { - $colb[] = $events[$i]; + $persontype = "youth"; + if (count($youth) > 0) { + foreach ($youth as $personid) { + include __DIR__ . "/template_person.php"; } + } else { + include __DIR__ . "/template_person.php"; } ?> +
-
- -
-
    - -
  • -
    - - -
    -
  • - -
-
- -
-
    - -
  • -
    - - -
    -
  • - -
-
+
+
+ Add another
-
+ +
-
+

Pay and Submit

+

Total: $0

+
We can't see your card info; it's sent directly and securely from your computer to our payment processor.
@@ -478,9 +157,9 @@ if (isset($_SESSION['familyid']) && $database->has('families', ['familyid' => $_
-
- -
-
-
-
-
\ No newline at end of file diff --git a/public/static/fontawesome-all.min.js b/public/static/fontawesome-all.min.js deleted file mode 100644 index b08e9a6..0000000 --- a/public/static/fontawesome-all.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * Font Awesome Free 5.3.1 by @fontawesome - https://fontawesome.com - * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) - */ -!function(){"use strict";var c={};try{"undefined"!=typeof window&&(c=window)}catch(c){}var l=(c.navigator||{}).userAgent,h=void 0===l?"":l,z=c,v=(~h.indexOf("MSIE")||h.indexOf("Trident/"),"___FONT_AWESOME___"),m=function(){try{return!0}catch(c){return!1}}(),s=[1,2,3,4,5,6,7,8,9,10],e=s.concat([11,12,13,14,15,16,17,18,19,20]);["xs","sm","lg","fw","ul","li","border","pull-left","pull-right","spin","pulse","rotate-90","rotate-180","rotate-270","flip-horizontal","flip-vertical","stack","stack-1x","stack-2x","inverse","layers","layers-text","layers-counter"].concat(s.map(function(c){return c+"x"})).concat(e.map(function(c){return"w-"+c}));var a=z||{};a[v]||(a[v]={}),a[v].styles||(a[v].styles={}),a[v].hooks||(a[v].hooks={}),a[v].shims||(a[v].shims=[]);var t=a[v],M=Object.assign||function(c){for(var l=1;l>>0;h--;)l[h]=c[h];return l}function U(c){return c.classList?X(c.classList):(c.getAttribute("class")||"").split(" ").filter(function(c){return c})}function K(c,l){var h,z=l.split("-"),v=z[0],m=z.slice(1).join("-");return v!==c||""===m||(h=m,~w.indexOf(h))?null:m}function G(c){return(""+c).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function J(h){return Object.keys(h||{}).reduce(function(c,l){return c+(l+": ")+h[l]+";"},"")}function Q(c){return c.size!==W.size||c.x!==W.x||c.y!==W.y||c.rotate!==W.rotate||c.flipX||c.flipY}function Z(c){var l=c.transform,h=c.containerWidth,z=c.iconWidth;return{outer:{transform:"translate("+h/2+" 256)"},inner:{transform:"translate("+32*l.x+", "+32*l.y+") "+" "+("scale("+l.size/16*(l.flipX?-1:1)+", "+l.size/16*(l.flipY?-1:1)+") ")+" "+("rotate("+l.rotate+" 0 0)")},path:{transform:"translate("+z/2*-1+" -256)"}}}var $={x:0,y:0,width:"100%",height:"100%"},cc=function(c){var l=c.children,h=c.attributes,z=c.main,v=c.mask,m=c.transform,s=z.width,e=z.icon,a=v.width,t=v.icon,M=Z({transform:m,containerWidth:a,iconWidth:s}),f={tag:"rect",attributes:A({},$,{fill:"white"})},r={tag:"g",attributes:A({},M.inner),children:[{tag:"path",attributes:A({},e.attributes,M.path,{fill:"black"})}]},H={tag:"g",attributes:A({},M.outer),children:[r]},i="mask-"+D(),n="clip-"+D(),V={tag:"defs",children:[{tag:"clipPath",attributes:{id:n},children:[t]},{tag:"mask",attributes:A({},$,{id:i,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[f,H]}]};return l.push(V,{tag:"rect",attributes:A({fill:"currentColor","clip-path":"url(#"+n+")",mask:"url(#"+i+")"},$)}),{children:l,attributes:h}},lc=function(c){var l=c.children,h=c.attributes,z=c.main,v=c.transform,m=J(c.styles);if(0"+s.map(bc).join("")+""}var gc=function(){};function Sc(c){return"string"==typeof(c.getAttribute?c.getAttribute(g):null)}var yc={replace:function(c){var l=c[0],h=c[1].map(function(c){return bc(c)}).join("\n");if(l.parentNode&&l.outerHTML)l.outerHTML=h+(E.keepOriginalSource&&"svg"!==l.tagName.toLowerCase()?"\x3c!-- "+l.outerHTML+" --\x3e":"");else if(l.parentNode){var z=document.createElement("span");l.parentNode.replaceChild(z,l),z.outerHTML=h}},nest:function(c){var l=c[0],h=c[1];if(~U(l).indexOf(E.replacementClass))return yc.replace(c);var z=new RegExp(E.familyPrefix+"-.*");delete h[0].attributes.style;var v=h[0].attributes.class.split(" ").reduce(function(c,l){return l===E.replacementClass||l.match(z)?c.toSvg.push(l):c.toNode.push(l),c},{toNode:[],toSvg:[]});h[0].attributes.class=v.toSvg.join(" ");var m=h.map(function(c){return bc(c)}).join("\n");l.setAttribute("class",v.toNode.join(" ")),l.setAttribute(g,""),l.innerHTML=m}};function wc(h,c){var z="function"==typeof c?c:gc;0===h.length?z():(r.requestAnimationFrame||function(c){return c()})(function(){var c=!0===E.autoReplaceSvg?yc.replace:yc[E.autoReplaceSvg]||yc.replace,l=Mc.begin("mutate");h.map(c),l(),z()})}var kc=!1;var xc=null;function Ac(c){if(e&&E.observeMutations){var v=c.treeCallback,m=c.nodeCallback,s=c.pseudoElementsCallback,l=c.observeMutationsRoot,h=void 0===l?H.body:l;xc=new e(function(c){kc||X(c).forEach(function(c){if("childList"===c.type&&0li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:solid .08em #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);transform:scale(1,-1)}.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;position:relative;width:2em}.fa-stack-1x,.fa-stack-2x{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}.svg-inline--fa.fa-stack-1x{height:1em;width:1em}.svg-inline--fa.fa-stack-2x{height:2em;width:2em}.fa-inverse{color:#fff}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}";if("fa"!==l||h!==c){var v=new RegExp("\\.fa\\-","g"),m=new RegExp("\\."+c,"g");z=z.replace(v,"."+l+"-").replace(m,"."+h)}return z};function zl(c){return{found:!0,width:c[0],height:c[1],icon:{tag:"path",attributes:{fill:"currentColor",d:c.slice(4)[0]}}}}function vl(){E.autoAddCss&&!tl&&(Y(hl()),tl=!0)}function ml(l,c){return Object.defineProperty(l,"abstract",{get:c}),Object.defineProperty(l,"html",{get:function(){return l.abstract.map(function(c){return bc(c)})}}),Object.defineProperty(l,"node",{get:function(){if(M){var c=H.createElement("div");return c.innerHTML=l.html,c.children}}}),l}function sl(c){var l=c.prefix,h=void 0===l?"fa":l,z=c.iconName;if(z)return pc(al.definitions,h,z)||pc(T.styles,h,z)}var el,al=new(function(){function c(){k(this,c),this.definitions={}}return x(c,[{key:"add",value:function(){for(var l=this,c=arguments.length,h=Array(c),z=0;z>>0;n--;)e[n]=t[n];return e}function kt(t){return t.classList?xt(t.classList):(t.getAttribute("class")||"").split(" ").filter(function(t){return t})}function At(t,e){var n,a=e.split("-"),r=a[0],i=a.slice(1).join("-");return r!==t||""===i||(n=i,~H.indexOf(n))?null:i}function Ct(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function Nt(n){return Object.keys(n||{}).reduce(function(t,e){return t+"".concat(e,": ").concat(n[e],";")},"")}function St(t){return t.size!==vt.size||t.x!==vt.x||t.y!==vt.y||t.rotate!==vt.rotate||t.flipX||t.flipY}function zt(t){var e=t.transform,n=t.containerWidth,a=t.iconWidth,r={transform:"translate(".concat(n/2," 256)")},i="translate(".concat(32*e.x,", ").concat(32*e.y,") "),o="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),c="rotate(".concat(e.rotate," 0 0)");return{outer:r,inner:{transform:"".concat(i," ").concat(o," ").concat(c)},path:{transform:"translate(".concat(a/2*-1," -256)")}}}var Mt={x:0,y:0,width:"100%",height:"100%"};function Ot(t){var e=t.icons,n=e.main,a=e.mask,r=t.prefix,i=t.iconName,o=t.transform,c=t.symbol,s=t.title,l=t.extra,f=t.watchable,u=void 0!==f&&f,d=a.found?a:n,m=d.width,h=d.height,p="fa-w-".concat(Math.ceil(m/h*16)),g=[V.replacementClass,i?"".concat(V.familyPrefix,"-").concat(i):"",p].filter(function(t){return-1===l.classes.indexOf(t)}).concat(l.classes).join(" "),v={children:[],attributes:B({},l.attributes,{"data-prefix":r,"data-icon":i,class:g,role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(m," ").concat(h)})};u&&(v.attributes[U]=""),s&&v.children.push({tag:"title",attributes:{id:v.attributes["aria-labelledby"]||"title-".concat(wt())},children:[s]});var b,y,w,x,k,A,C,N,S,z,M,O,E,j,P,L,_,T,R,H,I,F,Y,D=B({},v,{prefix:r,iconName:i,main:n,mask:a,transform:o,symbol:c,styles:l.styles}),q=a.found&&n.found?(y=(b=D).children,w=b.attributes,x=b.main,k=b.mask,A=b.transform,C=x.width,N=x.icon,S=k.width,z=k.icon,M=zt({transform:A,containerWidth:S,iconWidth:C}),O={tag:"rect",attributes:B({},Mt,{fill:"white"})},E={tag:"g",attributes:B({},M.inner),children:[{tag:"path",attributes:B({},N.attributes,M.path,{fill:"black"})}]},j={tag:"g",attributes:B({},M.outer),children:[E]},P="mask-".concat(wt()),L="clip-".concat(wt()),_={tag:"defs",children:[{tag:"clipPath",attributes:{id:L},children:[z]},{tag:"mask",attributes:B({},Mt,{id:P,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[O,j]}]},y.push(_,{tag:"rect",attributes:B({fill:"currentColor","clip-path":"url(#".concat(L,")"),mask:"url(#".concat(P,")")},Mt)}),{children:y,attributes:w}):function(t){var e=t.children,n=t.attributes,a=t.main,r=t.transform,i=Nt(t.styles);if(0").concat(o.map(Kt).join(""),"")}var Gt=function(){};function Jt(t){return"string"==typeof(t.getAttribute?t.getAttribute(U):null)}var Qt={replace:function(t){var e=t[0],n=t[1].map(function(t){return Kt(t)}).join("\n");if(e.parentNode&&e.outerHTML)e.outerHTML=n+(V.keepOriginalSource&&"svg"!==e.tagName.toLowerCase()?"\x3c!-- ".concat(e.outerHTML," --\x3e"):"");else if(e.parentNode){var a=document.createElement("span");e.parentNode.replaceChild(a,e),a.outerHTML=n}},nest:function(t){var e=t[0],n=t[1];if(~kt(e).indexOf(V.replacementClass))return Qt.replace(t);var a=new RegExp("".concat(V.familyPrefix,"-.*"));delete n[0].attributes.style;var r=n[0].attributes.class.split(" ").reduce(function(t,e){return e===V.replacementClass||e.match(a)?t.toSvg.push(e):t.toNode.push(e),t},{toNode:[],toSvg:[]});n[0].attributes.class=r.toSvg.join(" ");var i=n.map(function(t){return Kt(t)}).join("\n");e.setAttribute("class",r.toNode.join(" ")),e.setAttribute(U,""),e.innerHTML=i}};function Zt(n,t){var a="function"==typeof t?t:Gt;0===n.length?a():(h.requestAnimationFrame||function(t){return t()})(function(){var t=!0===V.autoReplaceSvg?Qt.replace:Qt[V.autoReplaceSvg]||Qt.replace,e=Tt.begin("mutate");n.map(t),e(),a()})}var $t=!1;function te(){$t=!1}var ee=null;function ne(t){if(l&&V.observeMutations){var r=t.treeCallback,i=t.nodeCallback,o=t.pseudoElementsCallback,e=t.observeMutationsRoot,n=void 0===e?p:e;ee=new l(function(t){$t||xt(t).forEach(function(t){if("childList"===t.type&&0 - diff --git a/public/static/material-color.min.css b/public/static/material-color.min.css new file mode 100644 index 0000000..f39722b --- /dev/null +++ b/public/static/material-color.min.css @@ -0,0 +1,7 @@ +/* Material-Color.css + * Copyright (c) 2018 Netsyms Technologies + * MIT License + * https://source.netsyms.com/Netsyms/Material-Color + */ +.alert-red{background-color:#f44336;color:#fff!important}.alert-pink{background-color:#e91e63;color:#fff!important}.alert-purple{background-color:#9c27b0;color:#fff!important}.alert-deep-purple{background-color:#673ab7;color:#fff!important}.alert-indigo{background-color:#3f51b5;color:#fff!important}.alert-blue{background-color:#2196f3;color:#fff!important}.alert-light-blue{background-color:#03a9f4;color:#000!important}.alert-cyan{background-color:#00bcd4;color:#000!important}.alert-teal{background-color:#009688;color:#fff!important}.alert-green{background-color:#4caf50;color:#fff!important}.alert-light-green{background-color:#8bc34a;color:#000!important}.alert-lime{background-color:#cddc39;color:#000!important}.alert-yellow{background-color:#ffeb3b;color:#000!important}.alert-amber{background-color:#ffc107;color:#000!important}.alert-orange{background-color:#ff9800;color:#000!important}.alert-deep-orange{background-color:#ff5722;color:#fff!important}.alert-brown{background-color:#795548;color:#fff!important}.alert-grey{background-color:#9e9e9e;color:#000!important}.alert-blue-grey{background-color:#607d8b;color:#fff!important}.alert-red .alert-link{color:#fff!important}.alert-pink .alert-link{color:#fff!important}.alert-purple .alert-link{color:#fff!important}.alert-deep-purple .alert-link{color:#fff!important}.alert-indigo .alert-link{color:#fff!important}.alert-blue .alert-link{color:#fff!important}.alert-light-blue .alert-link{color:#000!important}.alert-cyan .alert-link{color:#000!important}.alert-teal .alert-link{color:#fff!important}.alert-green .alert-link{color:#fff!important}.alert-light-green .alert-link{color:#000!important}.alert-lime .alert-link{color:#000!important}.alert-yellow .alert-link{color:#000!important}.alert-amber .alert-link{color:#000!important}.alert-orange .alert-link{color:#000!important}.alert-deep-orange .alert-link{color:#fff!important}.alert-brown .alert-link{color:#fff!important}.alert-grey .alert-link{color:#000!important}.alert-blue-grey .alert-link{color:#fff!important}.alert-red .alert-heading{color:#fff!important}.alert-pink .alert-heading{color:#fff!important}.alert-purple .alert-heading{color:#fff!important}.alert-deep-purple .alert-heading{color:#fff!important}.alert-indigo .alert-heading{color:#fff!important}.alert-blue .alert-heading{color:#fff!important}.alert-light-blue .alert-heading{color:#000!important}.alert-cyan .alert-heading{color:#000!important}.alert-teal .alert-heading{color:#fff!important}.alert-green .alert-heading{color:#fff!important}.alert-light-green .alert-heading{color:#000!important}.alert-lime .alert-heading{color:#000!important}.alert-yellow .alert-heading{color:#000!important}.alert-amber .alert-heading{color:#000!important}.alert-orange .alert-heading{color:#000!important}.alert-deep-orange .alert-heading{color:#fff!important}.alert-brown .alert-heading{color:#fff!important}.alert-grey .alert-heading{color:#000!important}.alert-blue-grey .alert-heading{color:#fff!important}.badge-red{background-color:#f44336;color:#fff}.badge-pink{background-color:#e91e63;color:#fff}.badge-purple{background-color:#9c27b0;color:#fff}.badge-deep-purple{background-color:#673ab7;color:#fff}.badge-indigo{background-color:#3f51b5;color:#fff}.badge-blue{background-color:#2196f3;color:#fff}.badge-light-blue{background-color:#03a9f4;color:#000}.badge-cyan{background-color:#00bcd4;color:#000}.badge-teal{background-color:#009688;color:#fff}.badge-green{background-color:#4caf50;color:#fff}.badge-light-green{background-color:#8bc34a;color:#000}.badge-lime{background-color:#cddc39;color:#000}.badge-yellow{background-color:#ffeb3b;color:#000}.badge-amber{background-color:#ffc107;color:#000}.badge-orange{background-color:#ff9800;color:#000}.badge-deep-orange{background-color:#ff5722;color:#fff}.badge-brown{background-color:#795548;color:#fff}.badge-grey{background-color:#9e9e9e;color:#000}.badge-blue-grey{background-color:#607d8b;color:#fff}.btn-red{background-color:#f44336;color:#fff}.btn-pink{background-color:#e91e63;color:#fff}.btn-purple{background-color:#9c27b0;color:#fff}.btn-deep-purple{background-color:#673ab7;color:#fff}.btn-indigo{background-color:#3f51b5;color:#fff}.btn-blue{background-color:#2196f3;color:#fff}.btn-light-blue{background-color:#03a9f4;color:#000}.btn-cyan{background-color:#00bcd4;color:#000}.btn-teal{background-color:#009688;color:#fff}.btn-green{background-color:#4caf50;color:#fff}.btn-light-green{background-color:#8bc34a;color:#000}.btn-lime{background-color:#cddc39;color:#000}.btn-yellow{background-color:#ffeb3b;color:#000}.btn-amber{background-color:#ffc107;color:#000}.btn-orange{background-color:#ff9800;color:#000}.btn-deep-orange{background-color:#ff5722;color:#fff}.btn-brown{background-color:#795548;color:#fff}.btn-grey{background-color:#9e9e9e;color:#000}.btn-blue-grey{background-color:#607d8b;color:#fff}.bg-red{background-color:#f44336}.bg-pink{background-color:#e91e63}.bg-purple{background-color:#9c27b0}.bg-deep-purple{background-color:#673ab7}.bg-indigo{background-color:#3f51b5}.bg-blue{background-color:#2196f3}.bg-light-blue{background-color:#03a9f4}.bg-cyan{background-color:#00bcd4}.bg-teal{background-color:#009688}.bg-green{background-color:#4caf50}.bg-light-green{background-color:#8bc34a}.bg-lime{background-color:#cddc39}.bg-yellow{background-color:#ffeb3b}.bg-amber{background-color:#ffc107}.bg-orange{background-color:#ff9800}.bg-deep-orange{background-color:#ff5722}.bg-brown{background-color:#795548}.bg-grey{background-color:#9e9e9e}.bg-blue-grey{background-color:#607d8b}.list-group-item-red{background-color:#f44336;color:#fff}.list-group-item-pink{background-color:#e91e63;color:#fff}.list-group-item-purple{background-color:#9c27b0;color:#fff}.list-group-item-deep-purple{background-color:#673ab7;color:#fff}.list-group-item-indigo{background-color:#3f51b5;color:#fff}.list-group-item-blue{background-color:#2196f3;color:#fff}.list-group-item-light-blue{background-color:#03a9f4;color:#000}.list-group-item-cyan{background-color:#00bcd4;color:#000}.list-group-item-teal{background-color:#009688;color:#fff}.list-group-item-green{background-color:#4caf50;color:#fff}.list-group-item-light-green{background-color:#8bc34a;color:#000}.list-group-item-lime{background-color:#cddc39;color:#000}.list-group-item-yellow{background-color:#ffeb3b;color:#000}.list-group-item-amber{background-color:#ffc107;color:#000}.list-group-item-orange{background-color:#ff9800;color:#000}.list-group-item-deep-orange{background-color:#ff5722;color:#fff}.list-group-item-brown{background-color:#795548;color:#fff}.list-group-item-grey{background-color:#9e9e9e;color:#000}.list-group-item-blue-grey{background-color:#607d8b;color:#fff}.border-red{border-color:#f44336;border-width:1px}.border-pink{border-color:#e91e63;border-width:1px}.border-purple{border-color:#9c27b0;border-width:1px}.border-deep-purple{border-color:#673ab7;border-width:1px}.border-indigo{border-color:#3f51b5;border-width:1px}.border-blue{border-color:#2196f3;border-width:1px}.border-light-blue{border-color:#03a9f4;border-width:1px}.border-cyan{border-color:#00bcd4;border-width:1px}.border-teal{border-color:#009688;border-width:1px}.border-green{border-color:#4caf50;border-width:1px}.border-light-green{border-color:#8bc34a;border-width:1px}.border-lime{border-color:#cddc39;border-width:1px}.border-yellow{border-color:#ffeb3b;border-width:1px}.border-amber{border-color:#ffc107;border-width:1px}.border-orange{border-color:#ff9800;border-width:1px}.border-deep-orange{border-color:#ff5722;border-width:1px}.border-brown{border-color:#795548;border-width:1px}.border-grey{border-color:#9e9e9e;border-width:1px}.border-blue-grey{border-color:#607d8b;border-width:1px}.text-red{color:#f44336}.text-pink{color:#e91e63}.text-purple{color:#9c27b0}.text-deep-purple{color:#673ab7}.text-indigo{color:#3f51b5}.text-blue{color:#2196f3}.text-light-blue{color:#03a9f4}.text-cyan{color:#00bcd4}.text-teal{color:#009688}.text-green{color:#4caf50}.text-light-green{color:#8bc34a}.text-lime{color:#cddc39}.text-yellow{color:#ffeb3b}.text-amber{color:#ffc107}.text-orange{color:#ff9800}.text-deep-orange{color:#ff5722}.text-brown{color:#795548}.text-grey{color:#9e9e9e}.text-blue-grey{color:#607d8b} + diff --git a/public/static/signup.js b/public/static/signup.js index 50ca076..937bb6f 100644 --- a/public/static/signup.js +++ b/public/static/signup.js @@ -4,13 +4,68 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +$("#add_camper").click(function () { + var copyfrom = $("#camper_list .person-list-item").first(); + $.get("parts/template_person.php", { + type: "camper", + lastname: $("input[name=lastname]", copyfrom).val(), + parentname: $("input[name=parentname]", copyfrom).val(), + address: $("input[name=address]", copyfrom).val(), + zip: $("input[name=zip]", copyfrom).val(), + phone1: $("input[name=phone1]", copyfrom).val(), + phone2: $("input[name=phone2]", copyfrom).val(), + email: $("input[name=email]", copyfrom).val(), + unit: $("input[name=unit]", copyfrom).val() + }, function (resp) { + $("#camper_list").append(resp); + updateTotal(); + }); +}); + +$("#add_adult").click(function () { + var copyfrom = $("#adult_list .person-list-item").first(); + $.get("parts/template_person.php", { + type: "adult", + lastname: $("input[name=lastname]", copyfrom).val(), + address: $("input[name=address]", copyfrom).val(), + zip: $("input[name=zip]", copyfrom).val(), + phone1: $("input[name=phone1]", copyfrom).val(), + phone2: $("input[name=phone2]", copyfrom).val(), + email: $("input[name=email]", copyfrom).val() + }, function (resp) { + $("#adult_list").append(resp); + updateTotal(); + }); +}); -$("#add_child_row").click(function () { - $.get("parts/template_child_entry.php", {}, function (resp) { - $("#child_list").append(resp); +$("#add_youth").click(function () { + var copyfrom = $("#youth_list .person-list-item").first(); + $.get("parts/template_person.php", { + type: "youth", + lastname: $("input[name=lastname]", copyfrom).val(), + address: $("input[name=address]", copyfrom).val(), + zip: $("input[name=zip]", copyfrom).val(), + parentname: $("input[name=parentname]", copyfrom).val(), + phone2: $("input[name=phone2]", copyfrom).val(), + email: $("input[name=email]", copyfrom).val() + }, function (resp) { + $("#youth_list").append(resp); + updateTotal(); }); }); +$("#camper_list").on("change", "input[name=firstname]", function () { + updateTotal(); +}); + +function updateTotal() { + totalcharge = $(".person-list-item[data-persontype=camper] input[name=firstname]").filter(function () { + return $(this).val() != ''; + }).length * 50.0; + + $("#total").text(totalcharge); +} + // Create a Stripe client. var stripe = Stripe(stripe_pubkey); @@ -34,18 +89,22 @@ card.addEventListener('change', function (event) { }); $("#savebutton").click(function (event) { - var form = $("#membershipform"); + var form = $("#registrationform"); + console.log("Validating..."); if (form[0].checkValidity() === false) { + console.log("Invalid!"); event.preventDefault() event.stopPropagation() } form.addClass('was-validated'); }); -$("#membershipform").on("submit", function (event) { + +$("#registrationform").on("submit", function (event) { event.preventDefault(); + // prevent multiple clicks since Stripe can take a few seconds $("#savebutton").prop("disabled", true); $("#savebutton-text").addClass("d-none"); diff --git a/public/static/solid.min.js b/public/static/solid.min.js new file mode 100644 index 0000000..89b8a5f --- /dev/null +++ b/public/static/solid.min.js @@ -0,0 +1 @@ +!function(){"use strict";var c={},h={};try{"undefined"!=typeof window&&(c=window),"undefined"!=typeof document&&(h=document)}catch(c){}var l=(c.navigator||{}).userAgent,v=void 0===l?"":l,z=c,s=h,M=(z.document,!!s.documentElement&&!!s.head&&"function"==typeof s.addEventListener&&s.createElement,~v.indexOf("MSIE")||v.indexOf("Trident/"),"___FONT_AWESOME___"),m=function(){try{return!0}catch(c){return!1}}();var H=z||{};H[M]||(H[M]={}),H[M].styles||(H[M].styles={}),H[M].hooks||(H[M].hooks={}),H[M].shims||(H[M].shims=[]);var a=H[M];function V(c,v){var h=(2 [ "type" => "mysql", - "name" => "hachemembers", + "name" => "campportal", "server" => "localhost", "user" => "", "password" => "", "charset" => "utf8" ], // Name of the app. - "site_title" => "Membership Portal", + "site_title" => "Camp Portal", "stripe" => [ "pubkey" => "", "seckey" => ""