v0.0.6 Made edit and update now works dynamically

This commit is contained in:
Victor
2021-06-03 12:50:28 +02:00
parent 256f163771
commit 4024c0dd99
9 changed files with 94 additions and 30 deletions
+5 -5
View File
@@ -1,17 +1,17 @@
<?php
require "accessControl.php";
require "../../bootstrap.php";
use Backend\Model\Post;
if(isset($_GET['id'])){
$id = $_GET['id'];
if(isset($_GET['delete_id'])){
$id = $_GET['delete_id'];
$findId = Post::query()->findOrFail($id);
if(!$findId->delete()){
echo "Error could not delete record";
return "Error could not delete";
}else{
header("location: ../../Frontend/home.php?recordDeleted");
return "Record deleted";
}
}