Viewing file: UpdatePersonalDev.php (6.73 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | ";
echo " กรุณาทำการ Login ก่อน ";
echo "";
exit();
}
else {
/** Configuration */
require_once( "../configuration.php" );
require_once( $_Config_absolute_path . "/includes/framework.php" );
require_once( "../includes/Function.php" );
require_once( "../includes/FunctionDB.php" );
require_once( "../includes/cURL.php" );
/** Create Database Object */
$dbObj = new DBConn;
/** Receive values */
$id = str_replace("-", "", trim($_POST['id'])); // บัตรประชาชน
$pcode = trim( $_POST['pcode'] ); // คำนำหน้า
$fname = trim( $_POST['fname'] ); //ชื่อ
$lname = trim( $_POST['lname'] ); // สกุล
$birthdate = dmyE2ymdE2($_REQUEST["DateBirth"]); // วันเกิด
$sex = trim( $_POST['sex'] ); // เพศ
$appointdate = dmyE2ymdE2($_REQUEST["Year_gov"]); // วันที่บรรจุ
$startdate = dmyE2ymdE2($_REQUEST["Year_coll"]); // วันที่ปฏิบัติงาน
$fperson = trim( $_POST['fperson'] ); // สภาพการปฏิบัติงาน
$statusId = trim( $_POST['statusId'] ); //สถานการปฏิบัติงาน
$posid = trim( $_POST['posid'] ); // เลขที่ตำแหน่ง
$salary = str_replace(',','',trim($salary));
$poscode = trim( $_POST['poscode'] ); // ตำแหน่งภายนอก
$levelcode = trim( $_POST['levelcode'] ); //ระดับ
$fposition = trim( $_POST['fposition'] ); //ลักษณะตำแหน่ง
$deptcode = trim( $_POST['deptcode'] ); // หน่วยงานตาม จ
$tcode = trim( $_POST['tcode'] ); // หน่วยงานที่ปฏิบัติ
$workcode = trim( $_POST['workcode'] ); //กลุ่ม/งาน/ฝ่าย
$Dev_type = trim( $_POST['Dev_type'] ); //สัญญาการใช้ทุน
if(isset($_POST['Dev_type']) && $_POST['Dev_type']=="Y"){
$schstartdate = dmyE2ymdE2($_REQUEST["schstartdate"]); // วันที่ใช้ทุน
$schstopdate = dmyE2ymdE2($_REQUEST["schstopdate"]); // วันที่สิ้นสุดการใช้ทุน
}
else{
$schstartdate = "0000-00-00"; // วันที่ใช้ทุน
$schstopdate = "0000-00-00"; // วันที่สิ้นสุดการใช้ทุน
}
//*--------dev_hrperson --------*//
$sql = "SELECT * FROM dev_hrperson where Teacher_code = $Teacher_code";
$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);
if($num_rows){
$rs = mysql_fetch_object($result);
$query =" UPDATE dev_hrperson SET Teacher_code ='$Teacher_code' , id='$id', pcode ='$pcode', fname='$fname', lname='$lname', birthdate='$birthdate', sex='$sex', appointdate='$appointdate', startdate='$startdate', fperson='$fperson' , statusId ='$statusId', posid='$posid', poscode ='$poscode', levelcode='$levelcode', salary='$salary', cercode='$cercode' , cerid='$cerid', fposition='$fposition' , deptcode='$deptcode', tcode='$tcode', workcode='$workcode' , Dev_type ='$Dev_type' , schstartdate ='$schstartdate' , schstopdate ='$schstopdate' Where Teacher_code ='$Teacher_code' ";
$result = $dbObj->runQuery($query);
$dbObj->freeresult($result);
$res = hrPersonCurl($rs->perid, $Teacher_code, $id, $pcode, $fname, $lname, $birthdate, $sex, $appointdate , $startdate, $fperson, $statusId, $posid, $poscode, $levelcode, $salary, $cercode, $cerid, $fposition, $deptcode, $tcode, $workcode, $Dev_type, $schstartdate, $schstopdate);
}
else{
InsertPersonaldev($Teacher_code, $id, $pcode, $fname, $lname, $birthdate, $sex, $appointdate, $startdate, $fperson, $statusId, $posid, $poscode, $levelcode, $salary, $cercode, $cerid, $fposition, $deptcode, $tcode, $workcode, $Dev_type, $schstartdate, $schstopdate);
$res = hrPersonCurl(mysql_insert_id(), $Teacher_code, $id, $pcode, $fname, $lname, $birthdate, $sex, $appointdate , $startdate, $fperson, $statusId, $posid, $poscode, $levelcode, $salary, $cercode, $cerid, $fposition, $deptcode, $tcode, $workcode, $Dev_type, $schstartdate, $schstopdate);
}
// $query =" UPDATE personal_tb SET PositionId ='$poscode' Where Teacher_code ='$Teacher_code' ";
// $result1 = $dbObj->runQuery($query);
// $dbObj->freeresult($result1);
} # else
?>
ข้อมูลทั่วไปบุคลากร - ข้อมูลแผนการสอน - แก้ไขประวัติผลงานวิจัย
freeresult($result1);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?> |