Viewing file: Person_Cost.php (11.62 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("../link/function.php");
/** Create Database Object */
$dbObj = new DBConn;
/** Config Table for This Page */
$myTable = "personal_tb";
$myTable1 = "budget_year_tb";
$myTable2 ="durable_type_tb";
/*----- personal_tb--------*/
$query = "SELECT *, prefixName as First_name 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 LEFT JOIN formagree ON formagree.Teacher_code = personal_tb.Teacher_code WHERE personal_tb.Teacher_code = '".$_REQUEST["Teacher_code"]." ' ";
$result = $dbObj->execQuery($query);
$rss = $dbObj->fetchArray($result);
$query = "SELECT *, prefixName as First_name 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 LEFT JOIN training_tb ON personal_tb.Teacher_code = training_tb.Teacher_code LEFT JOIN formaoffice ON training_tb.Teacher_code = formaoffice.Teacher_code LEFT JOIN formofficemoney ON formaoffice.codeId = formofficemoney.codeId WHERE formofficemoney.Teacher_code = '".$_REQUEST["Teacher_code"]." ' and training_tb.Training_code = '".$_REQUEST["Training_code"]." ' and formofficemoney.codeId = '".$_REQUEST["codeId"]." ' and formaoffice.maNo = '".$_REQUEST["maNo"]." ' ";
$result5 = $dbObj->execQuery($query);
$rs = $dbObj->fetchArray($result5);
$query7 = "SELECT * FROM formaoffice WHERE maNo = '$maNo' AND Flag = '$Flag'";
$result7 = $dbObj->execQuery($query7);
$rs7 = $dbObj->fetchArray($result7);
$sql8 = " SELECT * FROM formaoffice f LEFT JOIN personal_tb p ON f.Teacher_code=p.Teacher_code LEFT JOIN prefix ON p.First_name=prefix .prefixId LEFT JOIN position_tb pt ON p.PositionId=pt.PositionId WHERE NOT f.codeId IN ( SELECT codeId FROM form_costestimates) AND maNo = '$maNo' ";
$query8 = mysql_query($sql8);
$rs8 = mysql_fetch_array($query8);
} # 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=windows-874" />
<title><?=$_Config_sitename;?></title>
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/utilities.js"></script>
<script language="javascript" src="../js/ajaxScript.js"></script>
<script type="text/javascript" src="../js/calendarDateInput2.js"></script>
<script language="javascript">
function checkData() {
var formObj = document.pc;
if( (formObj.Time_start.value == "" ) && (formObj.Time_finish.value == "" ) ) { alert("กรุณากรอกข้อมูลให้ครบด้วยค่ะ" ); formObj.SMDay.style.backgroundColor='#F1F9FC'; formObj.STDay.focus(); return false; }
if(formObj.Vehicletotal.value == "" ) { alert("กรุณากรอก "); formObj.Vehicletotal.style.backgroundColor='#F1F9FC'; formObj.Vehicletotal.focus(); return false;}
if(formObj.STtotal.value == "" ) { alert("กรุณากรอก "); formObj.STtotal.style.backgroundColor='#F1F9FC'; formObj.STtotal.focus(); return false;}
if(formObj.Smtotal.value == "" ) { alert("กรุณากรอก "); formObj.Smtotal.style.backgroundColor='#F1F9FC'; formObj.Smtotal.focus(); return false;}
else return true ;
}
</script></head>
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0">
<?php
include("../templates/incHeader.php");
?>
<table width="1001" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="198" align="left" valign="top" style="padding:10px 0px 0px 5px"><?php include("./_incMainMenu.php");?></td>
<td width="803" height="440" align="center" valign="top" style="padding:10px 0px 5px 10px"><fieldset>
<table width="791" border="0" cellspacing="0" cellpadding="0">
<form id="pc" name="pc" method="post" action="InsertPerson_Cost.php?Teacher_code=<?=$rs8['Teacher_code'];?>&Training_code =<?=$rs8['Training_code'];?>&codeId=<?=$rs8['codeId'];?>'" onSubmit="return checkData();">
<tr>
<td width="791"> </td>
</tr>
<tr>
<td height="30" background="../images/background/bg-head-topic-w780.gif" class="PADDING-LEFT-10"><strong><a href="index.php">หน้าหลัก</a> » <a href="Menu_Form.php?Teacher_code=<?=$Teacher_code;?>">แบบฟอร์มราชการ</a> » เพิ่มผู้ร่วมเดินทางและประมาณการค่าใช้จ่ายในการเดินทางไปราชการ</strong></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="center"><table width="788" border="0" cellpadding="0" cellspacing="3">
<tr height="29">
<td height="16" colspan="4" align="center" l> </td>
</tr>
<tr height="29">
<td height="16" colspan="4" align="center" l><strong>เพิ่มผู้ร่วมเดินทางและประมาณการค่าใช้จ่ายในการเดินทางไปราชการ</strong></td>
</tr>
<tr height="29">
<td height="16" colspan="4" l> </td>
</tr>
<td width="243" height="23" align="left"> </td>
<td width="218" height="23" align="right">เลขที่สัญญา</td>
<td height="23" colspan="2" align="left"><input name="Noagree" type="text" disabled="disabled" id="Noagree" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$maNo?> " size="20" readonly="readonly" /></td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="right">วันที่</td>
<td width="315"><script>DateInput('mDate', true,'DD/MM/YYYY','<?=(isset($rs7["Date"]))?ymdT2dmyE($rs7["Date"]):date("d/m/Y");?>');</script></td>
<td width="1"></td>
</tr>
<tr height="29">
<td height="16" colspan="4">ยื่นต่อ ผู้อำนวยการ
<?php
$collegeCode = $rss["collegeCode"];
$sql = "Select * From college Where collegeStatus ='1'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[collegeName] ";
?></td>
</tr>
<tr height="29">
<td height="29" colspan="4"> ข้าพเจ้า
<input name="Name6" type="text" id="Name6" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="30" value="<?=$rs8['prefixName']?> <?=$rs8['Teacher_name']?> <?=$rs8['Teacher_lastname']?>" readonly="readonly" />
ตำแหน่ง
<input name="Name7" type="text" id="Name7" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="30" value="<?=$rs8['Position_name']?>" readonly="readonly"/></td>
</tr>
<tr height="29">
<td height="29" colspan="4" align="left">
สังกัด
<?php
$collegeCode = $rss["collegeCode"];
$sql = "Select * From college Where collegeStatus ='1'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[collegeName] ";
?></td>
</tr>
<tr height="29">
<td height="29" colspan="4" align="left">ค่าใช้จ่ายในการเดินทางไปประชุมเรื่อง
<input name="Training_name" type="text" id="Training_name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rs7['Training_name'];?>" size="80" />
</td>
</tr>
<tr height="29">
<td height="26" colspan="4" align="left"><table width="659" height="17" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td width="413">๑. ค่าเบี้ยเลี้ยงเดินทาง </td>
<td width="79" align="center"> </td>
<td width="147" align="center">รวม
<input name="Smtotal" type="text" id="Smtotal" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" onkeypress="return checkNumeric();" value="" size="10" />
บาท</td>
</tr>
<tr>
<td>๒. ค่าเช่าที่พักประเภท</td>
<td align="center"> </td>
<td align="center">รวม
<input name="STtotal" type="text" id="STtotal" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" onkeypress="return checkNumeric();" value="" size="10" />
บาท</td>
</tr>
<tr>
<td colspan="2">๓. ค่าพาหนะ </td>
<td align="center">รวม
<input name="Vehicletotal" type="text" id="Vehicletotal" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" onkeypress="return checkNumeric();" value="" size="10" />
บาท</td>
</tr>
<tr>
<td colspan="2">๔. ค่าใช้จ่ายอื่น </td>
<td align="center">รวม
<input name="Crgestotal" type="text" id="Crgestotal" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" onkeypress="return checkNumeric();" value="" size="10" />
บาท</td>
</tr>
</table></td>
</tr>
<tr height="29">
<td height="29" colspan="4" align="left"> </td>
</tr>
</table>
<input type="submit" name="Submit" value="บันทึก" class="WIDTH60 CURSOR-HAND" />
<input name="Reset" type="reset" class="WIDTH60 CURSOR-HAND" id="Reset" value="รีเซ็ต" />
<input name="Button" type="button" id="Reset" value="ยกเลิก" class="CURSOR-HAND WIDTH60" onclick="location.href='CostEstimatesList.php?Teacher_code<?=$Teacher_code;?>'" />
<input name="Teacher_code" type="hidden" id="Teacher_code" value="<?=$rs8['Teacher_code'];?>" />
<input name="Training_code" type="hidden" id="Training_code" value="<?=$rs8['Training_code'];?>" />
<input name="codeId" type="hidden" id="codeId" value="<?=$rs8['codeId'];?>" />
<input name="maNo" type="hidden" id="maNo" value="<?=$maNo;?>" /></td>
</tr>
<tr>
<td> </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);
?>
|