*/
// Set Globals
if (!isset($_GET['async']) || $_GET['async'] == "false") {
    // asynchronous validation
    $ASYNC = false;
} else {
    $ASYNC = true;
}
if (basename(__FILE__) == basename($_SERVER["SCRIPT_FILENAME"]) && !$ASYNC) {
    $INCLUDEX = true;
} else {
    $INCLUDEX = false;
}
include 'class/rsvp.inc';
// include the class
$rsvpForm = new RSVPForm();
// create the class
// Controller for three possibilities:
// 1. rsvp.php?validate=validatekey
if (isset($_GET['validate'])) {
    // Stage 2, validation without javscript
    // Show header, if called directly and not async
    if ($INCLUDEX) {
        include_once 'view/header.inc';
    }
    // Validate form
    switch ($rsvpForm->ValSession()) {
        case 0:
            // If validates
            include 'view/rsvp_confirmation.inc';
            // Present data to user
Example #2
0
 /**
  * Show the event form
  *
  * @return void
  */
 function showContent()
 {
     if (!empty($this->error)) {
         $this->element('p', 'error', $this->error);
     }
     $form = new RSVPForm($this->event, $this);
     $form->show();
     return;
 }
Example #3
0
 /**
  * Add a new event
  *
  * @return void
  */
 function cancelRSVP()
 {
     try {
         $notice = $this->rsvp->getNotice();
         // NB: this will delete the rsvp, too
         if (!empty($notice)) {
             common_log(LOG_DEBUG, "Deleting notice...");
             $notice->delete();
         } else {
             common_log(LOG_DEBUG, "Deleting RSVP alone...");
             $this->rsvp->delete();
         }
     } catch (ClientException $ce) {
         $this->error = $ce->getMessage();
         $this->showPage();
         return;
     }
     if ($this->boolean('ajax')) {
         $this->startHTML('text/xml;charset=utf-8');
         $this->elementStart('head');
         // TRANS: Page title after sending a notice.
         $this->element('title', null, _m('Event saved'));
         $this->elementEnd('head');
         $this->elementStart('body');
         $form = new RSVPForm($this->event, $this);
         $form->show();
         $this->elementEnd('body');
         $this->endHTML();
     }
 }