Lachenzelg/admin/teachers-delete.php

32 lines
701 B
PHP
Raw Permalink Normal View History

2025-01-07 03:02:25 +01:00
<?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');
}
?>