-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfetch2.php
54 lines (48 loc) · 1.22 KB
/
fetch2.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
<?php
include_once('db_connection.php');
if(isset($_POST["query"]))
{
$search = mysqli_real_escape_string($connection, $_POST["query"]);
$query = "SELECT * FROM client WHERE nom LIKE '%".$search."%' ";
}
else
{
$query = "SELECT * FROM client ORDER BY nom";
}
$result = mysqli_query($connection, $query);
if(mysqli_num_rows($result) > 0)
{
?>
<div class="table-responsive">
<table class="table table bordered">
<tr>
<th>Name</th>
<th>Phone</th>
<th>Email</th>
<th>Registration Date</th>
<th>Facture</th>
</tr>
<?php
while($row = mysqli_fetch_array($result))
{
?>
<tr>
<td><?php echo $row['nom'] . ' ' . $row['prenom']; ?></td>
<td><?php echo $row["phone"]; ?></td>
<td><?php echo $row["email"]; ?></td>
<td><?php echo $row["date_enregistrement_client"]; ?></td>
<td>
<form action="department.php" method="POST">
<input type="hidden" name="id_value" value="<?php echo $row['id_client']; ?>">
<button type="submit" name="id_submit" class="btn btn-success">Facture</button>
</form>
</td>
</tr>
<?php
}
}
else
{
echo 'Data Not Found';
}
?>