|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
if($_SESSION['userlevel'] >= '5') {
|
|
|
|
|
$sql = "SELECT * FROM `frequency` AS V, `devices` AS D WHERE V.device_id = D.device_id ORDER BY D.hostname, V.freq_descr";
|
|
|
|
|
$sql = "SELECT * FROM `sensors` AS V, `devices` AS D WHERE V.sensor_class='freq' AND V.device_id = D.device_id ORDER BY D.hostname, V.sensor_descr";
|
|
|
|
|
} else {
|
|
|
|
|
$sql = "SELECT * FROM `frequency` AS V, `devices` AS D, devices_perms as P WHERE V.device_id = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, V.freq_descr";
|
|
|
|
|
$sql = "SELECT * FROM `sensors` AS V, `devices` AS D, devices_perms as P WHERE V.sensor_class='freq' V.device_id = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, V.sensor_descr";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$graph_type = "sensor_frequency";
|
|
|
|
@ -28,46 +28,46 @@ while($freq = mysql_fetch_array($query))
|
|
|
|
|
{
|
|
|
|
|
if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
|
|
|
|
|
|
|
|
|
$weekly_freq = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$week&to=$now&width=500&height=150";
|
|
|
|
|
$freq_popup = "<a onmouseover=\"return overlib('<img src=\'$weekly_freq\'>', LEFT);\" onmouseout=\"return nd();\">
|
|
|
|
|
" . $freq['freq_descr'] . "</a>";
|
|
|
|
|
$weekly_freq = "graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=500&height=150";
|
|
|
|
|
$sensor_popup = "<a onmouseover=\"return overlib('<img src=\'$weekly_freq\'>', LEFT);\" onmouseout=\"return nd();\">
|
|
|
|
|
" . $freq['sensor_descr'] . "</a>";
|
|
|
|
|
|
|
|
|
|
if($freq['freq_current'] >= $freq['freq_limit']) { $alert = '<img src="images/16/flag_red.png" alt="alert" />'; } else { $alert = ""; }
|
|
|
|
|
if($freq['sensor_current'] >= $freq['sensor_limit']) { $alert = '<img src="images/16/flag_red.png" alt="alert" />'; } else { $alert = ""; }
|
|
|
|
|
|
|
|
|
|
$freq_day = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100";
|
|
|
|
|
$freq_week = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100";
|
|
|
|
|
$freq_month = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100";
|
|
|
|
|
$freq_year = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100";
|
|
|
|
|
$sensor_day = "graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100";
|
|
|
|
|
$sensor_week = "graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100";
|
|
|
|
|
$sensor_month = "graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100";
|
|
|
|
|
$sensor_year = "graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100";
|
|
|
|
|
|
|
|
|
|
$freq_minigraph = "<img src='graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$day&to=$now&width=100&height=20'";
|
|
|
|
|
$freq_minigraph .= " onmouseover=\"return overlib('<div class=list-large>".$freq['hostname']." - ".$freq['freq_descr'];
|
|
|
|
|
$freq_minigraph .= "</div><div style=\'width: 750px\'><img src=\'$freq_day\'><img src=\'$freq_week\'><img src=\'$freq_month\'><img src=\'$freq_year\'></div>', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >";
|
|
|
|
|
$sensor_minigraph = "<img src='graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=100&height=20'";
|
|
|
|
|
$sensor_minigraph .= " onmouseover=\"return overlib('<div class=list-large>".$freq['hostname']." - ".$freq['sensor_descr'];
|
|
|
|
|
$sensor_minigraph .= "</div><div style=\'width: 750px\'><img src=\'$sensor_day\'><img src=\'$sensor_week\'><img src=\'$sensor_month\'><img src=\'$sensor_year\'></div>', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >";
|
|
|
|
|
|
|
|
|
|
echo("<tr bgcolor=$row_colour>
|
|
|
|
|
<td class=list-bold>" . generate_device_link($freq) . "</td>
|
|
|
|
|
<td>$freq_popup</td>
|
|
|
|
|
<td>$freq_minigraph</td>
|
|
|
|
|
<td>$sensor_popup</td>
|
|
|
|
|
<td>$sensor_minigraph</td>
|
|
|
|
|
<td width=100>$alert</td>
|
|
|
|
|
<td style='text-align: center; font-weight: bold;'>" . $freq['freq_current'] . "Hz</td>
|
|
|
|
|
<td style='text-align: center'>" . $freq['freq_limit_low'] . "Hz - " . $freq['freq_limit'] . "Hz</td>
|
|
|
|
|
<td>" . (isset($freq['freq_notes']) ? $freq['freq_notes'] : '') . "</td>
|
|
|
|
|
<td style='text-align: center; font-weight: bold;'>" . $freq['sensor_current'] . "Hz</td>
|
|
|
|
|
<td style='text-align: center'>" . $freq['sensor_limit_low'] . "Hz - " . $freq['sensor_limit'] . "Hz</td>
|
|
|
|
|
<td>" . (isset($freq['sensor_notes']) ? $freq['sensor_notes'] : '') . "</td>
|
|
|
|
|
</tr>\n");
|
|
|
|
|
|
|
|
|
|
if($_GET['optb'] == "graphs") { ## If graphs
|
|
|
|
|
|
|
|
|
|
echo("<tr bgcolor='$row_colour'><td colspan=6>");
|
|
|
|
|
|
|
|
|
|
$daily_graph = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100";
|
|
|
|
|
$daily_url = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150";
|
|
|
|
|
$daily_graph = "graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100";
|
|
|
|
|
$daily_url = "graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150";
|
|
|
|
|
|
|
|
|
|
$weekly_graph = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100";
|
|
|
|
|
$weekly_url = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150";
|
|
|
|
|
$weekly_graph = "graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100";
|
|
|
|
|
$weekly_url = "graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150";
|
|
|
|
|
|
|
|
|
|
$monthly_graph = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100";
|
|
|
|
|
$monthly_url = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150";
|
|
|
|
|
$monthly_graph = "graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100";
|
|
|
|
|
$monthly_url = "graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150";
|
|
|
|
|
|
|
|
|
|
$yearly_graph = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100";
|
|
|
|
|
$yearly_url = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150";
|
|
|
|
|
$yearly_graph = "graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100";
|
|
|
|
|
$yearly_url = "graph.php?id=" . $freq['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150";
|
|
|
|
|
|
|
|
|
|
echo("<a onmouseover=\"return overlib('<img src=\'$daily_url\'>', LEFT);\" onmouseout=\"return nd();\">
|
|
|
|
|
<img src='$daily_graph' border=0></a> ");
|
|
|
|
|