function ifcrush_frat_handle_forms($action, $frat_letters) { ifcrush_frat_show_options(); switch ($action) { case "View Reports": //ifcrush_display_done_form( "Return to Event List" ); echo "<h2>Reports for {$frat_letters}</h2>"; echo '<div id="accordion">'; ifcrush_create_frat_report($frat_letters); echo '</div>'; break; case "Update Event": case "Delete Event": case "Add Event": ifcrush_event_handle_form($frat_letters); ifcrush_display_events($frat_letters); break; case "Show PNMS": ifcrush_display_done_form("Return to Event List"); ifcrush_display_register_pnm_at_event($_POST['eventID'], $frat_letters); break; case "Delete Event Reg": ifcrush_display_done_form("Finished showing PNMS"); /* add function call to delete this event registration */ ifcrush_eventreg_handle_form("delete registration"); ifcrush_display_register_pnm_at_event($_POST['eventID'], $frat_letters); break; case "Register this PMN": ifcrush_display_done_form("Finished showing PNMS"); /* add this specific PMN to the event, and then display everything */ ifcrush_eventreg_handle_form("add registration"); ifcrush_display_register_pnm_at_event($_POST['eventID']); break; case "Register PMNs": ifcrush_display_done_form("Finished showing PNMS"); /* display the pmns registered for this event and a form for one more */ ifcrush_display_register_pnm_at_event($_POST['eventID']); break; case "View Event Table": echo "<h2>Event Table for {$frat_letters}</h2>"; ifcrush_display_events($frat_letters); break; case "View Bid Offer Form": ifcrush_bid_show_bid_form($frat_letters); break; case "Create Bid": ifcrush_bid_handle_bid_form($frat_letters); break; default: echo "unknown action : {$action}<br>"; //die(); } }
/** * 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 }
function ifcrush_frat_handle_forms($action, $frat_letters) { switch ($action) { case "Create Report": ifcrush_display_done_form("Return to Fraternity Home"); echo "<h3>Report for {$frat_letters}</h3>"; ifcrush_create_frat_report($frat_letters); break; case "Update Event": case "Delete Event": case "Add Event": ifcrush_event_handle_form($frat_letters); ifcrush_display_events($frat_letters); break; case "Show PNMS": ifcrush_display_done_form("Return to Fraternity Home"); ifcrush_display_register_pnm_at_event($_POST['eventID'], $frat_letters); break; case "Delete Event Reg": ifcrush_display_done_form("Finished showing PNMS"); /* add function call to delete this event registration */ ifcrush_eventreg_handle_form("delete registration"); ifcrush_display_register_pnm_at_event($_POST['eventID'], $frat_letters); break; case "Register this PMN": ifcrush_display_done_form("Finished showing PNMS"); /* add this specific PMN to the event, and then display everything */ //echo "register ". $_POST['pnm_netID'] . " at " . $_POST['eventID'] . " <br>"; ifcrush_eventreg_handle_form("add registration"); ifcrush_display_register_pnm_at_event($_POST['eventID']); break; case "Register PMNs": ifcrush_display_done_form("Finished showing PNMS"); /* display the pmns registered for this event and a form for one more */ echo "display register pmns and add form for one more<br>"; ifcrush_display_register_pnm_at_event($_POST['eventID']); break; default: echo "unknown action : {$action}<br>"; } }