36 lines
959 B
PHP
36 lines
959 B
PHP
|
<?php
|
||
|
|
||
|
require '../config/function.php';
|
||
|
|
||
|
$paramResult = checkParamId('id');
|
||
|
if(is_numeric($paramResult))
|
||
|
{
|
||
|
$id = validate($paramResult);
|
||
|
$student = getById('tbl_students',$id);
|
||
|
if(($student['status'] == 200) && ($student['data']['status'] == 'archived'))
|
||
|
{
|
||
|
$studentDeleteRes = deleteQuery('tbl_students',$id, 'LIMIT 1');
|
||
|
if($studentDeleteRes)
|
||
|
{
|
||
|
redirect('archive.php','Schüler:in wurde erfolgreich entfernt','success');
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
redirect('archive.php','Ein Fehler ist aufgetreten','danger');
|
||
|
}
|
||
|
}
|
||
|
elseif(($student['status'] == 200) && ($student['data']['status'] != 'archived'))
|
||
|
{
|
||
|
redirect('students.php','Schüler:in kann nur entfernt werden, wenn er/sie archiviert wurden','danger');
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
redirect('students.php',$student['message'],'danger');
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
redirect('students.php',$paramResult,'danger');
|
||
|
}
|
||
|
|
||
|
?>
|