Viewing file: ExFormAPerson.php (19.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;
/** Config Table for This Page */
$myTable1 = "personal_tb";
$myTable2 = "formaoffice";
$myTable3 = "project_tb";
$myTable4 = "training_tb";
/** Table --> personal_tb */
$query = " SELECT * FROM $myTable1 WHERE Teacher_code='$Teacher_code' ";
$result = $dbObj->execQuery($query);
$rss = $dbObj->fetchArray($result);
$Teacher_code = $rss['Teacher_code'];
/** Table --> tech_plan_tb */
$query1 = " SELECT * FROM $myTable2 WHERE codeId='$codeId' ";
$result1 = $dbObj->execQuery($query1);
$rs1 = $dbObj->fetchArray($result1);
/** Table --> techplan_method_tb */
$query2 = " SELECT * FROM $myTable3 WHERE codeId='$codeId' ";
$result2 = $dbObj->execQuery($query2);
$rs2 = $dbObj->fetchArray($result2);
/** Table --> tech_spec_tb */
$query3 = " SELECT * FROM $myTable4 WHERE Training_code='$Training_code' ";
$result3 = $dbObj->execQuery($query3);
$rs3 = $dbObj->fetchArray($result3);
} # else
?>
<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>
<style type="text/css">
<!--
.style1 {
font-size: 14px;
font-family: Tahoma;
}
.style2 {
font-size: 14px;
font-weight: bold;
font-family: Tahoma;
}
.style5 {font-size: 14px; font-family: Tahoma; color: #FF0000; }
.style7 {font-size: 14px}
.style11 {font-size: 14px; color: #000000; }
.style12 {color: #000000}
.style21 {font-size: 14px}
-->
</style>
<title>บันทึกการขอไปราชการ</title><table width="727" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="727">
<table width="698" align="center" cellpadding="0" cellspacing="0">
<tr height="31">
<td colspan="2" rowspan="2" class="PATRON11"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><span class="style21"><img src="../picture/krud.jpg" width="87" height="86" border="0" align="absmiddle" /></span></font></td>
<td height="31" colspan="3" class="PATRON11"> บันทึกข้อความ</td>
<td height="31" align="center" class="PATRON11">MIS1001</td>
</tr>
<tr height="31">
<td height="31" align="center" class="PATRON11"> </td>
<td height="31" align="center" class="PATRON11"> </td>
<td height="31" align="center" class="PATRON11"> </td>
<td height="31" align="center" class="PATRON11"> </td>
</tr>
<tr height="29">
<td height="29" colspan="6" l="l">ส่วนราชการ</a>
<?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] ";
?>
</a></td>
</tr>
<tr>
<td height="29" colspan="2" align="left">ที่ </a>
<input type="text" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? echo $rs1['maNo'];?>" size="15" />
</font></td>
<td width="151" height="29" align="left"> </td>
<td height="29" align="left"> </td>
<td height="29" colspan="2" align="left"><font color="#000000" size="2" face="Tahoma">วันที่
</a>
<input name="Date" type="text" id="Date" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="10" value=" <?php
$sday = $rs1[Date];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>" />
</a></td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left">เรื่อง </a>
<input name="Detail" type="text" id="Detail" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="ขออนุมัติเดินทางไปราชการ" size="20" />
</a></td>
<td width="35"></td>
<td width="220"></td>
<td width="105"></td>
</tr>
<tr height="29">
<td height="29" colspan="5" align="left">เรียน ผู้อำนวยการ </a>
<?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] ";
?>
</a></td>
<td></td>
</tr>
<tr height="29">
<td width="128" height="24"></td>
<td colspan="5" align="left">ข้าพเจ้า</a>
<input name="Name" type="text" id="Name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="30" value="<? echo $rss[First_name]?> <? echo $rss[Teacher_name]?> <? echo $rss[Teacher_lastname]?> " />
</a> ตำแหน่ง</a>
<input name="Name4" type="text" id="Name4" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="30" value=" <? $PositionId = $rss["PositionId"];
$sql = "Select * From position_tb Where PositionId ='$PositionId' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[Position_name] ";?>
" />
</a></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">สังกัด</a>
<input name="Name2" type="text" id="Name2" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="30" value="<?php $Faculty_code = $rss["Faculty_code"];
$sql = "Select * From faculty_tb Where Faculty_code='$Faculty_code'";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[Faculty_name] "; ?>" />
</a>
<input name="Name3" type="text" id="Name3" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="40" value="<?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] "; ?> " />
</a>สถาบันพระบรมราชชนก</a></td>
</tr>
<tr height="29">
<td height="16" colspan="6">พร้อมด้วยผู้ร่วมเดินทาง</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><table width="92%" height="43" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" style="background-color:#eeeeee; border:0px solid gray">
<td height="20" align="center"class="BORDER">รายชื่อ</a></td>
<td align="center"class="BORDER">ข้อแผน</a></td>
<td align="center"class="BORDER">จำนวนเงินที่ขอใช้</a></td>
<td align="center"class="BORDER">จำนวนเงินทั้งหมดที่<br />ใช้ตามข้อแผน</a></td>
</tr>
<?php
$query = " SELECT * FROM $myTable2 Where maNo ='$rs1[maNo]' ";
$result2 = $dbObj->execQuery($query);
$numrows = $dbObj->_numrows;
?>
<?php
$no = 1+($display-1)*$limit;
while( $rs5 = $dbObj->fetchArray($result2) ) {
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
?>
<tr bgcolor="<?=$bgColor;?>">
<td width="48%" height="20" align="left">
<?php
$Teacher_code = $rs5["Teacher_code"];
$sql = "Select * From $myTable1 Where Teacher_code ='$Teacher_code' ";
$result6 = mysql_query($sql) or die("Error".mysql_error());
$rs6 = mysql_fetch_array($result6);
echo "$rs6[First_name] $rs6[Teacher_name] $rs6[Teacher_lastname]";?> </a></td>
<td width="10%" align="center">
<?php
// $sql = "Select * From project_tb Where ProjectId='$row[ProjectId]' AND Teacher_code='$row[Teacher_code]' ";
// $result2 = mysql_query($sql) or die("Error".mysql_error());
// $rs2 = mysql_fetch_array($result2);
// echo "$rs2[Orderlist]";
echo "$rs5[Orderlist]";
?>
</a></td>
<td width="21%" align="center">
<?php
//$sql3 = " SELECT SUM(Budget_use) AS SumB1 FROM project_tb WHERE ProjectId='$row[ProjectId]' And Teacher_code='$row[Teacher_code]' ";
//$result3 = $dbObj->execQuery($sql3);
//$rs3 = $dbObj->fetchArray($result3);
// echo number_format($rs3['SumB1'],2,'.',',');
echo number_format($rs5['Budget_use'],2,'.',',');
?>
</a></td>
<td width="21%" align="center"><?php
$sql3 = " SELECT SUM(Budget_use) AS SumB1 FROM project_tb WHERE ProjectId='$rs5[ProjectId]' And Teacher_code='$rs5[Teacher_code]' ";
$result3 = $dbObj->execQuery($sql3);
$rs3 = $dbObj->fetchArray($result3);
echo number_format($rs3['SumB1'],2,'.',',');
//echo number_format($rs5['Budget_use'],2,'.',',');
?></td>
</tr>
<?php
//$no++;
} # while
?>
</table></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">ขออนุมัติเดินทางไปราชการ เรื่อง</a> </a><? echo $rs1['Training_name'];?>
</a></td>
</tr>
<tr height="29">
<td height="26" colspan="6" align="left">ณ สถานที่ </a><? echo $rs3['CNEU'];?></a></td>
</tr>
<tr height="29">
<td height="26" colspan="6" align="left">เดินทางโดย </a>
<input type="radio" name="Travel" <?php if (!(strcmp("$rs1[Travel]","1"))){echo "checked";} ?> value="1" />
</a>โดยรถยนต์ของทางราชการ </a>
<input type="radio" name="Travel" <?php if (!(strcmp("$rs1[Travel]","2"))){echo "checked";} ?> value="2" />
</a> รถยนต์ปรับอากาศ </a>
<input type="radio" name="Travel" <?php if (!(strcmp("$rs1[Travel]","3"))){echo "checked";} ?> value="3" />
</a>รถไฟ </a>
<input type="radio" name="Travel" <?php if (!(strcmp("$rs1[Travel]","4"))){echo "checked";} ?> value="4" />
</a>เครื่องบิน </a>
<input type="radio" name="Travel" <?php if (!(strcmp("$rs1[Travel]","5"))){echo "checked";} ?> value="5" />
</a>รถยนต์ส่วนตัว </a> </a></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><label>อ้างตามหนังสือราชการเลขที่</label>
</a>
<?php
// $ProjectId = $rs1["ProjectId"];
// $sql = "Select * From project_tb Where ProjectId='$ProjectId' ";
// $result2 = mysql_query($sql) or die("Error".mysql_error());
// $rs2 = mysql_fetch_array($result2);
//echo "$rs2[Orderlist]";
?>
</a>
<input name="No_in" type="text" id="No_in" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? echo $rs1[No_in];?>" size="35" />
<input name="Status" type="text" id="Status" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<? echo $rs1[Status];?>" size="40" />
</a></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">กำหนดวันเดินทางในวันที่ </a>
<input name="Date_start" type="text" id="Date_start" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="10" value=" <?php
$sday = $rs1[Date_start];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>" />
</a> และ จะกลับวันที่ </a>
<input name="Date_finish" type="text" id="Date_finish" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="10" value=" <?php
$sday = $rs1[Date_finish];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>" />
</a>มีกำหนด</a>
<input name="Day" type="text" id="Day" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rs1['Day'];?>" size="2" />
</a>วัน โดยขอเบิกค่าใช้จ่ายใน</td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">การเดินทางไปราชการและในระหว่างเดินทางไปราชการข้าพเจ้าขอมอบหมายในหน้าที่ </a>
<input name="assignMent" type="text" id="assignMent" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?php echo $rs1[assignMent];?>" size="30" />
</a></td>
</tr>
<tr height="29">
<td height="35" colspan="6" align="left"> ให้ </a>
<input name="assignmentName" type="text" id="assignmentName" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="25"value="<?php echo $rs1[assignmentName];?> " />
</a> เป็นผู้ปฏิบัติงานแทน </td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"> จึงเรียนมาเพื่อโปรดอนุมัติด้วย จะเป็นพระคุณ</td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left"> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr height="31">
<td height="31" colspan="2" align="left"> </td>
<td> </td>
<td colspan="2" align="center">ลงชื่อ ....................................</td>
<td></td>
</tr>
<tr height="29">
<td height="29"> </td>
<td width="57"> </td>
<td> </td>
<td colspan="2" align="center">(</a> <? echo $rss[First_name]?> <? echo $rss[Teacher_name]?> <? echo $rss[Teacher_lastname]?></a> ) </td>
<td></td>
</tr>
<tr height="29">
<td height="23" colspan="3" align="left"> </td>
<td colspan="2" align="center">ตำแหน่ง</a>
<input name="Name6" type="text" id="Name6" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="25" value=" <? $PositionId = $rss["PositionId"];
$sql = "Select * From position_tb Where PositionId ='$PositionId' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[Position_name] ";?>
" />
</a></td>
<td></td>
</tr>
<tr height="29">
<td height="16" colspan="2" align="left"> </td>
<td align="left"> </td>
<td colspan="3" align="left"> </td>
</tr>
<tr height="29">
<td height="18" colspan="3" align="center">ลงชื่อ..................................หัวหน้าภาค/ฝ่าย.</td>
<td colspan="3" align="left"> </td>
</tr>
<tr height="29">
<td height="18" colspan="3" align="center">(</a>
<?php
//$Teacher_code = $rss["TeacherId"];
$sql = "Select * From personal_tb Where Faculty_code ='$Faculty_code' and TeacherId='1' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[First_name]$rs2[Teacher_name] $rs2[Teacher_lastname]";
?>
</a>) </td>
<td colspan="2">ความเห็นและคำสั่งผู้อำนวยการ</td>
<td align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="center">ตำแหน่ง</a>
<input name="Name5" type="text" id="Name5" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="25" value=" <? $PositionId = $rs2["PositionId"];
$sql = "Select * From position_tb Where PositionId ='$PositionId' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result1);
echo "$rs2[Position_name] ";?>
" />
</a></td>
<td align="left"> </td>
<td align="left"><input name="Flag2" type="checkbox" id="Flag2" <?php if ( !strcmp($rs1["Flag2"],"อนุมัติ") ) { echo "checked"; } ?> value="1" disabled="disabled" />
อนมัติ
<input name="Flag2" type="checkbox" id="Flag2" <?php if ( !strcmp($rs1["Flag2"],"ไม่อนุมัติ") ) { echo "checked"; } ?> value="2" disabled="disabled" />
ไม่อนุมัติ</td>
<td align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="left"> </td>
<td align="left"> </td>
<td colspan="2" align="center">ลงชื่อ ....................................</td>
<td 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>
<td align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="left"> </td>
<td align="left"> </td>
<td colspan="2" align="left"> </td>
<td align="left"> </td>
</tr>
</table>
</td>
</tr>
</table>
|