index.php 638 B

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