Advertisement
Guest User

Untitled

a guest
Nov 28th, 2015
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.39 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. $conn = mysql_connect('localhost', 'root', 'root') or die("Erro ao conectar no BD");
  5. mysql_select_db("bancoruralcomputacao") or die("Erro ao selecionar BD");
  6.  
  7. mysql_query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'", $conn);
  8.  
  9.  
  10. $result = mysql_query("SELECT correntista.codigo, correntista.nomecorrentista, correntista.idtc as tipocorrentista,
  11. correntista.dtcad, correntista.cpf, correntista.sexo, correntista.dtnasc,
  12. correntista.cnpj, correntista.nomefantasia, correntista.inscestadual, correntista.email,
  13. conta.saldoconta, tipoconta.idt , tipoconta.tipoconta
  14. FROM `correntista`
  15. LEFT JOIN tipocorrentista ON correntista.idtc=tipocorrentista.idtc
  16. LEFT JOIN conta ON correntista.codigo=conta.correntista
  17. LEFT JOIN tipoconta ON conta.tipo=tipoconta.idt
  18. ORDER BY CORRENTISTA.nomecorrentista LIMIT 0, 25") or die(mysql_error());
  19.  
  20.  
  21. $correntistas = array();
  22. while( $row = mysql_fetch_object($result))
  23. {
  24. $correntistas[] = $row;
  25. }
  26.  
  27.  
  28. ?>
  29. <!DOCTYPE unspecified PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  30. <head>
  31. <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  32. <style>
  33. *{
  34.  
  35. font-size: small;
  36. font-family: tahoma;
  37. }
  38. table#tb-correntista caption{
  39. border: 1px solid #eee;
  40. }
  41. table#tb-correntista{
  42. border: 1px solid #ccc;
  43. border-collapse: collapse;
  44. }
  45.  
  46. table#tb-correntista thead tr th{
  47. border: 1px solid #ccc;
  48. }
  49. table#tb-correntista tbody tr td{
  50. border-bottom: 1px solid #ccc;
  51. padding: 2px 2px 5px 5px;
  52. }
  53.  
  54. </style>
  55. </head>
  56. <body>
  57.  
  58. <table id="tb-correntista">
  59. <caption><h3>Tabela de Correntistas</h3></caption>
  60. <thead>
  61. <tr>
  62. <th>Nome</th>
  63. <th>cpf</th>
  64. <th>cnpj</th>
  65. <th>sexo</th>
  66. <th>Tipo de Conta</th>
  67. <th>Ação</th>
  68. </tr>
  69. </thead>
  70. <tbody>
  71. <?php
  72. $count = 0;
  73. foreach($correntistas As $correntista)
  74. {
  75. $count++;
  76. $poe_cinza = false;
  77. if($count%2) $poe_cinza = true;
  78. ?>
  79. <tr>
  80. <td bgcolor="<?php if($poe_cinza) echo '#eee';?>"><?php echo $correntista->nomecorrentista; ?></td>
  81. <td bgcolor="<?php if($poe_cinza) echo '#eee';?>"><?php echo $correntista->cpf?></td>
  82. <td bgcolor="<?php if($poe_cinza) echo '#eee';?>"><?php echo $correntista->cnpj?></td>
  83. <td bgcolor="<?php if($poe_cinza) echo '#eee';?>"><?php echo $correntista->sexo?></td>
  84. <td bgcolor="<?php if($poe_cinza) echo '#eee';?>"><?php echo $correntista->tipoconta?></td>
  85. <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>
  86. </tr>
  87. <?php
  88. }
  89.  
  90.  
  91. ?>
  92. </tbody>
  93. </table>
  94. </body>
  95.  
  96. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement