-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessage_view.php
More file actions
69 lines (63 loc) · 1.99 KB
/
message_view.php
File metadata and controls
69 lines (63 loc) · 1.99 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Youth Is A Travel</title>
<link rel="stylesheet" type="text/css" href="./css/common.css">
<link rel="stylesheet" type="text/css" href="./css/message.css">
</head>
<body>
<header>
<?php include "header.php";?>
</header>
<section id="main">
<div id="message_box">
<h3 class="title">
<?php
$mode = $_GET["mode"];
$num = $_GET["num"];
$con = mysqli_connect("localhost", "user1", "12345", "sample");
$sql = "select * from message where num=$num";
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_array($result);
$send_id = $row["send_id"];
$rv_id = $row["rv_id"];
$regist_day = $row["regist_day"];
$subject = $row["subject"];
$content = $row["content"];
$content = str_replace(" ", " ", $content);
$content = str_replace("\n", "<br>", $content);
if ($mode=="send")
$result2 = mysqli_query($con, "select name from members where id='$rv_id'");
else
$result2 = mysqli_query($con, "select name from members where id='$send_id'");
$record = mysqli_fetch_array($result2);
$msg_name = $record["name"];
if ($mode=="send")
echo "송신 쪽지함 > 내용보기";
else
echo "수신 쪽지함 > 내용보기";
?>
</h3>
<ul id="view_content">
<li>
<span class="col1"><b>제목 :</b> <?=$subject?></span>
<span class="col2"><?=$msg_name?> | <?=$regist_day?></span>
</li>
<li>
<?=$content?>
</li>
</ul>
<ul class="buttons2">
<li><button onclick="location.href='message_box.php?mode=rv'">수신 쪽지함</button></li>
<li><button onclick="location.href='message_box.php?mode=send'">송신 쪽지함</button></li>
<li><button onclick="location.href='message_response_form.php?num=<?=$num?>'">답변 쪽지</button></li>
<li><button onclick="location.href='message_delete.php?num=<?=$num?>&mode=<?=$mode?>'">삭제</button></li>
</ul>
</div> <!-- message_box -->
</section>
<footer>
<?php include "footer.php";?>
</footer>
</body>
</html>