From 409e32659b957700360f1e5b4e1fbf3c7d9fa0c8 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sun, 17 Feb 2019 19:40:33 -0700 Subject: [PATCH] Initial commit --- .gitignore | 4 + License | 29 ++ addPicture.php | 181 +++++++++ admin-template.php | 94 +++++ admin.php | 795 ++++++++++++++++++++++++++++++++++++ appReadMeFirst.php | 245 +++++++++++ applicationForm.php | 98 +++++ applicationFormUtils.php | 432 ++++++++++++++++++++ attendance.php | 206 ++++++++++ canteen.php | 96 +++++ classes.php | 199 +++++++++ courseEditor.php | 430 ++++++++++++++++++++ courses.php | 88 ++++ director-template.php | 94 +++++ director.php | 94 +++++ index.php | 130 ++++++ ipn/PaypalIPN.php | 143 +++++++ ipn/ipn.php | 423 +++++++++++++++++++ licence.php | 128 ++++++ login.php | 135 +++++++ logout.php | 96 +++++ member.php | 86 ++++ memberEditor.php | 810 +++++++++++++++++++++++++++++++++++++ memberList.php | 118 ++++++ memberMeeting.php | 117 ++++++ members-protospace-ca.svg | 40 ++ members-protospace-ca2.svg | 66 +++ members.css | 416 +++++++++++++++++++ membersAlt.css | 356 ++++++++++++++++ menu.css | 38 ++ menu0.css | 70 ++++ menu1.css | 85 ++++ new-transaciton.php | 97 +++++ password-reset.php | 283 +++++++++++++ pitches.php | 97 +++++ preferences.php | 482 ++++++++++++++++++++++ processIPNs.php | 169 ++++++++ signup.php | 530 ++++++++++++++++++++++++ storage.php | 102 +++++ text.php | 129 ++++++ toolActivation.php | 212 ++++++++++ toolAuth.php | 92 +++++ trainerAuthorizations.php | 135 +++++++ training.php | 214 ++++++++++ transactionEditor.php | 316 +++++++++++++++ transactions.php | 95 +++++ userCourses.php | 111 +++++ userpage-template.php | 97 +++++ utilities.php | 118 ++++++ 49 files changed, 9621 insertions(+) create mode 100644 .gitignore create mode 100644 License create mode 100644 addPicture.php create mode 100644 admin-template.php create mode 100644 admin.php create mode 100644 appReadMeFirst.php create mode 100644 applicationForm.php create mode 100644 applicationFormUtils.php create mode 100644 attendance.php create mode 100644 canteen.php create mode 100644 classes.php create mode 100644 courseEditor.php create mode 100644 courses.php create mode 100644 director-template.php create mode 100644 director.php create mode 100644 index.php create mode 100644 ipn/PaypalIPN.php create mode 100644 ipn/ipn.php create mode 100644 licence.php create mode 100644 login.php create mode 100644 logout.php create mode 100644 member.php create mode 100644 memberEditor.php create mode 100644 memberList.php create mode 100644 memberMeeting.php create mode 100644 members-protospace-ca.svg create mode 100644 members-protospace-ca2.svg create mode 100644 members.css create mode 100644 membersAlt.css create mode 100644 menu.css create mode 100644 menu0.css create mode 100644 menu1.css create mode 100644 new-transaciton.php create mode 100644 password-reset.php create mode 100644 pitches.php create mode 100644 preferences.php create mode 100644 processIPNs.php create mode 100644 signup.php create mode 100644 storage.php create mode 100644 text.php create mode 100644 toolActivation.php create mode 100644 toolAuth.php create mode 100644 trainerAuthorizations.php create mode 100644 training.php create mode 100644 transactionEditor.php create mode 100644 transactions.php create mode 100644 userCourses.php create mode 100644 userpage-template.php create mode 100644 utilities.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d599e79 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +realData/* +pictures/* +usercss/* +setup/* diff --git a/License b/License new file mode 100644 index 0000000..b4c120f --- /dev/null +++ b/License @@ -0,0 +1,29 @@ +Copyright 2018 Murray Hayes + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/addPicture.php b/addPicture.php new file mode 100644 index 0000000..8ebbb50 --- /dev/null +++ b/addPicture.php @@ -0,0 +1,181 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + $_SESSION['subNav'] = NULL; + $body->appendChild(generateSelectedMenuBar($doc)); + + + /* + * Insert content here. + */ + + $editorDiv = $doc->createElement('div'); + //$editorDiv->setAttribute('id', 'CourseEditorDiv'); + $form = createForm($doc, 'addPicture.php'); + $img = NULL; + if (is_null($targetID)) + $img = returnPictureForMember($_SESSION['MemberID']); + else + if (returnAdminStatus($_SESSION['MemberID']) || returnDirectorStatus($_SESSION['MemberID'])) + { + $img = returnPictureForMember($targetID); + $form->appendChild(createHiddenInput($doc, 'target', $targetID)); + } + if (!is_null($img)) + { + $label = $doc->createElement('H3'); + $label->appendChild($doc->createTextNode("Current picture")); + $form->appendChild($label); + $form->appendChild(createBr($doc)); + $form->appendChild(createImg($doc, $pictureDir . $img)); + } + $label = $doc->createElement('H3'); + $label->appendChild($doc->createTextNode("Add a picture")); + $form->appendChild($label); + $fieldSet = $doc->createElement('fieldset'); + //$fieldSet->setAttribute('style', 'width:200px; max-width:300px;'); //margin-top:0.5em;'); + $fieldSetDiv = $doc->createElement('div'); + + $label = $doc->createElement('label', 'File:'); + $label->setAttribute('for', 'filename'); + $label->setAttribute('class', 'CourseEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'file'); + $input->setAttribute('name', 'filename'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'submit'); + $input->setAttribute('value', 'upload'); + $input->setAttribute('name', 'submit'); + + $fieldSetDiv->appendChild($input); + + $form->appendChild($fieldSetDiv); + $editorDiv->appendChild($form); + $body->appendChild($editorDiv); + + + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + outputDoc($doc); + } +else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/admin-template.php b/admin-template.php new file mode 100644 index 0000000..5ed7226 --- /dev/null +++ b/admin-template.php @@ -0,0 +1,94 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + $_SESSION['subNav'] = 1; + $body->appendChild(generateSelectedMenuBar($doc, 1)); + + + /* + * Insert content here. + */ + + + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + outputDoc($doc); + } +else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..b7c6850 --- /dev/null +++ b/admin.php @@ -0,0 +1,795 @@ +beginTransaction(); + //$sth = $dbh->prepare("SELECT * FROM members WHERE id = ?"); + $sth = $dbh->prepare($statement204); + $count = 0; + if ($sth->execute(array($_POST['id']))) + { + if ($row = $sth->fetch(PDO::FETCH_ASSOC)) + { + if (($row['first_name'] === $_POST['first_name']) && ($row['last_name'] === $_POST['last_name'])) + { + //print_r($_POST); + + if (isset($_POST['Vet_Now']) && ($_POST['Vet_Now'] === "Vet Now")) + { + //print ("Vetting..."); + $stb = $dbh->prepare($statement287); + $stb->execute(array($_POST['id'], $_POST['first_name'], $_POST['last_name'])); + } + else + { + /* + * All optional variable need to be checked. + */ + if (isset($_POST['current_start'])) + $currStart = $_POST['current_start']; + else + if (isset($row['current_start_date'])) + $currStart = $row['current_start_date']; + else + $currStart = ""; + if (isset($_POST['street_address'])) + $streetAddr = $_POST['street_address']; + else + if (isset($row['street_address'])) + $streetAddr = $row['street_address']; + else + $streetAddr = ""; + if (isset($_POST['guardian'])) + $guardian = $_POST['guardian']; + else + $guardian = ""; + if (isset($_POST['emergency_contact_name'])) + $emergContactName = $_POST['emergency_contact_name']; + else + $emergContactName = ""; + if (isset($_POST['emergency_contact_number'])) + $emergContactNumber = $_POST['emergency_contact_number']; + else + $emergContactNumber = ""; + if (isset($_POST['instructor'])) + $instCheck = TRUE; + else + $instCheck = FALSE; + if (isset($_POST['administrator'])) + $adminCheck = TRUE; + else + $adminCheck = FALSE; + if (isset($_POST['director'])) + $dirCheck = TRUE; + else + $dirCheck = FALSE; + if (isset($_POST['minor'])) + $minorCheck = TRUE; + else + $minorCheck = FALSE; + /* + $sth = $dbh->prepare("UPDATE members SET preferred_name = ?, nickname = ?, email = ?, expire_date = ?, " . + "current_start_date = ?, application_date = ?, status = ?, monthly_fees = ?, proto_cash = ?, " . + "minor = ?, birthdate = ?, guardian_name = ?, street_address = ?, city = ?, province = ?, " . + "postal_code = ?, phone = ?, emergency_contact_name = ?, emergency_contact_phone = ?, " . + "new_member_notes = ?, instructor = ?, administrator = ?, director = ? WHERE id = ? AND first_name = ? " . + "AND last_name = ?"); + */ + //print ("curr start: " . $currStart); + $sth = $dbh->prepare($statement222); + $sth->execute(array($_POST['prefered_name'], $_POST['nick_name'], $_POST['email'], $_POST['expire'], + $currStart, $_POST['application_date'], $_POST['status'], $_POST['monthly_fees'], + $_POST['proto_cash'], $minorCheck, $_POST['birth_date'], $_POST['guardian'], $streetAddr, + $_POST['city'], $_POST['province'], $_POST['postal_code'], $_POST['phone'], $emergContactName, + $emergContactNumber, $_POST['member_notes'], $instCheck, $adminCheck, + $dirCheck, $row['id'], $row['first_name'], $row['last_name'])); + } + } + } + } + } + catch (Exception $e) + { + print ("Fail! " . $e->getMessage() . "\n"); + } + } + + $root = $doc->appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + /* + $body->appendChild(generateMemberNavigationBar($doc)); + + + $body->appendChild(generateAdminNavigationBar($doc)); + $_SESSION['sub_nav'] = "Admin";*/ + + $_SESSION['subNav'] = 1; + $body->appendChild(generateSelectedMenuBar($doc, 1)); + + $tableDiv = $doc->createElement('div'); + //$tableDiv->setAttribute('display', 'block'); + $tableDiv->setAttribute('class', 'FloatLeft50Div'); + $table = $doc->createElement('table'); + //$table.setAttribute('class' + //$table->setAttribute('class', 'FloatLeft50Div'); + $thead = $doc->createElement('thead'); + $tr = $doc->createElement('tr'); + + $th = $doc->createElement('th'); + $a = $doc->createElement('a'); + $a->appendChild($doc->createTextNode('ID')); + $th->appendChild($a); + $tr->appendChild($th); + + $th = $doc->createElement('th'); + $a = $doc->createElement('a'); + $a->appendChild($doc->createTextNode('First Name')); + $th->appendChild($a); + $tr->appendChild($th); + + $th = $doc->createElement('th'); + $a = $doc->createElement('a'); + $a->appendChild($doc->createTextNode('Last Name')); + $th->appendChild($a); + $tr->appendChild($th); + + $th = $doc->createElement('th'); + $th->appendChild($doc->createTextNode('Vetted')); + $tr->appendChild($th); + + $th = $doc->createElement('th'); + $th->appendChild($doc->createTextNode('Status')); + $tr->appendChild($th); + + $thead->appendChild($tr); + $table->appendChild($thead); + + $tbody = $doc->createElement('tbody'); + + $tint = false; + + $edit = NULL; + + try + { + //print_r(PDO::getAvailableDrivers()); + $dbh = returnDatabaseHandel(); + $dbh->beginTransaction(); + //$sth = $dbh->prepare("SELECT * FROM members"); /* SORT BY first_name;*/ + $sth = $dbh->prepare($statement101); + $count = 0; + if ($sth->execute()) + { + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) + { + if (isset($_GET['id'])) + if ($row['id'] === $_GET['id']) + $edit = $row; + + $count++; + $tr = $doc->createElement('tr'); + + /* + if ($tint === true) + { + $tr->setAttribute('class', 'AlternateRow'); + }*/ + /* + + try + { + $stg = $dbh->prepare("SELECT name FROM courses WHERE id = ?"); + if ($stg->execute(array($row['course_id']))) + { + $innerRow = $stg->fetch(PDO::FETCH_ASSOC); + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($innerRow['name'])); + $tr->appendChild($td); + } + } + catch (Exception $f) + { + echo "Fail! " . $f->getMessage() . "\n"; + } + */ + /* + $tint = !$tint; + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($course['Subject'])); + $tr->appendChild($td);*/ + + $td = $doc->createElement('td'); + $rr = $doc->createElement('a'); + $rr->setAttribute('href', "admin.php?id=${row['id']}"); + $rr->appendChild($doc->createTextNode($row['id'])); + $td->appendChild($rr); + $tr->appendChild($td); + +/* + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($row['id'])); + $tr->appendChild($td);*/ + + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($row['first_name'])); + $tr->appendChild($td); + + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($row['last_name'])); //$row['Confirmed'])); + $tr->appendChild($td); + + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($row['vetted_date'])); //$course['Open'])); + $tr->appendChild($td); + + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode(returnMemberStatusByID($row['id']))); //$course['Open'])); + $tr->appendChild($td); + +/* $rr = $doc->createElement('a'); + $rr->setAttribute('href', "admin.php?id=${row['id']}"); + $rr->appendChild($tr);*/ + + $tbody->appendChild($tr); + } + } + $table->appendChild($tbody); + $tableDiv->appendChild($table); + $body->appendChild($tableDiv); + + } + catch (Exception $e) + { + echo "Failed!" . $e->getMessage() . "\n"; + } + + + if (!($edit === NULL)) + { + $editorDiv = $doc->createElement('div'); + $editorDiv->setAttribute('id', 'MemberEditorDiv'); + $titleSpan = createSpan($doc); + $label = $doc->createElement('H3'); + $label->appendChild($doc->createTextNode($edit['first_name'] . " " . $edit['middle_name'] . " " . $edit['last_name'])); + $picture = returnPictureForMember($edit['id']); + + + if (!is_null($picture)) + { + $img = createImg($doc, $pictureDir . $picture, $edit['first_name'] . " " . $edit['last_name'], "MemberEditorIconPicture"); + $label->appendChild($img); + } + + $titleSpan->appendChild($label); + $editorDiv->appendChild($titleSpan); + + $form = createForm($doc, 'password-reset.php', 'GET'); + + $input = createHiddenInput($doc, 'id', (string)$edit['id'], NULL, NULL, TRUE); + $form->appendChild($input); + $input = createSubmitInput($doc, $text0012, $text0012, NULL, NULL); + $form->appendChild($input); + $editorDiv->appendChild($form); + + $form = createForm($doc, 'addPicture.php', 'POST'); + $input = createHiddenInput($doc, 'target', (string)$edit['id'], NULL, NULL, TRUE); + $form->appendChild($input); + $input = createSubmitInput($doc, 'Change Picture', 'Change Picture'); + $form->appendChild($input); + $editorDiv->appendChild($form); + + /* + $form = $doc->createElement('form'); + $form->setAttribute('action', 'admin.php'); + $form->setAttribute('method', 'post'); + */ + $form = createForm($doc, 'admin.php'); + + $input = createHiddenInput($doc, 'id', $edit['id'], NULL, NULL, TRUE); + $form->appendChild($input); + + $input = createHiddenInput($doc, 'first_name', $edit['first_name'], NULL, NULL, TRUE); + $form->appendChild($input); + + $input = createHiddenInput($doc, 'last_name', $edit['last_name'], NULL, NULL, TRUE); + $form->appendChild($input); + + $fieldSet = $doc->createElement('fieldset'); + //$fieldSet->setAttribute('style', 'width:200px; max-width:300px;'); //margin-top:0.5em;'); + $fieldSetDiv = $doc->createElement('div'); + + $label = $doc->createElement('label', 'Prefered Name:'); + $label->setAttribute('for', 'prefered_name'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'prefered_name'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['prefered_name'])) + $input->setAttribute('value', $edit['prefered_name']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Nick Name:'); + $label->setAttribute('for', 'nick_name'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'nick_name'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['nick_name'])) + $input->setAttribute('value', $edit['nick_name']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'EMail Address:'); + $label->setAttribute('for', 'email'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'email'); + $input->setAttribute('name', 'email'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('class', 'MemberEditorInputField'); + if (isset($edit['email'])) + $input->setAttribute('value', $edit['email']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Expiration Date:'); + $label->setAttribute('for', 'expire'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'expire'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['expire_date'])) + $input->setAttribute('value', $edit['expire_date']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Current Start Date:'); + $label->setAttribute('for', 'current_start'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'current_start'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['current_start_date'])) + $input->setAttribute('value', $edit['current_start_date']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Application Date:'); + $label->setAttribute('for', 'application_date'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'application_date'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['application_date'])) + $input->setAttribute('value', $edit['application_date']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Vetted Date:'); + $label->setAttribute('for', 'vetted'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + + $now = date_create('now'); + $startDate = date_create($edit['current_start_date']); //, $dbDateFormat); + $startDate = date_add($startDate, DateInterval::createFromDateString('4 weeks')); + $expireDate = date_create($edit['expire_date']); + if (isset($edit['vetted_date'])) + { + if (is_null($edit['vetted_date'])) + { + if (($startDate < $now) && ($now < $expireDate)) + { + $input = createSubmitInput($doc, 'Vet Now', 'Vet Now'); + $fieldSetDiv->appendChild($input); + } + else + { + $input = createSubmitInput($doc, 'Not Vetable', 'Not Vetable'); + $fieldSetDiv->appendChild($input); + } + } + else + { + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'vetted'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['vetted_date'])) + $input->setAttribute('value', $edit['vetted_date']); + //$input->setAttribute('required', 'required'); + $input->setAttribute('readonly', 'readonly'); + } + $fieldSetDiv->appendChild($input); + } + else + { + if (($startDate < $now) && ($now < $expireDate)) + { + $input = createSubmitInput($doc, 'Vet Now', 'Vet Now'); + $fieldSetDiv->appendChild($input); + } + else + { + $input = createSubmitInput($doc, 'Not Vetable', 'Not Vetable'); + $fieldSetDiv->appendChild($input); + } + } + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Status:'); + $label->setAttribute('for', 'status'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'status'); + //$input->setAttribute('autocomplete', 'off'); + if (isset($edit['status'])) + $input->setAttribute('value', $edit['status']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Monthly Fees:'); + $label->setAttribute('for', 'monthly_fees'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'number'); + $input->setAttribute('name', 'monthly_fees'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('step', '0.01'); + $input->setAttribute('pattern', '^\d+(\.|\,)\d{2}$'); + if (isset($edit['monthly_fees'])) + $input->setAttribute('value', $edit['monthly_fees']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Protospace Cash:'); + $label->setAttribute('for', 'proto_cash'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'number'); + $input->setAttribute('name', 'proto_cash'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['proto_cash'])) + $input->setAttribute('value', $edit['proto_cash']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Minor:'); + $label->setAttribute('for', 'minor'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'checkbox'); + $input->setAttribute('name', 'minor'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['minor'])) + $input->setAttribute('checked', 'checked'); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Birth Date:'); + $label->setAttribute('for', 'birth_date'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'birth_date'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['birth_date'])) + $input->setAttribute('value', $edit['birth_date']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Guardian:'); + $label->setAttribute('for', 'guardian'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'guardian'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['guardian'])) + $input->setAttribute('value', $edit['guardian']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Street Address:'); + $label->setAttribute('for', 'address'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'address'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['street_address'])) + $input->setAttribute('value', $edit['street_address']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'City:'); + $label->setAttribute('for', 'city'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'city'); + //$input->setAttribute('autocomplete', 'off'); + if (isset($edit['city'])) + $input->setAttribute('value', $edit['city']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Province:'); + $label->setAttribute('for', 'province'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'province'); + //$input->setAttribute('autocomplete', 'off'); + if (isset($edit['province'])) + $input->setAttribute('value', $edit['province']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Postal Code:'); + $label->setAttribute('for', 'postal_code'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'postal_code'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['postal_code'])) + $input->setAttribute('value', $edit['postal_code']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Phone:'); + $label->setAttribute('for', 'phone'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'phone'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['phone'])) + $input->setAttribute('value', $edit['phone']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Emergency Contact Name:'); + $label->setAttribute('for', 'emergency_name'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'emergency_name'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['emergency_contact_name'])) + $input->setAttribute('value', $edit['emergency_contact_name']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Emergency Contact Number:'); + $label->setAttribute('for', 'emergency_number'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'emergency_number'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['emergency_contact_number'])) + $input->setAttribute('value', $edit['emergency_contact_number']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Instructor:'); + $label->setAttribute('for', 'instructor'); + $label->setAttribute('class', 'MemberEditorInputLabelTight'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'checkbox'); + $input->setAttribute('name', 'instructor'); + $input->setAttribute('class', 'MemberEditorInputFieldTight'); + $input->setAttribute('autocomplete', 'off'); + if (returnInstructorStatus($edit['id'])) + $input->setAttribute('checked', 'checked'); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + + $label = $doc->createElement('label', 'Administrator:'); + $label->setAttribute('for', 'administrator'); + $label->setAttribute('class', 'MemberEditorInputLabelTight'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'checkbox'); + $input->setAttribute('name', 'administrator'); + $input->setAttribute('class', 'MemberEditorInputFieldTight'); + $input->setAttribute('autocomplete', 'off'); + if (returnAdminStatus($edit['id'])) + $input->setAttribute('checked', 'checked'); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + + $label = $doc->createElement('label', 'Director:'); + $label->setAttribute('for', 'director'); + $label->setAttribute('class', 'MemberEditorInputLabelTight'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'checkbox'); + $input->setAttribute('name', 'director'); + $input->setAttribute('class', 'MemberEditorInputFieldTight'); + $input->setAttribute('autocomplete', 'off'); + if (returnDirectorStatus($edit['id'])) + $input->setAttribute('checked', 'checked'); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + + $label = $doc->createElement('label', 'Member Notes:'); + $label->setAttribute('for', 'member_notes'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'textarea'); + $input->setAttribute('name', 'member_notes'); + $input->setAttribute('rows', '3'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['member_notes'])) + $input->setAttribute('value', $edit['member_notes']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $fieldSet->appendChild($fieldSetDiv); + + $form->appendChild($fieldSet); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'reset'); + $form->appendChild($input); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'submit'); + $form->appendChild($input); + $editorDiv->appendChild($form); + $body->appendChild($editorDiv); + } + + $body->appendChild(generateFooter($doc)); + + outputDoc($doc); + } + else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/appReadMeFirst.php b/appReadMeFirst.php new file mode 100644 index 0000000..0fca865 --- /dev/null +++ b/appReadMeFirst.php @@ -0,0 +1,245 @@ +appendChild($root); + +$root->appendChild(generateHead($doc)); + +$body = $doc->createElement('body'); +$root->appendChild($body); + +$mastHead = $doc->createElement('h1'); +$mastHead->appendChild($doc->createTextNode("Read Me")); +$mastHead->setAttribute('class', 'mastHead'); +$body->appendChild($mastHead); + +$div = $doc->createElement('div'); +$div->setAttribute('class', 'readMe'); +$body->appendChild($div); + +$str = <<createElement('p'); +$para->appendChild($doc->createTextNode($str)); +$div->appendChild($para); + +$str = <<createElement('h3'); +$header->appendChild($doc->createTextNode('consts.php')); +$div->appendChild($header); +$para = $doc->createElement('p'); +$para->appendChild($doc->createTextNode($str)); +$div->appendChild($para); + + +$str = <<createElement('h3'); +$header->appendChild($doc->createTextNode('sql.php')); +$div->appendChild($header); +$para = $doc->createElement('p'); +$para->appendChild($doc->createTextNode($str)); +$div->appendChild($para); + +$str = <<createElement('h3'); +$header->appendChild($doc->createTextNode('database.php')); +$div->appendChild($header); +$para = $doc->createElement('p'); +$para->appendChild($doc->createTextNode($str)); +$div->appendChild($para); + +$str = <<createElement('h3'); +$header->appendChild($doc->createTextNode('utils.php')); +$div->appendChild($header); +$para = $doc->createElement('p'); +$para->appendChild($doc->createTextNode($str)); +$div->appendChild($para); + +$str = <<createElement('h3'); +$header->appendChild($doc->createTextNode('DOMUtils.php')); +$div->appendChild($header); +$para = $doc->createElement('p'); +$para->appendChild($doc->createTextNode($str)); +$div->appendChild($para); + + +$str = <<createElement('h3'); +$header->appendChild($doc->createTextNode('setup.php')); +$div->appendChild($header); +$para = $doc->createElement('p'); +$para->appendChild($doc->createTextNode($str)); +$div->appendChild($para); + +$str = <<createElement('h3'); +$header->appendChild($doc->createTextNode('formUtils.php')); +$div->appendChild($header); +$para = $doc->createElement('p'); +$para->appendChild($doc->createTextNode($str)); +$div->appendChild($para); + +$str = <<createElement('h3'); +$header->appendChild($doc->createTextNode('*-template.php')); +$div->appendChild($header); +$para = $doc->createElement('p'); +$para->appendChild($doc->createTextNode($str)); +$div->appendChild($para); + +$str = <<createElement('h3'); +$header->appendChild($doc->createTextNode('applicationForm.php')); +$div->appendChild($header); +$para = $doc->createElement('p'); +$para->appendChild($doc->createTextNode($str)); +$div->appendChild($para); + + +$str = <<createElement('h3'); +$header->appendChild($doc->createTextNode('other php files')); +$div->appendChild($header); +$para = $doc->createElement('p'); +$para->appendChild($doc->createTextNode($str)); +$div->appendChild($para); + +$str = <<createElement('h3'); +$header->appendChild($doc->createTextNode('members.css')); +$div->appendChild($header); +$para = $doc->createElement('p'); +$para->appendChild($doc->createTextNode($str)); +$div->appendChild($para); + +$str = <<createElement('h3'); +$header->appendChild($doc->createTextNode('End Of Line')); +$div->appendChild($header); +$para = $doc->createElement('p'); +$para->appendChild($doc->createTextNode($str)); +$div->appendChild($para); + + +outputDoc($doc); + +?> diff --git a/applicationForm.php b/applicationForm.php new file mode 100644 index 0000000..f7531c5 --- /dev/null +++ b/applicationForm.php @@ -0,0 +1,98 @@ +Output(); + + + //generateForm($_SESSION['MemberID']); + /* + $root = $doc->appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + $body->appendChild(generateMemberNavigationBar($doc)); + $body->appendChild(generateAdminNavigationBar($doc)); + +*/ + + /* + * Insert content here. + */ + +/* + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + echo $doc->saveXML(); + */ + } + else + { + $pdf = new ApplicationForm(getMemberRowData($_SESSION['MemberID'])); + $pdf->Output(); + } + else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/applicationFormUtils.php b/applicationFormUtils.php new file mode 100644 index 0000000..cb0afe8 --- /dev/null +++ b/applicationFormUtils.php @@ -0,0 +1,432 @@ +createElement('html'); + */ + +class ApplicationForm extends FPDF +{ + private $memberData = NULL; + private $inset = 5; + private $topMargin = 2.5; + + + function __construct($data) + { + global $timeZone; + parent::__construct("P", "mm", "Letter"); + + date_default_timezone_set($timeZone); + $doubleNewLine = "\n\n"; + $initial = "\n\n\n(initial)"; + $firstLine = "I confirm that the information I have provided is true and correct. I promise to be excellent to people."; + $secondLine = 'I am aware of, and will abide by, the member responsibilities listed in the Bylaws of Calgary Protospace, Ltd. I have signed or will sign a "Release of Liability, Waiver of Claims, Assumption of Risks and Indemnity Agreement". I release Calgary Protospace Limited, its members, directors, staff and agents from any and all liability arising out of this application, my use of equipment, tools or space at Protospace and my participation in any Protospace program, facility or event."'; + $thirdLine = "I agree to pay the required dues for membership. I understand that failure to do this may result in termination of my membership. I understand that dues will continue to be charged unless I request to end my membership."; + $fourthLine = "I am also aware that my application is subject to review and a probationary period before my membership becomes active"; + + $riskOne = 'I acknowledge that inherent risks, dangers and hazards exist when using hand tools, power tools, supplies, and other equipment commonly used in electronics construction, fabrication, software design and other activities hosted by Calgary Protospace Inc. ("Protospace"). Participation in such activities and/or the use of equipment associated with technology design, manufacture and experimentation may result in injury, illness, death or damage to personal property. These risks and dangers may be caused by other people, including Protospace members, participants, or guests, or by accidents, acts of nature or other causes. Risks and dangers may arise from foreseeable or unforeseeable causes including, but not limited to, electrocution, burns, impalement, and injury from slips or falls.'; + $riskTwo = "I am responsible for my own safety during Protospace's activities. This includes ensuring that tools are in proper working order, and that tools are used safely and responsibly. I agree not to use any tools I do not know how to use. I agree not to use tools or equipment while under the influence of drugs or alcohol."; + $riskThree = "I acknowledge that a Protospace member who may be acting as my host or Sponsor and other Members of Protospace may advise me on safe work practices, but this does not constitute training, nor a supervisory relationship. I further acknowledge that responsibility for safely using Protospace's facilities, tools or equipment lies entirely on myself. Failure to follow reasonable safety protocols or wilful violation of reasonable safety protocols may result in expulsion from Protospace facilities. If I am currently a Protospace member, or become one, wilful violation of reasonable safety protocols may result in the termination of my membership and/or access rights."; + $riskFour = "Until and unless I apply for and am accepted as a full member of Calgary Protospace, I understand that as a Guest, in order to access Protospace facilities or space, I must be accompanied by a member of Protospace, and I will not seek to access nor to remain in the space unaccompanied, until and unless I have become a member and have been issued my own key, key fob, or access card."; + + $waiverZero = "In consideration of Protospace allowing me to participate in Protospace's activities, and for other good and valuable consideration, the receipt and sufficiency of which is acknowledged, I hereby agree as follows:"; + $waiverOne = "1. RELEASE OF LIABILITY: The Participant (me), fully assumes all risks associated with participation in events, and exempts and releases Protospace, its members, officers, agents, and directors, from any and all liability arising out of any damage, expense, loss or injury including death to the participant or the participant's property while upon Protospace's premises, or using any of Protospace's equipment, or while participating in any of Protospace's activities, whether such loss, damage, or injury results from the negligence of Protospace, its members, its agents, or from some other cause."; + $waiverTwo = "2. COVENANT NOT TO SUE: The Participant agrees never to institute any suit or action at law or otherwise against Protospace, its members, officers, board members, agents, nor to initiate or any way assist in the prosecution of any claim for damages or course of action that the member, member's heirs, executors or administrators hereafter may have by reason of injury to the person of the member or to the participant's property arising from the activities contemplated by this agreement."; + $waiverThree = "3. THIRD PARTY INDEMNIFICATION: The Participant will indemnify, save and hold harmless Protospace, its members, officers, directors, or agents from any and all losses, claims, actions, or proceedings of every kind and character which may be presented or initiated by any Third Party and which arise directly or indirectly from the actions of the Participant while engaged in the activities contemplated by this agreement."; + $waiverFour = "4. ACCEPTABLE SPEECH AND BEHAVIOUR: Protospace is accepting of all races, creeds, genders, orientations, religions and any other type of identifier. While Protospace is encouraging of freedom of speech and the open sharing of ideas of all types, hateful speech, harassment, threats or violence will not be tolerated. Use of Protospace or Protospace Members' equipment while intoxicated or otherwise impaired is forbidden for reasons of safety. Such actions or speech may result in consequences including warnings, membership suspension or termination, or expulsion from the facility (temporarily or permanently)."; + $waiverFive = "5. This Release Agreement shall be effective and binding upon my heirs, next of kin, executors, administrators, assigns and representatives, in the event of my death or incapacity."; + $waiverSix = "6. This Release Agreement and any rights, duties and obligations as between myself and Protospace, its members, officers, directors or agents shall be governed by and interpreted solely in accordance with the laws of Alberta and no other jurisdiction."; + $waiverSeven = "7. Any litigation involving myself and Protospace, its members, officers, directors, or agents shall be brought solely in Alberta and shall be within the exclusive jurisdiction of the Courts of Alberta."; + $waiverEight = "8. I hereby acknowledge that I have CAREFULLY read all of the provisions above, fully understand the terms and conditions expressed there, and do freely choose acceptance of the provisions of the foregoing paragraphs relating to assumption of risk, release of liability, covenant not to sue, and third party indemnification. I am aware that this is a release of liability and a contract between myself and Protospace, and sign it of my own free will."; + $waiverNine = "9. I hereby acknowledge the danger involved in participating at Protospace, and agree to assume any and all risks of bodily injury, death or property damage, whether those risks are known or unknown."; + $waiverTen = "10. I hereby acknowledge that I have been shown the safety equipment in the space."; + $waiverEleven = "In entering into this Release Agreement, I am not relying on any oral or written representations or statements made by Protospace, its members, officers, board members, or agents with the respect to the safety of Protospace's activities, other than what is set forth in this Release Agreement."; + $waiverTwelve = "I CONFIRM THAT I HAVE READ AND UNDERSTOOD THIS RELEASE AGREEMENT PRIOR TO SIGNING IT, AND I AM AWARE THAT BY SIGNING THIS RELEASE AGREEMENT I AM WAIVING CERTAIN LEGAL RIGHTS WHICH I OR MY HEIRS, NEXT OF KIN, EXECUTORS, ADMINISTRATORS, ASSIGNS, AND REPRESENTATIVES MAY HAVE AGAINST CALGARY PROTOSPACE LTD, ITS MEMBERS, OFFICERS, DIRECTORS, OR AGENTS."; + + $tour = "The following member certifies that the participant has been shown the emergency exits and safety equipment in the facility, and has been given an opportunity to examine this document and appears to understand its contents"; + $guardian = "In the case of a participant who is a minor:\nI acknowledge and agree to be bound by the terms of this agreement both for myself, and on the part of the minor named as the participant."; + + $this->SetTopMargin($this->topMargin); + $this->memberData = arrayCopy($data); + $this->AddPage(); + $this->SetFont('Arial', 'B', 20); + $this->Cell(0, 9, "Protospace Membership Application", 0, 1, "C"); + $this->Line($this->inset, 18, $this->GetPageWidth() - $this->inset, 18); + $this->SetFont('Times','',16); + $this->Cell(0, 10, "Welcome", 0, 1); + $this->SetFont('Times', '', 12); + $this->Cell($this->inset, 0, "Thank you for your interest.", 0, 1); + $this->SetY($this->GetY() + 3); + $lineX = $this->GetX(); + $lineY = $this->GetY(); + $this->drawDataEntryBox(65, 10, "First Name", $this->memberData['first_name']); + $this->drawDataEntryBox(65, 10, "Last Name", $this->memberData['last_name']); + $this->drawDataEntryBox(65, 10, "Nick Name (Optional)", $this->memberData['nickname']); + $this->SetX($lineX); + $this->SetY($lineY + 10); + $lineY = $this->GetY(); + $this->drawDataEntryBox(85, 10, "Mailing Address", $this->memberData['street_address']); + $this->drawDataEntryBox(65, 10, "City, Province", $this->memberData['city'] . ", " . $this->memberData['province']); + $this->drawDataEntryBox(45, 10, "Postal Code", $this->memberData['postal_code']); + $this->SetX($lineX); + $this->SetY($lineY + 10); + $lineY = $this->GetY(); + $this->drawDataEntryBox(105, 10, "Email Address", $this->memberData['email']); + $this->drawDataEntryBox(90, 10, "Phone Number", $this->memberData['phone']); + $this->SetX($lineX); + $this->SetY($lineY + 10); + $lineY = $this->GetY(); + $this->drawDataEntryBox(195, 10, "How did you hear about Protospace?", ""); + $this->SetX($lineX); + $this->SetY($lineY + 10); + $lineY = $this->GetY(); + $this->drawDataEntryBox(105, 10, "Emergency Contact Name (Optional)", $this->memberData['emergency_contact_name']); + $this->drawDataEntryBox(90, 10, "Emergency Contact Phone (Optional)", $this->memberData['emergency_contact_phone']); + $this->SetX($lineX + 40); + $this->SetY($lineY + 13); + $lineY = $this->GetY(); + $this->drawDataEntryBox(120, 10, "Students - Institution Name and Course of Study (Optional)", ""); + $this->SetX($lineX); + $this->SetY($lineY + 13); + $lineY = $this->GetY(); + + $this->SetFont('Arial', '', 10); + $this->Write(4, $firstLine); + $this->SetX($lineX); + $this->SetY($lineY + 8); + $lineY = $this->GetY(); + $this->Write(4, $secondLine); + $this->Write(4, $doubleNewLine); + $this->Write(4, $thirdLine); + $this->Write(4, $doubleNewLine); + $this->Write(4, $fourthLine); + $this->Write(4, $doubleNewLine); + + $this->SetX($lineX); + $lineY = $this->GetY(); + $this->drawDataEntryBox(145, 10, "Signature of Applicant or the Applicant's Parent or Guardian", ""); //$this->memberData['first_name'] . " " . $this->memberData['last_name']); + $this->drawDataEntryBox(50, 10, "Date Signed", date("Y-m-d")); + $this->SetX($lineX); + $this->SetY($lineY + 12); + $lineY = $this->GetY(); + $this->drawDataEntryBox(195, 15, "Notes or Comments", ""); + $this->SetX($lineX); + $this->SetY($lineY + 18); + $lineY = $this->GetY(); + $this->Line($lineX, $lineY, $lineX + 195, $lineY); + $this->SetX($lineX); + $this->SetY($lineY + 6); + $lineY = $this->GetY(); + $this->SetFont('Arial', '', 16); + $this->Text($lineX, $lineY, "Payment of your first dues is required with this application."); + $this->SetX($lineX); + $this->SetY($lineY + 2); + $lineY = $this->GetY(); + $this->drawDataEntryBox(55, 10, "Payment Amount", ""); + $this->drawDataEntryBox(45, 10, "Payment Date", ""); + $this->drawDataEntryBox(95, 10, "Recipt Number (For Cheque or Cash)", ""); + $this->SetX($lineX); + $this->SetY($lineY + 10); + $lineY = $this->GetY(); + $this->drawPaymentChoiceBox(195, 18, "Where will we find your payment?"); + + $this->SetX($lineX); + $this->SetY($lineY + 22); + $lineY = $this->GetY(); + $this->Line($lineX, $lineY, $lineX + 195, $lineY); + $this->SetX($lineX); + $this->SetY($lineY + 6); + $lineY = $this->GetY(); + $this->SetFont('Arial', '', 16); + $this->Text($lineX, $lineY, "Sponsors and Approval"); + $this->SetX($lineX); + $this->SetY($lineY + 3); + $lineY = $this->GetY(); + + $this->drawDataEntryBox(95, 10, "Sponsor 1 - Name", ""); + $this->drawDataEntryBox(55, 10, "Signature", ""); + $this->drawDataEntryBox(45, 10, "Date Signed", ""); + $this->SetX($lineX); + $this->SetY($lineY + 10); + $lineY = $this->GetY(); + + $this->drawDataEntryBox(95, 10, "Sponsor 2 - Name", ""); + $this->drawDataEntryBox(55, 10, "Signature", ""); + $this->drawDataEntryBox(45, 10, "Date Signed", ""); + $this->SetX($lineX); + $this->SetY($lineY + 10); + $lineY = $this->GetY(); + + $this->drawDataEntryBox(65, 10, "ID checked by:", ""); + $this->drawDataEntryBox(65, 10, "Application checked by:", ""); + $this->drawDataEntryBox(65, 10, "Liability form checked by:", ""); + $this->SetX($lineX); + $this->SetY($lineY + 10); + $lineY = $this->GetY(); + + $this->drawDataEntryBox(95, 10, "Confirmed by (Director)", ""); + $this->drawDataEntryBox(55, 10, "Signature", ""); + $this->drawDataEntryBox(45, 10, "Date Signed", ""); + + $this->AddPage(); + $this->SetFont('Arial', '', 16); + $this->Cell(0, 6, "Calgary Protospace Ltd.", 0, 1, "C"); + $this->Cell(0, 6, "Release of Liability, Waiver of Claims,", 0, 1, "C"); + $this->Cell(0, 6, "Assumption of Risks and Indemnity Agreement", 0, 1, "C"); + $this->SetFont('Arial', '', 12); + $this->Cell(0, 3, '("Release Agreement")', 0, 1, "C"); + $this->Write(2, $doubleNewLine); + + $this->SetFont('Times', '', 14); + $this->Write(5, "Assumption of Risks"); + $this->SetFont('Times', '', 12); + //$this->Write(2, $doubleNewLine); + $this->Write(4, $doubleNewLine . $riskOne); + //$this->Write(2, $doubleNewLine); + $this->Write(4, $doubleNewLine . $riskTwo); + $this->Write(4, $doubleNewLine . $riskThree); + $this->Write(4, $doubleNewLine . $riskFour); + $this->Write(4, $initial); + $this->Line($this->GetX() + 2, $this->GetY() + 4, $this->GetX() + 25, $this->GetY() + 4); + + $this->SetFont('Times', '', 14); + $this->Write(5, "\n\nRelease of Liability, Waiver of Claims and Indemnity Agreement"); + $this->SetFont('Times', '', 12); + $this->Write(4, $doubleNewLine . $waiverZero); + $this->Write(4, $doubleNewLine . $waiverOne); + $this->Write(4, $doubleNewLine . $waiverTwo); + $this->Write(4, $doubleNewLine . $waiverThree); + $this->Write(4, $doubleNewLine . $waiverFour); + $this->Write(4, $doubleNewLine . $waiverFive); + $this->Write(4, $doubleNewLine . $waiverSix); + $this->Write(4, $doubleNewLine . $waiverSeven); + $this->Write(4, $doubleNewLine . $waiverEight); + $this->Write(4, $initial); + $this->Line($this->GetX() + 2, $this->GetY() + 4, $this->GetX() + 25, $this->GetY() + 4); + + $this->Write(4, $doubleNewLine . $waiverNine); + $this->Write(4, $initial); + $this->Line($this->GetX() + 2, $this->GetY() + 4, $this->GetX() + 25, $this->GetY() + 4); + + $this->Write(4, $doubleNewLine . $waiverTen); + $this->Write(4, $initial); + $this->Line($this->GetX() + 2, $this->GetY() + 4, $this->GetX() + 25, $this->GetY() + 4); + + $this->Write(4, $doubleNewLine . $waiverEleven); + $this->Write(4, $doubleNewLine . $waiverTwelve); + + $this->SetX($lineX); + $lineY = $this->GetY() + 6; + $this->SetY($lineY); + + $this->drawDataEntryBox(55, 10, "Participant Name - Print", ""); + $this->drawDataEntryBox(140, 10, "", $this->memberData['first_name'] . " " . $this->memberData['last_name']); + + $this->SetX($lineX); + $this->SetY($lineY + 10); + $lineY = $this->GetY(); + + $this->drawDataEntryBox(55, 10, "Signature", ""); + $this->drawDataEntryBox(140, 10, "", ""); + + $this->SetX($lineX); + $this->SetY($lineY + 10); + $lineY = $this->GetY(); + + $this->drawDataEntryBox(55, 10, "Date (YYYY-MM-DD)", ""); + $this->drawDataEntryBox(70, 10, "", date("Y-m-d")); + $this->drawDataEntryBox(70, 10, "Orignial signing date", ""); + $this->SetFont('Times', '', 12); + + $this->SetX($lineX); + $this->SetY($lineY + 12); + $lineY = $this->GetY(); + + $this->Write(4, $tour); + + $this->SetX($lineX); + $lineY = $this->GetY() + 6; + $this->SetY($lineY); + + $this->drawDataEntryBox(85, 10, "Touring Member - Print", ""); + $this->drawDataEntryBox(110, 10, "Touring Member - Signature", ""); + $this->SetFont('Times', '', 12); + + $this->SetX($lineX); + $lineY = $this->GetY() + 12; + $this->SetY($lineY); + + $this->Write(4, $guardian); + + $this->SetX($lineX); + $lineY = $this->GetY() + 6; + $this->SetY($lineY); + + $this->drawDataEntryBox(75, 10, "Name of Parent or Guardian", ""); + $this->drawDataEntryBox(75, 10, "Signature of Parent or Guardian", ""); + $this->drawDataEntryBox(45, 10, "Date", date("Y-m-d")); + $this->SetFont('Times', '', 12); + + } + + function drawDataEntryBox($w, $h, $label, $data) + { + $origX = $this->GetX(); + $origY = $this->GetY(); + + $this->Rect($origX, $origY, $w, $h); + $this->SetFont('Arial', '', 8); + $this->Text($origX + 2, $origY + 3, $label); + $this->SetFont('Times', 'B', 14); + $this->Text($origX + 8, $origY + 8, $data); + + $this->SetY($origY); + $this->SetX($origX + $w); + } + + function drawPaymentChoiceBox($w, $h, $label) + { + $origX = $this->GetX(); + $origY = $this->GetY(); + + $this->Rect($origX, $origY, $w, $h); + $this->SetFont('Arial', '', 8); + $this->Text($origX + 2, $origY + 3, $label); + $this->SetFont('Arial', '', 10); + + $this->Rect($origX + 5, $origY + 6, 2, 2); + $this->Text($origX + 8, $origY + 8, "I made a one time payment via PayPal or email Interact"); + $this->Rect($origX + 5, $origY + 12, 2, 2); + $this->Text($origX + 8, $origY + 14, "I set up a recuring PayPal payment"); + $this->Rect($origX + 100, $origY + 6, 2, 2); + $this->Text($origX + 103, $origY + 8, "I paid by cheque"); + $this->Rect($origX + 100, $origY + 12, 2, 2); + $this->Text($origX + 103, $origY + 14, "I paid by cash"); + $this->Rect($origX + 135, $origY + 6, 2, 2); + $this->Text($origX + 138, $origY + 8, "I paid by a credit card (Square)"); + /* + $this->drawCheckBoxChoice($origX + 5, $origY + 6, "I made a one time payment via PayPal or email Interact"); + $this->drawCheckBoxChoice($origX + 5, $origY + 12, "I set up a recuring PayPal payment"); + $this->drawCheckBoxChoice($origX + 55, $origY + 6, "I paid by cheque"); + $this->drawCheckBoxChoice($origX + 55, $origY + 12, "I paid by cash"); + $this->drawCheckBoxChoice($origX + 125, $origY + 6, "I paid by a credit card/n(Square)"); + */ + $this->SetY($origY + $h); + $this->SetX($origX + $w); + } + + function drawCheckBoxChoice($x, $y, $label) + { + $origX = $this->GetX(); + $origY = $this->GetY(); + + //$this->SetX($origX + $x); + //$this->SetY($origY + $y); + + //$this->Box($x, $y, 2, 2); + $this->Rect($x, $y, 2, 2); + //$this->SetX($origX + $x + 5); + //$this->SetY($origY + $y); + $this->SetFont('Arial', '', 10); + $this->Text($origX + $x + 5, $origY + $y, $label); + //$this->Write(4, $label); + + $this->SetX($origX); + $this->SetY($origY); + } + + /* + * Override of default + */ + function Header() + { + $this->SetFont('Times', '', 10); + $firstName = $this->memberData['first_name']; + $lastName = $this->memberData['last_name']; + $id = $this->memberData['id']; + $this->Cell(0, 6, "$firstName $lastName ($id)", 0, 1, "R"); + } + + /* + * Override of default + */ + + function Footer() + { + } +} + +function generateForm($memberID) +{ + $member = getMemberRowData($memberID); + $pdf = new FPDF("P", "mm", "Letter"); + $pdf->SetTopMargin(2.5); + $pdf->AddPage(); + $inset = 5; + /* + $pdf->Line(0, 0, 100, 0); + $pdf->Line(0, 0, 0, 100);*/ + + $pdf->SetFont('Times','',12); + $pdf->Cell(0, 6, "${member['first_name']} ${member['last_name']} (${member['id']})", 0, 1, "R"); + $pdf->SetFont('Arial', 'B', 20); + $pdf->Cell(0, 10, "Protospace Membership Application", 0, 1, "C"); + $pdf->Line($inset, 20, $pdf->GetPageWidth() - $inset, 20); + $pdf->SetFont('Times','',16); + $pdf->Cell(0, 10, "Welcome", 0, 1); + $pdf->SetFont('Times', '', 12); + $pdf->Cell($inset, 0, "Thank you for your interest.", 0, 1); + //$pdf-> + $pdf->Output(); +} + + +?> \ No newline at end of file diff --git a/attendance.php b/attendance.php new file mode 100644 index 0000000..937c753 --- /dev/null +++ b/attendance.php @@ -0,0 +1,206 @@ +beginTransaction(); + $sth = $dbh->prepare("UPDATE class_registrants SET attendance_status = 'no'"); + $sth->execute(); + $sth = $dbh->prepare("UPDATE class_registrants SET attendance_status = 'yes' WHERE member_id = ?"); + + + foreach ($_POST as $attendee => $status) + { + if ($status === "Attended") + $sth->execute(array($attendee)); + } + $dbh->commit(); + + + /* + $insert = TRUE; + //print_r(PDO::getAvailableDrivers()); + $dbh = returnDatabaseHandel(); + //$dbh->beginTransaction(); + $sth = $dbh->prepare("SELECT * FROM courses"); + $count = 0; + if ($sth->execute()) + { + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) + { + if ($row['id'] === $_POST['id']) + { + $insert = FALSE; + } + } + //echo "here"; + if ($insert) + { + $sth = $dbh->prepare("INSERT INTO courses (id, name, description) values (?, ?, ?)"); + $sth->execute(array($_POST['id'], $_POST['name'], $_POST['description'])); + } + else + { + $dbh->beginTransaction(); + $sth = $dbh->prepare("UPDATE courses SET name = ?, description = ? WHERE id = ?"); + $sth->execute(array($_POST['name'], $_POST['description'], $_POST['id'])); + //print_r($sth->errorInfo()); + $dbh->commit(); + } + } + } + catch (Exception $e) + { + $dbh->rollBack(); + print ("Fail! " . $e->getMessage() . "\n"); + }*/ + $status = cleanInput($_POST['status']); + + if ($status === "NoShow" || $status === "Attended" || + $status === "Rescheduled" || $status === "Confirmed" || + $status === "Withdrawn" || $status === "Registered") + { + updateAttendenceTable($classID, $status); + } + } + } + + $root = $doc->appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + + /*$body->appendChild(generateMemberNavigationBar($doc)); + if (returnInstructorStatus($_SESSION['MemberID'])) + if ($_SESSION['sub_nav'] === "Admin") + $body->appendChild(generateAdminNavigationBar($doc)); + else + if ($_SESSION['sub_nav'] === "Director") + $body->appendChild(generateDirectorNavigationBar($doc)); + else + $body->appendChild(generateTrainingNavigationBar($doc)); + else + if (returnAdminStatus($_SESSION['memberID'])) + $body->appendChild(generateAdminNavigationBar($doc)); */ + + /* + * Do not set session sub nav + */ + + $body->appendChild(generateSelectedMenuBar($doc)); + + /* + * Insert content here. + */ + + //print_r($_POST); + + $bodyDiv = $doc->createElement('div'); + $bodyDiv->setAttribute('class', 'BodyDiv'); + + if (returnInstructorStatus($_SESSION['MemberID']) || returnAdminStatus($_SESSION['MemberID']) || returnDirectorStatus($_SESSION['MemberID'])) + { + if (isset($_POST['classID'])) + $bodyDiv->appendChild(generateClassSelector($doc, (int) cleanInput($_POST['classID']))); // $_POST is only used for comparison in this function + else + $bodyDiv->appendChild(generateClassSelector($doc)); + + $bodyDiv->appendChild($doc->createElement('hr')); + + if (isset($_POST['classID'])) + { + $classID = (int) cleanInput($_POST['classID']); + $bodyDiv->appendChild(generateAttendanceForm($doc, $classID)); + $bodyDiv->appendChild($doc->createElement('br')); + $text = $doc->createElement('H3'); + $text->appendChild($doc->createTextNode(getCourseTitleFromClassID($classID))); + $bodyDiv->appendChild($text); + $text = $doc->createElement('p'); + $text->appendChild($doc->createTextNode(getCourseDescriptionFromClassID($classID))); + $bodyDiv->appendChild($text); + + } + } + + $body->appendChild($bodyDiv); + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + echo $doc->saveXML(); + } +else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/canteen.php b/canteen.php new file mode 100644 index 0000000..c9ca0ec --- /dev/null +++ b/canteen.php @@ -0,0 +1,96 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + $_SESSION['subNav'] = NULL; + $body->appendChild(generateSelectedMenuBar($doc)); + + + /* + * Insert content here. + */ + $h3 = $doc->createElement('h3'); + $h3->appendChild($doc->createTextNode("This is where members can track their pop purchases")); + $body->appendChild($h3); + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + outputDoc($doc); + } +else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/classes.php b/classes.php new file mode 100644 index 0000000..9d67272 --- /dev/null +++ b/classes.php @@ -0,0 +1,199 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + $body->appendChild(generateSelectedMenuBar($doc)); + + if ($_SERVER['REQUEST_METHOD'] == 'POST') + { + /* + * process class signup + * + * check if a seat is available + * add a class_registrant record + */ + //print_r($_POST); + if (isset($_POST['register'])) + { + if (isset($_POST['class_id']) && ($_POST['register'] === "Register")) + { + $classID = (int) cleanInput($_POST['class_id']); + registerMemberForClass($classID, $_SESSION['MemberID']); + $h3 = $doc->createElement('h3'); + $h3->appendChild($doc->createTextNode("You have been registered for class " . $classID)); + $body->appendChild($h3); + + $p = $doc->createElement('p'); + $p->appendChild($doc->createTextNode($text7000)); + $body->appendChild($p); + } + } + else + if (isset($_POST['withdraw'])) + { + if (isset($_POST['class_id'])) + { + $classID = (int) cleanInput($_POST['class_id']); + } + } + } + else + { + try + { + if (isset($_GET['class_id'])) + { + /* + * Get with class_id, show class details/signup + */ + $classID = (int) cleanInput($_GET['class_id']); + $classDiv = $doc->createElement('div'); + $classDiv->setAttribute('class', 'FloatLeft50Div'); + + $dbh = returnDatabaseHandel(); + $sth = $dbh->prepare($statement249); + if ($sth->execute(array($classID))) + { + $count = 0; + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) + { + $count++; + $h3 = $doc->createElement('h3'); + $h3->appendChild($doc->createTextNode("Class Number " . $row['id'])); + $classDiv->appendChild($h3); + //$classDiv->appendChild($doc->createElement('br')); + $h3 = $doc->createElement('h3'); + $h3->appendChild($doc->createTextNode($row['name'])); + $classDiv->appendChild($h3); + $h5 = $doc->createElement('h5'); + $h5->appendChild($doc->createTextNode("Cost: " . money_format('%i', $row['cost']))); + $classDiv->appendChild($h5); + $h5 = $doc->createElement('h5'); + $h5->appendChild($doc->createTextNode("Starting at: " . $row['start_datetime'])); + $classDiv->appendChild($h5); + $p = $doc->createElement('p'); + $p->appendChild($doc->createTextNode($row['description'])); + $classDiv->appendChild($p); + /* + * Register, deregister? + */ + + $form = createForm($doc, "classes.php"); + $input = createHiddenInput($doc, 'class_id', (string)$row['id']); +/* $input = $doc->createElement('input'); + $input->setAttribute('type', 'hidden'); + $input->setAttribute('name', 'class_id'); + $input->setAttribute('value', $row['id']); */ + $form->appendChild($input); + + $status = returnMemberStatusForClass($classID, $_SESSION['MemberID']); + + if ($status === "Confirmed" || $status === "Registered") + { + $input = createSubmitInput($doc, 'withdraw', $text0020); +/* $input = $doc->createElement('input'); + $input->setAttribute('type', 'submit'); + $input->setAttribute('name', 'withdraw'); + $input->setAttribute('value', 'Withdraw');*/ + $form->appendChild($input); + } + else + { + $input = createSubmitInput($doc, 'register', $text0021); +/* $input = $doc->createElement('input'); + $input->setAttribute('type', 'submit'); + $input->setAttribute('name', 'register'); + $input->setAttribute('value', 'Register'); */ + $form->appendChild($input); + } + $classDiv->appendChild($form); + } + } + if ($count == 1) + $body->appendChild($classDiv); + else + $body->appendChild(generateTrainingTable($doc, 'classes.php')); + } + else + { + /* + * Get with no class_id, display table + */ + $body->appendChild(generateTrainingTable($doc, 'classes.php')); + } + } + catch (Exception $e) + { + $body->appendChild(generateTrainingTable($doc, 'classes.php')); + } + } + + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + echo $doc->saveXML(); + } + + + +?> \ No newline at end of file diff --git a/courseEditor.php b/courseEditor.php new file mode 100644 index 0000000..67d0485 --- /dev/null +++ b/courseEditor.php @@ -0,0 +1,430 @@ +beginTransaction(); + $sth = $dbh->prepare("SELECT * FROM courses"); + $count = 0; + if ($sth->execute()) + { + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) + { + if ($row['id'] === $_POST['id']) + { + $insert = FALSE; + } + } + //echo "here"; + if ($insert) + { + $sth = $dbh->prepare("INSERT INTO courses (id, name, description) values (?, ?, ?)"); + $sth->execute(array($_POST['id'], $_POST['name'], $_POST['description'])); + } + else + { + $dbh->beginTransaction(); + $sth = $dbh->prepare("UPDATE courses SET name = ?, description = ? WHERE id = ?"); + $sth->execute(array($_POST['name'], $_POST['description'], $_POST['id'])); + //print_r($sth->errorInfo()); + $dbh->commit(); + } + } + } + catch (Exception $e) + { + print ("Fail! " . $e->getMessage() . "\n"); + } + } + + $root = $doc->appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + //$body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + /* + $body->appendChild(generateMemberNavigationBar($doc)); + if (returnInstructorStatus($_SESSION['MemberID'])) + if ($_SESSION['sub_nav'] === "Admin") + $body->appendChild(generateAdminNavigationBar($doc)); + else + if ($_SESSION['sub_nav'] === "Director") + $body->appendChild(generateDirectorNavigationBar($doc)); + else + $body->appendChild(generateTrainingNavigationBar($doc)); + else + if (returnAdminStatus($_SESSION['memberID'])) + $body->appendChild(generateAdminNavigationBar($doc)); + */ + + /* + * do not set session sub nav + */ + + //$body->appendChild(generateSelectedMenuBar($doc)); + + $body->appendChild(generateTopStickyDiv($doc, $baseDir)); + + /* + * Insert content here. + */ + + $bodyDiv = $doc->createElement('div'); + $bodyDiv->setAttribute('class', 'BodyDiv'); + + /* + $tableDiv = $doc->createElement('div'); + //$tableDiv->setAttribute('display', 'block'); + $tableDiv->setAttribute('class', 'FloatLeft50Div'); + $table = $doc->createElement('table'); + //$table.setAttribute('class' + //$table->setAttribute('class', 'FloatLeft50Div'); + $thead = $doc->createElement('thead'); + $tr = $doc->createElement('tr'); + + $th = $doc->createElement('th'); + $a = $doc->createElement('a'); + $a->appendChild($doc->createTextNode('ID')); + $th->appendChild($a); + $tr->appendChild($th); + + $th = $doc->createElement('th'); + $a = $doc->createElement('a'); + $a->appendChild($doc->createTextNode('Course Name')); + $th->appendChild($a); + $tr->appendChild($th); + + $th = $doc->createElement('th'); + $a = $doc->createElement('a'); + $a->appendChild($doc->createTextNode('Description')); + $th->appendChild($a); + $tr->appendChild($th); + + $thead->appendChild($tr); + $table->appendChild($thead); + + $tbody = $doc->createElement('tbody'); + + $tint = false; + + $edit = NULL; + $highestID = 0; + + try + { + //print_r(PDO::getAvailableDrivers()); + $dbh = new PDO($dsn, $dbUserName, $dbPassWord, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION)); + $dbh->beginTransaction(); + $sth = $dbh->prepare("SELECT * FROM courses"); + $count = 0; + + if ($sth->execute()) + { + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) + { + if (isset($_GET['id'])) + if ($row['id'] === $_GET['id']) + $edit = $row; + + $count++; + if ($row['id'] > $highestID) + $highestID = $row['id']; + + $tr = $doc->createElement('tr'); + + if ($tint === true) + { + $tr->setAttribute('class', 'AlternateRow'); + } + + $td = $doc->createElement('td'); + $rr = $doc->createElement('a'); + $rr->setAttribute('href', "courseEditor.php?id=${row['id']}"); + $rr->appendChild($doc->createTextNode($row['id'])); + $td->appendChild($rr); + $tr->appendChild($td); + + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($row['name'])); + $tr->appendChild($td); + + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($row['description'])); + $tr->appendChild($td); + + $tbody->appendChild($tr); + } + } + $table->appendChild($tbody); + $tableDiv->appendChild($table); + } + catch (Exception $e) + { + echo "Failed!" . $e->getMessage() . "\n"; + }*/ + if (isset($_GET['id'])) + $edit = getCourseRowByID($_GET['id']); + else + $edit = NULL; + $highestID = getHighestCourseID(); + + $bodyDiv->appendChild(generateCourseTable($doc)); + + + if (!($edit === NULL)) + { + $editorDiv = $doc->createElement('div'); + $editorDiv->setAttribute('id', 'CourseEditorDiv'); + $form = $doc->createElement('form'); + $form->setAttribute('action', 'courseEditor.php'); + $form->setAttribute('method', 'post'); + $label = $doc->createElement('H3'); + $label->appendChild($doc->createTextNode("Course ID: " . $edit['id'])); + $form->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'hidden'); + $input->setAttribute('name', 'id'); + $input->setAttribute('readonly', 'readonly'); + $input->setAttribute('value', $edit['id']); + $form->appendChild($input); + $fieldSet = $doc->createElement('fieldset'); + //$fieldSet->setAttribute('style', 'width:200px; max-width:300px;'); //margin-top:0.5em;'); + $fieldSetDiv = $doc->createElement('div'); + + $label = $doc->createElement('label', 'Course Name:'); + $label->setAttribute('for', 'name'); + $label->setAttribute('class', 'CourseEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'name'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('required', 'required'); + if (isset($edit['name'])) + $input->setAttribute('value', $edit['name']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + /* + $label = $doc->createElement('label', 'Description:'); + $label->setAttribute('for', 'description'); + $label->setAttribute('class', 'CourseEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'description'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('required', 'required'); + if (isset($edit['description'])) + $input->setAttribute('value', $edit['description']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + */ + + $label = $doc->createElement('label', 'Description:'); + $label->setAttribute('for', 'description'); + $label->setAttribute('class', 'CourseEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('textarea'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'description'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('rows', '6'); + $input->setAttribute('required', 'required'); + if (isset($edit['description'])) + $input->appendChild($doc->createTextNode($edit['description'])); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + + $fieldSet->appendChild($fieldSetDiv); + + $form->appendChild($fieldSet); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'reset'); + $form->appendChild($input); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'submit'); + $form->appendChild($input); + $editorDiv->appendChild($form); + $bodyDiv->appendChild($editorDiv); + } + else + { + $nextHighestID = $highestID + 1; + $editorDiv = $doc->createElement('div'); + $editorDiv->setAttribute('id', 'CourseEditorDiv'); + $editorDiv->setAttribute('class', 'sticky'); + $form = $doc->createElement('form'); + $form->setAttribute('action', 'courseEditor.php'); + $form->setAttribute('method', 'post'); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'hidden'); + $input->setAttribute('value', 'Add'); + $input->setAttribute('name', 'action'); + $input->setAttribute('readonly', 'readonly'); + $form->appendChild($input); + $label = $doc->createElement('H3'); + $label->appendChild($doc->createTextNode("Add New Course")); + $form->appendChild($label); + $fieldSet = $doc->createElement('fieldset'); + //$fieldSet->setAttribute('style', 'width:200px; max-width:300px;'); //margin-top:0.5em;'); + $fieldSetDiv = $doc->createElement('div'); + + $fieldSet->appendChild($fieldSetDiv); + + $label = $doc->createElement('label', 'Course ID:'); + $label->setAttribute('for', 'id$'); + $label->setAttribute('class', 'CourseEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'number'); + $input->setAttribute('name', 'id'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('required', 'required'); + $input->setAttribute('value', "$nextHighestID"); + $input->setAttribute('min', "$nextHighestID"); + $input->setAttribute('step', '1'); + $fieldSetDiv->appendChild($input); + + $label = $doc->createElement('label', 'Course Name:'); + $label->setAttribute('for', 'name'); + $label->setAttribute('class', 'CourseEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'name'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + /* + $label = $doc->createElement('label', 'Description:'); + $label->setAttribute('for', 'description'); + $label->setAttribute('class', 'CourseEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'description'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + */ + + $label = $doc->createElement('label', 'Description:'); + $label->setAttribute('for', 'description'); + $label->setAttribute('class', 'CourseEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('textarea'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'description'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('rows', '6'); + $input->setAttribute('required', 'required'); + $input->appendChild($doc->createTextNode("")); /* a child node is needed to close the textarea */ + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + + $form->appendChild($fieldSet); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'reset'); + $form->appendChild($input); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'submit'); + $form->appendChild($input); + $editorDiv->appendChild($form); + //$bodyDiv->appendChild($editorDiv); + $body->appendChild($editorDiv); // Needs to be in the body for sticky + } + + $body->appendChild($bodyDiv); + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + echo $doc->saveXML(); + } +else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/courses.php b/courses.php new file mode 100644 index 0000000..1f851e4 --- /dev/null +++ b/courses.php @@ -0,0 +1,88 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + //$body->appendChild(generateMemberNavigationBar($doc)); + + $body->appendChild(generateSelectedMenuBar($doc)); + +/* if (isset($_SESSION['FirstName']) && isset($_SESSION['LastName'])) + { + if ($_SESSION['sub_nav'] === "Admin") + $body->appendChild(generateAdminNavigationBar($doc)); + else + $body->appendChild(generateTrainingTable($doc, 'courses.php')); + } */ + $body->appendChild(generateTrainingTable($doc, 'courses.php')); + + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + echo $doc->saveXML(); + } + + + +?> \ No newline at end of file diff --git a/director-template.php b/director-template.php new file mode 100644 index 0000000..3205e77 --- /dev/null +++ b/director-template.php @@ -0,0 +1,94 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + $body->appendChild(generateMemberNavigationBar($doc)); + $body->appendChild(generateDirectorNavigationBar($doc)); + + + /* + * Insert content here. + */ + + + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + outputDoc($doc); + } +else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/director.php b/director.php new file mode 100644 index 0000000..bc3d138 --- /dev/null +++ b/director.php @@ -0,0 +1,94 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + $body->appendChild(generateMemberNavigationBar($doc)); + $body->appendChild(generateDirectorNavigationBar($doc)); + + + /* + * Insert content here. + */ + + + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + echo $doc->saveXML(); + } +else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..670e595 --- /dev/null +++ b/index.php @@ -0,0 +1,130 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + if (isset($_SESSION['login'])) + if ($_SESSION['login'] === TRUE) + $body->appendChild(generateSelectedMenuBar($doc)); + + //$body->appendChild(generateMemberNavigationBar($doc)); + + //$body->appendChild($doc->createElement('hr')); + + /* + * $welcome = $doc->createElement('div'); + * $welcomeHeader = $doc->createElement('h3'); + * $welcomeHeader->appendChild($doc->createTextNode('Welcome to the members database for Protospace')); + * $welcome->appendChild($welcomeHeader); + * + * $body->appendChild($welcome); + + $body->appendChild(generateMenuList($doc, $baseDir, array ( + array ( + 'index.php', + 'My transactions' ), + array ( + 'login.php', + 'Login for more options' ), + array ( + 'school.php', + 'Classes, courses, seminars, events and fun for all!' ) ))); + + // $body->appendChild($welcome);*/ + + $bodyDiv = $doc->createElement('div'); + $bodyDiv->setAttribute('id', 'BodyDiv'); + + $bodyDiv->appendChild(generateStatus($doc)); + + $briefTable = generateBriefTrainingTable($doc, 20); + + if ($briefTable === FALSE) + { + } + else + $bodyDiv->appendChild($briefTable); + + + /*, array ( + createCourseInfo("Monthly Cleanup and Group Lunch", 11257, "Sat, Jan 20, 9:30 AM", 11, 88), + createCourseInfo("New Members: Orientation and Basic Safety", 11245, "Sat, Jan 20, 2:00 PM", 11, 1), + createCourseInfo("Woodworking: Stationary Saws", 11266, "Sun, Jan 21, 12:00 PM", 5, 0), + createCourseInfo("Electronics: Creating PCBs with Free Software (Part 1)", 11261, "Sat, Jan 27, 10:00 AM", 8, 0), + createCourseInfo("Electronics: Creating PCBs with Free Software (Part 2)", 11262, "Sun, Jan 28, 10:00 AM", 8, 0), + createCourseInfo("Test: How to Donate!", 11258, "Wed, Jan 31, 11:45 PM", 1, 11) ))); + */ + + + $body->appendChild($bodyDiv); + + //$body->appendChild($doc->createElement('br')); + + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + outputDoc($doc); +} +else +{ + generateCookieMonster(); +} + +?> + + diff --git a/ipn/PaypalIPN.php b/ipn/PaypalIPN.php new file mode 100644 index 0000000..eb0e25b --- /dev/null +++ b/ipn/PaypalIPN.php @@ -0,0 +1,143 @@ +use_sandbox = true; + } + + /** + * Sets curl to use php curl's built in certs (may be required in some + * environments). + * @return void + */ + public function usePHPCerts() + { + $this->use_local_certs = true; + } + + /** + * Determine endpoint to post the verification data to. + * + * @return string + */ + public function getPaypalUri() + { + if ($this->use_sandbox) { + return self::SANDBOX_VERIFY_URI; + } else { + return self::VERIFY_URI; + } + } + + /** + * Verification Function + * Sends the incoming post data back to PayPal using the cURL library. + * + * @return bool + * @throws Exception + */ + public function verifyIPN() + { + if ( ! count($_POST)) { + throw new Exception("Missing POST Data"); + } + + $raw_post_data = file_get_contents('php://input'); + $raw_post_array = explode('&', $raw_post_data); + $myPost = array(); + foreach ($raw_post_array as $keyval) { + $keyval = explode('=', $keyval); + if (count($keyval) == 2) { + // Since we do not want the plus in the datetime string to be encoded to a space, we manually encode it. + if ($keyval[0] === 'payment_date') { + if (substr_count($keyval[1], '+') === 1) { + $keyval[1] = str_replace('+', '%2B', $keyval[1]); + } + } + $myPost[$keyval[0]] = urldecode($keyval[1]); + } + } + + // Build the body of the verification post request, adding the _notify-validate command. + $req = 'cmd=_notify-validate'; + $get_magic_quotes_exists = false; + if (function_exists('get_magic_quotes_gpc')) { + $get_magic_quotes_exists = true; + } + foreach ($myPost as $key => $value) { + if ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) { + $value = urlencode(stripslashes($value)); + } else { + $value = urlencode($value); + } + $req .= "&$key=$value"; + } + + // Post the data back to PayPal, using curl. Throw exceptions if errors occur. + $ch = curl_init($this->getPaypalUri()); + curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); + curl_setopt($ch, CURLOPT_POST, 1); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_POSTFIELDS, $req); + curl_setopt($ch, CURLOPT_SSLVERSION, 6); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); + + // This is often required if the server is missing a global cert bundle, or is using an outdated one. + if ($this->use_local_certs) { + curl_setopt($ch, CURLOPT_CAINFO, __DIR__ . "/cert/cacert.pem"); + } + curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); + curl_setopt($ch, CURLOPT_HTTPHEADER, array( + 'User-Agent: PHP-IPN-Verification-Script', + 'Connection: Close', + )); + $res = curl_exec($ch); + if ( ! ($res)) { + $errno = curl_errno($ch); + $errstr = curl_error($ch); + curl_close($ch); + throw new Exception("cURL error: [$errno] $errstr"); + } + + $info = curl_getinfo($ch); + $http_code = $info['http_code']; + if ($http_code != 200) { + throw new Exception("PayPal responded with http code $http_code"); + } + + curl_close($ch); + + // Check if PayPal verifies the IPN data, and if so, return true. + if ($res == self::VALID) { + return true; + } else { + return false; + } + } +} + +?> \ No newline at end of file diff --git a/ipn/ipn.php b/ipn/ipn.php new file mode 100644 index 0000000..849501a --- /dev/null +++ b/ipn/ipn.php @@ -0,0 +1,423 @@ +"; +$from_email_address = "My Name "; + +// Set this to true to save a log file: +$save_log_file = true; +$log_file_dir = __DIR__ . "/logs"; + + +require('PaypalIPN.php'); + +use PaypalIPN; + +$ipn = new PaypalIPN(); + +date_default_timezone_set($timeZone); + +// Use the sandbox endpoint during testing. +if ($enable_sandbox) + $ipn->useSandbox(); + +//$verified = $ipn->verifyIPN(); +$verified = TRUE; +if ($verified) +{ + /* + * Process IPN + * A list of variables is available here: + * https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNandPDTVariables/ + */ + +/* + if (isset($_POST['protection_eligibility']) && isset($_POST['payer_id']) && + isset($_POST['payment_date']) && isset($_POST['payment_status']) && + isset($_POST['first_name']) && isset($_POST['last_name']) && + isset($_POST['notify_version']) && isset($_POST['verify_sign']) && + isset($_POST['payer_email']) && isset($_POST['txn_id']) && + isset($_POST['payment_type']) && isset($_POST['receiver_email']) && + isset($_POST['receiver_id']) && isset($_POST['txn_type'])) + { + if ($_POST['protection_eligibility'] === 'Eligible') + $protection_eligibility = TRUE; + else + $protection_eligibility = FALSE; + $payer_id = $_POST['payer_id']; + $payment_date = $_POST['payment_date']; + if ($_POST['payment_status'] === 'Completed') + $payment_status = TRUE; + else + $payment_status = FALSE; + $first_name = $_POST['first_name']; + $last_name = $_POST['last_name']; + $notify_version = $_POST['notify_version']; + $verify_sign = $_POST['verify_sign']; + $payer_email = $_POST['payer_email']; + $txn_id = $_POST['txn_id']; + $payment_type = $_POST['payment_type']; + $receiver_email = $_POST['receiver_email']; + $receiver_id = $_POST['receiver_id']; + $txn_type = $_POST['txn_type']; + + if (isset($_POST['mc_gross'])) + $mc_gross = (float) $_POST['mc_gross']; + else + $mc_gross = (float) 0.0; + + if (isset($_POST['address_status']) && $_POST['address_status'] === 'confirmed') + $address_status = TRUE; + else + $address_status = FALSE; + + if (isset($_POST['tax'])) + $tax = (float) $_POST['tax']; + else + $tax = (float) 0.00; + + if (isset($_POST['address_street'])) + $address_street = $_POST['address_street']; + else + $address_street = NULL; + + if (isset($_POST['charset'])) + $charset = $_POST['charset']; + else + $charset = 'utf-8'; + + if (isset($_POST['address_zip'])) + $address_zip = $_POST['address_zip']; + else + $address_zip = NULL; + + if (isset($_POST['mc_fee'])) + $mc_fee = (float) $_POST['mc_fee']; + else + $mc_fee = (float) 0.0; + + if (isset($_POST['address_country_code'])) + $address_country_code = $_POST['address_country_code']; + else + $address_country_code = 'CA'; + + if (isset($_POST['address_name'])) + $address_name = $_POST['address_name']; + else + $address_name = NULL; + + if (isset($_POST['cusom'])) + $custom = $_POST['custom']; + else + $custom = NULL; + + if (isset($_POST['payer_satus']) && $_POST['payer_satus'] === 'verified') + $payer_status = TRUE; + else + $payer_status = FALSE; + + if (isset($_POST['address_country'])) + $address_country = $_POST['address_country']; + else + $address_country = NULL; + + if (isset($_POST['address_city'])) + $address_city = $_POST['address_city']; + else + $address_city = NULL; + + if (isset($_POST['quantity'])) + $quantity = (int) $_POST['quantity']; + else + $quantity = (int) -1; + + if (isset($_POST['address_state'])) + $address_state = $_POST['address_state']; + else + $address_state = NULL; + + if (isset($_POST['payment_fee'])) + $payment_fee = (float) $_POST['payment_fee']; + else + $payment_fee = (float) 0.00; + + if (isset($_POST['item_name'])) + $item_name = $_POST['item_name']; + else + $item_name = NULL; + + if (isset($_POST['mc_currency'])) + $mc_currency = $_POST['mc_currency']; + else + $mc_currency = 'CAD'; + + if (isset($_POST['item_number'])) + $item_number = $_POST['item_number']; + else + $item_number = NULL; + + if (isset($_POST['residence_country'])) + $residence_country = $_POST['residence_country']; + else + $residence_country = 'CA'; + + if (isset($_POST['test_ipn'])) + $test_ipn = $_POST['test_ipn']; + else + $test_ipn = NULL; + + if (isset($_POST['handling_amount'])) + $handling_amount = (float) $_POST['handling_amount']; + else + $handling_amount = (float) 0.00; + + if (isset($_POST['transaction_subject'])) + $transaction_subject = $_POST['transaction_subject']; + else + $transaction_subject = NULL; + + if (isset($_POST['payment_gross'])) + $payment_gross = (float) $_POST['payment_gross']; + else + $payment_gross = (float) 0.00; + + if (isset($_POST['shipping'])) + $shipping = $_POST['shipping']; + else + $shippling = (float) 0.00; + + $ipnID = receiveInstantPaypalNotification($item_name, $item_number, (int) $quantity, + $mc_currency, $mc_gross, $mc_fee, $payment_type, $payment_date, + $payment_gross, $payment_fee, $shipping, $handling_amount, $tax, + $payment_status, $protection_eligibility, $payer_id, $payer_email, + $first_name, $last_name, $address_street, $address_city, $address_state, + $address_country, $address_country_code, $address_zip, $address_status, + $address_name, $payer_status, $residence_country, $receiver_id, + $receiver_email, $transaction_subject, $custom, $charset, $txn_id, + $txn_type, $notify_version, $verify_sign, $test_ipn); + processInstantPaypalNotification($ipnID); + } +*/ + + /* + * Attempt number 2 + */ + + $data = file_get_contents('php://input'); + if (isset($_POST['txn_type']) && isset($_POST['verify_sign']) && ($data !== FALSE)) + { + $txn_type = $_POST['txn_type']; + $verify_sign = $_POST['verify_sign']; + if (isset($_POST['txn_id'])) + $txn_id = $_POST['txn_id']; + else + $txn_id = NULL; + + $ipnID = receiveInstantPaypalNotification($txn_type, $txn_id, $verify_sign, $data); + //print ("ipnID: $ipnID"); + if (isset($_POST['payer_id'])) + $payer_id = $_POST['payer_id']; + else + $payer_id = NULL; + if (isset($_POST['payment_date'])) + $payment_date = date_format(date_create($_POST['payment_date']), $dbDateTimeFormat); + else + $payment_date = NULL; + if (isset($_POST['payment_status'])) + $payment_status = $_POST['payment_status']; + else + $payment_status = NULL; + if (isset($_POST['first_name'])) + $first_name = $_POST['first_name']; + else + $first_name = NULL; + if (isset($_POST['last_name'])) + $last_name = $_POST['last_name']; + else + $last_name = NULL; + if (isset($_POST['payer_email'])) + $payer_email = $_POST['payer_email']; + else + $payer_email = NULL; + if (isset($_POST['mc_currency'])) + $mc_currency = $_POST['mc_currency']; + else + $mc_currency = NULL; + if (isset($_POST['mc_gross'])) + $mc_gross = $_POST['mc_gross']; + else + $mc_gross = NULL; + if (isset($_POST['mc_fee'])) + $mc_fee = $_POST['mc_fee']; + else + $mc_fee = NULL; + if (isset($_POST['address_street'])) + $address_street = $_POST['address_street']; + else + $address_street = NULL; + if (isset($_POST['address_city'])) + $address_city = $_POST['address_city']; + else + $address_city = NULL; + if (isset($_POST['address_state'])) + $address_state = $_POST['address_state']; + else + $address_state = NULL; + if (isset($_POST['address_country'])) + $address_country = $_POST['address_country']; + else + $address_country = NULL; + if (isset($_POST['address_country_code'])) + $address_country_code = $_POST['address_country_code']; + else + $address_country_code = NULL; + if (isset($_POST['address_zip'])) + $address_zip = $_POST['address_zip']; + else + $address_zip = NULL; + if (isset($_POST['address_country'])) + $address_country = $_POST['address_country']; + else + $address_country = NULL; + if (isset($_POST['contact_phone'])) + $contact_phone = $_POST['contact_phone']; + else + $contact_phone = NULL; + if (isset($_POST['custom'])) + $custom = $_POST['custom']; + else + $custom = NULL; + if (isset($_POST['receipt_id'])) + $receipt_id = $_POST['receipt_id']; + else + $receipt_id = NULL; + if (isset($_POST['payer_status'])) + $payer_status = $_POST['payer_status']; + else + $payer_status = NULL; + if (isset($_POST['quantity'])) + $quantity = $_POST['quantity']; + else + $quantity = NULL; + if (isset($_POST['payment_type'])) + $payment_type = $_POST['payment_type']; + else + $payment_type = NULL; + if (isset($_POST['receiver_email'])) + $receiver_email = $_POST['receiver_email']; + else + $receiver_email = NULL; + if (isset($_POST['receiver_id'])) + $receiver_id = $_POST['receiver_id']; + else + $receiver_id = NULL; + if (isset($_POST['item_name'])) + $item_name = $_POST['item_name']; + else + $item_name = NULL; + if (isset($_POST['item_number'])) + $item_number = $_POST['item_number']; + else + $item_number = NULL; + if (isset($_POST['residence_country'])) + $residence_country = $_POST['residence_country']; + else + $residence_country = NULL; + if (isset($_POST['charset'])) + $charset = $_POST['charset']; + else + $charset = NULL; + if (isset($_POST['transaction_subject'])) + $transaction_subject = $_POST['transaction_subject']; + else + $transaction_subject = NULL; + if (isset($_POST['memo'])) + $memo = $_POST['memo']; + else + $memo = NULL; + if (isset($_POST['test_ipn'])) + $test_ipn = $_POST['test_ipn']; + else + $test_ipn = NULL; + if (isset($_POST['notify_version'])) + $notify_version = $_POST['notify_version']; + else + $notify_version = NULL; + if (isset($_POST['parent_txn_id'])) + $parent_txn_id = $_POST['parent_txn_id']; + else + $parent_txn_id = NULL; + if (isset($_POST['initial_payment_txn_id'])) + $initial_payment_txn_id = $_POST['initial_payment_txn_id']; + else + $initial_payment_txn_id = NULL; + if (isset($_POST['recurring_payment_id'])) + $recurring_payment_id = $_POST['recurring_payment_id']; + else + $recurring_payment_id = NULL; +/* if (isset($_POST['address_country'])) + $address_country = $_POST['address_country']; + else + $address_country = NULL;*/ + insertInstantPaypalNotificationData($ipnID, $payer_id, $payment_date, + $payment_status, $first_name, $last_name, $payer_email, $mc_currency, + $mc_gross, $mc_fee, $address_street, $address_city, $address_country, + $address_state, $address_country_code, $address_zip, $contact_phone, + $custom, $receipt_id, $payer_status, $quantity, $payment_type, + $receiver_email, $receiver_id, $item_name, $item_number, + $residence_country, $charset, $transaction_subject, $memo, $test_ipn, + $notify_version, $parent_txn_id, $initial_payment_txn_id, $recurring_payment_id); + } +} + +// Reply with an empty 200 response to indicate to paypal the IPN was received correctly. +header("HTTP/1.1 200 OK"); + + +?> \ No newline at end of file diff --git a/licence.php b/licence.php new file mode 100644 index 0000000..f76faf0 --- /dev/null +++ b/licence.php @@ -0,0 +1,128 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + $_SESSION['subNav'] = NULL; + $body->appendChild(generateSelectedMenuBar($doc)); + + + /* + * Insert content here. + */ + + $copyRight00 = "Copyright 2018 Murray Hayes"; + $copyRight01 = "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:"; + $copyRight02 = "1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer."; + $copyRight03 = "2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."; + $copyRight04 = "3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission."; + $copyRight05 = 'THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.'; + + $p = createP($doc); + $p->appendChild($doc->createTextNode($copyRight00)); + $body->appendChild($p); + + $p = createP($doc); + $p->appendChild($doc->createTextNode($copyRight01)); + $body->appendChild($p); + + $p = createP($doc); + $p->appendChild($doc->createTextNode($copyRight02)); + $body->appendChild($p); + + $p = createP($doc); + $p->appendChild($doc->createTextNode($copyRight03)); + $body->appendChild($p); + + $p = createP($doc); + $p->appendChild($doc->createTextNode($copyRight04)); + $body->appendChild($p); + + $p = createP($doc); + $p->appendChild($doc->createTextNode($copyRight05)); + $body->appendChild($p); + + + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + outputDoc($doc); + } +else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/login.php b/login.php new file mode 100644 index 0000000..4d2c21e --- /dev/null +++ b/login.php @@ -0,0 +1,135 @@ +appendChild($root); + + if (!isset($_SESSION['login']) || ($_SESSION['login'] === FALSE)) + { + $root->appendChild(generateHead($doc)); + $_SESSION['login'] = FALSE; + } + else + { + $meta = $doc->createElement('meta'); + $meta->setAttribute('http-equiv', 'refresh'); + //$meta->setAttribute('content', '0;' . $_SERVER['PHP_SELF'] . "?cookieCheck=true"); + //$meta->setAttribute('content', '0;https://' . $siteDomain . $baseDir . $memberDir . "members.php"); +/* + * This isn't needed anymore because I setup https on localhost and defined + * zombies in the hosts file. + if ($localHost) + $meta->setAttribute('content', '0;http://localhost' . $baseDir . $memberDir . "member.php"); + else + $meta->setAttribute('content', '0;https://' . $siteDomain . $baseDir . $memberDir . "member.php"); +*/ + + $meta->setAttribute('content', '0;https://' . $siteDomain . $baseDir . $memberDir . "member.php"); + $root->appendChild(generateHead($doc, $meta)); + } + $body = $doc->createElement('body'); + $body->appendChild(generateMastHead($doc, $baseDir)); + if ($_SESSION['login'] === FALSE) + { + $badPass = $doc->createElement('h3'); + $badPass->appendChild($doc->createTextNode($text0010)); + $body->appendChild($badPass); + /* + $badPass = $doc->createElement('h5'); + $badPass->appendChild($doc->createTextNode($_POST['username'] . " " . $_POST['password'])); + $body->appendChild($badPass);*/ + } + $body->appendChild(generateLoginForm($doc)); + + $body->appendChild(createAnchor($doc, 'password-reset.php', $text0012)); + + $body->appendChild(generateFooter($doc)); + $root->appendChild($body); + + outputDoc($doc); +} +else + generateCookieMonster(); + + +?> + \ No newline at end of file diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..2254dde --- /dev/null +++ b/logout.php @@ -0,0 +1,96 @@ +appendChild($root); + + $meta = $doc->createElement('meta'); + $meta->setAttribute('http-equiv', 'refresh'); + //$meta->setAttribute('content', '0;' . $_SERVER['PHP_SELF'] . "?cookieCheck=true"); + //$meta->setAttribute('content', '0;https://' . $siteDomain . $baseDir . $memberDir . "members.php"); +/* + * This isn't needed anymore because I set up https on the localhost and defined + * zombies in the hosts file. + if ($localHost) + $meta->setAttribute('content', '0;http://localhost' . $baseDir); + else + $meta->setAttribute('content', '0;https://' . $siteDomain . $baseDir); +*/ + + $meta->setAttribute('content', '0;https://' . $siteDomain . $baseDir); + $root->appendChild(generateHead($doc, $meta)); + + $body = $doc->createElement('body'); + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild(generateLoginForm($doc)); + + $body->appendChild(generateFooter($doc)); + $root->appendChild($body); + + outputDoc($doc); +} +else + generateCookieMonster(); + + + +?> diff --git a/member.php b/member.php new file mode 100644 index 0000000..5b62749 --- /dev/null +++ b/member.php @@ -0,0 +1,86 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + //$body->appendChild(generateMemberNavigationBar($doc)); + //$body->appendChild(generateNewNavigationBar($doc)); + + $_SESSION['subNav'] = NULL; + + $body->appendChild(generateSelectedMenuBar($doc)); + + if (isset($_SESSION['FirstName']) && isset($_SESSION['LastName'])) + $body->appendChild(generateMemberDetailReport($doc)); + $body->appendChild(generateMemberReport($doc)); + + + $body->appendChild(generateFooter($doc)); + + outputDoc($doc); + } + + +?> \ No newline at end of file diff --git a/memberEditor.php b/memberEditor.php new file mode 100644 index 0000000..91f2450 --- /dev/null +++ b/memberEditor.php @@ -0,0 +1,810 @@ +beginTransaction(); + //$sth = $dbh->prepare("SELECT * FROM members WHERE id = ?"); + $sth = $dbh->prepare($statement204); + $count = 0; + if ($sth->execute(array($_POST['id']))) + { + if ($row = $sth->fetch(PDO::FETCH_ASSOC)) + { + if (($row['first_name'] === $_POST['first_name']) && ($row['last_name'] === $_POST['last_name'])) + { + //print_r($_POST); + + if (isset($_POST['Vet_Now']) && ($_POST['Vet_Now'] === "Vet Now")) + { + //print ("Vetting..."); + $stb = $dbh->prepare($statement287); + $stb->execute(array($_POST['id'], $_POST['first_name'], $_POST['last_name'])); + } + else + { + /* + * All optional variable need to be checked. + */ + if (isset($_POST['current_start'])) + $currStart = $_POST['current_start']; + else + if (isset($row['current_start_date'])) + $currStart = $row['current_start_date']; + else + $currStart = ""; + if (isset($_POST['street_address'])) + $streetAddr = $_POST['street_address']; + else + if (isset($row['street_address'])) + $streetAddr = $row['street_address']; + else + $streetAddr = ""; + if (isset($_POST['guardian'])) + $guardian = $_POST['guardian']; + else + $guardian = ""; + if (isset($_POST['emergency_contact_name'])) + $emergContactName = $_POST['emergency_contact_name']; + else + $emergContactName = ""; + if (isset($_POST['emergency_contact_number'])) + $emergContactNumber = $_POST['emergency_contact_number']; + else + $emergContactNumber = ""; + if (isset($_POST['instructor'])) + $instCheck = TRUE; + else + $instCheck = FALSE; + if (isset($_POST['administrator'])) + $adminCheck = TRUE; + else + $adminCheck = FALSE; + if (isset($_POST['director'])) + $dirCheck = TRUE; + else + $dirCheck = FALSE; + if (isset($_POST['minor'])) + $minorCheck = TRUE; + else + $minorCheck = FALSE; + /* + $sth = $dbh->prepare("UPDATE members SET preferred_name = ?, nickname = ?, email = ?, expire_date = ?, " . + "current_start_date = ?, application_date = ?, status = ?, monthly_fees = ?, proto_cash = ?, " . + "minor = ?, birthdate = ?, guardian_name = ?, street_address = ?, city = ?, province = ?, " . + "postal_code = ?, phone = ?, emergency_contact_name = ?, emergency_contact_phone = ?, " . + "new_member_notes = ?, instructor = ?, administrator = ?, director = ? WHERE id = ? AND first_name = ? " . + "AND last_name = ?"); + */ + //print ("curr start: " . $currStart); + $sth = $dbh->prepare($statement222); + $sth->execute(array($_POST['prefered_name'], $_POST['nick_name'], $_POST['email'], $_POST['expire'], + $currStart, $_POST['application_date'], $_POST['status'], $_POST['monthly_fees'], + $_POST['proto_cash'], $minorCheck, $_POST['birth_date'], $_POST['guardian'], $streetAddr, + $_POST['city'], $_POST['province'], $_POST['postal_code'], $_POST['phone'], $emergContactName, + $emergContactNumber, $_POST['member_notes'], $instCheck, $adminCheck, + $dirCheck, $row['id'], $row['first_name'], $row['last_name'])); + } + } + } + } + } + catch (Exception $e) + { + print ("Fail! " . $e->getMessage() . "\n"); + } + } + else + if ($_SERVER['REQUEST_METHOD'] === 'GET') + { + + /** TODO: + * validate this input + */ + if (isset($_GET['id'])) + $edit = $_GET['id']; + } + + $root = $doc->appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + /* + $body->appendChild(generateMemberNavigationBar($doc)); + + + $body->appendChild(generateAdminNavigationBar($doc)); + $_SESSION['sub_nav'] = "Admin";*/ + + $_SESSION['subNav'] = 1; + $body->appendChild(generateSelectedMenuBar($doc, 1)); + + + if (isset($edit)) + $body->appendChild(generateMemberEditor($doc, $edit)); + + + $tableDiv = $doc->createElement('div'); + //$tableDiv->setAttribute('display', 'block'); + $tableDiv->setAttribute('class', 'FloatLeft50Div'); + $table = $doc->createElement('table'); + //$table.setAttribute('class' + //$table->setAttribute('class', 'FloatLeft50Div'); + $thead = $doc->createElement('thead'); + $tr = $doc->createElement('tr'); + + $th = $doc->createElement('th'); + $a = $doc->createElement('a'); + $a->appendChild($doc->createTextNode('ID')); + $th->appendChild($a); + $tr->appendChild($th); + + $th = $doc->createElement('th'); + $a = $doc->createElement('a'); + $a->appendChild($doc->createTextNode('First Name')); + $th->appendChild($a); + $tr->appendChild($th); + + $th = $doc->createElement('th'); + $a = $doc->createElement('a'); + $a->appendChild($doc->createTextNode('Last Name')); + $th->appendChild($a); + $tr->appendChild($th); + + $th = $doc->createElement('th'); + $th->appendChild($doc->createTextNode('Vetted')); + $tr->appendChild($th); + + $th = $doc->createElement('th'); + $th->appendChild($doc->createTextNode('Status')); + $tr->appendChild($th); + + $thead->appendChild($tr); + $table->appendChild($thead); + + $tbody = $doc->createElement('tbody'); + + $tint = false; + + $edit = NULL; + + try + { + //print_r(PDO::getAvailableDrivers()); + $dbh = returnDatabaseHandel(); + $dbh->beginTransaction(); + //$sth = $dbh->prepare("SELECT * FROM members"); /* SORT BY first_name;*/ + $sth = $dbh->prepare($statement101); + $count = 0; + if ($sth->execute()) + { + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) + { + if (isset($_GET['id'])) + if ($row['id'] === $_GET['id']) + $edit = $row; + + $count++; + $tr = $doc->createElement('tr'); + + /* + if ($tint === true) + { + $tr->setAttribute('class', 'AlternateRow'); + }*/ + /* + + try + { + $stg = $dbh->prepare("SELECT name FROM courses WHERE id = ?"); + if ($stg->execute(array($row['course_id']))) + { + $innerRow = $stg->fetch(PDO::FETCH_ASSOC); + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($innerRow['name'])); + $tr->appendChild($td); + } + } + catch (Exception $f) + { + echo "Fail! " . $f->getMessage() . "\n"; + } + */ + /* + $tint = !$tint; + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($course['Subject'])); + $tr->appendChild($td);*/ + + $td = $doc->createElement('td'); + $rr = $doc->createElement('a'); + $rr->setAttribute('href', "memberEditor.php?id=${row['id']}"); + $rr->appendChild($doc->createTextNode($row['id'])); + $td->appendChild($rr); + $tr->appendChild($td); + +/* + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($row['id'])); + $tr->appendChild($td);*/ + + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($row['first_name'])); + $tr->appendChild($td); + + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($row['last_name'])); //$row['Confirmed'])); + $tr->appendChild($td); + + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode($row['vetted_date'])); //$course['Open'])); + $tr->appendChild($td); + + $td = $doc->createElement('td'); + $td->appendChild($doc->createTextNode(returnMemberStatusByID($row['id']))); //$course['Open'])); + $tr->appendChild($td); + +/* $rr = $doc->createElement('a'); + $rr->setAttribute('href', "admin.php?id=${row['id']}"); + $rr->appendChild($tr);*/ + + $tbody->appendChild($tr); + } + } + $table->appendChild($tbody); + $tableDiv->appendChild($table); + $body->appendChild($tableDiv); + + } + catch (Exception $e) + { + echo "Failed!" . $e->getMessage() . "\n"; + } + + + if (!($edit === NULL)) + { + $editorDiv = $doc->createElement('div'); + $editorDiv->setAttribute('id', 'MemberEditorDiv'); + $titleSpan = createSpan($doc); + $label = $doc->createElement('H3'); + $label->appendChild($doc->createTextNode($edit['first_name'] . " " . $edit['middle_name'] . " " . $edit['last_name'])); + $picture = returnPictureForMember($edit['id']); + + + if (!is_null($picture)) + { + $img = createImg($doc, $pictureDir . $picture, $edit['first_name'] . " " . $edit['last_name'], "MemberEditorIconPicture"); + $label->appendChild($img); + } + + $titleSpan->appendChild($label); + $editorDiv->appendChild($titleSpan); + + $form = createForm($doc, 'password-reset.php', 'GET'); + + $input = createHiddenInput($doc, 'id', (string)$edit['id'], NULL, NULL, TRUE); + $form->appendChild($input); + $input = createSubmitInput($doc, $text0012, $text0012, NULL, NULL); + $form->appendChild($input); + $editorDiv->appendChild($form); + + $form = createForm($doc, 'addPicture.php', 'POST'); + $input = createHiddenInput($doc, 'target', (string)$edit['id'], NULL, NULL, TRUE); + $form->appendChild($input); + $input = createSubmitInput($doc, 'Change Picture', 'Change Picture'); + $form->appendChild($input); + $editorDiv->appendChild($form); + + /* + $form = $doc->createElement('form'); + $form->setAttribute('action', 'admin.php'); + $form->setAttribute('method', 'post'); + */ + $form = createForm($doc, 'admin.php'); + + $input = createHiddenInput($doc, 'id', $edit['id'], NULL, NULL, TRUE); + $form->appendChild($input); + + $input = createHiddenInput($doc, 'first_name', $edit['first_name'], NULL, NULL, TRUE); + $form->appendChild($input); + + $input = createHiddenInput($doc, 'last_name', $edit['last_name'], NULL, NULL, TRUE); + $form->appendChild($input); + + $fieldSet = $doc->createElement('fieldset'); + //$fieldSet->setAttribute('style', 'width:200px; max-width:300px;'); //margin-top:0.5em;'); + $fieldSetDiv = $doc->createElement('div'); + + $label = $doc->createElement('label', 'Prefered Name:'); + $label->setAttribute('for', 'prefered_name'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'prefered_name'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['prefered_name'])) + $input->setAttribute('value', $edit['prefered_name']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Nick Name:'); + $label->setAttribute('for', 'nick_name'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'nick_name'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['nick_name'])) + $input->setAttribute('value', $edit['nick_name']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'EMail Address:'); + $label->setAttribute('for', 'email'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'email'); + $input->setAttribute('name', 'email'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('class', 'MemberEditorInputField'); + if (isset($edit['email'])) + $input->setAttribute('value', $edit['email']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Expiration Date:'); + $label->setAttribute('for', 'expire'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'expire'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['expire_date'])) + $input->setAttribute('value', $edit['expire_date']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Current Start Date:'); + $label->setAttribute('for', 'current_start'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'current_start'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['current_start_date'])) + $input->setAttribute('value', $edit['current_start_date']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Application Date:'); + $label->setAttribute('for', 'application_date'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'application_date'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['application_date'])) + $input->setAttribute('value', $edit['application_date']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Vetted Date:'); + $label->setAttribute('for', 'vetted'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + + $now = date_create('now'); + $startDate = date_create($edit['current_start_date']); //, $dbDateFormat); + $startDate = date_add($startDate, DateInterval::createFromDateString('4 weeks')); + $expireDate = date_create($edit['expire_date']); + if (isset($edit['vetted_date'])) + { + if (is_null($edit['vetted_date'])) + { + if (($startDate < $now) && ($now < $expireDate)) + { + $input = createSubmitInput($doc, 'Vet Now', 'Vet Now'); + $fieldSetDiv->appendChild($input); + } + else + { + $input = createSubmitInput($doc, 'Not Vetable', 'Not Vetable'); + $fieldSetDiv->appendChild($input); + } + } + else + { + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'vetted'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['vetted_date'])) + $input->setAttribute('value', $edit['vetted_date']); + //$input->setAttribute('required', 'required'); + $input->setAttribute('readonly', 'readonly'); + } + $fieldSetDiv->appendChild($input); + } + else + { + if (($startDate < $now) && ($now < $expireDate)) + { + $input = createSubmitInput($doc, 'Vet Now', 'Vet Now'); + $fieldSetDiv->appendChild($input); + } + else + { + $input = createSubmitInput($doc, 'Not Vetable', 'Not Vetable'); + $fieldSetDiv->appendChild($input); + } + } + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Status:'); + $label->setAttribute('for', 'status'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'status'); + //$input->setAttribute('autocomplete', 'off'); + if (isset($edit['status'])) + $input->setAttribute('value', $edit['status']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Monthly Fees:'); + $label->setAttribute('for', 'monthly_fees'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'number'); + $input->setAttribute('name', 'monthly_fees'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('step', '0.01'); + $input->setAttribute('pattern', '^\d+(\.|\,)\d{2}$'); + if (isset($edit['monthly_fees'])) + $input->setAttribute('value', $edit['monthly_fees']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Protospace Cash:'); + $label->setAttribute('for', 'proto_cash'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'number'); + $input->setAttribute('name', 'proto_cash'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['proto_cash'])) + $input->setAttribute('value', $edit['proto_cash']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Minor:'); + $label->setAttribute('for', 'minor'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'checkbox'); + $input->setAttribute('name', 'minor'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['minor'])) + $input->setAttribute('checked', 'checked'); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Birth Date:'); + $label->setAttribute('for', 'birth_date'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'birth_date'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['birth_date'])) + $input->setAttribute('value', $edit['birth_date']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Guardian:'); + $label->setAttribute('for', 'guardian'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'guardian'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['guardian'])) + $input->setAttribute('value', $edit['guardian']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Street Address:'); + $label->setAttribute('for', 'address'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'address'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['street_address'])) + $input->setAttribute('value', $edit['street_address']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'City:'); + $label->setAttribute('for', 'city'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'city'); + //$input->setAttribute('autocomplete', 'off'); + if (isset($edit['city'])) + $input->setAttribute('value', $edit['city']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Province:'); + $label->setAttribute('for', 'province'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'province'); + //$input->setAttribute('autocomplete', 'off'); + if (isset($edit['province'])) + $input->setAttribute('value', $edit['province']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Postal Code:'); + $label->setAttribute('for', 'postal_code'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'postal_code'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['postal_code'])) + $input->setAttribute('value', $edit['postal_code']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Phone:'); + $label->setAttribute('for', 'phone'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'phone'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['phone'])) + $input->setAttribute('value', $edit['phone']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Emergency Contact Name:'); + $label->setAttribute('for', 'emergency_name'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'emergency_name'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['emergency_contact_name'])) + $input->setAttribute('value', $edit['emergency_contact_name']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Emergency Contact Number:'); + $label->setAttribute('for', 'emergency_number'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'emergency_number'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['emergency_contact_number'])) + $input->setAttribute('value', $edit['emergency_contact_number']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Instructor:'); + $label->setAttribute('for', 'instructor'); + $label->setAttribute('class', 'MemberEditorInputLabelTight'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'checkbox'); + $input->setAttribute('name', 'instructor'); + $input->setAttribute('class', 'MemberEditorInputFieldTight'); + $input->setAttribute('autocomplete', 'off'); + if (returnInstructorStatus($edit['id'])) + $input->setAttribute('checked', 'checked'); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + + $label = $doc->createElement('label', 'Administrator:'); + $label->setAttribute('for', 'administrator'); + $label->setAttribute('class', 'MemberEditorInputLabelTight'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'checkbox'); + $input->setAttribute('name', 'administrator'); + $input->setAttribute('class', 'MemberEditorInputFieldTight'); + $input->setAttribute('autocomplete', 'off'); + if (returnAdminStatus($edit['id'])) + $input->setAttribute('checked', 'checked'); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + + $label = $doc->createElement('label', 'Director:'); + $label->setAttribute('for', 'director'); + $label->setAttribute('class', 'MemberEditorInputLabelTight'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'checkbox'); + $input->setAttribute('name', 'director'); + $input->setAttribute('class', 'MemberEditorInputFieldTight'); + $input->setAttribute('autocomplete', 'off'); + if (returnDirectorStatus($edit['id'])) + $input->setAttribute('checked', 'checked'); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + + $label = $doc->createElement('label', 'Member Notes:'); + $label->setAttribute('for', 'member_notes'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'textarea'); + $input->setAttribute('name', 'member_notes'); + $input->setAttribute('rows', '3'); + $input->setAttribute('autocomplete', 'off'); + if (isset($edit['member_notes'])) + $input->setAttribute('value', $edit['member_notes']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $fieldSet->appendChild($fieldSetDiv); + + $form->appendChild($fieldSet); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'reset'); + $form->appendChild($input); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'submit'); + $form->appendChild($input); + $editorDiv->appendChild($form); + $body->appendChild($editorDiv); + } + + $body->appendChild(generateFooter($doc)); + + outputDoc($doc); + } + else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/memberList.php b/memberList.php new file mode 100644 index 0000000..4ecb7cc --- /dev/null +++ b/memberList.php @@ -0,0 +1,118 @@ +createElement('html'); + $root = $doc->appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + + $_SESSION['subNav'] = NULL; + $body->appendChild(generateSelectedMenuBar($doc)); + + //$body->appendChild(generateMemberNavigationBar($doc)); + + /* + * Insert content here. + */ + /* + $searchDiv = $doc->createElement('div'); + $searchDiv->setAttribute('class', 'memberListSearch'); + $searchForm = $doc->createElement('form'); + $searchForm->setAttribute('action', 'memberList.php'); + $searchForm->setAttribute('method', 'get'); + $label = $doc->createElement('H3'); + $label->appendChild($doc->createTextNode('Member Name: ')); + $searchForm->appendChild($label); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'search'); + $searchForm->appendChild($input); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'submit'); + $input->setAttribute('value', 'Search'); + $searchForm->appendChild($input); + + $searchDiv->appendChild($searchForm); + $body->appendChild($searchDiv); + */ + $body->appendChild(generateMemberSearchForm($doc, "memberList.php")); + + $body->appendChild(generateMemberTableWithPictures($doc)); + + $body->appendChild(generateFooter($doc)); + + outputDoc($doc); + } +else + generateIndexRedirect(); + + +?> diff --git a/memberMeeting.php b/memberMeeting.php new file mode 100644 index 0000000..6f04938 --- /dev/null +++ b/memberMeeting.php @@ -0,0 +1,117 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + /* + $body->appendChild(generateMemberNavigationBar($doc)); + $body->appendChild(generateDirectorNavigationBar($doc)); + */ + + + $body->appendChild(generateSelectedMenuBar($doc, 2)); + + + /* + * Insert content here. + */ + $body->appendChild(generateMeetingAttendance($doc)); +/* if ($_SERVER['REQUEST_METHOD'] === 'GET') + { + if (isset($_GET['search'])) + { + $body->appendChild(generateMemberSelection($doc, "memberMeeting.php")); + } + }*/ + //$body->appendChild(generateMemberSelection($doc, "memberMeeting.php", "useStatement230")); + + $body->appendChild(generateFooter($doc)); + + outputDoc($doc); + } +else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/members-protospace-ca.svg b/members-protospace-ca.svg new file mode 100644 index 0000000..73c8833 --- /dev/null +++ b/members-protospace-ca.svg @@ -0,0 +1,40 @@ + + + + + + + image/svg+xml + + + + + + + members.protospace.ca + + diff --git a/members-protospace-ca2.svg b/members-protospace-ca2.svg new file mode 100644 index 0000000..4fd019d --- /dev/null +++ b/members-protospace-ca2.svg @@ -0,0 +1,66 @@ + + + + + + + + image/svg+xml + + + + + + + members.protospace.ca + + diff --git a/members.css b/members.css new file mode 100644 index 0000000..29f2fb6 --- /dev/null +++ b/members.css @@ -0,0 +1,416 @@ +@CHARSET "UTF-8"; + +html { + margin: 0; + padding: 0; +} + +body { + /* + font: 755 georgia, sans-serif; + line-height: 1.0; */ + //color: #1010FF; + color: #EEEEEE; + //background: #FFFFFF; + background: #010101;] + margin: 0; + padding: 0; +} + +p { + margin-top: 0; + text-align: inherit; +} + +a:link { + font-weight: bold; + text-decoration: none; + //color: #111111; + //color: #ee82ee; + color: #EEEEEE; +} + +a:visited { + font-weight: bold; + text-decoration: none; + //color: #111111; + //color: #ee82ee; + color: #EEEEEE; +} + +abbr { + border-bottom: none; +} + +#BodyDiv { + display: inline-block; + margin: auto; + width: 100%; + /*h-align: center;*/ +} + +.masthead { + + position: -webkit-sticky; + position: sticky; + + //position: fixed; + top: 0; + width: 100%; + + text-align: center; + //color: #ff0000; + color: #010101; + background-color: #010101; + //background-color: #025fff; + //background-color: #32cd32; +} + +.mastheadgraphic { +/* float: left; */ + +} + + + +#memberDetailPicture { + max-width: 250px; + max-height: 400px; + width: auto; + height: auto; +} + +.memberListThumbnailPicture { + max-width: 80px; + max-height: 120px; + width: auto; + height: auto; +} + +.memberListRow { + height: 120px; + valign: center; +} + +.memberListThumbnailPicture:hover { + max-width: 250px; + max-height: 400px; + width: auto; + height: auto; + overflow: visible; + position: absolute; + //top: 0px; // this does the top of the view port not the cell.... + //left: 0px; + //text-align: top; + + z-index: 5; +} + +.memberReport { + float: right; +} + +#statusCurrent { + color: green; +} + +#statusDue { + color: yellow; +} + +#statusOverdue { + color: red; +} + +#statusContractor { + color: grey; +} + +.memberListSearch { + align: center; +} + +.memberDetailPicture { + display: inline; + float: left; + /* + max-width: 250px; + max-height: 400px; + width: auto; + height: auto;*/ +} + +.LoginDiv { + font: Arial, sans-serif; + pasition: absolute; + right: 0px; + width: 300px; + +} + +.LoginLabel { + text-alight: left; + float: left; +} + +.LoginButton { + position: relative; + display: inline-block; +} + +.SignupButton { + position: relative; + display: inline-block; +} + + +.DropdownLogForm { + display: none; + position: absolute; + box-shadow: 0px 8px 16px 0px; + opacity: 1.0; + background-color: #FFFFFF; + color: #000000; /* Needed to prevent transperancy */ + padding: 12px 16px; + z-index: 1; +} + +.LoginButton:onclick .DropdownLogForm { + display: block; +} + +.LoginButton:hover .DropdownLogForm { + display: block; +} + +.BodyDiv { + display: block; + width: 100%; +} + +table { + border-collapse: collapse; + background-color: #010101; + color: #EEEEEE; +} + +table, th { + //border: 1px solid black; + border: 1px solid white; + /* + position: -webkit-sticky; + position: sticky; + top: 20; + */ +} + +tr:nth-child(even) { + background-color: #484848; + color: #EEEEEE; +} + +tr:nth-child(odd) { + background-color: #010101; + color: #EEEEEE; +} + + +.BriefTable { + overflow-y:auto; + /*float: right;*/ +} + +tr:nth-child(even).Undecorated { + background-color: #FFFFFF; + +} + +td.centerAlign { + text-align: center; +} + +td.rightAlign { + text-align: right; +} + +td.padLeftAndRight { + padding-left: 2px; + padding-right: 2px; +} + +.FloatLeft50Div { + display: block-inline; + float: left; + /*clear: left;*/ + width: 45%; + margin: 10px; +} + +.NewClassDiv label { + //float: left; + width: 25%; + text-align: right; + //padding: 20px; + margin: 5px; +} + +.NewClassDiv input { + //float: left; + //width: 35%; + margin: 3px; +} + +#MemberSignupDiv { + /*position: -webkit-sticky; + position: sticky;*/ + top: 5; + width: 45%; + /* float: right; */ + background-color: cyan; + border: 2px solid blue; +} + + +#ClassTableDiv { + float: left; + width:70%; + margin: 10px; +} + +#MemberEditorDiv { + position: -webkit-sticky; + position: sticky; + top: 5; + width: 45%; + float: right; + background-color: green; + border: 2px solid blue; +} + +#TransactionEditorDiv { + position: fixed; + top: initial; + right: 0; + background-color: green; + border: 2px solid blue; +} + + +.transactionDetailDiv { + background-color: #800040; + /* width: 65%; */ + width: auto; + //display: inline; + border: 2px solid; + padding: 10px; +} + +.transactionDetailElement { + display: inline-block; + outline-style: solid; + outline-color: invert; + outline-width: thin; + border: 0px; + padding: 0px; + margin: 0px; +} + +.memberDetailTableDiv { + display: inline-block; + background-color: pink; + border: 2px solid; + padding: 10px; +} + +.memberDetailTable { + display: inline-block; + background-color: purple; + //border: 2px solid; +} + +.memberDetailTable tr:nth-child(even) { + background-color: #484848; + color: #EEEEEE; +} + +.memberDetailTable tr:nth-child(odd) { + background-color: #010101; + color: #EEEEEE; +} + + +.memberDetailReport { + //background-color: yellow; + background-color: #010101; + color: #EEEEEE; +} + +.MemberEditorInputLabel { + display: inline-block; + float: left; + clear: left; + width: 45%; +} + +.MemberEditorInputLabelTight { + display: inline-block; + width: 15%; +} + +.MemberEditorInputField { + display: inline-block; + //float: left; +} + +.MemberEditorInputFieldTight { + display: inline-block; + width: 10%; +} + +.MemberEditorIconPicture { + width:48px; + height:48px; +} + +.sticky { + position: sticky; + top: 5; +} + +#CourseEditorDiv { + //display: inline-block; + //display: block; + //display: inline; + //position: -webkit-sticky; + //position: sticky; + //postition: absolute; + //top: 5; + position: fixed; + top: initial; + right: 0; + //left: 5; + width: 45%; + //float: right; + background-color: green; + border: 2px solid blue; + z-index: -5; +} + + +.footer { + display: inline-block; + width: 100%; + color: #EEEEEE; + background-color: #010101; + //background-color: #1010FF; +} + + +.readMe { + width: 90%; + align: center; + padding: 5%; + left: 5%; + right: 5%; +} + diff --git a/membersAlt.css b/membersAlt.css new file mode 100644 index 0000000..70064dd --- /dev/null +++ b/membersAlt.css @@ -0,0 +1,356 @@ +@CHARSET "UTF-8"; + +html { + margin: 0; + padding: 0; +} + +body { + /* + font: 755 georgia, sans-serif; + line-height: 1.0; */ + //color: #1010FF; + //color: #EEEEEE; + color: $010101; + //background: #FFFFFF; + //background: #010101; + background: $EEEEEE; + margin: 0; + padding: 0; +} + +p { + margin-top: 0; + text-align: inherit; +} + +a:link { + font-weight: bold; + text-decoration: none; + //color: #111111; + //color: #ee82ee; + //color: #EEEEEE; + color: $010101; +} + +a:visited { + font-weight: bold; + text-decoration: none; + //color: #111111; + //color: #ee82ee; + //color: #EEEEEE; + color: #010101; +} + +abbr { + border-bottom: none; +} + +#BodyDiv { + display: inline-block; + margin: auto; + width: 100%; + /*h-align: center;*/ +} + +.masthead { + text-align: center; + //color: #ff0000; + color: #010101; + background-color: #EEEEEE; + //background-color: #010101; + //background-color: #025fff; + //background-color: #32cd32; +} + +.mastheadgraphic { +/* float: left; */ + +} + + + +#memberDetailPicture { + max-width: 250px; + max-height: 400px; + width: auto; + height: auto; +} + +.memberListThumbnailPicture { + max-width: 80px; + max-height: 120px; + width: auto; + height: auto; +} + +.memberListRow { + height: 120px; + valign: center; +} + +.memberListThumbnailPicture:hover { + max-width: 250px; + max-height: 400px; + width: auto; + height: auto; + overflow: visible; + position: absolute; + //top: 0px; // this does the top of the view port not the cell.... + //left: 0px; + //text-align: top; + + z-index: 5; +} + +.memberReport { + float: right; +} + +#statusCurrent { + color: green; +} + +#statusDue { + color: yellow; +} + +#statusOverdue { + color: red; +} + +#statusContractor { + color: black; +} + +.memberListSearch { + align: center; +} + +.memberDetailPicture { + display: inline; + float: left; + /* + max-width: 250px; + max-height: 400px; + width: auto; + height: auto;*/ +} + +.LoginDiv { + font: Arial, sans-serif; + pasition: absolute; + right: 0px; + width: 300px; + +} + +.LoginLabel { + text-alight: left; + float: left; +} + +.LoginButton { + position: relative; + display: inline-block; +} + +.SignupButton { + position: relative; + display: inline-block; +} + + +.DropdownLogForm { + display: none; + position: absolute; + box-shadow: 0px 8px 16px 0px; + opacity: 1.0; + background-color: #FFFFFF; + color: #000000; /* Needed to prevent transperancy */ + padding: 12px 16px; + z-index: 1; +} + +.LoginButton:onclick .DropdownLogForm { + display: block; +} + +.LoginButton:hover .DropdownLogForm { + display: block; +} + +.BodyDiv { + display: block; + width: 100%; +} + +table { + border-collapse: collapse; + color: #010101; + background-color: #EEEEEE; + //background-color: #010101; + //color: #EEEEEE; +} + +table, th { + //border: 1px solid black; + border: 1px solid white; +} + +tr:nth-child(even) { + color: #010101; + background-color: #EEEEEE; + //background-color: #484848; + //color: #EEEEEE; +} + +tr:nth-child(odd) { + color: #010101; + background-color: #A8A8A8; + //background-color: #484848; + //background-color: #010101; + //color: #EEEEEE; +} + + +.BriefTable { + overflow-y:auto; + /*float: right;*/ +} + +tr:nth-child(even).Undecorated { + background-color: #EEEEEE; +} + +.FloatLeft50Div { + display: block-inline; + float: left; + /*clear: left;*/ + width: 45%; + margin: 10px; +} + +#MemberSignupDiv { + /*position: -webkit-sticky; + position: sticky;*/ + top: 5; + width: 45%; + /* float: right; */ + background-color: cyan; + border: 2px solid blue; +} + + +#ClassTableDiv { + float: left; + width:70%; + margin: 10px; +} + +#MemberEditorDiv { + position: -webkit-sticky; + position: sticky; + top: 5; + width: 45%; + float: right; + background-color: green; + border: 2px solid blue; +} + +.memberDetailTableDiv { + display: inline-block; + background-color: pink; + border: 2px solid; + padding: 10px; +} + +.memberDetailTable { + display: inline-block; + background-color: purple; + //border: 2px solid; +} + +.memberDetailTable tr:nth-child(even) { + color: #010101; + background-color: #EEEEEE; + //background-color: #484848; + //color: #EEEEEE; +} + +.memberDetailTable tr:nth-child(odd) { + color: #010101; + background-color: #484848; + //background-color: #010101; + //color: #EEEEEE; +} + + +.memberDetailReport { + color: #010101; + background-color: #EEEEEE; + //background-color: yellow; + //background-color: #010101; + //color: #EEEEEE; +} + +.MemberEditorInputLabel { + display: inline-block; + float: left; + clear: left; + width: 45%; +} + +.MemberEditorInputLabelTight { + display: inline-block; + width: 15%; +} + +.MemberEditorInputField { + display: inline-block; + //float: left; +} + +.MemberEditorInputFieldTight { + display: inline-block; + width: 10%; +} + +.sticky { + position: sticky; + top: 5; +} + +#CourseEditorDiv { + //display: inline-block; + //display: block; + //display: inline; + //position: -webkit-sticky; + //position: sticky; + top: 5; + //left: 5; + width: 45%; + float: right; + background-color: green; + border: 2px solid blue; +} + +.footer { + display: inline-block; + width: 100%; + color: #010101; + background-color: #EEEEEE; + //color: #EEEEEE; + //background-color: #010101; + //background-color: #1010FF; +} + + +.readMe { + width: 90%; + align: center; + padding: 5%; + left: 5%; + right: 5%; +} + diff --git a/menu.css b/menu.css new file mode 100644 index 0000000..5d0ba8d --- /dev/null +++ b/menu.css @@ -0,0 +1,38 @@ +@CHARSET "UTF-8"; + + +.NavBar { + list-style-type: none; + margin: 0; + padding: 0; + border: 0; + color: #ff0000; + background-color: #025fff; + //background-color: #32cd32; +} + +.NavItem { + display: inline; + padding: 12px; + font-family: 'Arial'; + font-size: 30px; + +} + +#DirectorNavBar { + position: relative; + left: 5%; +} + +#AdminNavBar { + position: relative; + left: 5%; +} + +#TrainingNavBar { + position: relative; + left: 5%; +} + + + diff --git a/menu0.css b/menu0.css new file mode 100644 index 0000000..8c962ad --- /dev/null +++ b/menu0.css @@ -0,0 +1,70 @@ +@CHARSET "UTF-8"; + + +/* + * NavBarRedux + */ + +.NavBarDiv { + overflow: hidden; + background-color: #333; + font-family: Arial; +} + +.NavBarDiv a { + float: left; + font-size: 16px; + color: white; + text-align: center; + padding: 14px 16px; + text-decoration: none; +} + +.NavBarDropDown { + float: left; + overflow: hidden; +} + +.NavBarDropDown .NavBarDropDownButton { + font-size: 16px; + border: none; + outline: none; + color: white; + padding: 14px 16px; + background-color: inherit; + font-family: inherit; /* Important for vertical align on mobile phones */ + margin: 0; /* Important for vertical align on mobile phones */ +} + +.NavBar a:hover .NavBarDropDown:hover .NavBarDropDownButton { + background-color: red; +} + +.NavBarDropDownContent { + float: none; + color: black; + padding: 12px 16px; + text-decoration: none; + display: block; + text-align: left; +} + +.NavBarDropDownContent a { + float: none; + color: black; + padding: 12px 16px; + text-decoration: none; + display: block; + text-align: left; +} + +.NavBarDropDownContent a:hover { + background-color: #ddd; +} + +.NavBarDropDown:hover .NavBarDropDownContent { + display: block; +} + + + diff --git a/menu1.css b/menu1.css new file mode 100644 index 0000000..cf2161d --- /dev/null +++ b/menu1.css @@ -0,0 +1,85 @@ +@CHARSET "UTF-8"; + + +/* + * NavBarRedux + */ + +.NavBarDiv { + overflow: hidden; + background-color: #333; + font-family: Arial; +} + +.NavBarDiv a { + float: left; + font-size: 16px; + color: white; + text-align: center; + padding: 14px 16px; + text-decoration: none; +} + +.NavBarDropDown { + //display: none; + float: left; + overflow: hidden; + color: white; + bacground-color: #333; +} + +.NavBarDropDown .NavBarDropDownButton { + font-size: 16px; + border: none; + outline: none; + color: white; + padding: 14px 16px; + background-color: inherit; + font-family: inherit; /* Important for vertical align on mobile phones */ + margin: 0; /* Important for vertical align on mobile phones */ +} + +.NavBarDiv a:hover .NavBarDropDown:hover .NavBarDropDownButton { + background-color: red; +} + +.NavBarDropDownContent { +/* display: none; + float: none; + color: black; + padding: 12px 16px; + text-decoration: none; + display: block; + text-align: left;*/ + display: none; + position: absolute; + //background-color: #f9f9f9; + background-color: #333; + color: white; + z-index: 1; +/* min-width: 160px; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);*/ +} + +.NavBarDropDownContent a { + //display: none; + float: none; + //color: black; + color: white; + background-color: #333; + padding: 12px 16px; + text-decoration: none; + display: block; + text-align: left; +} + +.NavBarDropDownContent a:hover { + background-color: #ddd; +} + +.NavBarDropDown:hover .NavBarDropDownContent { + display: block; +} + + + diff --git a/new-transaciton.php b/new-transaciton.php new file mode 100644 index 0000000..cf4875e --- /dev/null +++ b/new-transaciton.php @@ -0,0 +1,97 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + $_SESSION['subNav'] = NULL; + $body->appendChild(generateSelectedMenuBar($doc)); + + + /* + * Insert content here. + */ + + + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + outputDoc($doc); + } +else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/password-reset.php b/password-reset.php new file mode 100644 index 0000000..fb65abe --- /dev/null +++ b/password-reset.php @@ -0,0 +1,283 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + + /* + * Insert content here. + */ + + if ($_SERVER['REQUEST_METHOD'] == 'POST') + { + if (isset($_POST['TokenID']) && isset($_POST['password1']) && isset($_POST['password2'])) + { + /* + * We have a TokenID and two passwords on POST + * If everything checks out, reset the password. + */ + + $token = cleanInput($_POST['TokenID']); + + if ($_POST['password1'] === $_POST['password2']) + { + $newPassword = $_POST['password1']; + $memberID = FALSE; + $memberID = verifyPasswordResetToken($token); + if (!($memberID === FALSE)) + { + /* + * everything looks good, update the password and clear the token. + */ + + } + } + } + if (isset($_POST['useremail'])) + { + /* + * Send a password reset url + */ + + $targetEmail = cleanInput($_POST['useremail']); + + /* + * Apply some sanity to this because there is no userid to log + * abusive requests to. + */ + + if (strpos($targetEmail, ';') === FALSE && + strpos($targetEmail, '"') === FALSE && + strpos($targetEmail, "'") === FALSE && + strpos($targetEmail, '?') === FALSE && + strpos($targetEmail, "/") === FALSE && + strpos($targetEmail, "\\") === FALSE) + { + $mailArray = returnPasswordResetTokenArray($targetEmail); + if (!is_null($mailArray)) + { + $mailTo = $mailArray['email']; + $token = $mailArray['token']; + //print ("token is " . strlen($token) . " characters long"); + $firstName = $mailArray['firstName']; + $lastName = $mailArray['lastName']; + $subject = "Request to change your password has been recieved"; + $message = "Hello $firstName, we have received a request to change " . + "your password. If this request was not made by you do not " . + "respond to this email. If you continue to receive these requests " . + "please let us know. To reset your password, follow this link: " . + "http://$siteDomain$baseDir/password-reset.php?TokenID=$token " . + "and you will be guided through the rest of the process. Again, " . + "it is safe to ignore this email if you do not want to reset your " . + "password. Abuse can be reported to mailto:info@protospace.ca "; + if (!$passwordResetMailSilence) + { + mail($mailTo, $subject, $message); + } + else + { + $label = $doc->createElement('h3'); + $label->appendChild($doc->createTextNode("This message would have been sent but it was silenced")); + $body->appendChild($label); + + $label = $doc->createElement('p'); + $label->appendChild($doc->createTextNode($message)); + $body->appendChild($label); + } + } + } + } + } + else + { + if (isset($_GET['TokenID'])) + { + $memberID = FALSE; + /* + * Check the token and reset the password + */ + $token = cleanInput($_GET['TokenID']); + + /* + * Tokens will have very specific formats that should be checked. + */ + + /** TODO: + * Make this more better, less sucky + */ + if (strlen($token) == 64) + { + $memberID = verifyPasswordResetToken($token); + + if (!($memberID === FALSE)) + { + $label = $doc->createElement('h3'); + $label->appendChild($doc->createTextNode("Reset Password")); + $body->appendChild($label); + + $form = createForm($doc, "password-reset.php"); + $fieldSet = $doc->createElement('fieldset'); + $fieldSetDiv = $doc->createElement('div'); + $fieldSet->appendChild($fieldSetDiv); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'hidden'); + $input->setAttribute('name', 'TokenID'); + $input->setAttribute('value', $token); + $fieldSetDiv->appendChild($input); + + $label = $doc->createElement('label', 'Enter new password:'); + $label->setAttribute('for', 'password1'); + $label->setAttribute('class', 'CourseEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'password'); + $input->setAttribute('name', 'password1'); + $input->setAttribute('value', ''); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('required', 'required'); + //$input->setAttribute(''); + $fieldSetDiv->appendChild($input); + + $label = $doc->createElement('label', 'Confirm new password:'); + $label->setAttribute('for', 'password2'); + $label->setAttribute('class', 'CourseEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'password'); + $input->setAttribute('name', 'password2'); + $input->setAttribute('value', ''); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('required', 'required'); + //$input->setAttribute(''); + $fieldSetDiv->appendChild($input); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'submit'); + $input->setAttribute('value', 'Reset Password'); + $fieldSetDiv->appendChild($input); + + $form->appendChild($fieldSet); + $body->appendChild($form); + } + } + } + else + { + /* + * Offer a password reset + */ + $label = $doc->createElement('h3'); + $label->appendChild($doc->createTextNode("Reset Password")); + $body->appendChild($label); + + $form = createForm($doc, "password-reset.php"); + $fieldSet = $doc->createElement('fieldset'); + $fieldSetDiv = $doc->createElement('div'); + $fieldSet->appendChild($fieldSetDiv); + + /* + $label = $doc->createElement('label', 'Username:'); + $label->setAttribute('for', 'username'); + $label->setAttribute('class', 'CourseEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'username'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute(''); + $fieldSetDiv->appendChild($input); + */ + + $label = $doc->createElement('label', 'Email:'); + $label->setAttribute('for', 'useremail'); + $label->setAttribute('class', 'CourseEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'useremail'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_GET['id']) && + (returnAdminStatus($_SESSION['MemberID']) || returnDirectorStatus($_SESSION['MemberID']))) + { + $input->setAttribute('value', returnUserEmail((int)cleanInput($_GET['id']))); + } + //$input->setAttribute(''); + $fieldSetDiv->appendChild($input); + + $input = $doc->createElement('input'); + $input->setAttribute('type', 'submit'); + $form->appendChild($input); + + $form->appendChild($fieldSet); + $body->appendChild($form); + } + } + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + outputDoc($doc); +} +else +{ + generateCookieMonster(); +} + +?> + diff --git a/pitches.php b/pitches.php new file mode 100644 index 0000000..b8879cb --- /dev/null +++ b/pitches.php @@ -0,0 +1,97 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + $_SESSION['subNav'] = NULL; + $body->appendChild(generateSelectedMenuBar($doc)); + + + /* + * Insert content here. + */ + $h3 = $doc->createElement('h3'); + $h3->appendChild($doc->createTextNode("This is where members will pitch projects")); + $body->appendChild($h3); + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + outputDoc($doc); + } +else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/preferences.php b/preferences.php new file mode 100644 index 0000000..e54287f --- /dev/null +++ b/preferences.php @@ -0,0 +1,482 @@ += 0 && $cleaned <= 1) + $set_style = $cleaned; + } + + try + { + $dbh = returnDatabaseHandel(); + $dbh->beginTransaction(); + $sth = $dbh->prepare($statement255); + $sth->execute(array($set_lang, $set_xml, $set_mobi, $set_style, $_SESSION['MemberID'])); + $dbh->commit(); + + } + catch (Exception $e) + { + print("Failed ut update user_options " . $e->getMessage()); + $dbh->rollBack(); + } + + } + } + + + $root = $doc->appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + $_SESSION['subNav'] = NULL; + + $body->appendChild(generateSelectedMenuBar($doc)); + + + /* + * Insert content here. + */ + + $db_lang = 'en'; + $db_xml = TRUE; + $db_mobi = TRUE; + $db_set = 0; + + try + { + $dbh = returnDatabaseHandel(); + $sth = $dbh->prepare($statement254); + $count = 0; + if ($sth->execute(array($_SESSION['MemberID']))) + { + while ($row = $sth->fetch(PDO::FETCH_ASSOC)) // && ($row['start_datetime'] > date(''))) + { + $count++; + $db_lang = $row['language']; + $db_xml = $row['prefer_xml']; + $db_mobi = $row['despize_mobile']; + $db_set = $row['prefered_css']; + } + } + } + catch (Exception $e) + { + + } + + + $h3 = $doc->createElement('h3'); + $h3->appendChild($doc->createTextNode($text0100)); + $body->appendChild($h3); + + $form = createForm($doc, "preferences.php"); + $fieldSet = $doc->createElement('fieldset'); + + $label = $doc->createElement('label', $text0101); + $label->setAttribute('for', 'xml'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSet->appendChild($label); + $input = $doc->createElement('select'); + $input->setAttribute('name', 'language'); + + $option = $doc->createElement('option'); + $option->setAttribute('value', 'zz'); + if (isset($_SESSION['language']) && $_SESSION['language'] === 'zz') + $option->setAttribute('selected', 'selected'); + $option->appendChild($doc->createTextNode('Browser')); + $input->appendChild($option); + + + $option = $doc->createElement('option'); + $option->setAttribute('value', 'en'); + if (isset($_SESSION['language']) && $_SESSION['language'] === 'en') + $option->setAttribute('selected', 'selected'); + $option->appendChild($doc->createTextNode('English')); + $input->appendChild($option); + + $option = $doc->createElement('option'); + $option->setAttribute('value', 'fr'); + if (isset($_SESSION['language']) && $_SESSION['language'] === 'fr') + $option->setAttribute('selected', 'selected'); + $option->appendChild($doc->createTextNode('French')); + $input->appendChild($option); + + $option = $doc->createElement('option'); + $option->setAttribute('value', 'es'); + if (isset($_SESSION['language']) && $_SESSION['language'] === 'es') + $option->setAttribute('selected', 'selected'); + $option->appendChild($doc->createTextNode('Spanish')); + $input->appendChild($option); + + $fieldSet->appendChild($input); + $label = $doc->createElement('br'); + $fieldSet->appendChild($label); + + + $label = $doc->createElement('label', $text0102); + $label->setAttribute('for', 'xml'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSet->appendChild($label); + $input = createCheckboxInput($doc, 'xml', 'xml', NULL, NULL, FALSE); +/* $input = $doc->createElement('input'); + $input->setAttribute('type', 'checkbox'); + $input->setAttribute('name', 'xml'); + $input->setAttribute('value', 'xml'); + $input->setAttribute('autocomplete', 'off'); */ + + if ($_SESSION['prefXML'] === TRUE) + $input->setAttribute('checked', 'checked'); +// else +// $input->setAttribute('checked', ''); + $fieldSet->appendChild($input); + $label = $doc->createElement('br'); + $fieldSet->appendChild($label); + + $label = $doc->createElement('label', $text0103); + $label->setAttribute('for', 'mobile'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSet->appendChild($label); + $input = createCheckboxInput($doc, 'mobile', 'mobile', NULL, NULL, FALSE); +/* $input = $doc->createElement('input'); + $input->setAttribute('type', 'checkbox'); + $input->setAttribute('name', 'mobile'); + $input->setAttribute('value', 'mobile'); + $input->setAttribute('autocomplete', 'off'); */ + if ($_SESSION['despizeMobile'] === TRUE) + $input->setAttribute('checked', 'checked'); +// else +// $input->setAttribute('checked', ''); + $fieldSet->appendChild($input); + $label = $doc->createElement('br'); + $fieldSet->appendChild($label); + + $label = $doc->createElement('label', $text0104); + $label->setAttribute('for', 'style'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSet->appendChild($label); + $input = $doc->createElement('select'); + $input->setAttribute('name', 'style'); + $input->setAttribute('autocomplete', 'off'); + for ($i = 0; $i < 2; $i++) + { + $option = $doc->createElement('option'); + $option->setAttribute('value', $i); + if ($i === $_SESSION['prefCSS']) + $option->setAttribute('selected', 'selected'); + $option->appendChild($doc->createTextNode($i)); + $input->appendChild($option); + } + + $fieldSet->appendChild($input); + $label = $doc->createElement('br'); + $fieldSet->appendChild($label); + + /* + * The order of this is unusual to provide for special labeling. + */ + + $extendedText = $text0105; + $input = createCheckboxInput($doc,'customCSS', 'customCSS', NULL, NULL, FALSE); + if (userHasRegisteredCustomCSS($_SESSION['MemberID'])) + { + /* + * SECURITE - if the original file name was not properly sterilized, this + * is where the injection attack can occur. + */ + $extendedText .= "(" . returnUserCSSOriginalFileName($_SESSION['MemberID']) . ")"; + if ($_SESSION['useCustomCSS'] === TRUE) + $input->setAttribute('checked', 'checked'); + } + else + { + $input->setAttribute('disabled', 'disabled'); + $extendedText .= "($text0107)"; + } + $label = $doc->createElement('label', $extendedText); + $label->setAttribute('for', 'customCSS'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSet->appendChild($label); + $fieldSet->appendChild($input); + $label = $doc->createElement('br'); + $fieldSet->appendChild($label); + + $label = $doc->createElement('label', $text0106); + $label->setAttribute('for', 'cssfile'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSet->appendChild($label); + $input =$doc->createElement('input'); + $input->setAttribute('type', 'file'); + $input->setAttribute('name', 'cssfile'); + $fieldSet->appendChild($input); + + $input = createSubmitInput($doc, $text0007, $text0007); +/* $input = $doc->createElement('input'); + $input->setAttribute('type', 'submit'); + $input->setAttribute('name', $text0007); + $input->setAttribute('value', $text0007); */ + $fieldSet->appendChild($input); + $label = $doc->createElement('br'); + $fieldSet->appendChild($label); + + if (returnMemberUseEncryptions($_SESSION['MemberID'])) + $label = createLabel($doc, $text0130, 'encryptEmail', 'MemberEditorInputLabel', 'Checked'); + else + $label = createLabel($doc, $text0130, 'encryptEmail', 'MemberEditorInputLabel'); + $fieldSet->appendChild($label); + $label = createCheckboxInput($doc, 'encryptEmail'); + $fieldSet->appendChild($label); + $label = createBr($doc); + $fieldSet->appendChild($label); + + + $label = $doc->createElement('label', $text0131); + $label->setAttribute('for', 'pgpkeyfile'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSet->appendChild($label); + $input =$doc->createElement('input'); + $input->setAttribute('type', 'file'); + $input->setAttribute('name', 'pgpkeyfile'); + $fieldSet->appendChild($input); + + $input = createSubmitInput($doc, $text0007, $text0007); + + $form->appendChild($fieldSet); + + $input = createSubmitInput($doc, $text0005, $text0005); +/* $input = $doc->createElement('input'); + $input->setAttribute('type', 'submit'); + $input->setAttribute('name', $text0005); + $input->setAttribute('value', $text0005);*/ + $form->appendChild($input); + + if ($changed) + { + $input = createSubmitInput($doc, $text0006, $text0006); +/* $input = $doc->createElement('input'); + $input->setAttribute('type', 'submit'); + $input->setAttribute('name', $text0006); + $input->setAttribute('value', $text0006); */ + $form->appendChild($input); + } + + $body->appendChild($form); + + $body->appendChild(generateFooter($doc)); + + if ($prettyPretty) + $doc->formatOutput = true; + outputDoc($doc); + } +else + generateIndexRedirect(); + +?> \ No newline at end of file diff --git a/processIPNs.php b/processIPNs.php new file mode 100644 index 0000000..d13e52d --- /dev/null +++ b/processIPNs.php @@ -0,0 +1,169 @@ + array('min_range' => 1)); + + if (isset($_GET['id']) && (filter_var($_GET['id'], FILTER_VALIDATE_INT, $options) !== FALSE)) + { + $ipn = returnPendingIPN($_GET['id']); + if (!is_null($ipn)) + { + $ipnDetailForm = createForm($doc, 'processIPNs.php'); + $ipnDetail = createTable($doc); + $tr = createTr($doc); + $tr->appendChild(createTd($doc, 'IPN ID')); + $tr->appendChild(createTd($doc, $ipn['id'])); + $ipnDetail->appendChild($tr); + $tr = createTr($doc); + $tr->appendChild(createTd($doc, 'TXN ID')); + $tr->appendChild(createTd($doc, $ipn['txn_id'])); + $ipnDetail->appendChild($tr); + $tr = createTr($doc); + $tr->appendChild(createTd($doc, 'IPN Type')); + $tr->appendChild(createTd($doc, $ipn['txn_type'])); + $ipnDetail->appendChild($tr); + $tr = createTr($doc); + $tr->appendChild(createTd($doc, 'IPN Payer ID')); + $tr->appendChild(createTd($doc, $ipn['payer_id'])); + $ipnDetail->appendChild($tr); + $tr = createTr($doc); + $tr->appendChild(createTd($doc, 'IPN First Name')); + $tr->appendChild(createTd($doc, $ipn['first_name'])); + $ipnDetail->appendChild($tr); + $tr = createTr($doc); + $tr->appendChild(createTd($doc, 'IPN Last Name')); + $tr->appendChild(createTd($doc, $ipn['last_name'])); + $ipnDetail->appendChild($tr); + $tr = createTr($doc); + $tr->appendChild(createTd($doc, 'IPN Payment Date')); + $tr->appendChild(createTd($doc, $ipn['payment_date'])); + $ipnDetail->appendChild($tr); + $tr = createTr($doc); + $tr->appendChild(createTd($doc, 'Date of Record')); + $tr->appendChild(createTd($doc, $ipn['incoming_timestamp'])); + $ipnDetail->appendChild($tr); + $tr = createTr($doc); + $tr->appendChild(createTd($doc, 'IPN Gross')); + $tr->appendChild(createTd($doc, $ipn['mc_gross'])); + $ipnDetail->appendChild($tr); + $tr = createTr($doc); + $tr->appendChild(createTd($doc, 'Select Member')); + $td = createTd($doc); + $td->appendChild(generateMemberSelector($doc, 'targetMember')); + $tr->appendChild($td); + $ipnDetail->appendChild($tr); + $ipnDetailForm->appendChild($ipnDetail); + $ipnDetailForm->appendChild(createHiddenInput($doc, 'id', $ipn['id'])); + $ipnDetailForm->appendChild(createLabel($doc, 'Add To Known Paypal IDs', 'makePayerKnown')); + $ipnDetailForm->appendChild(createCheckboxInput($doc, 'makePayerKnown')); + $ipnDetailForm->appendChild(createBr($doc)); + $ipnDetailForm->appendChild(createSubmitInput($doc, 'assignIPN', 'Assign IPN to Member')); + } + } + } + + processInstantPaypalNotificationQueue(); + $root = $doc->appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + //$body->appendChild($doc->createElement('hr')); + + $_SESSION['subNav'] = 1; + $body->appendChild(generateSelectedMenuBar($doc, 1)); + + + /* + * Insert content here. + */ + + if (!is_null($ipnDetailForm)) + $body->appendChild($ipnDetailForm); + $body->appendChild(generatePendingIPNTable($doc, 'processIPNs.php')); + + $body->appendChild(generateFooter($doc)); + if ($prettyPretty) + $doc->formatOutput = true; + outputDoc($doc); + } + else + { + generateIndexRedirect(); + //print ("redirect"); + } + +?> \ No newline at end of file diff --git a/signup.php b/signup.php new file mode 100644 index 0000000..f662b6e --- /dev/null +++ b/signup.php @@ -0,0 +1,530 @@ +appendChild($root); + $root->appendChild(generateHead($doc)); + + $body = $doc->createElement('body'); + $root->appendChild($body); + + $body->appendChild(generateMastHead($doc, $baseDir)); + + if (!isset($_SESSION['login']) || $_SESSION['login'] === FALSE) + + /* + * Insert content here. + */ + + if ($_SERVER['REQUEST_METHOD'] === 'POST') + { + if (isset($_POST['first_name']) && isset($_POST['last_name']) && isset($_POST['email']) && isset($_POST['monthly_fees']) + && isset($_POST['application_date']) && isset($_POST['password1']) && isset($_POST['password2']) + && ($_POST['password1'] === $_POST['password2'])) + { + try + { + /* + + $newMemberID = insertIntoMemberTable(); + $newMemberID = returnIdFromUsername($_) + */ + if (insertIntoMemberTable()) + { + /* + * Print Application Form PDF + */ + $newMemberID = returnIdFromUsername($_POST['first_name'] . "." . $_POST['last_name']); + $pdf = new ApplicationForm(getMemberRowData($newMemberID)); + $pdf->Output(); + + //printApplicationForm(); + } + } + catch (Exception $e) + { + if ($e->getCode() == 23000) + { + $h1 = $doc->createElement('h1'); + $h1->appendChild($doc->createTextNode('A user by that exact name already exists.')); + $body->appendChild($h1); + } + } + } + else + { + print ("short\n"); + } + } + else + { + $editorDiv = $doc->createElement('div'); + $editorDiv->setAttribute('id', 'MemberSignupDiv'); + $form = $doc->createElement('form'); + $form->setAttribute('action', 'signup.php'); + $form->setAttribute('method', 'post'); + $label = $doc->createElement('H3'); + $label->appendChild($doc->createTextNode("New Member Signup")); + $form->appendChild($label); + + $fieldSet = $doc->createElement('fieldset'); + //$fieldSet->setAttribute('style', 'width:200px; max-width:300px;'); //margin-top:0.5em;'); + $fieldSetDiv = $doc->createElement('div'); + + + $label = $doc->createElement('label', 'First Name:'); + $label->setAttribute('for', 'first_name'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'first_name'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('required', 'required'); + if (isset($_POST['first_name'])) + $input->setAttribute('value', $_POST['first_name']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Middle Name:'); + $label->setAttribute('for', 'middle_name'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'middle_name'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['middle_name'])) + $input->setAttribute('value', $_POST['middle_name']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Last Name:'); + $label->setAttribute('for', 'last_name'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'last_name'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('required', 'required'); + if (isset($_POST['last_name'])) + $input->setAttribute('value', $_POST['last_name']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Prefered Name:'); + $label->setAttribute('for', 'prefered_name'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'prefered_name'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['prefered_name'])) + $input->setAttribute('value', $_POST['prefered_name']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Nick Name:'); + $label->setAttribute('for', 'nick_name'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'nick_name'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['nick_name'])) + $input->setAttribute('value', $_POST['nick_name']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'EMail Address:'); + $label->setAttribute('for', 'email'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'email'); + $input->setAttribute('name', 'email'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('class', 'MemberEditorInputField'); + $input->setAttribute('required', 'required'); + if (isset($_POST['email'])) + $input->setAttribute('value', $_POST['email']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); +/* + $label = $doc->createElement('label', 'Expiration Date:'); + $label->setAttribute('for', 'expire'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'expire'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['expire'])) + $input->setAttribute('value', $_POST['expire']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Current Start Date:'); + $label->setAttribute('for', 'current_start'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'current_start'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['current_start_date'])) + $input->setAttribute('value', $_POST['current_start_date']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + */ + + $label = $doc->createElement('label', 'Application Date:'); + $label->setAttribute('for', 'application_date'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'application_date'); + $input->setAttribute('autocomplete', 'off'); + $currentTime = date('Y-m-d'); + if (isset($_POST['application_date'])) + $input->setAttribute('value', $_POST['application_date']); + else + $input->setAttribute('value', "$currentTime"); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + /* + $label = $doc->createElement('label', 'Status:'); + $label->setAttribute('for', 'status'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'status'); + //$input->setAttribute('autocomplete', 'off'); + if (isset($_POST['status'])) + $input->setAttribute('value', $_POST['status']); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + */ + + $label = $doc->createElement('label', 'Monthly Rate:'); + $label->setAttribute('for', 'monthly_fees'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('select'); + //$input->setAttribute('type', 'select'); + $input->setAttribute('name', 'monthly_fees'); + $option = $doc->createElement('option'); + $option->setAttribute('value', '55'); + $option->setAttribute('selected', 'selected'); + $option->appendChild($doc->createTextNode("$55.00")); + $input->appendChild($option); + $option = $doc->createElement('option'); + $option->setAttribute('value', '35.00'); + $option->appendChild($doc->createTextNode("$35.00")); + $input->appendChild($option); + +/* $input->setAttribute('type', 'number'); + $input->setAttribute('name', 'monthly_fees'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('step', '0.01'); + $input->setAttribute('pattern', '^\d+(\.|\,)\d{2}$'); + $input->setAttribute('value', '55');*/ + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Birth Date:'); + $label->setAttribute('for', 'birth_date'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'date'); + $input->setAttribute('name', 'birth_date'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['birth_date'])) + $input->setAttribute('value', $_POST['birth_date']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Minor:'); + $label->setAttribute('for', 'minor'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'checkbox'); + $input->setAttribute('name', 'minor'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['minor']) /* || ($_POST['birth_date'] - 18) */) + $input->setAttribute('value', $_POST['minor']); + /* $input->setAttribute('required', 'required'); */ + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Guardian:'); + $label->setAttribute('for', 'guardian'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'guardian'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['guardian'])) + $input->setAttribute('value', $_POST['guardian']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Street Address:'); + $label->setAttribute('for', 'address'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'address'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['street_address'])) + $input->setAttribute('value', $_POST['street_address']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'City:'); + $label->setAttribute('for', 'city'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'city'); + //$input->setAttribute('autocomplete', 'off'); + if (isset($_POST['city'])) + $input->setAttribute('value', $_POST['city']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Province:'); + $label->setAttribute('for', 'province'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'province'); + //$input->setAttribute('autocomplete', 'off'); + if (isset($_POST['province'])) + $input->setAttribute('value', $_POST['province']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Postal Code:'); + $label->setAttribute('for', 'postal_code'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'postal_code'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['postal_code'])) + $input->setAttribute('value', $_POST['postal_code']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Phone:'); + $label->setAttribute('for', 'phone'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'phone'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['phone'])) + $input->setAttribute('value', $_POST['phone']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Emergency Contact Name:'); + $label->setAttribute('for', 'emergency_name'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'emergency_name'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['emergency_contact_name'])) + $input->setAttribute('value', $_POST['emergency_contact_name']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + $label = $doc->createElement('label', 'Emergency Contact Number:'); + $label->setAttribute('for', 'emergency_number'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'text'); + $input->setAttribute('name', 'emergency_number'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['emergency_contact_number'])) + $input->setAttribute('value', $_POST['emergency_contact_number']); + //$input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + + $label = $doc->createElement('label', 'Password:'); + $label->setAttribute('for', 'password1'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'password'); + $input->setAttribute('name', 'password1'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('required', 'required'); + if (isset($_POST['password1'])) + $input->setAttribute('value', $_POST['password1']); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + + $label = $doc->createElement('label', 'Confirm:'); + $label->setAttribute('for', 'password2'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('input'); + $input->setAttribute('type', 'password'); + $input->setAttribute('name', 'password2'); + $input->setAttribute('autocomplete', 'off'); + $input->setAttribute('required', 'required'); + $fieldSetDiv->appendChild($input); + $label = $doc->createElement('br'); + $fieldSetDiv->appendChild($label); + + + $label = $doc->createElement('label', 'Member Notes:'); + $label->setAttribute('for', 'member_notes'); + $label->setAttribute('class', 'MemberEditorInputLabel'); + $fieldSetDiv->appendChild($label); + $input = $doc->createElement('textarea'); + //$input->setAttribute('type', 'textarea'); + $input->setAttribute('name', 'member_notes'); + $input->setAttribute('rows', '3'); + $input->setAttribute('cols', '50'); + $input->setAttribute('autocomplete', 'off'); + if (isset($_POST['member_notes'])) + $input->setAttribute('value', $_POST['member_notes']); + //$input->setAttribute('required', 'required'); + + /* A child node is required to create a proper closing tag for