% IF (checkPermission("parents")="FAILED") THEN response.write("You do not have permission to view this page") response.end END IF %> <% response.buffer = true StrError="None" IF REQUEST("add")="parent.account" THEN roleID=sanitizeRequest("roleID","form") IF roleID <> "" THEN IF Len(roleID) > 20 THEN StrError = "The role ID cannot exceed 20 characters" END IF ELSE roleID="0" END IF schoolID=str_u_id IF schoolID <> "" THEN IF IsNumeric(schoolID) THEN 'ok ELSE StrError="The school id is not numeric" END IF END IF parentname=sanitizeRequest("parentname","form") IF LEN(parentname) < 2 THEN StrError = "The Parent Name Is A Required Field" END IF address1=sanitizeRequest("address1","form") address2=sanitizeRequest("address2","form") address3=sanitizeRequest("address3","form") country="UK" countystate=sanitizeRequest("countystate","form") postcode=sanitizeRequest("postcode","form") IF LEN(postcode) < 2 THEN StrError = "The Postcode Is Required" & VbCrLf & "If you do not have a postcode enter 000" END IF pupilROLEIDS=sanitizeRequest("assignedPupils","form") email=sanitizeRequest("email","form") IF LEN(email) < 6 OR LEN(email) > 150 OR NOT(Instr(email,"@") > 0) OR NOT(Instr(email,".") > 0) THEN StrError = "The Email Address Appears Invalid" ELSE email=lcase(email) END IF acpwd=sanitizeRequest("acp","form") IF len(acpwd) < 6 OR len(acpwd) > 100 THEN StrError = "Password must be between 6 and 50 characters long" ELSE ecpwd=CustEncryptAndEncode(acpwd) END IF phone=sanitizeRequest("phone","form") acc_type="" business_accountID="0" customerNOTES=sanitizeContent("customerNOTES","form") IF REQUEST("newsource") <> "" THEN csource=sanitizeRequest("newsource","form") ELSE csource=sanitizeRequest("csource","form") END IF str_rand_t = trim(postcode & generatePassword(12)) str_cust_token = CustEncryptAndEncode(str_rand_t) IF StrError <> "None" THEN 'print the errors ELSE 'add the account aSQL = "INSERT INTO cbk_parents " aSQL = aSQL & "(`schoolID`,`roleID`, `name`, `pupilROLEIDS`, `email`, `acpwd`, `phone`, `mobile`, `address1`, `address2`, `address3`, `countystate`, `postcode`, `country`, `signupDATE`, `origin_source`, `acc_type`, `business_accountID`, `cust_notes`,`cust_token`)" aSQL = aSQL & " VALUES" aSQL = aSQL & "('"&schoolID&"','"&roleID&"', '"&parentname&"', '"&pupilROLEIDS&"', '"&email&"', '"&ecpwd&"', '"&phone&"', '"&mobile&"', '"&address1&"', '"&address2&"', '"&address3&"', '"&countystate&"', '"&postcode&"', '"&country&"', '"&year(now())&"-"&month(now())&"-"&day(now())&"', '"&csource&"', '"&acc_type&"', '"&business_accountID&"', '"&customerNOTES&"', '"&str_cust_token&"')" dbCBK.Execute(aSQL) pfSQL = "SELECT @@IDENTITY AS 'Identity'" Set rsSelectResultpf = dbCBK.Execute( pfSQL ) If rsSelectResultpf.EOF Then StrError = "An error occurred, please try again" & vbCrLf Else StrError = "None" nCID=rsSelectResultpf(0).value 'check and send parent login details here... IF REQUEST("snts")="yes" THEN body="
" body=body & "