Viewing file: comments.php (3.73 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include 'header.php';
$technology= $_GET['tech'];
?>
<!-- <style type="text/css">
.footer{
position: fixed;
bottom: 0;
width: 100%;
left: 0;
}
</style> -->
<section class="project-banner">
<div class="container">
<div class="row">
<div class="col-12">
<div class="banner-sec">
<div class="projectheading btn_right">
<h3>Reviews</h3>
<button class="btn backbtn" onclick="history.go(-1);">Back </button>
</div>
</div>
</div>
</div>
</div>
</section>
<section>
<div class="container">
<div class="row">
<div class="col-sm-12">
<h3>Comments</h3>
<a href="#" >Overall Rating </a>
<?php
$ratinguery = "SELECT AVG(rating) AS avg FROM reviews where technology='$technology'";
$ratingResult = mysqli_query($con, $ratinguery) or die("database error:" . mysqli_error($conn));
while ($rating = mysqli_fetch_assoc($ratingResult)) {
for ($i = 1; $i <= 5; $i++) {
$ratingClass = "far";
if ($i <= ceil($rating['avg'])) {
$ratingClass = "fas";
}
?>
<span class=" fa-star <?php echo $ratingClass; ?>" aria-hidden="true"></span>
<!-- </a> -->
<?php }
}
?>
<hr/>
<div class="review-block">
<?php
$ratinguery = "SELECT * FROM reviews where technology='$technology'";
$ratingResult = mysqli_query($con, $ratinguery) or die("database error:" . mysqli_error($conn));
while ($rating = mysqli_fetch_assoc($ratingResult)) {
//$date=date_create($rating['created']);
//$reviewDate = date_format($date,"M d, Y");
?>
<div class="row">
<!-- <div class="col-sm-3">
<img src="images/profile.jpg" class="img-rounded">
</div>-->
<div class="col-sm-12">
<div class="review-block-name"><?php echo $rating['name']; ?></div>
<div class="review-block-rate">
<?php
for ($i = 1; $i <= 5; $i++) {
$ratingClass = "far";
if ($i <= $rating['rating']) {
$ratingClass = "fas";
}
?>
<span class=" fa-star <?php echo $ratingClass; ?>" aria-hidden="true"></span>
<?php } ?>
</div>
<div class="review-block-description"><?php echo $rating['review']; ?></div>
</div>
</div>
<hr/>
<?php } ?>
</div>
</div>
</div>
</div>
</section>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<?php include 'footer.php'; ?>
|