%
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_pupils WHERE `pupilID`='"&cID&"' limit 1")
response.redirect("/super-user/control-panel/?go=pupils¬ify=Pupil+account+deleted+sucessfully&nact=success")
END SELECT
END IF
bSQL = "SELECT `pupilID`, `roleID`, `schoolID`, `name`, `rfID`, `email`, `acpwd`, `phone`, `mobile`, `address1`, `address2`, `address3`, `countystate`, `postcode`, `country`, `signupDATE`, `origin_source`, `acc_type`, `business_accountID`, `cust_notes` from cbk_pupils WHERE `pupilID`='"&cID&"' limit 1"
SET rsB = dbCBK.Execute(bSQL)
IF rsB.EOF THEN
StrError="Pupil data invalid [this account has been moved or no longer exists]"
END IF
DO WHILE NOT rsB.EOF
pupilID=rsB("pupilID")
roleID=rsB("roleID")
schoolID=rsB("schoolID")
name=rsB("name")
rfID=rsB("rfID")
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="Pupil data invalid [this account has been moved or no longer exists]"
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
IF StrError <> "None" THEN
'print the errors
%>
<%=StrError%>
<%ELSE%>
View Pupil
Role ID: <%IF roleID <> "" THEN%><%=roleID%><%ELSE%>-<%END IF%>
Parent & School Details
School: <%=fetchSchoolName(schoolID, "n")%>
| Pupil Details |
| Name |
<%=obscureData(PCase(name))%>
|
| Role # |
<%IF roleID <> "" THEN%><%=roleID%><%ELSE%>-<%END IF%> |
| Pupil Registration ID: |
<%=cID%> |
| RF ID # |
<%IF rfID <> "" THEN%>
<%=rfID%><%IF CStr(rfID)="0" THEN response.write(" (none assigned)")%>
<%ELSE%>
- (none assigned)
<%END IF%>
|
| School |
<%=fetchSchoolName(schoolID,"l")%> |
| 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%>
|
| Signup Date |
<%=formatDateTime(signupDATE,vblongdate)%>
|
| Pupil Notes (*office use only) |
|
<%IF customerNOTES <> "" THEN%><%=displayContent(customerNOTES)%><%ELSE%>none<%END IF%>
|
<%END IF%>