Viewing file: InsertFormAgree.php (4.55 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( "../includes/FunctionDB.php" );
/** Create Database Object */
$dbObj = new DBConn;
/** Config Table for This Page */
$myTable1 = "personal_tb";
$myTable2 = "formagree";
$myTable2PK = "proId";
$Teacher_code = $_POST['Teacher_code'];
$Noagree = trim($_POST['Noagree']);
$maNo = trim( $_POST['maNo'] );
$Date = dmyE2ymdT($_REQUEST['mDate']);
$Training_name = trim( $_POST['Training_name'] ); //ขออนุมัติ
$Year_std = trim( $_POST['Year_std'] ); //
$query = " SELECT * FROM $myTable2 ORDER BY agreeId DESC ";
$result = $dbObj->execQuery($query);
$rss= $dbObj->fetchArray($result);
$myTable2 = $rss[0]+1 ; // นำค่า id มาเพิ่มให้กับค่ารหัสสมาชิกครั้งละ1
$Noagree = "$Ageer$myTable2" ;
$Flag = "N";
/*-----------------*/
$Budget_use = $Smtotal + $STtotal + $Vehicletotal +$Crgestotal ;
//### user_tb
$checkid = 0;
$sql11 = "SELECT * FROM formagree Where maNo='$maNo' and Teacher_code='$Teacher_code' and contId='$contId' ";
$result11 = mysql_query($sql11);
while ($rs11 = mysql_fetch_array($result11)){
if ($rs11["Teacher_code"] == $Teacher_code){
echo "";
echo "";
echo "";
exit();
}else{
$checkid = 1;
}
}
if ($check == 0){
InsertFormAgree( $Noagree , $maNo , $Teacher_code, $contId, $Training_code , $MoneyS_C , $Training_name , $Date, $Dayout, $Smtotal, $STtotal , $Vehicletotal, $Crgestotal , $Budget_use ,$Filetex , $Flag , $Year_std );
}
} # else
?>
MIS -- Teacher
freeresult($result);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?> |