Viewing file: FrmEdit.php (16.55 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php session_start(); if (session_is_registered("valid_user")) { $Username = $valid_user; include("../include/FunctionDB.php"); include("../include/Function.php"); ConnectDB(); $sql ="SELECT * FROM personal_tb WHERE Teacher_code='$Teacher_code'"; $result = mysql_query($sql) or die("Cannot Select").mysql_error(); $rs = mysql_fetch_array($result); $sql2 = "SELECT * FROM training_tb WHERE Training_code='$Training_code'"; $result2 = mysql_query($sql2) or die("Cannot Select").mysql_error(); $rss = mysql_fetch_array($result2); ?>
<html> <head> <title>Form Edit Research</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> <link href="../css/style1.css" rel="stylesheet" type="text/css"> <script language="JavaScript" type="text/JavaScript"> function MM_reloadPage(init) { //reloads the window if Na v4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //-->
var highlightcolor="lightyellow" var ns6=document.getElementById&&!document.all var previous='' var eventobj //Regular expression to highlight only form elements var intended=/INPUT|TEXTAREA|SELECT|OPTION/
//Function to check whether element clicked is form element function checkel(which){ if (which.style&&intended.test(which.tagName)){ if (ns6&&eventobj.nodeType==3) eventobj=eventobj.parentNode.parentNode return true } else return false }
//Function to highlight form element function highlight(e){ eventobj=ns6? e.target : event.srcElement if (previous!=''){ if (checkel(previous)) previous.style.backgroundColor='' previous=eventobj if (checkel(eventobj)) eventobj.style.backgroundColor=highlightcolor } else{ if (checkel(eventobj)) eventobj.style.backgroundColor=highlightcolor previous=eventobj } } function handleEnter (field, event) { var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode == 13) { var i; for (i = 0; i < field.form.elements.length; i++) if (field == field.form.elements[i]) break; i = (i + 1) % field.form.elements.length; field.form.elements[i].focus(); return false; } else return true; } </script>
</head> <body bgcolor="#F2FCED"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="25%" class="table" background="../Image/bard1.jpg"> <div align="center"><strong><font size="2" face="Tahoma"><a href="Menu_Develop.php" class="g">กลับหน้าหลัก</a></font></strong></div></td> <td width="25%" class="table" background="../Image/bard1.jpg"> <div align="center"><strong><font size="2" face="Tahoma"><a href="AllTrainingList.php?Teacher_code=<? echo $rs[Teacher_code]?>" class="g">แสดง</a></font></strong></div></td> <td width="25%" class="table" background="../Image/bard1.jpg"> <div align="center"><strong><font size="2" face="Tahoma"><a href="EditTrainingList.php?Teacher_code=<? echo $rs[Teacher_code] ?>" class="g">ลบ หรือ แก้ไข</a></font></strong></div></td> <td width="25%" class="table" background="../Image/bard1.jpg"> <div align="center"><strong><font size="2" face="Tahoma"><a href="../logout.php" class="g">Logout</a></font></strong></div></td> </tr> </table></td> </tr> </table> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td> </td> </tr> <tr> <td><div align="center"></div></td> </tr> </table> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" style="border:1px solid gray"> <tr bgcolor="#D2F49F" > <td height="25" colspan="3" background="../Image/bdevel.jpg"> <div align="center"><font color="#000000" size="4" face="Tahoma"><strong><font color="#FF0000">แก้ไข</font> ประวัติการพัฒนาบุคลากร</strong></font></div></td> </tr> <form name="form1" method="POST" action="EditTraining.php"> <tr bgcolor="#EEEEEE"> <td width="20%" height="20" bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma">ชื่อ-นามสกุล</font></div></td> <td width="3%"> </td> <td width="77%"><font color="#006633"><font size="2" face="Tahoma"><strong><? echo $rs[First_name] ;?></strong></font><font size="2" face="Tahoma"><strong> <? echo $rs[Teacher_name] ;?> <? echo $rs[Teacher_lastname] ;?> </strong></font></font></td> </tr> <tr bgcolor="#EEEEEE"> <td height="20" bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma">ระยะเวลา</font></div></td> <td> </td> <td><font size="2" face="Tahoma"> <input type="radio" name="Period_code" <?php if (!(strcmp("$rss[Period_code]","00001"))) {echo "checked";} ?> value="00001" onkeypress="return handleEnter(this, event)"> </font> <font size="2" face="Tahoma"> ระยะสั้น (1-3) ปี <input type="radio" name="Period_code" <?php if (!(strcmp("$rss[Period_code]","00002"))) {echo "checked";} ?> value="00002" onkeypress="return handleEnter(this, event)"> ระยะยาว (3-5) ปี</font></td> </tr> <tr bgcolor="#EEEEEE"> <td height="22" bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma">เรื่อง</font></div></td> <td> </td> <td> <input name="Training_name" type="text" class="input1" id="Training_name" value="<? echo $rss[Training_name]?>" size="80" onkeypress="return handleEnter(this, event)"></td> </tr> <tr bgcolor="#EEEEEE"> <td height="22" bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma">สาขาวิชา</font></div></td> <td> </td> <td><font size="2" face="Tahoma"> <input name="Major" type="text" id="Major" value="<? echo $rss[Major]?>" size="30" class="input1" onkeypress="return handleEnter(this, event)"> </font></td> </tr> <tr bgcolor="#EEEEEE"> <td rowspan="2" bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma">ประเภท</font></div></td> <td height="20"> </td> <td><font size="2" face="Tahoma"> <input type="radio" name="Training_type" <?php if (!(strcmp("$rss[Training_type]","00001"))) {echo "checked";} ?> value="00001" onkeypress="return handleEnter(this, event)"> การอบรม <input type="radio" name="Training_type" <?php if (!(strcmp("$rss[Training_type]","00002"))) {echo "checked";} ?> value="00002" onkeypress="return handleEnter(this, event)"> การศึกษาดูงาน <input type="radio" name="Training_type" <?php if (!(strcmp("$rss[Training_type]","00003"))) {echo "checked";} ?> value="00003" onkeypress="return handleEnter(this, event)"> ประชุม <input type="radio" name="Training_type" <?php if (!(strcmp("$rss[Training_type]","00004"))) {echo "checked";} ?> value="00004" onkeypress="return handleEnter(this, event)"> สัมมนา </font></td> </tr> <tr bgcolor="#EEEEEE"> <td> </td> <td bgcolor="#EEEEEE"><font size="2" face="Tahoma"> <input type="radio" name="Training_type" <?php if (!(strcmp("$rss[Training_type]","00005"))) {echo "checked";} ?> value="00005" onkeypress="return handleEnter(this, event)"> การศึกษาต่อ ระดับ <input name="Level" type="text" id="Level2" value="<? echo $rss[Level]?>" size="60" class="input1" onkeypress="return handleEnter(this, event)"> </font></td> </tr> <tr bgcolor="#EEEEEE"> <td bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma"> ปี พ.ศ </font></div></td> <td> </td> <td bgcolor="#EEEEEE"><font size="2" face="Tahoma"> <input name="Year_std" type="text" id="Year_std2" value="<? echo $rss[Year_std]?>" size="8" class="input1" onkeypress="return handleEnter(this, event)"> </font></td> </tr> <tr bgcolor="#EEEEEE"> <td bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma">สถานที่</font></div></td> <td> </td> <td bgcolor="#EEEEEE"><font size="2" face="Tahoma"> <input type="radio" name="Place" <?php if (!(strcmp("$rss[Place]","ในประเทศ"))) {echo "checked";} ?> value="ในประเทศ" onkeypress="return handleEnter(this, event)"> ในประเทศ <input type="radio" name="Place" <?php if (!(strcmp("$rss[Place]","นอกประเทศ"))) {echo "checked";} ?> value="นอกประเทศ" onkeypress="return handleEnter(this, event)"> นอกประเทศ ระบุ <input name="Place_des" type="text" id="Place_des" value="<? echo $rss[Place_des]?>" size="40" class="input1" onkeypress="return handleEnter(this, event)"> </font> </td> </tr> <tr bgcolor="#EEEEEE"> <td height="22" bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma">วันที่เริ่ม</font></div></td> <td> </td> <td> <font color="#000000" size="2" face="Tahoma">วันที่ <select name="mDate" id="mDate" class="select" > <?php $Date_start = $rss[Date_start]; $yearthai = explode("-",$Date_start); $mDate = intval($yearthai[2]); $mMonth = intval($yearthai[1]); $mYear = intval($yearthai[0]); for($i=0;$i<=31;$i++) { if( $i == 0) echo"\n\t<option value=\"$mDate\" selected>$mDate</option>\n "; else echo"\n\t<option value=\"$i\">$i</option>\n "; } // getDay1to31(); ?> </select> เดือน <select name="mMonth" id="select2" class="select" > <?php $Date_start = $rss[Date_start]; $yearthai = explode("-",$Date_start); $mDate= intval($yearthai[2]); $Month = intval($yearthai[1]); $mYear = intval($yearthai[0]); $mMonth = $Month; $CMonth = TxtThaiMonth($Month); for($i=-1;$i<=11;$i++) { $a = $i+1; if( $a == 0) echo"\n\t<option value=\"$mMonth\" selected>$CMonth</option>\n "; else echo"\n\t<option value=\"$a\">$ThaiMonth[$i]</option>\n "; } // getThaiMonth(); ?> </select> พ.ศ. <input name="mYear" type="text" class="input1" id="mYear" value="<? echo $mYear ?>" size="5"> </font><font size="2" face="Tahoma">วันสิ้นสุด </font><font color="#000000" size="2" face="Tahoma"> <select name="mDate2" id="mDate2" class="select" > <?php $Date_finish = $rss[Date_finish]; $yearthai = explode("-",$Date_finish); $mDate = intval($yearthai[2]); $mMonth = intval($yearthai[1]); $mYear = intval($yearthai[0]); for($i=0;$i<=31;$i++) { if( $i == 0) echo"\n\t<option value=\"$mDate\" selected>$mDate</option>\n "; else echo"\n\t<option value=\"$i\">$i</option>\n "; } // getDay1to31(); ?> </select> เดือน <select name="mMonth2" id="select4" class="select" > <?php $Date_finish = $rss[Date_finish]; $yearthai = explode("-",$Date_finish); $mDate= intval($yearthai[2]); $Month = intval($yearthai[1]); $mYear2= intval($yearthai[0]); $mMonth = $Month; $CMonth = TxtThaiMonth($Month); for($i=-1;$i<=11;$i++) { $a = $i+1; if( $a == 0) echo"\n\t<option value=\"$mMonth\" selected>$CMonth</option>\n "; else echo"\n\t<option value=\"$a\">$ThaiMonth[$i]</option>\n "; } // getThaiMonth(); ?> </select> พ.ศ. <input name="mYear2" type="text" class="input1" id="mYear2" value="<? echo $mYear2 ?>" size="5"> </font></td> </tr> <tr bgcolor="#EEEEEE"> <td height="22" bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma">CNEU </font></div></td> <td> </td> <td> <input name="CNEU" type="text" class="input1" id="CNEU" value="<? echo $rss[CNEU]?>" size="20" onkeypress="return handleEnter(this, event)"></td> </tr> <tr bgcolor="#EEEEEE"> <td bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma"> จำนวนชั่วโมง</font></div></td> <td> </td> <td><input name="Total_hour" type="text" class="input1" id="Total_hour" value="<? echo $rss[Total_hour]?>" size="20" onkeypress="return handleEnter(this, event)"></td> </tr> <tr bgcolor="#EEEEEE"> <td bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma">เงินสนับสนุน</font> </div></td> <td> </td> <td> <input name="Fund" type="text" class="input1" id="Fund" value="<? echo $rss[Fund]?>" size="20" onkeypress="return handleEnter(this, event)"> <font size="2" face="Tahoma">แหล่งเงินสนับสนุน</font> <input name="Fund_resource" type="text" class="input1" id="Fund_resource" value="<? echo $rss[Fund_resource]?>" size="30" onkeypress="return handleEnter(this, event)"></td> </tr> <tr bgcolor="#EEEEEE"> <td bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma">หน่วยงานที่จัด</font></div></td> <td> </td> <td> <input name="Organiz" type="text" class="input1" id="Organiz" value="<? echo $rss[Organiz]?>" size="40" onkeypress="return handleEnter(this, event)"></td> </tr> <tr bgcolor="#EEEEEE"> <td bgcolor="#EEEEEE"> <div align="center"><font size="2" face="Tahoma"> วันที่ส่งรายงาน</font></div></td> <td> </td> <td><font color="#000000" size="2" face="Tahoma">วันที่ <select name="mDate3" id="mDate3" class="select" > <?php $Date_send = $rss[Date_send]; $yearthai = explode("-",$Date_send); $mDate = intval($yearthai[2]); $mMonth = intval($yearthai[1]); $mYear = intval($yearthai[0]); for($i=0;$i<=31;$i++) { if( $i == 0) echo"\n\t<option value=\"$mDate\" selected>$mDate</option>\n "; else echo"\n\t<option value=\"$i\">$i</option>\n "; } // getDay1to31(); ?> </select> เดือน <select name="mMonth3" id="mMonth3" class="select" > <?php $Date_send = $rss[Date_send]; $yearthai = explode("-",$Date_send); $mDate= intval($yearthai[2]); $Month = intval($yearthai[1]); $mYear3 = intval($yearthai[0]); $mMonth = $Month; $CMonth = TxtThaiMonth($Month); for($i=-1;$i<=11;$i++) { $a = $i+1; if( $a == 0) echo"\n\t<option value=\"$mMonth\" selected>$CMonth</option>\n "; else echo"\n\t<option value=\"$a\">$ThaiMonth[$i]</option>\n "; } // getThaiMonth(); ?> </select> ปี พ.ศ. <input name="mYear3" type="text" class="input1" id="mYear3" value="<? echo $mYear3 ?>" size="10"> </font></td> </tr> <tr bgcolor="#EEEEEE"> <td bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma">เวลาที่เผยแพร่</font></div></td> <td> </td> <td><font size="2" face="Tahoma"> <input type="radio" name="Period_prop" <?php if (!(strcmp("$rss[Period_prop]","1"))) {echo "checked";} ?> value="1"> น้อยกว่า 2 สัปดาห์ <input type="radio" name="Period_prop" <?php if (!(strcmp("$rss[Period_prop]","2"))) {echo "checked";} ?> value="2"> 2 สัปดาห์ <input type="radio" name="Period_prop" <?php if (!(strcmp("$rss[Period_prop]","3"))) {echo "checked";} ?> value="3"> มากกว่า 4 สัปดาห์</font></td> </tr> <tr bgcolor="#EEEEEE"> <td bgcolor="#EEEEEE"><div align="center"><font size="2" face="Tahoma">การประยุกต์นำไปใช้งาน</font></div></td> <td> </td> <td><textarea name="Apply" cols="60" rows="5" id="Apply" class="input1"><? echo $rss[Apply]?></textarea></td> </tr> <tr bgcolor="#D2F49F" > <td height="25" colspan="3" background="../Image/bdevel.jpg"> <div align="center"> <input type="hidden" name="Teacher_code" value="<? echo $rs[Teacher_code]?>"> <input type="hidden" name="Training_code" value="<? echo $rss[Training_code]?>"> <input type="submit" name="Submit" value=" บันทึก " class="button"> </div></td> </tr> </form> </table> </body> </html> <?php } else { echo"<meta http-equiv=\"refresh\" content=\"3;URL=../../Login.php\">\n"; echo"Please Login "; } ?>
|