Viewing file: ApprovalAcadmic.php (9.8 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
//print_r($_REQUEST);
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;
/** Config Table for This Page */
$myTable = "project_plan";
$myTablePK = "missId";
$myOrderBy = "missId";
//=== project_plan //
$query = " SELECT * FROM $myTable ";
$result = $dbObj->execQuery($query);
$rs01 = $dbObj->fetchArray($result);
$num = $dbObj->_numrows;
/** Paging */
$page = $_GET['page'];
if( $page == "" ) { $page = 1; }
/** จำนวนข้อมูล ต่อ 1 หน้า */
$perpage = $_REQUEST['perpage'];
if( $perpage == "" ) { $perpage = 50; }
/** Botton Name Action */
$action = $_REQUEST['action'];
$id = $_REQUEST['id'];
if( isset($action) && !empty($action) ) {
switch( $action ) {
case "Update" :
$num = count($id);
for( $i=0; $i<$num; $i++ ) {
//--- college
$qryUp = " UPDATE project_plan, project_type_tb SET project_type_tb.proId='$id[$i]' where project_plan.proId='$id[$i]' and project_plan.ProjectId = project_type_tb.ProjectId ";
$resultUp = $dbObj->runQuery($qryUp);
$dbObj->freeresult($resultUp);
} # for
break;
} # switch
} # if
/** Parameters */
$params = "Budget_Year=$Budget_Year&Faculty_code=$Faculty_code";
} # 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><?=$_Config_sitename;?></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">
<?php
/** Query เพื่อหา Numrows ก่อน */
$query = " SELECT * FROM $myTable Where Budget_Year='$Budget_Year' and Faculty_code='$Faculty_code' ";
$result = $dbObj->execQuery($query);
$numrows = $dbObj->_numrows;
?>
<fieldset><table width="780" border="0" cellspacing="0" cellpadding="0">
<form id="myForm" name="myForm" method="post" action="<?=$PHP_SELF;?>?page=<?=$page;?>&<?=$params;?>">
<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>» </strong><strong><a href="ProjectFaculty.php?Budget_Year=<?=$Budget_Year; ?>">หน่วยงานภายใน</a></strong> <strong>» </strong><strong><a href="ProjectAcadmic.php?Budget_Year=<?=$Budget_Year; ?>&Faculty_code=<?=$Faculty_code;?>">แผนปฎิบัติการรายโครงการ</a> <strong>»</strong> <span class="NOTE">ปรับปรุงโครงการแผนปฏิบัติการ </span><span class="NOTE"><span class="PATRON11">
<?=$AcademicYear; ?>
</span></span></strong></td>
</tr>
<tr>
<td><table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="381" 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="379" align="right"> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="139" align="center" valign="top">
<?php if( $numrows > 0 ) { ?>
<table width="773" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="571" height="25" align="left" style="padding-bottom:5px;">จำนวน: <span class="TEXT-CLIMSON10"><strong><?=$numrows;?></strong></span> องค์ประกอบ</td>
<td width="202" align="right" style="padding-bottom:5px;"><span style="padding-bottom:5px">
<?php if( $numrows > 0 ) { ?>
<input type="submit" name="action" id="action" value="Update" class="TEXT-CLIMSON10 CURSOR-HAND WIDTH60" />
<?php } #if ?>
</span> </td>
</tr>
</table>
<table width="775" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" style="background-color:#EEEEEE; border:0px solid gray" size="12">
<tr>
<td height="20" colspan="11" align="center" bgcolor="#FFFFFF" class="PADDING-LEFT-15">รายละเอียดโครงการหน่วยงาน
<?php
$sql1 = " SELECT * FROM faculty_tb WHERE Faculty_code='$Faculty_code' ";
$result1 = $dbObj->execQuery($sql1);
$rs1 = $dbObj->fetchArray($result1);
echo $rs1['Faculty_name'];
?></td>
</tr>
<tr bgcolor="<?=$bgColor;?>" >
<td colspan="2" align="left" valign="top" bgcolor="#FFFFFF" class="PADDING-LEFT-5"> </td>
<td colspan="9" align="center" valign="top" bgcolor="#FFFFFF" class="PADDING-LEFT-3"><input name="checkboxall" type="checkbox" id="checkboxall" onclick="checkAllDelete(this,this.form);" value="checkbox" alt=" ปรับปรุงที่เลือก " title=" เลือก/ไม่เลือก ทั้งหมด " /></td>
</tr>
<tr bgcolor="<?=$bgColor;?>" >
<?php
$no = 1+($display-1)*$limit;
while( $rs = $dbObj->fetchArray($result) ) {
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
?>
<td colspan="2" align="left" valign="top" class="PADDING-LEFT-5">(
<?=$no;?>
)
<?=$rs['Orderlist'];?>
"
<?=htmlspecialchars_decode( nl2br( $rs['Project_plan'] ) );?>
" </td>
<td><span class="PADDING-LEFT-3">
<input type="checkbox" name="id[]" value="<?=$rs['proId'];?>" onclick="highlightRow(this);" title=" บันทึก(<?php echo $rs['proId']; ?>&ID<?=$rs['ProjectId'];?>)" />
</span></td>
</tr>
<?php
$query2 = " SELECT * FROM project_type_tb WHERE ProjectId = '".$rs['ProjectId']."' ";
$result2 = mysql_query($query2);
while($rss = mysql_fetch_array($result2)){ ;
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
?>
<tr bgcolor="<?=$bgColor;?>" >
<td width="667" align="left" valign="top" class="PADDING-LEFT-15"><span class="PADDING-LEFT-15 BORDER-LIGHT">
<?=$rss['Orderlist'];?>
»
<?=htmlspecialchars_decode( nl2br( $rss['Project_plan'] ) );?>
</a> (
<?php
$MoneyS_C = $rss['MoneyS_C'];
$sql3 = " Select * From money_source_tb Where MoneyS_C='$MoneyS_C' ";
$result3 = $dbObj->execQuery($sql3);
$rs3 = $dbObj->fetchArray($result3);
echo $rs3['MoneyS_M'];
?>
)</span></td>
<td width="71" align="right" valign="top" class="PADDING-RIGHT-5"><? echo number_format ($rss['Budget_total'],2,'.',',');?></td>
<td width="27" colspan="9" align="center" valign="top" bgcolor="<?=$bgColor;?>" class="PADDING-LEFT-3"> </td>
</tr>
<?php
/*
$query = " SELECT * FROM tech_coseoutcom WHERE AcademicYear ='$AcademicYear' and comId = '".$rss['comId']."' Order By outNo ";
$result3 = mysql_query($query);
while($rs3 = mysql_fetch_array($result3)){ ;
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
*/
?>
<tr bgcolor="<?=$bgColor;?>" >
<td align="right" valign="top" bgcolor="#FFFFFF" class="PADDING-RIGHT-5">รวมยอดเงิน</td>
<td align="right" valign="top" bgcolor="#FFFFFF" class="PADDING-RIGHT-5">
<?php
$sql = " SELECT SUM(Budget_total) AS SumB1 FROM project_type_tb WHERE ProjectId ='$rss[ProjectId]' and Budget_Year='$rss[Budget_Year]' ";
$result1 = $dbObj->execQuery($sql);
$rs1 = $dbObj->fetchArray($result1);
echo number_format($rs1['SumB1'],2,'.',',');
?>
</td>
<td colspan="9" align="center" valign="top" bgcolor="#FFFFFF" class="PADDING-LEFT-3"> </td>
</tr>
<?php
} # while
?>
<?php
$no++;
} # while
?>
</table>
<?php } #if ?></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);
?>
|