Ir para conteúdo
Fórum Script Brasil

mestre fyoda

Membros
  • Total de itens

    1.908
  • Registro em

  • Última visita

Tudo que mestre fyoda postou

  1. Eu tenho uma tabela chamada Agenda_Tecnica, onde vai conter o cod_funcionario_cadastro ( codigo do funcionario que cadastrou no sistema ) e o cod_funcionario_visita ( codigo do funcionario que vai no cliente ) num só registro. Exemplo: cod_funcionario_cadastro cod_funcionario_visita 10 50 30 27 Eu preciso buscar o nome deles na tabela Funcionario, como eu faria isso ?
  2. echo $buffer = file_get_contents("Backup/tipo_funcionario--11-04-2009-01-29-43.sql"); mysql_query($buffer) or die(mysql_error()); Veja que estou dando echo ali em cima, eu pego o que me retorna desse echo e inserio Manualmente no phpmyadmin e funciona mas esse mesma querry que foi inserida com sucesso no phpmyadmin não funciona quando executada no php. CREATE TABLE tipo_funcionario ( codigo_tipo_funcionario int(11) NOT NULL auto_increment, tipo_funcionario varchar(50) NOT NULL , privilegio_funcionario int(11) NOT NULL , PRIMARY KEY (codigo_tipo_funcionario) ); INSERT INTO tipo_funcionario VALUES('1' , 'Administrador' , '1'); INSERT INTO tipo_funcionario VALUES('2' , 'Usuario' , '3'); You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO tipo_funcionario VALUES('1' , 'Administrador' , '1'); INSERT INTO ti' at line 8
  3. <br /> <b>Warning</b>: implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed in <b>C:\Servidor PHP\www\insert.php</b> on line <b>91</b><br /> Query was empty o meu sql CREATE TABLE tipo_funcionario ( codigo_tipo_funcionario int(11) NOT NULL auto_increment, tipo_funcionario varchar(50) NOT NULL , privilegio_funcionario int(11) NOT NULL , PRIMARY KEY (codigo_tipo_funcionario) ); INSERT INTO tipo_funcionario VALUES('1' , 'Administrador' , '1'); INSERT INTO tipo_funcionario VALUES('2' , 'Usuario' , '3'); meu codigo $arquivo = @fopen("Backup/chamado--11-04-2009-01-29-43.sql", "r"); $array = @file($arquivo); $conteudo = implode(" ", $array); mysql_query($conteudo) or die(mysql_error()); Muito estranho estar dando esse erro. alguém poderia me ajudar ?
  4. Veja, esse codigo pega a quatnidade do array dinamicamente e faz o for de acordo com a quantidade do array. <?php $test=array("t1","t2","t3"); $array[] = new array(); for( $i = 0; $i < count($test); $i++ ) $array[] = $test[$i]; ?> veja que você vai guardar no $array[] todos os valores do $test. neste exemplo vai ficar assim : $array[0] = t1 $array[1] = t2 $array[2] = t3 qualquer duvida poste ai !
  5. Por exemplo, tenho a classe Mysql , Zip e Backup. Na classe Backup eu preciso fazer um extends Mysql e Zip, como eu faço ?
  6. <b>Catchable fatal error</b>: Object of class stdClass could not be converted to string in <b>C:\Servidor PHP\www\insert.php</b> on line <b>54</b><br /> $privilegio = json_decode($_POST["privilegio"]); for($i = 0; $i < count($privilegio); $i++){ $sql = mysql_query("INSERT INTO Privilegio (codigo_funcionario, codigo_formulario, ler, cadastrar, editar, excluir, imprimir, exportar) VALUES( $codigo_funcionario, $privilegio[$i]->codigo_formulario , $privilegio[$i]->ler , $privilegio[$i]->cadastrar , $privilegio[$i]->editar , $privilegio[$i]->excluir , $privilegio[$i]->imprimir , $privilegio[$i]->exportar ) "); } Linha 54 é a linha do VALUES
  7. retornou [{"codigo_privilegio":"","nome_funcionario":"","nome_formulario":"Chamado","tipo":"","ler":true,"cadastrar" :false,"editar":false,"excluir":false,"imprimir":false,"exportar":false},{"codigo_privilegio":"","nome_funcionario" :"","nome_formulario":"Relatorio Chamado","tipo":"","ler":true,"cadastrar":false,"editar":false,"excluir" :false,"imprimir":false,"exportar":false}]
  8. <br /> <b>Warning</b>: file_get_contents([]) [<a href='function.file-get-contents'>function.file-get-contents </a>]: failed to open stream: No such file or directory in <b>C:\Servidor PHP\www\insert.php</b> on line <b>57</b><br /> esta dando está essa warning e continua retornando null ! $contents = file_get_contents($_POST['data']); $contents = utf8_encode($contents); $json = json_decode($contents); var_dump($json[0]);
  9. $json = json_decode($_POST['data']); var_dump($json->{'nome_formulario'}); Verifiquei e o data esta passando assim: data [{"codigo_privilegio":"","nome_funcionario":"","nome_formulario":"Chamado","tipo":"","ler":true,"cadastrar" :false,"editar":false,"excluir":false,"imprimir":false,"exportar":false},{"codigo_privilegio":"","nome_funcionario" :"","nome_formulario":"Relatorio Chamado","tipo":"","ler":true,"cadastrar":false,"editar":false,"excluir" :false,"imprimir":false,"exportar":false}] Porque está retornando NULL ?
  10. Como eu faço para fazer uma pesquisa no array ?
  11. <?php mysql_connect("localhost", "root", "janio1"); mysql_select_db("kiko"); $pagina = $_GET["pagina"]; $maximo = 5; $inicio = $pagina - 1; $inicio = $maximo * $inicio; $sql = mysql_query("Select * from foto LIMIT $inicio,$maximo "); while( $arr = mysql_fetch_array($sql) ){ ?> O problema esta na linha do while . alguém sabe me informar como arrumar isso ?
  12. RESOLVIDO . $linha = str_replace("\r\n", "",$linha); include("boleto\\". $linha .".php"); Mas agora to com outro problema, supondo que esse seja a minha lista de boletos no txt: bb cef unibanco bradesco nossacaixa banespa hsbc itau unibanco hsbc banespa nossacaixa cef bradesco itau bb , acontece que repete os boletos, ate ai beleza. Quando passa do primeiro itau as funções de todos os bancos adotam a função do itau, mas o layout dos bancos ficam corretos . require_once("include/funcoes_nomebanco.php"); include("include/layout_nomebanco.php");
  13. Eu tentei fazer isso mas ele so abre o ultimo arquivo, porque ? <?php //$arquivo = copy( $_FILES["file"][tmp_name], ); $abrir = fopen( "boleto.txt", "r"); while( !feof($abrir) ){ ?> <div class="folha"> <?php $linha = fgets($abrir, 4096); @include("boleto\\". $linha .".php"); ?> </div> <?php } ?>
  14. Como que eu faço para ler uma mensagem no email em php ? for($i = 1;$i <= imap_num_msg($connection);$i++) { $headers = imap_header($connection, $i); $assunto = $headers->subject; $message_id = $headers->message_id; $toaddress = $headers->toaddress; $to = $headers->to; $remetente = $to[0]->personal; $email_remetente = $to[0]->mailbox; $servidor_remetente = $to[0]->host; $data = $headers->date; $lido = $headers->Recent; $data = strtotime($data); $data = date("d/m/Y H:i:s", $data); echo "<br>". $lido; } $mensagem = imap_fetchbody($connection, $i, 1); echo nl2br(quoted_printable_decode($mensagem)); esta dando a seguinte mensagem : alguém saberia o porque de não estar listando ?
  15. var posInicial = stri.indexOf("<br><center><b>Solução</b></center><br>"); esta estranho, porque essa string existe no formulario, porem se der alert nela retorna -1. se eu retirar os <br> e <center></center> retorna outro valsor, lembrando que essa string existe. porque isso ocorre ?
  16. Estou usando a versao 3.17, alguém saberia resolver esse problema ?
  17. mestre fyoda

    Projeto BoletoPHP

    <TD vAlign=bottom align=left height=50>sasasassaas". fbarcode($dadosboleto["codigo_barras"]) ." esta parte gera o codigo de barra, eu coloquei sasasassaas para testar e elas ficaram no lugar do codigo de barra, porem o codigo de barra ficou la em cima.
  18. mestre fyoda

    Projeto BoletoPHP

    ESerra, a variavel $boleto gaurda tudo sim, mas o problema é que o codigo de barra ele está no topo da pagina. Neste link http://rafaelfernandes.dyndns.info:8090/upload/upload.php mostra o codigo de barra no topo, tirando o codigo de barra no topo ta tudo certinho. Você saberia o que está havendo ? No layout_bradesco.php, aonde está o codigo fbarcode($dadosboleto["codigo_barras"]) , é aonde gera o codigo de barra !
  19. mestre fyoda

    Projeto BoletoPHP

    malz ai :) as vezes você pode ter ai :) to com outro problema. O Codigo de barra ele ta aparecendo no topo do site. http://rafaelfernandes.dyndns.info:8090/upload/upload.php O problema está no layout_bradesco.php ! boleto_bradesco.php <?php $dias_de_prazo_para_pagamento = 5; $taxa_boleto = 2.95; $data_venc = date("d/m/Y", time() + ($dias_de_prazo_para_pagamento * 86400)); // Prazo de X dias OU informe data: "13/04/2006"; $valor_cobrado = "2950,00"; // Valor - REGRA: Sem pontos na milhar e tanto faz com "." ou "," ou com 1 ou 2 ou sem casa decimal $valor_cobrado = str_replace(",", ".",$valor_cobrado); $valor_boleto=number_format($valor_cobrado+$taxa_boleto, 2, ',', ''); $dadosboleto["nosso_numero"] = "75896452"; // Nosso numero sem o DV - REGRA: Máximo de 11 caracteres! $dadosboleto["numero_documento"] = $dadosboleto["nosso_numero"]; // Num do pedido ou do documento = Nosso numero $dadosboleto["data_vencimento"] = $data_venc; // Data de Vencimento do Boleto - REGRA: Formato DD/MM/AAAA $dadosboleto["data_documento"] = date("d/m/Y"); // Data de emissão do Boleto $dadosboleto["data_processamento"] = date("d/m/Y"); // Data de processamento do boleto (opcional) $dadosboleto["valor_boleto"] = $valor_boleto; // Valor do Boleto - REGRA: Com vírgula e sempre com duas casas depois da virgula // DADOS DO SEU CLIENTE $dadosboleto["sacado"] = "Nome do seu Cliente"; $dadosboleto["endereco1"] = "Endereço do seu Cliente"; $dadosboleto["endereco2"] = "Cidade - Estado - CEP: 00000-000"; // INFORMACOES PARA O CLIENTE $dadosboleto["demonstrativo1"] = "Pagamento de Compra na Loja Nonononono"; $dadosboleto["demonstrativo2"] = "Mensalidade referente a nonon nonooon nononon<br>Taxa bancária - R$ ".number_format($taxa_boleto, 2, ',', ''); $dadosboleto["demonstrativo3"] = "BoletoPhp - http://www.boletophp.com.br"; $dadosboleto["instrucoes1"] = "- Sr. Caixa, cobrar multa de 2% após o vencimento"; $dadosboleto["instrucoes2"] = "- Receber até 10 dias após o vencimento"; $dadosboleto["instrucoes3"] = "- Em caso de dúvidas entre em contato conosco: xxxx@xxxx.com.br"; $dadosboleto["instrucoes4"] = "&nbsp; Emitido pelo sistema Projeto BoletoPhp - www.boletophp.com.br"; // DADOS OPCIONAIS DE ACORDO COM O BANCO OU CLIENTE $dadosboleto["quantidade"] = "001"; $dadosboleto["valor_unitario"] = $valor_boleto; $dadosboleto["aceite"] = ""; $dadosboleto["especie"] = "R$"; $dadosboleto["especie_doc"] = "DS"; // ---------------------- DADOS FIXOS DE CONFIGURAÇÃO DO SEU BOLETO --------------- // // DADOS DA SUA CONTA - Bradesco $dadosboleto["agencia"] = "1172"; // Num da agencia, sem digito $dadosboleto["agencia_dv"] = "0"; // Digito do Num da agencia $dadosboleto["conta"] = "0403005"; // Num da conta, sem digito $dadosboleto["conta_dv"] = "2"; // Digito do Num da conta // DADOS PERSONALIZADOS - Bradesco $dadosboleto["conta_cedente"] = "0403005"; // ContaCedente do Cliente, sem digito (Somente Números) $dadosboleto["conta_cedente_dv"] = "2"; // Digito da ContaCedente do Cliente $dadosboleto["carteira"] = "06"; // Código da Carteira: pode ser 06 ou 03 // SEUS DADOS $dadosboleto["identificacao"] = "BoletoPhp - Código Aberto de Sistema de Boletos"; $dadosboleto["cpf_cnpj"] = ""; $dadosboleto["endereco"] = "Coloque o endereço da sua empresa aqui"; $dadosboleto["cidade_uf"] = "Cidade / Estado"; $dadosboleto["cedente"] = "Coloque a Razão Social da sua empresa aqui"; // NÃO ALTERAR! include("include/funcoes_bradesco.php"); include("include/layout_bradesco.php"); echo $boleto; ?> layout_bradesco.php <?php if( isset($dadosboleto["cpf_cnpj"]) ) $dadosboleto["cpf_cnpj"] = "<br>". $dadosboleto["cpf_cnpj"]; else $dadosboleto["cpf_cnpj"] = ''; $boleto = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'> <HTML> <HEAD> <TITLE>". $dadosboleto["identificacao"] ."</TITLE> <META http-equiv=Content-Type content=text/html charset=ISO-8859-1> <style type=text/css> .cp { font: bold 10px Arial; color: black} .ti { font: 9px Arial, Helvetica, sans-serif} .ld { font: bold 15px Arial; color: #000000} .ct { FONT: '9px Arial Narrow'; COLOR: #000033} .cn { FONT: 9px Arial; COLOR: black } .bc { font: bold 20px Arial; color: #000000 } .ld2 { font: bold 12px Arial; color: #000000 } body { page-break-after: always } </style> </head> <BODY text=#000000 bgColor=#ffffff topMargin=0 rightMargin=0> <table width=666 cellspacing=0 cellpadding=0 border=0><tr><td valign=top class=cp><DIV ALIGN=CENTER>Instruções de Impressão</DIV></TD></TR><TR><TD valign=top class=cp><DIV ALIGN=left> <p> <li>Imprima em impressora jato de tinta (ink jet) ou laser em qualidade normal ou alta (Não use modo econômico).<br> <li>Utilize folha A4 (210 x 297 mm) ou Carta (216 x 279 mm) e margens mínimas à esquerda e à direita do formulário.<br> <li>Corte na linha indicada. Não rasure, risque, fure ou dobre a região onde se encontra o código de barras.<br> <li>Caso não apareça o código de barras no final, clique em F5 para atualizar esta tela. <li>Caso tenha problemas ao imprimir, copie a seqüencia numérica abaixo e pague no caixa eletrônico ou no internet banking:<br><br> <span class=ld2> &nbsp;&nbsp;&nbsp;&nbsp;Linha Digitável: &nbsp;". $dadosboleto["linha_digitavel"] ."<br> &nbsp;&nbsp;&nbsp;&nbsp;Valor: &nbsp;&nbsp;R$ ". $dadosboleto["valor_boleto"] ."<br> </span> </DIV></td></tr></table><br><table cellspacing=0 cellpadding=0 width=666 border=0><TBODY><TR><TD class=ct width=666><img height=1 src=../boleto/imagens/imagens/6.png width=665 border=0></TD></TR><TR><TD class=ct width=666><div align=right><b class=cp>Recibo do Sacado</b></div></TD></tr></tbody></table><table width=666 cellspacing=5 cellpadding=0 border=0><tr><td width=41></TD></tr></table> <table width=666 cellspacing=5 cellpadding=0 border=0 align=Default> <tr> <td width=41><IMG src=../boleto/imagens/logo_empresa.png></td> <td class=ti width=455>". $dadosboleto["identificacao"] ." ". $dadosboleto["cpf_cnpj"] ."<br> ". $dadosboleto["endereco"] ."<br> ". $dadosboleto["cidade_uf"] ."<br> </td> <td align=RIGHT width=150 class=ti>&nbsp;</td> </tr> </table> <BR><table cellspacing=0 cellpadding=0 width=666 border=0><tr><td class=cp width=150> <span class=campo><IMG src=../boleto/imagens/logobradesco.jpg width=150 height=40 border=0></span></td> <td width=3 valign=bottom><img height=22 src=../boleto/imagens/3.png width=2 border=0></td><td class=cpt width=58 valign=bottom><div align=center><font class=bc>". $dadosboleto["codigo_banco_com_dv"]."</font></div></td><td width=3 valign=bottom><img height=22 src=../boleto/imagens/3.png width=2 border=0></td><td class=ld align=right width=453 valign=bottom><span class=ld> <span class=campotitulo> ". $dadosboleto["linha_digitavel"] ." </span></span></td> </tr><tbody><tr><td colspan=5><img height=2 src=../boleto/imagens/2.png width=666 border=0></td></tr></tbody></table><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=298 height=13>Cedente</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=126 height=13>Agência/Código do Cedente</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=34 height=13>Espécie</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=53 height=13>Quantidade</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=120 height=13>Nosso número</td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=298 height=12> <span class=campo> ". $dadosboleto["cedente"] ."</span></td> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=126 height=12> <span class=campo> ". $dadosboleto["agencia_codigo"] ." </span></td> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=34 height=12><span class=campo> ". $dadosboleto["especie"] ." </span> </td> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=53 height=12><span class=campo> ". $dadosboleto["quantidade"]." </span> </td> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=120 height=12> <span class=campo> ". $dadosboleto["nosso_numero"] ." </span></td> </tr><tr><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=298 height=1><img height=1 src=../boleto/imagens/2.png width=298 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=126 height=1><img height=1 src=../boleto/imagens/2.png width=126 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=34 height=1><img height=1 src=../boleto/imagens/2.png width=34 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=53 height=1><img height=1 src=../boleto/imagens/2.png width=53 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=120 height=1><img height=1 src=../boleto/imagens/2.png width=120 border=0></td></tr></tbody></table><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top colspan=3 height=13>Número do documento</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=132 height=13>CPF/CNPJ</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=134 height=13>Vencimento</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=180 height=13>Valor documento</td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top colspan=3 height=12> <span class=campo> ". $dadosboleto["numero_documento"] ." </span></td> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=132 height=12> <span class=campo> ". $dadosboleto["cpf_cnpj"] ." </span></td> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=134 height=12> <span class=campo> ". $dadosboleto["data_vencimento"] ." </span></td> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=180 height=12> <span class=campo> ". $dadosboleto["valor_boleto"]." </span></td> </tr><tr><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=113 height=1><img height=1 src=../boleto/imagens/2.png width=113 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=72 height=1><img height=1 src=../boleto/imagens/2.png width=72 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=132 height=1><img height=1 src=../boleto/imagens/2.png width=132 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=134 height=1><img height=1 src=../boleto/imagens/2.png width=134 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=180 height=1><img height=1 src=../boleto/imagens/2.png width=180 border=0></td></tr></tbody></table><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=113 height=13>(-) Desconto / Abatimentos</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=112 height=13>(-) Outras deduções</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=113 height=13>(+) Mora / Multa</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=113 height=13>(+) Outros acréscimos</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=180 height=13>(=) Valor cobrado</td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=113 height=12></td><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=112 height=12></td><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=113 height=12></td><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=113 height=12></td><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=180 height=12></td></tr><tr><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=113 height=1><img height=1 src=../boleto/imagens/2.png width=113 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=112 height=1><img height=1 src=../boleto/imagens/2.png width=112 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=113 height=1><img height=1 src=../boleto/imagens/2.png width=113 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=113 height=1><img height=1 src=../boleto/imagens/2.png width=113 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=180 height=1><img height=1 src=../boleto/imagens/2.png width=180 border=0></td></tr></tbody></table><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=659 height=13>Sacado</td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=659 height=12> <span class=campo> ". $dadosboleto["sacado"]." </span></td> </tr><tr><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=659 height=1><img height=1 src=../boleto/imagens/2.png width=659 border=0></td></tr></tbody></table><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct width=7 height=12></td><td class=ct width=564 >Demonstrativo</td><td class=ct width=7 height=12></td><td class=ct width=88 >Autenticação mecânica</td></tr><tr><td width=7 ></td><td class=cp width=564 > <span class=campo> ". $dadosboleto["demonstrativo1"]."<br> ". $dadosboleto["demonstrativo2"]."<br> ". $dadosboleto["demonstrativo3"]."<br> </span> </td><td width=7 ></td><td width=88 ></td></tr></tbody></table><table cellspacing=0 cellpadding=0 width=666 border=0><tbody><tr><td width=7></td><td width=500 class=cp> <br><br><br> </td><td width=159></td></tr></tbody></table><table cellspacing=0 cellpadding=0 width=666 border=0><tr><td class=ct width=666></td></tr><tbody><tr><td class=ct width=666> <div align=right>Corte na linha pontilhada</div></td></tr><tr><td class=ct width=666><img height=1 src=../boleto/imagens/6.png width=665 border=0></td></tr></tbody></table><br><table cellspacing=0 cellpadding=0 width=666 border=0><tr><td class=cp width=150> <span class=campo><IMG src=../boleto/imagens/logobradesco.jpg width=150 height=40 border=0></span></td> <td width=3 valign=bottom><img height=22 src=../boleto/imagens/3.png width=2 border=0></td><td class=cpt width=58 valign=bottom><div align=center><font class=bc>". $dadosboleto["codigo_banco_com_dv"]."</font></div></td><td width=3 valign=bottom><img height=22 src=../boleto/imagens/3.png width=2 border=0></td><td class=ld align=right width=453 valign=bottom><span class=ld> <span class=campotitulo> ". $dadosboleto["linha_digitavel"]." </span></span></td> </tr><tbody><tr><td colspan=5><img height=2 src=../boleto/imagens/2.png width=666 border=0></td></tr></tbody></table><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=472 height=13>Local de pagamento</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=180 height=13>Vencimento</td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=472 height=12>Pagável em qualquer Banco até o vencimento</td><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=180 height=12> <span class=campo> ". $dadosboleto["data_vencimento"]." </span></td> </tr><tr><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=472 height=1><img height=1 src=../boleto/imagens/2.png width=472 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=180 height=1><img height=1 src=../boleto/imagens/2.png width=180 border=0></td></tr></tbody></table><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=472 height=13>Cedente</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=180 height=13>Agência/Código cedente</td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=472 height=12> <span class=campo> ". $dadosboleto["cedente"]." </span></td> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=180 height=12> <span class=campo> ". $dadosboleto["agencia_codigo"]." </span></td> </tr><tr><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=472 height=1><img height=1 src=../boleto/imagens/2.png width=472 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=180 height=1><img height=1 src=../boleto/imagens/2.png width=180 border=0></td></tr></tbody></table><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct valign=top width=7 height=13> <img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=113 height=13>Data do documento</td><td class=ct valign=top width=7 height=13> <img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=153 height=13>N<u>o</u> documento</td><td class=ct valign=top width=7 height=13> <img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=62 height=13>Espécie doc.</td><td class=ct valign=top width=7 height=13> <img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=34 height=13>Aceite</td><td class=ct valign=top width=7 height=13> <img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=82 height=13>Data processamento</td><td class=ct valign=top width=7 height=13> <img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=180 height=13>Nosso número</td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=113 height=12><div align=left> <span class=campo> ". $dadosboleto["data_documento"]." </span></div></td><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=153 height=12> <span class=campo> ". $dadosboleto["numero_documento"]." </span></td> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=62 height=12><div align=left><span class=campo> ". $dadosboleto["especie_doc"]." </span> </div></td><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=34 height=12><div align=left><span class=campo> ". $dadosboleto["aceite"]." </span> </div></td><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=82 height=12><div align=left> <span class=campo> ". $dadosboleto["data_processamento"]." </span></div></td><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=180 height=12> <span class=campo> ". $dadosboleto["nosso_numero"]." </span></td> </tr><tr><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=113 height=1><img height=1 src=../boleto/imagens/2.png width=113 border=0></td><td valign=top width=7 height=1> <img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=153 height=1><img height=1 src=../boleto/imagens/2.png width=153 border=0></td><td valign=top width=7 height=1> <img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=62 height=1><img height=1 src=../boleto/imagens/2.png width=62 border=0></td><td valign=top width=7 height=1> <img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=34 height=1><img height=1 src=../boleto/imagens/2.png width=34 border=0></td><td valign=top width=7 height=1> <img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=82 height=1><img height=1 src=../boleto/imagens/2.png width=82 border=0></td><td valign=top width=7 height=1> <img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=180 height=1> <img height=1 src=../boleto/imagens/2.png width=180 border=0></td></tr></tbody></table><table cellspacing=0 cellpadding=0 border=0><tbody><tr> <td class=ct valign=top width=7 height=13> <img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top COLSPAN=3 height=13>Uso do banco</td><td class=ct valign=top height=13 width=7> <img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=83 height=13>Carteira</td><td class=ct valign=top height=13 width=7> <img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=53 height=13>Espécie</td><td class=ct valign=top height=13 width=7> <img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=123 height=13>Quantidade</td><td class=ct valign=top height=13 width=7> <img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=72 height=13> Valor Documento</td><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=180 height=13>(=) Valor documento</td></tr><tr> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td valign=top class=cp height=12 COLSPAN=3><div align=left> </div></td><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=83> <div align=left> <span class=campo> ". $dadosboleto["carteira"]." </span></div></td><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=53><div align=left><span class=campo> ". $dadosboleto["especie"]." </span> </div></td><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=123><span class=campo> ". $dadosboleto["quantidade"]." </span> </td> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=72> <span class=campo> ". $dadosboleto["valor_unitario"]." </span></td> <td class=cp valign=top width=7 height=12> <img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=180 height=12> <span class=campo> ". $dadosboleto["valor_boleto"]." </span></td> </tr><tr><td valign=top width=7 height=1> <img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=75 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=31 height=1><img height=1 src=../boleto/imagens/2.png width=31 border=0></td><td valign=top width=7 height=1> <img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=83 height=1><img height=1 src=../boleto/imagens/2.png width=83 border=0></td><td valign=top width=7 height=1> <img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=53 height=1><img height=1 src=../boleto/imagens/2.png width=53 border=0></td><td valign=top width=7 height=1> <img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=123 height=1><img height=1 src=../boleto/imagens/2.png width=123 border=0></td><td valign=top width=7 height=1> <img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=72 height=1><img height=1 src=../boleto/imagens/2.png width=72 border=0></td><td valign=top width=7 height=1> <img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=180 height=1><img height=1 src=../boleto/imagens/2.png width=180 border=0></td></tr></tbody> </table><table cellspacing=0 cellpadding=0 width=666 border=0><tbody><tr><td align=right width=10><table cellspacing=0 cellpadding=0 border=0 align=left><tbody> <tr> <td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td></tr><tr> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td></tr><tr> <td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=1 border=0></td></tr></tbody></table></td><td valign=top width=468 rowspan=5><font class=ct>Instruções (Texto de responsabilidade do cedente)</font><br><br><span class=cp> <FONT class=campo> ". $dadosboleto["instrucoes1"] ."<br> ". $dadosboleto["instrucoes2"] ."<br> ". $dadosboleto["instrucoes3"] ."<br> ". $dadosboleto["instrucoes4"] ."</FONT><br><br> </span></td> <td align=right width=188><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=180 height=13>(-) Desconto / Abatimentos</td></tr><tr> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=180 height=12></td></tr><tr> <td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=180 height=1><img height=1 src=../boleto/imagens/2.png width=180 border=0></td></tr></tbody></table></td></tr><tr><td align=right width=10> <table cellspacing=0 cellpadding=0 border=0 align=left><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td></tr><tr><td valign=top width=7 height=1> <img height=1 src=../boleto/imagens/2.png width=1 border=0></td></tr></tbody></table></td><td align=right width=188><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=180 height=13>(-) Outras deduções</td></tr><tr><td class=cp valign=top width=7 height=12> <img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=180 height=12></td></tr><tr><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=180 height=1><img height=1 src=../boleto/imagens/2.png width=180 border=0></td></tr></tbody></table></td></tr><tr><td align=right width=10> <table cellspacing=0 cellpadding=0 border=0 align=left><tbody><tr><td class=ct valign=top width=7 height=13> <img height=13 src=../boleto/imagens/1.png width=1 border=0></td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td></tr><tr><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=1 border=0></td></tr></tbody></table></td><td align=right width=188> <table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=180 height=13>(+) Mora / Multa</td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=180 height=12></td></tr><tr> <td valign=top width=7 height=1> <img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=180 height=1> <img height=1 src=../boleto/imagens/2.png width=180 border=0></td></tr></tbody></table></td></tr><tr><td align=right width=10><table cellspacing=0 cellpadding=0 border=0 align=left><tbody><tr> <td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td></tr><tr><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=1 border=0></td></tr></tbody></table></td><td align=right width=188> <table cellspacing=0 cellpadding=0 border=0><tbody><tr> <td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=180 height=13>(+) Outros acréscimos</td></tr><tr> <td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=180 height=12></td></tr><tr><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=180 height=1><img height=1 src=../boleto/imagens/2.png width=180 border=0></td></tr></tbody></table></td></tr><tr><td align=right width=10><table cellspacing=0 cellpadding=0 border=0 align=left><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td></tr></tbody></table></td><td align=right width=188><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=180 height=13>(=) Valor cobrado</td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top align=right width=180 height=12></td></tr></tbody> </table></td></tr></tbody></table><table cellspacing=0 cellpadding=0 width=666 border=0><tbody><tr><td valign=top width=666 height=1><img height=1 src=../boleto/imagens/2.png width=666 border=0></td></tr></tbody></table><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=659 height=13>Sacado</td></tr><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=659 height=12><span class=campo> ". $dadosboleto["sacado"]." </span> </td> </tr></tbody></table><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=cp valign=top width=7 height=12><img height=12 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=659 height=12><span class=campo> ". $dadosboleto["endereco1"]." </span> </td> </tr></tbody></table><table cellspacing=0 cellpadding=0 border=0><tbody><tr><td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=cp valign=top width=472 height=13> <span class=campo> ". $dadosboleto["endereco2"]." </span></td> <td class=ct valign=top width=7 height=13><img height=13 src=../boleto/imagens/1.png width=1 border=0></td><td class=ct valign=top width=180 height=13>Cód. baixa</td></tr><tr><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=472 height=1><img height=1 src=../boleto/imagens/2.png width=472 border=0></td><td valign=top width=7 height=1><img height=1 src=../boleto/imagens/2.png width=7 border=0></td><td valign=top width=180 height=1><img height=1 src=../boleto/imagens/2.png width=180 border=0></td></tr></tbody></table><TABLE cellSpacing=0 cellPadding=0 border=0 width=666><TBODY><TR><TD class=ct width=7 height=12></TD><TD class=ct width=409 >Sacador/Avalista</TD><TD class=ct width=250 ><div align=right>Autenticação mecânica - <b class=cp>Ficha de Compensação</b></div></TD></TR><TR><TD class=ct colspan=3 ></TD></tr></tbody></table><TABLE cellSpacing=0 cellPadding=0 width=666 border=0><TBODY><TR><TD vAlign=bottom align=left height=50>". fbarcode($dadosboleto["codigo_barras"]) ." </TD> </tr></tbody></table><TABLE cellSpacing=0 cellPadding=0 width=666 border=0><TR><TD class=ct width=666></TD></TR><TBODY><TR><TD class=ct width=666><div align=right>Corte na linha pontilhada</div></TD></TR><TR><TD class=ct width=666><img height=1 src=../boleto/imagens/6.png width=665 border=0></TD></tr></tbody></table> </BODY></HTML>"; ?> funcoes_bradesco.php <?php $codigobanco = "237"; $codigo_banco_com_dv = geraCodigoBanco($codigobanco); $nummoeda = "9"; $fator_vencimento = fator_vencimento($dadosboleto["data_vencimento"]); //valor tem 10 digitos, sem virgula $valor = formata_numero($dadosboleto["valor_boleto"],10,0,"valor"); //agencia é 4 digitos $agencia = formata_numero($dadosboleto["agencia"],4,0); //conta é 6 digitos $conta = formata_numero($dadosboleto["conta"],6,0); //dv da conta $conta_dv = formata_numero($dadosboleto["conta_dv"],1,0); //carteira é 2 caracteres $carteira = $dadosboleto["carteira"]; //nosso número (sem dv) é 11 digitos $nnum = formata_numero($dadosboleto["carteira"],2,0).formata_numero($dadosboleto["nosso_numero"],11,0); //dv do nosso número $dv_nosso_numero = digitoVerificador_nossonumero($nnum); //conta cedente (sem dv) é 7 digitos $conta_cedente = formata_numero($dadosboleto["conta_cedente"],7,0); //dv da conta cedente $conta_cedente_dv = formata_numero($dadosboleto["conta_cedente_dv"],1,0); //$ag_contacedente = $agencia . $conta_cedente; // 43 numeros para o calculo do digito verificador do codigo de barras $dv = digitoVerificador_barra("$codigobanco$nummoeda$fator_vencimento$valor$agencia$nnum$conta_cedente".'0', 9, 0); // Numero para o codigo de barras com 44 digitos $linha = "$codigobanco$nummoeda$dv$fator_vencimento$valor$agencia$nnum$conta_cedente"."0"; $nossonumero = substr($nnum,0,2).'/'.substr($nnum,2).'-'.$dv_nosso_numero; $agencia_codigo = $agencia."-".$dadosboleto["agencia_dv"]." / ". $conta_cedente ."-". $conta_cedente_dv; $dadosboleto["codigo_barras"] = $linha; $dadosboleto["linha_digitavel"] = monta_linha_digitavel($linha); $dadosboleto["agencia_codigo"] = $agencia_codigo; $dadosboleto["nosso_numero"] = $nossonumero; $dadosboleto["codigo_banco_com_dv"] = $codigo_banco_com_dv; function digitoVerificador_nossonumero($numero) { $resto2 = modulo_11($numero, 7, 1); $digito = 11 - $resto2; if ($digito == 10) { $dv = "P"; } elseif($digito == 11) { $dv = 0; } else { $dv = $digito; } return $dv; } function digitoVerificador_barra($numero) { $resto2 = modulo_11($numero, 9, 1); if ($resto2 == 0 || $resto2 == 1 || $resto2 == 10) { $dv = 1; } else { $dv = 11 - $resto2; } return $dv; } // FUNÇÕES // Algumas foram retiradas do Projeto PhpBoleto e modificadas para atender as particularidades de cada banco function formata_numero($numero,$loop,$insert,$tipo = "geral") { if ($tipo == "geral") { $numero = str_replace(",","",$numero); while(strlen($numero)<$loop){ $numero = $insert . $numero; } } if ($tipo == "valor") { /* retira as virgulas formata o numero preenche com zeros */ $numero = str_replace(",","",$numero); while(strlen($numero)<$loop){ $numero = $insert . $numero; } } if ($tipo == "convenio") { while(strlen($numero)<$loop){ $numero = $numero . $insert; } } return $numero; } function fbarcode($valor){ $fino = 1; $largo = 3; $altura = 50; $barcodes[0] = "00110"; $barcodes[1] = "10001"; $barcodes[2] = "01001"; $barcodes[3] = "11000"; $barcodes[4] = "00101"; $barcodes[5] = "10100"; $barcodes[6] = "01100"; $barcodes[7] = "00011"; $barcodes[8] = "10010"; $barcodes[9] = "01010"; for($f1=9;$f1>=0;$f1--){ for($f2=9;$f2>=0;$f2--){ $f = ($f1 * 10) + $f2; $texto = ""; for($i=1;$i<6;$i++){ $texto .= substr($barcodes[$f1],($i-1),1) . substr($barcodes[$f2],($i-1),1); } $barcodes[$f] = $texto; } } //Desenho da barra //Guarda inicial ?><img src=../boleto/imagens/p.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img src=../boleto/imagens/b.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img src=../boleto/imagens/p.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img src=../boleto/imagens/b.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img <?php $texto = $valor; if((strlen($texto) % 2) <> 0){ $texto = "0" . $texto; } // Draw dos dados while (strlen($texto) > 0) { $i = round(esquerda($texto,2)); $texto = direita($texto,strlen($texto)-2); $f = $barcodes[$i]; for($i=1;$i<11;$i+=2){ if (substr($f,($i-1),1) == "0") { $f1 = $fino; }else{ $f1 = $largo; } ?> src=../boleto/imagens/p.png width=<?php echo $f1?> height=<?php echo $altura?> border=0><img <?php if (substr($f,$i,1) == "0") { $f2 = $fino; }else{ $f2 = $largo; } ?> src=../boleto/imagens/b.png width=<?php echo $f2?> height=<?php echo $altura?> border=0><img <?php } } // Draw guarda final ?> src=../boleto/imagens/p.png width=<?php echo $largo?> height=<?php echo $altura?> border=0><img src=../boleto/imagens/b.png width=<?php echo $fino?> height=<?php echo $altura?> border=0><img src=../boleto/imagens/p.png width=<?php echo 1?> height=<?php echo $altura?> border=0> <?php } //Fim da função function esquerda($entra,$comp){ return substr($entra,0,$comp); } function direita($entra,$comp){ return substr($entra,strlen($entra)-$comp,$comp); } function fator_vencimento($data) { $data = split("/",$data); $ano = $data[2]; $mes = $data[1]; $dia = $data[0]; return(abs((_dateToDays("1997","10","07")) - (_dateToDays($ano, $mes, $dia)))); } function _dateToDays($year,$month,$day) { $century = substr($year, 0, 2); $year = substr($year, 2, 2); if ($month > 2) { $month -= 3; } else { $month += 9; if ($year) { $year--; } else { $year = 99; $century --; } } return ( floor(( 146097 * $century) / 4 ) + floor(( 1461 * $year) / 4 ) + floor(( 153 * $month + 2) / 5 ) + $day + 1721119); } function modulo_10($num) { $numtotal10 = 0; $fator = 2; // Separacao dos numeros for ($i = strlen($num); $i > 0; $i--) { // pega cada numero isoladamente $numeros[$i] = substr($num,$i-1,1); // Efetua multiplicacao do numero pelo (falor 10) // 2002-07-07 01:33:34 Macete para adequar ao Mod10 do Itaú $temp = $numeros[$i] * $fator; $temp0=0; foreach (preg_split('//',$temp,-1,PREG_SPLIT_NO_EMPTY) as $k=>$v){ $temp0+=$v; } $parcial10[$i] = $temp0; //$numeros[$i] * $fator; // monta sequencia para soma dos digitos no (modulo 10) $numtotal10 += $parcial10[$i]; if ($fator == 2) { $fator = 1; } else { $fator = 2; // intercala fator de multiplicacao (modulo 10) } } // várias linhas removidas, vide função original // Calculo do modulo 10 $resto = $numtotal10 % 10; $digito = 10 - $resto; if ($resto == 0) { $digito = 0; } return $digito; } function modulo_11($num, $base=9, $r=0) { /** * Autor: * Pablo Costa <pablo@users.sourceforge.net> * * Função: * Calculo do Modulo 11 para geracao do digito verificador * de boletos bancarios conforme documentos obtidos * da Febraban - www.febraban.org.br * * Entrada: * $num: string numérica para a qual se deseja calcularo digito verificador; * $base: valor maximo de multiplicacao [2-$base] * $r: quando especificado um devolve somente o resto * * Saída: * Retorna o Digito verificador. * * Observações: * - Script desenvolvido sem nenhum reaproveitamento de código pré existente. * - Assume-se que a verificação do formato das variáveis de entrada é feita antes da execução deste script. */ $soma = 0; $fator = 2; /* Separacao dos numeros */ for ($i = strlen($num); $i > 0; $i--) { // pega cada numero isoladamente $numeros[$i] = substr($num,$i-1,1); // Efetua multiplicacao do numero pelo falor $parcial[$i] = $numeros[$i] * $fator; // Soma dos digitos $soma += $parcial[$i]; if ($fator == $base) { // restaura fator de multiplicacao para 2 $fator = 1; } $fator++; } /* Calculo do modulo 11 */ if ($r == 0) { $soma *= 10; $digito = $soma % 11; if ($digito == 10) { $digito = 0; } return $digito; } elseif ($r == 1){ $resto = $soma % 11; return $resto; } } function monta_linha_digitavel($codigo) { // 01-03 -> Código do banco sem o digito // 04-04 -> Código da Moeda (9-Real) // 05-05 -> Dígito verificador do código de barras // 06-09 -> Fator de vencimento // 10-19 -> Valor Nominal do Título // 20-44 -> Campo Livre (Abaixo) // 20-23 -> Código da Agencia (sem dígito) // 24-05 -> Número da Carteira // 26-36 -> Nosso Número (sem dígito) // 37-43 -> Conta do Cedente (sem dígito) // 44-44 -> Zero (Fixo) // 1. Campo - composto pelo código do banco, código da moéda, as cinco primeiras posições // do campo livre e DV (modulo10) deste campo $p1 = substr($codigo, 0, 4); // Numero do banco + Carteira $p2 = substr($codigo, 19, 5); // 5 primeiras posições do campo livre $p3 = modulo_10("$p1$p2"); // Digito do campo 1 $p4 = "$p1$p2$p3"; // União $campo1 = substr($p4, 0, 5).'.'.substr($p4, 5); // 2. Campo - composto pelas posiçoes 6 a 15 do campo livre // e livre e DV (modulo10) deste campo $p1 = substr($codigo, 24, 10); //Posições de 6 a 15 do campo livre $p2 = modulo_10($p1); //Digito do campo 2 $p3 = "$p1$p2"; $campo2 = substr($p3, 0, 5).'.'.substr($p3, 5); // 3. Campo composto pelas posicoes 16 a 25 do campo livre // e livre e DV (modulo10) deste campo $p1 = substr($codigo, 34, 10); //Posições de 16 a 25 do campo livre $p2 = modulo_10($p1); //Digito do Campo 3 $p3 = "$p1$p2"; $campo3 = substr($p3, 0, 5).'.'.substr($p3, 5); // 4. Campo - digito verificador do codigo de barras $campo4 = substr($codigo, 4, 1); // 5. Campo composto pelo fator vencimento e valor nominal do documento, sem // indicacao de zeros a esquerda e sem edicao (sem ponto e virgula). Quando se // tratar de valor zerado, a representacao deve ser 000 (tres zeros). $p1 = substr($codigo, 5, 4); $p2 = substr($codigo, 9, 10); $campo5 = "$p1$p2"; return "$campo1 $campo2 $campo3 $campo4 $campo5"; } function geraCodigoBanco($numero) { $parte1 = substr($numero, 0, 3); $parte2 = modulo_11($parte1); return $parte1 . "-" . $parte2; } ?>
  20. Como colocar o layout_bradesco.php numa variavel ?
  21. eu já olhei na documentação mas não sei como ir para a proxima pagina do pdf , como eu faço isso ? require_once("../pdf/dompdf_config.inc.php"); $txt = file ("upload/golive_10_10_2008.txt"); $old_limit = ini_set("memory_limit", "16M"); $dompdf = new DOMPDF(); for($i = 0; $i < count($txt); $i++) { $txt[$i] = "". .""; $dompdf->load_html($txt[$i]); COLOCAR PROXIMA PAGINA AQUI } $dompdf->set_paper("a10", "portrait"); $dompdf->render(); $dompdf->stream("dompdf_out.pdf"); alguém saberia como fazer ?
  22. create view status_chamado as SELECT e.nome_empresa, Count( c.codigo_empresa ) as Aberto FROM Empresa e INNER JOIN Chamado c ON e.codigo_empresa = c.codigo_empresa WHERE status = 1 GROUP BY e.codigo_empresa UNION ALL SELECT e.nome_empresa, Count( c.codigo_empresa ) as Fechado FROM Empresa e INNER JOIN Chamado c ON e.codigo_empresa = c.codigo_empresa WHERE status = 0 GROUP BY e.codigo_empresa Retorna duas Colunas: -nome_empresa -Aberto Eu queria que retornace 3 colunas : -nome_empresa -Aberto -Fechado Porque a coluna Fechado não é criada ? Os dados dela fica na coluna Aberto!
  23. Como eu faço com o Administrador para colocar a pasta do microsoft Officce em outro usuario ?
  24. como eu faço para colocar o notebook ( wireless ) em rede com o meu PC , sem utilizar cabo de rede ? Eu não quero que o meu notebook não use cabo de rede e nem o meu pc use cabo de rede para que a rede funcione, tem como ?
×
×
  • Criar Novo...