Viewing file: EditTraining.php (7.21 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" );
/** Create Database Object */
$dbObj = new DBConn;
//=== SESSION
$Username = $valid_user;
/** Config Table for This Page */
$myTable1 = "personal_tb";
$myTable2 = "training_tb";
$myTable2PK = "Training_code";
/** Table --> personal_tb */
$query1 = " SELECT * FROM $myTable1 WHERE Teacher_code='$Teacher_code' ";
$result1 = $dbObj->execQuery($query1);
$rs1 = $dbObj->fetchArray($result1);
$Teacher_code = $rs1['Teacher_code'];
//$Date = $_POST['mYear']."-".$_POST['mMonth']."-".$_POST['mDate'];
//$Date_start = $_POST['mYear1']."-".$_POST['mMonth1']."-".$_POST['mDate1'];
//$Date_finish = $_POST['mYear2']."-".$_POST['mMonth2']."-".$_POST['mDate2'];
$Date = dmyE2ymdT($_REQUEST["mDate"]);
$Date_start = dmyE2ymdT($_REQUEST["mDate1"]);
$Date_finish = dmyE2ymdT($_REQUEST["mDate2"]);
$Sources = ($_POST['Sources'] == "เงินสนับสนุนอื่นๆ")?trim($_POST['SourcesOut']):trim($_POST['Sources']); // แหล่งเงินสนับสนุน
/*--------------*/
$sql = "SELECT * FROM training_tb where Training_code='$Training_code' and Teacher_code='$Teacher_code' ";
$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);
$rs = mysql_fetch_array($result);
if($num_rows){
if($_FILES['Filetex']['name'] != ""){
//ลบไฟล์เก่า
unlink($ResearchPicPath.$rs["Filetex"]);
//Upload ไฟล์เอกสารใหม่
$Filetex = date('YmdHis').strrchr($_FILES['Filetex']['name'], ".");
@copy( $_FILES['Filetex']['tmp_name'] , $ResearchPicPath.$Filetex );
@unlink( $_FILES['Filetex']['tmp_name'] );
/** Table --> training_tb */
$query = " UPDATE $myTable2 SET maNo='$maNo', codeId='$codeId', No_in='$No_in', Dated='$Dated', provinceId='$provinceId', Training_name='$Training_name', Period_code='$Period_code', Training_type='$Training_type', Training_std='$Training_std', Objective='$Objective', Content='$Content' , Benefits='$Benefits', Day='$Day', Capability_1='$Capability_1', Capability_2='$Capability_2', Performance_1='$Performance_1', Performance_2='$Performance_2', Performance_3='$Performance_3', Performance_4='$Performance_4', Performance_5='$Performance_5',PerformanceYear_1='$PerformanceYear_1',PerformanceYear_2='$PerformanceYear_2',PerformanceYear_3='$PerformanceYear_3',PerformanceYear_4='$PerformanceYear_4', Skills_1='$Skills_1', Skills_2='$Skills_2', Skills_3='$Skills_3', Skills_4='$Skills_4', Sources='$Sources', Major='$Major', Year_std='$Year_std', Place='$Place', Place_des='$Place_des', Date='$Date' ,Date_start='$Date_start' , Date_finish='$Date_finish' , CNEU='$CNEU' , Cradit='$Cradit', Total_hour='$Total_hour' , Budget_use='$Budget_use',Fund='$Fund' , Fund_resource='$Fund_resource' , Organiz='$Organiz' , Apply='$Apply', Filetex='$Filetex', date_updated=NOW() WHERE Training_code='$Training_code' AND Teacher_code='$Teacher_code' ";
}
else{
$query = " UPDATE $myTable2 SET maNo='$maNo', codeId='$codeId', No_in='$No_in', Dated='$Dated', provinceId='$provinceId', Training_name='$Training_name', Period_code='$Period_code', Training_type='$Training_type', Training_std='$Training_std', Objective='$Objective', Content='$Content' , Benefits='$Benefits', Day='$Day', Capability_1='$Capability_1', Capability_2='$Capability_2', Performance_1='$Performance_1', Performance_2='$Performance_2', Performance_3='$Performance_3', Performance_4='$Performance_4', Performance_5='$Performance_5',PerformanceYear_1='$PerformanceYear_1',PerformanceYear_2='$PerformanceYear_2',PerformanceYear_3='$PerformanceYear_3',PerformanceYear_4='$PerformanceYear_4', Skills_1='$Skills_1', Skills_2='$Skills_2', Skills_3='$Skills_3', Skills_4='$Skills_4', Sources='$Sources', Major='$Major', Year_std='$Year_std', Place='$Place', Place_des='$Place_des', Date='$Date' ,Date_start='$Date_start' , Date_finish='$Date_finish' , CNEU='$CNEU' , Cradit='$Cradit', Total_hour='$Total_hour' , Budget_use='$Budget_use',Fund='$Fund' , Fund_resource='$Fund_resource' , Organiz='$Organiz' , Apply='$Apply', date_updated=NOW() WHERE Training_code='$Training_code' AND Teacher_code='$Teacher_code' ";
}
$result = $dbObj->runQuery($query);
$dbObj->freeresult($result);
}
} # else
?>
ข้อมูลทั่วไปบุคลากร - ข้อมูลการพัฒนาบุคลากร - แก้ไขข้อมูลประวัติการพัฒนาตนเอง
freeresult($result1);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?> |