Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require('../dao/conexao.php');
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>.:Lista de Cliente:.</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link href="http://localhost/a.swebnet/geral/css/bootstrap-responsive.css" rel="stylesheet">
- <link href="http://localhost/a.swebnet/geral/css/bootstrap.css" rel="stylesheet" media="screen">
- <script src="http://code.jquery.com/jquery.js"></script>
- <script src="http://localhost/a.swebnet/geral/js/bootstrap.min.js"></script>
- </head>
- <body>
- <ul class="breadcrumb">
- <li><a href="http://localhost/a.swebnet/home.php?p=3">Voltar</a> <span class="divider">/</span></li>
- <li class="active">Relatorio Clientes </li>
- </ul>
- <div class="well bs-component">
- <!-- PESQUISAR -->
- <form class="form-search" id="form1" name="form1" method="post" action="#">
- <input type="text" name="busca" id="cadastronome" />      
- <input type="text" name="cl_endereco" id="cadastroendereco"/>   
- <input type="submit" class="btn" name="acao" id="button" value="Buscar" />
- <input type="submit" class="btn" name="acao" maxlength="255" value="Limpar"/>
- <div id="todo">
- <?php
- if (isset($_POST['acao']) && $_POST['acao'] == 'busca') {
- $pesquisa = $_POST['busca'];
- $cl_endereco = $_POST ['cl_endereco'];
- $sql = mysql_query("SELECT * FROM cliente WHERE cl_nome like '%$pesquisa%' and cl_endereco like '%$cl_endereco%' ");
- //Mostrando todos os campos encontrados
- while ($ress = mysql_fetch_assoc($sql)) {
- $cl_nome = $ress['cl_nome'];
- $cl_endereco = $ress['cl_endereco'];
- echo "<td>" . $cl_nome . "</td>";
- echo "<td>" . $cl_endereco . "</td>";
- ?>
- <?php
- }
- }
- ?>
- </div>
- </form>
- <!-- END PESQUISAR -->
- <!-- TRATAMENTO USUARIO -->
- <table class="table table-bordered" id="table_cadastro">
- <thead>
- <tr>
- <th>Ação</th>
- <th>Nome</th>
- <th>Usuário</th>
- <th>CPF</th>
- <th>Endereço</th>
- <th>N°</th>
- <th>Entrada</th>
- <th>Equipamento</th>
- <th>Mac</th>
- <th>Plano</th>
- <th>Valor</th>
- <th>Observação</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <!-- MONSTRANDO DADOS -->
- <?php
- $query = mysql_query("SELECT id, cl_nome,cl_obs,cl_cpf, cl_endereco,cl_numero,cl_data,cl_eqpto,cl_mac,cl_plano,cl_usuario,cl_mensalidade,cl_status FROM cliente ORDER BY cl_nome ASC");
- $TotalReceber = 0;
- $FaltaReceber = 0;
- while ($prod = mysql_fetch_array($query)) {
- echo '<tr>';
- echo '<td><a href="javascript:abrir(\'../controller/crud/editar.php?id=' . $prod['id'] . '\');"><i class="icon-edit"></i></a>';
- echo '  ';
- echo '<a href="../controller/crud/deletar.php?id=' . $prod['id'] . '"><i class="icon-remove"></i></a></td>';
- echo "<td>" . $prod['cl_nome'] . "</td>";
- echo "<td>" . $prod['cl_usuario'] . "</td>";
- echo "<td>" . $prod['cl_cpf'] . "</td>";
- echo "<td>" . $prod['cl_endereco'] . "</td>";
- echo "<td>" . $prod['cl_numero'] . "</td>";
- echo "<td>" . $prod['cl_data'] . "</td>";
- echo "<td>" . $prod['cl_eqpto'] . "</td>";
- echo "<td>" . $prod['cl_mac'] . "</td>";
- echo "<td>" . $prod['cl_plano'] . "</td>";
- // Incluir R$ no campo [VALOR] se o mesmo não for vazio.
- $prod['Valor'] = (!empty($prod['cl_mensalidade'])) ? 'R$ ' . $prod['cl_mensalidade'] : $prod['cl_mensalidade'];
- echo "<td>" . $prod['Valor'] . "</td>";
- echo "<td>" . $prod['cl_obs'] . "</td>";
- echo "<td>" . '<li class="andamento"> <img width="15" id="noneon" src="../geral/img/' . $prod['cl_status'] . '.png" title="' . $prod['cl_status'] . '"/></li>' . "</td>";
- echo '</tr>';
- ?>
- <?php
- if (!empty($prod['cl_mensalidade']) and ( $prod['cl_status'] !== 'Ativo')) {
- $FaltaReceber = $FaltaReceber + $prod['cl_mensalidade'];
- }
- $TotalReceber = $TotalReceber + $prod['cl_mensalidade'];
- }
- ?>
- </tbody>
- </table>
- <span class="label label-important">FALTA RECEBER: <?php echo toReal($FaltaReceber); ?> </span></br></br>
- <span class="label label-info">TOTAL RECEBER: <?php echo toReal($TotalReceber); ?></span>
- </div>
- <style>
- td{list-style:none;}
- </style>
- <script language="JavaScript">
- function abrir(URL) {
- var width = 800;
- var height = 750;
- var left = 99;
- var top = 99;
- window.open(URL, 'janela', 'width=' + width + ', height=' + height + ', top=' + top + ', left=' + left + ', scrollbars=yes, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment