Viewing file: DetailFormProject.php (16.15 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 = "formproject";
$myTable3 = "project_tb";
/** Table --> personal_tb */
$query = " SELECT *, prefixName as First_name FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId 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 proId='$proId' ";
$result1 = $dbObj->execQuery($query1);
$rs1 = $dbObj->fetchArray($result1);
/** Table --> techplan_method_tb */
$query2 = " SELECT * FROM $myTable3 WHERE proId='$proId' ";
$result2 = $dbObj->execQuery($query2);
$rs2 = $dbObj->fetchArray($result2);
} # 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="709" 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">MIS1005</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] ";
?>
</font></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['proNo'];?>" 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">วันที่
</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="35" /></a></td>
<td width="35"></td>
<td width="220"></td>
<td width="116"></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] ";
?>
</font></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="29" colspan="6" align="left">ขออนุมัติใช้เงินในโครงการ เรื่อง </a><? echo $rs1['Training_name'];?>
</a></td>
</tr>
<tr height="29">
<td height="26" colspan="6" align="left">อ้างตามแผนดำเนินการ ข้อที่</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>
*</a></a>
<input name="Budget_use3" type="text" id="Budget_use3" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value=" <?php echo $rs2[Orderlist];?>" size="4" />
</a> กิจกรรม/โครงการ </a><?php echo $rs2[Project_plan];?></a></td>
</tr>
<tr height="29">
<td height="26" colspan="6" align="left"><a>ปีงบประมาณ</a></a>
<input name="Budget_use2" type="text" id="Budget_use2" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rs1['Year_std'];?>" size="3" />
จำนวนเงิน </a></a></a>
<input name="Budget_use" type="text" id="Budget_use" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?php echo number_format($rs1['Budget_use'],2,'.',',');?>" size="10" />
บาท </a><span id="budgetOver"></span> </a> </a>หมวดเงิน
<?php
$ProjectId = $rs1["ProjectId"];
$sql = "Select * From project_tb Where ProjectId='$ProjectId' and proId='$proId' ";
$result2 = mysql_query($sql) or die("Error".mysql_error());
$rs2 = mysql_fetch_array($result2);
$sql = "Select * From money_source_tb Where MoneyS_C='$rs2[MoneyS_C]' ";
$result3 = mysql_query($sql) or die("Error".mysql_error());
$rs3 = mysql_fetch_array($result3);
echo "$rs3[MoneyS_M]";
?> </a></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">จำนวนเงินทั้งหมดที่ตั้งไว้ตามแผน</a>
<input name="Budget_use6" type="text" id="Budget_use6" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?php
$sql = " SELECT * FROM project_type_tb WHERE ProjectId='$rs1[ProjectId]' " ;
$result22 = mysql_query($sql);
$rs22 = mysql_fetch_array($result22);
echo number_format($rs22['Budget_use'],2,'.',',');
?> " size="10" />
บาท</a> จำนวนเงินทั้งหมดที่ใช้ตามแผน</a>
<input name="Budget_use5" type="text" id="Budget_use5" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?php
$sql = " SELECT SUM(Budget_use) AS SumB1 FROM project_tb WHERE ProjectId='$rs1[ProjectId]' " ;
$result11 = mysql_query($sql);
$rs11 = mysql_fetch_array($result11);
echo number_format($rs11['SumB1'],2,'.',','); ?> " size="10" />
บาท </a></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">คงเหลือเงินทั้งหมดตามแผน</a>
<input name="Budget_use" type="text" id="Budget_use" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?
$Sum3 = $rs22['Budget_use'] - $rs11['SumB1'] ;
echo number_format($Sum3,2,'.',','); ?> " size="10" />
บาท</span></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left"><a> จึงเรียนมาเพื่อโปรดอนุมัติด้วย จะเป็นพระคุณ</a></td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left"> </td>
<td></td>
<td></td>
<td></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">ตำแหน่ง
<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 *, prefixName as First_name FROM personal_tb LEFT JOIN prefix ON personal_tb.First_name = prefix.prefixId 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>
|