"; echo "
"; include("menup.html"); echo "
"; mostra_nome_login($un,$ut); //############################################################################################ form_start("Download","download1.php"); separador(" - Sensores e cordenadas do periodo:","#f7f7f7","#000000"); echo "
- Procurar em "; simple_check($un,"Todas_as_cordenadas","download1.php"); echo "
"; echo "
"; menu_field_mills($un,"root/data/live/", "download1.php"); echo "
"; separador(" - Tamanho dos arquivos:","#f7f7f7","#000000"); echo "
"; radio_box($un,"tamanho_dos_arquivos", "download1.php", array("anuais","mensais","diarios","horarios")); echo "
"; separador(" - Intervalo desejado (dia/mes/ano):","#f7f7f7","#000000"); echo "
"; echo "
"; echo " Inicio :
"; radio_box($un,"dia0", "download1.php", array("01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"),""); echo " / "; radio_box($un,"mes0", "download1.php", array("01","02","03","04","05","06","07","08","09","10","11","12"),""); echo " / "; radio_box($un,"ano0", "download1.php", array("2013","2014","2015","2016","2017","2018","2019","2020"),""); echo " - Fim :
"; radio_box($un,"dia1", "download1.php", array("01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31"),""); echo "/ "; radio_box($un,"mes1", "download1.php", array("01","02","03","04","05","06","07","08","09","10","11","12"),""); echo "/ "; radio_box($un,"ano1", "download1.php", array("2013","2014","2015","2016","2017","2018","2019","2020"),""); echo "
"; echo "
"; separador(" - Gerar arquivos e baixar:","#f7f7f7","#000000"); echo "
"; button($un,"Gerar_Arquivos_Para_Download","download1.php","download"); if((button_value($un,"Gerar_Arquivos_Para_Download")!="")){ // msg("BOTAO"); try{mkdir("download_$un/");}catch (Exception $e){} //apaga todos os arquivos do diretorio $files = glob("download_$un/*.*"); for($i=0;$ix " . $files[$i]; unlink($files[$i]); } //RETORNA ID MAXIMO $ano0 = radio_box_value($un,"ano0") - 2000; $mes0 = radio_box_value($un,"mes0"); $dia0 = radio_box_value($un,"dia0"); $ano1 = radio_box_value($un,"ano1") - 2000; $mes1 = radio_box_value($un,"mes1"); $dia1 = radio_box_value($un,"dia1"); //verifica se as datas estão corretas $abs0 = dt_abs($dia0,$mes0,$ano0); $abs1 = dt_abs($dia1,$mes1,$ano1); $absd = $abs1 - $abs0; if($absd<=0){ reg_set($un."_status",0); echo "

*** A DATA INICIAL PRECISA SER MENOR QUE A FINAL!

"; return 0; echo "
"; } reg_set($un."_ano",$ano0); reg_set($un."_mes",$mes0); reg_set($un."_dia",$dia0); reg_set($un."_ic", 0); reg_set($un."_cordc", 0); reg_set($un."_novo_arquivo",1); reg_set($un."_status","gerando"); } $status = reg_get($un."_status"); if($status!="gerando"){ echo "
"; separador(" - Arquivos gerados para download : ","#f7f7f7","#000000"); //mosta arquivos gerados para download $files = glob("download_$un/*.*"); for($h=0;$h $fnl - $fs Mb "; } $files = glob("util/*.*"); echo "

"; separador(" - Utilitarios disponiveis para download : ","#f7f7f7","#000000"); for($h=0;$h $fnl - $fs Mb "; } }else{ gerar_arquivos($un); } form_end(); //############################################################################################ html_end_page(); //############################################################################################ function gerar_arquivos($un ){ $novo_arquivo = (int) reg_get($un."_novo_arquivo"); $file_out = reg_get($un."_file_out"); if($novo_arquivo==0){ try{ $f = "download_$un/$file_out"; $fout = fopen($f, "a"); //fputs($fout,"\n"); }catch (Exception $e){} } $ano = reg_get($un."_ano"); $mes = reg_get($un."_mes"); $dia = reg_get($un."_dia"); $ic = reg_get($un."_ic"); $cordc = reg_get($un."_cordc"); $ano0 = radio_box_value($un,"ano0") - 2000; $mes0 = radio_box_value($un,"mes0"); $dia0 = radio_box_value($un,"dia0"); $ano1 = radio_box_value($un,"ano1") - 2000; $mes1 = radio_box_value($un,"mes1"); $dia1 = radio_box_value($un,"dia1"); //"anuais","mensais","diarios","horarios" $tamanho = radio_box_value($un,"tamanho_dos_arquivos"); $detec_auto = check_value($un,"Todas_as_cordenadas"); //verifica se as datas estão corretas $abs = dt_abs($dia,$mes,$ano,0,0,0); $abs1 = dt_abs($dia1,$mes1,$ano1,0,0,0); $absd = $abs1 - $abs0; //RETORNA ID MAXIMO $lista = list_dir($dir = "root/data/live/"); $id_maximo=1; for($i=0;$i31){ $dia=1; $mes++; if($tamanho=="mensais"){$novo_arquivo=1;}; } if($mes>12){ $mes=1; $ano++; if($tamanho=="anuais"){$novo_arquivo=1;}; } $abs = dt_abs($dia,$mes,$ano,$hora,$min,$seg); reg_set($un."_ano",$ano); reg_set($un."_mes",$mes); reg_set($un."_dia",$dia); reg_set($un."_status","gerando"); reg_set($un."_ic", $i); reg_set($un."_cordc", $cord); reg_set($un."_novo_arquivo",$novo_arquivo); reg_set($un."_file_out",$file_out); try{fclose($fi);}catch (Exception $e){} try{fclose($fout);}catch (Exception $e){} seguranca_goto("dping.php"); exit; }else{ $cord++; reg_set($un."_ano",$ano0); reg_set($un."_mes",$mes0); reg_set($un."_dia",$dia0); reg_set($un."_status","gerando"); reg_set($un."_ic", $i); reg_set($un."_cordc", $cord); reg_set($un."_novo_arquivo",$novo_arquivo); reg_set($un."_file_out",$file_out); try{fclose($fi);}catch (Exception $e){} try{fclose($fout);}catch (Exception $e){} seguranca_goto("dping.php"); exit; } } // $cord++; } } $novo_arquivo=1; $i++; $cord = 0; reg_set($un."_ano",$ano0); reg_set($un."_mes",$mes0); reg_set($un."_dia",$dia0); reg_set($un."_status","gerando"); reg_set($un."_ic", $i); reg_set($un."_cordc", $cord); reg_set($un."_novo_arquivo",$novo_arquivo); reg_set($un."_file_out",$file_out); try{fclose($fi);}catch (Exception $e){} try{fclose($fout);}catch (Exception $e){} seguranca_goto("dping.php"); exit; } reg_set($un."_status","terminado"); try{fclose($fi);}catch (Exception $e){} try{fclose($fout);}catch (Exception $e){} seguranca_goto("dping.php"); exit; } ?>