-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload_discussion.php
70 lines (50 loc) · 2.02 KB
/
load_discussion.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
include("connection.php");
$comm =mysqli_query($conn,"select * from discussion order by id");
?>
<div class="card-body msg_card_body">
<?php
$i=0;
while($row=mysqli_fetch_array($comm)){
$sendby=$row['sendby'];
$message=$row['message'];
$time=$row['datetime'];
$q=mysqli_query($conn,"select * from user where name='$sendby'");
$drow=mysqli_fetch_array($q);
$senimage=$drow['image'];
$user1=$drow['email'];
//echo $user1;
?>
<br/>
<?php if($i==0) {?>
<div class="d-flex justify-content-start mb-4">
<div class="img_cont_msg">
<?php
if($senimage!=null){
echo "<img src='images/$user1/$senimage' class='rounded-circle user_img_msg'>" ;}
else{
echo "<img src='images/avtar.JPEG' class='rounded-circle user_img_msg'>" ;
} echo $sendby ;?>
</div>
<div class="msg_cotainer">
<?php echo $message; ?>
<span class="msg_time"><?php echo $time; ?></span>
</div>
</div><?php $i=1; } else{?>
<!------>
<div class="d-flex justify-content-end mb-4">
<div class="msg_cotainerreceiver">
<?php echo $message; ?>
<span class="msg_time"><?php echo $time;?></span>
</div>
<div class="img_cont_msg">
<?php
if($senimage!=null){
echo "<img src='images/$user1/$senimage' class='rounded-circle user_img_msg'>";
}else{
echo "<img src='images/avtar.JPEG' class='rounded-circle user_img_msg'>";
}echo $sendby ;?>
</div>
</div><?php $i=0;} ?>
<?php } ?>
</div>