01.
<?php
02.
session_start();
03.
include
(
"../config.php"
);
04.
05.
$pre_id
= null;
06.
if
(isset(
$_GET
[
"pre_id"
]))
07.
{
08.
$pre_id
=
$_GET
[
"pre_id"
];
09.
}
10.
?>
11.
<html>
12.
<head>
13.
<meta charset=
"UTF-8"
>
14.
<title>Local History Southern Thailand </title>
15.
<link rel=
"stylesheet"
href=
"css/s-index.css"
>
16.
</head>
17.
<body>
18.
<div>
19.
<h1>แก้ไขแบบทดสอบก่อนเรียน</h1>
20.
21.
<?php
22.
$sqli
=
"SELECT * FROM tb_pretest WHERE pre_id = '"
.
$pre_id
.
"' "
;
23.
$result
= mysqli_query(
$con
,
$sqli
);
24.
$row
= mysqli_fetch_array(
$result
);
25.
?>
26.
27.
<form action=
"save_pretest.php"
method=
"post"
name=
"edit_pre"
>
28.
<table>
29.
30.
<tr>
31.
<td width=
"100"
>ระดับ</td>
32.
<td width=
"500"
>
33.
<input type=
"text"
name=
"txtlevel"
value=
"<?php echo $row["
pre_levels
"] ?>"
readonly>
34.
<a href=
"edit_level.php?pre_id=<?php echo $row["
pre_id
"]?>"
><input type=
"button"
name=
"but_lev"
value=
"CHANGE LEVELS"
></a>
35.
</td>
36.
</tr>
37.
38.
<tr>
39.
<td width=
"100"
>บทเรียน</td>
40.
<td width=
"500"
>
41.
<input type=
"text"
name=
"txtlosson"
value=
"<?php echo $row["
pre_lesson
"] ?>"
readonly>
42.
<a href=
"edit_lesson.php?pre_id=<?php echo $row["
pre_id
"]?>"
><input type=
"button"
name=
"but_lev"
value=
"CHANGE LESSON"
></a>
43.
</td>
44.
</tr>
45.
<tr>
46.
<td width=
"300"
>รหัสแบบฝึกหัดก่อนเรียน</td>
47.
<td width=
"300"
><input type=text name=idpre value=
"<?php echo $row["
pre_id
"];?>"
readonly></td>
48.
</tr>
49.
<tr>
50.
<td width=
"100"
>โจทย์</td>
51.
<td width=
"300"
><input type=text name=subject value=
"<?php echo $row["
pre_subject
"];?>"
></td>
52.
</tr>
53.
<tr>
54.
<td width=
"100"
>ตัวเลือกที่ 1</td>
55.
<td width=
"300"
><input type=text name=choice1 value=
"<?php echo $row["
pre_choice1
"];?>"
></td>
56.
</tr>
57.
<tr>
58.
<td width=
"100"
>ตัวเลือกที่ 2</td>
59.
<td width=
"300"
><input type=text name=choice2 value=
"<?php echo $row["
pre_choice2
"];?>"
></td>
60.
</tr>
61.
<tr>
62.
<td width=
"100"
>ตัวเลือกที่ 3</td>
63.
<td width=
"300"
><input type=text name=choice3 value=
"<?php echo $row["
pre_choice3
"];?>"
></td>
64.
</tr>
65.
<tr>
66.
<td width=
"100"
>ตัวเลือกที่ 4</td>
67.
<td width=
"300"
><input type=text name=choice4 value=
"<?php echo $row["
pre_choice4
"];?>"
></td>
68.
</tr>
69.
</table><br>
70.
<a href=
"../teacher/index_teacher.php"
><input type=
"button"
value=
"BACK"
></a>
71.
<input type=
"submit"
name=
"submit"
value=
"UPDATE"
>
72.
</form>
73.
</div>
74.
75.
<br>
76.
77.
</body>
78.
</html>