";
} //while
} // for
} // Alerts
} // for each destination agent
} //end if copy modules or alerts
// -----------
// DELETE DATA
// -----------
elseif (isset($_POST["delete"])) {
echo "
".$lang_label["deletedata"]."
";
// Initial checkings
// if selected more than 0 agents
$destino = $_POST["destino"];
if (count($destino) <= 0){
echo "
ERROR: ".$lang_label["noagents_del"]."
";
break;
}
// If selected modules or alerts
if (isset($_POST["modules"]))
$modulos = 1;
else
$modulos = 0;
if (isset($_POST["alerts"]))
$alertas = 1;
else
$alertas = 0;
if (($alertas + $modulos) >= 0)
// Delete
for ($a=0;$a ".$lang_label["deleting_data"]." -> ".dame_nombre_agente($id_agente);
// Deleting data
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agente;
$result1=mysql_query($sql1);
while ($row=mysql_fetch_array($result1)){
$sql_delete1="DELETE FROM tagente_datos WHERE id_agente_modulo=".$row["id_agente_modulo"];
$sql_delete2="DELETE FROM tagente_datos_inc WHERE id_agente_modulo=".$row["id_agente_modulo"];
$sql_delete3="DELETE FROM tagente_datos_string WHERE id_agente_modulo=".$row["id_agente_modulo"];
$result=mysql_query($sql_delete1);
$result=mysql_query($sql_delete2);
$result=mysql_query($sql_delete3);
}
// Delete conf
$sql_delete5 ="DELETE FROM tagente_modulo WHERE id_agente = ".$id_agente; // delete from table tagente_modulo
$sql_delete6 ="DELETE FROM tagente_estado WHERE id_agente = ".$id_agente; // detele from table tagente_estado
$result=mysql_query($sql_delete5);
$result=mysql_query($sql_delete6);
}
// delete alerts definitions
if ($alertas == 1){
// delete data
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agente;
$result1=mysql_query($sql1);
while ($row=mysql_fetch_array($result1)){
$sql_delete1="DELETE FROM talerta_agente_modulo WHERE id_agente_modulo=".$row["id_agente_modulo"];
$result = mysql_query($sql_delete1);
} // while
}//if
}// for
}//delete
elseif (isset($_POST["delete_agent"])) {
echo "
".lang_string("delete_agents")."
";
// Initial checkings
// if selected more than 0 agents
$destino = $_POST["destino"];
if (count($destino) <= 0){
echo "
ERROR: ".$lang_label["noagents_del"]."
";
break;
}
// Delete
for ($a=0;$a ".$lang_label["deleting_data"]." -> ".dame_nombre_agente($id_agente);
// Deleting data
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agente;
$result1=mysql_query($sql1);
while ($row=mysql_fetch_array($result1)){
$sql_delete1="DELETE FROM tagente_datos WHERE id_agente_modulo=".$row["id_agente_modulo"];
$sql_delete2="DELETE FROM tagente_datos_inc WHERE id_agente_modulo=".$row["id_agente_modulo"];
$sql_delete3="DELETE FROM tagente_datos_string WHERE id_agente_modulo=".$row["id_agente_modulo"];
$result=mysql_query($sql_delete1);
$result=mysql_query($sql_delete2);
$result=mysql_query($sql_delete3);
}
// Delete conf
$sql_delete5 ="DELETE FROM tagente_modulo WHERE id_agente = ".$id_agente; // delete from table tagente_modulo
$sql_delete6 ="DELETE FROM tagente_estado WHERE id_agente = ".$id_agente; // detele from table tagente_estado
$result=mysql_query($sql_delete5);
$result=mysql_query($sql_delete6);
// delete alerts definitions
// delete data
$sql1='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agente;
$result1=mysql_query($sql1);
while ($row=mysql_fetch_array($result1)){
$sql_delete1="DELETE FROM talerta_agente_modulo WHERE id_agente_modulo=".$row["id_agente_modulo"];
$result = mysql_query($sql_delete1);
} // while
// delete agent
$sql1='DELETE FROM tagente WHERE id_agente = '.$id_agente;
$result1=mysql_query($sql1);
}// for
}//delete
// ============
// Form view
// ============
} else {
// title
echo '