Viewing file: Finpublicbreport.php (11.93 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include("./include/FunctionDB.php");
include("./include/Function.php");
include("admin_menu.php");
ConnectDB();
$strSQL = "SELECT * FROM finance3_tb Order By Date_note";
if (! $Page)
$Page = 1;
$Pre_Page = $Page - 1;
$Next_Page = $Page +1;
$Per_Page = 30;
$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 );
//$count = 0;
?>
<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">
<link href="./source/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style24 {font-size: 12px}
.style25 {font-family: Tahoma; font-size: 12px; }
-->
</style>
<table width="842" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><br><fieldset>
<legend><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><a href="index.php" >หน้าหลัก</a> <img src="./picture/ico3.gif" width="10" height="10" border="0" align="absmiddle"><a href="FincostList.php">ข้อมูลงบบุคลากร</a></font><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>"><img src="./picture/ico3.gif" width="10" height="10" border="0" align="absmiddle" />ข้อมูลค่าสาธารณูปโภค</font></legend>
<label>
<form id="form1" name="form1" method="post" action="">
<p align="left"><font size="2" face="Tahoma"><img src="./picture/previous.gif" onclick="window.history.back()" width="85" height="22" border="0" /></font></p>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" >
<tr bordercolor="#003366" bgcolor="#D6ECF3">
<td width="28" height="23" align="center"><span class="style25"><font color="#003366">No.</font></span></td>
<td width="77" align="center"><p class="style25">เดือน<br />
</p></td>
<td width="87" align="center"><span class="style25">ค่าน้ำ</span></td>
<td width="81" align="center"><span class="style25">ไฟฟ้า</span></td>
<td width="108" align="center"><span class="style25">ไปรษณีย์/โทรเลข</span></td>
<td width="98" align="center"><span class="style25">โทรศัพท์</span></td>
<td width="120" align="center"><span class="style25">บริการอินเตอร์เน็ต</span></td>
<td width="101" align="center"><span class="style25">ค่าบริการ</span></td>
<td width="105" align="center"><span class="style25"><font color="#993333">รวม</font></span></td>
</tr>
<?php
$i = 1;
while($row = mysql_fetch_array($result))
{
if($count==0)
{
?>
<tr >
<td align="center" bordercolor="#D1D1D1" bgcolor="#F8F8F8" ><font color="#003300" size="2" face="Tahoma">
<?=$i?>
</font></td>
<td align="center" bordercolor="#DFDFDF" bgcolor="#F8F8F8" ><font color="#003366" size="2" face="Tahoma">
<?php
$sday = $row[Date_note];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>
</font></td>
<td align="center" bordercolor="#DFDFDF" bgcolor="#F8F8F8" ><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost1'],2,'.',',');?> </font></div></td>
<td bordercolor="#DFDFDF" bgcolor="#F8F8F8"><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost2'],2,'.',',');?> </font></div></td>
<td bordercolor="#DFDFDF" bgcolor="#F8F8F8" ><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost3'],2,'.',',');?></font></div></td>
<td bordercolor="#DFDFDF" bgcolor="#F8F8F8" ><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost4'],2,'.',',');?></font></div></td>
<td bordercolor="#DFDFDF" bgcolor="#F8F8F8" ><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost5'],2,'.',',');?></font></div></td>
<td bordercolor="#DFDFDF" bgcolor="#F8F8F8" ><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost6'],2,'.',',');?></font></div></td>
<td bordercolor="#DFDFDF" bgcolor="#F8F8F8" ><div align="right"><font color="#FF0000" size="2" face="Tahoma">
<?php
$Sum4 = $row[Cost1] + $row[Cost2] + $row[Cost3] + $row[Cost4] + $row[Cost5] + $row[Cost6];
echo number_format($Sum4,2,'.',',');
// echo"$Sum4";
?>
</font></div></td>
</tr>
<?
$count=1;
}
else
{
?>
<tr>
<td align="center" bordercolor="#D1D1D1" bgcolor="#FFFFFF" ><font color="#003300" size="2" face="Tahoma">
<?=$i?>
</font></td>
<td align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><font color="#003366" size="2" face="Tahoma">
<?php
$sday = $row[Date_note];
$yearthai = explode("-",$sday);
$day = intval($yearthai[2]);
$month = intval($yearthai[1]);
$year = intval($yearthai[0]);
//////////////////
// $yearthai = $day ;
$m = getThaiSubMonth($month);
echo"$day"." "."$m"." "."$year";
?>
</font></td>
<td height="18" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost1'],2,'.',',');?></font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF"><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost2'],2,'.',',');?> </font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost3'],2,'.',',');?></font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost4'],2,'.',',');?></font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost5'],2,'.',',');?></font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><div align="right"><font color="#0033CC" size="2" face="Tahoma"><? echo number_format($row['Cost6'],2,'.',',');?></font></div></td>
<td bordercolor="#FFFFFF" bgcolor="#FFFFFF" ><div align="right"><font color="#FF0000" size="2" face="Tahoma">
<?php
$Sum4 = $row[Cost1] + $row[Cost2] + $row[Cost3] + $row[Cost4] + $row[Cost5] + $row[Cost6];
echo number_format($Sum4,2,'.',',');
// echo"$Sum4";
?>
</font></div></td>
</tr>
<?
$count=0;
}
$i++;
}
?>
<tr bgcolor="#D6ECF3" >
<td align="center" bordercolor="#D1D1D1" ><strong><font color="#003300" size="2" face="Tahoma"> </font></strong></td>
<td align="center" bordercolor="#DFDFDF" ><font color="#993333" size="2" face="Tahoma"><strong>รวม</strong></font></td>
<td align="center" bordercolor="#DFDFDF" ><div align="right"><font color="#993333" size="2" face="Tahoma">
<?php
$sql1 = "Select Sum(Cost1) as SumC1 From finance3_tb ";
$result1 = mysql_query($sql1) or die("Erro".mysql_error());
$rss1 = mysql_fetch_array($result1);
echo number_format($rss1[SumC1],2,'.',',');
// echo"$rss1[SumC1]";
?>
</font></div></td>
<td bordercolor="#DFDFDF"><div align="right"><font color="#993333" size="2" face="Tahoma">
<?php
$sql1 = "Select Sum(Cost2) as SumC2 From finance3_tb ";
$result1 = mysql_query($sql1) or die("Erro".mysql_error());
$rss2 = mysql_fetch_array($result1);
echo number_format($rss2[SumC2],2,'.',',');
// echo"$rss2[SumC2]";
?>
</font></div></td>
<td bordercolor="#DFDFDF" ><div align="right"><font color="#993333" size="2" face="Tahoma">
<?php
$sql3 = "Select Sum(Cost3) as SumC3 From finance3_tb ";
$result3 = mysql_query($sql3) or die("Erro".mysql_error());
$rss3 = mysql_fetch_array($result3);
echo number_format($rss3[SumC3],2,'.',',');
// echo"$rss3[SumC3]";
?>
</font></div></td>
<td bordercolor="#DFDFDF" ><div align="right"><font color="#993333" size="2" face="Tahoma">
<?php
$sql4 = "Select Sum(Cost4) as SumC4 From finance3_tb ";
$result4 = mysql_query($sql4) or die("Erro".mysql_error());
$rss4 = mysql_fetch_array($result4);
echo number_format($rss4[SumC4],2,'.',',');
// echo"$rss4[SumC4]";
?>
</font></div></td>
<td bordercolor="#DFDFDF" ><div align="right"><font color="#993333" size="2" face="Tahoma">
<?php
$sql5 = "Select Sum(Cost5) as SumC5 From finance3_tb ";
$result5 = mysql_query($sql5) or die("Erro".mysql_error());
$rss5 = mysql_fetch_array($result5);
echo number_format($rss5[SumC5],2,'.',',');
// echo"$rss5[SumC5]";
?>
</font></div></td>
<td bordercolor="#DFDFDF" ><div align="right"><font color="#993333" size="2" face="Tahoma">
<?php
$sql6 = "Select Sum(Cost6) as SumC6 From finance3_tb ";
$result6 = mysql_query($sql6) or die("Erro".mysql_error());
$rss6 = mysql_fetch_array($result6);
echo number_format($rss6[SumC6],2,'.',',');
// echo"$rss6[SumC6]";
?>
</font></div></td>
<td bordercolor="#DFDFDF" ><div align="right"><font color="#FF0000" size="2" face="Tahoma"><strong>
<?php
$SumAll = $rss1[SumC1] + $rss2[SumC2] + $rss3[SumC3] + $rss4[SumC4] + $rss5[SumC] + $rss6[SumC6];
echo number_format($SumAll,2,'.',',');
// echo"$SumAll";
?>
</strong></font></div></td>
</tr>
<tr>
<td colspan="9" align="center"><div align="center"><font color="#000000" size="2" face="Tahoma">ทั้งหมด <? echo $num ?> รายการ</font></div></td>
</tr>
</table>
</form>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#99CCFF">
<tr>
<td align="right" class="Tahoma11"><div align="center"><font color="#FFFFFF"> <font color="#000000" size="2" face="Tahoma"> <?php echo $Num_Pages;?></font><font color="#000000" size="2" face="Tahoma"> หน้า</font> <font color="#000000" size="2" face="Tahoma">
<?php
if ($Pre_Page)
echo"<a href=\"$PHP_SELF?Page=$Pre_Page\" class=\"PageLink\"><font =\"Ms San serif\" size=\"3\"><b><< Previus</b> </font></a>";
for($i=1;$i<=$Num_Pages;$i++)
{
if($i != $Page)
echo" [<a href=\"$PHP_SELF?Page=$i\" class=\"PageLink\"><font =\"Ms San serif\" size=\"3\"><b>$i</b></font></a>] ";
else
echo"<b>$i</b>";
}
if($Page != $Num_Pages)
echo"<a href=\"$PHP_SELF?Page=$Next_Page\" class=\"PageLink\"><font =\"Ms San serif\" size=\"3\"><b> Next >></b> </font></a>";
?>
</font> </font> </div></td>
</tr>
</table>
</fieldset><br>
<font color="<?php echo $GLOBALS["COLOR_FONT_3"];?>" size="2"><b>หมายเหตุ :</b> ใช้เมาส์คลิก<br>
</font></td>
</tr>
</table>
|