Review monitoring V1.o
This commit is contained in:
parent
429b5dfbdf
commit
ae6079e24f
@ -221,8 +221,6 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
|||||||
$shopInfo[] = $row;
|
$shopInfo[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="shop-offers">
|
<div class="shop-offers">
|
||||||
@ -271,9 +269,48 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
|
|||||||
|
|
||||||
<?php $stmt->close(); ?>
|
<?php $stmt->close(); ?>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$stmt = mysqli_prepare($conn,
|
||||||
|
" SELECT rating, comment, users.displayname FROM reviews
|
||||||
|
INNER JOIN users ON reviews.userID = users.userID
|
||||||
|
WHERE productID = ? ORDER BY rating DESC");
|
||||||
|
|
||||||
|
$stmt->bind_param("i", $productId);
|
||||||
|
$stmt->execute();
|
||||||
|
$result = $stmt->get_result();
|
||||||
|
|
||||||
|
$reviews = [];
|
||||||
|
|
||||||
|
while ($row = $result->fetch_assoc()) {
|
||||||
|
$reviews[] = $row;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="reviews">
|
||||||
|
|
||||||
|
<?php if (!empty($reviews)): ?>
|
||||||
|
|
||||||
|
<?php foreach ($reviews as $review): ?>
|
||||||
|
|
||||||
|
<div class="one-review">
|
||||||
|
<?= htmlspecialchars($review['rating']) ?>
|
||||||
|
<?= htmlspecialchars($review['comment']) ?>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="no-shop">
|
||||||
|
<p>Es gibt noch keine Bewertungen.</p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php include 'footer.php'; ?>
|
<?php include 'footer.php'; ?>
|
||||||
Loading…
Reference in New Issue
Block a user