drsmachado 23 de fev. de 2012
Sim, gera.
Existe um filtro, feito em php mesmo, que pode resolver isso.
O problema é que não me recordo como era feito, tampouco qual o link.
Mas acredito que o google pode te dar esse caminho…
perdeu 23 de fev. de 2012
fuadksd 23 de fev. de 2012
posso mandar, mas vai ficar estranho por causa do banco
<?php
session_start ();
$_SESSION [ 'ERROS' ][] = 'erro' ;
error_reporting ( E_ALL ^ E_NOTICE );
$Titulo = 'Categorias' ;
require 'conexaoabre.php' ;
require 'util.inc.php' ;
$Query = "
SELECT
ID, NOME, RD
FROM
CATEGORIAS
WHERE
ATIVO = 1 AND
ID > 0
" ;
$RS = & $DB -> Execute ( $Query );
if ( $RS -> NumRows () > 0 ) {
$HTMLListagem = '
<table class="listagem">
<thead>
<th>Nome</th>
<th>Tipo</th>
<th>Editar</th>
<th>Deletar</th>
</thead>
<tbody>
' ;
while ( ! $RS -> EOF ) {
$HTMLListagem .= '
<tr>' .
'<td>' . $RS -> fields [ 1 ] . '</td>' .
'<td>' . formataDebitoCredito ( $RS -> fields [ 2 ]) . '</td>' .
'<td class="link controle">' . '<a href="categoriascadastro.php?id=' . $RS -> fields [ 0 ] . '" title="Editar ' . $RS -> fields [ 1 ] . '">Editar</a>' . '</td>' .
'<td class="link controle">' . '<a href="categoriasdelete.php?id=' . $RS -> fields [ 0 ] . '" title="Deletar ' . $RS -> fields [ 1 ] . '">Deletar</a>' . '</td>' .
'</tr>
' ;
$RS -> MoveNext ();
}
$HTMLListagem .= '
</tbody>
</table>
' ;
} else {
$HTMLListagem .= '<h1>Não foram encontrados registros</h1>' ;
}
$HTMLMenu = '
<div class="menu">
<a class="liberacadastro" href="#" title="Adicionar uma categoria">Adicionar</a>
</div>
' ;
// View
require_once 'cabecalho.php' ;
echo $HTMLListagem ;
echo $HTMLMenu ;
echo '
<div id="cadastro">
' ;
require_once 'categoriascadastro.php' ;
echo '
</div>
' ;
echo '
<script type="text/javascript">
$(document).ready(function() {
$(".liberacadastro").click(function() {
liberaCadastro();
});
});
</script>
' ;
require_once 'rodape.php' ;
require 'conexaofecha.php' ;
?>
essa é uma listagem. se tu rodar e ver o html, aqui aparece uma barra branca em cima. no fonte do HTML não tem nada, ta normal. mas se tu olha no console do opera, onde ele mostra o resultado parseado, ele coloca o conteudo do head dentro do body.
esse é o html resultante:
 <!DOCTYPE html>
