Viewing file: EditFromA1.php (6.59 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
session_start();
/** Define Validate Access */
define( '_VALID_ACCESS' , 1 );
/** Check Session User Login */
if( !session_is_registered("valid_user") && !session_is_registered("Priority") ) {
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-874\" />";
echo "<p style=padding-top:115px><p align=center><br /><font color=red><strong>กรุณาทำการ Login ก่อน</strong></font></p></p>";
echo "<meta http-equiv=\"refresh\" content=\"1; URL=../login.php\" />";
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;
list($d,$m,$y) = split('/',$_REQUEST["Date"]);
list($dStart,$mStart,$yStart) = split('/',$_REQUEST["dateStart"]);
list($dFinish,$mFinish,$yFinish) = split('/',$_REQUEST["dateFinish"]);
//$Teacher_code = $_POST['Teacher_code'];
$code = $_POST['code'];
$ProjectId = $_POST['ProjectId'];
$No_in = trim( $_POST['No_in'] ); //้างตามหนังสือราชการเลขที่
$Detail = trim( $_POST['Detail'] );
$Date = ($y+543)."-".$m."-".$d;
$Date_start = ($yStart+543)."-".$mStart."-".$dStart;
$Date_finish = ($yFinish+543)."-".$mFinish."-".$dFinish;
$Training_name = trim( $_POST['Training_name'] ); //ขออนุมัติเดินทางไปราชการ
$Training_type = $_POST['Training_type'];
$Organiz = $_POST['Organiz'];
$Day = trim( $_POST['Day'] ); //
$Year_std = trim( $_POST['Year_std'] ); //
$TeacherId = $_POST['TeacherId'];
$Budget_use = str_replace(",", "", trim($_POST['Budget_use'])); //
$assignMent = trim( $_POST['assignMent'] ); //
$assignmentName = trim( $_POST['assignmentName'] ); //
$Status = trim( $_POST['Status'] ); //อ้างตามหนังสือราชการเลขที่
$Project_plan = trim( $_POST['Project_plan'] ); //รายละเอียด
$Fund_resource = trim( $_POST['Fund_resource'] ); // แหล่งเงินสนับสนุน
$Organiz = trim( $_POST['Organiz'] ); //หน่วยงานที่จัด
$Fund_resource = trim( $_POST['Fund_resource'] ); //แหล่งเงินสนับสนุน
$CNEU = trim( $_POST['CNEU'] ); //สถานที่จัด
$query = "UPDATE training_tb as ttb
LEFT JOIN formaoffice as fao ON ttb.Training_code = fao.Training_code AND ttb.Teacher_code = fao.Teacher_code
LEFT JOIN project_tb as ptb ON ttb.Training_code = ptb.Training_code AND ttb.Teacher_code = ptb.Teacher_code
SET ttb.Teacher_code = '$Teacher_code', ttb.Training_name = '$Training_name', ttb.Period_code = '$Period_code', ttb.Training_type = '$Training_type', ttb.Training_std = '$Training_std',ttb.Total_hour = '$Total_hour', ttb.Fund_resource = '$Fund_resource', ttb.Organiz = '$Organiz' , ttb.CNEU='$CNEU', ttb.Date_start='$Date_start', ttb.Date_finish='$Date_finish', ttb.Budget_use = '$Budget_use', ttb.date_updated = NOW(),
fao.Training_code = '$Training_code', fao.Teacher_code = '$Teacher_code', fao.code = '$code', fao.Orderlist='$Orderlist', fao.Project_plan = '$Project_plan', fao.ProjectId = '$ProjectId', fao.Travel='$Travel', fao.No_in='$No_in', fao.Detail='$Detail', fao.Date = '$Date', fao.Date_start = '$Date_start', fao.Date_finish = '$Date_finish', fao.Training_name = '$Training_name', fao.Training_type = '$Training_type', fao.Day = '$Day', fao.Year_std = '$Year_std', fao.TeacherId = '$TeacherId', fao.Flag = '$Flag', fao.Flag1 = '$Flag1', fao.Budget_use = '$Budget_use', fao.maNo='$maNo', fao.assignMent='$assignMent', fao.assignmentName = '$assignmentName', fao.provinceId = '$provinceId' , fao.date_updated = NOW(),
ptb.Project_code = '$Project_code', ptb.Faculty_code = '$Faculty_code', ptb.Teacher_code = '$Teacher_code', ptb.ProjectNo = '$ProjectNo', ptb.ProjectId = '$ProjectId', ptb.Orderlist = '$Orderlist', ptb.Training_name = '$Training_name', ptb.Year = '$Year', ptb.MoneyS_C = '$MoneyS_C', ptb.MoneyId = '$MoneyId', ptb.Date = '$Date', ptb.Budget_use = '$Budget_use', ptb.Spending_use = '$Budget_use', ptb.Budget_Year='$Budget_Year' , ptb.date_updated=NOW()
WHERE ttb.Training_code = '".$_REQUEST["Training_code"]."'";
$result = $dbObj->execQuery($query);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/utilities.js"></script>
<title>ข้อมูลทั่วไปบุคลากร - ข้อมูลแผนการสอน - แก้ไขข้อมูลแผนการสอน</title>
</head>
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0">
<?php
include("../templates/incHeader.php");
?>
<table width="1003" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="203" align="left" valign="top" style="padding:10px 0px 0px 5px"><?php include("./_incMainMenu.php");?></td>
<td width="800" height="440" align="center" valign="top" style="padding:10px 0px 5px 10px"><fieldset>
<table width="780" border="0" cellspacing="0" cellpadding="0">
<form id="myForm" name="myForm" method="post" action="">
<tr>
<td height="5"></td>
</tr>
<tr>
<td height="30" background="../images/background/bg-head-topic-w780.gif" class="PADDING-LEFT-10"><strong><a href="index.php">หน้าหลัก</a></strong> <strong>» <a href="Menu_Teach.php">ข้อมูลทั่วไปบุคลากร</a> » <a href="PlanList.php?Teacher_code=<?=$Teacher_code;?>">ข้อมูลแผนการสอน</a> » <span class="NOTE">เพิ่มข้อมูล</span></strong></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td height="150" align="center"><span class="TEXT-GREEN10"><strong>ระบบจัดเก็บข้อมูลของท่านเรียบร้อยแล้ว</strong></span><br />
กรุณารอส้กครู่ กำลังเปลี่ยนหน้าอัตโนมัติ<br />
<?php echo "<meta http-equiv=\"refresh\" content=\"1; URL=FrmEditFormA.php?Teacher_code=$Teacher_code&Training_code=$Training_code&codeId=$codeId\">"; ?></td>
</tr>
<tr>
<td height="345"> </td>
</tr></form>
</table>
</fieldset></td>
</tr>
</table>
<?php include("../templates/incFooter.php"); ?>
</body>
</html>
<?php
/** Free Resource */
$dbObj->freeresult($result);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?>
|