<% 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 & "
Hello "&parentname&",


" body=body & "
Here are your Zywpeit parent portal Login Details


" body=body & "
School ID: "&str_u_id&"
" body=body & "
User Email: "&email&"
" body=body & "
User Password: "&acpwd&"


" body=body & "
To log in to the parent portal system, please visit the following URL.

" body=body & "
Login URL: https://zywpeit.com/parents



" body=body & "
This email was generated automatically by our system, if you believe this email contains any errors, please contact your account manager immediately. Please do not reply to this email address as this is a notification address only.
" body=body & "" 'to from subject content IF (sendMailMessage(email,"web-server","Re: Your Portal Login Details From Zywpeit",body)="SENT") THEN 'ok ELSE 'mail failed continue anyway END IF END IF response.redirect("/schools/control-panel/?go=parents&parents=view&view="&nCID&"¬ify=New+parent+added+successfuly&nact=success") End If END IF END IF %> <%IF StrError <> "None" THEN%>
<%=StrError%>
<%END IF%>
err

Add Parent

Enter the details below.

Important

Click the button to save the details.
<% ccn=country cstate=countystate %> <% linkedpupilID=sanitizeRequest("linkedpupilid","querystring") IF linkedpupilID <> "" AND IsNumeric(linkedpupilID) THEN 'account is being auto linked to the pupil ID supplied %> <% ELSE 'display the search options to find pupils %> <%END IF%>
Parent Contact Details
Name
Address
display:none;<%END IF%>" placeholder="County / State" />
Telephone #
Mobile #
Parent Login Details
Email
Account Password
Notification
Pupil / Child Details
Linked Pupil <% SET rsB = dbCBK.Execute("SELECT cbk_pupils.pupilID As pupilID, cbk_pupils.roleID As roleID, cbk_pupils.schoolID As schoolID, cbk_pupils.name As name, cbk_schools.schoolname As schoolname FROM cbk_pupils LEFT JOIN cbk_schools ON cbk_pupils.schoolID = cbk_schools.schoolID WHERE cbk_pupils.pupilID='"&linkedpupilid&"' AND cbk_pupils.schoolID='"&str_u_id&"' limit 1") IF rsB.EOF THEN response.write("Warning: No pupil found..") ELSE response.write("") END IF DO WHILE NOT rsB.EOF str_pupilID=rsB("pupilID") str_roleID=rsB("roleID") str_schoolID=rsB("schoolID") str_pupilNAME=rsB("name") str_schoolNAME=rsB("schoolname") rsB.MoveNext loop rsB.Close SET rsB = Nothing %> <%IF str_pupilNAME <> "" THEN response.write("Name: " & str_pupilNAME & "
")%> <%IF str_roleID <> "" THEN response.write("Role ID: " & str_roleID & "
")%> <%IF str_schoolNAME<> "" THEN response.write("School: " & str_schoolNAME & "
")%>
Assign pupils to this parent account
Assigned Pupils
none
Additional Information
Notes (*office use only)

Add Parent

Enter the details above.

Important

Click the button to save the details.
<%IF Err.Number <> 0 THEN response.write(Err.Description)%>