'.$lang_label["dbmain_title"].' >'.$lang_label["db_purge"]."";
echo "";
echo "
";
echo '
'.$lang_label["get_data_agent"].'
';
// All data (now)
$purge_all=date("Y-m-d H:i:s",time());
require("godmode/db/times_incl.php");
$datos_rango3=0;$datos_rango2=0;$datos_rango1=0;$datos_rango0=0; $datos_rango00=0; $datos_rango11=0; $datos_total=0;
# ADQUIRE DATA PASSED AS FORM PARAMETERS
# ======================================
# Purge data using dates
# Purge data using dates
if (isset($_POST["purgedb"])){
$from_date =$_POST["date_purge"];
if (isset($id_agent)){
if ($id_agent != -1) {
echo $lang_label["purge_task"].$id_agent." / ".$from_date;
echo "".$lang_label["please_wait"]."
",$lang_label["while_delete_data"].$lang_label["agent"]."
";
if ($id_agent == 0)
$sql_2='SELECT * FROM tagente_modulo';
else
$sql_2='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agent;
$result_t=mysql_query($sql_2);
while ($row=mysql_fetch_array($result_t)){
echo $lang_label["deleting_records"].dame_nombre_modulo_agentemodulo($row["id_agente_modulo"]);
flush();
//ob_flush();
echo "
";
$query = "DELETE FROM tagente_datos WHERE id_agente_modulo = ".$row["id_agente_modulo"]." and timestamp < '".$from_date."'";
mysql_query($query);
$query = "DELETE FROM tagente_datos_inc WHERE id_agente_modulo = ".$row["id_agente_modulo"]." and timestamp < '".$from_date."'";
mysql_query($query);
$query = "DELETE FROM tagente_datos_string WHERE id_agente_modulo = ".$row["id_agente_modulo"]." and timestamp < '".$from_date."'";
mysql_query($query);
}
}
else {
echo $lang_label["deleting_records"].$lang_label["all_agents"];
flush();
ob_flush();
$query = "DELETE FROM tagente_datos WHERE timestamp < '".$from_date."'";
mysql_query($query);
$query = "DELETE FROM tagente_datos_inc WHERE timestamp < '".$from_date."'";
mysql_query($query);
$query = "DELETE FROM tagente_datos_string WHERE timestamp < '".$from_date."'";
mysql_query($query);
}
echo "
";
}
mysql_close();
}
# Select Agent for further operations.
?>