File "index.php"
Full Path: /home/custbahd/tourismfraternity.com/admin/counter/get-review/index.php
File size: 2.34 KB
MIME-type: text/x-php
Charset: utf-8
<?php
include_once "../../../admin/counter/db/config.php";
include '../../../admin/db/saucerer.php';
$listing_id = $_GET['listing_id'];
?>
<div class="comments-area">
<?php
$sql = "SELECT count(*) FROM reviews WHERE listing_id='$listing_id' AND deleted='' ORDER BY id DESC";
$result = $conn->query($sql);
while($row = mysqli_fetch_array($result)) {
if ($row['count(*)']==0) {
echo '<h4>No Reviews</h4>';
} elseif ($row['count(*)']==1) {
echo '<h4>'.$row['count(*)'].' Review</h4>';
} else {
echo '<h4>'.$row['count(*)'].' Reviews</h4>';
}
}
?>
<?php
$sql = "SELECT * FROM reviews WHERE listing_id='$listing_id' AND deleted='' ORDER BY id DESC";
$result = $conn->query($sql);
while($row = mysqli_fetch_array($result)) {
if ($row["rate"]==1) {
$rating = '<i class="fa fa-star"></i>';
} elseif ($row["rate"]==2) {
$rating = '<i class="fa fa-star"></i> <i class="fa fa-star"></i>';
} elseif ($row["rate"]==3) {
$rating = '<i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i>';
} elseif ($row["rate"]==4) {
$rating = '<i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i>';
} elseif ($row["rate"]==5) {
$rating = '<i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i>';
}
echo '
<div class="comments-items">
<div class="comments-content">
<div class="comments-author-title">
<div class="comments-author-name">
<h4>'.$row["name"].' <small class="text-orange" style="font-size: 8px;float: right;">'.$rating.'</small></h4>
</div>
</div>
<p>'.$row["review"].'</p>
</div>
</div>';
}
?>
</div>