001.
<html>
002.
<head>
003.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
/>
004.
<meta name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
005.
<meta http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
/>
006.
011.
<link href=
"css/main.css"
rel=
"stylesheet"
/>
012.
013.
<style>
014.
015.
table {
016.
font-family:
'Kanit'
, sans-serif;
017.
margin-top : 50px;
018.
}
019.
.center {
020.
display: block;
021.
margin-left: auto;
022.
margin-right: auto;
023.
margin-bottom: 30px;
024.
width: 50%;
025.
}
026.
027.
028.
}
029.
</style>
030.
031.
</head>
032.
<body>
033.
<?php
034.
ini_set
(
'display_errors'
, 1);
035.
error_reporting
(~0);
036.
037.
$strKeyword
= null;
038.
039.
if
(isset(
$_POST
[
"txtKeyword"
]))
040.
{
041.
$strKeyword
=
$_POST
[
"txtKeyword"
];
042.
}
043.
044.
include
(
'conn.php'
);
045.
ini_set
(
'memory_limit'
,
'-1'
);
046.
047.
?>
048.
<div
class
=
"s003"
>
049.
<form name=
"frmSearch"
method=
"post"
action=
"<?php echo $_SERVER['SCRIPT_NAME'];?>"
>
050.
<img src=
"/images/logo.png"
class
=
"center"
>
051.
<div
class
=
"inner-form"
>
052.
<div
class
=
"input-field first-wrap"
>
053.
<div
class
=
"input-select"
>
054.
<select data-trigger=
""
name=
"choices"
>
055.
<option placeholder=
""
>เลือกคณะ</option>
056.
<option value=
"<?php $sql = "
SELECT * FROM tbl_education WHERE EID LIKE
'%".$strKeyword."%'
"; $query = mysqli_query($con,$sql); ?> "
>คณะครุศาสตร์</option>
057.
<option value=
"<?php $sql = "
SELECT * FROM tbl_science WHERE std_ID LIKE
'%".$strKeyword."%'
"; $query = mysqli_query($con,$sql); ?>"
>คณะวิทยาศาสตร์และเทคโนโลยี</option>
058.
<option value=
"<?php $sql = "
SELECT * FROM tbl_humanities WHERE HID LIKE
'%".$strKeyword."%'
"; $query = mysqli_query($con,$sql); ?>"
>คณะมนุษยศาสตร์และสังคมศาสตร์</option>
059.
<option value=
"<?php $sql = "
SELECT * FROM tbl_management WHERE MID LIKE
'%".$strKeyword."%'
"; $query = mysqli_query($con,$sql); ?>"
>คณะวิทยาการจัดการ</option>
060.
<option value=
"<?php $sql = "
SELECT * FROM tbl_nurse WHERE NID LIKE
'%".$strKeyword."%'
"; $query = mysqli_query($con,$sql); ?>"
>คณะพยาบาลศาสตร์</option>
061.
062.
</select>
063.
</div>
064.
</div>
065.
<div
class
=
"input-field second-wrap"
>
066.
<input placeholder=
"โปรดใส่รหัสนักศึกษา"
name=
"txtKeyword"
type=
"text"
id=
"txtKeyword"
value=
"<?php echo $strKeyword;?>"
/>
067.
</div>
068.
<div
class
=
"input-field third-wrap"
>
069.
<button
class
=
"btn-search"
type=
"submit"
value=
"Search"
>
070.
<svg
class
=
"svg-inline--fa fa-search fa-w-16"
aria-hidden=
"true"
data-prefix=
"fas"
data-icon=
"search"
role=
"img"
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 512 512"
>
071.
<path fill=
"currentColor"
d=
"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"
></path>
072.
</svg>
073.
</button>
074.
</div>
075.
</div>
076.
077.
<table
class
=
"table table-borderless"
>
078.
079.
<tbody>
080.
<?php
081.
082.
if
(
$strKeyword
) {
083.
$result
=mysqli_fetch_array(
$query
,MYSQLI_ASSOC);
084.
{
085.
?>
086.
087.
<tr>
088.
<td>ชื่อ - นามสกุล</td>
089.
<td><?php
echo
$result
[
"FirstName"
];?> <?php
echo
$result
[
"LastName"
];?></td>
090.
</tr>
091.
<tr>
092.
<td>สถานที่เก็บชั่วโมง</td>
093.
<td><?php
echo
$result
[
"Workloc"
];?></td>
094.
</tr>
095.
<tr>
096.
<td>ชั่วโมงการทำงาน</td>
097.
<td><?php
echo
$result
[
"hour"
];?></td>
098.
</tr>
099.
<?php
100.
} }
101.
?>
102.
</tbody>
103.
</table>
104.
105.
</form>
106.
</div>
107.
<?php
108.
mysqli_close(
$con
);
109.
?>
110.
<script src=
"js/extention/choices.js"
></script>
111.
<script>
112.
const
choices =
new
Choices(
'[data-trigger]'
,
113.
{
114.
searchEnabled: false,
115.
itemSelectText:
''
,
116.
});
117.
118.
</script>
119.
</body><!-- This templates was made by Colorlib (https:
120.
</html>