Ir para conteúdo
Fórum Script Brasil

lorenzi

Membros
  • Total de itens

    17
  • Registro em

  • Última visita

Tudo que lorenzi postou

  1. lorenzi

    Ler dois arrays

    Ola pessoal preciso de ideias, meus problema é o seguinte: Array 1 dados vindos de um arquivo: 0 $funcionario['numcra'] = 12345 $funcionario['nome'] = Marcelo 1 $funcionario['numcra'] = 77777 $funcionario['nome'] = lorenzi Array 2 dados de uma tabela SQL: 0 $marcacao['numcra'] = 12345 $marcacao['data'] = 01/03/2010 1 $marcacao['numcra'] = 77777 $marcacao['data'] = 01/03/2010 O que eu preciso é o seguinte: Ler o array 1 e depois ler o array 2 pelo campo 'numcra' pois pela sequencia não da do tipo for each ($funcionario as $funcionario){ for each($marcacao where $marcacao['numcra'] = $funcionario['numcra'] ){ } } Algo assim so que não tenho ideia se funciona assim ou se posso fazer de outra maneira: Grato pela ajuda.
  2. lorenzi

    Add imagem em pdf

    Ola pessoal neste site http://www.tylerlesmann.com/2009/jan/28/wr...-adding-images/ tem a maneira de escrever em PDF usando reportlab so que ele não adiciona num arquivo existente somente sobscreve, tipo tenho um PDF com texto ai ele adiciona a imagem e elimina o texto. alguém pode dar um help??
  3. lorenzi

    Inserir imagem em PDf

    Pessoal fui orientado a tentar usar o pycairo, baixei pra windows mas sempre tenho este erro: C:\>C:\txttopdf.py C:\fatura.txt Traceback (most recent call last): File "C:\txttopdf.py", line 52, in <module> import cairo File "C:\Python26\lib\site-packages\cairo\__init__.py", line 1, in <module> from _cairo import * ImportError: DLL load failed: NÒo foi possÝvel encontrar o m¾dulo especificado. alguém já usou isso pra windows?
  4. Pessoal fui orientado a tentar usar o pycairo, baixei pra windows mas sempre tenho este erro: C:\>C:\txttopdf.py C:\fatura.txt Traceback (most recent call last): File "C:\txttopdf.py", line 52, in <module> import cairo File "C:\Python26\lib\site-packages\cairo\__init__.py", line 1, in <module> from _cairo import * ImportError: DLL load failed: NÒo foi possÝvel encontrar o m¾dulo especificado. alguém já usou isso pra windows?
  5. Ola. Meu problema é o seguinte, tenho um script em python que busca um arquivo TXT e converte pra PDF, so que antes de fazer a conversão gostaria de inserir uma imagem no cabecalho, so que não consegui encontrar nada que me orientase no assunto. Fico grato se alguém puder ajudar: Uso Python 2.6 ambiente windows. Caso alguém queira o script que faz a conversao so me falar, não é meu mas achei ele na web e adaptei.
  6. Ola. Meu problema é o seguinte, tenho um script em python que busca um arquivo TXT e converte pra PDF, so que antes de fazer a conversão gostaria de inserir uma imagem no cabecalho, so que não consegui encontrar nada que me orientase no assunto. Fico grato se alguém puder ajudar: Uso Python 2.6 ambiente windows. Caso alguém queira o script que faz a conversao so me falar, não é meu mas achei ele na web e adaptei.
  7. lorenzi

    Capturar valor da tela

    Ola pessoal resolvido em: http://social.msdn.microsoft.com/Forums/en...4a-fa0c2396e219
  8. lorenzi

    Capturar valor da tela

    opa o valor que eu preciso recuperar da tela e este campo IDC_EDIT_LEN
  9. Bom tarde, Pessoal tenho um novo problema, estou desenvolvolvendo um projeto pra smart device e tenho um campo text na tela o nome dele é IDC_EDIT_LEN gostaria de saber como consigo pegar a informação digitada neste campo tentei de varias formas mas não funciona: wsprintf(szLen , TEXT("%d"),(IDC_EDIT_LEN)); hctl_length = GetDlgItem(hwnd,IDC_EDIT_LEN); camara são variaveis do tipo LPTSTR se informa no campo 5555 ou retorna ??? ou retorna 1001: camara = (LPTSTR) (hctl_length, szLen); /* retorna 1001*/ camara1 = (LPTSTR) (szLen); /* retorna 1001*/ camara2 = (LPTSTR) hctl_length; /* retorna ????*/ camara3 = (LPTSTR) GetDlgItem(hwnd,IDC_EDIT_LEN); /* retorna ????*/ camara4 = (hctl_length, szLen); /* retorna 1001 */ dados = (LPTSTR)SCNBUF_GETDATA(lpScanBuffer); ponto = (LPTSTR)";"; lfp = fopen("transf.txt","a"); if(lfp) { fwprintf(lfp,camara); fwprintf(lfp,ponto); fwprintf(lfp,camara1); fwprintf(lfp,ponto); fwprintf(lfp,camara2); fwprintf(lfp,ponto); fwprintf(lfp,camara3); fwprintf(lfp,ponto); fwprintf(lfp,camara4); fwprintf(lfp,ponto); fwprintf(lfp,dados); fwprintf(lfp,ponto); fclose(lfp); } Grato se alguém puder me ajudar.
  10. não sei o que acontece, juntei daquela maneira e somente aparece ? /*esta duas variaveis estao corretas se eu fizer a saida de uma delas pro arquivo funciona normal, mas preciso juntar elas*/ LPTSTR dados; LPTSTR ponto; char str[50]; dados = (LPTSTR)SCNBUF_GETDATA(lpScanBuffer); ponto = (LPTSTR)";"; strcat (str, dados); /*advertencia = Warning 1 warning C4133: 'function' : incompatible types - from 'LPTSTR' to 'const char *' c:\Documents and Settings\lorenzi\Meus documentos\Visual Studio 2008\Projects\BasicScan\BasicScan.c 314 BasicScan */ strcat (str, ";"); lfp = fopen("texto.txt","a"); if(lfp) { fwprintf(lfp,LPTSTR(str)); /*se for assim funciona mas no resultado somente sai ????*/ fwprintf(lfp,str); /*advertencia = Warning 2 warning C4133: 'function' : incompatible types - from 'char [50]' to 'const wchar_t *' c:\Documents and Settings\lorenzi\Meus documentos\Visual Studio 2008\Projects\BasicScan\BasicScan.c 321 BasicScan */ fclose(lfp); } O esquema é assim na dados eu tenho 12345 e na ponto eu tenho ; então: 12345;88888;88888; Grato se alguém puder ajudar
  11. Pessoal seguinte tenho meu form que pra validar chama um funcao java script: [code]<head> <script type="text/javascript" src="scriptUsuario.js"></script> <title>Tela para cadastro de usuário</title> <meta name="Keywords" content="telefone,lista" /> <meta name="Author" content="LORENZI" /> <link rel="stylesheet" type="text/css" href="novo.css" /> </head> <body > <form id="form1" method="post" action="usuario.php" onsubmit="return Verifica()" enctype="multipart/form-data"> etc.. function Verifica() { var senha = document.getElementById("senha").value; var confirma = document.getElementById("confirma").value; if (boton != 3) /*somente entra ak se for alteracao ou inclusao*/ { if (boton == 2 && document.getElementById("id_usuario").value == "") { alert("Favor selecionar um usuario na tabela!"); return false; } if (senha != confirma) { alert('Senha não confere'); document.getElementById("senha").focus(); return false; }else if (document.getElementById("senha").value == "" || document.getElementById("confirma").value == "" || document.getElementById("login").value == ""){ alert('Campo login, senha e confirma senha são obrigatórios'); document.getElementById("senha").focus(); return false; }else if (document.upload.arquivo.value=="" ) { alert("Arquivo com a foto não informado!"); document.upload.arquivo.focus(); return false; }else return true; }else if (document.getElementById("id_usuario").value == ""){ alert("Favor selecionar um usuario na tabela!"); return false; } } So que assim quando eu uso no firefox funciona beleza, vai para a funcao e valida, mas quando uso no IE não vai para a função, alguém já passou por isso , poderia me ajudar????
  12. lorenzi

    Validar w3c

    beleza kakaroto, vou testar mas assim nunca desenvolvi web usando html,php é correto colocar o codigo php dentro do HTML, ou isso é contra as regras??
  13. lorenzi

    Validar w3c

    este é alguns dos erros: # Line 77, Column 96: an attribute value literal can occur in an attribute specification list only after a VI delimiter. …tato" value="<?=$escrever["id_contato"];?>" /> ✉ Have you forgotten the "equal" sign marking the separation between the attribute and its declared value? Typical syntax is attribute=value". # Error Line 77, Column 96: document type does not allow element "input" here; missing one of "th", "td" start-tag. …tato" value="<?=$escrever["id_contato];?>" /> ✉ The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element. One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>"). # Error Line 77, Column 97: end tag for "input" omitted, but OMITTAG NO was specified. …ato" value="<?=$escrever["id_contato"];?>" /> ✉ You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">". Meu codigo: <?xml version="1.0" encoding="iso-8859-2"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-br" lang="pt-br"> <?php $id = $_GET["id"]; if ($id != "") { include "conf.php"; $res = mysql_query("select * from contato where id_contato = '$id'"); $escrever=mysql_fetch_array($res); } else { /*zerar os campos*/ } ?> <head> <script type="text/javascript"> function Verifica() { var nome = document.getElementById("nome").value; var telefone = document.getElementById("telefone").value; if (nome == "" || telefone == ""){ alert('Campo nome e telefone são obrigatórios'); document.getElementById("nome").focus(); return false; }else return true; } function maskIt(w,e,m,r,a){ // Cancela se o evento for Backspace if (!e) var e = window.event if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; // Variáveis da função var txt = (!r) ? w.value.replace(/[^\d]+/gi,'') : w.value.replace(/[^\d]+/gi,'').reverse(); var mask = (!r) ? m : m.reverse(); var pre = (a ) ? a.pre : ""; var pos = (a ) ? a.pos : ""; var ret = ""; if(code == 9 || code == 8 || txt.length == mask.replace(/[^#]+/g,'').length) return false; // Loop na máscara para aplicar os caracteres for(var x=0,y=0, z=mask.length;x < z && y<txt.length;){ if(mask.charAt(x)!='#'){ ret += mask.charAt(x); x++; }else{ ret += txt.charAt(y); y++; x++; } } // Retorno da função ret = (!r) ? ret : ret.reverse() w.value = pre+ret+pos; } // Novo método para o objeto 'String' String.prototype.reverse = function(){ return this.split('').reverse().join(''); }; </script> <title>Tela para manipulação de registros</title> <meta name="Keywords" content="telefone,lista" /> <meta name="Author" content="LORENZI" /> <link rel="stylesheet" type="text/css" href="novo.css" /> </head> <body> <form method="post" action="contato.php" onsubmit="return Verifica()"> <div class="dLista"> <div class="dLista1"> <h3> Inclusão,Exclusão,Alteração da lista </h3> </div> <div class="dLista2"> <table class="ftable1"> <tr> <input name="id_contato" type="hidden" id="id_contato" value="<?=$escrever["id_contato"];?>" /> <td>Nome:</td> <td><input class="fnome" type="text" name="nome" id="nome" value="<?=$escrever["nome"];?>" /></td> </tr> <tr> <td>E-mail:</td> <td><input class="femail" type="text" name="email" id="email" value="<?=$escrever["email"];?>" /></td> </tr> <tr> <td>Endereço:</td> <td><input class="fendereco" type="text" name="endereco" id="endereco" value="<?=$escrever["endereco"];?>" /> </td> </tr> <tr> <td>Cidade:</td> <td><input class="fcidade" type="text" name="cidade" id="cidade" value="<?=$escrever["cidade"];?>"/> </td> <td>Estado</td> <td> <select name="Estado" id="estado" value="<?=$escrever["estado"];?>"> <option>SC</option> <option>AC</option> <option>AL</option> <option>AM</option> <option>AP</option> <option>BA</option> <option>CE</option> <option>DF</option> <option>ES</option> <option>GO</option> <option>MA</option> <option>MG</option> <option>MS</option> <option>muito</option> <option>PA</option> <option>PB</option> <option>PE</option> <option>PI</option> <option>PR</option> <option>RS</option> <option>RJ</option> <option>RN</option> <option>RO</option> <option>RR</option> <option>SE</option> <option>SP</option> <option>TO</option> </select></td> </tr> <tr> <td>CEP:</td> <td><input class="fcep" type="text" name="cep" id="cep" value="<?=$escrever["cep"];?>" maxlength="9" onkeyup="maskIt(this,event,'#####-###')" /> </td> </tr> <tr> <td>Telefone:</td> <td><input class="ftelefone" type="text" name="telefone" id="telefone" maxlength="13" value="<?=$escrever["telefone"];?>" onkeyup="maskIt(this,event,'(##)####-####')" /> </td> </tr> <tr> <td>Celular:</td> <td><input class="ftelefone" type="text" name="celular" id="celular" maxlength="13" value="<?=$escrever["celular"];?>" onkeyup="maskIt(this,event,'(##)####-####')" /> </td> </tr> <tr> <td>Skype:</td> <td><input class="femail" type="text" name="skype" id="skype" value="<?=$escrever["skype"];?>" /> </td> </tr> </table> </div> <div class="dLista3"> <input class="button" type="submit" value="Incluir" name="incluir" /> <input class="button" type="submit" value="Alterar" name="alterar" /> <input class="button" type="submit" value="Excluir" name="excluir"/> <input class="button" type="button" value="Retornar Consulta" onclick="window.location='consultanatabela.php'" /> </div> </div> </form> </body> </html> Grato
  14. lorenzi

    Link em tabela

    Ola Tibum esta dando erro quando passo o ID: outra coisa como eu faço pra passar tabem o valor informado na descricao para ser usado na consulta sql abaixo?? <form action="#"> <div class="dConsultaini"> <h1> Consulta lista telefônica </h1> <div class="dconsulta1"> <span class="negrito"> Informe parte do nome: </span> <input class="tdescricao" type="text" name="descricao" id="descricao" /> <input class="button" type="submit" name="enviar" value="Buscar" onclick="Verifica()" /> </div> <div class="dconsulta2"> <?php include "conf.php"; $res = mysql_query("select * from contato "); /*Executa o comando SQL, no caso para pegar todos os usuarios do sistema e retorna o valor da consulta em uma variavel ($res) */ echo "<table border=1><tr><td width='300'>NOME</td><td width='200'>CIDADE</td><td width='100'>TELEFONE</td><td width='100'>SKYPE</td><td>EDITAR</td><td>EXCLUIR</td></tr>"; while($escrever=mysql_fetch_array($res)){ echo "<tr><td>" . $escrever['nome'] . "</td><td>" . $escrever['cidade'] . "</td><td>" . $escrever['telefone'] . "</td> <td>" . $escrever['skype'] . "</td> <td width=90'><a href="fLista.html?id=$escrever['id_contato]">Alterar</a></td> <td width='90'><a href='fLista.html'>Excluir</a></td> </tr>"; } echo "</table>"; /*fecha a tabela apos termino de impressão das linhas*/ // mysql_close(conexao); ?> </div> <div class="dconsulta3"> <input class="button" type="button" value="Sair do Sistema" name="login" onclick="window.location='logout.php'" /> <input class="button" type="button" value="Incluir usuário" name="usuario" onclick="window.location='fUsuario.html'" /> <input class="button" type="button" value="Incluir contato" name="contato" onclick="window.location='fLista.html'" /> </div> </div> <p> <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10-blue" alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a> </p> </form>
  15. lorenzi

    Link em tabela

    Valeu Tibum vou testar, brigadao
  16. lorenzi

    Link em tabela

    Ok galera o link eu consegui so não consegui o esquema de colocar o ID oculto, e ler na proxima janela...
  17. Pessoal seguinte não manjo muito de html mas to tentando fazer uns esquema que é o seguinte : Faço a leitura no banco e trago os dados para limentar uma tabela, ai nesta tabela quando eu clicar na linha eu vou ser direcionado pra tela pra excluir ou alterar, so que não estou conseguindo fazer este link: <div class="dconsulta2"> <?php include "conf.php"; $res = mysql_query("select * from usuario "); /*Executa o comando SQL, no caso para pegar todos os usuarios do sistema e retorna o valor da consulta em uma variavel ($res) */ echo "<table><tr><td width='300'>NOME</td><td width='200'>CIDADE</td><td width='100'>TELEFONE</td><td width='100'>SKYPE</td></tr>"; while($escrever=mysql_fetch_array($res)){ echo "<tr><td>" . $escrever['nome'] . "</td><td>" . $escrever['cidade'] . "</td><td>" . $escrever['telefone'] . "</td> <td>" . $escrever['skype'] . "</td></tr>"; }/*Fim do while*/ echo "</table>"; /*fecha a tabela apos termino de impressão das linhas*/ mysql_close(conexao); ?> </div> Outra coisa como eu faço pra colocar o ID oculto ak, tipo quando eu clicar levar o id pra alterar ou excluir baseado nele ... Grato..
×
×
  • Criar Novo...