-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqna_write.php
159 lines (129 loc) · 4.14 KB
/
qna_write.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
<?php
$code_page='third';
include "./head.php";
$shn = $_REQUEST['shn'];
$idx = $_REQUEST['idx'];
if(isset($_REQUEST['pg'])) {
$page = $_REQUEST['pg'];
}else{
$page = 1;
}
if(isset($_REQUEST['s_pagecnt'])) {
$s_pagecnt = $_REQUEST['s_pagecnt'];
}else{
$s_pagecnt = 15;
}
if(isset($_REQUEST['spg'])) {
$spg = $_REQUEST['spg'];
}else{
$spg = 15;
}
$sMode= $_REQUEST['mode'];
if($sMode == "update") {
$sql1 = " SELECT * FROM tc_board where idx = '".$idx."' " ;
$result1 = mysqli_query($connect, $sql1);
$row = mysqli_fetch_array($result1);
}
?>
<script language="javascript">
<!--
function board_list()
{
document.listForm.target = ""
document.listForm.action ="./qna.php"
document.listForm.submit();
}
function board_delete()
{
document.listForm.mode.value = "del";
document.listForm.target = "FrmHid"
document.listForm.action ="./qna_ok.php"
document.listForm.submit();
}
function board_save()
{
if (document.listForm.b_title.value.length < 1)
{
alert("제목을 입력해 주세요 ")
document.listForm.b_title.focus();
return;
}
if (document.listForm.b_custname.value.length < 1)
{
alert("작성자를 입력해 주세요 ")
document.listForm.b_custname.focus();
return;
}
document.listForm.target = "FrmHid"
document.listForm.action ="./qna_ok.php"
document.listForm.submit();
}
-->
</script>
<div class="notice_cont">
<h2 class="sub_tit">1:1<span class="po_b">문의게시판</span></h2>
<!-- 게시물 시작 -->
<span style="display:none">
<input type="passwd" name="bbs_spam_value" id="bbs_spam_value" value="">
</span>
<form class="form-horizontal" method="post" name="listForm" action="qna_ok.php" enctype=multipart/form-data >
<input type="hidden" name="idx" value="<?php echo $row['idx']; ?>">
<input type="hidden" name="pg" value="<?php echo $page ; ?>">
<input type="hidden" name="spg" value="<?php echo $spg; ?>">
<input type="hidden" name="shn" value="<?php echo $shn; ?>">
<input type="hidden" name="s_pagecnt" value="<?php echo $s_pagecnt; ?>">
<input type="hidden" name="mode" value="<?php echo $sMode; ?>">
<input type="hidden" name="mpage" value="<?php echo $mpage;?>">
<input type="hidden" name="spage" value="<?php echo $spage;?>">
<input type="hidden" name="old_b_file01" value="<?php echo $row['b_file01'];?>">
<input type="hidden" name="privacy" value="Y">
<div class="bbs_input_ment">
<font color="#666">*</font> 표시는 필수입력 사항으로<span class="mobile_enter"></span> 글 작성시 반드시 기재해야 하는 항목입니다.
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="bbs_input">
<caption><div class="hide">글쓰기 및 수정</div></caption>
<colgroup>
<col width="15%" />
<col width="85%" />
</colgroup>
<tr>
<th>이름 *</th>
<td width=""><input id="b_custname" name="b_custname" value="<?php echo $row['b_custname'];?>" type="text" size="20" class="input" /></td>
</tr>
<tr>
<th>제목 *</th>
<td colspan="3"><input id="b_title" name="b_title" value="<?php echo $row['b_title'];?>" type="text" size="60" class="input l_input" /></td>
</tr>
<tr>
<th>팝업</th>
<td colspan="3"><input type="checkbox" id="b_popup_flag" name="b_popup_flag" value="Y" <?php if($row['b_popup_flag'] == "Y") { ?>checked<?php } ?> ><span class="txtw">팝업표시</span></td>
</tr>
<tr>
<th>내용 *</th>
<td colspan="3">
<textarea class="textarea" name="b_memo" id="b_memo" style="width: 100%; height: 200px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd;"><?php echo $row['b_memo'];?></textarea>
</td>
</tr>
<tr>
<th>파일첨부</th>
<td colspan="3">
<input type="file" class="custom-file-input" id="b_file01" name="b_file01">
<?php if($sMode == "update") { ?>
<?php echo $row['b_file01'];?>
<?php } ?>
</td>
</tr>
</table>
</form>
<!-- 버튼 -->
<div class="bbs_btn">
<ul>
<li class="list_btn inner_btn">
<a href="javascript:board_list();" class="btn_w">리스트</a>
<a href="javascript:board_save();" class="btn_b">작성하기</a>
</li>
</ul>
</div>
<!-- 버튼 끝 -->
</div>
<? include "./foot.php"; ?>