if (empty($_REQUEST['username'])) { $errors['username'] = '******'; } if (empty($_REQUEST['password'])) { $errors['password'] = '******'; } if (!isset($errors)) { require_once "classWeddingUser.inc"; //Note: model class sanitizes input $currentUser = new weddingUser(); if ($usrID = $currentUser->validateUser($_REQUEST['username'], $_REQUEST['password'])) { $currentUser->setCurrentUser($usrID); //set session variables with userID, name, etc $_SESSION['userID'] = $currentUser->getCurrentUserID(); $_SESSION['username'] = $currentUser->getCurrentUsername(); $_SESSION['name'] = $currentUser->getCurrentFullName(); if ($currentUser->getCurrentUserIsAdmin()) { $_SESSION['login'] = 2; } else { $_SESSION['login'] = 1; } //regular user //"guest" hack: if ($_SESSION['username'] == "Guest") { $_SESSION['guest'] = true; } else { $_SESSION['guest'] = false; } if ($currentUser->getCurrentUserIsBridalShower()) { $_SESSION['isBridalShower'] = true; //special sections for exclusive bridal shower guests
?> " /></td> <td><label for="notesRSVP">User RSVP Notes: </label></td> <td><textarea name="notesRSVP" id="notesRSVP" cols="20" rows="1" placeholder="User-Submitted Notes" tabindex="<?php echo $tabIndex++; ?> "><?php echo $invalidSubmit ? isset($_REQUEST['notesRSVP']) ? $_REQUEST['notesRSVP'] : '' : $userEditor->getCurrentNotesRSVP(); ?> </textarea></td> </tr> <tr> <td><label for="name">Display Name: </label></td> <td><input type="text" name="name" id="name" value="<?php echo $invalidSubmit ? isset($_REQUEST['name']) ? $_REQUEST['name'] : '' : $userEditor->getCurrentFullName(); ?> " placeholder="Name Shown to User" size="25" maxlength="254" required tabindex="<?php echo $tabIndex++; ?> " /></td> <td><label for="gift">Admin Gift Notes: </label></td> <td><textarea name="gift" id="gift" cols="20" rows="3" placeholder="Our gift notes" tabindex="<?php echo $tabIndex++; ?> "><?php echo $invalidSubmit ? isset($_REQUEST['gift']) ? $_REQUEST['gift'] : '' : $userEditor->getCurrentGift(); ?> </textarea></td> </tr>
} </script> <section class=content> <?php require_once "classWeddingUser.inc"; $currentUser = new weddingUser(); $currentUser->setCurrentUser($_SESSION['userID']); if (isset($_REQUEST['submitted'])) { //echo print_r($_REQUEST); $isUpdate = $currentUser->getCurrentIsRSVP(); $oldTotal = $currentUser->getCurrentNumAttending(); $oldSumAttending = $currentUser->getTotalAttending(); if ($isUpdate) { $emailMsg = '<strong>Changed RSVP Submitted</strong><br /> ' . date(DATE_RFC850) . '<br />--------<pre>'; $emailMsg .= 'Name: ' . $currentUser->getCurrentFullName() . "\r\n"; $emailMsg .= 'Username: '******'UserID: ' . $currentUser->getcurrentUserID() . "\r\n\r\n"; } foreach ($_REQUEST['isPlusOne'] as $attID => $isPlusOne) { if ($isUpdate) { $emailMsg .= '[' . ($_REQUEST['isAttending'][$attID] == 'on' ? 'x' : ' ') . '] ' . $_REQUEST['displayName'][$attID] . '(ID: ' . $attID . ")"; $emailMsg .= ' - Previous: [' . ($currentUser->getAttendeeIsAttending($attID) ? 'x' : ' ') . '] ' . $currentUser->getAttendeeDisplayName($attID) . "\r\n"; } if ($_REQUEST['displayName'][$attID] != '') { $currentUser->updateAttendeeRSVP($attID, $_REQUEST['isAttending'][$attID] == 'on' ? true : false, $isPlusOne, $_REQUEST['displayName'][$attID]); } else { $currentUser->updateAttendeeRSVP($attID, $_REQUEST['isAttending'][$attID] == 'on' ? true : false, $isPlusOne); } } $currentUser->updateCurrentRSVP($_REQUEST['email'], $_REQUEST['notesRSVP']);