2007-05-21 Sancho Lerena <slerena@artica.es>

* operation/visual_console/index.php: Fixed SQL error when no data.

        * operation/agentes/estado_alertas.php: Style fix (databox).

        * operation/agentes/ver_agente.php: Now main view shows also alert info.

        * operation/menu.php: Fixed SQL error when there is no data.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@462 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2007-05-21 13:24:17 +00:00
parent 206e099c20
commit 474ef38aba
5 changed files with 18 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2007-05-21 Sancho Lerena <slerena@artica.es>
* operation/visual_console/index.php: Fixed SQL error when no data.
* operation/agentes/estado_alertas.php: Style fix (databox).
* operation/agentes/ver_agente.php: Now main view shows also alert info.
* operation/menu.php: Fixed SQL error when there is no data.
2007-05-21 Raul Mateos <raulofpandora@gmail.com> 2007-05-21 Raul Mateos <raulofpandora@gmail.com>
* include/styles/pandora.css: Updated footer style. * include/styles/pandora.css: Updated footer style.

View File

@ -45,7 +45,7 @@ if (isset($_GET["id_agente"])){
$id_agente = $_GET["id_agente"]; $id_agente = $_GET["id_agente"];
$query_gen='SELECT talerta_agente_modulo.alert_text, talerta_agente_modulo.id_alerta, talerta_agente_modulo.descripcion, talerta_agente_modulo.last_fired, talerta_agente_modulo.times_fired, tagente_modulo.nombre, talerta_agente_modulo.dis_max, talerta_agente_modulo.dis_min, talerta_agente_modulo.max_alerts, talerta_agente_modulo.time_threshold, talerta_agente_modulo.min_alerts, talerta_agente_modulo.id_agente_modulo, tagente_modulo.id_agente_modulo FROM tagente_modulo, talerta_agente_modulo WHERE tagente_modulo.id_agente = '.$id_agente.' AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo ORDER BY tagente_modulo.nombre'; $query_gen='SELECT talerta_agente_modulo.alert_text, talerta_agente_modulo.id_alerta, talerta_agente_modulo.descripcion, talerta_agente_modulo.last_fired, talerta_agente_modulo.times_fired, tagente_modulo.nombre, talerta_agente_modulo.dis_max, talerta_agente_modulo.dis_min, talerta_agente_modulo.max_alerts, talerta_agente_modulo.time_threshold, talerta_agente_modulo.min_alerts, talerta_agente_modulo.id_agente_modulo, tagente_modulo.id_agente_modulo FROM tagente_modulo, talerta_agente_modulo WHERE tagente_modulo.id_agente = '.$id_agente.' AND tagente_modulo.id_agente_modulo = talerta_agente_modulo.id_agente_modulo ORDER BY tagente_modulo.nombre';
if ($result_gen=mysql_query($query_gen)){ if ($result_gen=mysql_query($query_gen)){
echo "<table cellpadding='3' cellspacing='3' width=750 border=0>"; echo "<table cellpadding='4' cellspacing='4' width=750 border=0 class='databox'>";
echo "<tr><th>".$lang_label["type"]."<th>".$lang_label["name"]."</th><th>".$lang_label["description"]."</th><th>".$lang_label["min_max"]."</th><th>".$lang_label["time_threshold"]."</th><th>".$lang_label["last_fired"]."</th><th>".$lang_label["times_fired"]."</th><th>".$lang_label["status"]."</th>"; echo "<tr><th>".$lang_label["type"]."<th>".$lang_label["name"]."</th><th>".$lang_label["description"]."</th><th>".$lang_label["min_max"]."</th><th>".$lang_label["time_threshold"]."</th><th>".$lang_label["last_fired"]."</th><th>".$lang_label["times_fired"]."</th><th>".$lang_label["status"]."</th>";
$color=1; $color=1;
while ($data=mysql_fetch_array($result_gen)){ while ($data=mysql_fetch_array($result_gen)){
@ -93,7 +93,7 @@ if (isset($_GET["id_agente"])){
else else
echo "<td class='".$tdcolor."' align='center'><img src='images/dot_green.gif'>"; echo "<td class='".$tdcolor."' align='center'><img src='images/dot_green.gif'>";
} }
echo '<tr><td colspan="9"><div class="raya"></div></td></tr></table>'; echo '</table>';
} }
else echo "<div class='nf'>".$lang_label["no_alerts"]."</div>"; else echo "<div class='nf'>".$lang_label["no_alerts"]."</div>";

View File

@ -96,6 +96,7 @@ if (comprueba_login() == 0) {
case "main": require "estado_generalagente.php"; case "main": require "estado_generalagente.php";
require "estado_monitores.php"; require "estado_monitores.php";
require "estado_alertas.php";
break; break;
case "data": require "estado_ultimopaquete.php"; case "data": require "estado_ultimopaquete.php";

View File

@ -85,7 +85,7 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
if ( isset($_GET["sec"]) && $_GET["sec"] == "visualc") { if ( isset($_GET["sec"]) && $_GET["sec"] == "visualc") {
$sql="SELECT * FROM tlayout"; $sql="SELECT * FROM tlayout";
$res=mysql_query($sql); if($res=mysql_query($sql))
while ($row = mysql_fetch_array($res)){ while ($row = mysql_fetch_array($res)){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/visual_console/render_view") { if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/visual_console/render_view") {
if (isset($_GET["id"]) && $_GET["id"] == $row["id"]) if (isset($_GET["id"]) && $_GET["id"] == $row["id"])

View File

@ -32,8 +32,8 @@ echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_frame'>";
echo "<tr><th>".$lang_label["name"]."<th>".$lang_label["group"]."<th>".$lang_label["elements"]."<th>".$lang_label["view"]; echo "<tr><th>".$lang_label["name"]."<th>".$lang_label["group"]."<th>".$lang_label["elements"]."<th>".$lang_label["view"];
$color=1; $color=1;
$sql="SELECT * FROM tlayout"; $sql="SELECT * FROM tlayout";
$res=mysql_query($sql); if ($res=mysql_query($sql))
while ($row = mysql_fetch_array($res)){ while ($row = mysql_fetch_array($res)){
// Calculate table line color // Calculate table line color
if ($color == 1){ if ($color == 1){
$tdcolor = "datos"; $tdcolor = "datos";
@ -56,7 +56,7 @@ while ($row = mysql_fetch_array($res)){
echo "<td valign='top'align='center' class='$tdcolor'>".$row2[0]; echo "<td valign='top'align='center' class='$tdcolor'>".$row2[0];
// View icon // View icon
echo "<td valign='middle' class='$tdcolor' align='center'><a href='index.php?sec=visualc&sec2=operation/visual_console/render_view&id=$id_layout'><img src='images/images.png'></A>"; echo "<td valign='middle' class='$tdcolor' align='center'><a href='index.php?sec=visualc&sec2=operation/visual_console/render_view&id=$id_layout'><img src='images/images.png'></A>";
} }
echo "</table>"; echo "</table>";