% Response.expires = 0 Response.expiresabsolute = Now() - 1 Response.addHeader "pragma", "no-cache" Response.addHeader "cache-control", "private" Response.addHeader "cache-control", "no-cache" Response.addHeader "cache-control", "no-store" 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_id = Null: ox_id = Null x_Names = Null: ox_Names = Null x_Sex = Null: ox_Sex = Null x_Address = Null: ox_Address = Null x_Phone = Null: ox_Phone = Null x_Email = Null: ox_Email = Null x_Country = Null: ox_Country = Null x_offering = Null: ox_offering = Null x_contact = Null: ox_contact = Null x_partner = Null: ox_partner = Null x_TypeofPartner = Null: ox_TypeofPartner = Null x_Occupation = Null: ox_Occupation = Null %> <% Response.Buffer = True ' Load key from QueryString bCopy = True x_id = Request.QueryString("id") If x_id = "" Or IsNull(x_id) Then bCopy = False End If ' Get action sAction = Request.Form("a_add") If (sAction = "" Or IsNull(sAction)) Then If bCopy Then sAction = "C" ' Copy record Else sAction = "I" ' Display blank record End If Else ' Get fields from form x_id = Request.Form("x_id") x_Names = Request.Form("x_Names") x_Sex = Request.Form("x_Sex") x_Address = Request.Form("x_Address") x_Phone = Request.Form("x_Phone") x_Email = Request.Form("x_Email") x_Country = Request.Form("x_Country") x_offering = Request.Form("x_offering") x_contact = Request.Form("x_contact") x_partner = Request.Form("x_partner") x_TypeofPartner = Request.Form("x_TypeofPartner") x_Occupation = Request.Form("x_Occupation") End If ' Open connection to the database Set conn = Server.CreateObject("ADODB.Connection") conn.Open xDb_Conn_Str Select Case sAction Case "C": ' Get a record to display If Not LoadData() Then ' Load Record based on key Session("ewmsg") = "No records found" conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "Givinglist.asp" End If Case "A": ' Add If AddData() Then ' Add New Record Session("ewmsg") = "Add New Record Successful" conn.Close ' Close Connection Set conn = Nothing Response.Clear Response.Redirect "Givinglist.asp" Else End If End Select %>
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||