Guest Book (and components, yea)

This commit is contained in:
2024-05-10 13:44:58 +02:00
parent 54e43f4318
commit c86bba1596
8 changed files with 92 additions and 84 deletions
+2
View File
@@ -0,0 +1,2 @@
DENY FROM ALL
ALLOW FROM 127.0.0.1
+16
View File
@@ -0,0 +1,16 @@
<div class="col">
<div class="card h-100">
<div class="card-header">
<h5 class="card-title"><?= $comment->title ?></h5>
<h6 class="card-subtitle mb-2 text-muted"><?= $comment->name ?></h6>
</div>
<div class="card-body">
<p class="card-text"><?= $comment->comment ?></p>
</div>
<div class="card-footer">
<small class="text-muted">
<?php echo date("d.m.Y H:i", $comment->time) ?>
</small>
</div>
</div>
</div>
+7
View File
@@ -0,0 +1,7 @@
<div class="alert alert-danger alert-dismissible fade show mt-3 mb-0">
<svg class="bi flex-shrink-0 me-2" width="24" height="24">
<use xlink:href="#exclamation-triangle-fill" />
</svg>
<?= $error ?>
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
+27
View File
@@ -0,0 +1,27 @@
<form action="comment.php" method="post" class="needs-validation row m-0" novalidate>
<div class="col">
<h4 class="mb-3">Leave a Comment!</h4>
<div class="mb-3">
<input class="form-control" type="text" name="title" required placeholder="A catching title" />
<div class="invalid-feedback">
Please enter a title.
</div>
</div>
<div class="mb-3">
<input class="form-control" type="text" name="name" required placeholder="Your name" />
<div class="invalid-feedback">
Please enter a name.
</div>
</div>
<div class="mb-3 position-relative">
<textarea class="form-control" id="comment" name="comment" rows="3" maxlength="250" required placeholder="Comment here"></textarea>
<small class="text-muted position-absolute" id="comment-count" style="right: 20px; bottom: 0;">
0/250
</small>
<div class="invalid-feedback">
Please enter text.
</div>
</div>
<button class="btn btn-primary mb-3">Comment</button>
</div>
</form>
+19
View File
@@ -0,0 +1,19 @@
<nav>
<ul class="pagination justify-content-center">
<li class="page-item">
<a class="page-link <?php if ($page === 0) echo "disabled" ?>" href="?p=<?= $page > 0 ? $page - 1 : 0 ?>">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
<?php for ($i = 0; $i <= $maxPage; $i++) { ?>
<li class="page-item <?php if ($page === $i) echo "active" ?>">
<a class="page-link" href="?p=<?= $i ?>"><?= $i + 1 ?></a>
</li>
<?php } ?>
<li class="page-item">
<a class="page-link <?php if ($page === $maxPage) echo "disabled" ?>" href="?p=<?= $page < $maxPage ? $page + 1 : $maxPage ?>">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</ul>
</nav>