<%
sql = "select count(HotelId) as chid from hoteldir a, country b, city c where a.CountryId = b.countryid and a.CityId = c.cityid";
//out.print(sql);
st = con.createStatement();
rs = st.executeQuery(sql);
int total = 0;
if(rs.next()){
total = rs.getInt("chid");
}
int pages = total/15;
if(total%15 != 0)
pages++;
int pno = 1;
if(request.getParameter("pno")!=null)
pno = Integer.parseInt(request.getParameter("pno"));
int start = 0;
if(pno != 0){
start = (pno-1)*15+1;
start --;
}
String pagination = "";
int i = 0;
%>
<%@ include file="pagination1.jsp" %>
<%
st = con.createStatement();
sql = "select * from hoteldir a, country b, city c where a.CountryId = b.countryid and a.CityId = c.cityid order by HotelId desc limit "+start+", 15";
//out.print(sql);
rs = st.executeQuery(sql);
String desc = "";
while(rs.next()){
desc = rs.getString("Description");
if(desc.length() > 200){
desc = desc.substring(0,200)+" ...";
}
%>