%
IF (checkPermission("parents")="FAILED") THEN
response.write("You do not have permission to view this page")
response.end
END IF
parentID=sanitizeRequest("_pid","form")
IF parentID <> "" AND parentID <> "0" AND IsNumeric(parentID) THEN
strEM="none"
SET rsE = dbCBK.Execute("SELECT `name`, `email`, `acpwd` from cbk_parents WHERE parentID='"&parentID&"' AND schoolID='"&str_u_id&"' limit 1")
IF rsE.EOF THEN
strEM="none"
END IF
DO WHILE NOT rsE.EOF
strCN=rsE("name")
strEM=rsE("email")
strEP=rsE("acpwd")
rsE.MoveNext
loop
rsE.Close
SET rsE = Nothing
IF strEM <> "" AND strEP <> "" THEN
strDCEP=CustDecodeAndDecrypt(strEP)
body="
"
body=body & "Hello "&strCN&",
"
body=body & "Here are your Zywpeit parent portal Login Details
"
body=body & "School ID: "&str_u_id&"
"
body=body & "User Email: "&strEM&"
"
body=body & "User Password: "&strDCEP&"
"
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(strEM,"web-server","Re: Your Portal Login Details From Zywpeit",body)="SENT") THEN
response.write("SUCCESS||")
ELSE
response.write("ERROR||Unable to send mail")
END IF
ELSE
response.write("ERROR||No Details Found")
END IF
ELSE
response.write("invalid data detected..")
END IF
%>