<% response.buffer = true IF (checkPermission("customers")="FAILED") THEN response.write("You do not have permission to view this page") response.end END IF StrError="None" cID=sanitizeRequest("view","querystring") Function displayContent(str_str) IF str_str <> "" AND Not(IsNull(str_str)) THEN str_str=replace(str_str,chr(13),"
") 'str_str=replace(str_str,chr(10),"
") str_str=replace(str_str,"&39","'") str_str=replace(str_str,"-euro-","€") str_str=replace(str_str,"-pound-","£") str_str=replace(str_str,"-percent-","%") displayContent = str_str ELSE displayContent = "" Exit Function END IF End Function IF cID <> "" AND IsNumeric(cID) THEN 'check for any updates IF REQUEST("action")<>"" THEN var_act = sanitizeRequest("action","querystring") SELECT CASE var_act case "delete_acc": dbCBK.Execute("DELETE FROM cbk_parents WHERE `parentID`='"&cID&"' limit 1") response.redirect("/super-user/control-panel/?go=parents¬ify=Parent+account+deleted+sucessfully&nact=success") END SELECT END IF bSQL = "SELECT `parentID`, `name`, `pupilROLEIDS`, `email`, `acpwd`, `phone`, `mobile`, `address1`, `address2`, `address3`, `countystate`, `postcode`, `country`, `signupDATE`, `origin_source`, `acc_type`, `business_accountID`, `cust_notes` from cbk_parents WHERE `parentID`='"&cID&"' limit 1" SET rsB = dbCBK.Execute(bSQL) IF rsB.EOF THEN StrError="Parent data could not be found" END IF DO WHILE NOT rsB.EOF parentID=rsB("parentID") name=rsB("name") pupilROLEIDS=rsB("pupilROLEIDS") email=rsB("email") acpwd=rsB("acpwd") phone=rsB("phone") mobile=rsB("mobile") address1=rsB("address1") address2=rsB("address2") address3=rsB("address3") countystate=rsB("countystate") postcode=rsB("postcode") country=rsB("country") signupDATE=rsB("signupDATE") origin_source=rsB("origin_source") acc_type=rsB("acc_type") business_accountID=rsB("business_accountID") customerNOTES=rsB("cust_notes") rsB.MoveNext loop rsB.Close SET rsB = Nothing ELSE StrError="Parent data invalid" END IF Function fetchSchoolName(aID, norl) IF aID = "0" THEN fbRET="No School Assigned" fetchSchoolName=fbRET ELSEIF aID <> "" AND IsNumeric(aID) THEN SET rsfbN = dbCBK.Execute("SELECT `schoolname` from cbk_schools WHERE `schoolID`='"&aID&"' limit 1") IF rsfbN.EOF THEN fbRET="School not found.." END IF DO WHILE NOT rsfbN.EOF IF norl="n" THEN fbRET=rsfbN("schoolname") ELSE fbRET="" & rsfbN("schoolname") & "" END IF rsfbN.MoveNext loop rsfbN.Close SET rsfbN = Nothing fetchSchoolName=fbRET ELSE Exit Function END IF End Function Function fetchPupil(pID) IF pID = "0" THEN fpRET="No Pupil Assigned" fetchPupil=fpRET ELSEIF pID <> "" AND IsNumeric(pID) THEN SET rsfbPID = dbCBK.Execute("SELECT `pupilID`, `roleID`, `name` from cbk_pupils WHERE `pupilID`='"&pID&"' limit 1") IF rsfbPID.EOF THEN fpRET="Pupil not found.." END IF DO WHILE NOT rsfbPID.EOF fpRET="▸ " & rsfbPID("name") & "  |  (" & rsfbPID("roleID") & ")" rsfbPID.MoveNext loop rsfbPID.Close SET rsfbPID = Nothing fetchPupil=fpRET ELSE Exit Function END IF End Function IF StrError <> "None" THEN 'print the errors %>
<%=StrError%>
<%ELSE%>

View Parent Details

Name: <%=PCase(name)%>

Tools

Manage Parent
Parent Details
Name <%=PCase(name)%>
Contact # <%IF NOT(phone <> "") AND NOT(mobile <> "") THEN%>-<%END IF%> <%IF phone <> "" THEN response.write("" & "tel: " & phone & "")%> <%IF mobile <> "" THEN response.write("" & "mob: " & mobile & "")%>
Email <%IF email <> "" THEN%><%=email%><%ELSE%>-<%END IF%>
Address
<%=address1%>, <%=address2%>
<%=address3%>
<%=countystate%>
<%=postcode%>
<%IF country="GB" THEN response.write("UK") ELSE response.write(country) END IF%>
Pupil / Child Details
  <% IF pupilROLEIDS <> "" THEN str_pids=split(pupilROLEIDS,"||") for each x in str_pids response.write(fetchPupil(x) & "
") next ELSE response.write("none assigned") END IF %>
Additional Information
Signup Date <%=formatDateTime(signupDATE,vblongdate)%>
Notes (*office use only)
<%IF customerNOTES <> "" THEN%><%=displayContent(customerNOTES)%><%ELSE%>none<%END IF%>
<%END IF%>