PageRenderTime 53ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/html/pages/device/health/current.inc.php

https://github.com/observernms/core
PHP | 59 lines | 36 code | 22 blank | 1 comment | 2 complexity | 918dce945cc3c8a518eef7be3d600232 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0
  1. <?php
  2. $sql = "SELECT * FROM `current` WHERE device_id = '" . $_GET[id] . "' ORDER BY current_descr";
  3. $query = mysql_query($sql);
  4. echo("<table cellspacing=0 cellpadding=5 width=100%>");
  5. $row = 1;
  6. while($current = mysql_fetch_array($query)) {
  7. if(!is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
  8. echo("<tr class=list-large style=\"background-color: $row_colour; padding: 5px;\">
  9. <td width=350>" . $current['current_descr'] . "</td>
  10. <td>" . $current['current_current'] . "A</td>
  11. <td>" . $current['current_limit_low'] . 'A - ' . $current['current_limit'] . "A</td>
  12. <td>" . $current['current_notes'] . "</td>
  13. </tr>\n");
  14. echo("<tr bgcolor=$row_colour><td colspan='4'>");
  15. $graph_type = "current";
  16. // start current graphs
  17. $daily_current = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$day&to=$now&width=211&height=100";
  18. $daily_url = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$day&to=$now&width=400&height=150";
  19. $weekly_current = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$week&to=$now&width=211&height=100";
  20. $weekly_url = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$week&to=$now&width=400&height=150";
  21. $monthly_current = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$month&to=$now&width=211&height=100";
  22. $monthly_url = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$month&to=$now&width=400&height=150";
  23. $yearly_current = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$year&to=$now&width=211&height=100";
  24. $yearly_url = "graph.php?id=" . $current['current_id'] . "&type=$graph_type&from=$year&to=$now&width=400&height=150";
  25. echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
  26. <img src='$daily_current' border=0></a> ");
  27. echo("<a onmouseover=\"return overlib('<img src=\'$weekly_url\'>', LEFT);\" onmouseout=\"return nd();\">
  28. <img src='$weekly_current' border=0></a> ");
  29. echo("<a onmouseover=\"return overlib('<img src=\'$monthly_url\'>', LEFT);\" onmouseout=\"return nd();\">
  30. <img src='$monthly_current' border=0></a> ");
  31. echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT);\" onmouseout=\"return nd();\">
  32. <img src='$yearly_current' border=0></a>");
  33. echo("</td></tr>");
  34. $row++;
  35. }
  36. echo("</table>");
  37. ?>