Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="../javascripts/js/lib/jquery.js" type="text/javascript"></script>
- <script src="../javascripts/js/jquery.validate.js" type="text/javascript"></script>
- <script type="text/javascript">
- $(document).ready(function()
- {
- $("#signupForm").validate({
- rules: {
- first_name: {required:true,minlength:3},
- last_name: {required:true,minlength:3},
- address1: "required",
- city: "required",
- postal_code: "required",
- country: "required",
- business_name: "required",
- business_phone: "required",
- email1: {required:true, email:true },
- liscence_number: "required",
- province: "required",
- about_us: {required:true,minlength:15}
- },
- messages: {
- first_name: " - Please enter your first name",
- last_name: " - Please enter your last name",
- address1 : " - Please enter your address",
- city: " - Please enter your city",
- postal_code: "- Please enter your postal code",
- country: " - Please select your country ",
- business_name: " - Please enter you business name",
- business_phone: " - Please enter your business phone number",
- email1: " - Please enter your email address",
- liscence_number : " - Please enter your Liscence Number",
- province: " - Please select your province"
- },
- errorElement: "span",
- errorPlacement: function(error, element) {
- element.siblings("label").append(error);
- },
- highlight: function(element) {
- $(element).siblings("label").addClass("error");
- },
- unhighlight: function(element) {
- $(element).siblings("label").removeClass("error");
- },
- submitHandler: function() {
- form.submit();
- }
- });
- });
- </script>
- <!-- #INCLUDE file="../include/header2.asp"-->
- <!-- #INCLUDE file="../include/ado.asp"-->
- <!-- #INCLUDE file="../include/functions.asp"-->
- <%
- dim do_what
- dim Member_ID
- do_what = Request.QueryString("do_what")
- OpenDB("../database/cpio.mdb")
- %>
- <!-- THERE ARE 5 COLUMNS IN THIS OUTTER TABLE -->
- <tr>
- <td colspan="5" align="left" valign="top" style="font-family:Tahoma,arial; font-size:12px; color:#464646">
- <a href="../default.asp" style="padding-left:10px;">Home</a> » <a href="default.asp">Memberships</a> » Online Application Form
- <br>
- <table cellpadding="0" cellspacing="0" border="0" style="padding-top:40px;">
- <tr>
- <td width="140" align="center" valign="top" style="font-family: Tahoma, Arial; font-size: 12px; padding-left:30px;">
- <img src="../images/memberships-1.jpg" alt=""><br><br><strong><small>"Join a winning team"</small></strong>
- <td valign="top" style="font-family: Tahoma, Arial; font-size: 12px; padding-left:30px;">
- <div style="font-family:Century Gothic; font-weight:bold; font-size:20px; padding-top:0px; padding-bottom:20px;">
- Membership Application Form</div>
- <div style="padding-right:35px; padding-bottom:30px; font-family: Tahoma; font-size: 12px; color:#464646; line-height:20px;">
- <% if do_what = "" then %>
- Please complete the following form in detail. For security reasons, your full legal name and business name (if applicable) are required. Failure to complete all fields may delay your application.<br>
- <br><br>
- <form name="signupForm" method="post" id="signupForm" action="signup.asp?do_what=submit">
- <fieldset>
- <legend>Personal Information</legend>
- <div class="row">
- <label for="last_name">Last Name:*</label>
- <input type="text" name="last_name" class="required" maxlength="30" size="35">
- </div>
- <div class="row">
- <label for="first_name">First Name*:</label>
- <input type="text" name="first_name" class="required" maxlength="30" size="35">
- </div>
- <div class="row">
- <label for="middle_initial">Middle Initial:</label>
- <input type="textbox" name="middle_initial" maxlength="1" size="2">
- </div>
- <div class="row">
- <label for="dob">Birth Date:</label>
- <input type="textbox" name="dob" maxlength="10" size="15"> <small>(MM/DD/YYYY)</small>
- </div>
- </fieldset>
- <br/>
- <fieldset>
- <legend>Business Address</legend>
- <div class="row">
- <label for="address1">Address1:*</label>
- <input type="textbox" name="address1" class="required" maxlength="50" size="35">
- </div>
- <div class="row">
- <label for="address2">Address2:</label>
- <input type="textbox" name="address2" maxlength="50" size="35">
- </div>
- <div class="row">
- <label for="city">City:*</label>
- <input type="textbox" name="city" class="required" maxlength="30" size="35">
- </div>
- <div class="row">
- <label for="Province:">Province:*</label>
- <% Call LoadProvinces() %>
- </div>
- <div class="row">
- <label for="postal_code">Postal Code:*</label>
- <input type="textbox" name="postal_code" class="required" maxlength="15" size="15">
- </div>
- <div class="row">
- <label for="country">Country:*</label>
- <select name="country" class="required" >
- <option></option>
- <option value="Canada">Canada</option>
- <option value="United States">United States</option>
- </select>
- </div>
- </fieldset>
- <fieldset>
- <legend>Business Contact Information</legend>
- <div class="row">
- <label for="business_name">Business Name:*</label>
- <input type="textbox" name="business_name" class="required" maxlength="100" size="35">
- </div>
- <div class="row">
- <label for="business_phone">Business Phone:*</label>
- <input type="textbox" name="business_phone" class="required" maxlength="40" size="35">
- <div class="row">
- <label for="toll_free">Toll Free:</label>
- <input type="textbox" name="toll_free" maxlength="40" size="35">
- </div>
- <div class="row">
- <label for="fax_number">Fax Number:</label>
- <input type="textbox" name="fax_number" maxlength="40" size="35">
- </div>
- <div class="row">
- <label for="cell_phone">Cell Phone:</label>
- <input type="textbox" name="cell_phone" maxlength="40" size="35">
- </div>
- <div class="row">
- <label for="email1">Email #1:*</label>
- <input type="textbox" name="email1" class="required" maxlength="60" size="35">
- </div>
- <div class="row">
- <label for="email2">Email #2:</label>
- <input type="textbox" name="email2" maxlength="60" size="35">
- </div>
- <div class="row">
- <label for="website_url">Business Url:</label>
- <input type="textbox" name="website_url" maxlength="60" size="35" >
- </div>
- <div class="row">
- <label for="about_us">Business History:*</label>
- <textarea name="about_us" rows="5" cols="30" class="required"></textarea>
- </div>
- </fieldset>
- <fieldset>
- <legend>Membership Details</legend>
- <div class="row">
- <label for="lisence_number">P.I. License #:*</label>
- <input type="textbox" name="license_number" class="required" maxlength="300" size="35">
- </div>
- <div class="row">
- <label for="Agency_Number">Agency. License #:*</label>
- <input type="textbox" name="Agency_Number" class="required" maxlength="300" size="35">
- </div>
- <div class="row">
- <label for="membership_type_id">Membership Type:*</label>
- <select name="membership_type_id" class="required">
- <option></option>
- <%
- SQL = "SELECT * FROM Membership_Types ORDER BY Membership_Type ASC"
- dbRS2.Open SQL, dbConn, adOpenForwardOnly, adLockReadOnly
- RS2Open = true
- do until dbRS2.EOF
- select case ucase(trim(dbRS2.fields("Membership_Type") & ""))
- case "INDIVIDUAL","AGENCY","ASSOCIATE","STUDENT"
- response.write "<option value='" & dbRS2.fields("Membership_Type_ID") & "'>"
- response.write UCase(GetField("Membership_Type", "Membership_Types", "Membership_Type_ID", dbRS2.fields("Membership_Type_ID")))
- response.write "</option>"
- end select
- dbRS2.MoveNext
- loop
- dbRS2.Close
- RS2Open = false
- %>
- </select>
- </div>
- </fieldset>
- <fieldset>
- <legend>Legal Information</legend>
- <label for="privacy">I agree that I have read and understand the <a href="http://www.cpi-ontario.com/governance/privacy_policy.asp">Privacy Policy</a>. I understand that my information may be shared on this site.</label>
- <input type="checkbox" name="privacy" class="required" />
- <br>
- <br>
- <label> I agree that i have read, and will abide by the code of ethics <a href="http://www.cpi-ontario.com/disclaimer.asp">Code of Ethics</a></label>
- <input type="checkbox" name="ethics" class="required" />
- <br>
- <br>
- </fieldset>
- <div align="center" style="padding-right:30px; padding-top:30px;">
- <!--<input type="button" name="submitBtn" value="Submit Application" onClick="javascript:check_form(this, 'signup.asp?do_what=submit');">-->
- <input class="submit" type="submit" value="submit"/></div>
- </form>
- <%
- elseif do_what = "submit" then
- Call SaveApplication()
- dim full_name
- full_name = GetField("Full_Name", "Members", "Member_ID", Member_ID)
- msgBody = "<html><body><div style='font-family:Tahoma; font-size:12px; line-height:18px;'>" _
- & "Dear " & full_name & ":<br><br>" _
- & "Thank you for your application for membership with the CPIO. Your message will be reviewed within the next " _
- & "24 to 48 hours. If your application is approved, you will receive a confirmation by e-mail along with a " _
- & "'Welcome' package. <br><br><strong>Your temporary membership ID # is <u>ON" & right("00000" & cstr(Member_ID), 5) & "</u>" _
- & ".</strong><br><br>" _
- & "If you have not heard back from us within this time frame, please contact our <a href='mailto:webadmin@cpi-ontario.com'>" _
- & "Website Administrator</a> and/or our <a href='mailto:director.memberships@cpi-ontario.com'>Director of Memberships</a>." _
- & "<br><br><br>Thanks again,<br><br><br>Council of Private Investigators - Ontario" _
- & "</div></div></body></html>"
- 'if len(trim(full_name)) >= 5 then
- Call SendMsg2(msgBody)
- 'end if
- end if %>
- </div>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <%
- function LoadProvinces()
- %><select name="province" class="required" ><option></option>
- <%
- sql = "SELECT * FROM Provinces WHERE Country = 'Canada' ORDER BY Province ASC"
- dim rs
- dim rsOpen
- set rs = Server.CreateObject("ADODB.Recordset")
- rs.Open SQL, dbConn, adOpenDynamic, adLockOptimistic
- rsOpen = True
- do until rs.eof
- %>
- <option value="<% = ucase(trim(rs.fields("Code") & ""))%>"><% =ucase(trim(rs.fields("Code") & "")) & " - " & trim(rs.fields("Province") & "")%></option>
- <% rs.MoveNext
- loop
- rs.Close()
- rsOpen = false
- %><option>-----------------------------------------</option><%
- sql = "SELECT * FROM Provinces WHERE Country = 'United States' ORDER BY Province ASC"
- rs.Open SQL, dbConn, adOpenDynamic, adLockOptimistic
- rsOpen = True
- do until rs.eof
- %>
- <option value="<% = ucase(trim(rs.fields("Code") & ""))%>"><% =ucase(trim(rs.fields("Code") & "")) & " - " & trim(rs.fields("Province") & "")%></option>
- <% rs.MoveNext
- loop
- rs.Close()
- rsOpen = false
- set rs = nothing
- %></select><%
- end function
- function SaveApplication()
- dim alreadyOnFile
- SQL = "SELECT * FROM Members WHERE Last_Name = '" & Trim(Request.Form("last_name") & "") & "' AND First_Names LIKE '" & Trim(Request.Form("first_name") & "") & "%'"
- dim rs
- dim rsOpen
- set rs = Server.CreateObject("ADODB.Recordset")
- 'response.write "<br>sql = " & sql
- 'response.end
- rs.open sql, dbConn, adOpenDynamic, adLockOptimistic
- if rs.eof then
- alreadyOnFile = false
- else
- alreadyOnFile = true
- Member_ID = rs.fields("Member_ID")
- end if
- if not alreadyOnFile then
- rs.AddNew
- Member_ID = rs.fields("Member_ID")
- fname = Trim(Request.Form("first_name") & "") & " " & Trim(Request.Form("middle_initial") & "")
- rs.fields("First_Names") = ProperCase(Trim( fname ))
- rs.fields("Last_Name") = ucase(Trim(Request.Form("last_name") & ""))
- rs.fields("Full_Name") = Trim(rs.fields("First_Names") & " " & Trim(Request.Form("last_name") & ""))
- if isdate(trim(Request.Form("DOB"))) then
- rs.fields("DOB") = Trim(Request.Form("dob") & "")
- else
- rs.fields("DOB") = null
- end if
- rs.fields("Operating_Name") = ProperCase(DoubleUpQuotes(Trim(Request.Form("business_name") & "")))
- rs.fields("Address1") = ProperCase(DoubleUpQuotes(Trim(Request.Form("address1") & "")))
- rs.fields("Address2") = ProperCase(DoubleUpQuotes(Trim(Request.Form("address2") & "")))
- rs.fields("City") = ProperCase(DoubleUpQuotes(Trim(Request.Form("city") & "")))
- rs.fields("Province") = ProperCase(Trim(Request.Form("province") & ""))
- rs.fields("Postal_Code") = ucase(Trim(Request.Form("postal_code") & ""))
- rs.fields("Country") = ProperCase(Trim(Request.Form("country") & ""))
- rs.fields("Business_Phone") = FormatPhoneNumber(Request.Form("business_phone"))
- rs.fields("Toll_Free") = FormatPhoneNumber(Request.Form("toll_free"))
- rs.fields("Cell") = FormatPhoneNumber(Request.Form("cell"))
- rs.fields("Business_Fax") = FormatPhoneNumber(Request.Form("business_fax"))
- rs.fields("Email1") = lcase(Trim(Request.Form("email1") & ""))
- rs.fields("Email2") = lcase(Trim(Request.Form("email2") & ""))
- rs.fields("Website_URL") = lcase(Trim(Request.Form("website_url") & ""))
- rs.fields("about_us") = lcase(Trim(Request.Form("about_us") & ""))
- rs.fields("Membership_Number") = "ON" & RIGHT("00000" & cstr(Member_ID), 5)
- rs.fields("Agency_Number") = lcase(Trim(Request.Form("Agency_Number") & ""))
- rs.fields("Membership_Status") = "PENDING"
- rs.fields("Membership_Type_ID") = Request.Form("membership_type_id")
- rs.fields("Last_Updated") = now
- rs.fields("Membership_Application_Date") = now
- rs.fields("Allow_View_Private_Topics")= true
- if(Request.Form("membership_type_id")="1") then 'Individual
- rs.fields("Allow_View_Private_Topics")= true
- rs.fields("Allow_Submit_Topics")= true
- rs.fields("Allow_View_Threads") = true
- rs.fields("Allow_Submit_Threads") = true
- end if
- if(Request.Form("membership_type_id")="2") then 'Agency
- rs.fields("Allow_View_Private_Topics")= true
- rs.fields("Allow_Submit_Topics")= true
- rs.fields("Allow_View_Threads") = true
- rs.fields("Allow_Submit_Threads") = true
- end if
- if(Request.Form("membership_type_id")="3") then 'Associate
- rs.fields("Allow_View_Private_Topics")= true
- rs.fields("Allow_Submit_Topics")= true
- rs.fields("Allow_View_Threads") = true
- rs.fields("Allow_Submit_Threads") = true
- end if
- if(Request.Form("membership_type_id")="4") then 'Student
- rs.fields("Allow_View_Private_Topics")= true
- rs.fields("Allow_Submit_Topics")= true
- rs.fields("Allow_View_Threads") = true
- rs.fields("Allow_Submit_Threads") = true
- end if
- ' MEMBERSHIPS EXPIRE 1 YEAR + 1st day of following month
- y = year(now) + 1
- m = month(now)
- d = day(now)
- if m = 12 then
- m = 1
- y = y + 1
- d = 1
- end if
- rs.fields("Membership_Expiry_Date") = "01/01/" & cstr(y)
- rs.Update
- end if
- rs.Close
- rsOpen = False
- if not alreadyOnFile then
- %>
- Thank you for completing and submitting the online application form.<br><br><br>Your application will be reviewed within the next 48 hours and you will be notified by e-mail once it has been approved.
- <%
- else
- %>
- <div style="color:red; font-weight:bold">An application has already been submitted in your name.
- <%
- end if
- set rs = nothing
- end function
- %>
- <%
- function SendMsg2 (msgBody)
- Dim objMessage 'Holds the CDONTS NewMail Object
- dim email1
- dim email2
- email1 = GetField("Email1", "Members", "Member_ID", Member_ID)
- email2 = GetField("Email2", "Members", "Member_ID", Member_ID)
- Set objMessage = Server.CreateObject("CDO.Message")
- Set objConfig = Server.CreateObject ("CDO.Configuration")
- 'Outgoing SMTP server
- objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.cpi-ontario.com"
- objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 2525
- objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
- objConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
- ObjConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic
- '(clear-text) authentication
- ObjConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") ="noreply@cpi-ontario.com"
- ObjConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="*****"
- objConfig.Fields.Update
- 'Update the CDOSYS Configuration
- Set objMessage.Configuration = objConfig
- 'WORKS
- objMessage.From = "noreply@cpi-ontario.com"
- objMessage.To = email1
- objMessage.Cc = "adam@affordabletechs.net"
- objMessage.Bcc = "act1@affordabletechs.net"
- objMessage.Subject = "New Membership Application"
- objMessage.HtmlBody = "<html><body>" & status & "<br><br>" & msg & "</body></html>"
- SendMsg = objMessage.Send
- Set objMessage = Nothing
- Set objConfig = Nothing
- End function
- %>
- <%
- CloseDB()
- %>
- <!-- #INCLUDE file="../include/footer2.asp" -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement