STB/blog/views/post/show.php

55 lines
1.5 KiB
PHP
Executable File

<?php
$thisPage="blog";
$thissheet = "/show";
require(__DIR__ . "/../layout/header.php");
include __DIR__ . "./../../views/layout/css/navi.css";
include __DIR__ . "/../layout/navigation.php";
//unset($_SESSION['login']);
//unset($_SESSION['rechte'])
var_dump($post); echo "<br><br>";
var_dump($comments);
?>
<div class="container">
<div class="starter-template">
<h3>Show - Kommentar zufügen:</h3>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><?php echo e($post['title']); ?></h3>
</div>
</div>
<div class="panel-body">
<?php echo nl2br(e($post['content'])); ?>
</div>
<ul class="list-group"><?php
$i = 1;
foreach($comments AS $comment): ?>
<li class="list-group-item">
<a href="posts-edit_c?id=<?php echo e($comment['id']); ?>"><?php
echo $i.". ".e($comment->content)."</a>";
echo "<br>ID=".e($comment->id). " -> ";
echo "post-ID=".e($comment->post_id). " -> ";
echo "content=".e($comment->content);
$i++;?>
</li>
<?php endforeach; ?>
</ul>
<form method="post" action="post?id=<?php echo e($post['id']);?>">
<textarea name="content" class="form-control"></textarea>
</br>
<input type="submit" value="Kommentar hinzufügen" class="btn btn-primary"/>
</form>
</br>
</br>
</div>
</div>
<?php
include __DIR__ . "/../layout/header.php";
?>