Viewing file: ExcelStdSum.php (8.32 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
header('Content-type: application/xls');
header('Content-Disposition: attachment; filename="testing.xls"');
include("../include/FunctionDB.php");
ConnectDB();
$sql = "SELECT * FROM projectstdplan_tb WHERE Budget_Year='$Budget_Year' and Faculty_code='$Faculty_code' ";
$result = mysql_query($sql) or die(" Error").mysql_error();
$rs = mysql_fetch_array($result);
$row = mysql_num_rows($result);
$strSQL = "Select * FROM projectstdplan_tb WHERE Budget_Year='$Budget_Year' and Faculty_code='$Faculty_code' Order By Orderlist ASC ";
$result = mysql_query($strSQL);
$num = mysql_num_rows($result );
?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">
<style type="text/css">
<!--
.style1 {
font-size: 14px;
font-weight: bold;
}
.style2 {font-size: 14px}
.style3 {
font-family: Tahoma;
font-size: 14px;
}
.style23 {font-size: 14}
-->
</style>
<table width="1020" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="1020"><br />
<fieldset>
<legend><span class="style3"><a href="PlaningByYear.php" class="style2"></a></span></legend>
<form id="form" name="form" method="get" action="SearchRepPlaning.php">
<table width="100%" cellpadding="0" cellspacing="0" style="background-color:#eeeeee; border:0px solid gray">
<tr bgcolor="#CCCCFF">
<td height="24" colspan="8" bgcolor="#eeeeee" align="center"><input name="Project_code" type="hidden" id="Project_code" value="<?=$Project_code ?>" />
<input name="Faculty_code" type="hidden" id="Faculty_code" value="<?=$Faculty_code ?>" />
<input name="Budget_Year" type="hidden" id="Budget_Year" value="<?=$Budget_Year?>" />
รายละเอียดแผนดำเนินการประจำปีงบประมาณ <font color="#003399"><? echo $Budget_Year?></font>
หน่วยงาน <font color="#003399"><?php
//$Faculty_code = $row[Faculty_code];
$sql3 = "Select * From faculty_tb Where Faculty_code='$Faculty_code'";
$result3 = mysql_query($sql3) or die("Error".mysql_error());
$rss = mysql_fetch_array($result3);
echo"$rss[Faculty_name]";
?></font></td>
</tr>
<tr bgcolor="#E6E6E6">
<td align="center" bgcolor="#FFFFFF" style="border:0px solid gray"><span class="style3">ข้อ</span></td>
<td align="center" bgcolor="#FFFFFF" style="border:0px solid gray"> </td>
<td align="center" bgcolor="#FFFFFF" style="border:0px solid gray"><font color="#003366" face="Tahoma"><span class="style2">วัตถุประสงค์</span></font></td>
<td align="center" bgcolor="#FFFFFF" style="border:0px solid gray"><span class="style2"><font color="#000066" face="Tahoma">ตัวชี้วัดความสำเร็จ</font></span></td>
<td align="center" bgcolor="#FFFFFF" style="border:0px solid gray"><span class="style2"><font color="#000066" face="Tahoma">วิธีการดำเนินงาน</font></span></td>
<td align="center" bgcolor="#FFFFFF" style="border:0px solid gray"><span class="style2"><font color="#003366" face="Tahoma">กลุ่มเป้าหมาย</font></span></td>
<td align="center" bgcolor="#FFFFFF" style="border:0px solid gray"><span class="style23"><span class="style2"><font color="#003366" face="Tahoma">ผลที่คาดว่าจะได้รับ</font></span></span></td>
<td align="center" bgcolor="#FFFFFF" style="border:0px solid gray">จำนวนเงิน</td>
</tr>
<?php
$i = 1;
while($row = mysql_fetch_array($result))
{
if($count==0)
{
?>
<tr bgcolor="#F7F7F7" >
<td width="20" align="center" bgcolor="#FFFFFF" ><div align="left">
<?=$row["Orderlist"]?>
</a></div></td>
<td width="245" align="left" bgcolor="#FFFFFF" ><div align="left"><font color="#0033CC" size="2" face="Tahoma"><? echo $row[Project_plan]?></font></a></div></td>
<td width="159" bordercolor="#EEEEEE" bgcolor="#FFFFFF" ><font color="#0033CC" size="2" face="Tahoma"><? echo $row[Orderlist_2]?></font></a></td>
<td width="124" bordercolor="#EEEEEE" bgcolor="#FFFFFF"><font color="#0033CC" size="2" face="Tahoma"><? echo $row[Project_name]?></font></a></td>
<td width="152" bordercolor="#EEEEEE" bgcolor="#FFFFFF"><font color="#0033CC" size="2" face="Tahoma"><? echo $row[Project_rep]?></font></a></td>
<td width="78" bordercolor="#EEEEEE" bgcolor="#FFFFFF"><?=$row["Period"]?>
</a></td>
<td width="185" bordercolor="#EEEEEE" bgcolor="#FFFFFF"><?=$row["Period_1"]?>
</a></td>
<td width="53" bordercolor="#EEEEEE" bgcolor="#FFFFFF"></a><font color="#993333" size="2" face="Tahoma">
<?php
$Project_code = $row["Project_code"];
$sql1 = "Select Sum(Budget_use) as SumB1 From project_type_tb Where Project_code='$Project_code' and Budget_Year='$Budget_Year' and Faculty_code='$Faculty_code' ";
$result1 = mysql_query($sql1) or die("Erro".mysql_error());
$rss1 = mysql_fetch_array($result1);
echo number_format($rss1[SumB1],2,'.',',');
//echo"$rss1[SumC1]";
?>
</font></td>
</tr>
<?
$count=1;
}
else
{
?>
<tr bgcolor="#FFFFFF">
<td align="center" bordercolor="#FFFFFF" ><div align="left">
<?=$row["Orderlist"]?>
</a></div></td>
<td align="left" ><div align="left"><font color="#0033CC" size="2" face="Tahoma"><? echo $row[Project_plan]?></font></a></div></td>
<td bordercolor="#EEEEEE" ><font color="#0033CC" size="2" face="Tahoma"><? echo $row[Orderlist_2]?></font></a></td>
<td bordercolor="#EEEEEE" ><font color="#0033CC" size="2" face="Tahoma"><? echo $row[Project_name]?></font></a></td>
<td bordercolor="#EEEEEE" ><font color="#0033CC" size="2" face="Tahoma"><? echo $row[Project_rep]?></font></a></td>
<td bordercolor="#EEEEEE" ><?=$row["Period"]?> </a></td>
<td bordercolor="#EEEEEE" ><?=$row["Period_1"]?>
</a></td>
<td bordercolor="#EEEEEE" ></a><font color="#993333" size="2" face="Tahoma">
<?php
$Project_code = $row["Project_code"];
$sql1 = "Select Sum(Budget_use) as SumB1 From project_type_tb Where Project_code='$Project_code' and Budget_Year='$Budget_Year' and Faculty_code='$Faculty_code' ";
$result1 = mysql_query($sql1) or die("Erro".mysql_error());
$rss1 = mysql_fetch_array($result1);
echo number_format($rss1[SumB1],2,'.',',');
//echo"$rss1[SumC1]";
?>
</font></td>
</tr>
<?
$count=0;
}
$i++;
}
?>
<tr bgcolor="#FFFFFF">
<td align="center" > </td>
<td align="center" bgcolor="#FFFFFF" > </td>
<td align="center" > </td>
<td align="center" > </td>
<td align="center" > </td>
<td align="center" > </td>
<td align="center" ><span class="style3">รวมจำนวนเงินตามฝ่าย</span></td>
<td align="center" ><div align="left"><strong><font color="#993333" size="2" face="Tahoma">
<?php
$sql1 = "Select Sum(Budget_use) as SumB1 From project_type_tb Where Budget_Year='$Budget_Year' and Faculty_code='$Faculty_code' ";
$result1 = mysql_query($sql1) or die("Erro".mysql_error());
$rss1 = mysql_fetch_array($result1);
echo number_format($rss1[SumB1],2,'.',',');
//echo"$rss1[SumC1]";
?>
</font></strong></div></td>
</tr>
<tr bgcolor="#CCCCFF">
<td colspan="8" align="center" bgcolor="#FFFFFF" ><span class="style2"><font color="#000000" face="Tahoma">ทั้งหมด</font></span><strong><font color="#003399" size="2" face="Tahoma"> <? echo $num ?> </font></strong><font color="#FFFFFF" face="Tahoma"><span class="style2"><font color="#003366">รายการ</font></span></font></td>
</tr>
</table>
</form>
</fieldset>
</td>
</tr>
</table>
|