|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /home/pathumthani_integration/integration/application/industry/ |
Upload File : |
<? session_start() ;
//header("Content-Type: text/html; charset=windows-874");
set_time_limit(0) ;
//include_once("../../config/config_epm.inc.php");
include_once("manage_user.inc.php");
mysql_connect( '123.242.173.130', 'sapphire', 'sprd!@#$%' );
$dbname1="joom_psdoc";
mysql_select_db($dbname1);
mysql_query("SET NAMES 'UTF8' ");
//mysql_query("SET NAMES TIS-620 ");
?>
<!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 rel="stylesheet" href="css/template.css" type="text/css" />
<link rel="stylesheet" href="css/style.css" type="text/css" />
<title><?=$title_name?></title>
<script language="javascript">
function mOvr(src,clrOver){
if (!src.contains(event.fromElement)) src.bgColor = clrOver;
}
function mOut(src,clrIn){
if (!src.contains(event.toElement)) src.bgColor = clrIn;
}
</script>
<style type="text/css">
<!--
A:link {
FONT-SIZE: 12px;color: #000000; FONT-FAMILY: Tahoma, "Microsoft Sans Serif";TEXT-DECORATION: underline;FONT-WEIGHT: bold; text-decoration:none;
}
A:visited {
FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Tahoma, "Microsoft Sans Serif"; TEXT-DECORATION: underline;FONT-WEIGHT: bold;text-decoration:none;
}
A:active {
FONT-SIZE: 12px; COLOR: #014d5f; FONT-FAMILY: Tahoma, "Microsoft Sans Serif"; TEXT-DECORATION: underline;FONT-WEIGHT: bold;text-decoration:none;
}
A:hover {
FONT-SIZE: 12px; COLOR: #f3960b; FONT-FAMILY: Tahoma, "Microsoft Sans Serif"; TEXT-DECORATION: underline;FONT-WEIGHT: bold;text-decoration:none;
}
.h_menu {color:#FF9900}
-->
.bg_th{
background-image:url(images/horiz-bg.png);
background-repeat:repeat-x;
background-color:#305086;
font-weight:bold;
color:#FFFFFF;
text-align:center;
text-decoration: none;
}
.bg_th1{
background-repeat:repeat-x;
background-color:#355790;
font-weight:bold;
color:#FFFFFF;
text-align:center;
}
.style1 {
font-size: 18px;
font-weight: bold;
}
</style>
<script src="common/gs_sortable.js"></script>
<link href="common/gs_sortable.css" />
<script language=JavaScript>
function Conf(object) {
if (confirm("แน่ใจว่าจะลบข้อมูล")==true) {
return true;
}
return false;
}
function CheckIsIE()
{
if (navigator.appName.toUpperCase() == 'MICROSOFT INTERNET EXPLORER') { return true;}
else { return false; }
}
function PrintThisPage()
{
if (CheckIsIE() == true)
{
parent.iframe1.focus();
parent.iframe1.print();
}
else
{
window.frames['iframe1'].focus();
window.frames['iframe1'].print();
}
}
</script>
</head>
<body>
<?
if($_GET['show']==''){
include("header.php");
}
?>
<br />
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td align="center"><strong style="color:#000033; font-size:16px;">รายงานแสดงผลข้อมูลที่ราชพัสดุ
<?
if($_GET['type']){
$sqlAmphur1=" SELECT ccDigi,ccName,ccType FROM tbl_ccaa WHERE tbl_ccaa.ccType = 'Aumpur' AND tbl_ccaa.ccDigi = '".$_GET['type']."' ";
$rsAmphur1=mysql_db_query($dbname1,$sqlAmphur1);
$resAmphur1=mysql_fetch_assoc($rsAmphur1);
echo '[';
echo iconv("utf-8","tis-620",$resAmphur1['ccName']);
echo ']';
}
?></strong></td>
</tr>
</table>
<br />
<?
if($_GET['show']==''){
?>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td> </td>
<td></td>
</tr>
<tr>
<td valign="top" align="center">
<table width="75%" border="0" bgcolor="#CCCCCC" cellpadding="3" cellspacing="1">
<tr class="bg_th">
<td align="center" width="120"><strong>อำเภอ</strong></td>
<td align="center" width="100"><strong>เนื้อที่ (ไร่)</strong></td>
<td align="center" width="100"><strong>ร้อยละ</strong></td>
</tr>
<?
$strSqlAll="
SELECT SUM(plantation_unit) AS NUMplantation_unit,
SUM(work_unit/4) AS NUMwork_unit,
SUM(wah_unit/400) AS NUMwah_unit
FROM psdoc_durable
WHERE runid IS NOT NULL
"; //(year(now())+543)
//echo $strSqlYear;
$rsAll = mysql_db_query($dbname1,$strSqlAll);
$Result_All = mysql_fetch_assoc($rsAll);
$totalUnit=$Result_All['NUMplantation_unit']+$Result_All['NUMwork_unit']+$Result_All['NUMwah_unit'];
$strSqlType="
SELECT ccDigi,ccName,ccType FROM tbl_ccaa WHERE tbl_ccaa.ccType = 'Aumpur' AND tbl_ccaa.ccDigi like '13%'
"; //(year(now())+543)
//echo $strSqlYear;
$rsType = mysql_db_query($dbname1,$strSqlType);
$data1='';
$catagory='';
while($Result_Type = mysql_fetch_assoc($rsType)){
$strSqlShop="
SELECT SUM(plantation_unit) AS NUMplantation_unit,
SUM(work_unit/4) AS NUMwork_unit,
SUM(wah_unit/400) AS NUMwah_unit
FROM psdoc_durable
WHERE amphur='".$Result_Type['ccDigi']."'
"; //(year(now())+543)
//echo $strSqlYear;
$rsShop= mysql_db_query($dbname1,$strSqlShop);
$Result_Shop= mysql_fetch_assoc($rsShop);
$unit=$Result_Shop['NUMplantation_unit']+$Result_Shop['NUMwork_unit']+$Result_Shop['NUMwah_unit'];
$data1.=$unit.';';
$catagory.=$Result_Type['ccName'].';';
$percen=($unit*100)/$totalUnit;
$totalNUM+=$unit;
//$seriesname.='จำพวก '.$Result_Class['class_id'].';';
?>
<tr bgcolor="#FFFFFF">
<td align="left"><strong><?=iconv("utf-8","tis-620",$Result_Type['ccName'])?></strong></td>
<td align="right"><? if($unit!=0){ ?><a href="?show=1&type=<?=$Result_Type['ccDigi']?>" target="_blank"><? }?><?=number_format($unit)?></a></td>
<td align="right"><?=number_format($percen,2)?></td>
</tr>
<? }
$percen=($totalUnit*100)/$totalUnit;
?>
<tr bgcolor="#DDDDDD">
<td align="left"><strong>ทั้งหมด</strong></td>
<td align="right"><? if($totalNUM!=0){ ?><a href="?show=1&type=" target="_blank"><? }?><?=number_format($totalNUM)?></a></td>
<td align="right"><?=number_format($percen,2)?></td>
</tr>
</table>
</td>
<td align="center" width="500" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="400" bgcolor="#000D70">
<tr><td>
<?
$data1=substr($data1,0,strlen($data1)-1);
$catagory=substr($catagory,0,strlen($catagory)-1);
$data1=iconv("utf-8","tis-620",$data1);
$catagory=iconv("utf-8","tis-620",$catagory);
//$catagory='ยังดำเนินการอยู่;เลิกกิจการ';
$columntitle="กราฟแสดงข้อมูลที่ราชพัสดุจำแนกตามอำเภอ";
//$columntitle=iconv("utf-8","tis-620",$columntitle);
//echo $catagory;
//$graph_path = "http://202.129.35.106/graphservice/graphservice.php"; //Sapphire Graph
//$catagory = 'ระดับความรุนแรงน้อย;ระดับความรุนแรงปานกลาง;ระดับความรุนแรงมาก';
/*$w1=375;
$h1=188;*/
$w1=400;
$h1=200;
$xgraphurl = $graph_path ."?category=$catagory"."&data1="."$data1"."&outputstyle=&numseries=1&seriesname=&graphtype=pie&title=$columntitle&xname=&yname=&subtitle=&graphstyle=srd_allvisible_lg.scs";
$xgraphurl_link = $graph_path ."?category=$catagory"."&data1="."$data1"."&outputstyle=&numseries=1&seriesname=&graphtype=pie&title=$pie&xname=&yname=&subtitle=&graphstyle=srd_allvisible_lg.scs&xcontrol=1";//srd_sf_004
?>
<table width="100%" border="0">
<tr>
<td> </td>
<td align="right"><a href="<?=$xgraphurl_link?>" target="_blank"><img src="images/maximize.gif" align="absmiddle" border="0" /></a></td>
</tr>
</table>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="<?=$w1?>" height="<?=$h1?>" >
<param name="movie" value="<?=$xgraphurl?>">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed src="<?=$xgraphurl?>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="<?=$w1?>" height="<?=$h1?>" wmode="transparent"></embed>
</object>
</td></tr></table>
</td>
<td width="20"></td>
</tr>
</table>
<?
}
?>
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td>
</td>
<td width="13%" align="left"></td>
<td width="10%"></td>
</tr>
</table>
<table width="99%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td> </td>
<td></td>
</tr>
<tr>
<td>
<?php
if($_GET['show']){
//$strSQL_1.=" and import_status = '".($_GET['import_status']-1)."' ";
$strSearch.="&show=".$_GET['show'];
}
$strSQL_1 = "SELECT *
FROM psdoc_durable
WHERE runid IS NOT NULL
";
if($_GET['type']){
$strSQL_1.=" and amphur = '".$_GET['type']."' ";
$strSearch.="&type=".$_GET['type'];
}
$strSQL_1.=" ORDER BY update_time DESC ";
$rsConn = mysql_db_query($dbname1,$strSQL_1);
$all_row = mysql_num_rows($rsConn);
$board_row_per_page = 10;
$total_page = ceil($all_row/$board_row_per_page);
$page = ($_GET['page'])?$_GET['page']:1;
$page = ($page > $total_page)?$total_page:$page;
$page = ($page <= 0)?1:$page;
$limit_start = ($page==1)?0:(($page*$board_row_per_page)-$board_row_per_page);
$limit_end = $board_row_per_page;
if($View==''){
$strSQL_1 .= " LIMIT ".$limit_start.", ".$limit_end;
$num = $limit_start ;
}
if(isset($cols)&&isset($sort)){
$solink="&cols=$cols&sort=$sort";
}
$text_search = "";
$prev_page = $page - 1; $prev_page = ($prev_page <= 1)?1:$prev_page;
$prev = "self.location='".$PHP_SELF."?".$strSearch.$text_search."&search=$search&page=$prev_page$link$solink'";
$next_page = $page + 1; $next_page = ($next_page >= $total_page)?$total_page:$next_page;
$next = "self.location='".$PHP_SELF."?".$strSearch.$text_search."&search=$search&page=$next_page$link$solink'";
$prev_Tenpage=$page-$board_row_per_page;$prev_Tenpage=($prev_Tenpage<= 1)?1:$prev_Tenpage;
$prevTen = "self.location='".$PHP_SELF."?".$strSearch.$text_search."&search=$search&page=$prev_Tenpage$link$solink'";
$nextTenPage=$page+$board_row_per_page;$next_TenPage=($next_TenPage >= $total_page)?$total_page:$next_TenPage;
$nextTen = "self.location='".$PHP_SELF."?".$strSearch.$text_search."&search=$search&page=$nextTenPage$link$solink'";
?>
<? if($View==""){$Klink="?".$strSearch.$text_search."&View=All"; $CSh="ข้อมูลทั้งหมด"; $Klink2="?".$strSearch.$text_search."&View=";}else{$Klink="?".$strSearch.$text_search."&View=";$CSh="ข้อมูล ".$board_row_per_page." รายการล่าสุด";$Klink2="?".$strSearch.$text_search."&View=All";}?>
ทั้งหมด <b> <font color="#CC0000">
<?=number_format($all_row);?>
</font> </b> รายการ
<? if($View==""){?>
แบ่งเป็น <b><font color="#0033CC">
<?=number_format($total_page);?>
</font></b> หน้า
<? }?>
<a href="<?=$Klink?>"><img src="img/Search-Add.gif" alt="<?=$CSh?>" width="16" height="16" border="0" /></a>
<? if($View==''){?>
<? if($page==1){?>
<img src="img/page_div_icon/xFirst.gif" />
<? }else{?>
<img src="img/page_div_icon/First.gif" align="absmiddle" border="0" width="10" height="12" onclick="<?=$prevTen;?>" onMouseOver="style.cursor='hand';"/>
<? }?>
<? if($page==1){?>
<img src="img/page_div_icon/xPrevious.gif" />
<? }else{?>
<img src="img/page_div_icon/Previous.gif" align="absmiddle" border="0" width="7" height="12" onclick="<?=$prev;?>" onMouseOver="style.cursor='hand';"/>
<? }?>
<?php
$board_link_num = $board_row_per_page;
$ii = 1;
if ( $board_link_num > $total_page ){
$loop_page = $total_page;
} else {
$bx = ceil($board_link_num / 2);
$pp = $page - $bx;
$pn = $page + $bx;
$loop_page = $pn;
$ii = $pp;
if ( $total_page <= $loop_page ) {
$loop_page = $total_page;
$ii = $loop_page - ($board_link_num -1);
}
if ( $ii < 1 ) {
$ii = 1;
$loop_page = $ii + ($board_link_num -1);
}
}
for($i=$ii;$i<=$loop_page;$i++){
if ( $i==$page || !$page ) {
$txt = "<b>$i</b>";
} else {
$txt = $i;
}
?>
<a href="<?=$PHP_SELF;?>?Sort=<?=$Sort;?>&search=<?=$search?>&<?=$text_search?>&page=<?=$i;?><?=$strSearch;?>"><?=$txt;?>
</a>
<?
} # for
?>
<? if($page==$loop_page){?>
<img src="img/page_div_icon/xNext.gif" />
<? }else{?>
<img src="img/page_div_icon/Next.gif" align="absmiddle" border="0" width="7" height="12" onClick="<?=$next;?>" onMouseOver="style.cursor='hand';"/>
<? }?>
<? if($page==$loop_page){?>
<img src="img/page_div_icon/xLast.gif" />
<? }else{?>
<img src="img/page_div_icon/Last.gif" align="absmiddle" border="0" width="10" height="12" onClick="<?=$nextTen;?>" onMouseOver="style.cursor='hand';"/>
<?
}
}#End View=
?>
</td>
<td align="right"><?php /*?><a href="report_year_fee_pdf.php?year=<?=$_GET['year']?>" target="_blank"><IMG src="img/pdf.gif" alt="ผลการค้นหา PDF" width="18" height="18" border="0" title="PDF" align="absmiddle"><?php */?></td>
</tr>
</table>
<table width="99%" border="0" align="center" bgcolor="#CCCCCC" cellpadding="3" cellspacing="1" id="my_table">
<thead>
<tr class="bg_th">
<th width="50" rowspan="2" align="center"><strong>ลำดับที่</strong></th>
<th width="160" rowspan="2" align="center"><font color="#FFFFFF"><strong>ตำบล</strong></font></th>
<th width="160" rowspan="2" align="center"><font color="#FFFFFF"><strong>อำเภอ</strong></font></th>
<th width="80" rowspan="2" align="center"><font color="#FFFFFF"><strong>หมายเลขทะเบียน</strong></font></th>
<th colspan="2" align="center"><font color="#FFFFFF"><strong>หนังสือสำหรับที่ดิน</strong></font></th>
<th colspan="3" align="center"><font color="#FFFFFF"><strong>เนื้อที่</strong></font></th>
<th width="180" rowspan="2" align="center"><font color="#FFFFFF"><strong>การใช้ประโยชน์</strong></font></th>
<th colspan="3" align="center"><font color="#FFFFFF"><strong>สภาพ</strong></font></th>
<th width="100" rowspan="2" align="center"><font color="#FFFFFF"><strong>หมายเหตุ</strong></th>
</tr>
<tr class="bg_th1">
<th width="80" align="center"><font color="#FFFFFF"><strong>ประเภท</strong></font></th>
<th width="80" align="center"><font color="#FFFFFF"><strong>หมายเลข</strong></font></th>
<th width="70" align="center"><font color="#FFFFFF"><strong>ไร่</strong></font></th>
<th width="70" align="center"><font color="#FFFFFF"><strong>งาน</strong></font></th>
<th width="70" align="center"><font color="#FFFFFF"><strong>วา</strong></font></th>
<th width="50" align="center"><font color="#FFFFFF"><strong>ดี</strong></font></th>
<th width="50" align="center"><font color="#FFFFFF"><strong>ชำรุด</strong></font></th>
<th width="50" align="center"><font color="#FFFFFF"><strong>สูญหาย</strong></font></th>
</tr>
</thead>
<tbody>
<?
/*$strSQL_1 = "SELECT type_id,commendate,tempdate,fname,capital,year_fee,tempstop
FROM industry_register
WHERE fyear<=".$year_value."
ORDER BY commendate
";*/
//echo $strSQL_1;
$rsConn_1 = mysql_db_query($dbname1,$strSQL_1);
$i=0;
while ( $Result_1 = mysql_fetch_assoc($rsConn_1)) {
$i++;
$rowNumb = ($i+($board_link_num*$page)-$board_link_num);
$sqlTambol=" SELECT ccDigi,ccName,ccType FROM tbl_ccaa WHERE tbl_ccaa.ccType = 'Tamboon' AND tbl_ccaa.ccDigi = '".$Result_1['tambol']."' ";
$rsTambol=mysql_db_query($dbname1,$sqlTambol);
$resTambol=mysql_fetch_assoc($rsTambol);
$sqlAmphur=" SELECT ccDigi,ccName,ccType FROM tbl_ccaa WHERE tbl_ccaa.ccType = 'Aumpur' AND tbl_ccaa.ccDigi = '".$Result_1['amphur']."' ";
$rsAmphur=mysql_db_query($dbname1,$sqlAmphur);
$resAmphur=mysql_fetch_assoc($rsAmphur);
$sqlProvice=" SELECT ccDigi,ccName,ccType FROM tbl_ccaa WHERE tbl_ccaa.ccType = 'Changwat' AND tbl_ccaa.ccDigi = '".$Result_1['province']."' ";
$rsProvice=mysql_db_query($dbname1,$sqlProvice);
$resProvice=mysql_fetch_assoc($rsProvice);
//$location=$Result_1['location'].' '.$resTambol['ccName'].' '.$resAmphur['ccName'].' '.$resProvice['ccName'].' รหัสไปษณีย์ '.$Result_1['zipcode'];
?>
<tr bgcolor="#FFFFFF">
<td align="center"><?=$rowNumb?></td>
<td align="left"><?=iconv("utf-8","tis-620",$resTambol['ccName'])?></td>
<td align="left"><?=iconv("utf-8","tis-620",$resAmphur['ccName'])?></td>
<td align="center"><?=iconv("utf-8","tis-620",$Result_1['code'])?></td>
<td align="left"><?=iconv("utf-8","tis-620",$Result_1['book_type'])?></td>
<td align="center"><?=$Result_1['book_id']?></td>
<td align="right"><?=$Result_1['plantation_unit']?></td>
<td align="right"><?=$Result_1['work_unit']?></td>
<td align="right"><?=$Result_1['wah_unit']?></td>
<td align="left"><?=iconv("utf-8","tis-620",$Result_1['useful'])?></td>
<td align="center"><?=($Result_1['status']=='1')?'<img src="img/right.gif" alt="" title="" border="0" align="absmiddle" />':''?></td>
<td align="center"><?=($Result_1['status']=='2')?'<img src="img/right.gif" alt="" title="" border="0" align="absmiddle" />':''?></td>
<td align="center"><?=($Result_1['status']=='3')?'<img src="img/right.gif" alt="" title="" border="0" align="absmiddle" />':''?></td>
<td align="left"><?=$Result_1['note']?></td>
</tr>
<? }?>
</tbody>
<tfoot>
<!--<tr bgcolor="#DDDDDD">
<td align="right"><strong>รวม </strong></td>
<td align="right"> </td>
<td align="right"> </td>
<td align="right"> </td>
<td align="right"> </td>
</tr>-->
</tfoot>
</table>
<br>
<script type="text/javascript">
<!--
var TSort_Data = new Array ('my_table', '', 'h','h','h','h');
var TSort_Classes = new Array ('row1', 'row2');
tsRegister();
// -->
</script>
</body>
</html>