<!--#include virtual="/_appDB/db_connection.asp" -->
<!--#include virtual="/_appDB/functions.asp" -->
<!--#include virtual="/schools/scripts/admin_functions.asp" -->
<!--#include virtual="/schools/scripts/enc_function.asp" -->
<!--#include virtual="/schools/scripts/adm_inst.asp" -->
<%
IF (checkPermission("customers")="FAILED") THEN
	response.write("You do not have permission to view this page")
	response.end
END IF
pupilID=sanitizeRequest("cID","querystring")
IF pupilID <> "" AND pupilID <> "0" AND IsNumeric(pupilID) THEN
%>
<div style="width:100%;box-sizing:border-box;padding:10px;">
<table cellpadding="2" cellspacing="0" style="width:100%;" class="drvDataTable">
		<tr style="background-color:#f8f8f8;">
			<td class="formfields" style="padding:10px;">
				<p><span style="color:red;">Warning:</span> you are about to permanently<br /> delete this pupil account.</p>
				<div class="clear" style="height:5px;"></div>
				<input type="checkbox" name="confirmdelete" id="confirmdelete" value="yes" /> <label for="confirmdelete">Permanently delete account.</label>
			</td>
		</tr>
		<tr style="background-color:#f8f8f8;">
			<td><div class="adminbutton"><a href="#" id="delc" style="width:99%;color:#fff;">Delete account</a></div></td>
		</tr>	
</table>
</div>
<script type="text/javascript">
 $('#delc').click(function(e){
	e.preventDefault();
	var c = <%=pupilID%>;
	$('#delc').html('<img src="/schools/img/blue_load.gif" alt="" />');
	if(dgbi('confirmdelete').checked == true){
			setTimeout(function(){window.location = '/schools/control-panel/?go=pupils&pupils=view&view='+c+'&action=delete_acc'},1500);
	}else {
		miniNotify('Please check the box to confirm you want to delete this account','error');
		setTimeout(function(){$('#delc').html('Delete account');},1500);
	}
 });
</script>
<%
ELSE
	response.write("invalid data detected..")
END IF
%>