% 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("nilecruises") Else ewCurSec = GetAnonymousPriv("nilecruises") End If If (ewCurSec And ewAllowView) <> ewAllowView Then Response.Redirect "nilecruiseslist.asp" %> <% ' Initialize common variables x_NileCruiseID = Null: ox_NileCruiseID = Null: z_NileCruiseID = Null x_NileCruiseLogo = Null: ox_NileCruiseLogo = Null: z_NileCruiseLogo = Null fs_x_NileCruiseLogo = 0: fn_x_NileCruiseLogo = "": ct_x_NileCruiseLogo = "" wd_x_NileCruiseLogo = 0: ht_x_NileCruiseLogo = 0: a_x_NileCruiseLogo = "" x_NileCruiseName = Null: ox_NileCruiseName = Null: z_NileCruiseName = Null x_CruiseCategory = Null: ox_CruiseCategory = Null: z_CruiseCategory = Null x_CruiseItinerary = Null: ox_CruiseItinerary = Null: z_CruiseItinerary = Null x_CruiseDescription = Null: ox_CruiseDescription = Null: z_CruiseDescription = 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_Cabinfacilities = Null: ox_Cabinfacilities = Null: z_Cabinfacilities = Null x_Cruisefacilities = Null: ox_Cruisefacilities = Null: z_Cruisefacilities = Null %> <% Response.Buffer = True x_NileCruiseID = Request.QueryString("NileCruiseID") If x_NileCruiseID = "" Or IsNull(x_NileCruiseID) Then Response.Redirect "nilecruiseslist.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 "nilecruiseslist.asp" End If End Select %>
<% 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_NileCruiseID) Then LoadData = False Exit Function End If sFilter = Replace(sFilter, "@NileCruiseID", AdjustSql(x_NileCruiseID)) ' 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_NileCruiseID = rs("NileCruiseID") x_NileCruiseLogo = rs("NileCruiseLogo") x_NileCruiseName = rs("NileCruiseName") x_CruiseCategory = rs("CruiseCategory") x_CruiseItinerary = rs("CruiseItinerary") x_CruiseDescription = rs("CruiseDescription") x_Photo1 = rs("Photo1") x_Photo2 = rs("Photo2") x_Photo3 = rs("Photo3") x_Photo4 = rs("Photo4") x_Photo5 = rs("Photo5") x_Cabinfacilities = rs("Cabinfacilities") x_Cruisefacilities = rs("Cruisefacilities") End If rs.Close Set rs = Nothing End Function %>