v0.1.0 - Updated Deletetion of post

Updated home to admin
Updated create & fetch
Added DataTables
Added Icons for DataTables
Added SWAL
This commit is contained in:
Anders
2021-06-08 09:07:58 +02:00
parent 0c6d26d084
commit 350b22923a
76 changed files with 21707 additions and 80 deletions
+2 -2
View File
@@ -9,9 +9,9 @@ if(isset($_POST['delete_id'])){
$id = $_POST['delete_id'];
$findId = Post::query()->findOrFail($id);
if(!$findId->delete()){
return "Error could not delete";
return 0;
}else{
return "Record deleted";
return 1;
}
}
+1 -1
View File
@@ -18,7 +18,7 @@ if (isset($_POST['loginsubmit'])) {
if ($password->save()) {
$_SESSION['token'] = $token;
$_SESSION['name'] = $username;
header('location: ../../Frontend/home.php?login=success');
header('location: ../../Frontend/admin.php?login=success');
exit();
http_response_code(200);
} else {
+1 -1
View File
@@ -12,6 +12,6 @@ if(isset($_POST['update'])){
if(!$post->update()){
echo "Error could not update";
}else{
header("location: ../../Frontend/home.php");
header("location: ../../Frontend/admin.php");
}
}