index.php 592 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. error_reporting(NULL);
  3. $TAB = 'RRD';
  4. // Main include
  5. include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
  6. // Check user
  7. if ($_SESSION['userContext'] != 'admin') {
  8. header('Location: /list/user');
  9. exit;
  10. }
  11. // Data
  12. exec (HESTIA_CMD."v-list-sys-rrd json", $output, $return_var);
  13. $data = json_decode(implode('', $output), true);
  14. unset($output);
  15. $period=$_GET['period'];
  16. if (!in_array($period, array('daily', 'weekly', 'monthly', 'yearly'))) {
  17. $period = 'daily';
  18. }
  19. // Render page
  20. render_page($user, $TAB, 'list_rrd');
  21. // Back uri
  22. $_SESSION['back'] = $_SERVER['REQUEST_URI'];