Example #1
0
 static function deleteEvent($id)
 {
     // retrieve model instance
     $model = EventModel::getInstance();
     // delegate deletion to the model
     $result = $model->delete($id);
     // reload events list
     $id = $_SESSION['activation_id'];
     //use if present
     EventsController::listRows($id);
 }
Example #2
0
             // clear the search map stored in the session
             unset($_SESSION['event_search_map']);
             // retrieve the last filter from the session
             $filter = $_SESSION['last_events_filter'];
         }
         // search button was pressed
         if (isset($map['search'])) {
             // store search data in the session
             $_SESSION['event_search_map'] = $map;
             // create a filter
             $filter = EventModel::createFilter($map);
             // store the last filter in the session
             $_SESSION['last_events_filter'] = $filter;
         }
         // list the rows using the filter
         EventsController::listRows($filter);
         break;
         // toggle the search box visibility
     // toggle the search box visibility
     case 'togglesearch':
         // invert the session variable
         if ($_SESSION['hide_event_searchbox'] == "false") {
             $_SESSION['hide_event_searchbox'] = "true";
         } else {
             $_SESSION['hide_event_searchbox'] = "false";
         }
         // redirect to the events page
         header("Location: events.php");
     default:
         break;
 }