02.
<head>
03.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
04.
<title>Online Postgraduate Information System</title>
05.
<meta name=
"keywords"
content=
""
/>
06.
<meta name=
"description"
content=
""
/>
07.
<link href=
"../styles.css"
rel=
"stylesheet"
type=
"text/css"
media=
"screen"
/>
08.
<div id=
"main"
>
09.
<script language=
"JavaScript"
>
10.
function
ClickCheckAll(vol)
11.
{
12.
13.
var
i=1;
14.
for
(i=1;i<=document.frmMain.hdnCount.value;i++)
15.
{
16.
if
(vol.checked == true)
17.
{
18.
eval
(
"document.frmMain.chkDel"
+i+
".checked=true"
);
19.
}
20.
else
21.
{
22.
eval
(
"document.frmMain.chkDel"
+i+
".checked=false"
);
23.
}
24.
}
25.
}
26.
function
onDelete()
27.
{
28.
if
(confirm(
'Do you want to delete ?'
)==true)
29.
{
30.
return
true;
31.
}
32.
else
33.
{
34.
return
false;
35.
}
36.
}
37.
</script>
38.
<form name=
"frmMain"
action=
"drp.php"
method=
"post"
OnSubmit=
"return onDelete();"
>
39.
<?
40.
include
(
'db.php'
);
41.
$sql
=
"SELECT * FROM subject"
;
42.
43.
44.
$res
= mysql_query(
$sql
);
45.
if
(!
$res
)
46.
{
47.
die
(
"You couldn't perform the query"
.mysql_error());
48.
}
49.
?>
50.
<div id=
"right"
>
51.
<h4><strong>การจัดการรายวิชา</strong></h4>
52.
<br><div id=
"maa"
>
53.
<input type=
"image"
name=
"btnDelete"
src=
"../images/del.png"
><a href=
"adm_sub_add.php"
><img src=
"../images/add.png"
/></a></div>
54.
<table width=
"682"
border=
"1"
align=
"left"
>
55.
<tr>
56.
<td width=
"26"
height=
"25"
align=
"center"
><input name=
"CheckAll"
type=
"checkbox"
id=
"CheckAll"
value=
"Y"
onClick=
"ClickCheckAll(this);"
></td>
57.
<td width=
"45"
align=
"center"
><strong><h3>ลำดับ</h3></strong></td>
58.
<td width=
"130"
align=
"center"
><strong><h3>รหัสวิชา</h3></strong></td>
59.
<td width=
"273"
align=
"center"
><strong><h3>วิชา</h3></strong></td>
60.
<td width=
"118"
align=
"center"
><strong><h3>หน่วยกิจ</h3></strong></td>
61.
<td width=
"50"
align=
"center"
><strong><h3>แก้ไข</h3></strong></td>
62.
</tr>
63.
<?
64.
$i
= 0;
65.
$j
= 1;
66.
while
(
$result
= mysql_fetch_row(
$res
)){
67.
$i
++;
68.
?>
69.
<tr>
70.
<td align=
"center"
height=
"25"
><input type=
"checkbox"
name=
"chkDel[]"
id=
"chkDel<?=$i;?>"
value=
"<?=$result[0];?>;?>"
></td>
71.
<td align=
"center"
><?=
$j
?></td>
72.
<td align=
"center"
><?
echo
$result
[0];?></td>
73.
<td> <?
echo
$result
[1];?></td>
74.
<td> <?
echo
$result
[2];?></td>
75.
<td width=
"50"
align=
"center"
><a href =
"adm_sub_update.php?s_id=<? echo $result[0]; ?>"
><img src=
"../images/edit.png"
/></a></td>
76.
</tr>
77.
<?
$j
++;
78.
}
79.
?>
80.
</table>
81.
<?
82.
mysql_close(
$db_connect
);
83.
?>
84.
<input type=
"hidden"
name=
"hdnCount"
value=
"<?=$i;?>"
>
85.
</div></form>
86.
</div></body>
87.
</html>