-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphoneNumberList.php
73 lines (61 loc) · 1.56 KB
/
phoneNumberList.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
67
68
69
70
71
72
73
<?php
$activeTitle="Phone Number List";
$activePage='phoneNumberList';
require 'ustHtml.php';
require 'loginControl.php';
?>
<div class="container">
<div class='row text-center'>
<h1 class='alert alert-primary mt-3'>Phone Number List</h1>
</div>
<form method="GET">
<p class="text-center">
Enter Name, Unit Or Phone Number: <input type="text" name="name_form">
<button type="submit" value="Search" class="btn btn-primary">Search <i class="bi bi-search"></i></button>
</p>
</form>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
<th>Degree</th>
<th>Phone Number</th>
</tr>
</thead>
<tbody>
<?php
require_once('db.php');
if (isset($_GET['name_form'])) {
// Formdan gelen kişileri göster...
$ArananAd = $_GET['name_form'];
$ArananAd = "%{$ArananAd}%";
} else {
$ArananAd = "";
}
$sql = "SELECT * FROM users
WHERE
name LIKE :name_form OR
email LIKE :name_form OR
degree LIKE :name_form OR
phonenumber LIKE :name_form
LIMIT 50";
$SORGU = $DB->prepare($sql);
$SORGU->bindParam(':name_form', $ArananAd);
$SORGU->execute();
$users = $SORGU->fetchAll(PDO::FETCH_ASSOC);
foreach ($users as $user) {
echo "
<tr>
<td>{$user['name']}</td>
<td>{$user['email']}</td>
<td>{$user['degree']}</td>
<td>{$user['phonenumber']}</td>
</tr>
";
}
?>
</tbody>
</table>
</div>
<?php require 'altHtml.php'; ?>