Viewing file: EditAbsent.php (5.47 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( "../include/Function.php" );
require_once( "../include/FunctionDB.php" );
/** Create Database Object */
$dbObj = new DBConn;
//=== SESSION
$Username = $valid_user;
/** Config Table for This Page */
$myTable1 = "personal_tb";
$myTable2 = "history_absent_tb";
$myTable2PK = "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']);
$Path = "../Absent_pic";
//### Upload Image File
if( $_FILES['Filetext']['name'] != "" ) {
//ลบไฟล์เอกสารเดิม
$query1 = "select Filetext from history_absent_tb WHERE code='$code'";
$result1 = mysql_query($query1);
$rs = mysql_fetch_array($result1);
if(!empty($rs["Filetext"])) unlink($AbsentPicPath.$rs["Filetext"]);
$dbObj->freeresult($result1);
//Upload ไฟล์เอกสารใหม่
//$Filetex = $_FILES['Filetex']['name'];
$Filetext = date('YmdHis').strrchr($_FILES['Filetext']['name'], ".");
@copy( $_FILES['Filetext']['tmp_name'] , $AbsentPicPath.$Filetext );
@unlink( $_FILES['Filetext']['tmp_name'] );
/** Table --> training_tb */
$query = " UPDATE $myTable2 SET Absent_code='$Absent_code' , Year='$Year', Absent_type='$Absent_type' , Teacher_code='$Teacher_code' , Absent_times='$Absent_times' ,Date='$Date', Date_start='$Date_start' ,Date_finish='$Date_finish' , Address='$Address' ,Status='$Status' ,Filetext='$Filetext', date_added=NOW() WHERE code='$code' and Teacher_code='$Teacher_code' ";
}
else{
$query = " UPDATE $myTable2 SET Absent_code='$Absent_code' , Year='$Year', Absent_type='$Absent_type' , Teacher_code='$Teacher_code' , Absent_times='$Absent_times' ,Date='$Date', Date_start='$Date_start' ,Date_finish='$Date_finish' , Address='$Address' ,Status='$Status' , date_added=NOW() WHERE code='$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);
?> bool(false)
|