Example #1
0
/**
 * 
 * @param Event $event
 */
function eventsInfo($event)
{
    $current_user = wp_get_current_user();
    $output = View::outputEventInfo($event);
    $participantsStatus = getParticipantsStatus($current_user->ID, $event->getEventID());
    $action = View::eventActionOutput($_GET['page_id'], $participantsStatus, $event->getEventID());
    $output .= "<table><tr><th>{$action}</th><th><a href = '?page_id=" . $_GET['page_id'] . "'>" . BACK . "</a></tr>";
    $output .= "</table></div>";
    return $output;
}
Example #2
0
 /**
  * Outputs the list of event participants and their current statuses
  * @param array $participants
  * @param Event $event
  */
 public static function outputParticipantsList($participants, $event)
 {
     $output = View::outputEventInfo($event, array(EVENT_TITLE_LONG => 'title_long', EVENT_TITLE_SHORT => 'title_short', EVENT_DATE_TIME => 'date_time'));
     $output .= "<h3>" . PARTICIPANTS . "</h3><form action = '' method = 'post' name = 'participants'>" . "<table>";
     foreach ($participants as $participant) {
         $user = get_userdata($participant['userID']);
         $output .= '<tr><td>' . $user->data->display_name . '</td><td>' . View::outputOptions('status_user' . $user->ID, array(STATUS_COMPLETED => STATUS_COMPLETED_TITLE, STATUS_SIGN_IN => STATUS_SIGNED_IN_TITLE, STATUS_MISSED => STATUS_MISSED_TITLE, STATUS_SIGN_OUT => STATUS_SIGNED_OUT_TITLE), $participant['status'], false);
         $output .= '</td></tr>';
     }
     $output .= "</table>";
     if (!empty($participants)) {
         $output .= "<input type = 'submit' value = '" . BUTTON_SUBMIT . "'>";
     }
     $output .= "</form>";
     echo $output;
 }
 /**
  * Sends a mail notification that the user is signed out from the event
  * 
  * @param string $email
  * @param Event $event
  */
 public static function sendSignOutMail($email, $event)
 {
     $message = MAIL_CONTENT_SIGNOUT . View::outputEventInfo($event, array(EVENT_TITLE_LONG => 'title_long', EVENT_TITLE_SHORT => 'title_short', EVENT_DATE_TIME => 'date_time')) . "\r\n" . MAIL_CONTACT_INFO;
     wp_mail($email, MAIL_CONTENT_HEADER_SIGNOUT, $message, MailNotifications::$headers);
 }