01.
<?php
02.
require_once
(
'../Connections/MyConnec.php'
); ?>
03.
<?php
04.
if
(!isset(
$_SESSION
)) {
05.
session_start();
06.
}
07.
?>
08.
<?php
09.
mysql_select_db(
$database_MyConnec
,
$MyConnec
);
10.
$query
=
"select * from teacher"
;
11.
$data
= mysql_query(
$query
,
$MyConnec
)
or
die
(mysql_error());
12.
$row
= mysql_fetch_assoc(
$data
);
13.
$totalRows
= mysql_num_rows(
$data
);
14.
?>
15.
<!DOCTYPE html>
16.
<html lang=
"en"
>
17.
<head>
18.
<title>อาจารย์</title>
19.
<meta charset=
"utf-8"
>
20.
<meta name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
24.
</head>
25.
<body>
26.
27.
<nav
class
=
"navbar navbar-inverse"
>
28.
<div
class
=
"container-fluid"
>
29.
<div
class
=
"navbar-header"
>
30.
<a
class
=
"navbar-brand"
href=
"System_users.php"
>ข้อมูลผู้ใช้งาน</a>
31.
</div>
32.
<ul
class
=
"nav navbar-nav"
>
33.
<li
class
=
"active"
><a href=
"for_admin.php"
>Home</a></li>
34.
<li><a href=
"System_users.php"
>ผู้ใช้งาน</a></li>
35.
<li><a href=
"subject.php"
>รายวิชา</a></li>
36.
<li><a href=
"report.php"
>ออกรายงาน</a></li>
37.
<li><a href=
"index.php"
>LOGOUT</a></li>
38.
</ul>
39.
<form
class
=
"navbar-form navbar-left"
>
40.
<div
class
=
"input-group"
>
41.
<input type=
"text"
class
=
"form-control"
placeholder=
"Search"
>
42.
<div
class
=
"input-group-btn"
>
43.
<button
class
=
"btn btn-default"
type=
"submit"
>
44.
<i
class
=
"glyphicon glyphicon-search"
></i>
45.
</button>
46.
</div>
47.
</div>
48.
</form>
49.
</div>
50.
</nav>
51.
<div
class
=
"container"
>
52.
53.
<h3>รายชื่ออาจารย์</h3>
54.
<table
class
=
"table table-condensed"
>
55.
<thead>
56.
<tr>
57.
<th>ลำดับ</th>
58.
<th>ชื่อ</th>
59.
<th>นามสกุล</th>
60.
<th>คณะ</th>
61.
<th>สาขา</th>
62.
<th>ประจำวิชา</th>
63.
</tr>
64.
</thead>
65.
<tbody>
66.
<?php
67.
while
(
$row
= mysql_fetch_assoc(
$data
)){
68.
?>
69.
<tr>
70.
<td><?php
echo
$row
[
'Tc_id'
]?></td><!--ดึงมาจากฐานข้อมูลจากบรรทัดที่ 9-13 -->
71.
<td><?php
echo
$row
[
'Tc_name'
]?></td><!--ดึงมาจากฐานข้อมูลจากบรรทัดที่ 9-13 -->
72.
<td><?php
echo
$row
[
'Tc_surname'
]?></td><!--ดึงมาจากฐานข้อมูลจากบรรทัดที่ 9-13 -->
73.
<td><?php
echo
$row
[
'Fac_id'
]?></td><!--ดึงมาจากฐานข้อมูลจากบรรทัดที่ 9-13 -->
74.
<td><?php
echo
$row
[
'Bra_id'
]?></td><!--ดึงมาจากฐานข้อมูลจากบรรทัดที่ 9-13 -->
75.
<td><?php
echo
$row
[
'Sub_id'
]?></td><!--ดึงมาจากฐานข้อมูลจากบรรทัดที่ 9-13 -->
76.
</tr>
77.
<?php } ?>
78.
</tbody>
79.
</table>
80.
</div>
81.
82.
</body>
83.
</html>