Viewing file: AddEditFormProject.php (18.64 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" );
/** Create Database Object */
$dbObj = new DBConn;
/** Config Table for This Page */
$myTable = "personal_tb";
$myTable1 = "budget_year_tb";
$query = " SELECT * FROM $myTable WHERE Teacher_code='$Teacher_code' ";
$result = $dbObj->execQuery($query);
$rss = $dbObj->fetchArray($result);
$query1 = " SELECT * FROM $myTable1 ";
$result1 = $dbObj->execQuery($query1);
$rs = $dbObj->fetchObject($result1);
} # 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>บันทึกการใช้เงินตามแผน</title>
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/utilities.js"></script>
<script type="text/javascript" src="../js/ajaxScript.js"></script>
<script language="javascript">
function checkData() {
var formObj = document.form1;
if( (formObj.Training_name.value == "" ) && (formObj.Day.value == "" ) ) { alert("กรุณากรอกข้อมูลให้ครบด้วยค่ะ" ); formObj.Training_name.style.backgroundColor='#F1F9FC'; formObj.Day.focus(); return false; }
else if(formObj.Training_name.value == "" ) { alert("กรุณากรอก เรื่อง"); formObj.Training_name.style.backgroundColor='#F1F9FC'; formObj.Training_name.focus(); return false;}
else if(formObj.Travel.value == "" ) { alert("กรุณากรอก การเดินทาง"); formObj.Travel.style.backgroundColor='#F1F9FC'; formObj.Travel.focus(); return false;}
else if(formObj.Orderlist.value == "" ) { alert("กรุณากรอก ข้อแผน"); formObj.Orderlist.style.backgroundColor='#F1F9FC'; formObj.Orderlist.focus(); return false;
}
else if(formObj.nameDetail.value == "" ) { alert("กรุณากรอก จำนวนวัน"); formObj.nameDetail.style.backgroundColor='#F1F9FC'; formObj.nameDetail.focus(); return false;}
else return true ;
}
</script>
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</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" height="440" align="center" valign="top" style="padding:10px 0px 5px 10px"><fieldset>
<table width="780" border="0" cellspacing="0" cellpadding="0">
<form id="form1" name="form1" method="post" action="InserUpProject.php" onSubmit="return checkData();">
<tr>
<td> </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="FormProjectList.php?Teacher_code=<?=$Teacher_code;?>">ข้อมูลการใช้เงินตามโครงการ</a> » <span class="NOTE">ใบขออนุมัติการแก้ไขโครงการ/กิจกรรม</span></strong></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><span 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></span></td>
</tr>
<tr>
<td align="center">
<table width="750" cellpadding="0" cellspacing="0">
<tr height="31">
<td height="31" colspan="6" align="center" class="PATRON11">ใบขออนุมัติแก้ไขโครงการ/กิจกรรม</td>
</tr>
<tr height="29">
<td height="29" colspan="6" l>ส่วนราชการ <font size="2" face="Tahoma">
<?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>
<td height="29" colspan="2" align="left"><input name="naNo" type="text" id="naNo" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="ที่ สธ.0203." size="15" readonly="readonly" /></td>
<td width="148" height="29" align="left"> </td>
<td height="29" align="left"> </td>
<td height="29" colspan="2" align="left">วันที่</a>*</a>
<select name="mDate" id="mDate" class="select" >
<? getDay1to31();?>
</select>
เดือน
<select name="mMonth" id="mMonth" class="select" >
<? getThaiMonth();?>
</select>
ปี พ.ศ. </a>
<select name="mYear" id="mYear">
<?php
$curr_year = date("Y")+543;
$prev_year = $curr_year-2;
$next_year = $curr_year+3;
for( $i=$prev_year; $i<=$next_year; $i++ ) {
?>
<option value="<?=$i;?>" <?php if( $i==$curr_year ) echo 'selected'; elseif( $i==$Budget_Year ) echo 'selected'; ?>>
<?=$i;?>
</option>
<?php
} # for
?>
</select>
</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="202"></td>
<td width="155"></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="125" height="25"></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" value="<? echo $rss[First_name]?> <? echo $rss[Teacher_name]?> <? echo $rss[Teacher_lastname]?> " size="25" readonly="readonly" />
</a> ตำแหน่ง</a>
<input name="Name2" type="text" id="Name2" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" 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] ";?>
" size="25" readonly="readonly" />
</a></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">สังกัด</a>
<input name="Name3" type="text" id="Name3" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" 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] "; ?>" size="20" readonly="readonly" />
</a>
<input name="Name3" type="text" id="Name4" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" 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]"; ?> " size="40" readonly="readonly" />
</a>สถาบันพระบรมราชชนก</a></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">เหตุผลในการขอปรับแผน เพื่อ </a>*</a>
<input name="Training_name" type="text" id="Training_name" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="70" />
</a></td>
</tr>
<tr height="29">
<td height="27" colspan="6" align="left">อ้างตามแผนดำเนินการ ข้อที่ </a>*</a>
<input name="Orderlist" type="text" id="Orderlist" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="5" readonly />
โครงการ/แผน
<input name="Project_plan" type="text" id="Project_plan" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="70" readonly />
</font></td>
</tr>
<tr height="29">
<td height="29" colspan="6" align="left">แก้ไขจำนวนเงิน </a>*</a>
<input name="Budget" type="text" id="Budget" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" onkeypress="checkNumeric()" size="5" maxlength="15" />
</a> บาท ปี ระบุเดือน*
<select name="Month" id="Month">
<?getThaiMonth();?>
</select>
งบประมาณ</a>
<input name="Year_std" type="text" id="Year_std" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" value="<?=$rs1['Budget_Year'];?>" size="4" maxlength="4" readonly />
<input name="Budget_Year" type="hidden" id="Budget_Year" />
<input name="MoneyS_C" type="hidden" id="MoneyS_C" />
<input name="MoneyId" type="hidden" id="MoneyId" />
<a href="javascript:;" onclick="MM_openBrWindow('ProjectByYearShow.php?Faculty_code=<?=$Faculty_code;?>','Detail','scrollbars=yes,width=820,height=380')"><img src="../images/icons/search.gif" alt="เลือกข้อของแผนดำเนินการ" width="15" height="19" border="0" align="absmiddle" /></a>
<input name="ProjectId" type="hidden" id="ProjectId" />
<input name="Budget_total" type="hidden" id="Budget_total" />
<input name="Faculty_code" type="hidden" id="Faculty_code" /></td>
</tr>
<td height="33" colspan="6"></a>หมายเหตุ ให้กรอกรายละเอียด
<input name="nameDetail" type="text" id="nameDetail" style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: black 1px dashed" size="90" /></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">ลงชื่อ ............................................</td>
<td></td>
</tr>
<tr height="29">
<td height="29"> </td>
<td width="57"> </td>
<td> </td>
<td colspan="2" align="center">(<? echo $rss[First_name]?> <? echo $rss[Teacher_name]?> <? echo $rss[Teacher_lastname]?></a>)
<input name="Teacher_code" type="hidden" id="Teacher_code" value="<? echo $rss["Teacher_code"]?>" />
<input name="Flag" type="hidden" id="Flag" value="<? echo $rss["Teacher_code"]?>" /></td>
<td></td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left"> </td>
<td colspan="2"><font color="#0000FF" size="2" face="Tahoma"> </font> ตำแหน่ง<font color="#0000FF" size="2" face="Tahoma">
<input name="Name4" type="text" id="Name5" 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] ";?>
" />
</font></td>
<td></td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="left"> </td>
<td align="left"> </td>
<td colspan="3" align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left">ลงชื่อ.............................................หัวหน้าภาค/ฝ่าย.</td>
<td colspan="3" align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="2" align="center">(<font size="2" face="Tahoma">
<?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]";
?>
</font>)
<input name="TeacherId" type="hidden" id="TeacherId" value="<? echo $rs2["Teacher_code"]?>" /></td>
<td align="left"> </td>
<td align="left"><div align="center">คำสั่ง</div></td>
<td align="left"> </td>
<td align="left"> </td>
</tr>
<tr height="29">
<td height="29" colspan="3" align="left">ตำแหน่ง<font color="#0000FF" size="2" face="Tahoma">
<input name="Name5" type="text" id="Name6" 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] ";?>
" />
</font></td>
<td align="left"> </td>
<td align="left">
<input name="Flag2" type="checkbox" id="Flag2" value="1" disabled="disabled" />
อนมัติ
<input name="Flag2" type="checkbox" id="Flag2" 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="left">ลงชื่อ................................
..</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>
<hr color="#D5DFE5" size="1px" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"></td>
</tr>
</table>
<span id="submitBtn"><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='ResearchByYear.php?Teacher_code<?=$Teacher_code;?>'" /></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);
?>
|