Viewing file: StateList.php (11.07 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 */
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" );
include("../include/Function.php");
/** Create Database Object */
$dbObj = new DBConn;
$sql1 = "SELECT * FROM state_tb Where State='$State' ";
$result1 = mysql_query($sql1) ;
$rss = mysql_fetch_array($result1);
$strSQL = "SELECT * FROM state_tb Where State='$State' Order By stateId";
$result = mysql_query($strSQL);
$numrows = mysql_num_rows($result);
} # 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" />
<link href="../css/default.css" rel="stylesheet" type="text/css" />
<title>MIS -- Administrator</title>
<script type="text/javascript" src="../js/utilities.js"></script>
<style type="text/css">
<!--
.style1 {
color: royalblue;
font-weight: bold;
}
.style2 {color: royalblue}
-->
</style>
</head>
<body topmargin="0" rightmargin="0" bottommargin="0" leftmargin="0">
<?php
include("../templates/incHeader.php");
?>
<table width="1003" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="203" align="left" valign="top" style="padding:10px 0px 0px 5px"><?php include("./_incMainMenu.php");?></td>
<td width="800" height="440" align="center" valign="top" style="padding:10px 0px 5px 10px">
<fieldset>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="2"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form id="myForm" name="myForm" method="post" action="<?=$PHP_SELF;?>?page=<?=$page;?>">
<tr>
<td width="70%" height="30" align="left" background="../images/background/bg-head-topic.gif" class="PADDING-LEFT-10"><span class="style1"><a href="index.php">หน้าแรก</a></span><strong><span class="style2">/รายงานงบประมาณ/</span></strong></td>
<td width="30%" align="right" class="PADDING-LEFT-10 PADDING-RIGHT-15"> </td>
</tr>
<tr>
<td height="385" colspan="2" valign="top">
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="10"></td>
</tr>
</table>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="right" style="padding:5px 0px 5px 0px"><strong>แสดงรายการ</font></strong></font>
:</strong>
<input name="State" type="checkbox" disabled="disabled" id="State" value="งบดำเนินการ" <?php if (!(strcmp("$rss[State]","1"))) {echo "checked" ; } ?> />
<font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>">งบดำเนินการ</a></font>
<input name="State" type="checkbox"disabled="disabled" id="State" value="งบครุภัณฑ์" <?php if (!(strcmp("$rss[State]","2"))) {echo "checked" ; } ?> />
<font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>">งบครุภัณฑ์</a></font>
<input name="State2" type="checkbox"disabled="disabled" id="State" value="งบ พตส." <?php if (!(strcmp("$rss[State]","3"))) {echo "checked" ; } ?> />
<font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>">งบ พตส</a></font>
<input name="State22" type="checkbox"disabled="disabled" id="State" value="งบ พตส." <?php if (!(strcmp("$rss[State]","4"))) {echo "checked" ; } ?> />
<font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"]; ?>">งบ อุดหนุน</a></font></td>
</tr>
</table>
<?php if( $numrows > 0 ) { ?>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" class="BORDER-GREY">
<tr bgcolor="#F8F8F8">
<td width="35" height="78" align="center"><span class="style1">ลำดับ</span></td>
<td width="46" align="center" class="BORDER-LEFT-RIGHT"><span class="style1">เดือน</span></td>
<td width="95" align="center"><span class="style1">เลขที่เอกสาร</span></td>
<td width="187" align="center" class="BORDER-LEFT"><span class="style1"> รายการ</span></td>
<td width="85" align="center" class="BORDER-LEFT"><span class="style1">รายรับ งปม
(บาท) </span></td>
<td width="70" align="center" class="BORDER-LEFT"><span class="style1">รับเงินยืม</span></td>
<td width="61" align="center" class="BORDER-LEFT"><span class="style1">เงินยืมุ</span></td>
<td width="73" align="center" class="BORDER-LEFT"><span class="style1">เงินกันเบิก</span></td>
<td width="77" align="center" class="BORDER-LEFT"><span class="style1">รายการเบิก</span></td>
<td width="69" align="center" class="BORDER-LEFT"><span class="style1">คงเหลือ</span></td>
</tr>
<?php
//$no = 1+($display-1)*$limit;
$i = 1;
while($row = $dbObj->fetchArray($result)){
?>
<tr onmouseover="this.style.backgroundColor='#F5F9F9'" onmouseout="this.style.backgroundColor=''">
<td height="23" align="center" class="BORDER-TOP"><?echo $i?></td>
<td align="center" class="BORDER-TOP-LEFT-RIGHT"><?= $row['Date_note'];?></td>
<td align="left" class="PADDING-LEFT-5 BORDER-TOP"><? echo"$row[No]";?></td>
<td align="left" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT"><? echo"$row[Disciption]";?></td>
<td align="left" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT"><? echo number_format($row['Cost1'],2,'.',',');?></td>
<td align="left" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT"><? echo number_format($row['Cost5'],2,'.',',');?></td>
<td align="left" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT"><? echo number_format($row['Cost2'],2,'.',',');?></td>
<td align="left" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT"><? echo number_format($row['Cost3'],2,'.',',');?></td>
<td align="left" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT"><? echo number_format($row['Cost4'],2,'.',',');?></td>
<td align="left" class="PADDING-LEFT-5 BORDER-TOP BORDER-LEFT"><? echo number_format($row['CostSum'],2,'.',',');?></td>
</tr>
<?php
$i++;
} # while
$dbObj->freeresult($result);
?>
</table>
<?php } #if ( $numrows > 0 ) ?>
</div>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<?php if( $numrows > 0 ) { ?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="10" colspan="2"></td>
</tr>
<tr>
<td width="80%" align="left"><span style="font-size:12px">Page :
<?php
/** ตรวจสอบการ Order By ของ Query */
if( $ASCDESC=="ASC") { $ASCDESC = "DESC"; } else { $ASCDESC="ASC"; }
$paging = ceil($numrows/$limit);
//=== Display the navigation
if ($display > 1) {
$previous = $display - 1;
?><a href="<?=$PHP_SELF;?>?page=1&perpage=<?=$perpage;?>&OrderBy=<?=$OrderBy;?>&ASCDESC=<?=$ASCDESC;?>&keyword=<?=$keyword;?>"><font color="#FE830B">|« หน้าแรก</font></a> <a href="<?=$PHP_SELF;?>?page=<?=$previous;?>&perpage=<?=$perpage;?>&OrderBy=<?=$OrderBy;?>&ASCDESC=<?=$ASCDESC;?>&keyword=<?=$keyword;?>"><font color="#FE830B">« ก่อนหน้า</font></a>
<?php
} // end..if
if($numrows != $limit) {
if($paging > $scroll) {
$first = $_GET['page'];
$last = ($scroll - 1) + $_GET['page'];
} else {
$first = 1;
$last = $paging;
}
if($last > $paging ) {
$first = $paging - ($scroll - 1);
$last = $paging;
}
for($i=$first; $i<=$last; $i++) {
if($display == $i) {
echo "<font color=red size=2> [<strong>$i</strong>] </font>";
}
else {
//echo " <a href=\"$PHP_SELF?page=$i&user_id=$user_id&user_login=$user_login\">$i</a> ";
printf(" <a href=\"%s?page=%s&perpage=%s&OrderBy=%s&ASCDESC=%s&keyword=%s\">%s</a> ", $_SERVER['PHP_SELF'], $i, $perpage, $OrderBy, $ASCDESC, $keyword, $i);
}
} // end..for
} // end..if
if($display < $paging) {
$next = $display + 1;
?> <a href="<?=$PHP_SELF;?>?page=<?=$next;?>&perpage=<?=$perpage;?>&OrderBy=<?=$OrderBy;?>&ASCDESC=<?=$ASCDESC;?>&keyword=<?=$keyword;?>"><font color="#FE830B">ถัดไป »</font></a> <a href="<?=$PHP_SELF;?>?page=<?=$paging;?>&perpage=<?=$perpage;?>&OrderBy=<?=$OrderBy;?>&ASCDESC=<?=$ASCDESC;?>&keyword=<?=$keyword;?>"><font color="#FE830B">หน้าสุดท้าย »|</font></a><?php
} // end..if
?></span></td>
<td width="20%" align="right">Total: <strong><?=$numrows;?></strong> <?php if( $numrows==1) echo 'Record'; else echo 'Records'; ?></td>
</tr>
</table>
<?php } #if ?></td>
</tr>
</table>
<br /></td></tr>
</form>
</table>
</fieldset></td>
</tr>
</table>
<?php include("../templates/incFooter.php"); ?>
</body>
</html>
<?php
/** Close the Database */
$dbObj->disconn();
/** Unset Class */
unset($dbObj);
?>
|