Viewing file: FrmeditPlan.php (14.96 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( "../includes/Function.php" );
require_once( "../includes/FunctionDB.php" );
/** Create Database Object */
$dbObj = new DBConn;
$Username = $valid_user;
/** Config Table for This Page */
$myTable = "project_tb";
//$myTable2 = "faculty_tb";
//=== salary_repot_tb
$query = " SELECT * FROM $myTable WHERE codeId='$codeId' ";
$result = $dbObj->execQuery($query);
$rs = $dbObj->fetchArray($result);
} # 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" />
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/utilities.js"></script>
<title>ข้อมูลแผนดำเนินงานและรายงาน : ข้อมูลแผนดำเนินการ รายปีงบประมาณ - เพิ่มข้อมูลแผน/โครงการรดำเนินงาน (ย่อย)</title>
<style type="text/css">
<!--
.style1 { font-size: 14px;
font-family: Tahoma;
}
.style5 {font-size: 14px; color: #FF0000; font-family: Tahoma;}
.style5 {font-size: 14px; color: #FF0000; font-family: Tahoma;}
.style6 {font-size: 14px; font-family: Tahoma; }
.style11 {font-size: 14px;
font-family: Tahoma;
}
-->
</style>
</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" 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="EditStdPlanIn.php" onSubmit="return checkData();">
<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="SearchPlanList.php?ProjectId=<? echo $rs['ProjectId']?>&Project_code=<? echo $rs['Project_code']?>&Faculty_code=<? echo $rs['Faculty_code']?>&Budget_Year=<? echo $rs['Budget_Year']?>">แสดงการแก้ไขกิจกรรม/โครงการ</a> » <a href="DetailRepPlaning.php?ProjectId=<?php echo $rs['ProjectId']; ?>&Orderlist=<?php echo $rs['Orderlist']; ?>&Project_code=<?php echo $rs['Project_code']; ?>&Faculty_code=<?=$rs['Faculty_code'];?>&Budget_Year=<?php echo $rs['Budget_Year']; ?>">รายงานการใช้เงินตามข้อย่อยแผน</a> » <span class="NOTE">แก้ไขข้อมูลการใช้เงินตามกิจกรรม/โครงการ</span></strong></td>
</tr>
<tr>
<td><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="50%" class="PADDING-TOP-10 PADDING-BOTTOM-10"><img src="../images/icons/arrow-circle-225-left.png" width="16" height="16" border="0" align="absmiddle" /> <a href="javascript:;" onclick="window.history.back();"><strong>‹ ย้อนกลับ</strong></a></td>
<td width="50%" align="right" valign="bottom" class="PADDING-TOP-10 PADDING-BOTTOM-5"><span class="TEXT-ORANGE9"> </span></td>
</tr>
</table></td>
</tr>
<tr>
<td height="173" align="center" valign="top"><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" style=" border:0px solid gray"size="12">
<tr>
<td height="29" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td height="43" ><table width="98%" border="0" align="center" cellpadding="0" cellspacing="3" bgcolor="#E0E0E0">
<tr bgcolor="#EEEEEE">
<td align="right" bgcolor="#FFFFFF">เลขที่เอกสาร</td>
<td bordercolor="#006699" bgcolor="#FFFFFF"> </td>
<td bordercolor="#006699" bgcolor="#FFFFFF"><?=htmlspecialchars_decode( nl2br( $rs['ProjectNo'] ) );?></td>
</tr>
<tr bgcolor="#EEEEEE">
<td width="23%" align="right" bgcolor="#FFFFFF"><font color="#000066" face="Tahoma">รายละเอียดของแผนดำเนินกา</font>ร</td>
<td width="2%" bordercolor="#006699" bgcolor="#FFFFFF"><font color="#FF0000" size="4" face="Tahoma"><strong>*</strong></font></td>
<td width="75%" bordercolor="#006699" bgcolor="#FFFFFF">
<?=htmlspecialchars_decode( nl2br( $rs['Training_name'] ) );?>
</a></td>
</tr>
<tr bgcolor="#EEEEEE">
<td align="right" bgcolor="#FFFFFF"><span style="padding-top:10px;">ผู้ใช้เงิน</span></td>
<td bordercolor="#006699" bgcolor="#FFFFFF"> </td>
<td bordercolor="#006699" bgcolor="#FFFFFF"><span style="padding-top:15px;"><span class="PADDING-LEFT-3">
<?php
//$MoneyS_C = $rs['MoneyS_C'];
$sql3 = " Select * From personal_tb Where Teacher_code='$rs[Teacher_code]' ";
$result3 = $dbObj->execQuery($sql3);
$rs3 = $dbObj->fetchArray($result3); ?>
<? echo $rs3['First_name']; ?>
<? echo $rs3['Teacher_name']; ?>
<? echo $rs3['Teacher_lastname'];
?>
<input name="Teacher_code" type="hidden" id="Teacher_code" value="<? echo $rs3['Teacher_code'];?>" />
</span></span></td>
</tr>
<tr bgcolor="#EEEEEE">
<td align="right" bgcolor="#FFFFFF"><font color="#003366" face="Tahoma">หมวดเงิน</font></td>
<td bordercolor="#006699" bgcolor="#FFFFFF"> </td>
<td bordercolor="#006699" bgcolor="#FFFFFF"><select name="MoneyS_C" id="MoneyS_C">
<?php
$MoneyS_C = $rs[MoneyS_C];
$strSQL1 = "SELECT * FROM money_source_tb Where MoneyS_C='$MoneyS_C' ";
$result1 = mysql_query($strSQL1);
$strSQL2 = "SELECT * FROM money_source_tb Order By MoneyS_C ";
$result2 = mysql_query($strSQL2);
while( $rs1 = mysql_fetch_array($result1))
{
echo"<option value=\"$rs1[MoneyS_C]\" ><b>$rs1[MoneyS_M]</b></option>\n";
while( $rs2 = mysql_fetch_array($result2))
{
echo"<option value=\"$rs2[MoneyS_C]\" ><b>$rs2[MoneyS_M]</b></option>\n";
}
}
?>
</select></td>
</tr>
<tr bgcolor="#EEEEEE">
<td align="right" bgcolor="#FFFFFF"><font color="#003366" face="Tahoma">ประเภทหมวดค่าใช้จ่าย</font></td>
<td bordercolor="#006699" bgcolor="#FFFFFF"> </td>
<td bordercolor="#006699" bgcolor="#FFFFFF"><select name="MoneyId" id="MoneyId">
<?php
$MoneyId = $rs[MoneyId];
$strSQL2 = "SELECT * FROM money_tb Where MoneyId='$MoneyId' ";
$result2= mysql_query($strSQL2);
$strSQL3 = "SELECT * FROM money_tb Order By MoneyId ";
$result3= mysql_query($strSQL3);
while( $rs2 = mysql_fetch_array($result2))
{
echo"<option value=\"$rs2[MoneyId]\" ><b>$rs2[MoneyName]</b></option>\n";
while( $rs3= mysql_fetch_array($result3))
{
echo"<option value=\"$rs3[MoneyId]\" ><b>$rs3[MoneyName]</b></option>\n";
}
}
CloseDB();
?>
</select></td>
</tr>
<tr bgcolor="#eeeeee">
<td align="right" bordercolor="#99CC99" bgcolor="#FFFFFF"><span class="style6"><font color="#000066" face="Tahoma">วัน/เดือน/ปี
(ที่</font><font face="Tahoma">ดำเนินการ</font><font color="#000066" face="Tahoma">)</font></span></td>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF"> </td>
<td bordercolor="#CCCCCC" bgcolor="#FFFFFF">วัน<font color="#000000" size="2" face="Tahoma">
<select name="mDate" class="select" id="mDate" >
<?php
$Date = $rs[Date];
$yearthai = explode("-",$Date);
$mDate = intval($yearthai[2]);
$mMonth = intval($yearthai[1]);
$mYear = intval($yearthai[0]);
for($i=0;$i<=31;$i++)
{
if( $i == 0)
echo"\n\t<option value=\"$mDate\" selected>$mDate</option>\n ";
else
echo"\n\t<option value=\"$i\">$i</option>\n ";
}
?>
</select>
</font>-<font color="#000000" size="2" face="Tahoma">
<select name="mMonth" class="select" id="mMonth" >
<?php
$Date= $rs[Date];
$yearthai = explode("-",$Date);
$mDate= intval($yearthai[2]);
$Month = intval($yearthai[1]);
$mYear = intval($yearthai[0]);
$mMonth = $Month;
$CMonth = TxtThaiMonth($Month);
for($i=-1;$i<=11;$i++)
{
$a = $i+1;
if( $a == 0)
echo"\n\t<option value=\"$mMonth\" selected>$CMonth</option>\n ";
else
echo"\n\t<option value=\"$a\">$ThaiMonth[$i]</option>\n ";
}
// getThaiMonth();
?>
</select>
</font><font color="#000000" face="Tahoma">-</font><font color="#000000" size="2" face="Tahoma">
<input name="mYear" type="text" class="style6" id="mYear" value="<? echo $mYear ?>" size="3" maxlength="4" />
</font></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="22" colspan="3" align="left" bgcolor="#FFFFFF"><span style="padding-left:103px"><font face="Tahoma">จำนวนเงินทั้งหมดที่ใช้ตามแผน</font>
<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
$sql = " SELECT SUM(Spending_use) AS SumB1 FROM project_tb WHERE ProjectId='$rs[ProjectId]' " ;
$result11 = mysql_query($sql);
$rs11 = mysql_fetch_array($result11);
echo number_format($rs11['SumB1'],2,'.',','); ?> " size="10" />
บาท</font></span></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="22" colspan="3" align="left" bgcolor="#FFFFFF"><span style="padding-left:103px"><font face="Tahoma">จำนวนเงินทั้งหมดที่ตั้งไว้ตามแผน</font>
<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="<?php
$sql = " SELECT * FROM project_type_tb WHERE ProjectId='$rs[ProjectId]' " ;
$result22 = mysql_query($sql);
$rs22 = mysql_fetch_array($result22);
echo number_format($rs22['Budget_use'],2,'.',',');
?> " size="10" />
บาท </font></span></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="22" colspan="3" align="left" bgcolor="#FFFFFF"><span style="padding-left:103px"><font face="Tahoma">คงเหลือเงินทั้งหมดตามแผน</font>
<input name="Budget_use3" type="text" id="Budget_use5" 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" />
บาท </font></font></span></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="22" align="right" bgcolor="#FFFFFF">จำนวนเงินที่ขอใช้ตามแผน</a></td>
<td bordercolor="#006699" bgcolor="#FFFFFF"> </td>
<td align="left" bordercolor="#006699" bgcolor="#FFFFFF"><input name="Spending_use" type="hidden" id="Spending_use" value="<? echo $rs['Spending_use']?>" />
<? echo $rs['Spending_use']?> บาท </a></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="22" align="right" bgcolor="#FFFFFF">จำนวนเงินที่ใช้จริงตามแผน</a></td>
<td bordercolor="#006699" bgcolor="#FFFFFF"><strong>*</strong></a></td>
<td align="left" bordercolor="#006699" bgcolor="#FFFFFF">
<input name="Budget_use" type="text" id="Budget_use" value="<? echo $rs['Budget_use']?>" size="10" />
</a></strong>บาท </a>*ไม่ต้องพิมพ์เครื่องหมาย comma (,)</a>
</td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="22" align="right" bgcolor="#FFFFFF">ส่วนต่าง(คืนเงิน/เบิกเพิ่ม)</a></td>
<td bordercolor="#006699" bgcolor="#FFFFFF"> </td>
<td align="left" bordercolor="#006699" bgcolor="#FFFFFF"><? $Sum = $rs[Spending_use] - $rs[Budget_use] ;
echo number_format($Sum,2,'.',','); ?> บาท </a></td>
</tr>
<tr bgcolor="#EEEEEE">
<td height="22" align="right" bgcolor="#FFFFFF"><span class="style5">สถานะการดำเนินการ</span></td>
<td bordercolor="#006699" bgcolor="#FFFFFF"> </td>
<td align="left" bordercolor="#006699" bgcolor="#FFFFFF"><input name="Flag" type="checkbox" id="Flag" value="Y" <?php if ( !strcmp("$rs[Flag]","Y") ) { echo "checked"; } ?> /></td>
</tr>
<tr bgcolor="#ECD9C6">
<td height="32" colspan="3" bgcolor="#FFFFFF"><div align="center">
<input name="codeId" type="hidden" id="codeId" value="<?=$codeId;?>" />
<input name="Submit" type="submit" id="Submit" value=" บันทึกข้อมูล" />
</div></td>
</tr>
</table></td>
</tr>
</table></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);
?>
|