forked from osohyun0224/NaverConnect_SW_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
read.php
172 lines (167 loc) · 3.9 KB
/
read.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?php
include ('db_connect.php');
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>게시판</title>
<style>
#board_read {
width:900px;
position: relative;
word-break:break-all;
}
#user_info {
font-size:14px;
}
#user_info ul li {
float:left;
margin-left:10px;
}
#bo_line {
width:880px;
height:2px;
background: gray;
margin-top:20px;
}
#bo_content {
margin-top:20px;
}
#bo_ser {
font-size:14px;
color:#333;
position: absolute;
right: 0;
}
#bo_ser > ul > li {
list-style: none;
float:left;
margin-left:10px;
}
/* 댓글 */
.reply_view {
width:900px;
margin-top:100px;
word-break:break-all;
}
.dap_lo {
font-size: 14px;
padding:10px 0 15px 0;
border-bottom: solid 1px gray;
}
.dap_to {
margin-top:5px;
}
.rep_me {
font-size:12px;
}
.rep_me ul li {
float:left;
width: 30px;
}
.dat_delete {
display: none;
}
.dat_edit {
display:none;
}
.dap_sm {
position: absolute;
top: 10px;
}
.dap_edit_t{
width:520px;
height:70px;
position: absolute;
top: 40px;
}
.re_mo_bt {
position: absolute;
top:40px;
right: 5px;
width: 90px;
height: 72px;
}
#re_content {
width:700px;
height: 56px;
resize: none;
}
.dap_ins {
margin-top:50px;
}
.re_bt {
position: absolute;
width:100px;
height:56px;
font-size:16px;
margin-left: 10px;
}
#foot_box {
height: 50px;
}
</style>
</head>
<body>
<?php
$board_id = $_GET['board_id'];
$bno = $_GET['idx']; /* bno함수에 idx값을 받아와 넣음*/
$hit = mysqli_fetch_array(mq("select * from ".$board_id." where idx ='".$bno."'"));
$hit = $hit['hit'] + 1;
$fet = mq("update ".$board_id." set hit = '".$hit."' where idx = '".$bno."'");
$sql = mq("select * from ".$board_id." where idx='".$bno."'"); /* 받아온 idx값을 선택 */
$board = $sql->fetch_array();
?>
<!-- 글 불러오기 -->
<div id="board_read">
<h2><?php echo $board['title']; ?></h2>
<div id="user_info" align=right>
<?php echo $board['name']; ?> <?php echo $board['date']; ?> 조회:<?php echo $board['hit']; ?>
<div id="bo_line"></div>
</div>
<div>
파일 : <a href="uploads/<?php echo $board['file'];?>" download><?php echo $board['file']; ?></a>
</div>
<div id="bo_content">
<?php echo nl2br("$board[content]"); ?>
</div>
<!-- 목록, 수정, 삭제 -->
<div id="bo_ser">
<ul>
<li><a href="board.php?board_id=<?echo $board_id;?>">[목록으로]</a></li>
<?if ($board['name']==$_SESSION['userid']){?>
<li><a href="modify.php?idx=<?php echo $board['idx']; ?>">[수정]</a></li>
<li><a href="delete.php?idx=<?php echo $board['idx']; ?>">[삭제]</a></li>
<?}?>
</ul>
</div>
</div>
<!--- 댓글 불러오기 -->
<div class="reply_view">
<h3>댓글목록</h3>
<?php
$sql3 = mq("select * from ".$board_id."_reply where con_num='".$bno."' order by idx desc");
while($reply = $sql3->fetch_array()){
?>
<div class="dap_lo">
<div><b><?php echo $reply['name'];?></b></div>
<div class="dap_to comt_edit"><?php echo nl2br("$reply[content]"); ?></div>
<div class="rep_me dap_to"><?php echo $reply['date']; ?></div>
</div>
<?php } ?>
<!--- 댓글 입력 폼 -->
<div class="dap_ins">
<form action="reply_ok.php?board_id=<?echo $board_id;?>&idx=<?php echo $bno; ?>" method="post">
<input type="hidden" name="dat_user" id="dat_user" class="dat_user" size="15" placeholder="아이디" value=<?$_SESSION['userid']?>>
<div style="margin-top:10px; ">
<textarea name="content" class="reply_content" id="re_content" ></textarea>
<button id="rep_bt" class="re_bt">댓글</button>
</div>
</form>
</div>
</div><!--- 댓글 불러오기 끝 -->
<div id="foot_box"></div>
</div>
</body>
</html>