<% FUNCTION fixQuotes( theString ) fixQuotes = REPLACE( theString, "'", "''" ) END FUNCTION Dim sHotelArea, sHotelStars, sHotelName Set Cnn = Server.CreateObject("Adodb.Connection") Set Rst = Server.CreateObject("Adodb.Recordset") Cnn.Open Application("DbPath") sHotelName = fixQuotes(Trim(Request("HN"))) '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Dim original original = SetLocale("en-us") Ip = Request.ServerVariables("REMOTE_ADDR") Referer = Request.ServerVariables("HTTP_REFERER") Via = Request.ServerVariables("HTTP_VIA") 'BC: browser capabilities components Set BC = Server.CreateObject("MSWC.BrowserType") browser = bc.Browser platform = bc.Platform majorver = bc.Majorver minorver = bc.Minorver Set BC = Nothing 'Create time and Dates LebNow = DateAdd("h", 7, now) d = Day(LebNow) 'Day m = Month(LebNow) 'Month y = Year(LebNow) 'Year LebDate = CDate(m & "/" & d & "/" & y) Set CnnBC = Server.CreateObject("ADODB.Connection") CnnBC.Open Application("Admin") CnnBC.Execute "INSERT INTO hits (HotelName, ip, via, referer, browser, platform, majorver, minorver,lebDate, lebNow, d, m, y) Values ('" & sHotelName & "', '" & ip & "', '" & via & "', '" & referer & "', '" & browser & "', '" & platform & "', '" & majorver & "', '" & minorver & "', #" & lebDate & "#, #" & LebNow & "#, " & d & ", " & m & ", " & y & ")" Set CnnBC = Nothing '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'Cnn.Execute "Update tbl_HotelsHit Set HotelHits = HotelHits + 1 WHERE HotelName LIKE '" & sHotelName & "%' " sqlStr = "SELECT * FROM hotels, hotelsLocations WHERE hotels.name = hotelsLocations.hotelname" If sHotelName <> "" Then sqlStr = sqlStr & " AND hotels.Name LIKE '" & sHotelName & "%'" End If Rst.Open sqlStr, Cnn, 3, 1 'static ' read only Records = CInt(Rst.RecordCount) If Rst.Eof = True Then Response.Redirect("DisplayMsg2.asp?Msg=No Records Where Found") Response.End() End If HotelName = Trim(Rst("Name")) HotelStars = Trim(Rst("NumberOfStars")) HotelLocation = Trim(Rst("District")) & " - " & Trim(Rst("Kaza")) HotelFax = Trim(Rst("Fax")) HotelURL = Trim(Rst("URL")) HotelEmail = Trim(Rst("Email")) HotelPhone = Trim(Rst("Phone")) HotelImagePath = Trim(Rst("ImagePath")) If HotelImagePath = "" Or HotelImagePath = "-" Or IsEmpty(HotelImagePath) = True Or IsNull(HotelImagePath) = True Then HImgPath1 = "GENERIC.jpg" HImgPath2 = "GENERIC.jpg" HImgPath3 = "GENERIC.jpg" Else HImgPath = Split(HotelImagePath, ",", -1, 1) HImgPath1 = Trim(HImgPath(0)) HImgPath2 = Trim(HImgPath(1)) HImgPath3 = Trim(HImgPath(2)) End If HotelIsActive = Trim(Rst("IsActive")) HotelPoBox = Trim(Rst("PoBox")) HotelNbOfRooms = Trim(Rst("NumberOfSingle")) HotelNbOfBeds = Trim(Rst("RoomFacilities")) HotelDescription = Trim(Rst("Description")) HotelAddress = Trim(Rst("Address")) S1 = InStr(1, HotelStars, "1", 1) S2 = InStr(1, HotelStars, "2", 1) S3 = InStr(1, HotelStars, "3", 1) S4 = InStr(1, HotelStars, "4", 1) S5 = InStr(1, HotelStars, "5", 1) S6 = InStr(1, HotelStars, "-", 1) If S1 <> 0 Then HotelStars = "Stars1.jpg" ElseIf S2 <> 0 Then HotelStars = "Stars2.jpg" ElseIf S3 <> 0 Then HotelStars = "Stars3.jpg" ElseIf S4 <> 0 Then HotelStars = "Stars4.jpg" ElseIf S5 <> 0 Then HotelStars = "Stars5.jpg" ElseIf S6 <> 0 Then HotelStars = "Stars6.jpg" End If %>
>>BACK