<?php require_once 'config.inc.php';?> <?php if ( ! is_login()) exit('Access denie.'); ?> <?php $student_id = is_student() ? $_SESSION['user']['id'] : (int) $_GET['student_id']; if ($_POST) { // echo '<pre>'; print_r($_POST); exit('</pre>'); $json = json_encode($_POST); $json2db = mysql_real_escape_string($json); $sql = "SELECT id FROM stddoc WHERE student_id={$student_id}"; $query = mysql_query($sql) or die($sql); $sql = (mysql_num_rows($query)) ? "UPDATE stddoc SET coen05='{$json2db}' WHERE student_id={$student_id}" : "INSERT INTO stddoc (id, student_id, coen05) VALUES(NULL, {$student_id}, '{$json2db}')"; mysql_query($sql) or die($sql); $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>'; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Cooperative education system.</title> <link href="css/style.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="js/jquery-1.7.1_min.js"></script> <script type="application/javascript"> $(document).ready(function(){ $('#doc-form :text').focus(function(){ $(this).addClass('focus1'); }).blur(function(){ $(this).removeClass('focus1'); }); }); </script> </head> <body> <?php show_header();?> <table width="950" border="0" align="center" cellpadding="4" cellspacing="0" bgcolor="#FFFFFF" class="bodyBorder"> <tr> <td width="200" align="left" valign="top" style="background-image:url(image/menu_bg.gif)"> <?php show_mgeneral();?> <?php show_mmember();?> <?php show_ads();?> </td> <td width="736" align="left" valign="top" class="main-body"> <div class="div710"> <h3>CO.EN.05</h3> <?php echo $report ? $report : '';?> <form id="doc-form" action="coen05.php<?php echo $_GET['student_id'] ? '?student_id='.$_GET['student_id'] : '';?>" method="post"> <?php $sql = "SELECT coen05 FROM stddoc WHERE student_id={$student_id}"; $query = mysql_query($sql) or die($sql); $row = mysql_fetch_assoc($query); $data = $row ? json_decode($row['coen05'], TRUE) : array(); // echo '<pre>';print_r($data); echo '</pre>'; ?> <div style="background:#FFF"> <div align="center" style="padding-top:10px"> <strong>แบบแจ้งรายละเอียดที่พักระหว่างการปฏิบัติงานสหกิจศึกษา</strong><strong> </strong><br /> โครงการสหกิจศึกษาและฝึกงานทางวิศวกรรม </div> </div> <table width="100%" border="0" cellspacing="0" bgcolor="#FFFFFF" cellpadding="3"> <tr> <td><p>(ผู้ให้ข้อมูล : <u>นักศึกษา</u>)</p></td> </tr> <tr> <td><strong>เรียน</strong> หัวหน้าโครงการสหกิจศึกษา คณะวิศวกรรมศาสตร์ มหาวิทยาลัยเทคโนโลยีราชมงคลศรีวิชัย วิทยาเขตภาคใต้ </td> </tr> <tr> <td>ชื่อ – นามสกุล <input name="name_surname" type="text" class="w150" id="name_surname" value="<?php echo $data['name_surname'];?>" maxlength="100" /> เลขรหัสประจำตัว <input name="std_code" type="text" class="w150" id="std_code" value="<?php echo $data['std_code'];?>" maxlength="14" /> <br /></td> </tr> <tr> <td>สาขาวิชา <input name="major" type="text" class="w200" id="major" value="<?php echo $data['major'];?>" maxlength="100" /> คณะ <input name="school" type="text" class="w150" id="school" value="<?php echo $data['school'];?>" maxlength="100" /></td> </tr> <tr> <td>ชื่อสถานประกอบการ (ไทย หรือ อังกฤษ) <input name="orgname" type="text" class="w220" id="orgname" value="<?php echo $data['orgname'];?>" maxlength="100" /></td> </tr> <tr> <td> </td> </tr> <tr> <td>ขอแจ้งรายละเอียดเกี่ยวกับที่พักระหว่างปฏิบัติงานสหกิจศึกษาดังนี้ </td> </tr> <tr> <td>เลขที่ <input name="addr_number" type="text" class="w80" id="addr_number" value="<?php echo $data['addr_number'];?>" maxlength="100" /> ถนน <input name="addr_road" type="text" class="w120" id="addr_road" value="<?php echo $data['addr_road'];?>" maxlength="100" /> ซอย <input name="addr_lane" type="text" class="w100" id="addr_lane" value="<?php echo $data['addr_lane'];?>" maxlength="100" /><label> <input name="addr_tambol_radio" type="radio" id="address_tambol_1" value="ตำบล"<?php echo ($data['addr_tambol_radio'] =='ตำบล') ? ' checked="checked"' : '';?> /> ตำบล</label> <label> <input name="addr_tambol_radio" type="radio" id="address_tambol_0" value="แขวง"<?php echo ($data['addr_tambol_radio'] == 'แขวง') ? ' checked="checked"' : '';?> /> แขวง</label> <input name="addr_tambol" type="text" class="w120" id="addr_tambol" value="<?php echo $data['addr_tambol'];?>" maxlength="100" /></td> </tr> <tr> <td><label> <input name="addr_amphur_radio" type="radio" id="addr_amphur_0" value="อำเภอ"<?php echo ($data['addr_amphur_radio'] =='อำเภอ') ? ' checked="checked"' : '';?> /> อำเภอ</label> <label> <input name="addr_amphur_radio" type="radio" id="addr_amphur_1" value="เขต"<?php echo ($data['addr_amphur_radio'] == 'เขต') ? ' checked="checked"' : '';?> /> เขต</label> <input name="addr_amphur" type="text" class="w120" id="addr_amphur" value="<?php echo $data['addr_amphur'];?>" maxlength="100" /> จังหวัด <input name="addr_province" type="text" class="w120" id="addr_province" value="<?php echo $data['addr_province'];?>" maxlength="50" /> รหัสไปรษณีย์ <input name="addr_post_code" type="text" class="w80" id="addr_post_code" value="<?php echo $data['addr_post_code'];?>" maxlength="5" /></td> </tr> <tr> <td>โทรศัพท์ <input name="addr_phone" type="text" class="w120" id="addr_phone" value="<?php echo $data['addr_phone'];?>" maxlength="20" /> โทรสาร <input name="addr_fax" type="text" class="w150" id="addr_fax" value="<?php echo $data['addr_fax'];?>" maxlength="100" /></td> </tr> <tr> <td> </td> </tr> <tr> <td>ชื่อที่อยู่ ผู้ที่สามารถติดต่อได้ในกรณีฉุกเฉิน </td> </tr> <tr> <td>เลขที่ <input name="addr_number2" type="text" class="w80" id="addr_number2" value="<?php echo $data['addr_number2'];?>" maxlength="100" /> ถนน <input name="addr_road2" type="text" class="w120" id="addr_road2" value="<?php echo $data['addr_road2'];?>" maxlength="100" /> ซอย <input name="addr_lane2" type="text" class="w100" id="addr_lane2" value="<?php echo $data['addr_lane2'];?>" maxlength="100" /><label> <input name="addr_tambol_radio2" type="radio" id="address_tambol_2" value="ตำบล"<?php echo ($data['addr_tambol_radio2'] =='ตำบล') ? ' checked="checked"' : '';?> /> ตำบล</label> <label> <input name="addr_tambol_radio2" type="radio" id="address_tambol_3" value="แขวง"<?php echo ($data['addr_tambol_radio2'] == 'แขวง') ? ' checked="checked"' : '';?> /> แขวง</label> <input name="addr_tambol2" type="text" class="w120" id="addr_tambol2" value="<?php echo $data['addr_tambol2'];?>" maxlength="100" /></td> </tr> <tr> <td><label> <input name="addr_amphur_radio2" type="radio" id="addr_amphur_2" value="อำเภอ"<?php echo ($data['addr_amphur_radio2'] =='อำเภอ') ? ' checked="checked"' : '';?> /> อำเภอ</label> <label> <input name="addr_amphur_radio2" type="radio" id="addr_amphur_3" value="เขต"<?php echo ($data['addr_amphur_radio2'] == 'เขต') ? ' checked="checked"' : '';?> /> เขต</label> <input name="addr_amphur2" type="text" class="w120" id="addr_amphur2" value="<?php echo $data['addr_amphur2'];?>" maxlength="100" /> จังหวัด <input name="addr_province2" type="text" class="w120" id="addr_province2" value="<?php echo $data['addr_province2'];?>" maxlength="50" /> รหัสไปรษณีย์ <input name="addr_post_code2" type="text" class="w80" id="addr_post_code2" value="<?php echo $data['addr_post_code2'];?>" maxlength="5" /></td> </tr> <tr> <td>โทรศัพท์ <input name="addr_phone2" type="text" class="w120" id="addr_phone2" value="<?php echo $data['addr_phone2'];?>" maxlength="20" /> โทรสาร <input name="addr_fax2" type="text" class="w150" id="addr_fax2" value="<?php echo $data['addr_fax2'];?>" maxlength="100" /></td> </tr> <tr> <td> </td> </tr> <tr> <td align="center"><input name="button" type="submit" class="save-button" id="button" value=" บันทึกเอกสาร " /></td> </tr> </table> </form> </div> </td> </tr> </table> <?php show_footer();?> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง