Пример #1
0
/**
 * ifcrush_frat() shortcode entry point
 * Fraternities can view their events, create events, register PNMs
 *
 * KBL todo - on failure to access due to login, maybe we should add a link to the
 * login page
 **/
function ifcrush_frat()
{
    global $debug;
    if ($debug) {
        echo "[ifcrush_frat] ";
    }
    if (false == is_user_logged_in()) {
        echo "sorry you must logged in as a recruitment chair to use this page.";
        return;
    }
    $current_user = wp_get_current_user();
    if (is_user_an_rc($current_user)) {
        $frat_letters = get_frat_letters($current_user);
    } else {
        echo "sorry you must be a recruitment chair to use this page";
        return;
    }
    /* Now I know who I am.
     * Lets see if there are any forms to handle 
     */
    if (isset($_POST['action'])) {
        ifcrush_frat_handle_forms($_POST['action'], $frat_letters);
    } else {
        /* Create the options for a fraternity.*/
        echo "Hello {$frat_letters}.";
        ifcrush_frat_show_options();
    }
}
Пример #2
0
/**
 * ifcrush_frat() shortcode entry point
 * Fraternities can view their events, create events, register PNMs
 *
 **/
function ifcrush_frat()
{
    global $debug;
    //if ($debug) echo "[ifcrush_frat] ";
    if (!is_user_logged_in()) {
        echo "sorry you must logged in as a fraternity to access this page.";
        return;
    }
    $current_user = wp_get_current_user();
    if (is_user_an_rc($current_user)) {
        $frat_letters = get_frat_letters($current_user);
    } else {
        echo "sorry you must be a recruitment chair to use this page";
        return;
    }
    /* Now I know who I am.
     * Lets see if there are any forms to handle 
     */
    if (isset($_POST['action'])) {
        ifcrush_frat_handle_forms($_POST['action'], $frat_letters);
    } else {
        /* List events and actions for this fraternity */
        echo "Hello {$frat_letters}. ";
        echo "Here are your events.";
        echo "<br>";
        ifcrush_display_request_report_form();
        ifcrush_display_events($frat_letters);
    }
    /** all done **/
}
Пример #3
0
/**
 * Display event table - short code entry point
 **/
function ifcrush_display_eventreg_placeholder()
{
    /* sort out who is logged in */
    if (!is_user_logged_in()) {
        echo "sorry you must be logged use register pnms for events";
        return;
    }
    $current_user = wp_get_current_user();
    if (is_user_an_rc($current_user)) {
        /* get the frat of the rc */
        $fratLetters = get_frat_letters($current_user);
        ifcrush_display_eventreg($fratLetters);
    } else {
        /* assume its an admin */
        ifcrush_display_eventreg("");
    }
    ifcrush_eventreg_handle_form();
    // handle updates, adds, deletes
}
Пример #4
0
/**  This is the short code ifcrush_report_rusheesbyfrat entry point **/
function ifcrush_display_reports()
{
    if (!is_user_logged_in()) {
        echo "sorry you must be logged use reporting";
        return;
    }
    $current_user = wp_get_current_user();
    if (is_user_an_rc($current_user)) {
        /* pass user info to reporting function so only
         * that frat's info is displayed
         */
        $fratLetters = get_frat_letters($current_user);
        ifcrush_display_frat_events($fratLetters);
    } else {
        /* assume its an admin */
        ifcrush_display_events_by_frat_form(isset($_POST['letters']) ? $_POST['letters'] : "");
        if (isset($_POST['reportype'])) {
            ifcrush_report_handle_form();
        }
    }
}