< html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "en" >
< head >
< meta charset = "UTF-8" />
< title > Cali | Categorias</ title >
< link rel = "stylesheet" href = "css/cabecalho.css" type = "text/css" media = "screen" />
< link rel = "stylesheet" href = "css/conteudo.css" type = "text/css" media = "screen" />
< script type = "text/javascript" src = "js/jquery.js" ></ script >
< script type = "text/javascript" src = "js/util.js" ></ script >
</ head >
< body >
< div id = "topo" >
< nav id = "menutopo" >
< ul >
< li >< a href = "index.php" > Início</ a ></ li >
< li >< a href = "favorecidoslista.php" > Favorecidos</ a ></ li >
< li >< a href = "fluxolista.php" > Fluxo</ a ></ li >
< li >< a href = "categoriaslista.php" > Categorias</ a ></ li >
< li >< a href = "contaslista.php" > Contas</ a ></ li >
< li >< a href = "#" > 123</ a ></ li >
< li >< a href = "#" > 456</ a ></ li >
< li >< a href = "#" > 789</ a ></ li >
< li >< a href = "#" > Sair</ a ></ li >
</ ul >
</ nav >
</ div >
< table id = "cabecalho" >
< tbody >
< td >< a href = "index.php" title = "Início" >< img src = "imagens/cali_logo.png" width = "150" height = "75" alt = "Cali" /></ a ></ td >
< td >< span id = "titulo" > Categorias</ span ></ td >
</ tr >
</ tbody >
</ table >
< nav id = "menulateral" >
< ul >
< li >< a href = "index.php" > Início</ a ></ li >
< li >< a href = "favorecidoslista.php" > Favorecidos</ a ></ li >
< li >< a href = "fluxolista.php" > Fluxo</ a ></ li >
< li >< a href = "categoriaslista.php" > Categorias</ a ></ li >
< li >< a href = "contaslista.php" > Contas</ a ></ li >
< li >< a href = "#" > 123</ a ></ li >
< li >< a href = "#" > 456</ a ></ li >
< li >< a href = "#" > 789</ a ></ li >
< li >< a href = "#" > abc</ a ></ li >
< li >< a href = "#" > def</ a ></ li >
< li >< a href = "#" > ghi</ a ></ li >
< li >< a href = "#" > jkl</ a ></ li >
< li >< a href = "#" > mno</ a ></ li >
< li >< a href = "#" > pqr</ a ></ li >
< li >< a href = "#" > stu</ a ></ li >
< li >< a href = "#" > vwx</ a ></ li >
< li >< a href = "#" > yz</ a ></ li >
</ ul >
</ nav >
< div id = "conteudo" >
< table class = "listagem" >
< thead >
< th > Nome</ th >
< th > Tipo</ th >
< th > Editar</ th >
< th > Deletar</ th >
</ thead >
< tbody >
< tr >< td > Aluguel</ td >< td > Débito</ td >< td class = "link controle" >< a href = "categoriascadastro.php?id=1" title = "Editar Aluguel" > Editar</ a ></ td >< td class = "link controle" >< a href = "categoriasdelete.php?id=1" title = "Deletar Aluguel" > Deletar</ a ></ td ></ tr >
< tr >< td > Condom� nio</ td >< td > Débito</ td >< td class = "link controle" >< a href = "categoriascadastro.php?id=2" title = "Editar Condom�nio" > Editar</ a ></ td >< td class = "link controle" >< a href = "categoriasdelete.php?id=2" title = "Deletar Condom�nio" > Deletar</ a ></ td ></ tr >
< tr >< td > Energia</ td >< td > Débito</ td >< td class = "link controle" >< a href = "categoriascadastro.php?id=4" title = "Editar Energia" > Editar</ a ></ td >< td class = "link controle" >< a href = "categoriasdelete.php?id=4" title = "Deletar Energia" > Deletar</ a ></ td ></ tr >
< tr >< td > Telefone</ td >< td > Débito</ td >< td class = "link controle" >< a href = "categoriascadastro.php?id=5" title = "Editar Telefone" > Editar</ a ></ td >< td class = "link controle" >< a href = "categoriasdelete.php?id=5" title = "Deletar Telefone" > Deletar</ a ></ td ></ tr >
< tr >< td > Categoría com Acento</ td >< td > Débito</ td >< td class = "link controle" >< a href = "categoriascadastro.php?id=6" title = "Editar Categoría com Acento" > Editar</ a ></ td >< td class = "link controle" >< a href = "categoriasdelete.php?id=6" title = "Deletar Categoría com Acento" > Deletar</ a ></ td ></ tr >
< tr >< td > Software</ td >< td > Crédito</ td >< td class = "link controle" >< a href = "categoriascadastro.php?id=7" title = "Editar Software" > Editar</ a ></ td >< td class = "link controle" >< a href = "categoriasdelete.php?id=7" title = "Deletar Software" > Deletar</ a ></ td ></ tr >
< tr >< td > Cali Lab</ td >< td > Crédito</ td >< td class = "link controle" >< a href = "categoriascadastro.php?id=8" title = "Editar Cali Lab" > Editar</ a ></ td >< td class = "link controle" >< a href = "categoriasdelete.php?id=8" title = "Deletar Cali Lab" > Deletar</ a ></ td ></ tr >
< tr >< td > Cali Web</ td >< td > Crédito</ td >< td class = "link controle" >< a href = "categoriascadastro.php?id=9" title = "Editar Cali Web" > Editar</ a ></ td >< td class = "link controle" >< a href = "categoriasdelete.php?id=9" title = "Deletar Cali Web" > Deletar</ a ></ td ></ tr >
< tr >< td > myLIMS</ td >< td > Débito</ td >< td class = "link controle" >< a href = "categoriascadastro.php?id=10" title = "Editar myLIMS" > Editar</ a ></ td >< td class = "link controle" >< a href = "categoriasdelete.php?id=10" title = "Deletar myLIMS" > Deletar</ a ></ td ></ tr >
</ tbody >
</ table >
< div class = "menu" >
< a class = "liberacadastro" href = "#" title = "Adicionar uma categoria" > Adicionar</ a >
</ div >
< div id = "cadastro" >
< form action = "categoriasinsert.php" method = "POST" >
< input name = "id" type = "hidden" value = "" >
< table class = "campos" >
< tbody >
< tr >
< td >< label for = "nome" > Nome</ label ></ td >
< td >< input type = "text" name = "nome" id = "nome" autofocus = "autofocus" required = "required" value = "" /></ td >
</ tr >
< tr >
< td >< label for = "supercategoria" > Supercategoria</ label ></ td >
< td >
< select name = "supercategoria" id = "supercategoria" >
< option value = "0" > </ option >
< option value = "1" > Aluguel</ option >
< option value = "5" > Telefone</ option >
< option value = "6" > Categoría com Acento</ option >
< option value = "7" > Software</ option >
</ select >
</ td >
< tr >
< td >< input type = "radio" name = "cd" id = "credito" value = "C" checked = "checked" />< label for = "credito" > Crédito</ label ></ td >
< td >< input type = "radio" name = "cd" id = "debito" value = "D" />< label for = "debito" > Debito</ label ></ td >
</ tr >
< td >< input type = "submit" value = "Gravar" /></ td >
</ tr >
</ tbody >
</ table >
</ form >
 </ div >
</ body >
</ html >
aqui tem uma imagem: https://dl-web.dropbox.com/get/Photos/opera.png?w=7d8c6e6b
drsmachado 23 de fev. de 2012
fuadksd 23 de fev. de 2012
o interessante é que no opera, se eu colocar a linha
include ‘cabecalho.php’;
antes de
include ‘conexao.php’;
ele mostra sem a barra branca.
fuadksd 23 de fev. de 2012
o problema é que ele (por algum motivo desconhecido) tá jogando o conteudo do head no body. isso acaba confundindo o browser.
soaresinfo 23 de fev. de 2012
Cara, isso é a codificação do arquivo, já aconteceu comigo, o editor salva em UTF-8 com BOM (byte order mask). Usei o notepad++ e formatei para UTF-8 sem BOM, salvei e deu certo.
fuadksd 23 de fev. de 2012
nao deu certo. o que mais me intriga é que se tu pegar o fonte em html no browser, copiar, salvar e abrir, aparece tudo certinho.
podem ver que na imagem, na parte de baixo, ele mostra um html diferente do fonte. to ficando louco aqui já.