Viewing file: FrmFormContract.php (18.39 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" );
require_once("../link/function.php");
/** Create Database Object */
$dbObj = new DBConn;
//=== SESSION
$Username = $valid_user;
if(isset($_REQUEST["maNo"])) $maNo = iconv("UTF-8", "WINDOWS-874",trim($_REQUEST["maNo"]));
/** Personal Data **/
$query = "SELECT * FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId LEFT JOIN position_tb ON personal_tb.PositionId = position_tb.PositionId LEFT JOIN faculty_tb ON personal_tb.Faculty_code = faculty_tb.Faculty_code WHERE Teacher_code = '".$_REQUEST["Teacher_code"]."'";
$result = $dbObj->execQuery($query);
$rs1 = $dbObj->fetchArray($result);
if(isset($_REQUEST["maNo"])){
/** Training Data **/
//$query = "SELECT * FROM training_tb LEFT JOIN formaoffice ON training_tb.Training_code = formaoffice.Training_code AND training_tb.Teacher_code = formaoffice.Teacher_code LEFT JOIN project_tb ON training_tb.Training_code = project_tb.Training_code AND training_tb.Teacher_code = project_tb.Teacher_code WHERE training_tb.maNo = '".$maNo."' LIMIT 1";
$query = "SELECT * FROM formcontract LEFT JOIN formaoffice ON formcontract.maNo = formaoffice.maNo WHERE formcontract.Teacher_code = '".$Teacher_code."' and formcontract.contId = '".$contId."' ";
$result2 = $dbObj->execQuery($query);
$rs2 = $dbObj->fetchArray($result2);
}
/** Personal Data(Faculty Head) **/
$query = "SELECT * FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId LEFT JOIN position_tb ON personal_tb.PositionId = position_tb.PositionId LEFT JOIN faculty_tb ON personal_tb.Faculty_code = faculty_tb.Faculty_code WHERE personal_tb.Faculty_code = '".$rs1["Faculty_code"]."' AND TeacherId = '1'";
$result = $dbObj->execQuery($query);
$rs3 = $dbObj->fetchArray($result);
/** College Data **/
$sql = "Select * From college Where collegeStatus ='1'";
$result = mysql_query($sql) or die("Error".mysql_error());
$rs4 = mysql_fetch_array($result);
$collegeName = $rs4["collegeName"];
} # else
?>
<!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=tis-620" />
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/utilities.js"></script>
<script type="text/javascript" src="../js/ajaxScript.js"></script>
<script type="text/javascript" src="../js/calendarDateInput2.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>
<form id="form1" name="form1" method="post" action="EditFormContract.php">
<table width="780" border="0" cellspacing="0" cellpadding="0">
<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="FormContractList.php?Teacher_code=<?=$_REQUEST["Teacher_code"];?>">ข้อมูลบันทึกการยืมเงินไปราชการ</a> »
<span class="NOTE">บันทึกข้อมูลการยืมเงินไปราชการ</span></strong></td>
</tr>
<tr>
<td><hr /></td>
</tr>
<tr>
<td align="center">
<?php
?>
<table width="750" cellpadding="0" cellspacing="0" border="0">
<tr height="31">
<td height="31" colspan="6" align="center" class="PATRON11">บันทึกข้อความ</td>
</tr>
<tr height="29">
<td height="29" colspan="6"> </td>
</tr>
<tr>
<td height="29" colspan="5" align="right" nowrap>วันที่ </td>
<td height="29" align="center"><script>DateInput('Date', true,'DD/MM/YYYY','<?=(isset($rs2["Date"]))?ymdT2dmyE($rs2["Date"]):date("d/m/Y");?>');</script></td>
</tr>
<tr>
<td height="29" colspan="5" align="left" nowrap>ส่วนราชการ
<?=$collegeName;?></td>
<td height="29" align="center"></td>
</tr>
<tr>
<td height="29" colspan="2" align="left" nowrap>
ที่
<!--<INPUT TYPE="checkbox" ID="addJoinFormA" NAME="addJoinFormA" onclick="(this.checked)?document.getElementById('maNo').readOnly=false:document.getElementById('maNo').readOnly=true; (this.checked)?document.getElementById('searchJoinFormA').style.display='':document.getElementById('searchJoinFormA').style.display='none';">
<input name="maNo" type="text" id="maNo" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=(isset($_REQUEST["maNo"]))?$maNo:genDocNo();?>" onblur="this.readOnly=true;" size="15" readonly/>
<img SRC="../picture/search_ico.gif" ID="searchJoinFormA" width="15" height="15" style="display:none;cursor:pointer;" onclick="document.getElementById('addJoinFormA').checked=false; location.href='AddFormContract.php?Teacher_code=<?=$_REQUEST["Teacher_code"];?>&Budget_year=<?=$_REQUEST["Budget_year"];?>&maNo='+encodeURIComponent(document.getElementById('maNo').value);" title="คลิ๊กที่นี่เพื่อค้นหาข้อมูลการเดินทางไปราชการ">-->
<input name="maNo" type="text" id="maNo" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rs2['maNo']; //=(isset($rs2["maNo"]))?$maNo:$docNo."...";?>" size="20" readonly/>
<img SRC="../picture/search_ico.gif" ID="searchJoinFormA" width="15" height="15" style="cursor:pointer" onclick="MM_openBrWindow('SearchTrainingCon.php?Teacher_code=<?=$_REQUEST["Teacher_code"];?>&Budget_year=<?=$_REQUEST["Budget_year"];?>','Detail','scrollbars=yes,width=820,height=480');" title="คลิ๊กที่นี่เพื่อค้นหาข้อมูลการเดินทางไปราชการ">
</td>
<td width="146" height="29" align="left">
<input name="Flag" type="hidden" id="Flag" value="<?=$rs2["Flag"]?>"/>
</td>
<td height="29" align="left"> </td>
<td height="29" align="right"> </td>
<td height="29" width="131" align="center">
</td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left">
เรื่อง ขออนุมัติยืมเงินไปราชการ
<input name="Detail" type="hidden" id="Detail" value="1"/>
</td>
<td width="14"> </td>
<td width="274"> </td>
<td width="131"> </td>
</tr>
<tr height="29">
<td height="29" colspan="5" align="left">เรียน ผู้อำนวยการ <?=$collegeName;?></td>
<td> </td>
</tr>
<tr height="29">
<td width="150" height="25"> </td>
<td colspan="5" align="left" nowrap>
ข้าพเจ้า<input name="Name" type="text" id="Name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed ; text-align:center" size="30" value="<?=$rs1["prefixName"]." ".$rs1["Teacher_name"]." ".$rs1["Teacher_lastname"];?>" readonly/>
ตำแหน่ง<input name="Name2" type="text" id="Name2" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed; text-align:center" size="30" value="<?=$rs1["Position_name"];?>" readonly/>
</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left" nowrap>
สังกัด<input name="Name3" type="text" id="Name3" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed; text-align:center" size="20" value="<?=$rs1["Faculty_name"];?>" readonly/>
<input name="Name4" type="text" id="Name4" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed; text-align:center" size="65" value="<?=$collegeName;?>" readonly/>สถาบันพระบรมราชชนก
</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left" nowrap>พร้อมด้วย
<input name="WithMon" type="text" id="WithMon" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rs2["WithMon"];?>" size="75" />
ได้รับอนุมัติให้เข้าร่วมประชุม</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left" nowrap>
เรื่อง *
<input name="Training_name" type="text" id="Training_name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed; text-align:center" size="80" value="<?=(isset($rs2["Training_name"]))?$rs2["Training_name"]:"";?>" <?=(isset($rs2["Training_name"]))?"readonly":"";?>/>
จังหวัด
<select name="provinceId" id="provinceId" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" <?=(isset($rs2["provinceId"]))?"disabled":"";?>>
<?php
$query = " SELECT * FROM province";
$result = mysql_query($query);
while($rs4 = mysql_fetch_array($result)){
?>
<option value="<?=$rs4['provinceId'];?>" <?=($rs4['provinceId']==$rs2['provinceId'] )?"selected":"";?>>
<?=$rs4['provinceName'];?>
</option>
<?php
} # while
?>
</select></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">
<table width="723">
<tr>
<td width="66">ระหว่างวันที่</td>
<td width="226" align="left">
<script>DateInput('dateStart', true,'DD/MM/YYYY','<?=(isset($rs2["Date_start"]))?ymdT2dmyE($rs2["Date_start"]):date("d/m/Y");?>');</script>
</td>
<td width="69" align="right">ถึงวันที่</td>
<td width="191" align="left">
<script>DateInput('dateFinish', true,'DD/MM/YYYY','<?=(isset($rs2["Date_finish"]))?ymdT2dmyE($rs2["Date_finish"]):date("d/m/Y");?>');</script>
</td>
<td width="147">
มีกำหนด
<input name="Day" type="text" id="Day" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed; text-align:center" value="<?=$rs2['Day'];?>" size="2" maxlength="3" <?=(isset($rs2['Day']))?"readonly":"";?>/>
วัน
</td>
</tr>
</table></td>
</tr>
<tr height="31">
<td height="31" colspan="6"> เพื่อให้การเดินทางไปราชการครั้งนี้ สำเร็จตามวัตถุประสงค์ ข้าพเจ้าจึงขออนุมัติยืมเงินจาก
<label><select name="MoneyS_C" id="MoneyS_C" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" >
<?php
$query = " SELECT * FROM money_source_tb ";
$result5 = mysql_query($query);
while($rs5 = mysql_fetch_array($result5)){
?>
<option value="<?=$rs5['MoneyS_C'];?>" <?=($rs5['MoneyS_C']==$rs2['MoneyS_C'] )?"selected":"";?>>
<?=$rs5['MoneyS_M'];?>
</option>
<?php
} # while
?>
</select>
</label></td>
</tr>
<tr height="31">
<td height="31" colspan="6" nowrap>จำนวนเงิน
<input name="Budget" type="text" id="Budget" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed; text-align:center" value="<?=$rs2["Budget"];?>" size="20" />
บาท จำนวนเงินตัวอักษร
(
<input name="#" type="text" id="#" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed; text-align:center" value="<? echo convertNumberToString($rs2['Budget']).'ถ้วน';?>" size="40" />
)</td>
</tr>
<tr height="31">
<td height="31" colspan="3" align="left">เพื่อเป็นค่าใช้จ่ายในการเดินทางไปราชการในครั้งนี้</td>
<td colspan="2"> </td>
<td> </td>
</tr>
<tr height="31">
<td height="31" colspan="5" align="left"> จึงเรียนมาเพื่อทราบและโปรดพิจารณาอนุมัติ</td>
<td> </td>
</tr>
<tr height="31">
<td height="31" colspan="3" align="left"> </td>
<td colspan="2"> </td>
<td> </td>
</tr>
<tr height="31">
<td height="31" colspan="3" align="left"> </td>
<td colspan="2" align="center">ลงชื่อ .......................................ผู้ยืมเงิน</td>
<td> </td>
</tr>
<tr height="29">
<td height="29" colspan="3"> </td>
<td colspan="2" align="center">
( <?=$rs1["prefixName"]." ".$rs1["Teacher_name"]." ".$rs1["Teacher_lastname"];?> )
<input name="Faculty_code" type="hidden" id="Faculty_code" value="<? echo $rs1["Faculty_code"]?>"/>
</td>
<td> </td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left"> </td>
<td colspan="2" align="center">
ตำแหน่ง<input name="Name5" type="text" id="Name5" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: none; text-align:center" size="25" value="<?=$rs1["Position_name"];?>"/>
</td>
<td> </td>
</tr>
<tr height="29">
<td colspan="5"> <!--<div align="right">*
<select name="Teacher_code" id="Teacher_code" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" >
<?php
$query = " SELECT * FROM personal_tb LEFT JOIN prefix ON personal_tb.prefixId = prefix.prefixId Where StatusId = '1' Or Teacher_name= 'พขร' Order By Teacher_name ASC";
$result = mysql_query($query);
while($rs4 = mysql_fetch_array($result)){
?>
<option value="<?=$rs4['Teacher_code'];?>" <?=($rs4['Teacher_code']==$rs1['Teacher_code'])?"selected":"";?>>
<?=$rs4['prefixName']." ".$rs4['Teacher_name']." ".$rs4['Teacher_lastname'];?>
</option>
<?php
} # while
?>
</select></div>-->
</td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="center">ลงชื่อ..................................หัวหน้าภาค/ฝ่าย</td>
<td colspan="3" align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="center">
( <?=$rs3['prefixName']." ".$rs3['Teacher_name']." ".$rs3['Teacher_lastname'];?> )
<input name="TeacherId" type="hidden" id="TeacherId" value="<?=$rs3["TeacherId"]?>"/>
</td>
<td align="left"> </td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="center">
ตำแหน่ง<input name="Name6" type="text" id="Name6" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: none; text-align:center" size="25" value="<?=$rs3["Position_name"];?>"/>
</td>
<td align="left"> </td>
<td colspan="2" align="left"> </td>
</tr>
<tr height="29">
<td height="28" colspan="2" align="left"> </td>
<td align="left"> </td>
<td colspan="2" align="left"> </td>
</tr>
<tr height="29">
<td height="28" colspan="2" align="left"> </td>
<td align="left"> </td>
<td colspan="2" align="center">ลงชื่อ.............................................</td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="left"> </td>
<td align="left"> </td>
<td colspan="2" align="center"> วันที่........เดือน.............พ.ศ........</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="16" align="center"> </td>
</tr>
<tr>
<td height="16" align="center">
</td>
</tr>
<tr>
<td align="center">
<input name="contId" type="hidden" id="contId" value="<?=$_REQUEST["contId"];?>"/>
<input type="hidden" name="Teacher_code" value="<?=$_REQUEST["Teacher_code"];?>"/>
<input type="hidden" name="Training_code" value="<?=$_REQUEST["Training_code"];?>"/>
<span id="submitBtn">
<input type="submit" name="Submit" value="บันทึก" style="cursor:pointer" class="WIDTH60 CURSOR-HAND" />
</span>
<input type="reset" name="Reset" value="รีเซ็ต" style="cursor:pointer" class="WIDTH60 CURSOR-HAND"/>
<input type="button" name="Button" value="ยกเลิก" style="cursor:pointer" class="WIDTH60 CURSOR-HAND" onclick="location.href='AddFormContract.php?Teacher_code=<?=$_REQUEST["Teacher_code"];?>'"/>
</td>
</tr>
</table>
</form>
</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);
?>
|