-
Notifications
You must be signed in to change notification settings - Fork 0
/
accountComments.php
51 lines (46 loc) · 1.07 KB
/
accountComments.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
$sql = "SELECT CommentedID, CommenterID, Comment, Rating FROM Ratings";
$commentResult = $conn->query($sql);
while($commentRow = $commentResult->fetch_assoc())
{
if($commentRow["CommentedID"] == $sessionId)
{
$sql = "SELECT ID, Name, Rating FROM Users";
$commenterResult = $conn->query($sql);
while($commenterRow = $commenterResult->fetch_assoc())
{
if($commenterRow["ID"] == $commentRow["CommenterID"])
{
?>
<p><h4><a href="viewComments.php?id=<?php echo($commenterRow["ID"]) ?>" style="color:#EDB100">
<?php
echo $commenterRow["Name"];
?>
</a>
</h4>
<?php
$stars = round($commentRow["Rating"]);
for($index = 0; $index < $stars; $index++)
{
?>
<span class = "fa fa-star checked"></span>
<?php } ?>
<?php
for($index = 0; $index < (5 - $stars); $index++)
{ ?>
<span class = "fa fa-star"></span>
<?php
}
echo '(' . round($commenterRow["Rating"], 1) . ')';
?>
</p>
<p><?php
echo $commentRow["Comment"];
?>
</p>
<?php
}
}
}
}
?>