Viewing file: InsertAbsent.php (4.51 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;
/** Config Table for This Page */
$myTable1 = "personal_tb";
$myTable2 = "history_absent_tb";
$myTable2PK = "code";
/** Receive values */
$Teacher_code = $_POST['Teacher_code'];
$Year = $_POST['Year']; // ปี พ.ศ.
$Absent_code = $_POST['Absent_code']; // ประเภทการลา
$Absent_type = $_POST['Absent_type']; // ประเภทการลา
$Absent_times = trim( $_POST['Absent_times'] ); // จำนวนวันลา
//$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']);
$Address = $_POST['Address']; // นับครั้ง
$Status = 'รออนุมัติ';
///*-------- นำค่า id มาเพิ่มให้กับค่ารหัสครั้งละ1 -----------*//
$query = " SELECT * FROM $myTable2 ORDER BY code DESC ";
$result = $dbObj->execQuery($query);
$rss= $dbObj->fetchArray($result);
$myTable2 = $rss[0]+1 ; // นำค่า id มาเพิ่มให้กับค่ารหัสสมาชิกครั้งละ1
$AbsentNo = "$Absent$myTable2" ;
//--- Table --> 'history_absent_tb'
InsertAbsent( $Absent_code , $Year , $Absent_type , $Teacher_code , $Absent_times ,$Times_total , $Times_sum, $Date, $Date_start , $Date_finish , $Address ,$Status ,$AbsentNo );
} # else
?>
ข้อมูลประวัติส่วนตัว - ข้อมูลการลารายปี - เพิ่มข้อมูลการลา
disconn();
/** Unset Class */
unset($dbObj);
?> |