v0.0.5 Made edit and update
This commit is contained in:
@@ -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
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user