001.
<?php
require_once
'config.inc.php'
;?>
002.
<?php
if
( ! is_login())
exit
(
'Access denie.'
); ?>
003.
<?php
004.
$student_id
= is_student() ?
$_SESSION
[
'user'
][
'id'
] : (int)
$_GET
[
'student_id'
];
005.
if
(
$_POST
)
006.
{
007.
008.
$json
= json_encode(
$_POST
);
009.
$json2db
= mysql_real_escape_string(
$json
);
010.
011.
$sql
=
"SELECT id FROM stddoc WHERE student_id={$student_id}"
;
012.
$query
= mysql_query(
$sql
)
or
die
(
$sql
);
013.
$sql
= (mysql_num_rows(
$query
))
014.
?
"UPDATE stddoc SET coen05='{$json2db}' WHERE student_id={$student_id}"
015.
:
"INSERT INTO stddoc (id, student_id, coen05) VALUES(NULL, {$student_id}, '{$json2db}')"
;
016.
017.
mysql_query(
$sql
)
or
die
(
$sql
);
018.
$report
=
'<div align="center" style="color:red; font-weight: bold;font-size:1.08em; margin:0; padding: 5px 0;">เอกสารถูกบันทึก <a href="download_doc.php?doc=coen05"><strong>[ดาวน์โหลด]</strong></a></div>'
;
019.
}
020.
?>
023.
<head>
024.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
025.
<title>Cooperative education system.</title>
026.
<link href=
"css/style.css"
rel=
"stylesheet"
type=
"text/css"
>
027.
<script type=
"text/javascript"
src=
"js/jquery-1.7.1_min.js"
></script>
028.
<script type=
"application/javascript"
>
029.
$(document).ready(
function
(){
030.
$(
'#doc-form :text'
).focus(
function
(){
031.
$(this).addClass(
'focus1'
);
032.
}).blur(
function
(){
033.
$(this).removeClass(
'focus1'
);
034.
});
035.
});
036.
</script>
037.
</head>
038.
039.
<body>
040.
<?php show_header();?>
041.
<table width=
"950"
border=
"0"
align=
"center"
cellpadding=
"4"
cellspacing=
"0"
bgcolor=
"#FFFFFF"
class
=
"bodyBorder"
>
042.
<tr>
043.
<td width=
"200"
align=
"left"
valign=
"top"
style=
"background-image:url(image/menu_bg.gif)"
>
044.
<?php show_mgeneral();?>
045.
<?php show_mmember();?>
046.
<?php show_ads();?>
047.
</td>
048.
<td width=
"736"
align=
"left"
valign=
"top"
class
=
"main-body"
>
049.
<div
class
=
"div710"
>
050.
<h3>CO.EN.05</h3>
051.
<?php
echo
$report
?
$report
:
''
;?>
052.
<form id=
"doc-form"
action=
"coen05.php<?php echo $_GET['student_id'] ? '?student_id='.$_GET['student_id'] : '';?>"
method=
"post"
>
053.
<?php
054.
$sql
=
"SELECT coen05 FROM stddoc WHERE student_id={$student_id}"
;
055.
$query
= mysql_query(
$sql
)
or
die
(
$sql
);
056.
$row
= mysql_fetch_assoc(
$query
);
057.
$data
=
$row
? json_decode(
$row
[
'coen05'
], TRUE) :
array
();
058.
059.
?>
060.
<div style=
"background:#FFF"
>
061.
<div align=
"center"
style=
"padding-top:10px"
> <strong>แบบแจ้งรายละเอียดที่พักระหว่างการปฏิบัติงานสหกิจศึกษา</strong><strong> </strong><br />
062.
โครงการสหกิจศึกษาและฝึกงานทางวิศวกรรม </div>
063.
</div>
064.
<table width=
"100%"
border=
"0"
cellspacing=
"0"
bgcolor=
"#FFFFFF"
cellpadding=
"3"
>
065.
<tr>
066.
<td><p>(ผู้ให้ข้อมูล : <u>นักศึกษา</u>)</p></td>
067.
</tr>
068.
<tr>
069.
<td><strong>เรียน</strong> หัวหน้าโครงการสหกิจศึกษา คณะวิศวกรรมศาสตร์ มหาวิทยาลัยเทคโนโลยีราชมงคลศรีวิชัย วิทยาเขตภาคใต้ </td>
070.
</tr>
071.
<tr>
072.
<td>ชื่อ – นามสกุล
073.
<input name=
"name_surname"
type=
"text"
class
=
"w150"
id=
"name_surname"
value=
"<?php echo $data['name_surname'];?>"
maxlength=
"100"
/>
074.
เลขรหัสประจำตัว
075.
<input name=
"std_code"
type=
"text"
class
=
"w150"
id=
"std_code"
value=
"<?php echo $data['std_code'];?>"
maxlength=
"14"
/>
076.
<br /></td>
077.
</tr>
078.
<tr>
079.
<td>สาขาวิชา
080.
<input name=
"major"
type=
"text"
class
=
"w200"
id=
"major"
value=
"<?php echo $data['major'];?>"
maxlength=
"100"
/>
081.
คณะ
082.
<input name=
"school"
type=
"text"
class
=
"w150"
id=
"school"
value=
"<?php echo $data['school'];?>"
maxlength=
"100"
/></td>
083.
</tr>
084.
<tr>
085.
<td>ชื่อสถานประกอบการ (ไทย หรือ อังกฤษ)
086.
<input name=
"orgname"
type=
"text"
class
=
"w220"
id=
"orgname"
value=
"<?php echo $data['orgname'];?>"
maxlength=
"100"
/></td>
087.
</tr>
088.
<tr>
089.
<td> </td>
090.
</tr>
091.
<tr>
092.
<td>ขอแจ้งรายละเอียดเกี่ยวกับที่พักระหว่างปฏิบัติงานสหกิจศึกษาดังนี้ </td>
093.
</tr>
094.
<tr>
095.
<td>เลขที่
096.
<input name=
"addr_number"
type=
"text"
class
=
"w80"
id=
"addr_number"
value=
"<?php echo $data['addr_number'];?>"
maxlength=
"100"
/>
097.
ถนน
098.
<input name=
"addr_road"
type=
"text"
class
=
"w120"
id=
"addr_road"
value=
"<?php echo $data['addr_road'];?>"
maxlength=
"100"
/>
099.
ซอย
100.
101.
<input name=
"addr_lane"
type=
"text"
class
=
"w100"
id=
"addr_lane"
value=
"<?php echo $data['addr_lane'];?>"
maxlength=
"100"
/><label>
102.
<input name=
"addr_tambol_radio"
type=
"radio"
id=
"address_tambol_1"
value=
"ตำบล"
<?php
echo
(
$data
[
'addr_tambol_radio'
] ==
'ตำบล'
) ?
' checked="checked"'
:
''
;?> />
103.
ตำบล</label>
104.
<label>
105.
<input name=
"addr_tambol_radio"
type=
"radio"
id=
"address_tambol_0"
value=
"แขวง"
<?php
echo
(
$data
[
'addr_tambol_radio'
] ==
'แขวง'
) ?
' checked="checked"'
:
''
;?> />
106.
แขวง</label>
107.
<input name=
"addr_tambol"
type=
"text"
class
=
"w120"
id=
"addr_tambol"
value=
"<?php echo $data['addr_tambol'];?>"
maxlength=
"100"
/></td>
108.
</tr>
109.
<tr>
110.
<td><label>
111.
<input name=
"addr_amphur_radio"
type=
"radio"
id=
"addr_amphur_0"
value=
"อำเภอ"
<?php
echo
(
$data
[
'addr_amphur_radio'
] ==
'อำเภอ'
) ?
' checked="checked"'
:
''
;?> />
112.
อำเภอ</label>
113.
<label>
114.
<input name=
"addr_amphur_radio"
type=
"radio"
id=
"addr_amphur_1"
value=
"เขต"
<?php
echo
(
$data
[
'addr_amphur_radio'
] ==
'เขต'
) ?
' checked="checked"'
:
''
;?> />
115.
เขต</label>
116.
<input name=
"addr_amphur"
type=
"text"
class
=
"w120"
id=
"addr_amphur"
value=
"<?php echo $data['addr_amphur'];?>"
maxlength=
"100"
/>
117.
จังหวัด
118.
<input name=
"addr_province"
type=
"text"
class
=
"w120"
id=
"addr_province"
value=
"<?php echo $data['addr_province'];?>"
maxlength=
"50"
/>
119.
รหัสไปรษณีย์
120.
<input name=
"addr_post_code"
type=
"text"
class
=
"w80"
id=
"addr_post_code"
value=
"<?php echo $data['addr_post_code'];?>"
maxlength=
"5"
/></td>
121.
</tr>
122.
<tr>
123.
<td>โทรศัพท์
124.
<input name=
"addr_phone"
type=
"text"
class
=
"w120"
id=
"addr_phone"
value=
"<?php echo $data['addr_phone'];?>"
maxlength=
"20"
/>
125.
โทรสาร
126.
<input name=
"addr_fax"
type=
"text"
class
=
"w150"
id=
"addr_fax"
value=
"<?php echo $data['addr_fax'];?>"
maxlength=
"100"
/></td>
127.
</tr>
128.
<tr>
129.
<td> </td>
130.
</tr>
131.
<tr>
132.
<td>ชื่อที่อยู่ ผู้ที่สามารถติดต่อได้ในกรณีฉุกเฉิน </td>
133.
</tr>
134.
<tr>
135.
<td>เลขที่
136.
<input name=
"addr_number2"
type=
"text"
class
=
"w80"
id=
"addr_number2"
value=
"<?php echo $data['addr_number2'];?>"
maxlength=
"100"
/>
137.
ถนน
138.
<input name=
"addr_road2"
type=
"text"
class
=
"w120"
id=
"addr_road2"
value=
"<?php echo $data['addr_road2'];?>"
maxlength=
"100"
/>
139.
ซอย
140.
141.
<input name=
"addr_lane2"
type=
"text"
class
=
"w100"
id=
"addr_lane2"
value=
"<?php echo $data['addr_lane2'];?>"
maxlength=
"100"
/><label>
142.
<input name=
"addr_tambol_radio2"
type=
"radio"
id=
"address_tambol_2"
value=
"ตำบล"
<?php
echo
(
$data
[
'addr_tambol_radio2'
] ==
'ตำบล'
) ?
' checked="checked"'
:
''
;?> />
143.
ตำบล</label>
144.
<label>
145.
<input name=
"addr_tambol_radio2"
type=
"radio"
id=
"address_tambol_3"
value=
"แขวง"
<?php
echo
(
$data
[
'addr_tambol_radio2'
] ==
'แขวง'
) ?
' checked="checked"'
:
''
;?> />
146.
แขวง</label>
147.
<input name=
"addr_tambol2"
type=
"text"
class
=
"w120"
id=
"addr_tambol2"
value=
"<?php echo $data['addr_tambol2'];?>"
maxlength=
"100"
/></td>
148.
</tr>
149.
<tr>
150.
<td><label>
151.
<input name=
"addr_amphur_radio2"
type=
"radio"
id=
"addr_amphur_2"
value=
"อำเภอ"
<?php
echo
(
$data
[
'addr_amphur_radio2'
] ==
'อำเภอ'
) ?
' checked="checked"'
:
''
;?> />
152.
อำเภอ</label>
153.
<label>
154.
<input name=
"addr_amphur_radio2"
type=
"radio"
id=
"addr_amphur_3"
value=
"เขต"
<?php
echo
(
$data
[
'addr_amphur_radio2'
] ==
'เขต'
) ?
' checked="checked"'
:
''
;?> />
155.
เขต</label>
156.
<input name=
"addr_amphur2"
type=
"text"
class
=
"w120"
id=
"addr_amphur2"
value=
"<?php echo $data['addr_amphur2'];?>"
maxlength=
"100"
/>
157.
จังหวัด
158.
<input name=
"addr_province2"
type=
"text"
class
=
"w120"
id=
"addr_province2"
value=
"<?php echo $data['addr_province2'];?>"
maxlength=
"50"
/>
159.
รหัสไปรษณีย์
160.
<input name=
"addr_post_code2"
type=
"text"
class
=
"w80"
id=
"addr_post_code2"
value=
"<?php echo $data['addr_post_code2'];?>"
maxlength=
"5"
/></td>
161.
</tr>
162.
<tr>
163.
<td>โทรศัพท์
164.
<input name=
"addr_phone2"
type=
"text"
class
=
"w120"
id=
"addr_phone2"
value=
"<?php echo $data['addr_phone2'];?>"
maxlength=
"20"
/>
165.
โทรสาร
166.
<input name=
"addr_fax2"
type=
"text"
class
=
"w150"
id=
"addr_fax2"
value=
"<?php echo $data['addr_fax2'];?>"
maxlength=
"100"
/></td>
167.
</tr>
168.
<tr>
169.
<td> </td>
170.
</tr>
171.
<tr>
172.
<td align=
"center"
><input name=
"button"
type=
"submit"
class
=
"save-button"
id=
"button"
value=
" บันทึกเอกสาร "
/></td>
173.
</tr>
174.
</table>
175.
</form>
176.
</div>
177.
</td>
178.
</tr>
179.
</table>
180.
<?php show_footer();?>
181.
</body>
182.
</html>