Viewing file: ExcelMissionFaculty.php (5.84 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 */
header('Content-type: application/xls');
header('Content-Disposition: attachment; filename="testing.xls"');
/** 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;
//=== SESSION
$Username = $valid_user;
/** Config Table for This Page */
$myTable1 = "personal_tb";
$myTable2 = "project_type_tb";
$myTable3 = "project_plan";
$myTable4 = "project_mission";
$myTable2PK = "Orderlist";
/** Table --> projectstdplan_tb */
$query = " SELECT * FROM $myTable4 WHERE Budget_Year='$Budget_Year' ";
$result11 = $dbObj->execQuery($query);
$rss = $dbObj->fetchArray($result11);
$query = " SELECT * FROM $myTable4 WHERE Budget_Year='$Budget_Year' ";
$result1 = $dbObj->execQuery($query);
$rs01 = $dbObj->fetchArray($result1);
$query = " SELECT * FROM $myTable2 WHERE Budget_Year='$Budget_Year' AND subId ='$subId' and Faculty_code='$Faculty_code' ORDER BY Orderlist ASC ";
$result = $dbObj->execQuery($query);
//$rs = $dbObj->fetchArray($result);
$num = $dbObj->_numrows;
} # 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>
</head>
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0">
<table width="771" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="background-color:#EEEEEE; border:0px solid gray" size="12">
<tr >
<td height="23" colspan="4" align="left" bordercolor="#999966" bgcolor="#FFFFFF" class="PADDING-LEFT-5"><strong>
<?php
$sql = " SELECT * FROM project_submission ps, project_mission pm WHERE ps.subId='$subId' ";
$result4 = $dbObj->execQuery($sql);
$rs4= $dbObj->fetchArray($result4);
echo $rs4['mission_plan'] ;
?>
</strong></td>
</tr>
<tr>
<td height="23" colspan="4" align="left" bordercolor="#999966" bgcolor="#FFFFFF" class="PADDING-LEFT-5"><strong>พันธกิจ</strong><span class="TEXT-BLUE10"><strong><strong><strong>
<?php
$sql = " SELECT * FROM project_submission WHERE subId='$subId' ";
$result4 = $dbObj->execQuery($sql);
$rs4= $dbObj->fetchArray($result4);
echo $rs4['submission_plan'];
?>
</strong></strong></strong></span></td>
</tr>
<tr bgcolor="<?=$bgColor;?>" onmouseover="this.style.backgroundColor='#FFFFE0'" onmouseout="this.style.backgroundColor=''">
<td align="center" valign="top" bgcolor="#F8F8F8"><strong>รหัส</strong></td>
<td height="21" align="center" bgcolor="#F8F8F8" class="PADDING-LEFT-3"><span class="PATRON">รายการโครงการ/กิจกรรมตามแผนปฏิบัติการ ปี งปม</span> <span class="TEXT-CLIMSON10"><?php echo $Budget_Year; ?></span> </span></td>
<td height="21" align="center" bgcolor="#F8F8F8" class="PADDING-LEFT-3"><strong>หมวดเงิน</strong></td>
<td align="right" bgcolor="#F8F8F8" class="PADDING-RIGHT-5"><strong>จำนวนเงิน</strong></td>
</tr>
<?php
while( $rs = $dbObj->fetchArray($result) ) {
$bgColor = ( $bgColor == "#FFFFFF" ) ? "#F9FBFB" : "#FFFFFF";
?>
<tr bgcolor="<?=$bgColor;?>" onmouseover="this.style.backgroundColor='#FFFFE0'" onmouseout="this.style.backgroundColor=''">
<td width="48" align="center" valign="top"><span class="PADDING-LEFT-5">
<?=$rs['Orderlist'];?>
</span></td>
<td width="423" height="21" align="left" valign="top" class="PADDING-LEFT-3"><?=htmlspecialchars_decode( nl2br( $rs['Project_plan'] ) );?>
</a></td>
<td width="137" height="21" align="left" class="PADDING-LEFT-3"><?php
$MoneyS_C = $rs['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'];
?>
</a></td>
<td width="88" align="right" class="PADDING-RIGHT-5"><?php echo number_format($rs['Budget_total'],2,'.',',');
?></td>
</tr>
<?php
} # while
?>
<tr bgcolor="#F8F8F8">
<td height="22" colspan="3" align="right" bordercolor="#999966" class="PADDING-RIGHT-10" style="border-top:1px double #EEEEEE"><strong>จำนวนเงินที่ใช้</strong></td>
<td bordercolor="#999966" align="right" class="PADDING-RIGHT-5" style="border-top:1px double #EEEEEE"><strong class="TEXT-CLIMSON10">
<?php
$sql3 = " SELECT SUM(Budget_total) AS Sum FROM project_type_tb WHERE Budget_Year='$Budget_Year' AND subId='$subId' and Faculty_code='$Faculty_code' ";
$result3 = $dbObj->execQuery($sql3);
$rs3 = $dbObj->fetchArray($result3);
echo number_format($rs3['Sum'],2,'.',',');
?>
</strong></td>
</tr>
</table>
<p> </p>
</body>
</html>
<?php
/** Free Resource */
$dbObj->freeresult($result1);
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?>
|