-
Notifications
You must be signed in to change notification settings - Fork 0
/
sent.php
72 lines (62 loc) · 1.83 KB
/
sent.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
71
72
<table width="700">
<tr> <th>Receiver:</th>
<th>Subject</th>
<th>Date</th>
<th>Reply</th>
</tr>
<?php
$sel_msg="select * from messages where receiver='$user_id'";
$run_msg=mysqli_query($con,$sel_msg);
$count_msg=mysqli_num_rows($run_msg);
while($row_msg=mysqli_fetch_array($run_msg))
{
$msg_id=$row_msg['msg_id'];
$msg_receiver=$row_msg['receiver'];
$msg_sender=$row_msg['sender'];
$msg_sub=$row_msg['msg_sub'];
$msg_topic=$row_msg['msg_topic'];
$msg_date=$row_msg['msg_date'];
// echo $msg_sender;
// echo $msg_receiver;
$get_receiver="select * from users where user_id='$msg_receiver'";
$run_receiver=mysqli_query($con,$get_receiver);
$row=mysqli_fetch_array($run_receiver);
$receiver_name=$row['user_name'];
?>
<tr align="center">
<td>
<a href="user_profile.php?u_id=<?php echo $msg_receiver;?>"
target="blank"> <?php echo $receiver_name; ?>
</a>
</td>
<td>
<a href="my_messages.php?sent&msg_id=<?php
echo $msg_id; ?>"> <?php echo $msg_sub; ?>
</a>
</td>
<td>
<?php echo $msg_date; ?></td>
<td><a href ="my_messages.php?sent&msg_id=<?php echo $msg_id;
?>" >Reply</a></td>
</tr>
<?php } ?>
</table>
<?php
if(isset($_GET['msg_id']))
{
$get_id= $_GET['msg_id'];
// echo "zihan";
$sel_message="select * from messages where msg_id='$get_id'";
$run_message=mysqli_query($con,$sel_message);
$row_message=mysqli_fetch_array($run_message);
$msg_subject=$row_message['msg_sub'];
$msg_topic=$row_message['msg_topic'];
$reply_content=$row_message['reply'];
echo "<center><br/><hr>
<h2>$msg_subject</h2>
<p><b><My Message:</b>$msg_topic</p>
<p><b>Their Reply:</b>$reply_content</p>
</center>
";
}
?>