Viewing file: FrmEditProduct_bk.php (23.74 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
if (session_is_registered("valid_user")&&session_is_registered("Priority")&&session_is_registered("password") )
{
$Username = $valid_user;
$Password = $password;
include("../include/FunctionDB.php");
include("../include/Function.php");
include("admin_menu.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 edu_product_tb WHERE Prod_code='$Prod_code'";
$res = mysql_query($sql2) or die("Cannot Select").mysql_error();
$row = mysql_fetch_array($res);
?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">
<style type="text/css">
<!--
.style14 {color: #000000}
.style15 {font-size: 14px}
-->
</style>
<table width="802" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="802"><br>
<fieldset>
<legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="menu_teacher.php " >หน้าหลัก</a> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle"><a href="Edu_ProductMe.php?Teacher_code=<? echo $rs[Teacher_code] ?>">ข้อมูลผลงานวิชาการ</a></font><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" /><a href="FrmProductList.php?Teacher_code=<? echo $rs[Teacher_code] ?>">แก้ไขข้อมูลผลงานวิชาการ</a><img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" />เพิ่มข้อมูลผลงานวิชาการ</font></legend>
<label><div align="center">
<form id="form1" name="form1" method="post" action="EditProduct.php">
<table width="85%" border="0" align="center" cellpadding="0" cellspacing="0" style=" border:1px solid gray"size="12">
<tr>
<td height="29" background="../Image/barIns2.jpg" bgcolor="#D1E1F0"><div align="center"><font size="2" face="Tahoma">ขณะนี้ อ.<font color="#993333"><strong><? echo $rs['Teacher_name'] ?> </strong></font><font size="2" face="Tahoma"><font color="#993333"><strong><? echo $rs['Teacher_lastname'] ?></strong></font></font><font color="#993333"><strong> </strong></font><span class="style14">รหัสประจำตัว</span> <font color="#993333"><strong><? echo $rs['Teacher_id'] ?></strong></font> กำลังใช้งานระบบ</font></div></td>
</tr>
<tr>
<td height="43" ><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E4E4E4">
<tr bgcolor="#D5F0F9">
<td colspan="3"><div align="center"><font color="#003366" size="4" face="Tahoma"><strong><font color="#FF0000">แก้ไข</font> - ผลงานการผลิต และ เผยแพร่ </strong></font></div></td>
</tr>
<tr bgcolor="#EEEEEE">
<td><div align="center"><font size="2" face="Tahoma">ชื่อ - นามสกุล</font></div></td>
<td bordercolor="#FEEDF9"> </td>
<td bordercolor="#F2DEFE"><font color="#003366" size="2" face="Tahoma"><strong> <? echo $rs[First_name] ;?> <? echo $rs[Teacher_name] ;?> <? echo $rs[Teacher_lastname] ;?> </strong></font></td>
</tr>
<tr bgcolor="#EEEEEE">
<td width="27%"><div align="center"><font size="2" face="Tahoma">ชื่อผลงาน</font></div></td>
<td width="2%" bordercolor="#FEEDF9"> </td>
<td width="71%" bordercolor="#F2DEFE"><input name="Product_name" type="text" class="input1" id="Product_name" value="<? echo $row[Product_name]?>" size="50"></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="52"><div align="center"><font size="2" face="Tahoma">ประเภทผลงาน</font></div></td>
<td bordercolor="#FEEDF9"> </td>
<td bordercolor="#F2DEFE"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td width="50%"><font size="2" face="Tahoma">
<input type="radio" name="Product_type" <?php if (!(strcmp("$row[Product_type]","เอกสารประกอบการสอน"))) {echo "checked";} ?> value="เอกสารประกอบการสอน" />
เอกสารประกอบการสอน</font></td>
<td width="50%"><font size="2" face="Tahoma">
<input type="radio" name="Product_type" <?php if (!(strcmp("$row[Product_type]"," เอกสารประกอบคำบรรยาย"))) {echo "checked";} ?> value="เอกสารประกอบคำบรรยาย" />
เอกสารประกอบคำบรรยาย </font></td>
</tr>
<tr>
<td><font size="2" face="Tahoma">
<input type="radio" name="Product_type" <?php if (!(strcmp("$row[Product_type]","สื่อการเรียนการสอน"))) {echo "checked";} ?> value="สื่อการเรียนการสอน" />
สื่อการเรียนการสอน </font></td>
<td><font size="2" face="Tahoma">
<input type="radio" name="Product_type" <?php if (!(strcmp("$row[Product_type]","การผลิตตำรา"))) {echo "checked";} ?> value="การผลิตตำรา" />
การผลิตตำรา </font></td>
</tr>
<tr>
<td><font size="2" face="Tahoma">
<input type="radio" name="Product_type"<?php if (!(strcmp("$row[Product_type]","สิ่งประดิษฐ์"))) {echo "checked";} ?> value="สิ่งประดิษฐ์" />
สิ่งประดิษฐ์</font></td>
<td><font size="2" face="Tahoma">
<input type="radio" name="Product_type" <?php if (!(strcmp("$row[Product_type]","เอกสารวิชาการ"))) {echo "checked";} ?> value="เอกสารวิชาการ" />
เอกสารวิชาการ </font></td>
</tr>
</table></td>
</tr>
<tr bordercolor="#CCCCCC" bgcolor="#EEEEEE">
<td><div align="center" class="style15"><font face="Tahoma">ชื่อผู้ร่วมวิจัยที่1</font></div></td>
<td> </td>
<td><select name="name1" id="select" >
<?php
$name1 = $row[name1];
if ($name1 == "00000") //
{
echo"<option value=\"\"></option>";
$sql_2 = "SELECT * FROM personal_tb ";
$result_2 = mysql_query($sql_2);
while($rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
else
{
$sql_1 = "Select * From personal_tb Where Teacher_code='$name1' ";
$result_1 = mysql_query($sql_1) or die("Error $result_1".mysql_error());
$sql_2 = "Select * From personal_tb ";
$result_2 = mysql_query($sql_2)or die("Error $result_2".mysql_error());
while($rs_1 = mysql_fetch_array($result_1))
{
echo"<option value=\"$rs_1[Teacher_code]\" ><b>$rs_1[First_name] $rs_1[Teacher_name] $rs_1[Teacher_lastname]</b></option>\n";
while( $rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
}
?>
</select>
<font color="#003366" size="2" face="Tahoma"> </font> </td>
</tr>
<tr bordercolor="#CCCCCC" bgcolor="#EEEEEE">
<td><div align="center"><font size="2" face="Tahoma">ชื่อผู้ร่วมวิจัยที่2</font></div></td>
<td> </td>
<td><select name="name2" id="Teacher_code">
<?php
$name2 = $row[name2];
if ($name2 == "00000") //
{
echo"<option value=\"\"></option>";
$result_2 = mysql_query($sql_2);
while($rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
else
{
$sql_1 = "Select * From personal_tb Where Teacher_code='$name2' ";
$result_1 = mysql_query($sql_1);
$sql_2 = "Select * From personal_tb";
$result_2 = mysql_query($sql_2);
while($rs_1 = mysql_fetch_array($result_1))
{
echo"<option value=\"$rs_1[Teacher_code]\" ><b>$rs_1[First_name] $rs_1[Teacher_name] $rs_1[Teacher_lastname]</b></option>\n";
while( $rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
}
?>
</select></td>
</tr>
<tr bordercolor="#CCCCCC" bgcolor="#EEEEEE">
<td><div align="center"><font size="2" face="Tahoma">ชื่อผู้ร่วมวิจัยที่3</font></div></td>
<td> </td>
<td><select name="name3">
<?php
$name3 = $row[name3];
if ($name3 == "00000")
{
echo"<option value=\"\"></option>";
$result_2 = mysql_query($sql_2);
while($rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
else
{
$sql_1 = "Select * From personal_tb Where Teacher_code='$name3' ";
$result_1 = mysql_query($sql_1);
$sql_2 = "Select * From personal_tb";
$result_2 = mysql_query($sql_2);
while($rs_1 = mysql_fetch_array($result_1))
{
echo"<option value=\"$rs_1[Teacher_code]\" ><b>$rs_1[First_name] $rs_1[Teacher_name] $rs_1[Teacher_lastname]</b></option>\n";
while( $rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
}
?>
</select></td>
</tr>
<tr bordercolor="#CCCCCC" bgcolor="#EEEEEE">
<td><div align="center"><font size="2" face="Tahoma">ชื่อผู้ร่วมวิจัยที่4</font></div></td>
<td> </td>
<td><select name="name4">
<?php
$name4 = $row[name4];
if ($name4 == "00000")
{
echo"<option value=\"\"></option>";
$sql_2 = "Select First_name,Teacher_name,Teacher_lastname From personal_tb";
$result_2 = mysql_query($sql_2);
while($rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
else
{
$sql_1 = "Select * From personal_tb Where Teacher_code='$name4' ";
$result_1 = mysql_query($sql_1);
$sql_2 = "Select * From personal_tb";
$result_2 = mysql_query($sql_2);
while($rs_1 = mysql_fetch_array($result_1))
{
echo"<option value=\"$rs_1[Teacher_code]\" ><b>$rs_1[First_name] $rs_1[Teacher_name] $rs_1[Teacher_lastname]</b></option>\n";
while( $rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
}
?>
</select></td>
</tr>
<tr bordercolor="#CCCCCC" bgcolor="#EEEEEE">
<td><div align="center"><font size="2" face="Tahoma">ชื่อผู้ร่วมวิจัยที่5</font></div></td>
<td> </td>
<td><select name="name5">
<?php
$name5 = $row[name5];
if ($name5 == "00000")
{
echo"<option value=\"\"></option>";
$sql_2 = "Select First_name,Teacher_name,Teacher_lastname From personal_tb";
$result_2 = mysql_query($sql_2);
while($rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
else
{
$sql_1 = "Select First_name,Teacher_name,Teacher_lastname From personal_tb Where Teacher_code='$name5' ";
$result_1 = mysql_query($sql_1);
$sql_2 = "Select First_name,Teacher_name,Teacher_lastname From personal_tb";
$result_2 = mysql_query($sql_2);
while($rs_1 = mysql_fetch_array($result_1))
{
echo"<option value=\"$rs_1[Teacher_code]\" ><b>$rs_1[First_name] $rs_1[Teacher_name] $rs_1[Teacher_lastname]</b></option>\n";
while( $rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
}
?>
</select></td>
</tr>
<tr bordercolor="#CCCCCC" bgcolor="#EEEEEE">
<td><div align="center"><font size="2" face="Tahoma">ชื่อผู้ร่วมวิจัยที่6</font></div></td>
<td> </td>
<td><select name="name6">
<?php
$name6 = $row[name6];
if ($name6 == "00000")
{
echo"<option value=\"\"></option>";
$sql_2 = "Select First_name,Teacher_name,Teacher_lastname From personal_tb";
$result_2 = mysql_query($sql_2);
while($rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
else
{
$sql_1 = "Select First_name,Teacher_name,Teacher_lastname From personal_tb Where Teacher_code='$name6' ";
$result_1 = mysql_query($sql_1);
$sql_2 = "Select First_name,Teacher_name,Teacher_lastname From personal_tb";
$result_2 = mysql_query($sql_2);
while($rs_1 = mysql_fetch_array($result_1))
{
echo"<option value=\"$rs_1[Teacher_code]\" ><b>$rs_1[First_name] $rs_1[Teacher_name] $rs_1[Teacher_lastname]</b></option>\n";
while( $rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
}
?>
</select></td>
</tr>
<tr bordercolor="#CCCCCC" bgcolor="#EEEEEE">
<td><div align="center"><font size="2" face="Tahoma">ชื่อผู้ร่วมวิจัยที่7</font></div></td>
<td> </td>
<td><select name="name7">
<?php
$name7 = $row[name7];
if ($name7 == "00000")
{
echo"<option value=\"\"></option>";
$sql_2 = "Select First_name,Teacher_name,Teacher_lastname From personal_tb";
$result_2 = mysql_query($sql_2);
while($rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
else
{
$sql_1 = "Select First_name,Teacher_name,Teacher_lastname From personal_tb Where Teacher_code='$name7' ";
$result_1 = mysql_query($sql_1);
$sql_2 = "Select First_name,Teacher_name,Teacher_lastname From personal_tb";
$result_2 = mysql_query($sql_2);
while($rs_1 = mysql_fetch_array($result_1))
{
echo"<option value=\"$rs_1[Teacher_code]\" ><b>$rs_1[First_name] $rs_1[Teacher_name] $rs_1[Teacher_lastname]</b></option>\n";
while( $rs_2 = mysql_fetch_array($result_2))
{
echo"<option value=\"$rs_2[Teacher_code]\" ><b>$rs_2[First_name] $rs_2[Teacher_name] $rs_2[Teacher_lastname]</b></option>\n";
}
}
}
?>
</select></td>
</tr>
<tr bordercolor="#CCCCCC" bgcolor="#EEEEEE">
<td><div align="center"><font size="2" face="Tahoma">วัน/เดือน/ปี เริ่มผลิต</font></div></td>
<td> </td>
<td><font size="2" face="Tahoma">ั</font><font color="#000000" size="2" face="Tahoma">วันที่
<select name="mDate1" class="select" id="mDate1" >
<?php
$Date_start = $row[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="mMonth1" class="select" id="mMonth1" >
<?php
$Date_start= $row[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="mYear1" type="text" class="input1" id="mYear1" value="<? echo $mYear ?>" size="4" maxlength="4" />
</font></td>
</tr>
<tr bordercolor="#CCCCCC" bgcolor="#EEEEEE">
<td><div align="center"><font size="2" face="Tahoma">วัน/เดือน/ปี แล้วเสร็จ</font></div></td>
<td> </td>
<td><font color="#000000" size="2" face="Tahoma">วันที่
<select name="mDate2" class="select" >
<?php
$Date_finish = $row[Date_finish];
$yearthai = explode("-",$Date_finish);
$mDate2 = intval($yearthai[2]);
$mMonth = intval($yearthai[1]);
$mYear2 = intval($yearthai[0]);
for($i=0;$i<=31;$i++)
{
if( $i == 0)
echo"\n\t<option value=\"$mDate2\" selected>$mDate2</option>\n ";
else
echo"\n\t<option value=\"$i\">$i</option>\n ";
}
?>
</select>
เดือน
<select name="mMonth2" class="select" >
<?php
$Date_finish = $row[Date_finish];
$yearthai = explode("-",$Date_finish);
$mDate= intval($yearthai[2]);
$Month2 = intval($yearthai[1]);
$mYear2= intval($yearthai[0]);
$mMonth2 = $Month2;
$CMonth = TxtThaiMonth($Month2);
for($i=-1;$i<=11;$i++)
{
$a = $i+1;
if( $a == 0)
echo"\n\t<option value=\"$mMonth2\" 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="4" maxlength="4" />
</font></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="26"><div align="center"><font size="2" face="Tahoma">ปี</font></div></td>
<td bordercolor="#FEEDF9"> </td>
<td bordercolor="#F2DEFE"><input name="Term" type="text" id="Term" value="<? echo $row[Term]?>" size="5" class="input1" /></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="26"><div align="center"><font size="2" face="Tahoma">การเผยแพร่</font></div></td>
<td bordercolor="#FEEDF9"> </td>
<td bordercolor="#F2DEFE"><input name="Propagate" type="text" class="input1" id="Propagate" value="<? echo $row[Propagate] ?>" size="50" /></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="24"><div align="center"><font size="2" face="Tahoma">แหล่งงบประมาณ </font> </div></td>
<td bordercolor="#FEEDF9"> </td>
<td bordercolor="#F2DEFE"><font color="#000000" size="2" face="Tahoma">
<input name="Fund_resource" type="text" class="input1" id="Fund_resource" value="<? echo $row[Fund_resource] ?>" size="30">
</font><font size="2" face="Tahoma">งบประมาณ</font><font color="#000000" size="2" face="Tahoma">
<input name="Fund" type="text" class="input1" id="Fund" value="<? echo $row[Fund] ?>" size="6" maxlength="10">
บาท </font></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="58"><div align="center"><font size="2" face="Tahoma">ประโยชน์ของผลงาน</font></div></td>
<td bordercolor="#FEEDF9"> </td>
<td bordercolor="#F2DEFE"><textarea name="Benefit" cols="50" rows="5" id="Benefit" class="input1"><? echo $row[Benefit] ?></textarea> </td>
</tr>
<tr bgcolor="#EEEEEE">
<td><div align="center"><font size="2" face="Tahoma">การนำไปใช้อ้างอิง</font></div></td>
<td bordercolor="#FEEDF9"> </td>
<td bordercolor="#F2DEFE"><textarea name="Use_ref" cols="50" id="Use_ref" class="input1"><? echo $row[Use_ref] ?></textarea></td>
</tr>
<tr bgcolor="#D5F0F9">
<td colspan="3"><div align="center">
<input type="hidden" name="Prod_code" value="<? echo $row[Prod_code]?>" />
<input type="submit" name="Submit" value=" แก้ไขข้อมูล" class="button" />
</div></td>
</tr>
</table></td>
</tr>
</table>
</form>
</div>
</label>
</fieldset><br>
<font color="<?php echo $GLOBALS["COLOR_FONT_3"];?>" size="2"><b>หมายเหตุ :</b> ใช้เมาส์คลิกที่ชื่อ<br>
</font></td>
</tr>
</table>
<?php
}
else
{
echo"<meta http-equiv=\"refresh\" content=\"3;URL=../login.php\">\n";
echo"Please Login ";
}
?>
|