Profilepictuers for reviews added
This commit is contained in:
parent
5cb8badc23
commit
5e68d3b6c5
@ -319,8 +319,10 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
|
||||
|
||||
<?php
|
||||
// HIER ANGEPASST: profilePicture und createdAt zum SELECT hinzugefügt
|
||||
$stmt = mysqli_prepare($conn,
|
||||
" SELECT rating, comment, users.displayname FROM reviews
|
||||
" SELECT rating, comment, users.displayname, users.profilePicture, reviews.createdAt
|
||||
FROM reviews
|
||||
INNER JOIN users ON reviews.userID = users.userID
|
||||
WHERE productID = ? ORDER BY rating DESC");
|
||||
|
||||
@ -347,9 +349,23 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
<div class="review-card">
|
||||
|
||||
<div class="review-header">
|
||||
|
||||
<div class="review-user-info">
|
||||
<img class="review-avatar"
|
||||
src="<?= !empty($review['profilePicture']) ? htmlspecialchars($review['profilePicture']) : 'assets/images/placeholder.png' ?>"
|
||||
alt="Profilbild von <?= htmlspecialchars($review['displayname']) ?>">
|
||||
|
||||
<div>
|
||||
<div class="review-user">
|
||||
<?= htmlspecialchars($review['displayname']) ?>
|
||||
</div>
|
||||
<?php if (isset($review['createdAt'])): ?>
|
||||
<div style="font-size: 0.8rem; color: #94a3b8;">
|
||||
<?= date('d.m.Y', strtotime($review['createdAt'])) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="review-rating">
|
||||
<?php for ($i = 1; $i <= 5; $i++): ?>
|
||||
@ -477,7 +493,3 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
||||
|
||||
<?php endif; ?>
|
||||
<?php include 'footer.php'; ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user