|  |  | 
          
            | คือพอค้นตามชื่อหน่วยงานมันค้นไม่เจอค่ะ และบางทีที่ค้นจาก เพื่อใช้ในงาน/โครงการ บางทีก็เจอบางทีก็ไม่เจอ งงมากเลย ยังไงรบกวนช่วยหน่อยนะค่ะ  ขอบคุณค่า 
 
 <!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"><!-- InstanceBegin template="/Templates/Body.dwt.php" codeOutsideHTMLIsLocked="false" -->
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
 <!-- InstanceBeginEditable name="doctitle" -->
 <title>ข้อมูลการใช้บริการข้อมูลGIS</title>
 <!-- InstanceEndEditable -->
 <style type="text/css">
 <!--
 body {
 margin-left: 0px;
 margin-top: 0px;
 background-color: #FFE9BF;
 background-image: url(../images/BB.jpg);
 }
 -->
 </style>
 <!-- InstanceBeginEditable name="head" --><style type="text/css">
 <!--
 a:link {
 color: #3300FF;
 }
 a:hover {
 color: #FF0099;
 }
 -->
 </style><!-- InstanceEndEditable -->
 </head>
 
 <body>
 <table width="800" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFBB">
 <!--DWLayoutTable-->
 <tr>
 <td height="200" colspan="3" valign="top"><img src="../images/GIS.jpg" alt="GIS" width="800" height="200" /></td>
 </tr>
 <tr>
 <td height="45" colspan="3" valign="top"><!-- InstanceBeginEditable name="menu" -->
 <script language = "JavaScript">
 function conf(object){
 if(confirm("คุณต้องการลบข้อมูลนี้หรือไม่")==true){
 return true;
 }
 return false;
 }
 </script>
 <form action="loginhome.php" method="post" name="form1" class="style112" id="form1"onsubmit="return check()">
 <div align="right"><a href="adddata.php">เพิ่มข้อมูล</a>  / 
 <select name="menu_pro" id="menu_pro">
 <option value="ชื่อหน่วยงาน" >ชื่อหน่วยงาน</option>
 <option value="เพื่อให้ในงานโครงการ">เพื่อให้ในงานโครงการ</option>
 </select>
 <input name="search_pro" type="text" id="search_pro"  value="<?=$_GET["search_pro"];?>" />
 <input type="submit" name="Submit" value="ค้นหา" />
 </div><!-- InstanceEndEditable --></td>
 </tr>
 <tr>
 <td width="60" height="725" valign="top"><!--DWLayoutEmptyCell--> </td>
 <td width="680" valign="top"><!-- InstanceBeginEditable name="BB" -->
 <?php
 $menu_pro=$_REQUEST['menu_pro'];
 $search_pro=$_REQUEST['search_pro'];
 include("connect.php");
 $text="SET NAMES 'tis620'";
 mysql_query($text);
 if($search_pro==""){$q="select *from re_name";}
 elseif($menu_pro=="ชื่อหน่วยงาน"){$q="select*from re_name where Org like '%$search_pro%' ";}
 else{$q="select*from re_name where Forre like '%$search_pro%' ";}
 $qr=mysql_query($q);
 $total=mysql_num_rows($qr);?>
 <?php
 // สร้างฟังก์ชั่น สำหรับแสดงการแบ่งหน้า
 //function page_navigator($before_p,$plus_p,$total,$total_p,$chk_page){
 function page($before_p,$plus_p,$total,$total_p,$chk_page){
 global $urlquery_str;
 $pPrev=$chk_page-1;
 $pPrev=($pPrev>=0)?$pPrev:0;
 $pNext=$chk_page+1;
 $pNext=($pNext>=$total_p)?$total_p-1:$pNext;
 $lt_page=$total_p-4;
 if($chk_page>0){
 echo "<a  href='?s_page=$pPrev&urlquery_str=".$urlquery_str."' class='naviPN'>Prev</a>";
 }
 if($total_p>=11){
 if($chk_page>=4){
 echo "<a $nClass href='?s_page=0&urlquery_str=".$urlquery_str."'>1</a><a class='SpaceC'>. . .</a>";
 }
 if($chk_page<4){
 for($i=0;$i<$total_p;$i++){
 $nClass=($chk_page==$i)?"class='selectPage'":"";
 if($i<=4){
 echo "<a $nClass href='?s_page=$i&urlquery_str=".$urlquery_str."'>".intval($i+1)."</a> ";
 }
 if($i==$total_p-1 ){
 echo "<a class='SpaceC'>. . .</a><a $nClass href='?s_page=$i&urlquery_str=".$urlquery_str."'>".intval($i+1)."</a> ";
 }
 }
 }
 if($chk_page>=4 && $chk_page<$lt_page){
 $st_page=$chk_page-3;
 for($i=1;$i<=5;$i++){
 $nClass=($chk_page==($st_page+$i))?"class='selectPage'":"";
 echo "<a $nClass href='?s_page=".intval($st_page+$i).$_SESSION['ses_qCurProvince']."'>".intval($st_page+$i+1)."</a> ";
 }
 for($i=0;$i<$total_p;$i++){
 if($i==$total_p-1 ){
 $nClass=($chk_page==$i)?"class='selectPage'":"";
 echo "<a class='SpaceC'>. . .</a><a $nClass href='?s_page=$i&urlquery_str=".$urlquery_str."'>".intval($i+1)."</a> ";
 }
 }
 }
 if($chk_page>=$lt_page){
 for($i=0;$i<=4;$i++){
 $nClass=($chk_page==($lt_page+$i-1))?"class='selectPage'":"";
 echo "<a $nClass href='?s_page=".intval($lt_page+$i-1).$_SESSION['ses_qCurProvince']."'>".intval($lt_page+$i)."</a> ";
 }
 }
 }else{
 for($i=0;$i<$total_p;$i++){
 $nClass=($chk_page==$i)?"class='selectPage'":"";
 echo "<a href='?s_page=$i&urlquery_str=".$urlquery_str."' $nClass  >".intval($i+1)."</a> ";
 }
 }
 if($chk_page<$total_p-1){
 echo "<a href='?s_page=$pNext&urlquery_str=".$urlquery_str."'  class='naviPN'>Next</a>";
 }
 }
 ?>
 <table width="682" border="1" align="center">
 <tr>
 <td colspan="5"><div align="center">ข้อมูลการใช้บริการข้อมูล GIS</div></td>
 </tr>
 
 <?
 $e_page=21; // กำหนด จำนวนรายการที่แสดงในแต่ละหน้า
 if(!isset($s_page)){
 $s_page=0;
 }else{
 $chk_page=$s_page;
 $s_page=$s_page*$e_page;
 }
 $q.=" LIMIT $s_page,$e_page";
 $qr=mysql_query($q);
 if(mysql_num_rows($qr)>=1){
 $plus_p=($chk_page*$e_page)+mysql_num_rows($qr);
 }else{
 $plus_p=($chk_page*$e_page);
 }
 $total_p=ceil($total/$e_page);
 $before_p=($chk_page*$e_page)+1;
 ?>
 <tr>
 <td width="75"><div align="center">ลำดับ</div></td>
 <td width="160"><div align="center">ชื่อหน่วยงาน </div></td>
 <td width="332"><div align="center">เพื่อใช้ในงาน / โครงการ </div></td>
 <td width="44"><div align="center">แก้ไข </div></td>
 <td width="35"><div align="center">ลบ </div></td>
 </tr>
 <?php
 $i=1;
 while($row_show=mysql_fetch_array($qr)){
 ?>  <?php
 if($total>0){
 while($row_show=mysql_fetch_array($qr))	{	?>
 <td><div align="center"><? echo $i." ";?></div></td>
 <td><?=$row_show['Org']?>             </td>
 <td><?=$row_show['Forre']?> </td>
 <td><div align="center"><a href="editdata.php?edit_id1=<?= $row_show['Re_id']?>" class="Body" >Edit</a></div></td>
 <td><div align="center"><a href="loginhome.php?del_id1=<?= $row_show['Re_id']?>" class="Body"onclick ="return conf(this);">Del</a></div></td>
 </tr>
 <?
 $i++;
 }
 ?>
 <? if($total>0){ ?>
 
 <? }}
 else
 { echo"<center><br>ไม่มีข้อมูลที่คุณค้นหา หรือคุณกรอกข้อมูลไม่ถูกต้อง<br><br></center>";}}
 ?>
 </table>
 <?
 // เรียกใช้งานฟังก์ชั่น สำหรับแสดงการแบ่งหน้า
 // page_navigator($before_p,$plus_p,$total,$total_p,$chk_page);
 page($before_p,$plus_p,$total,$total_p,$chk_page);
 ?>
 <?php
 $Re_id=$_REQUEST['Re_id'];
 include("connect.php");
 if($_REQUEST['del_id1'] != "") //ถ้า ค่า del_id ไม่เท่ากับค่าว่างเปล่า
 {
 $del_id1 = $_REQUEST['del_id1'];
 $sql_del1 = "delete from re_name  where Re_id= '$del_id1';";
 mysql_query($sql_del1) or die(mysql_error());
 ?>
 
 <div align="center">
 <?
 echo "<script>window.location='loginhome.php';</script>";
 }
 mysql_close();
 ?>
 <!-- InstanceEndEditable --></td>
 <td width="60" valign="top"><!--DWLayoutEmptyCell--> </td>
 </tr>
 
 
 
 
 
 
 <tr>
 <td height="36" colspan="3" valign="top"><!--DWLayoutEmptyCell--> </td>
 </tr>
 </table>
 </body>
 <!-- InstanceEnd --></html>
 
 
 
 Tag : - - - -
 
 |  
            |  |  
            | 
              
                |  |  |  |  
                |  | 
                    
                      | Date :
                          2010-02-08 14:34:28 | By :
                          manoylg | View :
                          1372 | Reply :
                          0 |  |  |  
                |  |  |  |  |  
            |  |  
		            |  |