-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimKiemNhanVien.php
65 lines (64 loc) · 1.83 KB
/
timKiemNhanVien.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
<?php
$connect = new mysqli("localhost", "root", "", "qlnhanvien1");
$output = '';
if(isset($_POST["query"]))
{
$search = mysqli_real_escape_string($connect, $_POST["query"]);
$query = "
SELECT nhanvien.ten, nhanvien.ngaysinh,
nhanvien.gioitinh, nhanvien.chucvu,
nhanvien.luong, nhanvien.cmnd,
nhanvien.sdt, nhanvien.email,
nhanvien.diachi, nhanvien.hinhanh,
phongban.tenphongban
FROM nhanvien, phongban
WHERE nhanvien.maphongban=phongban.maphongban
AND nhanvien.ten LIKE '%".$search."%'
";
$result = $connect->query($query);
if($result->num_rows > 0)
{
$output .= '<div class="table-responsive">
<table class="table table-hover">
<thead class="thead-dark">
<tr style="font-size: 11px;">
<th>Ảnh</th>
<th>Tên nhân viên</th>
<th>Giới tính</th>
<th>Ngày sinh</th>
<th>Chức vụ</th>
<th>Lương</th>
<th>CMND</th>
<th>SDT</th>
<th>Email</th>
<th>Địa chỉ</th>
<th>Phòng ban</th>
</tr>
</thead>
<tbody>';
while($row = $result->fetch_assoc())
{
$output .= '
<tr style="font-size: 11px;">
<td> <img src="img/'.$row["hinhanh"].'" style="width: 60px;"></td>
<td>'.$row["ten"].'</td>
<td>'.$row["gioitinh"].'</td>
<td>'.$row["ngaysinh"].'</td>
<td>'.$row["chucvu"].'</td>
<td>'.$row["luong"].'</td>
<td>'.$row["cmnd"].'</td>
<td>'.$row["sdt"].'</td>
<td>'.$row["email"].'</td>
<td>'.$row["diachi"].'</td>
<td>'.$row["tenphongban"].'</td>
</tr>
</tbody>';
}
echo $output;
}
else
{
echo 'Không có kết quả phù hợp';
}
}
?>