-
Notifications
You must be signed in to change notification settings - Fork 0
/
ajaxtimelinecomments.php
31 lines (28 loc) · 1.18 KB
/
ajaxtimelinecomments.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
<?php
include("dbconnection.php");
// Coding to view comment
$sqlcomments = "SELECT * FROM timeline_comments WHERE timeline_id=$rstimeline[timeline_id] AND comment_type=Comment";
$qsqlcomments = mysqli_query($con, $sqlcomments);
while($rscomments = mysqli_fetch_array($qsqlcomments))
{
$dtcommentstime = strtotime($rscomments[date_time]);
$sqlcommentsstudent = "SELECT * FROM student WHERE student_id=$rscomments[student_id]";
$qsqlcommentsstudent = mysqli_query($con, $sqlcommentsstudent);
$rscommentsstudent = mysqli_fetch_array($qsqlcommentsstudent);
echo "<div id=comment style=background-color:gold;>
<img src=";
if(file_exists(studentimages/ .$rscommentsstudent[student_img]))
{
echo studentimages/ . $rscommentsstudent[student_img];
}
else
{
echo images/no-image.png;
}
echo " style=width:75px;height:75px;padding:5px; align=left >
<strong>$rscommentsstudent[student_name]</strong><br />".$rscomments[message]."
<br><span><i class=fa fa-calendar></i> Published on " . date("D d M Y h:i:s A",$dtcommentstime) . "</span>
<div>
<hr>";
}
?>