001.
<?php session_start();
002.
include
(
'includes/connect_db.php'
);
003.
?>
006.
<head>
007.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
008.
<title>Untitled Document</title>
009.
</head>
010.
011.
012.
<body>
013.
<p>
014.
<?php
015.
$tid
=
$_SESSION
[
'login'
];
016.
017.
$sql
=
"select * from teacher where teacher = '$tid'"
;
018.
$result
= mysql_query(
$sql
)
or
die
(
"<script>alert('Error!');history.back();</script>"
);
019.
$array
= mysql_fetch_array(
$result
);
020.
$teacher
=
$array
[
'Teacher'
];
021.
$tname
=
$array
[
'Tname'
];
022.
$tsname
=
$array
[
'Tsname'
];
023.
$class
=
$array
[
'class'
];
024.
$room
=
$array
[
'room'
]
025.
?>
026.
</p>
027.
<p align=
"center"
class
=
"style7"
> </p>
028.
<form id=
"form2"
name=
"form2"
method=
"post"
action=
"subject/add_hr_check.php"
>
029.
030.
031.
<table width=
"597"
class
=
"outter"
>
032.
<tr>
033.
<td width=
"585"
><table
class
=
"text"
border=
"0"
cellpadding=
"4"
cellspacing=
"3"
width=
"100%"
>
034.
<tr height=
"40px"
>
035.
<td colspan=
"4"
class
=
"formHeading"
>บันทึกการหักคะแนนรายวิชา Home Room</td>
036.
</tr>
037.
<tr>
038.
<td colspan=
"4"
class
=
"note"
bgcolor=
"#E0F0E8"
> ข้อมูลอาจารย์ประจำชั้น <?
echo
(
$class
); ?>/<?
echo
(
$room
); ?></td>
039.
</tr>
040.
<tr height=
"10px"
>
041.
<td colspan=
"4"
></td>
042.
</tr>
043.
044.
<tr>
045.
<td align=
"right"
bgcolor=
"#E0F0E8"
width=
"24%"
>รหัสอาจารย์ประจำชั้น</td>
046.
<td colspan=
"3"
><?
echo
$teacher
;?><input name=
"teacher"
type=
"hidden"
value=
"<? echo $teacher;?>"
/></td>
047.
</tr>
048.
<tr>
049.
<td align=
"right"
bgcolor=
"#E0F0E8"
>ชื่ออาจารย์ประจำชั้น</td>
050.
<td colspan=
"3"
><?
echo
$tname
;?> <?
echo
$tsname
; ?>
051.
<input type=
"hidden"
name=
"gname"
value=
"<? echo $tname;?>"
/></td>
052.
</tr>
053.
<tr>
054.
<td ></td>
055.
<td colspan=
"3"
> </td>
056.
</tr>
057.
<tr>
058.
<td colspan=
"4"
class
=
"note"
bgcolor=
"#E0F0E8"
> ข้อมูลวิชา</td>
059.
</tr>
060.
<tr>
061.
<td align=
"right"
bgcolor=
"#E0F0E8"
>วันที่</td>
062.
<td><input type=
"text"
name=
"date_check"
id=
"date_check"
/></td>
063.
<td bgcolor=
"#E0F0E8"
>คาบที่</td>
064.
<td><input type=
"text"
name=
"hour"
id=
"hour"
/></td>
065.
</tr>
066.
<tr>
067.
<td align=
"right"
bgcolor=
"#E0F0E8"
>ภาคเรียนที่</td>
068.
<td width=
"24%"
><input type=
"text"
name=
"Term"
id=
"Term"
/></td>
069.
<td width=
"15%"
bgcolor=
"#E0F0E8"
>ปีที่</td>
070.
<td width=
"37%"
><input type=
"text"
name=
"Year"
id=
"Year"
/></td>
071.
</tr>
072.
<tr>
073.
<td colspan=
"4"
align=
"right"
bgcolor=
"#E0F0E8"
>
074.
<div align=
"center"
>
075.
<input type=
"hidden"
name=
"Full"
id=
"Full"
value=
"FULL"
/>
076.
<input type=
"checkbox"
name=
"checkfull"
id=
"checkfull "
value=
"OK"
/>
077.
Check Full
078.
</div></td>
079.
</tr>
080.
</table>
081.
<div align=
"center"
></div></td></tr>
082.
083.
</table>
084.
085.
086.
087.
088.
<span id=cust style=
"position:relative;"
></span><br/>
089.
<center>
090.
</center>
091.
092.
<br/>
093.
<p>
094.
095.
096.
097.
<table id=
"myTable"
width=
"597"
class
=
"outter"
>
098.
<tr>
099.
<td width=
"585"
><table width=
"100%"
border=
"0"
cellpadding=
"4"
cellspacing=
"3"
bordercolor=
"#00CC99"
class
=
"text"
>
100.
101.
<tr>
102.
<td
class
=
"note"
bgcolor=
"#E0F0E8"
width=
"10%"
><div align=
"center"
>รหัสนักเรียน</div></td>
103.
<td
class
=
"note"
bgcolor=
"#E0F0E8"
width=
"20%"
><div align=
"center"
>ชื่อสกุลนักเรียน</div></td>
104.
<td
class
=
"note"
bgcolor=
"#E0F0E8"
width=
"10%"
><div align=
"center"
>ห้อง</div></td>
105.
<td
class
=
"note"
bgcolor=
"#E0F0E8"
width=
"10%"
><div align=
"center"
>ขาด</div></td>
106.
<td
class
=
"note"
bgcolor=
"#E0F0E8"
width=
"10%"
><div align=
"center"
>สาย</div></td>
107.
<td
class
=
"note"
bgcolor=
"#E0F0E8"
width=
"10%"
><div align=
"center"
>หนี</div></td>
108.
<td
class
=
"note"
bgcolor=
"#E0F0E8"
width=
"10%"
><div align=
"center"
>แต่งกาย</div></td>
109.
<td
class
=
"note"
bgcolor=
"#E0F0E8"
width=
"10%"
><div align=
"center"
><p>ลบ
110.
<input name=
"CheckAll"
type=
"checkbox"
id=
"CheckAll"
value=
"Y"
onClick=
"checkAllBox(this);"
>
111.
</p></div></td>
112.
</tr>
113.
114.
<?php
115.
$sql1
=
"select * from student where Sgrade = '$class' order by SID"
;
116.
$result1
= mysql_query(
$sql1
)
or
die
(
"<script>alert('error');history.back();</script>"
);
117.
$row
= mysql_num_rows(
$result1
);
118.
$i
=1;
119.
while
(
$array1
=mysql_fetch_array(
$result1
))
120.
{
121.
122.
123.
?>
124.
<tr>
125.
<td align=
"center"
><?php
echo
$array1
[
'SID'
];?> </td>
126.
<td><?php
echo
$array1
[
'Sname'
];?> <?php
echo
$array1
[
'Ssname'
];?> </td>
127.
<td align=
"center"
><?php
echo
$array1
[
'Sgrade'
];?>/<?php
echo
$array1
[
'Room'
];?></td>
128.
<td align=
"center"
><div align=
"center"
><input type=
"checkbox"
name=
"Chk1[]"
id=
"Chk1[]"
value=
"<?php echo $array1['SID'];?>"
/>
129.
</div></td>
130.
<td align=
"center"
><div align=
"center"
><input type=
"checkbox"
name=
"Chk2[]"
id=
"Chk2[]"
value=
"<?php echo $array1['SID'];?>"
/>
131.
</div></td>
132.
<td align=
"center"
><div align=
"center"
><input type=
"checkbox"
name=
"Chk3[]"
id=
"Chk3[]"
value=
"<?php echo $array1['SID'];?>"
/>
133.
</div></td>
134.
<td align=
"center"
><div align=
"center"
><input type=
"checkbox"
name=
"Chk4[]"
id=
"Chk4[]"
value=
"<?php echo $array1['SID'];?>"
/>
135.
</div></td>
136.
<td align=
"center"
><div align=
"center"
><input type=
"checkbox"
name=
"Chk5[]"
id=
"Chk5[]"
value=
"<?php echo $array1['SID'];?>"
/>
137.
</div></td><?
$i
++ ?>
138.
</tr>
139.
<?php
140.
}
141.
?>
142.
<input type=
"hidden"
name=
"gid"
value=
"<?php echo $gid?>"
>
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
<tr height=
"10px"
>
154.
<td colspan=
"6"
></td>
155.
</tr>
156.
157.
158.
</table>
159.
160.
161.
<div align=
"center"
>
162.
<p>
163.
<input type=
"submit"
name=
"Submit"
value=
"บันทึก"
/>
164.
</p>
165.
<p> </p>
166.
</div></td></tr>
167.
168.
</table>
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
<p> </p>
182.
<p>
183.
<center>
184.
</center>
185.
</p>
186.
</form> </p>
187.
</body>
188.
</html>