Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $conn = mysql_connect('localhost', 'root', 'root') or die("Erro ao conectar no BD");
- mysql_select_db("bancoruralcomputacao") or die("Erro ao selecionar BD");
- mysql_query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'", $conn);
- $result = mysql_query("SELECT correntista.codigo, correntista.nomecorrentista, correntista.idtc as tipocorrentista,
- correntista.dtcad, correntista.cpf, correntista.sexo, correntista.dtnasc,
- correntista.cnpj, correntista.nomefantasia, correntista.inscestadual, correntista.email,
- conta.saldoconta, tipoconta.idt , tipoconta.tipoconta
- FROM `correntista`
- LEFT JOIN tipocorrentista ON correntista.idtc=tipocorrentista.idtc
- LEFT JOIN conta ON correntista.codigo=conta.correntista
- LEFT JOIN tipoconta ON conta.tipo=tipoconta.idt
- ORDER BY CORRENTISTA.nomecorrentista LIMIT 0, 25") or die(mysql_error());
- $correntistas = array();
- while( $row = mysql_fetch_object($result))
- {
- $correntistas[] = $row;
- }
- ?>
- <!DOCTYPE unspecified PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <head>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <style>
- *{
- font-size: small;
- font-family: tahoma;
- }
- table#tb-correntista caption{
- border: 1px solid #eee;
- }
- table#tb-correntista{
- border: 1px solid #ccc;
- border-collapse: collapse;
- }
- table#tb-correntista thead tr th{
- border: 1px solid #ccc;
- }
- table#tb-correntista tbody tr td{
- border-bottom: 1px solid #ccc;
- padding: 2px 2px 5px 5px;
- }
- </style>
- </head>
- <body>
- <table id="tb-correntista">
- <caption><h3>Tabela de Correntistas</h3></caption>
- <thead>
- <tr>
- <th>Nome</th>
- <th>cpf</th>
- <th>cnpj</th>
- <th>sexo</th>
- <th>Tipo de Conta</th>
- <th>Ação</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $count = 0;
- foreach($correntistas As $correntista)
- {
- $count++;
- $poe_cinza = false;
- if($count%2) $poe_cinza = true;
- ?>
- <tr>
- <td bgcolor="<?php if($poe_cinza) echo '#eee';?>"><?php echo $correntista->nomecorrentista; ?></td>
- <td bgcolor="<?php if($poe_cinza) echo '#eee';?>"><?php echo $correntista->cpf?></td>
- <td bgcolor="<?php if($poe_cinza) echo '#eee';?>"><?php echo $correntista->cnpj?></td>
- <td bgcolor="<?php if($poe_cinza) echo '#eee';?>"><?php echo $correntista->sexo?></td>
- <td bgcolor="<?php if($poe_cinza) echo '#eee';?>"><?php echo $correntista->tipoconta?></td>
- <td bgcolor="<?php if($poe_cinza) echo '#eee';?>"><a href="editar_correntista.php?id=">editar</a> | <a href="excluir_correntista.php?id=">excluir</a></td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement