, 2003-2006 // Raul Mateos , 2006 // Load global vars require("include/config.php"); //require("include/functions.php"); //require("include/functions_db.php"); if (comprueba_login() == 0) $id_usuario= $_SESSION["id_usuario"]; if (give_acl($id_usuario, 0, "DM")==1){ // Todo for a good DB maintenance /* - A function to "compress" data, and interpolate big chunks of data (1 month - 60000 registers) onto a small chunk of interpolated data (1 month - 600 registers) - A more powerful selection (by Agent, by Module, etc). */ ?>

 



".$lang_label["please_wait"]."
",$lang_label["while_delete_data"].$lang_label["agent"].""; $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. ?>
   

".$lang_label["db_agent_bra"].dame_nombre_agente($id_agent).$lang_label["db_agent_ket"].""; $sql_2='SELECT * FROM tagente_modulo WHERE id_agente = '.$id_agent; $result_t=mysql_query($sql_2); while ($row=mysql_fetch_array($result_t)){ flush(); ob_flush(); $rango00=mysql_query('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo = '.$row["id_agente_modulo"].' and timestamp > "'.$d1.'"'); $rango0=mysql_query('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo = '.$row["id_agente_modulo"].' and timestamp > "'.$d3.'"'); $rango1=mysql_query('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo = '.$row["id_agente_modulo"].' and timestamp > "'.$week.'"'); $rango11=mysql_query('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo = '.$row["id_agente_modulo"].' and timestamp > "'.$week2.'"'); $rango2=mysql_query('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo = '.$row["id_agente_modulo"].' and timestamp > "'.$month.'"'); $rango3=mysql_query('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo = '.$row["id_agente_modulo"].' and timestamp > "'.$month3.'"'); $rango4=mysql_query('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo = '.$row["id_agente_modulo"]); $row00=mysql_fetch_array($rango00); $row3=mysql_fetch_array($rango3); $row1=mysql_fetch_array($rango1); $row2=mysql_fetch_array($rango2); $row11=mysql_fetch_array($rango11); $row0=mysql_fetch_array($rango0); $row4=mysql_fetch_array($rango4); $datos_rango00=$datos_rango00+$row00[0]; $datos_rango0=$datos_rango0+$row0[0]; $datos_rango3=$datos_rango3+$row3[0]; $datos_rango2=$datos_rango2+$row2[0]; $datos_rango1=$datos_rango1+$row1[0]; $datos_rango11=$datos_rango11+$row11[0]; $datos_total=$datos_total+$row4[0]; } } ?>

" onClick="if (!confirm('')) return false;">