$action = strtolower(filter_input(INPUT_GET, 'action')); if ($action == NULL) { $action = 'list_presentations'; } } switch ($action) { case 'list_presentations': // Get the presentation list $presentationList = get_all_presentations(); // View the list of presentations include 'presentation_list.php'; exit; break; case 'show_modify_presentation': $presentation_id = filter_input(INPUT_GET, 'presentation_id'); $presentation = SeniorPresentation::getPresentation($presentation_id); $fields = get_field_list(); //$teachers = get_teachers(); //$presentation_types = get_presentation_types(); include '../../senior/show_modify_presentation.php'; exit; break; /*case 'modify_presentation': $error_msg = ''; $choice = filter_input(INPUT_POST, 'choice'); $presentation_id = filter_input(INPUT_POST, 'presentation_id'); $presentation_nbr = filter_input(INPUT_POST, 'presentation_nbr'); $presentation_name = filter_input(INPUT_POST, 'presentation_name'); $presentation_short_name = filter_input(INPUT_POST, 'presentation_short_name'); $presentation_desc = filter_input(INPUT_POST, 'presentation_desc');
public function addPresForUser($usr_id) { // begin transaction global $db; $db->beginTransaction(); try { // Check if the user currently has a presentation for this session. // If so, remove it. // The loop is a bit of overkill, but in case of an erroneous situation of the user having multiple // presentations for the same session, this will remove those extra cases. // // Include a check to make sure that presenters don't overwrite their presentations through this method. $presentations = get_presentations_by_user_by_session($usr_id, $this->ses_id); foreach ($presentations as $presentation) { if ($presentation['presenting'] == 1) { $db->rollback(); display_user_message("You cannot add a presentation for this session since you are presenting at the same time.", '../itinerary'); exit; } SeniorPresentation::deletePresentationsByUser($usr_id, $presentation['pres_id']); } // Inserts the new session for the user. $this->insert_presentation_for_user($usr_id); // commit transaction $db->commit(); } catch (PDOException $e) { // roll back transaction $db->rollback(); // log any errors to file log_pdo_exception($e, $usr_id, "Adding Presentation:" . $this, "addPresForUser"); display_error("Error saving data."); exit; } }
// Need to code $choice = filter_input(INPUT_POST, 'choice'); $pres_id = filter_input(INPUT_POST, 'pres_id'); $pres_title = filter_input(INPUT_POST, 'pres_title'); $pres_desc = filter_input(INPUT_POST, 'pres_desc'); $organization = filter_input(INPUT_POST, 'organization'); $location = filter_input(INPUT_POST, 'location'); $field_id = filter_input(INPUT_POST, 'field_id'); $rm_id = explode(":", filter_input(INPUT_POST, 'ses-room-number'))[1]; $ses_id = explode(":", filter_input(INPUT_POST, 'ses-room-number'))[0]; $team_members = filter_input(INPUT_POST, 'team-members') . ','; if ($choice == 'Modify') { // Append the current user to the team list. if (strlen($team_members) > 0) { $team_members = $team_members . ',' . $user->usr_id; } else { $team_members = $user->usr_id; } $pres = SeniorPresentation::getPresentationForSenior($user->usr_id); if ($pres->pres_id != $pres_id) { display_user_message("You do not have permission to modify this presentation."); } mod_pres($pres->pres_id, $pres_title, $pres_desc, $organization, $location, $field_id, $team_members); } $pres = SeniorPresentation::getPresentationForSenior($user->usr_id); include "presentation_view.php"; break; default: $pres = SeniorPresentation::getPresentationForSenior($user->usr_id); include "presentation_view.php"; }