2021-06-02 11:27:13 +00:00
|
|
|
<?php
|
|
|
|
require "../Backend/controller/accessControl.php";
|
|
|
|
require "../bootstrap.php";
|
|
|
|
?>
|
2021-06-01 09:29:56 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<title>Home</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
2021-06-02 07:01:51 +00:00
|
|
|
<p>Logget in som <?php echo $_SESSION['name'];?></p>
|
|
|
|
<a href="../Backend/controller/logout.php">Log ud</a>
|
|
|
|
<hr>
|
2021-06-02 11:27:13 +00:00
|
|
|
<p>Opret post</p>
|
2021-06-02 07:01:51 +00:00
|
|
|
<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>
|
2021-06-02 07:23:08 +00:00
|
|
|
<hr>
|
2021-06-02 11:27:13 +00:00
|
|
|
<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>
|
2021-06-01 09:29:56 +00:00
|
|
|
</body>
|
|
|
|
</html>
|