Viewing file: Add_Edu_Product.php (20.96 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( "../includes/Function.php" );
/** Create Database Object */
$dbObj = new DBConn;
//=== SESSION
$Username = $valid_user;
/** Config Table for This Page */
$myTable1 = "personal_tb";
$myTable2 = "research_tb";
$myTable2PK = "Research_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);
$Teacher_code = $rs['Teacher_code'];
/** Paging */
$page = $_GET['page'];
if( $page == "" ) { $page = 1; }
/** จำนวนข้อมูล ต่อ 1 หน้า */
$perpage = $_REQUEST['perpage'];
if( $perpage == "" ) { $perpage = 10; }
/** Botton Name Action */
$action = $_REQUEST['action'];
$id = $_REQUEST['id'];
if( isset($action) && !empty($action) ) {
switch($action) {
case "Delete" :
$num = count($id);
for( $i=0; $i<$num; $i++ ) {
//--- research_tb
$qryDel = " DELETE FROM $myTable2 WHERE $myTable2PK='$id[$i]' ";
$resultDel = $dbObj->runQuery($qryDel);
$dbObj->freeresult($resultDel);
}
break;
} # switch
} # if
} # 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 type="text/javascript" src="../js/nicEdit/nicEdit.js"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
</script>
<script language="JavaScript" type="text/JavaScript">
function browse()
{
myForm.Filetex.src = myForm.Filetex.value;
}
</script>
<script language="javascript">
function checkData() {
var formObj = document.myForm;
if( (formObj.Research_name.value == "" ) && (formObj.mYear1.value == "" ) ) { alert("กรุณากรอกข้อมูลให้ครบด้วยค่ะ" ); formObj.Research_name.style.backgroundColor='#F1F9FC'; formObj.Research_name.focus(); return false; }
else if(formObj.Research_name.value == "" ) { alert("กรุณากรอก ชื่อผลงานวิจัย"); formObj.Research_name.style.backgroundColor='#F1F9FC'; formObj.Research_name.focus(); return false;}
else if(formObj.mYear1.value == "" ) { alert("กรุณากรอก ปีที่เผยแพร่"); formObj.mYear1.style.backgroundColor='#F1F9FC'; formObj.mYear1.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" action="InsertProduction.php" enctype="multipart/form-data" 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">ข้อมูลทั่วไปบุคลากร</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="0" cellspacing="3" bgcolor="#E5E5E5" class="BORDER-GREY">
<tr>
<td width="16%" height="26" align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">ชื่อ-นามสกุล</td>
<td width="1%" bgcolor="#FFFFFF"> </td>
<td width="83%" 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="<?=$_GET['Product_name'];?>" size="90" />
</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" value="เอกสารประกอบการสอน" />เอกสารประกอบการสอน</td>
<td width="55%"><input type="radio" name="Product_type" value="เอกสารประกอบคำบรรยาย" />เอกสารประกอบคำบรรยาย</td>
</tr>
<tr>
<td><input type="radio" name="Product_type" value="สื่อการเรียนการสอน" />สื่อการเรียนการสอน</td>
<td><input type="radio" name="Product_type" value="การผลิตตำรา" />การผลิตตำรา</td>
</tr>
<tr>
<td><input type="radio" name="Product_type" value="สิ่งประดิษฐ์" />สิ่งประดิษฐ์</td>
<td><input type="radio" name="Product_type" 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) )
{
echo"<option value=\"$rs1[Teacher_code]\" ><b>$rs1[Teacher_name] $rs1[Teacher_lastname]</b></option>\n";
}
$dbObj->freeresult($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">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb ORDER BY First_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) )
{
echo"<option value=\"$rs1[Teacher_code]\" ><b>$rs1[Teacher_name] $rs1[Teacher_lastname]</b></option>\n";
}
$dbObj->freeresult($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">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb ORDER BY First_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) )
{
echo"<option value=\"$rs1[Teacher_code]\" ><b>$rs1[Teacher_name] $rs1[Teacher_lastname]</b></option>\n";
}
$dbObj->freeresult($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">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb ORDER BY First_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) )
{
echo"<option value=\"$rs1[Teacher_code]\" ><b>$rs1[Teacher_name] $rs1[Teacher_lastname]</b></option>\n";
}
$dbObj->freeresult($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">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb ORDER BY First_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) )
{
echo"<option value=\"$rs1[Teacher_code]\" ><b>$rs1[Teacher_name] $rs1[Teacher_lastname]</b></option>\n";
}
$dbObj->freeresult($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">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb ORDER BY First_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) )
{
echo"<option value=\"$rs1[Teacher_code]\" ><b>$rs1[Teacher_name] $rs1[Teacher_lastname]</b></option>\n";
}
$dbObj->freeresult($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">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb ORDER BY First_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) )
{
echo"<option value=\"$rs1[Teacher_code]\" ><b>$rs1[Teacher_name] $rs1[Teacher_lastname]</b></option>\n";
}
$dbObj->freeresult($result1);
?>
</select></td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">วันที่เริ่ม</td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><select name="mDate" id="mDate" class="select" />
<?php getDay1to31(); ?>
</select>
<select name="mMonth" id="mMonth" class="select" onkeypress="return handleEnter(this, event)">
<?php getThaiMonth(); ?>
</select> พ.ศ
<select name="mYear" id="mYear">
<?php
$curr_year = date("Y")+543;
$prev_year = $curr_year-3;
$next_year = $curr_year+5;
for( $i=$prev_year; $i<=$next_year; $i++ ) {
?>
<option value="<?=$i;?>" <?php if( $i==$curr_year ) echo 'selected'; elseif( $i==$Budget_Year ) echo 'selected'; ?>>
<?=$i;?>
</option>
<?php
} # for
?>
</select></td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">วันที่แล้วเสร็จ</td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><select name="mDate2" id="mDate2" class="select" /> <?php getDay1to31(); ?> </select>
<select name="mMonth2" id="mMonth2" class="select" onkeypress="return handleEnter(this, event)"><?php getThaiMonth(); ?></select>
พ.ศ
<select name="mYear2" id="mYear2">
<?php
$curr_year = date("Y")+543;
$prev_year = $curr_year-3;
$next_year = $curr_year+5;
for( $i=$prev_year; $i<=$next_year; $i++ ) {
?>
<option value="<?=$i;?>" <?php if( $i==$curr_year ) echo 'selected'; elseif( $i==$Budget_Year ) echo 'selected'; ?>>
<?=$i;?>
</option>
<?php
} # for
?>
</select></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"><select name="Term" id="Term">
<?php
$curr_year = date("Y")+543;
$prev_year = $curr_year-3;
$next_year = $curr_year+5;
for( $i=$prev_year; $i<=$next_year; $i++ ) {
?>
<option value="<?=$i;?>" <?php if( $i==$curr_year ) echo 'selected'; elseif( $i==$Budget_Year ) echo 'selected'; ?>>
<?=$i;?>
</option>
<?php
} # for
?>
</select></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">ปีงบประมาณ</td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><select name="Year_prop" id="Year_prop">
<?php
$curr_year = date("Y")+543;
$prev_year = $curr_year-3;
$next_year = $curr_year+5;
for( $i=$prev_year; $i<=$next_year; $i++ ) {
?>
<option value="<?=$i;?>" <?php if( $i==$curr_year ) echo 'selected'; elseif( $i==$Budget_Year ) echo 'selected'; ?>>
<?=$i;?>
</option>
<?php
} # for
?>
</select></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="Propagate " type="text" id="Propagate " style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$_GET['Propagate'];?>" size="90" />
</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">
<input name="Fund" type="text" size="10" maxlength="10" style="text-align:center" />
บาท <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="<?=$_GET['Product_name'];?>" size="50" />
</font></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">จำนวนที่ใช้จริง</td>
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"><input name="Benefit" type="text" id="Benefit" style="text-align:center" size="10" maxlength="10" />
บาท</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="90" rows="4" id="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="20" /></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" align="center" bgcolor="#FFFFFF"><input type="hidden" name="Teacher_code" value="<? echo $Teacher_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);
?>
|