32 lines
701 B
PHP
32 lines
701 B
PHP
|
<?php
|
||
|
|
||
|
require '../config/function.php';
|
||
|
|
||
|
$paramResult = checkParamId('id');
|
||
|
if(is_numeric($paramResult))
|
||
|
{
|
||
|
$id = validate($paramResult);
|
||
|
$teacher = getById('tbl_teachers',$id);
|
||
|
if($teacher['status'] == 200)
|
||
|
{
|
||
|
$teacherDeleteRes = deleteQuery('tbl_teachers',$id, 'LIMIT 1');
|
||
|
if($teacherDeleteRes)
|
||
|
{
|
||
|
redirect('teachers.php','Lehrperson wurde erfolgreich entfernt','success');
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
redirect('teachers.php','Ein Fehler ist aufgetreten','danger');
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
redirect('teachers.php',$teacher['message'],'danger');
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
redirect('teachers.php',$paramResult,'danger');
|
||
|
}
|
||
|
|
||
|
?>
|