示例#1
0
$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']);
    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();