itskp-odense/Frontend/home.php

34 lines
882 B
PHP
Raw Normal View History

2021-06-02 11:27:13 +00:00
<?php
require "../Backend/controller/accessControl.php";
require "../bootstrap.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Home</title>
</head>
<body>
<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>
<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>
</body>
</html>