events.ajax.php 680 B

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