<%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> TwiHotels : My Hotels <%@ include file="connectionDB.jsp" %>
<%@ include file="header.jsp" %> <% ResultSet rs = null; Statement st = null; String sql = ""; try { %> <% if(session.getAttribute("uid")!=null) { String twitterId = ""; int uid = 0; st = con.createStatement(); sql = "select user_name, user_id from login where user_id = '"+Integer.parseInt(session.getAttribute("uid").toString())+"'"; rs = st.executeQuery(sql); if(rs.next()){ twitterId = rs.getString("user_name"); uid = rs.getInt("user_id"); } %> <% } else { session.setAttribute("page","myHotels"); %> <% } %>
  Home  
My Hotels
Hotel Directory »
<% st = con.createStatement(); sql = "select HotelId, HotelName, countryname, cityname from hoteldir a, country b, city c where a.CountryId = b.countryid and a.CityId = c.cityid and (UId = '"+Integer.parseInt(session.getAttribute("uid").toString())+"' or TwitterId='"+twitterId+"')"; //out.print(sql); rs = st.executeQuery(sql); if(!rs.next()){ %> <% } else { %> <% rs.beforeFirst(); int i = 1; while(rs.next()){ %> <% i++; } } %>
No hotel submitted by you.
Submit a Hotel »
SNo. Hotel Name Country City Edit Delete
<%=i%> "><%=rs.getString("HotelName")%> <%=rs.getString("countryname")%> <%=rs.getString("cityname")%>
">
"> ','<%=rs.getString("HotelName")%>')" src="images/delete.png" width="23px" height="23px">
You are not logged in
Click here to Login using Twitter
<% } catch(Exception ex){ System.out.println("Error in edithotel "+ex.getMessage()); } finally { if(rs!=null) rs.close(); if(con!=null) con.close(); } %> <%@ include file="footer.jsp" %> <% if(session.getAttribute("message")!=null) { %> <% session.removeAttribute("message"); } %>