events.ajax.php 647 B

1234567891011121314151617181920212223
  1. <?php
  2. $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
  3. $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
  4. $event_name = isset($_REQUEST['eventName']) ? $_REQUEST['eventName'] : null;
  5. api_protect_admin_script();
  6. switch ($action) {
  7. case 'getEventTypes':
  8. $events = get_all_event_types();
  9. print json_encode($events);
  10. break;
  11. case 'getUsers':
  12. $users = UserManager::get_user_list();
  13. print json_encode($users);
  14. break;
  15. case 'get_event_users':
  16. $users = get_event_users($event_name);
  17. print json_encode($users);
  18. break;
  19. }
  20. exit;