Viewing file: AddPlanIn.php (16.02 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" );
/** Create Database Object */
$dbObj = new DBConn;
$Username = $valid_user;
/** Config Table for This Page */
$myTable = "project_type_tb";
$myTable2 = "faculty_tb";
//=== salary_repot_tb
$query = " SELECT * FROM $myTable WHERE ProjectId='$ProjectId' AND Faculty_code='$Faculty_code' AND Budget_Year='$Budget_Year' ";
$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 type="text/javascript" src="../js/utilities.js"></script>
<script type="text/javascript" src="../js/ajaxScript.js"></script>
<script language="javascript">
function checkData() {
var formObj = document.myForm;
if( ( formObj.Training_name.value == "" ) && ( formObj.Ind.value == "" ) && ( formObj.Date_start.value == "" ) && ( formObj.Budget_use.value == "" ) ) { alert("กรุณากรอกข้อมูลให้ครบด้วยค่ะ" ); formObj.Training_name.style.backgroundColor='#F1F9FC'; formObj.Training_name.focus(); return false; }
else if( formObj.Date_start.value == "" ) { alert("กรุณากรอก วัน/เดือน/ปี ที่ดำเนินการ"); formObj.Date_start.style.backgroundColor='#F1F9FC'; formObj.Date_start.focus(); return false; }
else if( formObj.Budget_use.value == "" ) { alert("กรุณากรอก จำนวนเงินที่ใช้"); formObj.Budget_use.style.backgroundColor='#F1F9FC'; formObj.Budget_use.focus(); return false; }
else if( formObj.Training_name.value == "" ) { alert("กรุณากรอก รายละเอียดของแผนดำเนินการ"); formObj.Training_name.style.backgroundColor='#F1F9FC'; formObj.Training_name.focus(); return false; }
else return true ;
}
</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" 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="InsertPlaningIn.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="Menu_Report.php">ข้อมูลแผนดำเนินงาน</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">ขึ้นบรรทัดใหม่ ใน Text Area ใช้ Ship+Enter </span></td>
</tr>
</table></td>
</tr>
<tr>
<td height="350" align="center" valign="top"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" style="border:1px solid #F0F0F0">
<tr>
<td width="17%" height="25" align="right">รหัสหน่วยงาน</td>
<td width="1%"> </td>
<td width="82%" class="TEXT-DARK-BLUE10"><?php
$Faculty_code = $rs['Faculty_code'];
$query = " SELECT * FROM faculty_tb WHERE Faculty_code='$Faculty_code' ";
$result1 = $dbObj->execQuery($query);
$rs1 = $dbObj->fetchArray($result1);
echo "$rs1[Faculty_code] - $rs1[Faculty_name]";
?></td>
</tr>
<tr>
<td height="25" align="right">รหัสแผน</td>
<td> </td>
<td class="TEXT-DARK-BLUE10"><?php echo $rs['Orderlist']; ?></td>
</tr>
<tr>
<td height="25" align="right">ชื่อโครงการ/กิจกรรม</td>
<td> </td>
<td class="TEXT-DARK-BLUE10"><?php echo htmlspecialchars_decode( nl2br( $rs['Project_plan'] ) ); ?></td>
</tr>
<tr>
<td height="25" align="right">วัตถุประสงค์</td>
<td> </td>
<td class="TEXT-DARK-BLUE10"><?php echo htmlspecialchars_decode( nl2br( $rs['Orderlist_2'] ) ); ?></td>
</tr>
<tr>
<td align="right" valign="top" style="padding-top:3px;"><span class="TEXT-RED10"><sup>*</sup></span> รายละเอียดของ<br />
แผนดำเนินการ</td>
<td> </td>
<td style="padding-top:5px;"><textarea name="Training_name" cols="50" rows="3" class="input" id="Training_name" ></textarea> </td>
</tr>
<tr>
<td align="right">หมวดเงิน</td>
<td align="center"> </td>
<td height="25" align="left"><select name="MoneyS_C" id="MoneyS_C">
<?php
$MoneyS_C = $rs['MoneyS_C'];
$strSQL3 = " SELECT * FROM money_source_tb WHERE MoneyS_C='$MoneyS_C' ";
$result3 = $dbObj->execQuery($strSQL3);
$strSQL4 = " SELECT * FROM money_source_tb ORDER BY MoneyS_C ";
$result4 = $dbObj->execQuery($strSQL4);
while( $rs3 = $dbObj->fetchArray($result3) ) {
echo "<option value=\"$rs3[MoneyS_C]\">$rs3[MoneyS_M]</option>\n";
while( $rs4 = $dbObj->fetchArray($result4) ) {
echo "<option value=\"$rs4[MoneyS_C]\">$rs4[MoneyS_M]</option>\n";
}
}
?>
</select></td>
</tr>
<tr>
<td align="right">ประเภทหมวดค่าใช้จ่าย</td>
<td align="center"> </td>
<td height="25" align="left"><select name="MoneyId" id="MoneyId">
<?php
//$MoneyId = $rs[MoneyId];
$strSQL5 = " SELECT * FROM money_tb ";
$result5 = $dbObj->execQuery($strSQL5);
while( $rs5 = $dbObj->fetchArray($result5) ) {
echo "<option value=\"$rs5[MoneyId]\" ><b>$rs5[MoneyName]</b></option>\n";
}
?>
</select></td>
</tr>
<tr>
<td align="right">วันที่ตั้งงบประมาณ</td>
<td align="center"> </td>
<td height="25" align="left">วันเริ่มต้น <span class="TEXT-DARK-BLUE10"><?php echo $rs['Date_start']; ?></span> วันสิ้นสุด <span class="TEXT-DARK-BLUE10"><?php echo $rs['Date_finish']; ?></span></td>
</tr>
<tr>
<td align="right">ปีงบประมาณ พ.ศ.</td>
<td align="center"> </td>
<td height="25" align="left" class="TEXT-DARK-BLUE10"><?php echo $rs['Budget_Year']; ?></td>
</tr>
<tr>
<td align="right" valign="top" style="padding-top:13px">จำนวนเงินที่ตั้ง<br />
งบประมาณรายเดือน</td>
<td align="center"> </td>
<td height="25" align="left" valign="top" style="padding-top:8px"><table width="99%" border="0" cellpadding="1" cellspacing="1">
<tr bgcolor="#F8F8F8">
<td width="16%" align="right" bgcolor="#FFFFFF"><strong>มกราคม </strong></td>
<td width="13%" align="left" bgcolor="#FFFFFF" class="PADDING-LEFT-10 TEXT-DARK-BLUE10"><strong><?php echo $rs['January']; ?></strong></td>
<td width="12%" align="right" bgcolor="#FFFFFF"><strong>กรฏาคม</strong></td>
<td width="59%" align="left" bgcolor="#FFFFFF" class="PADDING-LEFT-10 TEXT-DARK-BLUE10"><strong><?php echo $rs['July']; ?></strong></td>
</tr>
<tr bgcolor="#F8F8F8">
<td align="right" bgcolor="#FFFFFF"><strong>กุมภาพันธ์ </strong></td>
<td align="left" bgcolor="#FFFFFF" class="PADDING-LEFT-10 TEXT-DARK-BLUE10"><strong><?php echo $rs['February']; ?></strong></td>
<td align="right" bgcolor="#FFFFFF"><strong>สิงหาคม</strong></td>
<td align="left" bgcolor="#FFFFFF" class="PADDING-LEFT-10 TEXT-DARK-BLUE10"><strong><?php echo $rs['Augus']; ?></strong></td>
</tr>
<tr bgcolor="#F8F8F8">
<td align="right" bgcolor="#FFFFFF"><strong>มีนาคม</strong></td>
<td align="left" bgcolor="#FFFFFF" class="PADDING-LEFT-10 TEXT-DARK-BLUE10"><strong><?php echo $rs['March']; ?></strong></td>
<td align="right" bgcolor="#FFFFFF"><strong>กันยายน</strong></td>
<td align="left" bgcolor="#FFFFFF" class="PADDING-LEFT-10 TEXT-DARK-BLUE10"><strong><?php echo $rs['September']; ?></strong></td>
</tr>
<tr bgcolor="#F8F8F8">
<td align="right" bgcolor="#FFFFFF"><strong>เมษายน</strong></td>
<td align="left" bgcolor="#FFFFFF" class="PADDING-LEFT-10 TEXT-DARK-BLUE10"><strong><?php echo $rs['April']; ?></strong></td>
<td align="right" bgcolor="#FFFFFF"><strong>ตุลาคม</strong></td>
<td align="left" bgcolor="#FFFFFF" class="PADDING-LEFT-10 TEXT-DARK-BLUE10"><strong><?php echo $rs['October']; ?></strong></td>
</tr>
<tr bgcolor="#F8F8F8">
<td align="right" bgcolor="#FFFFFF"><strong>พฤษภาคม</strong></td>
<td align="left" bgcolor="#FFFFFF" class="PADDING-LEFT-10 TEXT-DARK-BLUE10"><strong><?php echo $rs['May']; ?></strong></td>
<td align="right" bgcolor="#FFFFFF"><strong>พฤศจิกายน</strong></td>
<td align="left" bgcolor="#FFFFFF" class="PADDING-LEFT-10 TEXT-DARK-BLUE10"><strong><?php echo $rs['November']; ?></strong></td>
</tr>
<tr bgcolor="#F8F8F8">
<td align="right" bgcolor="#FFFFFF"><strong>มิถุนายน</strong></td>
<td align="left" bgcolor="#FFFFFF" class="PADDING-LEFT-10 TEXT-DARK-BLUE10"><strong><?php echo $rs['June']; ?></strong></td>
<td align="right" bgcolor="#FFFFFF"><strong>ธันวาคม</strong></td>
<td align="left" bgcolor="#FFFFFF" class="PADDING-LEFT-10 TEXT-DARK-BLUE10"><strong><?php echo $rs['December']; ?></strong></td>
</tr>
</table>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="25" align="left" style="padding-left:103px"><strong>ยอดรวมจำนวนเงินทั้งหมด<span class="PADDING-LEFT-10"><strong class="TEXT-CLIMSON10"><?php echo number_format( $rs['Budget_use'], 2, '.', ',' ); ?></strong> บาท</span></strong></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right">ผู้รับใช้เงิน</td>
<td align="center"> </td>
<td height="25" align="left"><span style="padding-top:15px;">
<select name="Teacher_code" id="Teacher_code">
<option value=""></option>
<?php
$sql1 = " SELECT * FROM personal_tb WHERE StatusId='1' ORDER BY Teacher_name ASC ";
$result1 = mysql_query($sql1);
while( $rs1 = mysql_fetch_array($result1) ) {
?>
<option value="<?=$rs1['Teacher_code'];?>" <?php if( $rs1['Teacher_code']==$rs['Teacher_code'] ) echo 'selected';?>>
<?=$rs1['First_name'];?>
<?=$rs1['Teacher_name'];?>
<?=$rs1['Teacher_lastname'];?>
</option>
<?php
} # while
mysql_free_result($result1);
?>
</select>
</span></td>
</tr>
<tr>
<td align="right"><span class="TEXT-RED10"><sup>*</sup></span> วัน/เดือน/ปี<br />
(ที่ดำเนินการ)</td>
<td align="center"> </td>
<td height="25" align="left"><input name="Date" type="text" id="Date" size="9" style="text-align:center" />
<script type="text/javascript" src="../includes/popcalendar.js"></script>
<script language='JavaScript'>
if (!document.layers) {
document.write("<img src='../images/ew_calendar.gif' width='16' height='15' style='cursor:hand;' onclick='popUpCalendar(this, myForm.Date, \"yyyy-mm-dd\")'>")
}
</script> <span class="TEXT-ORANGE9"><-- คลิ๊กที่นี่</span></td>
</tr>
<tr>
<td align="right"><span class="TEXT-RED10"><sup>*</sup></span> จำนวนเงินที่ใช้</td>
<td align="center"> </td>
<td height="25" align="left"><input name="Budget_use" type="text" id="Budget_use" size="8" style="text-align:center" onkeypress="return checkNumeric();" onkeyup="checkBudget()"/>
บาท <span id="budgetOver"></span></td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"> </td>
<td height="25" align="left"> </td>
</tr>
<tr>
<td height="29" align="center"> </td>
<td height="29" align="center"> </td>
<td height="29" align="left"><input name="ProjectId" type="hidden" id="ProjectId" value="<?php echo $rs['ProjectId']; ?>" />
<input name="Project_code" type="hidden" id="Project_code" value="<?php echo $rs['Project_code']; ?>" />
<input name="Faculty_code" type="hidden" id="Faculty_code" value="<?php echo $rs['Faculty_code']; ?>" />
<input name="Orderlist" type="hidden" id="Orderlist" value="<?php echo $rs['Orderlist']; ?>" />
<input name="Project_plan" type="hidden" id="Project_plan" value="<? echo $rs['Project_plan']; ?>" />
<input name="Budget_Year" type="hidden" id="Budget_Year" value="<? echo $rs['Budget_Year']; ?>" />
<span id="submitBtn"><input name="Submit" type="submit" class="WIDTH60 CURSOR-HAND" value="บันทึก" disabled/></span>
<input name="Reset" type="reset" class="WIDTH60 CURSOR-HAND" value="รีเซ็ต" onclick="checkBudgetReset()"/>
<input name="Button" type="button" value="ยกเลิก" class="WIDTH60 CURSOR-HAND" onclick="location.href='EditPlaningList.php?Budget_Year=<?=$Budget_Year;?>&Faculty_code=<?=$Faculty_code;?>&Project_code=<?=$rs["Project_code"];?>'" /> </td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"> </td>
<td align="left"> </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);
?>
|