index.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. error_reporting(NULL);
  3. // Main include
  4. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  5. if($_REQUEST['ajax'] == 1){
  6. // Data
  7. exec (VESTA_CMD."v-list-user-notifications $user json", $output, $return_var);
  8. $data = json_decode(implode('', $output), true);
  9. $data = array_reverse($data,true);
  10. foreach($data as $key => $note){
  11. $note['ID'] = $key;
  12. $data[$key] = $note;
  13. }
  14. echo json_encode($data);
  15. exit();
  16. }
  17. $TAB = 'NOTIFICATIONS';
  18. // Header
  19. include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
  20. // Panel
  21. top_panel($user,$TAB);
  22. // Data
  23. exec (VESTA_CMD."v-list-user-notifications $user json", $output, $return_var);
  24. $data = json_decode(implode('', $output), true);
  25. $data = array_reverse($data,true);
  26. if ($_SESSION['user'] == 'admin') {
  27. include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_notifications.html');
  28. } else {
  29. include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_notifications.html');
  30. }
  31. // Back uri
  32. $_SESSION['back'] = $_SERVER['REQUEST_URI'];
  33. // Footer
  34. include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');