% Response.Expires = 0 Response.ExpiresAbsolute = Now() - 1 Response.AddHeader "pragma", "no-cache" Response.AddHeader "cache-control", "private, no-cache, no-store, must-revalidate" %> <% If Not IsLoggedIn And Request.Cookies(ewProjectName)("autologin") = "autologin" And Request.Cookies(ewProjectName)("password") <> "" Then Response.Redirect "login.asp" Call LoadUserLevel() If IsLoggedIn Then ewCurSec = CurrentUserLevelPriv("hotels") Else ewCurSec = GetAnonymousPriv("hotels") End If If (ewCurSec And ewAllowView) <> ewAllowView Then Response.Redirect "hotelslist.asp" %> <% ' Initialize common variables x_HotelID = Null: ox_HotelID = Null: z_HotelID = Null x_HotelLogo = Null: ox_HotelLogo = Null: z_HotelLogo = Null fs_x_HotelLogo = 0: fn_x_HotelLogo = "": ct_x_HotelLogo = "" wd_x_HotelLogo = 0: ht_x_HotelLogo = 0: a_x_HotelLogo = "" x_HotelName = Null: ox_HotelName = Null: z_HotelName = Null x_HotelCategory = Null: ox_HotelCategory = Null: z_HotelCategory = Null x_Governorate = Null: ox_Governorate = Null: z_Governorate = Null x_BtriefLocation = Null: ox_BtriefLocation = Null: z_BtriefLocation = Null x_HotelDescription = Null: ox_HotelDescription = Null: z_HotelDescription = Null x_Photo1 = Null: ox_Photo1 = Null: z_Photo1 = Null fs_x_Photo1 = 0: fn_x_Photo1 = "": ct_x_Photo1 = "" wd_x_Photo1 = 0: ht_x_Photo1 = 0: a_x_Photo1 = "" x_Photo2 = Null: ox_Photo2 = Null: z_Photo2 = Null fs_x_Photo2 = 0: fn_x_Photo2 = "": ct_x_Photo2 = "" wd_x_Photo2 = 0: ht_x_Photo2 = 0: a_x_Photo2 = "" x_Photo3 = Null: ox_Photo3 = Null: z_Photo3 = Null fs_x_Photo3 = 0: fn_x_Photo3 = "": ct_x_Photo3 = "" wd_x_Photo3 = 0: ht_x_Photo3 = 0: a_x_Photo3 = "" x_Photo4 = Null: ox_Photo4 = Null: z_Photo4 = Null fs_x_Photo4 = 0: fn_x_Photo4 = "": ct_x_Photo4 = "" wd_x_Photo4 = 0: ht_x_Photo4 = 0: a_x_Photo4 = "" x_Photo5 = Null: ox_Photo5 = Null: z_Photo5 = Null fs_x_Photo5 = 0: fn_x_Photo5 = "": ct_x_Photo5 = "" wd_x_Photo5 = 0: ht_x_Photo5 = 0: a_x_Photo5 = "" x_Photo6 = Null: ox_Photo6 = Null: z_Photo6 = Null fs_x_Photo6 = 0: fn_x_Photo6 = "": ct_x_Photo6 = "" wd_x_Photo6 = 0: ht_x_Photo6 = 0: a_x_Photo6 = "" x_NearbySightseeing = Null: ox_NearbySightseeing = Null: z_NearbySightseeing = Null x_HotelFacilities = Null: ox_HotelFacilities = Null: z_HotelFacilities = Null x_RoomFacilities = Null: ox_RoomFacilities = Null: z_RoomFacilities = Null x_RoomCategory = Null: ox_RoomCategory = Null: z_RoomCategory = Null x_RoomFacilitiesCategory = Null: ox_RoomFacilitiesCategory = Null: z_RoomFacilitiesCategory = Null x_RoomFacilitiesSubcategory = Null: ox_RoomFacilitiesSubcategory = Null: z_RoomFacilitiesSubcategory = Null %> <% Response.Buffer = True x_HotelID = Request.QueryString("HotelID") If x_HotelID = "" Or IsNull(x_HotelID) Then Response.Redirect "hotelslist.asp" ' Get action sAction = Request.Form("a_view") If sAction = "" Or IsNull(sAction) Then sAction = "I" ' Display with input box End If ' Open connection to the database Set conn = Server.CreateObject("ADODB.Connection") conn.Open xDb_Conn_Str Select Case sAction Case "I": ' Get a record to display If Not LoadData() Then ' Load Record based on key Session(ewSessionMessage) = "No records found" conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "hotelslist.asp" End If End Select %>
Back to Hotels
<% If (ewCurSec And ewAllowEdit) = ewAllowEdit Then %>
">Edit
<% End If %>
<% If (ewCurSec And ewAllowDelete) = ewAllowDelete Then %>
">Delete
<% End If %>
<% conn.Close ' Close Connection Set conn = Nothing %><% '------------------------------------------------------------------------------- ' Function LoadData ' - Load Data based on Key Value ' - Variables setup: field variables Function LoadData() Dim rs, sSql, sFilter sFilter = ewSqlKeyWhere If Not IsNumeric(x_HotelID) Then LoadData = False Exit Function End If sFilter = Replace(sFilter, "@HotelID", AdjustSql(x_HotelID)) ' Replace key value sSql = ewBuildSql(ewSqlSelect, ewSqlWhere, ewSqlGroupBy, ewSqlHaving, ewSqlOrderBy, sFilter, "") Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sSql, conn If rs.Eof Then LoadData = False Else LoadData = True rs.MoveFirst ' Get the field contents x_HotelID = rs("HotelID") x_HotelLogo = rs("HotelLogo") x_HotelName = rs("HotelName") x_HotelCategory = rs("HotelCategory") x_Governorate = rs("Governorate") x_BtriefLocation = rs("BtriefLocation") x_HotelDescription = rs("HotelDescription") x_Photo1 = rs("Photo1") x_Photo2 = rs("Photo2") x_Photo3 = rs("Photo3") x_Photo4 = rs("Photo4") x_Photo5 = rs("Photo5") x_Photo6 = rs("Photo6") x_NearbySightseeing = rs("NearbySightseeing") x_HotelFacilities = rs("HotelFacilities") x_RoomFacilities = rs("RoomFacilities") x_RoomCategory = rs("RoomCategory") x_RoomFacilitiesCategory = rs("RoomFacilitiesCategory") x_RoomFacilitiesSubcategory = rs("RoomFacilitiesSubcategory") End If rs.Close Set rs = Nothing End Function %>