-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbusca.php
66 lines (62 loc) · 2.32 KB
/
busca.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
session_start();
include_once 'includes/header.inc.php';
include_once 'includes/menu.inc.php';
?>
<div class="row container">
<div class="col s12">
<h5 class="light">Pesquisa de clientes e fornecedores</h5><hr>
<p class="light">
Você pesquisou por
<?php
include_once 'BD/conexao.php';
$busca = $_GET['pesquisa'];
echo '<b>'.$busca.'</b>';
?>
</p>
<table class="striped">
<thead>
<tr>
<th>ID</th>
<th>Nome Cliente</th>
<th>E-mail</th>
<th>Telefone</th>
<th>Fornecedor</th>
<th>Conferente</th>
<th>Data cadastro</th>
</tr>
</thead>
<tbody>
<?php
include_once 'BD/conexao.php';
$busca = $_GET['pesquisa'];
$querySelect = $link->query("
SELECT * FROM clientes WHERE nome LIKE '%$busca%' ".
"OR fornecedor LIKE '%$busca%'
");
while($registros = $querySelect->fetch_assoc()):
$id = $registros['id'];
$nome = $registros['nome'];
$email = $registros['email'];
$telefone = $registros['telefone'];
$fornecedor = $registros['fornecedor'];
$conferente = $registros['conferente'];
$created = $registros['created_at'];
echo "
<tr>
<td>$id</td>
<td>$nome</td>
<td>$email</td>
<td>$telefone</td>
<td>$fornecedor</td>
<td>$conferente</td>
<td>$created</td>
</tr>
";
endwhile;
?>
</tbody>
</table>
</div>
</div>
<?php include_once 'includes/footer.inc.php' ?>