<% // @Author: Dhunva Saisom ( Dun ) // @Project Name: Sisatchanalai // Number of Files: many // Files Name: ancient_town.jsp // // // Code provided by Author Dhunva Saisom ( Dun ) // as is,with warranties as to performance, fitness, merchantability,and any other warranty // ( whether expressed or implied ).Terms of Agreement: By using this source code, you agree // to the following terms... // 1) You may use this source code in personal or business projects by buying license. // 2) You MAY NOT redistribute this source code (for example to a web site) without // written permission from the original author.Failure to do so is a violation of copyright // laws. // If you find any bug in this source codes please e-mail : thedun_dec@hotmail.com %> <%@ page contentType="text/html;charset=utf-8" %> <%@ page import="java.sql.*,java.util.*" %> <% ResultSet rs, rs2; int pid = 0; int firstRow = 0; int totalRow = 0; int totalPage = 0; int intlinkGroup = 0; int preview = 0; int pageLinkLen = 10; String chDelete = null; String pageNo = request.getParameter ( "pageNo" ); String linkGroup = request.getParameter ( "linkGroup" ); String region = request.getParameter ( "region" ); String search = request.getParameter ( "search" ); if ( pageNo == null ) { pageNo = "1"; } if ( linkGroup == null ) { linkGroup = "0"; } if ( region == null ) { region = "I"; } if ( search != null ) { search = search.trim ( ); if ( search.equals ( "" ) ) { search = null; } } String search2 = null; if ( search != null ) { search2 = new String ( search.getBytes ( "ISO8859_1" ), "utf-8" ); } pid = Integer.parseInt ( pageNo ); intlinkGroup = Integer.parseInt ( linkGroup ); int sysid = 2; %> <%@ include file = "preview.jsp" %> Important
te
<% String intown = null; String outtown = null; String inmouse = null; String outmouse = null; if ( region.equals ( "I" ) ) { //out.print ( "in" ); intown = "Important_15.gif"; outtown = "Important_17.gif"; inmouse = "Important_15.gif"; outmouse = "Important_17.gif"; } else { //out.print ( "out" ); intown = "important_out_15.gif"; outtown = "important_out_17.gif"; inmouse = "important_out_15.gif"; outmouse = "important_out_17.gif"; } %>
กรอกคำที่ต้องการค้นหา
<% int placeid = 0; int rowCount = 0; String strSQL = null; String place_name = null; String main_topic = null; String url_image = null; if ( search != null ) { if ( region.equals ( "I" ) ) { strSQL = "Select * from places where place_type='I' and place_name Like '%" + search + "%' order by place_name asc"; } else { strSQL = "Select * from places where place_type='O' and place_name Like '%" + search + "%' order by place_name asc"; } } else { if ( region.equals ( "I" ) ) { strSQL = "Select * from places where place_type='I' order by place_name asc"; } else { strSQL = "Select * from places where place_type='O' order by place_name asc"; } } rs = dbcon.executeQuery ( strSQL, chDelete, preview, pid ); pid = dbcon.getpageID ( ); totalRow = dbcon.getTotalRow ( ); totalPage = dbcon.getTotalPage ( ); int rec_no = ( pid * preview ) - preview; while ( rs.next ( ) ) { placeid = rs.getInt ( "placeid" ); place_name = rs.getString ( "place_name" ); main_topic = rs.getString ( "main_topic" ); // @@@ START LINUX //place_name = new String ( place_name.getBytes ( "ISO8859_1" ), "MS874" ); //main_topic = new String ( main_topic.getBytes ( "ISO8859_1" ), "MS874" ); // @@@ END LINUX if ( main_topic.length ( ) > 350 ) { main_topic = main_topic.substring ( 0, 350 ) + "..."; } url_image = "up_image/no_image.gif"; rs2 = dbcon.executeQueryAll ( "Select * from up_images where isactive='Y' and placeid=" + placeid ); while ( rs2.next ( ) ) { url_image = rs2.getString ( "url_image" ); } rs2.close ( ); %> <% rowCount = rowCount + 1; if ( rowCount >= preview ) { rs.afterLast ( ); } } rs.close ( ); if ( rowCount == 0 ) { pid = 0; } %>
<% if ( url_image != null ) { %> <% } else { %> <% } %>
<%= place_name %>   <%= main_topic %>
หน้า <%= pid %> จาก <%= totalPage %> ( <%= totalRow %> แห่ง )
<% int goPage = 0; int totalpageLink = totalPage/pageLinkLen; int start_pageLink = pageLinkLen * intlinkGroup; if ( totalPage % pageLinkLen > 0 ) { totalpageLink = totalpageLink + 1; } if ( start_pageLink > 0 ) { out.print ( " " ); out.print ( "<< " + ( ( start_pageLink + 1 ) - pageLinkLen ) + "-" + start_pageLink + "" ); out.print ( " | " ); } for ( int i = 1; i <= pageLinkLen; i++ ) { goPage = i + start_pageLink; if ( goPage <= totalPage ) { if ( pid == goPage ) { out.print ( "" + goPage + " | " ); } else { out.print ( "" ); out.print ( goPage + " | " ); } } else { goPage = totalPage; } } if ( goPage < totalPage ) { out.print ( " " + ( goPage + 1 ) ); if ( ( goPage + pageLinkLen ) < totalPage ) { out.print ( "-" + ( goPage + pageLinkLen ) + " >>" ); } else { if ( ( goPage + 1 ) < totalPage ) { out.print ( "-" + totalPage + " >>" ); } else { out.print ( "" ); } } out.print ( "" ); } %>
 
<%@ include file = "footer.jsp" %>