index.php 1.1 KB

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