-
Notifications
You must be signed in to change notification settings - Fork 0
/
sualophoc.php
46 lines (45 loc) · 1.61 KB
/
sualophoc.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
<?php
$connect = new mysqli("localhost", "root", "", "qlsinhvien1");
$output = '';
if(isset($_POST["query"]))
{
$search = mysqli_real_escape_string($connect, $_POST["query"]);
$query = "
SELECT * FROM lophoc
WHERE tenlophoc 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 lớp học</h4>
<form method="POST">
<div class="form-row form-group col-xl-12">
<input readonly type="text" class="form-control" placeholder="mã lớp học" name="maps" required value="'.$row['malophoc'].'">
</div>
<div class="form-row form-group col-xl-12">
<input type="text" class="form-control" placeholder="Tên lớp học" name="tenlophocs" required value="'.$row['tenlophoc'].'">
</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 lớp học" name="btnsuapb">
</div>
</form>
</div>
';
}
echo $output;
}
else
{
echo 'Nhập sai nhập lại';
}
}
?>