%
if request("submit") = "submit" then
title = request("seltitle")
fname = request("fname")
sname = request("sname")
address = request("address")
country = request("country")
zip = request("postcode")
phone = request("phone")
mobile = request("mobile")
email = request("mail")
dec_date = request("date1")
can_date = request("date2")
if dec_date <> "" then
date1 = split(dec_date,"/")
dec_date = date1(1)&"/"&date1(0)&"/"&date1(2)
end if
if can_date <> "" then
date2 = split(can_date,"/")
can_date = date2(1)&"/"&date2(0)&"/"&date2(2)
'can_date = month(can_date)&"/"&day(can_date)&"/"&year(can_date)
end if
if can_date <> "" then
set objrs1 = Server.CreateObject("ADODB.Recordset")
objrs1.open "Select * from gift where email = '" &email& "' and dec_date <= #"&can_date&"#",connobj,2,3,1
if not objrs1.eof then
allow = "True"
else
allow = "False"
msg = "Cancel previous declaration date is prior to the existing declaration date.."
end if
objrs1.close
end if
set objrs = Server.CreateObject("ADODB.Recordset")
objrs.open "Select * from gift where email = '" &email& "'",connobj,2,3,1
if not objrs.eof then
objrs("title") = title
objrs("fname") = fname
objrs("sname") = sname
objrs("address") = address
objrs("country") = country
objrs("zip") = zip
objrs("phone") = phone
objrs("mobile") = mobile
objrs("email") = email
if dec_date <> "" then
objrs("dec_date") = dec_date
msg = "Records updated successfully.."
end if
if can_date <> "" and allow = "True" then
objrs("can_date") = can_date
msg = "Records updated successfully.."
end if
objrs.update
else
objrs.addnew
objrs("title") = title
objrs("fname") = fname
objrs("sname") = sname
objrs("address") = address
objrs("country") = country
objrs("zip") = zip
objrs("phone") = phone
objrs("mobile") = mobile
objrs("email") = email
if dec_date <> "" then
objrs("dec_date") = dec_date
msg = "Records submitted successfully.."
end if
if can_date <> "" then
objrs("can_date") = can_date
msg = "Records submitted successfully.."
end if
objrs.update
end if
objrs.close
response.Redirect "gift-aid-form.asp?msg="&msg
end if
%>
|
 |
 |
|
 |
Gift Aid Declaration Form |
|
|
| |
|
| |
<%if request("msg") = "" or request("msg") = "Cancel previous declaration date is prior to the existing declaration date.." then%>
<%else%>
<%end if%>
|
|
|
|
|
|
 |
|
| |
|
|
|
©2006 Surya Foundation. All rights reserved |
|
|
 |
|