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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
|
<?php include("./_common.php"); include($j3_adm_path."/shop_header.php");
//$qstr = $_SERVER['QUERY_STRING'];
$bbsinfo = bbs_info($b_table);
if($code!=''){ $sql = "select * from {$table_name} a where 1=1 and a.idx = '{$code}' "; $res = mysql_query($sql,$connect_j3); $cinfo = mysql_fetch_array($res);
$sql = "select * from shop_bbs_file where b_table = '{$b_table}' and b_idx = '{$code}' "; $res = mysql_query($sql,$connect_j3); while($info = mysql_fetch_array($res)){ $b_file_array[$info['b_no']] = $info; } } else if($pcode!=''){ $sql = "select * from {$table_name} a where 1=1 and a.idx = '{$pcode}' "; $res = mysql_query($sql,$connect_j3); $pinfo = mysql_fetch_array($res);
$cinfo['w_name'] = $id_name; $cinfo['w_email'] = $id_email; $cinfo['e_ecode'] = $id_code; $cinfo['w_login_id'] = $id; $cinfo['w_subject'] = "Re: {$pinfo['w_subject']}"; } else { $cinfo['w_name'] = $id_name; $cinfo['w_email'] = $id_email; $cinfo['e_ecode'] = $id_code; $cinfo['w_login_id'] = $id; }
if($cinfo['w_login_id']!=''){ $비밀번호숨김클래스 = "screen_out"; } if($cinfo['w_notice']=='1'){ $ck_w_notice = "checked"; } else { $ck_w_notice = ""; }
$공지사항필드 = "<input type='checkbox' name='w_notice' value='1' {$ck_w_notice}>"; $작성자필드 = "<input type='text' name='w_name' class='width_200' value='{$cinfo['w_name']}'>"; $이메일필드 = "<input type='text' name='w_email' class='width_200' value='{$cinfo['w_email']}'>"; $비밀번호필드 = "<input type='password' name='w_passwd' class='width_200' value=''>"; $제목필드 = "<input type='text' name='w_subject' class='width_500' value='{$cinfo['w_subject']}'>"; $내용필드 = "<textarea name='w_content' id='w_content'>{$cinfo['w_content']}</textarea>"; $조회수필드 = "<input type='text' name='w_hit' class='width_100' value='{$cinfo['w_hit']}'>"; for($i=0;$i<$bbsinfo['b_file_cnt'];$i++){ $파일필드[$i] = "<input type='file' name='add_file[]'>"; $file_info = $b_file_array[$i]; if($file_info['idx']!=''){ $파일필드[$i] .= " <a href='board_download.php?b_table={$b_table}&idx={$code}&b_no={$i}'>{$file_info['b_oriname']}</a>"; $파일필드[$i] .= " <input type='checkbox' name='add_file_del_{$i}' value='1'> 삭제"; } $파일필드[$i] .= "<br>"; }
if($bbsinfo['b_file_cnt']==0){ $파일숨김클래스 = "screen_out"; } if($bbsinfo['b_cate']==''){ $분류숨김클래스 = "screen_out"; } else{ $분류필드 = "<select name='w_cate'>"; $cate_array = explode("|",$bbsinfo['b_cate']); $분류필드 .= "<option value=''>--선택--</option>"; foreach($cate_array as $key=>$val){ if($cinfo['w_cate']==$val){ $std = "selected"; } else { $std = ""; } $분류필드 .= "<option value='{$val}' {$std}>{$val}</option>"; } $분류필드 .= "</select>"; }
$히든필드 = "<input type='hidden' name='qstr' value=''> <input type='hidden' name='code' value='{$code}'> <input type='hidden' name='pcode' value='{$pcode}'> <input type='hidden' name='b_table' value='{$b_table}'> <input type='hidden' name='w_ecode' value='{$cinfo['e_ecode']}'> <input type='hidden' name='w_ccode' value='{$cinfo['w_ccode']}'> <input type='hidden' name='w_login_id' value='{$cinfo['w_login_id']}'>"; ?> <?php if($shop_du_size>$limit_mbyte){ ?> <script src="<?php echo $j3_lib_url?>/ckeditor-nf/ckeditor.js"></script> <?php } else { ?> <script src="<?php echo $j3_lib_url?>/ckeditor/ckeditor.js"></script> <?php }?> <style> #w_content { width:95%; height:300px; margin-top:10px; } </style> <div id="wrap" class='container_wrap'> <div id="sub-title"> <h2><?php echo $bbsinfo['b_title'];?> 게시판 <?php if($code==''){?>신규<?php } else {?>수정<?php }?></h2> <div class="sub-location"> <a href="./index.php" class="home"><span class="screen_out">홈</span></a> <span class="location-gt"></span> <a>게시판관리</a> <span class="location-gt"></span> <a><?php echo $bbsinfo['b_title'];?> 게시판</a> </div> </div>
<form name='board_reg_form' method='post' action='ajax.board_reg_process.php' enctype="multipart/form-data"> <?php echo $히든필드;?>
<div class='cust_modal1'> <h4>기본 정보</h4> <table class="order-sheet table-top-border"> <caption class="screen_out">기본정보</caption> <colgroup> <col style="width:150px;"><col style="width:800px;"> </colgroup>
<tbody> <tr> <th>공지사항</th> <td> <?php echo $공지사항필드;?> <span class='help_info'>게시판 공지사항으로 지정합니다.</span> </td> </tr> <tr class='<?php echo $분류숨김클래스;?>'> <th>분류</th> <td> <?php echo $분류필드;?> </td> </tr> <tr> <th>작성자</th> <td> <?php echo $작성자필드;?> </td> </tr> <tr> <th>이메일</th> <td> <?php echo $이메일필드;?> </td> </tr> <tr> <th>조회수</th> <td> <?php echo $조회수필드;?> </td> </tr> <tr class='<?php echo $비밀번호숨김클래스;?>'> <th>비밀번호</th> <td> <?php echo $비밀번호필드;?> </td> </tr> <tr> <th>제목</th> <td> <?php echo $제목필드;?> </td> </tr> <tr> <th>내용</th> <td> <?php echo $내용필드;?> </td> </tr> <tr class='<?php echo $파일숨김클래스;?>'> <th>첨부파일</th> <td> <?php if($shop_du_size>$limit_mbyte){ echo "쇼핑몰 설정용량보다 오버되고 있습니다. 일부 파일 업로드 기능이 제한됩니다."; } else { foreach($파일필드 as $key=>$val){ echo $val; } } ?> </td> </tr> </table> </div>
</form> <div id="sub-contents-area" style='padding-left:500px;padding-top:20px;'> <div class="sub-btn-area"> <div class="sub-btn"> <a class="lignt-blue-btn" id='btn_board_save'>저장</a> <a class="gray-btn" id='btn_cancel_save'>목록</a> </div> </div> </div> </div> <!-- wrap end--> <script> function form_save(){ // 거래처 저장/수정 var form_obj = $("form[name='board_reg_form']"); if($(form_obj).find("input[name='w_name']").val()==''){ alert('작성자를 입력하세요.'); return; } if($(form_obj).find("input[name='w_subject']").val()==''){ alert('제목을 입력하세요.'); return; } $(form_obj).find("textarea[name='w_content']").val(CKEDITOR.instances.w_content.getData()); if($(form_obj).find("textarea[name='w_content']").val()==''){ alert('내용을 입력하세요.'); return; }
$(form_obj).find("input[name='qstr']").val('<?php echo $qstr;?>'); if(confirm('저장하시겠습니까?')){ form_obj.submit(); } //$(form_obj).submit(); }
$(function(){ if('<?php echo $cinfo['biztype']?>'=='0'){ $(".biztype0").show(); $(".biztype1").hide(); } if('<?php echo $cinfo['biztype']?>'=='1' || '<?php echo $cinfo['biztype']?>'==''){ $(".biztype0").hide(); $(".biztype1").show(); } $(".input_readonly").attr("readonly",true); $("input[name='comp_name']").focus();
$("input[name='email1']").change(function(){ $("input[name='tax_charge_email1']").val($(this).val()); }); $("input[name='email2']").change(function(){ $("input[name='tax_charge_email2']").val($(this).val()); });
$(document).on("click","input[name='code_auto']",function(){ // 코드자동 선택시 if($(this).is(":checked")){ $("input[name='code1']").addClass("input_readonly").attr("readonly",true).val("");
} else { $("input[name='code1']").removeClass("input_readonly").attr("readonly",false); } });
$("#btn_board_save").click(function(){ form_save(); });
$("#btn_cancel_save").click(function(){ // 취소 버튼 document.location.href='board.php?<?php echo $_COOKIE['qstr'];?>'; });
$(document).on("click",".zip_search",function(){ // 주소오픈 postSearch3("zipcode","","addr_m"); });
setTimeout(function(){ $("input[name='comp_name']").focus(); },500); }) <?php if($shop_du_size>$limit_mbyte){ ?> CKEDITOR.replace( 'w_content', { height: 300, filebrowserUploadUrl:"" } ); <?php } else { ?> CKEDITOR.replace( 'w_content', { height: 300 } ); <?php } ?> </script> <?php include($j3_adm_path."/shop_footer.php"); ?> <script src="http://dmaps.daum.net/map_js_init/postcode.v2.js"></script> <div id="daum_juso_rayer" style="background:#fff;border: 5px solid currentColor; left: 50%; top: 50%; width: 300px; height: 460px; overflow: hidden; margin-top: -235px; margin-left: -155px; display:none ; position: fixed; z-index: 10000; -webkit-overflow-scrolling: touch;"><input type='button' onclick="$('#daum_juso_rayer').hide();" value='close' style='top:0px;width:40px;height:20px;right:0px;padding:0px;'> <iframe src="about:blank" frameborder="0" style="margin: 0px;margin-top:30px; padding: 0px; border: 0px currentColor; left: 0px; top: 0px; width: 100%; height: 90%; overflow: hidden; position: absolute; min-width: 300px;"></iframe> </div>
|