v0.0.6 Made edit and update now works dynamically
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user