-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsuaPhongBan.php
More file actions
46 lines (45 loc) · 1.61 KB
/
Copy pathsuaPhongBan.php
File metadata and controls
46 lines (45 loc) · 1.61 KB
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
<?php
$connect = new mysqli("localhost", "root", "", "qlnhanvien1");
$output = '';
if(isset($_POST["query"]))
{
$search = mysqli_real_escape_string($connect, $_POST["query"]);
$query = "
SELECT * FROM phongban
WHERE tenphongban LIKE '%".$search."%'
OR sdt LIKE '%".$search."%'
";
$result = $connect->query($query);
if($result->num_rows > 0)
{
while($row = $result->fetch_assoc())
{
$output .= '
<div>
<h4>Thông tin phòng ban</h4>
<form method="POST">
<div class="form-row form-group col-xl-12">
<input readonly type="text" class="form-control" placeholder="mã phòng ban" name="maps" required value="'.$row['maphongban'].'">
</div>
<div class="form-row form-group col-xl-12">
<input type="text" class="form-control" placeholder="Tên phòng ban" name="tenphongbans" required value="'.$row['tenphongban'].'">
</div>
<div class="form-row col-xl-12">
<input type="text" class="form-control" placeholder="Số điện thoại" name="sdtpb" required value="'.$row['sdt'].'">
</div>
<br>
<div class="form-row form-group col-xl-12 text-center">
<input type="submit" value="Sửa phòng ban" name="btnsuapb">
</div>
</form>
</div>
';
}
echo $output;
}
else
{
echo 'Nhập sai nhập lại';
}
}
?>