".$lang_label["ag_title"]." > ".$lang_label["alert_listing"]."".$lang_label["help"]."";
}
$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, talerta_agente_modulo.id_aam 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 AND talerta_agente_modulo.disable = 0 ORDER BY tagente_modulo.nombre';
$result_gen=mysql_query($query_gen);
if (mysql_num_rows ($result_gen)) {
if (!isset($_GET["tab"])) {
echo "
";
}
echo "";
echo "
".$lang_label["type"]." | ".$lang_label["name"]." |
".$lang_label["description"]." |
".$lang_label["min."]." |
".$lang_label["max."]." |
".$lang_label["time_threshold"]." |
".$lang_label["last_fired"]." |
".$lang_label["times_fired"]." |
".$lang_label["status"]." |
".$lang_label["validate"]." | ";
$color=1;
while ($data=mysql_fetch_array($result_gen)){
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "
";
echo "".dame_nombre_alerta($data["id_alerta"])." | ";
echo "".substr($data["nombre"],0,21)." | ";
echo "".$data["descripcion"]." | ";
$mytempdata = fmod($data["dis_min"], 1);
if ($mytempdata == 0)
$mymin = intval($data["dis_min"]);
else
$mymin = $data["dis_min"];
$mymin = format_for_graph($mymin );
$mytempdata = fmod($data["dis_max"], 1);
if ($mytempdata == 0)
$mymax = intval($data["dis_max"]);
else
$mymax = $data["dis_max"];
$mymax = format_for_graph($mymax );
// Text alert ?
if ($data["alert_text"] != "")
echo "".$lang_label["text"]." | ";
else {
echo "".$mymin." | ";
echo "".$mymax." | ";
}
echo "".human_time_description($data["time_threshold"]);
if ($data["last_fired"] == "0000-00-00 00:00:00") {
echo " | ".$lang_label["never"]." | ";
}
else {
echo "".human_time_comparation ($data["last_fired"])." | ";
}
echo "".$data["times_fired"]." | ";
if ($data["times_fired"] <> 0){
echo " ";
echo " | ";
$id_grupo_alerta = give_db_value ("id_grupo", "tagente", "id_agente", $id_agente);
if (give_acl($id_user, $id_grupo_alerta, "AW") == 1) {
echo "";
echo " ";
echo " | ";
}
} else
echo " | ";
}
echo '
';
} else {
echo "".$lang_label["no_alerts"]."
";
}
} else {
// -------------------------------
// SHOW ALL ALERTS (GENERAL PAGE)
// -------------------------------
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 "