forked from rupali-soni/custom_chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetmsg.php
More file actions
33 lines (32 loc) · 1.11 KB
/
Copy pathgetmsg.php
File metadata and controls
33 lines (32 loc) · 1.11 KB
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
<?php
require_once 'functions.php';
$userId = $_POST['u1']; //current loggedin user
$msgs = getNewMsgs($userId);
if($msgs) {
?>
<ul class="list-unstyled">
<?php foreach ($msgs as $msg) {?>
<?php if($userId != $msg['from']) {?>
<li class="left clearfix"><span class="chat-img1 pull-left"> <img
src="https://lh6.googleusercontent.com/-y-MY2satK-E/AAAAAAAAAAI/AAAAAAAAAJU/ER_hFddBheQ/photo.jpg"
alt="User Avatar" class="img-circle">
</span>
<div class="chat-body1 clearfix">
<p><?php echo $msg['message'];?></p>
<!-- <div class="chat_time pull-right"><?php echo date("d-m-Y h:ia");$msg['message'];?></div> -->
</div></li>
<?php } else {?>
<li class="left clearfix admin_chat"><span
class="chat-img1 pull-right"> <img
src="https://lh6.googleusercontent.com/-y-MY2satK-E/AAAAAAAAAAI/AAAAAAAAAJU/ER_hFddBheQ/photo.jpg"
alt="User Avatar" class="img-circle">
</span>
<div class="chat-body1 clearfix">
<p><?php echo $msg['message'];?></p>
<!-- <div class="chat_time pull-left"><?php echo date("d-m-Y h:ia");$msg['message'];?></div> -->
</div></li>
<?php }?>
<?php }?>
</ul>
<?php
}