-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSearch.php
50 lines (48 loc) · 1.21 KB
/
Search.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
<?php
require_once "includes/Header.php";
require_once "Model/db.php";
$num = 1;
if(isset($_GET['sbtn'])){
$form = $_GET['search'];
$query = mysqli_query($conn , "SELECT * FROM data_tbl WHERE name LIKE '%$form%' or class LIKE '%$form%' or divisi like '%$form%'");
}else{
$query = mysqli_query($conn , "SELECT * FROM data_tbl");
}
?>
<br><br>
<br><br><br>
<div class="container">
<h5 align="center">
hasil pencarian untuk <?= $form; ?>
</h5>
<br>
<br>
<table class="table table-striped table-hover">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Nama</th>
<th scope="col">Kelas</th>
<th scope="col">Divisi</th>
<th scope="col">#</th>
</tr>
</thead>
<tbody>
<?php while($row = mysqli_fetch_object($query)) :?>
<tr>
<th><?= $num++?></th>
<td ><?=$row->name ?></td>
<td><?=$row->class ?></td>
<td ><?=$row->divisi ?></td>
<td>
<a class="btn btn-primary btn-sm" href="Anggota.php" role="button">@detail</a>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<?php
require_once "includes/Footer.php";
?>