Viewing file: FrmInstructor.php (12.39 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" );
/** Create Database Object */
$dbObj = new DBConn;
$myTable = "instructor_tb";
$myTableFK = "code";
$query = " SELECT * FROM $myTable WHERE code='$code' ";
$resultPerson = $dbObj->execQuery($query);
$rss = $dbObj->fetchArray($resultPerson);
} # 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" />
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/utilities.js"></script>
<script language="JavaScript">
extArray = new Array(".gif", ".jpg", ".jpeg");
function LimitAttach(form, file) {
allowSubmit = false;
if (!file) return;
while (file.indexOf("\\") != -1)
file = file.slice(file.indexOf("\\") + 1);
ext = file.slice(file.indexOf(".")).toLowerCase();
for (var i = 0; i < extArray.length; i++) {
if (extArray[i] == ext) {
allowSubmit = true; break;
}
}
if (allowSubmit)
fileClick();
else
alert("JPG/JPEG or GIF file Only!");
}
function fileClick() {
var cForm = document.myForm;
cForm.Img1.style.color = "#000000";
document.myForm.pimg.src = document.myForm.Img1.value;
}
</script>
<script language="javascript">
//========================
function checkEmail(form) {
var email = document.myForm.Email.value;
if (!isEmail(email)) {
//alert("รูปแบบของ อีเมล์ ไม่ถูกต้อง");
return false;
}
else { return true; }
}
function isEmail(str) {
var supported = 0;
if (window.RegExp) {
var tempStr = "a";
var tempReg = new RegExp(tempStr);
if (tempReg.test(tempStr)) supported = 1;
}
if (!supported)
return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
return (!r1.test(str) && r2.test(str));
} // function
function isBlank(myObj) {
if(myObj.value=='') {
return true;
}
return false;
}
function verifySubmit() {
with(document.myForm) {
if( isBlank(Name) ) { alert("กรุณากรอกข้อมูล ชื่อ"); Name.style.backgroundColor='#E8EFF6'; Name.focus(); return false; }
if( isBlank(Lastname) ) { alert("กรุณากรอกข้อมูล นามสกุล"); Lastname.style.backgroundColor='#E8EFF6'; Lastname.focus(); return false; }
if( !checkEmail(Email) ) { alert('รูปแบบของ อีเมล์ ไม่ถูกต้อง'); Email.style.backgroundColor='#E8EFF6'; Email.focus(); return false; }
document.myForm.submit();
}
}
//-->
</script>
<title>ข้อมูลการพัฒนาบุคลากร - วิทยาการทั้งหมด - เพิ่มข้อมูลวิทยากร</title>
</head>
<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 action="EditInstructor.php" method="post" enctype="multipart/form-data" name="myForm" id="myForm">
<tr>
<td height="5"></td>
</tr>
<tr>
<td height="30" background="../images/background/bg-head-topic-w780.gif" class="PADDING-LEFT-10"><strong><a href="index.php">หน้าหลัก</a></strong> <strong>» <a href="Menu_Training.php">ข้อมูลการพัฒนาบุคลากร</a> » <a href="InstructorList.php">รายชื่อวิทยาการทั้งหมด</a> » <span class="NOTE">แก้ไขข้อมูลวิทยากร</span></strong></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="370" align="center" valign="top"><table width="760" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#E5E5E5" class="BORDER-GREY-LIGHT">
<tr bgcolor="#FFCC99">
<td height="25" colspan="4" align="center" bgcolor="#F8F8F8"> </td>
</tr>
<tr>
<td width="20%" align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10"><span class="TEXT-RED10">*</span> คำนำหน้า</td>
<td width="1%" bgcolor="#FFFFFF"> </td>
<td colspan="2" align="left" bgcolor="#FFFFFF"><font color="#0000FF" size="2" face="Tahoma">
<input name="First_name" type="text" id="First_name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rss['First_name'];?>" size="4" />
<span class="TEXT-DARK-BLUE10">ชื่อ</span>
<input name="Name" type="text" id="Name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rss['Name'];?>" size="15" />
<span class="TEXT-DARK-BLUE10"> นามสกุล</span>
<input name="Lastname" type="text" id="Lastname" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rss['Lastname'];?>" size="15" />
</font></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">สถานะของอาจารย์</td>
<td bgcolor="#FFFFFF"> </td>
<td colspan="2" align="left" bgcolor="#FFFFFF"><input name="Status" type="radio" id="Status" <?php if (!(strcmp("$rss[Status]","1"))){echo "checked";} ?> value="1" />
อาจารย์ของวิทยาลัย
<input type="radio" name="Status" id="Status" <?php if (!(strcmp("$rss[Status]","2"))){echo "checked";} ?> value="2" />
อาจารย์พิเศษ (ภายนอก)</td>
</tr>
<tr>
<td height="26" align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">เพศ</td>
<td bgcolor="#FFFFFF"> </td>
<td colspan="2" align="left" bgcolor="#FFFFFF"><input name="Sex" type="radio" id="Sex" <?php if (!(strcmp("$rss[Sex]","ชาย"))){echo "checked";} ?> value="ชาย" />
ชาย
<input type="radio" name="Sex" id="Sex" <?php if (!(strcmp("$rss[Sex]","หญิง"))){echo "checked";} ?> value="หญิง" />
หญิง</td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">คุณวุฒิ</td>
<td bgcolor="#FFFFFF"> </td>
<td colspan="2" align="left" bgcolor="#FFFFFF"><font color="#0000FF" size="2" face="Tahoma">
<input name="Degree" type="text" id="Degree" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rss['Degree'];?>" size="60" />
</font></td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">ประสบการณ์การทำงาน</td>
<td bgcolor="#FFFFFF"> </td>
<td colspan="2" align="left" bgcolor="#FFFFFF"><textarea name="Exper" cols="60" rows="3" id="Exper"><?=$rss['Exper'];?>
</textarea></td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">ความเชี่ยวชาญ</td>
<td bgcolor="#FFFFFF"> </td>
<td colspan="2" align="left" bgcolor="#FFFFFF"><textarea name="Skill" cols="60" rows="3" id="Skill"><?=$rss['Skill'];?>
</textarea></td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">สถานที่ปฎิบัติงาน</td>
<td bgcolor="#FFFFFF"> </td>
<td colspan="2" align="left" bgcolor="#FFFFFF"><font color="#0000FF" size="2" face="Tahoma">
<input name="Addr_work" type="text" id="Addr_work" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rss['Addr_work'];?>" size="60" />
</font></td>
</tr>
<tr>
<td height="24" align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">ที่อยู่</td>
<td bgcolor="#FFFFFF"> </td>
<td colspan="2" align="left" bgcolor="#FFFFFF"><font color="#0000FF" size="2" face="Tahoma">
<input name="Addr_home" type="text" id="Addr_home" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rss['Addr_home'];?>" size="60" />
</font></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">โทรศัพท์</td>
<td bgcolor="#FFFFFF"> </td>
<td colspan="2" align="left" bgcolor="#FFFFFF"><font color="#0000FF" size="2" face="Tahoma">
<input name="Tel" type="text" id="Tel" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rss['Tel'];?>" size="20" />
</font><span class="TEXT-ORANGE9">(ใส่ตัวเลขติดกันทั้งหมด)</span></td>
</tr>
<tr>
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">E-Mail</td>
<td bgcolor="#FFFFFF"> </td>
<td colspan="2" align="left" bgcolor="#FFFFFF"><font color="#0000FF" size="2" face="Tahoma">
<input name="Email" type="text" id="Email" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rss['Email'];?>" size="30" />
</font></td>
</tr>
<tr >
<td align="right" bgcolor="#FFFFFF" class="TEXT-DARK-BLUE10">รูปภาพ</td>
<td bgcolor="#FFFFFF"> </td>
<td width="47%" align="left" bgcolor="#FFFFFF"><input name="Img1" type="file" id="Img1" onchange="LimitAttach(document.myForm, document.myForm.Img1.value)" size="35" /></td>
<td width="32%" align="left" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><img src="../images/picture_preview.jpg" width="100" height="100" border="0" align="center" name="pimg" style="border:1px solid #CCC" /></td>
</tr>
</table></td>
</tr>
<tr >
<td height="25" bgcolor="#FFFFFF"> </td>
<td height="25" bgcolor="#FFFFFF"> </td>
<td height="25" colspan="2" bgcolor="#FFFFFF"> </td>
</tr>
<tr >
<td height="25" bgcolor="#FFFFFF"> </td>
<td height="25" bgcolor="#FFFFFF"> </td>
<td height="25" colspan="2" bgcolor="#FFFFFF"><input type="button" name="Button" value="บันทึก" class="WIDTH60 CURSOR-HAND" onclick="verifySubmit();" />
<input name="Reset" type="reset" class="WIDTH60 CURSOR-HAND" id="Reset" value="รีเซ็ต" />
<input name="Button" type="button" id="Reset" value="ยกเลิก" class="CURSOR-HAND WIDTH60" onclick="location.href='InstructorList.php'" />
<input name="code" type="hidden" id="code" value="<? echo $code; ?>" /></td>
</tr>
<tr >
<td bgcolor="#FFFFFF"> </td>
<td bgcolor="#FFFFFF"> </td>
<td colspan="2" bgcolor="#FFFFFF"> </td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr></form>
</table>
</fieldset></td>
</tr>
</table>
<?php include("../templates/incFooter.php"); ?>
</body>
</html>
<?php
/** Free Resource */
$dbObj->freeresult($result);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?>
|