Viewing file: FrmEditProductMe.php (23.56 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
/** Define Validate Access */
define( '_VALID_ACCESS', 1 );
/** Check Session User Login */
if( !session_is_registered("valid_user") && !session_is_registered("Priority") ) {
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-874\" />";
echo "<p style=padding-top:115px><p align=center><br /><font color=red><strong>กรุณาทำการ Login ก่อน</strong></font></p></p>";
echo "<meta http-equiv=\"refresh\" content=\"1; URL=../login.php\" />";
exit();
}
else {
/** Configuration */
require_once( "../configuration.php" );
require_once( $_Config_absolute_path . "/includes/framework.php" );
require_once( "../include/Function.php" );
require_once( "../include/FunctionDB.php" );
/** Create Database Object */
$dbObj = new DBConn;
//=== SESSION
$Username = $valid_user;
/** Config Table for This Page */
$myTable1 = "personal_tb";
$myTable2 = "edu_product_tb";
$myTable2PK = "Prod_code";
/** Table --> personal_tb */
$query0 = " SELECT *, prefixName as First_name FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId WHERE Username='$Username' ";
$result0 = $dbObj->execQuery($query0);
$rs = $dbObj->fetchArray($result0);
$query ="SELECT * FROM $myTable2 WHERE Prod_code='$Prod_code' and Teacher_code='$Teacher_code' ";
$result3 = $dbObj->execQuery($query);
$rss = $dbObj->fetchArray($result3);
} # else
?>
<!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=windows-874" />
<title>ข้อมูลทั่วไปบุคลากร - ข้อมูลงานวิจัย - ผลงานการวิจัย</title></head>
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/utilities.js"></script>
<script language="JavaScript" type="text/JavaScript">
function browse()
{
myForm.Filetex.src = myForm.Filetex.value;
}
</script>
<script type="text/javascript" src="../js/nicEdit/nicEdit.js"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
</script>
<script language="javascript">
function checkData() {
var formObj = document.myForm;
if( (formObj.Product_name.value == "" ) && (formObj.Term.value == "" ) ) { alert("กรุณากรอกข้อมูลให้ครบด้วยค่ะ" ); formObj.Product_name.style.backgroundColor='#F1F9FC'; formObj.Product_name.focus(); return false; }
else if(formObj.Product_name.value == "" ) { alert("กรุณากรอก ชื่อผลงาน"); formObj.Product_name.style.backgroundColor='#F1F9FC'; formObj.Product_name.focus(); return false;}
else if(formObj.Term.value == "" ) { alert("กรุณากรอก ปีที่เผยแพร่"); formObj.Term.style.backgroundColor='#F1F9FC'; formObj.Term.focus(); return false;}
else return true ;
}
</script>
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0">
<?php
include("../templates/incHeader.php");
?>
<table width="1003" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="203" align="left" valign="top" style="padding:10px 0px 0px 5px"><?php include("./_incMainMenu.php");?></td>
<td width="800" height="440" align="center" valign="top" style="padding:10px 0px 5px 10px"><fieldset>
<table width="780" border="0" cellspacing="0" cellpadding="0">
<form id="myForm" name="myForm" method="post" enctype="multipart/form-data" action="EditProduct.php?Teacher_code=<?=$Teacher_code;?>" onsubmit="return checkData();">
<tr>
<td height="5" colspan="2"></td>
</tr>
<tr>
<td width="570" height="30" background="../images/background/bg-head-topic.gif" class="PADDING-LEFT-10"><strong><a href="index.php">หน้าหลัก</a></strong> <strong>» <a href="Menu_Teach.php?Teacher_code=<?=$Teacher_code;?>">ข้อมูลทั่วไปบุคลากร</a> » <a href="Edu_ProductMe.php?Teacher_code=<?=$Teacher_code;?>">ผลงานวิชาการ</a> » <span class="NOTE">แก้ไขข้อมูลผลงานวิชาการ</span></strong></td>
<td width="210"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="center"><table width="760" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#E5E5E5" class="BORDER-GREY">
<tr bgcolor="#FFCC99">
<td height="25" colspan="3" align="center" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td width="25%" height="26" align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">ชื่อ-นามสกุล</td>
<td width="1%" bgcolor="#FFFFFF"> </td>
<td width="74%" bgcolor="#FFFFFF" class="TEXT-HEADER11-BLUE"><? echo $rs['First_name'] . $rs['Teacher_name'] ." ". $rs['Teacher_lastname'];?></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10"><span class="TEXT-RED10">*</span> ชื่อผลงาน</td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><font color="#0000FF" size="2" face="Tahoma">
<input name="Product_name" type="text" id="Product_name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? echo $rss['Product_name'];?>" size="80" />
</font></td>
</tr>
<tr>
<td align="right" valign="top" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10 PADDING-TOP-5">ประเภทผลงาน</td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td width="45%"><input type="radio" name="Product_type" <?php if (!(strcmp("$rss[Product_type]","เอกสารประกอบการสอน"))) {echo "checked";} ?> value="เอกสารประกอบการสอน" />เอกสารประกอบการสอน</td>
<td width="55%"><input type="radio" name="Product_type" <?php if (!(strcmp("$rss[Product_type]","เอกสารประกอบคำบรรยาย"))) {echo "checked";} ?> value="เอกสารประกอบคำบรรยาย" />
เอกสารประกอบคำบรรยาย</td>
</tr>
<tr>
<td><input type="radio" name="Product_type" <?php if (!(strcmp("$rss[Product_type]","สื่อการเรียนการสอน"))) {echo "checked";} ?> value="สื่อการเรียนการสอน" />สื่อการเรียนการสอน</td>
<td><input type="radio" name="Product_type" <?php if (!(strcmp("$rss[Product_type]","การผลิตตำรา"))) {echo "checked";} ?> value="การผลิตตำรา" />การผลิตตำรา</td>
</tr>
<tr>
<td><input type="radio" name="Product_type" <?php if (!(strcmp("$rss[Product_type]","สิ่งประดิษฐ์"))) {echo "checked";} ?> value="สิ่งประดิษฐ์" />สิ่งประดิษฐ์</td>
<td><input type="radio" name="Product_type" <?php if (!(strcmp("$rss[Product_type]","เอกสารวิชาการ"))) {echo "checked";} ?> value="เอกสารวิชาการ" />เอกสารวิชาการ</td>
</tr>
<tr>
<td height="5"></td>
<td height="5"></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10"><span><font face="Tahoma">ชื่อผู้ร่วมที่ 1</font></span></td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><select name="name1" id="name1">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb ORDER BY First_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) ) {
?>
<option value="<?=$rs1['Teacher_code'];?>" <?php if( $rs1['Teacher_code']==$rss['name1'] ) echo 'selected';?>>
<?=$rs1['Teacher_name'];?>
<?=$rs1['Teacher_lastname'];?>
</option>
<?php
} # while
mysql_free_result($result1);
?>
</select></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10"><span><font face="Tahoma">ชื่อผู้ร่วมที่ 2</font></span></td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><select name="name2" id="name2">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb ORDER BY First_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) ) {
?>
<option value="<?=$rs1['Teacher_code'];?>" <?php if( $rs1['Teacher_code']==$rss['name2'] ) echo 'selected';?>>
<?=$rs1['Teacher_name'];?>
<?=$rs1['Teacher_lastname'];?>
</option>
<?php
} # while
mysql_free_result($result1);
?>
</select></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10"><span><font face="Tahoma">ชื่อผู้ร่วมที่ 3</font></span></td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><select name="name3" id="name3">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb ORDER BY First_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) ) {
?>
<option value="<?=$rs1['Teacher_code'];?>" <?php if( $rs1['Teacher_code']==$rss['name3'] ) echo 'selected';?>>
<?=$rs1['Teacher_name'];?>
<?=$rs1['Teacher_lastname'];?>
</option>
<?php
} # while
mysql_free_result($result1);
?>
</select></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10"><span><font face="Tahoma">ชื่อผู้ร่วมที่ 4</font></span></td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><select name="name4" id="name4">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb ORDER BY First_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) ) {
?>
<option value="<?=$rs1['Teacher_code'];?>" <?php if( $rs1['Teacher_code']==$rss['name4'] ) echo 'selected';?>>
<?=$rs1['Teacher_name'];?>
<?=$rs1['Teacher_lastname'];?>
</option>
<?php
} # while
mysql_free_result($result1);
?>
</select></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10"><span><font face="Tahoma">ชื่อผู้ร่วมที่ 5</font></span></td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><select name="name5" id="name5">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb ORDER BY First_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) ) {
?>
<option value="<?=$rs1['Teacher_code'];?>" <?php if( $rs1['Teacher_code']==$rss['name5'] ) echo 'selected';?>>
<?=$rs1['Teacher_name'];?>
<?=$rs1['Teacher_lastname'];?>
</option>
<?php
} # while
mysql_free_result($result1);
?>
</select></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10"><span><font face="Tahoma">ชื่อผู้ร่วมที่ 6</font></span></td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><select name="name6" id="name6">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb ORDER BY First_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) ) {
?>
<option value="<?=$rs1['Teacher_code'];?>" <?php if( $rs1['Teacher_code']==$rss['name6'] ) echo 'selected';?>>
<?=$rs1['Teacher_name'];?>
<?=$rs1['Teacher_lastname'];?>
</option>
<?php
} # while
mysql_free_result($result1);
?>
</select></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10"><span><font face="Tahoma">ชื่อผู้ร่วมที่ 7</font></span></td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><select name="name7" id="name7">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb ORDER BY First_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) ) {
?>
<option value="<?=$rs1['Teacher_code'];?>" <?php if( $rs1['Teacher_code']==$rss['name7'] ) echo 'selected';?>>
<?=$rs1['Teacher_name'];?>
<?=$rs1['Teacher_lastname'];?>
</option>
<?php
} # while
mysql_free_result($result1);
?>
</select></td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">วันที่เริ่ม</td>
<td bgcolor="#FFFFFF"> </td>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF">
<select name="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 ";
}
?>
</select>
เดือน
<select name="mMonth" 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 ";
}
?>
</select>
พ.ศ.
<input name="mYear" type="text" class="input1" id="mYear" value="<? echo $mYear; ?>" size="4" maxlength="4" style="text-align:center" /></td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">วันที่แล้วเสร็จ</td>
<td bgcolor="#FFFFFF"> </td>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF">
<select name="mDate2" class="select" id="mDate2" >
<?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 ";
}
?>
</select>
เดือน
<select name="mMonth2" class="select" id="mMonth2" >
<?php
$Date_finish = $rss['Date_finish'];
$yearthai = explode("-",$Date_finish);
$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 ";
}
?>
</select>
พ.ศ.
<input name="mYear2" type="text" class="input1" id="mYear2" value="<? echo $mYear; ?>" size="4" maxlength="4" style="text-align:center" /></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10"><span class="TEXT-RED10">*</span> ปีการศึกษา</td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><input name="Term" type="text" id="Term" style="text-align:center" value="<? echo $rss[Term]?>" size="4" maxlength="4" /></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">ปีงบประมาณ</td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><input name="Year_prop" type="text" id="Year_prop" style="text-align:center" value="<? echo $rss[Year_prop]?>" size="4" maxlength="4" /></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">การเผยแพร่</td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><font color="#0000FF" size="2" face="Tahoma">
<strong>
<input name="Propagate" type="text" id="Propagate" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? echo $rss[Propagate]?>" size="60"/>
</strong> </font></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10"><span class="TEXT-RED10">*</span> งบประมาณ</td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><font color="#0000FF" size="2" face="Tahoma">
<input name="Fund" type="text" id="Fund" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? echo $rss[Fund]?>" size="5"/>
</font>บาท <span class="TEXT-DARK-BLUE10">แหล่งงบประมาณ</span><font color="#0000FF" size="2" face="Tahoma">
<input name="Fund_resource" type="text" id="Fund_resource" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? echo $rss[Fund_resource]?>" size="40"/>
</font></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">จำนวนที่ใช้จริง</td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><font color="#0000FF" size="2" face="Tahoma">
<input name="Benefit" type="text" id="Benefit" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? echo $rss[Benefit]?>" size="5"/>
</font>
บาท</td>
</tr>
<tr >
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">การนำไปใช้อ้างอิง</td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><textarea name="Use_ref" cols="80" rows="4" id="Use_ref"><? echo $rss[Use_ref]?></textarea>
</td>
</tr>
<tr bordercolor="#CCCCCC">
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10"> </td>
<td bgcolor="#FFFFFF"> </td>
<td align="left" bgcolor="#FFFFFF"> </td>
</tr>
<tr bordercolor="#CCCCCC">
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">อัพโหลดไฟล์เอกสาร</td>
<td bgcolor="#FFFFFF"> </td>
<td align="left" bgcolor="#FFFFFF"><input name="Filetex" type="file" id="Filetex" size="30" /></td>
</tr>
<tr >
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
</tr>
<tr >
<td height="25" bgcolor="#FFFFFF"> </td>
<td height="25" bgcolor="#FFFFFF"> </td>
<td height="25" bgcolor="#FFFFFF"><input name="Prod_code" type="hidden" id="Prod_code" value="<? echo $Prod_code; ?>" />
<input type="submit" name="Submit" value="บันทึกข้อมูล" />
<input name="Reset" type="reset" class="button" id="Reset" value="เริ่มใหม่" /></td>
</tr>
<tr >
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr></form>
</table>
</fieldset></td>
</tr>
</table>
<?php include("../templates/incFooter.php"); ?>
</body>
</html>
<?php
/** Free Resource */
$dbObj->freeresult($result0);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?>
|