%@ Language=VBScript%>
<%
'on error resume next
Dim City, HotelType, Service, StarRate, rsHotels, sStr,Cntr, PageLength, aStr, Location, InstStr, State
'Kerala Hit counter
'--------------------------------------------
SERVER.EXECUTE("keralaHitStats.asp")
'--------------------------------------------
if Request.QueryString="" then
if len(FixQuotes(Trim(Request("City"))))=0 and Trim(Request("City1"))<>"All" then
City = FixQuotes(Trim(Request("City1")))
else
City = FixQuotes(Trim(Request("City")))
End if
Location = FixQuotes(Trim(Request("Location")))
HotelType = Request("Catg")
Service = FixQuotes(Trim(Request("Service")))
StarRate = FixQuotes(Trim(Request("Class")))
State = FixQuotes(Trim(Request("State")))
else
PresentPage = Request.QueryString("PresentPage")
City = Request.QueryString("City")
Location = Request.QueryString("Location")
HotelType = Request.QueryString("Catg")
Service = Request.QueryString("Service")
StarRate = Request.QueryString("StarRate")
State = Request.QueryString("State")
End if
sStr=""
Cntr=1
Openconnection MyConn
Set rsHotels = Server.CreateObject ("ADODB.Recordset")
'----- Create a query definition --------
sStr=""
if State="" then
sStr = "SELECT * FROM Hotels Where HtlState = 'KL' And"
else
sStr = "SELECT * FROM Hotels Where HtlState = '" & State & "' And "
End if
'sStr = "SELECT (SELECT COUNT(*) FROM Hotels e2 WHERE e2.HtlSlno <= e.HtlSlno) AS RowNumber ,* "
'sStr = sStr & " FROM Hotels e Where "
If City<>"" Then
aStr = " HtlCity LIKE '%" & city & "%' "
Else
aStr = " HtlCity LIKE '%' "
End If
If Location<>"" Then
aStr = " And HtlLocation LIKE '%" & Location & "%' "
End If
If (HotelType<>"" And HotelType<>"9") Then
aStr = aStr & " And HtlCatg = " & HotelType
End If
If Service<>"" Then
aStr = aStr & " And HtlServices LIKE '%" & Service & "%' "
End if
If StarRate<>"" And StarRate<>"0" Then
aStr = aStr & " And HtlHotelClass LIKE '%" & StarRate & "%' "
End If
sStr = sStr & aStr & " Order By HtlHotelName, HtlCity"
rsHotels.Open sStr, MyConn, adOpenStatic , adLockOptimistic
if not rsHotels.EOF and trim(request("PresentPage"))="" then
rsHotels.MoveFirst
InstStr="Delete From HotelSearchedLinks Where HslDate < Getdate() and HslSessionID ="& session.SessionID
MyConn.Execute InstStr
iFlag="Y"
InstStr="Delete From dbo.HotelSearchedLinks where (datediff(d,getdate(),HslDate)) <-1"
MyConn.Execute InstStr
Call inValues
end if
Sub inValues
do while not rsHotels.EOF
iStr = "Insert Into HotelSearchedLinks "
iStr = iStr & " ( HslUserName ,HslSearchedLink , HslSessionID) Values ('"
iStr = iStr & rsHotels.Fields("HtlHotelName") &"',"
iStr = iStr & " '" & rsHotels.Fields("HtlHotelName") & "',"
iStr = iStr & session.SessionID &")"
MyConn.Execute iStr
rsHotels.MoveNext
Loop
If rsHotels.RecordCount <>0 Then
rsHotels.MoveFirst
iFlag = True
End If
End Sub
If Not rsHotels.EOF Then
PresentPage = trim(request("PresentPage"))
If PresentPage = "" Then PresentPage=1
rsHotels.PageSize = 4
rsHotels.AbsolutePage = cInt(PresentPage)
rCount=0
End If
%>
<%=Title%> Searched Hotels
<%if not rsHotels.eof then%>
<%Do While Not rsHotels.eof and rCount< rsHotels.PageSize %>