<%@ LCID = 5129 %> <% Response.expires = 0 Response.expiresabsolute = Now() - 1 Response.addHeader "pragma", "no-cache" Response.addHeader "cache-control", "private" Response.CacheControl = "no-cache" %> <% ewCurSec = 0 ' Initialise ' User levels Const ewAllowAdd = 1 Const ewAllowDelete = 2 Const ewAllowEdit = 4 Const ewAllowView = 8 Const ewAllowList = 8 Const ewAllowReport = 8 Const ewAllowSearch = 8 Const ewAllowAdmin = 16 %> <% ' Initialize common variables x_csn = Null x_type = Null x_status = Null x_issue = Null x_card_size = Null x_expiry_date = Null x_issued_date = Null x_issued_at = Null x_issuer = Null x_reissued = Null x_hot = Null x_id = Null %> <% Response.Buffer = True sKey = Request.Querystring("key") If sKey = "" Or IsNull(sKey) Then sKey = Request.Form("key") If sKey = "" Or IsNull(sKey) Then Response.Redirect "card_datalist.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(sKey) Then ' Load Record based on key Session("ewmsg") = "No Record Found for Key = " & sKey conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "card_datalist.asp" End If End Select %>

View TABLE: card data

Back to List  Edit  Copy  Delete 

csn <% Response.Write x_csn %>
type <% Response.Write x_type %>
status <% Response.Write x_status %>
issue <% Response.Write x_issue %>
card size <% Response.Write x_card_size %>
expiry date <% If IsDate(x_expiry_date) Then Response.Write EW_FormatDateTime(x_expiry_date,7) Else Response.Write x_expiry_date End If %>
issued date <% If IsDate(x_issued_date) Then Response.Write EW_FormatDateTime(x_issued_date,7) Else Response.Write x_issued_date End If %>
issued at <% Response.Write x_issued_at %>
issuer <% Response.Write x_issuer %>
reissued <% If x_reissued = True Then sTmp = "Yes" Else sTmp = "No" End If ox_reissued = x_reissued ' Backup Original Value x_reissued = sTmp %> <% Response.Write x_reissued %> <% x_reissued = ox_reissued ' Restore Original Value %>
hot <% If x_hot = True Then sTmp = "Yes" Else sTmp = "No" End If ox_hot = x_hot ' Backup Original Value x_hot = sTmp %> <% Response.Write x_hot %> <% x_hot = ox_hot ' Restore Original Value %>
id <% Response.Write x_id %>

<% conn.Close ' Close Connection Set conn = Nothing %> <% '------------------------------------------------------------------------------- ' Function LoadData ' - Load Data based on Key Value sKey ' - Variables setup: field variables Function LoadData(sKey) Dim sKeyWrk, sSql, rs, sWhere, sGroupBy, sHaving, sOrderBy sKeyWrk = "'" & AdjustSql(sKey) & "'" sSql = "SELECT * FROM [card_data]" sSql = sSql & " WHERE [csn] = " & sKeyWrk sGroupBy = "" sHaving = "" sOrderBy = "" If sGroupBy <> "" Then sSql = sSql & " GROUP BY " & sGroupBy End If If sHaving <> "" Then sSql = sSql & " HAVING " & sHaving End If If sOrderBy <> "" Then sSql = sSql & " ORDER BY " & sOrderBy End If 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_csn = rs("csn") x_type = rs("type") x_status = rs("status") x_issue = rs("issue") x_card_size = rs("card_size") x_expiry_date = rs("expiry_date") x_issued_date = rs("issued_date") x_issued_at = rs("issued_at") x_issuer = rs("issuer") x_reissued = rs("reissued") x_hot = rs("hot") x_id = rs("id") End If rs.Close Set rs = Nothing End Function %>