events.ajax.php 743 B

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