This repository was archived by the owner on Feb 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloadmessenger.php
More file actions
39 lines (34 loc) · 1.64 KB
/
Copy pathloadmessenger.php
File metadata and controls
39 lines (34 loc) · 1.64 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
34
35
36
37
38
39
<?php
include "connection.php";
session_start();
$account_id = $_SESSION["id"];
$to_id = $_SESSION["contact_id"];
$sql2 = "SELECT * FROM messenger WHERE (to_id = '$to_id' AND from_id = '$account_id') OR (to_id = '$account_id' AND from_id = '$to_id')";
$findmessage = $conn->query($sql2);
while($row = $findmessage->fetch_object()) {
if($row->to_id == $account_id) { ?>
<div class="w3-cell w3-left w3-card w3-margin w3-clear w3-round w3-white">
<?php } else { ?>
<div class="w3-cell w3-right w3-card w3-margin w3-clear w3-round w3-white">
<?php } ?>
<div class="w3-container">
<?php if($row->to_id == $account_id) { ?>
<p class="w3-margin">
<?php } else { ?>
<p class="w3-right w3-margin">
<?php } ?>
<a style="text-decoration:none;" href="user.php?id=<?php echo $row->from_id ?>">
<i class="fa fa-envelope fa-fw w3-margin-right w3-text-theme"></i>
<b><?php echo $row->from_name ?></b>
</a>
<span style="padding-top:11px;display:block;">
<?php echo(nl2br($row->text)) ?>
</span>
</p>
<p style="clear:right;"></p>
<p class="w3-right"><?php echo($row->time_sent) ?></p>
</div>
</div>
<p style="clear:both;"></p>
<?php
} ?>