Viewing file: ReportMoc_bkp.php (11.05 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include("../include/FunctionDB.php");
include("admin_menu.php");
ConnectDB();
/*
$sql = "SELECT * FROM project_tb WHERE Budget_Year='$Budget_Year' and MoneyS_C='$MoneyId' ";
$result = mysql_query($sql) or die(" Error").mysql_error();
$rs = mysql_fetch_array($result);
$row = mysql_num_rows($result);
*/
$strSQL = " Select * FROM project_tb WHERE Budget_Year='$Budget_Year' and MoneyId='$MoneyId' Order By Orderlist , Date ASC ";
$result = mysql_query($strSQL);
$num = mysql_num_rows($result );
if (! $Page)
$Page = 1;
$Pre_Page = $Page - 1;
$Next_Page = $Page +1;
$Per_Page = 50;
$result = mysql_query($strSQL);
$Page_start = ($Per_Page*$Page) - $Per_Page;
$Num_Rows = mysql_num_rows($result);
if( $Num_Rows <= $Per_Page)
$Num_Pages = 1;
else if (($Num_Rows % $Per_Page) == 0)
$Num_Pages = ($Num_Rows / $Per_Page);
else
$Num_Pages = ($Num_Rows / $Per_Page) + 1;
$Num_Pages = (int)$Num_Pages;
if (( $Page > $Num_Pages) || ($Page < 0))
echo"Page $Page More than $Num_Pages";
$strSQL .=" LIMIT $Page_start,$Per_Page" ;
$result = mysql_query($strSQL);
$num = mysql_num_rows($result );
?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">
<link rel="stylesheet" href="../css/cart4.css" type="text/css">
<link href="../source/style.css" rel="stylesheet" type="text/css">
<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<style type="text/css">
<!--
.style1 {
font-size: 14px;
font-weight: bold;
}
.style2 {font-size: 14px}
.style3 {
font-family: Tahoma;
font-size: 14px;
}
.style16 {color: #FF0000}
.style19 {color: #000000}
-->
</style>
<table width="817" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="817"><br />
<fieldset>
<legend><span class="style3"><a href="menu_report.php?Budget_Year=<? echo $rs[Budget_Year]?>" class="style2">หน้าหลัก</a></span></legend><br />
<form id="form" name="form" method="get" action="SearchRepPlaning.php">
<font size="2" face="Tahoma"><img src="../picture/previous.gif" onclick="window.history.back()" width="85" height="22" border="0" /></font>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" style="background-color:#eeeeee; border:0px solid gray">
<tr bgcolor="#CCCCFF">
<td height="24" colspan="3" bgcolor="#FFFFFF" > </td>
<td width="381" height="24" bgcolor="#FFFFFF" > </td>
<td width="80" bgcolor="#FFFFFF" > </td>
<td width="86" height="24" bgcolor="#FFFFFF" > </td>
<td height="24" bgcolor="#FFFFFF" ><div align="right"><font color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><span class="style2">ส่งออก <a href="ExcelReportPlaning.php?Budget_Year=<? echo $rs[Budget_Year]?>&MoneyId=<? echo $rs[MoneyId]?>"><img src="../picture/excel.gif" width="18" height="18" border="0" align="absmiddle" /></a></span></font></div></td>
</tr>
<tr bgcolor="#CCCCFF">
<td height="24" colspan="7" bgcolor="#FFFFFF" ><div align="center" class="style1"></div></td>
</tr>
<tr bgcolor="#E6E6E6">
<td width="22" height="25" align="center" bgcolor="#CCCCFF" style="border:0px solid gray"><span class="style3">No</span></td>
<td colspan="3" align="center" bgcolor="#CCCCFF" style="border:0px solid gray"><div align="left" class="style3"><font color="#000000"> ปีงบประมาณ<font color="#000000"><strong><font color="#000000"><strong><font color="#000066"><strong> <span class="style16"><img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" /></span> <font color="#003399"><? echo $Budget_Year?></font></strong></font></strong></font></strong></font></font> <span class="style16"><span class="style19">ภาค/ฝ่าย</span> <img src="../picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" /></span><font color="#0033CC" size="2" face="Tahoma">
<?php
//MoneyId = $rs["MoneyId"];
$sql = "Select * From money_tb Where MoneyId='$MoneyId' ";
$result1 = mysql_query($sql) or die("Error".mysql_error());
$rss = mysql_fetch_array($result1);
echo " หมวดเงิน $rss[MoneyName]";
?>
</font></div>
<div align="left" class="style3"></div></td>
<td align="center" bgcolor="#CCCCFF" style="border:0px solid gray"><div align="right"><span class="style3">รหัสหน่วยงาน</span></div></td>
<td align="center" bgcolor="#CCCCFF" style="border:0px solid gray"><span class="style3">วันที่ดำเนินการ</span></td>
<td width="89" align="center" bgcolor="#CCCCFF" style="border:0px solid gray"><div align="right"><span class="style3">จำนวนเงิน</span></div></td>
</tr>
<?php
$i = 1;
while($row = mysql_fetch_array($result))
{
if($count==0)
{
?>
<tr bgcolor="#F7F7F7" >
<td align="center" bgcolor="#ECF5FF" ><font color="#996600" size="1" face="Tahoma">
<?=$i?>
</font></td>
<td width="31" align="center" bgcolor="#ECF5FF" ><div align="left">
<?=$row["Orderlist"]?>
</div>
</font></td>
<td colspan="2" align="center" bordercolor="#EEEEEE" bgcolor="#ECF5FF" > <font color="#996600" size="2" face="Tahoma">
<div align="left">
<?=$row['Training_name']?>
</div></font></td>
<td bordercolor="#EEEEEE" bgcolor="#ECF5FF" ><div align="center"><font color="#0033CC" size="2" face="Tahoma">
</font><font color="#003366" size="2" face="Tahoma"><font color="#003366" size="2" face="Tahoma">
<?=$row["Faculty_code"]?>
</font></font></div></td>
<td bordercolor="#EEEEEE" bgcolor="#ECF5FF" ><div align="center"><font color="#003366" size="2" face="Tahoma"><font color="#003366" size="2" face="Tahoma">
<?=$row["Date"]?>
</font></font></div></td>
<td bgcolor="#ECF5FF" ><div align="right"><font color="#993333" size="2" face="Tahoma"> <? echo number_format($row['Budget_use'],2,'.',','); ?> </font></div></td>
</tr>
<?
$count=1;
}
else
{
?>
<tr bgcolor="#FFFFFF">
<td align="center" bordercolor="#FFFFFF" ><font color="#996600" size="1" face="Tahoma">
<?=$i?>
</font></td>
<td align="center" bordercolor="#EEEEEE" ><div align="left">
<?=$row["Orderlist"]?></div></td>
<td colspan="2" align="center" bordercolor="#EEEEEE" ><div align="left"><font color="#996600" size="2" face="Tahoma">
<?=$row["Training_name"]?>
</font></div></td>
<td bordercolor="#EEEEEE" ><div align="center"><font color="#003366" size="2" face="Tahoma"><font color="#003366" size="2" face="Tahoma">
<?=$row["Faculty_code"]?>
</font></font></div></td>
<td bordercolor="#EEEEEE" ><div align="center"><font color="#003366" size="2" face="Tahoma"><font color="#003366" size="2" face="Tahoma">
<?=$row["Start_Date"]?>
</font></font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><div align="right"><font color="#993333" size="2" face="Tahoma"> <?echo number_format($row['Budget_use'],2,'.',','); ?> </font></div></td>
</tr>
<?
$count=0;
}
$i++;
}
?>
<tr bgcolor="#FFFFFF">
<td colspan="7" align="center" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="89%" bgcolor="#FFFFFF"><div align="right"><font color="#0033CC" size="2" face="Tahoma"><strong> </strong></font><font color="#0033CC" face="Tahoma"><strong><span class="style2"> </span></strong><span class="style2"><font color="#993333"> จำนวนเงินที่ใช</font></span></font><font color="#0033CC" size="2" face="Tahoma"><strong><font color="#993333">้</font></strong></font></div></td>
<td width="11%" bgcolor="#FFFFFF"><div align="right"><strong><font color="#993333" size="2" face="Tahoma">
<?php
$sql1 = "Select Sum(Budget_use) as SumB1 From project_tb Where Budget_Year='$Budget_Year' and MoneyId='$MoneyId' ";
$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>
</table></td>
</tr>
<tr bgcolor="#CCCCFF">
<td colspan="7" align="center" bgcolor="#FFFFFF" ><span class="style2"><font color="#000000" face="Tahoma">ทั้งหมด</font></span><font color="#003399" size="2" face="Tahoma"> <? echo $num ?></font> <span class="style2"><font color="#FFFFFF" face="Tahoma"><font color="#003366">รายการ</font><font color="#FFFFFF"> </font></font></span></td>
</tr>
<tr bgcolor="#CCCCFF">
<td colspan="7" align="center" bgcolor="#FFFFFF" ><div align="center"><font color="#FFFFFF"><font color="#FFFFFF" size="3" face="MS Sans Serif"><strong><font color="#000000" size="2" face="Tahoma"><?php echo $Num_Pages;?></font></strong></font><font color="#000000" size="2" face="Tahoma"><strong> </strong>หน้า</font><font color="#000000" size="2" face="Tahoma"><strong>
<?php
if ($Pre_Page)
echo"<a href=\"$PHP_SELF?Page=$Pre_Page&Budget_Year=$Budget_Year&MoneyId=$MoneyId\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b><< Previus</b> </font></a>";
for($i=1;$i<=$Num_Pages;$i++)
{
if($i != $Page)
echo" [<a href=\"$PHP_SELF?Page=$i&Budget_Year=$Budget_Year&MoneyId=$MoneyId\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b>$i</b></font></a>] ";
else
echo"<b>$i</b>";
}
if($Page != $Num_Pages)
echo"<a href=\"$PHP_SELF?Page=$Next_Page&Budget_Year=$Budget_Year&MoneyId=$MoneyId\" class=\"PageLink\"><font =\"Ms San serif\" size=\"2\"><b> Next >></b> </font></a>";
?>
</strong></font></font></div></td>
</tr>
</table>
</form>
</fieldset>
</td>
</tr>
</table>
|