Jump to content


arturpaixao

Member Since 27/04/2005
Offline Last Active 11/02/2008, 10:04
-----

Posts I've Made

In Topic: Preciso De Ajuda Para Colocar Um...

27/04/2005, 09:41

olha pessoal vou colocar o codigo ai vcs me ajudam:

?>
<html>
<head>
<title>Rose2HTML</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- Estilo para impressao -->
</head>
<body>
<?php
$acao = $_GET['acao'];
if(!$acao){
?>
 <script language="JavaScript">
 <!--
  function VerificaArquivo(f){
  retorno = true;
  /*alert(document.form.file.value);
  document.form.file.focus();
  return false;
  */if(f.value.length == 0){   
 	 alert("Informe a unidade de disco, o diretório\n e o nome completo do arquivo.");
 	 document.form.file.click();
 	 retorno = false;
  }else{
 	 valor = f.value; 	 
 	 valor = valor.toUpperCase();
 	 tamanho = valor.length;
 	 ponto = valor.indexOf(".");
 	 txt = valor.lastIndexOf("TXT",tamanho);
       	 
 	 if(ponto==-1){     
    alert("Informe o nome do arquivo completo com sua extensão.");
    retorno = false;
 	 }
 	 }
  } 	 
  return retorno;
	}
 
  function Submete(v){
  if(VerificaArquivo(v)){
 	 alert("Aguarde a tranferência do arquivo...");
 	 window.status = 'aguarde, alguns segundos...';
 	 return true;
  }else
 	 return false;
	}
	
	function RetornaNumeros(caracter) {
  if(document.all) { // Internet Explorer
   	 var tecla = event.keyCode;
 	 }
 	 else {
   	 var tecla = caracter.which;
 	 }

 	 if((tecla > 47 && tecla < 58) || (tecla > 64 && tecla < 91) || (tecla > 96 && tecla < 123)) { // numeros de 0 a 9 e letras Maisc. e Minusc.
    return true;
 	 }
 	 else {
   	 if ((tecla != 0) && (tecla != 8) && (tecla != 58) && (tecla != 92)) { // backspace e Del
     	 return false;
    }
    else {
      return true;
    }
  }
	}	
 //-->
 </script>
<div id="content">
  <h1><a name="R2H"></a>R2H</h1>
  <form name="form" method="post" action="upload.php" enctype="multipart/form-data" onSubmit="">
    <table cellpadding="2" cellspacing="1" border="0" width="100%" align="center">
    <tr> 
        <th class="tdHeader3" id="caminho">ARQUIVO:</th>
        <td colspan="4" class="tdHeader4" headers="caminho"> <input type="hidden" name="MAX_FILE_SIZE" value="6000000"> 
          <input name="file" type="file" title="Clique o botão procurar para localizar o arquivo." onFocus="window.status = 'Informe a unidade de disco, o diretorio e o nome do arquivo completo.';" onBlur="window.status='';" onKeyPress="return RetornaNumeros(event)" value="">
          <span class="tdHeader1">
          <input type="submit" name="Submit" value="Avan&ccedil;ar" class="button">
        </span>  </td>
    </tr>
    <tr> 
    </TR>
  </table>
</form>
<p></p>
<hr>
  <p class="voltar">&nbsp;</p>
</div>
<script language="JavaScript">
<!--
	//document.form.file.click();
	document.form.file.focus();
//-->
</script>
<script language="JavaScript">
<!--
	window.status = 'Iniciando a conversão.';
//-->
</script>
<div id="content">
<?php
set_time_limit (600000);
	$status = false;
	$perc = 0;
	$pontos = 45;
  $status = move_uploaded_file($file,$file_name);
 	 
 	 
  if($status){
    $lines = file ($file_name);
        $linhas = count($lines);
    $linha = 0;
    $arry = array('CHAR','NCHAR','VARCHAR', 'VARCHAR2', 'NVARCHAR2', 'DATE', 'LONG', 'LONG RAW', 'ROWID','MLSLABEL','CLOB','NCLOB','BLOB','BFILE','RAW','FLOAT','NUMBER','INTEGER','CHARACTER','CHAR VARYING','CHARACTER VARYING','DEC','DECIMAL','DOUBLE PRECISION','INT','NCHAR VARYING','NUMERIC','REAL','SMALLINT');
                $arry2 = array('Container for Scalar Types');
       foreach ($lines as $line_num => $line) {
         	 $linha++;
   	 
   	 $tabelas = stristr ($line, "object Class \""); 
                    if(strlen($tabelas)){
        $restabelas = trim(str_replace('"','',(stristr($tabelas, "\""))));
        if (!in_array($restabelas,$arry)){
        print "<strong>".$restabelas."</strong>"."<br>";
        }
   	 }
        $campos = stristr($line, "object ClassAttribute \"");
   	 if(strlen($campos)){
        $rescampos = trim(str_replace('"','',(stristr($campos,"\""))));
        echo $rescampos."<br>";
                    }
   	 $doc = stristr($line, "documentation  \"");
   	 
   	 if (strlen($doc)){
      $resdoc = trim(str_replace('"','',(stristr($doc,"\""))));
      if (!in_array($resdoc,$arry2)){
      echo $resdoc."<br>";
      }
   	 }	
   	 $tipo = stristr($line, "type        \"");
   	 if (strlen($tipo)){
      $restipo = trim(str_replace('"','',(stristr($tipo,"\""))));
      echo $restipo."<br>";
   	 }
       }// loop
        echo "</font></center></b></div><br>\n"; 	 

  unlink($file_name); //deleta arquivo
	}
	
}
?>
<p><a href="#R2H">topo</a></p>
</div>
</body>
</html>

É isso ai, por favor me ajudem preciso entregar isto hj pela manhã...
atenciosamente
Artur Paixão

IPB Skin By Virteq