Esempio n. 1
0
    $currentUser->updateCurrentRSVP($_REQUEST['email'], $_REQUEST['notesRSVP']);
    if ($isUpdate) {
        $emailMsg .= 'TotalAttending: ' . $currentUser->getCurrentNumAttending() . "\r\n";
        $emailMsg .= 'Previous Total: ' . $oldTotal . "\r\n";
        $delta = -($oldTotal - intval($currentUser->getCurrentNumAttending()));
        $emailMsg .= 'Delta:         ' . ($delta >= 0 ? '+' : '') . $delta . "\r\n\r\n";
        $emailMsg .= 'Email: ' . $currentUser->getcurrentUserEmail() . "\r\n";
        $emailMsg .= "\r\n\r\nNotes: \r\n" . $currentUser->getCurrentNotesRSVP();
        $emailMsg .= '</pre>--------<br />';
        $emailMsg .= 'Total Currently RSVP\'d: ' . $currentUser->getTotalAttending() . '<br />';
        $emailMsg .= 'Before this update:     ' . $oldSumAttending;
        require_once "emailDetails.inc";
        //echo 'DEBUG:<br />Mailto: ' . $mailto . '<br />Subject: ' . 'Updated RSVP - ' . $currentUser->getCurrentFullName() . '<br />Headers: ' . $headers . '<br />Email Body:<br />' . $emailMsg . '<br /><br />';
        mail($mailto, 'Updated RSVP - ' . $currentUser->getCurrentFullName(), $emailMsg, $headers);
    }
    echo '<p>Thanks for the ' . ($isUpdate ? 'update' : 'response') . '! We have ' . $currentUser->getCurrentAmountAttending() . ' confirmed guests in your party. ';
    if ($currentUser->getCurrentNumAttending() == 0) {
        echo 'That\'s a <em>little</em> bit sad, but it will be OK.</p>';
    } else {
        echo 'Huzzah!</p>';
    }
    if ($isUpdate) {
        echo '<p>An email has been sent for you.</p>';
    }
}
if (!$currentUser->getCurrentIsRSVP()) {
    echo '<p>Hello, ' . $currentUser->getCurrentFullName() . '! Are you ready to create your adventuring group for our wedding?</p><hr style="width:65%;margin-top:20px;margin-bottom:20px;" /><p>Please check off who can attend:</p>';
} else {
    echo '<p>You can unlock your RSVP to edit at any time. We\'ll get an email that you\'ve made changes so we can take note of it, no worries.</p>';
    echo '<p><input type="button" id="lockButton" class="lockedButton" onclick="toggleLock()" value="Locked" /></p>';
}