, 2003-2006 // Raul Mateos , 2005-2006 // Load global vars require("include/config.php"); if (comprueba_login() == 0) { if ((give_acl($id_user, 0, "AR")==1) or (give_acl($id_user,0,"AW")) or (dame_admin($id_user)==1)) { if (isset($_GET["id_agente"])){ echo "

".$lang_label["alert_listing"]."".$lang_label["help"]."

"; $id_agente = $_GET["id_agente"]; $query_gen='SELECT 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'; $result_gen=mysql_query($query_gen); if (mysql_num_rows ($result_gen)) { echo ""; echo ""; $color=1; while ($data=mysql_fetch_array($result_gen)){ if ($color == 1){ $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } echo ""; echo "
".$lang_label["type"]."".$lang_label["name"]."".$lang_label["description"]."".$lang_label["min_max"]."".$lang_label["time_threshold"]."".$lang_label["last_fired"]."".$lang_label["times_fired"]."".$lang_label["status"]."
".dame_nombre_alerta($data["id_alerta"]); echo "".$data["nombre"]; echo "".$data["descripcion"]; echo "".$data["dis_max"]."/".$data["dis_min"]; echo "".$data["time_threshold"]; echo "".$data["last_fired"]; echo "".$data["times_fired"]; if ($data["times_fired"] <> 0) echo ""; else echo ""; } echo '
'; } else echo "".$lang_label["no_alerts"].""; } else { echo "

".$lang_label["ag_title"]."

"; echo "

".$lang_label["alert_listing"]." ".$lang_label["help"]."

"; $iduser_temp=$_SESSION['id_usuario']; if (isset($_POST["ag_group"])) $ag_group = $_POST["ag_group"]; elseif (isset($_GET["group_id"])) $ag_group = $_GET["group_id"]; else $ag_group = -1; if (isset($_GET["ag_group_refresh"])){ $ag_group = $_GET["ag_group_refresh"]; } if (isset($_POST["ag_group"])){ $ag_group = $_POST["ag_group"]; echo "
"; } else { echo ""; } echo ""; echo "
"; echo ""; echo ""; // Show only selected groups if ($ag_group > 1) $sql='SELECT * FROM tagente WHERE id_grupo='.$ag_group.' order by nombre'; else $sql='SELECT * FROM tagente order by id_grupo, nombre'; $result=mysql_query($sql); if (mysql_num_rows($result)){ $string=''; $color=1; while ($row=mysql_fetch_array($result)){ //while there are agents if ($row["disabled"] == 0) { $id_agente = $row['id_agente']; $nombre_agente = $row["nombre"]; $query_gen='SELECT talerta_agente_modulo.id_alerta, talerta_agente_modulo.descripcion, talerta_agente_modulo.last_fired, talerta_agente_modulo.times_fired, 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'; $result_gen=mysql_query($query_gen); if (mysql_num_rows ($result_gen)) { while ($data=mysql_fetch_array($result_gen)){ if ($color == 1){ $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } if (!isset($string)) {$string='';} $string=$string."
".$nombre_agente.""; $string=$string."".dame_nombre_alerta($data["id_alerta"]); $string=$string."".$data["descripcion"]; $string=$string."".$data["last_fired"]; $string=$string."".$data["times_fired"]; if ($data["times_fired"] <> 0) $string=$string.""; else $string=$string.""; } } else if($ag_group>1) {unset($string);} //end result } //end disabled=0 } //end while if (isset($string)) { echo ""; echo " - ".$lang_label["fired"]; echo "  "; echo " - ".$lang_label["not_fired"]; echo "
"; echo "
"; echo ""; echo ""; echo $string; //built table of alerts echo "
".$lang_label["agent"]."".$lang_label["type"]."".$lang_label["description"]."".$lang_label["last_fired"]."".$lang_label["times_fired"]."".$lang_label["status"]."
"; } else { echo "".$lang_label["no_alert"].""; } } else echo "". $lang_label["no_agent"].$lang_label["no_agent_alert"].""; } } //end acl } //end login ?>