Viewing file: FinList2.php (8.49 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php session_start(); if (session_is_registered("valid_user")) { include("../../../include/FunctionDB.php"); include("../../../include/Function.php"); ConnectDB(); $strSQL = "SELECT * FROM finance4_tb"; if (! $Page) $Page = 1; $Pre_Page = $Page - 1; $Next_Page = $Page +1; $Per_Page = 10; $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; ?> <html> <head> <title>Information List</title> <link rel="stylesheet" href="../../../css/style1.css" type="text/css"> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> </head>
<body bgcolor="#FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#006699"> <tr > <td width="20%" background="../../../Image/bares5.jpg" class="table"> <div align="center"><strong><font size="2" face="Tahoma"><a href="../../menu_manage.php" class="d">กลับเมนูหน้า</a></font></strong></div></td> <td width="20%" background="../../../Image/bares5.jpg" class="table"> <div align="center"><strong><font size="2" face="Tahoma"><a href="AddFin.php" class="d" >เพิ่มข้อมูล</a></font></strong></div></td> <td width="20%" background="../../../Image/bares5.jpg" class="table"> <div align="center"><strong><font size="2" face="Tahoma"><a href="EditFinList.php" class="d">ลบ หรือ แก้ไข</a></font></strong></div></td> <td width="20%" background="../../../Image/bares5.jpg" class="table"> <div align="center"><strong><font size="2" face="Tahoma"><a href="../../../logout.php" class="d">Logout</a></font></strong></div></td> </tr> </table></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="4%" bgcolor="#C7DED0"> </td> <td width="96%" bgcolor="#C7DED0"><font size="2" face="Tahoma"><a href="Report4.php" class="g"><strong>ประมวลสรุปค่าครุภัณฑ์และสิ่งก่อสร้าง</strong></a></font></td> </tr> </table></td> </tr> <tr> <td> </td> </tr> </table> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" style="border:1px solid gray"> <tr bgcolor="#7CAB84"> <td height="24" colspan="8"> <div align="center"><font color="#FFCC66" size="4" face="Tahoma"><strong><font color="#FFFFFF">แสดงรายการ</font><font color="#FFFFFF" size="4" face="Tahoma"> ค่าครุภัณฑ์และสิ่งก่อสร้าง</font></strong></font></div></td> </tr> <tr bordercolor="#003366" bgcolor="#C7DED0"> <td width="24" align="center"><font color="#003366" size="2" face="Tahoma"><b>No.</b></font></td> <td width="87" align="center" bgcolor="#C7DED0"><font size="2" face="Tahoma">เดือน</font><br></td> <td width="105" align="center" bgcolor="#C7DED0"><font size="2" face="Tahoma">ครุภัณฑ์การศึกษา</font><font color="#003366" size="2" face="Tahoma"> </font></td> <td width="105" align="center" bgcolor="#C7DED0"><font size="2" face="Tahoma">สำนักงาน</font><font color="#003366" size="2" face="Tahoma"> </font></td> <td width="120" align="center"><font size="2" face="Tahoma">โฆษณาและเผยแพร่</font></td> <td width="95" align="center"><font size="2" face="Tahoma">ก่อสร้าง</font></td> <td width="105" align="center"><font size="2" face="Tahoma">ไฟฟ้าและวิทยุ</font><font color="#003366" size="2" face="Tahoma"> </font></td> <td width="112" align="center"><font size="2" face="Tahoma">งานบ้านงานครัว</font><font color="#003366" size="2" face="Tahoma"> </font></td> </tr> <?php $i = 1; while($row = mysql_fetch_array($result)) {
if($count==0) { ?> <tr bgcolor="#EEEEEE" > <td align=center bordercolor="#D1D1D1" ><strong><font color="#003300" size="2" face="Tahoma"> <?=$i?> </font></strong></td> <td align=center bordercolor="#DFDFDF" ><font color="#003300" size="2" face="Tahoma"><? echo"$row[Date_note]";?></font></td> <td align=center bordercolor="#DFDFDF" > <div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost1'],2,'.',',');?> </font></div></td> <td bordercolor="#DFDFDF"> <div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost2'],2,'.',',');?> </font></div></td> <td bordercolor="#DFDFDF" bgcolor="#EEEEEE" > <div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost3'],2,'.',',');?></font></div></td> <td bordercolor="#DFDFDF" > <div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost4'],2,'.',',');?></font></div></td> <td bordercolor="#DFDFDF" > <div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost5'],2,'.',',');?></font></div></td> <td bordercolor="#DFDFDF" > <div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost6'],2,'.',',');?></font></div></td> </tr> <? $count=1; } else { ?> <tr bgcolor="#FFFFFF"> <td align="center" bordercolor="#D1D1D1" ><strong><font color="#003300" size="2" face="Tahoma"> <?=$i?> </font></strong></td> <td align="center" bordercolor="#FFFFFF" ><font color="#003300" size="2" face="Tahoma"><? echo"$row[Date_note]";?></font></td> <td height="18" align="center" bordercolor="#FFFFFF" > <div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost1'],2,'.',',');?></font></div></td> <td bordercolor="#FFFFFF"> <div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost2'],2,'.',',');?> </font></div></td> <td bordercolor="#FFFFFF" ><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost3'],2,'.',',');?></font></div></td> <td bordercolor="#FFFFFF" ><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost4'],2,'.',',');?></font></div></td> <td bordercolor="#FFFFFF" ><div align="right"><font color="#0033CC" size="2" face="Tahoma"> <? echo number_format($row['Cost5'],2,'.',',');?></font></div></td> <td bordercolor="#FFFFFF" > <div align="right"><font color="#0033CC" size="2" face="Tahoma"><? echo number_format($row['Cost6'],2,'.',',');?></font></div></td> </tr> <? $count=0; } $i++; } CloseDB(); ?> <tr bgcolor="#7CAB84"> <td colspan="8" align="center"> <div align="center"><font color="#FFFFFF" size="2" face="Tahoma">ทั้งหมด <? echo $num ?> รายการ </font> </div></td> </table> <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="#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\" 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>"; ?> </strong></font> </font> </div></td> </tr> </table> <p> </p> </body> </html> <?php } else { echo"<meta http-equiv=\"refresh\" content=\"3;URL=../FrmLogin.php\" target=\"mainFrame\">\n"; echo"Please Login "; } ?>
|