Eu criei 4 arquivos, cidade_acao.php, cidade_lista.php, cidade_manutencao.php e index.php
Eu queria listar as informações da tabela tbl_cidade no index, Só que não sei oque estou fazendo de errado :/
Estou trabalhando com a biblioteca adodb e os arquivos são:
index.php:
cidade_manutencao.php:
cidade_lista.php
cidade_acao.php
Eu queria listar as informações da tabela tbl_cidade no index, Só que não sei oque estou fazendo de errado :/
Estou trabalhando com a biblioteca adodb e os arquivos são:
index.php:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sem título</title>
</head>
<body>
<table width="859" height="319" border="0" cellpadding="5" cellspacing="5">
<tr>
<td colspan="2"><div align="center">
<h1>Carrinho de Compras - Área administrativa</h1>
</div></td>
</tr>
<tr>
<td width="137"><a href="index.php">Home</a><br />Categoria<br />
<a href="index.php?tabela=cidade&acao=listar">Cidade</a><br />
Clientes<br />
Fornecedor<br />
Produtos<br />
Promoção<br />
Pedidos
</td>
<td width="328" align="center" valign="top">
<?php
require('../util/conecta.php');
$tabela= $_REQUEST["tabela"];
if($tabela == "cidade")
require('cidade_acao.php');
else
require('principal.php');
?>
</td>
</tr>
<tr>
<td colspan="2"><div align="center">
<h1>Carrinho de Compras - Área administrativa</h1>
</div></td>
</tr>
</table>
</body>
</html>
Código PHP:
<?php
//começa classe
class cidade_manutencao
{
var $resultado;
var $registro;
function cidade_manutencao()
{
$this->con = new conexao();
}
function listar_cidade()
{
$sql = "select * from tbl_cidade";
$this->resultado = $this->con->banco->Execute($sql);
}
function excluir()
{
//$sql = "select * from tbl_cidade";
//$this->$resultado = $this->con->banco->Execute($sql);
}
function novo_registro()
{
//$sql = "select * from tbl_cidade";
//$this->$resultado = $this->con->banco->Execute($sql);
}
}
//acaba classe
?>
cidade_lista.php
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sem título</title>
</head>
<body>
<table width="500" border="1" cellspacing="5" cellpadding="5">
<tr>
<td colspan="4"><div align="center">Lista de Cidades</div></td>
</tr>
<tr>
<td>Descrição</td>
<td>UF</td>
<td colspan="2">Novo Registro</td>
</tr>
<?php
//require('../util/conecta.php');
while($oquefazer->registro = $oquefazer->resultado->FetchNextObject())
{
?>
<tr>
<td><?php echo $oquefazer->registro->CID_DESCRICAO; ?></td>
<td><?php echo $oquefazer->registro->CID_UF; ?></td>
<td>Alterar</td>
<td>Excluir</td>
</tr>
<?php
}
?>
<tr>
<td colspan="4"><div align="center">Lista de Cidades</div></td>
</tr>
</table>
</body>
</html>
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sem título</title>
</head>
<body>
<table width="500" border="1" cellspacing="5" cellpadding="5">
<tr>
<td colspan="4"><div align="center">Lista de Cidades</div></td>
</tr>
<tr>
<td>Descrição</td>
<td>UF</td>
<td colspan="2">Novo Registro</td>
</tr>
<?php
//require('../util/conecta.php');
while($oquefazer->registro = $oquefazer->resultado->FetchNextObject())
{
?>
<tr>
<td><?php echo $oquefazer->registro->CID_DESCRICAO; ?></td>
<td><?php echo $oquefazer->registro->CID_UF; ?></td>
<td>Alterar</td>
<td>Excluir</td>
</tr>
<?php
}
?>
<tr>
<td colspan="4"><div align="center">Lista de Cidades</div></td>
</tr>
</table>
</body>
</html>
Comment