%@LANGUAGE="VBSCRIPT"%>
<%
'Option explicit 'Forces variable declaration
'Author : Kenny Oduyeye (http://www.seniorboys.com)
'==================================================
Response.Expires = -1500 'This prevents this page from being cached by the browser
'======================================================================================
' Action : This is a new page allowing new church details to be registered
' : on the praiselink database
' Company : Seniorboys - http://www.seniorboys.com
' Contact Info : kenny@seniorboys.com - 01708 857931
' Author : Kenny Oduyeye
' Description : This user interface allows users to add their church
' details into the database, but is only visible to users after
' checks carried out by the praiselink administrator.
' Notes: : Validation routine for this page is in the valid.js file
' Date : March 2003
' Version : 1.0
'=======================================================================================
'Declare local variables
'=======================
myConstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Request.ServerVariables("APPL_PHYSICAL_PATH") & "\my_db\praiselink.mdb;"
Dim oRs1, b_c
Dim RS, oConn, strSql, myConstring, MM_insertCmd
b_c = "kenny@seniorboys.com"
set oRs1 = Server.CreateObject("ADODB.Recordset")
oRs1.ActiveConnection = myconstring
Dim strName, strAddr1, strAddr2, strPostcode, strCity, strMidwk, strMtos, strService, strTel, strPastor, strWeb, strMail, strStatus
Dim objCDO, strBody, strTo, strFrom, strSubject
strStatus = "pending"
'Free Service
'============
strName = Request.Form("txtchurch")
strAddr1 = Request.Form("txtAddr1")
strAddr2 = Request.Form("txtAddr2")
strPostcode = Request.Form("txtpcode")
strCity = Request.Form("txtcity")
'Replace every occurence of a single quote with a matching closing quote
'=======================================================================
strName = Replace(strName, "'", "''")
strAddr1 = Replace(strAddr1, "'", "''")
strAddr2 = Replace(strAddr2, "'", "''")
strPostcode = Replace(strPostcode, "'", "''")
strCity = Replace(strCity, "'", "''")
'Paid Service
'============
strMidwk = Request.Form("midwk")
strMtos = Request.Form("tos")
strService = Request.Form("txttime")
strTel = Request.Form("txttel")
strPastor = Request.Form("txtpastor")
strWeb = Request.Form("txtweb")
strMail = Request.Form("txtmail")
'Replace every occurence of a single quote with a matching closing quote
'=======================================================================
strService = Replace(strService, "'", "''")
strTel = Replace(strTel, "'", "''")
strPastor = Replace(strPastor, "'", "''")
strWeb = Replace(strWeb, "'", "''")
strMail = Replace(strMail, "'", "''")
%>
Praiselink.com
Artist of the Month:
The Tribe
|
| Add Your Church |
| (Please enter your full postcode to register) |
|
Paid Service
|
| (£25 + VAT per anum for paid service) |
| (For an extra £25 + VAT per anum, you can advertise your church banner on our website) |
<%
If strName <> "" AND strAddr1 <> "" AND strAddr2 <> "" AND strPostcode <> "" AND strCity <> "" Or strName <> "" AND strAddr1 <> "" AND strAddr2 = "" AND strPostcode <> "" AND strCity <> "" Then
'Open our recordset
'==================
oRs1.Source = "SELECT postalcode FROM churches WHERE postalcode = '" & strPostcode & "'"
oRs1.Open
If Not oRs1.EOF Then
%>
<%
End If
If oRs1.EOF AND strMidwk <> "" AND strMtos <> "" AND strService <> "" AND strTel <> "" AND strPastor <> "" Then
'Add Church details of both free service and Paid service to the database
'========================================================================
strSql = "insert into churches(Churchname, AddressLine1, AddressLine2, Postalcode, City, Telephone, MidweekService, TimeOfService, WeekendService, Pastor, Website, EmailAddress, Status) values ('" & strName & "', '" & strAddr1 & "', '" & strAddr2 & "', '" & strPostcode & "', '" & strcity & "', '" & strTel & "', '" & strMidwk & "', '" & strMtos & "', '" & strService & "', '" & strPastor & "', '" & strWeb & "', '" & strMail & "', '" & strStatus & "')"
' finish the sql and execute it
'==============================
Set MM_insertCmd = Server.CreateObject("ADODB.Command")
MM_insertCmd.ActiveConnection = myConstring
MM_insertCmd.CommandText = strSql
MM_insertCmd.Execute
'Populate body of email with automated text
'===========================================
strBody = "This Email confirms that a paid service (New Church Details) is being registered on your database. " & vbCrLf & vbCrLf
Set objCDO = Server.CreateObject("CDONTS.NewMail")
strTo = "info@praiselink.com"
strFrom = "NewRegistration@praiselink.com"
strSubject = "Registration for paid service"
strBCC = b_c
objCDO.To = strTo
objCDO.Bcc = strBCC
objCDO.From = strFrom
objCDO.Subject = strSubject
objCDO.Body = strBody
objCDO.Send
Set objCDO = Nothing
'Response.Redirect("shoppingcart.asp")
Response.Redirect("http://www.praiselink.com/acatalog/praiselink_com_services_33.html")
End If
'Add Church details of Free service to the database
'==================================================
If oRs1.EOF AND strName <> "" AND strAddr1 <> "" AND strPostcode <> "" AND strCity <> "" Or oRs1.EOF AND strName <> "" AND strAddr1 <> "" AND strAddr2 = "" AND strPostcode <> "" AND strCity <> "" Then
If strMidwk = "" Then
strMidwk = "N/A"
End If
If strMtos = "" Then
strMtos = "N/A"
End If
If strService = "" Then
strService = "N/A"
End If
If strTel = "" Then
strTel = "N/A"
End If
If strPastor = "" Then
strPastor = "N/A"
End If
If strWeb = "" Then
strWeb = "N/A"
End If
If strMail = "" Then
strMail = "N/A"
End If
'Add details for free service only - also populate the paid service fields with "N/A"
'====================================================================================
'strSql = "insert into churches(Churchname, AddressLine1, AddressLine2, Postalcode, City, Status) values ('" & strName & "', '" & strAddr1 & "', '" & strAddr2 & "', '" & strPostcode & "', '" & strcity & "', '" & strStatus & "')"
strSql = "insert into churches(Churchname, AddressLine1, AddressLine2, Postalcode, City, Telephone, MidweekService, TimeOfService, WeekendService, Pastor, Website, EmailAddress, Status) values ('" & strName & "', '" & strAddr1 & "', '" & strAddr2 & "', '" & strPostcode & "', '" & strcity & "', '" & strTel & "', '" & strMidwk & "', '" & strMtos & "', '" & strService & "', '" & strPastor & "', '" & strWeb & "', '" & strMail & "', '" & strStatus & "')"
' finish the sql and execute it
'==============================
Set MM_insertCmd = Server.CreateObject("ADODB.Command")
MM_insertCmd.ActiveConnection = myConstring
MM_insertCmd.CommandText = strSql
MM_insertCmd.Execute
'Populate body of email with automated text
'===========================================
strBody = "This Email confirms that a paid service (New Church Details) is being registered on your database. " & vbCrLf & vbCrLf
Set objCDO = Server.CreateObject("CDONTS.NewMail")
strTo = "info@praiselink.com"
strFrom = "NewRegistration@praiselink.com"
strSubject = "Registration for paid service"
strBCC = b_c
objCDO.To = strTo
objCDO.Bcc = strBCC
objCDO.From = strFrom
objCDO.Subject = strSubject
objCDO.Body = strBody
objCDO.Send
Set objCDO = Nothing
'Response.Redirect("shoppingcart.asp")
'Response.Redirect("http://www.praiselink.com/acatalog/praiselink_com_services_33.html")
%>
| Your church details have been successfully registered |
<%
End If
End If
%>