index.php 591 B

12345678910111213141516171819202122232425
  1. <?php
  2. $TAB = 'NOTIFICATIONS';
  3. error_reporting(NULL);
  4. // Main include
  5. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  6. // Data
  7. exec (VESTA_CMD."v-list-user-notifications $user json", $output, $return_var);
  8. $notifications = json_decode(implode('', $output), true);
  9. $notifications = array_reverse($notifications,true);
  10. foreach($notifications as $key => $note){
  11. $note['ID'] = $key;
  12. $notifications[$key] = $note;
  13. }
  14. // Back uri
  15. $_SESSION['back'] = $_SERVER['REQUEST_URI'];
  16. $result = array(
  17. 'result' => empty($notifications) ? [] : $notifications
  18. );
  19. echo json_encode($result);