-
Notifications
You must be signed in to change notification settings - Fork 0
/
load_sent.php
65 lines (47 loc) · 2.25 KB
/
load_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
<div>
<?php
if(isset($_GET['id'])){
include_once("mysql_info.php");
$user_id = $_GET['id'];
$sql = "select active from member where id='$user_id'";
$result = mysqli_query($link,$sql);
$check_active = mysqli_fetch_array($result);
//1 普通 2 刪除
$sql = "select m.username as receiver, msg.* from member m, message msg where m.id = msg.to and msg.from='$user_id' and sender_status=1 order by msg.id desc";
$result = mysqli_query($link,$sql);
$id=$_GET["id"];
if($check_active[active]==1){
?>
<table class="table table-striped table table-hover" style="margin:15px 0px 15px 0px">
<tr><th class="col-md-2">收件人</th><th class="col-md-6">主旨</th><th class="col-md-2">日期/時間</th><th class="col-md-2">動作</th></tr>
<?php
$number_of_row=mysqli_num_rows($result);
for($k = 0; $k < $number_of_row; $k ++) {
if($row = mysqli_fetch_array($result)){
echo '<tr ';
$class = "";
if($id==$row[id]){
$class='class="info" ';
}
echo $class.'onClick="location.href=\'sent_message_area.php?id='.$row[id].'\'">
<form action="delete_message.php" method="POST">
<td class="col-md-2">'.$row[receiver].'</td>
<td class="col-md-6">'.$row[subject].'</td>
<td class="col-md-2">'.$row[date].'</td>
<td class="col-md-2">
<input type="submit" value="刪除" class="btn btn-danger">
<input type="hidden" value="'.$row[id].'" name="id"></td>
</form><tr>';
if($id==$row[id]){
echo '<tr><td colspan="1"></td><td class="info" colspan="3">'.nl2br($row[body]).'</td></tr>';
}
}
}
}else{
echo "<center>您的帳號尚未啟用,請至信箱收取驗證信。</center>";
}
}else{
echo "<center>查無使用者。</center>";
}?>
<div class="col-md-1"></div>
</div>