v0.0.5 Made edit and update

This commit is contained in:
Victor
2021-06-02 13:27:13 +02:00
parent 23a81e1925
commit 636672d8f2
5 changed files with 89 additions and 3 deletions
+20
View File
@@ -0,0 +1,20 @@
<?php
require "../Backend/controller/accessControl.php";
//require "../Backend/controller/edit.php";//Bootstrap is require via this file
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home</title>
</head>
<body>
<form action="../Backend/controller/update.php" method="POST">
<input type="number" name="id" hidden value="1">
<input type="text" name="upTitle" placeholder="Title">
<input type="text" name="upDescription" placeholder="Description">
<input type="submit" name="update">
</form>
</body>
</html>
+15 -3
View File
@@ -1,4 +1,7 @@
<?php require "../Backend/controller/accessControl.php"?>
<?php
require "../Backend/controller/accessControl.php";
require "../bootstrap.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
@@ -6,16 +9,25 @@
<title>Home</title>
</head>
<body>
<p>Logget in som <?php echo $_SESSION['name'];?></p>
<a href="../Backend/controller/logout.php">Log ud</a>
<hr>
<p>Opret post</p>
<form action="../Backend/controller/upload.php" method="POST">
<input type="text" name="title">
<input type="text" name="description">
<input type="submit" name="createPost" placeholder="Opret">
</form>
<hr>
<a href="../Backend/controller/deletePost.php?id=1" class="del_btn">Delete</a>
<p>Slet post</p>
<?php
$posts = \Backend\Model\Post::all()->pluck('id');
foreach ($posts as $post){
echo "<a href='../Backend/controller/deletePost.php?id=1'>Delete</a> <br>";
}
?>
<hr>
<p>Edit post</p>
<a href='edit.php?id=1'>Edit 1</a>
</body>
</html>