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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
|
<?php include("./_common.php"); include($j3_adm_path."/shop_header.php");
if($code!=''){ $sql = "select * from shop_event a where 1=1 and idx = '{$code}'"; $res = mysql_query($sql,$connect_j3); $cinfo = mysql_fetch_array($res);
//$ev_prod_array = prod_event_get($code, $admin_page, ""); //이벤트 상품을 가져온다. $ev_prod_array = prod_event_get($code, $where2, 1, 9999, $admin_page); // 이벤트 상품을 가져온다.
} else { $cinfo['ev_width'] = "150"; $cinfo['ev_height'] = "150"; $cinfo['ev_width_m'] = "250"; $cinfo['ev_height_m'] = "250"; $cinfo['ev_row_cnt'] = "4"; $cinfo['ev_col_cnt'] = "4"; $cinfo['ev_cnt_m'] = "15"; } $sql = "select ev_type from shop_event group by ev_type "; $res = mysql_query($sql,$connect_j3); while($info = mysql_fetch_array($res)){ $ev_type_array[] = $info['ev_type']; }
?> <?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 }?> <div id="wrap" class='container_wrap'> <div id="sub-title"> <h2>이벤트 <?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>이벤트관리</a> </div> </div>
<form name='event_reg_form' method='post' action='ajax.event_reg_process.php' enctype="multipart/form-data"> <input type='hidden' name='qstr' value=''> <input type='hidden' name='code' value='<?php echo $cinfo['idx'];?>'>
<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:350px;"> <col style="width:150px;"><col style="width:350px;"> </colgroup>
<tbody> <?php if($code!=''){ ?> <tr> <th>링크(PC/모바일 겸용)</th> <td colspan=3><?php echo "./event.php?idx={$cinfo['idx']}";?> <span class='help_info'>도메인이 변경되어도 사용 가능합니다. 쇼핑몰내에서 이링크를 주로 사용하시면 됩니다.</span></td> </tr> <tr> <th>이벤트 링크(PC전용)</th> <td colspan=3><?php echo "../shop/event.php?idx={$cinfo['idx']}";?> <span class='help_info'>도메인이 변경되어도 사용 가능합니다. PC전용 이벤트시에만 사용합니다.</span></td> </tr> <tr> <th>이벤트 링크(모바일전용)</th> <td colspan=3><?php echo "../shopm/event.php?idx={$cinfo['idx']}";?> <span class='help_info'>도메인이 변경되어도 사용 가능합니다. 모바일전용 이벤트시에만 사용합니다.</span></td> </tr> <tr> <th>이벤트 링크(풀링크)</th> <td colspan=3><?php echo "{$j3_shop_url}/event.php?idx={$cinfo['idx']}";?> <span class='help_info'>풀링크는 도메인이 변경되면 바꿔줘야 합니다. 주로 블로그나 카페에 링크시 사용합니다.</span></td> </tr> <?php }?> <tr> <th>이벤트분류코드</th> <td colspan=3> <select name='ev_type' style='width:150px;'> <?php foreach($ev_type_array as $key=>$val){ if($val==$cinfo['ev_type']){ $std = "selected"; } else { $std = ""; } echo " <option value='{$val}' {$std}>{$val}</option>"; } ?> </select> <input type='checkbox' name='add_type_ck' value='1'> <input type='text' name='add_type_name' class='width_100'> <span class='help_info'>분류를 추가할때는 체크박스를 클릭하고 왼쪽박스에 추가코드를 넣으시면 됩니다. 코드는 영숫자와 _ 만 입력하세요.</span> </td> </tr> <tr> <th>이벤트 제목</th> <td colspan=3><input type='text' name='ev_subject' class='width_500' value='<?php echo $cinfo['ev_subject'];?>'></td> </tr> <tr> <th>이벤트 사용 여부</th> <td colspan=3> <input type='radio' name='ev_use' value='1' <?php if($cinfo['ev_use']=='1' || $cinfo['ev_use']==''){?>checked<?php }?>> 사용함 <input type='radio' name='ev_use' value='0' <?php if($cinfo['ev_use']=='0'){?>checked<?php }?>> 사용안함 </td> </tr> <tr> <th>pc 이미지 width</th> <td><input type='text' name='ev_width' class='width_100' value='<?php echo $cinfo['ev_width'];?>'> px</td> <th>pc 이미지 height</th> <td><input type='text' name='ev_height' class='width_100' value='<?php echo $cinfo['ev_height'];?>'> px</td> </tr> <tr> <th>pc 상품 가로갯수</th> <td><input type='text' name='ev_row_cnt' class='width_60' value='<?php echo $cinfo['ev_row_cnt'];?>'></td> <th>pc 상품 세로갯수</th> <td><input type='text' name='ev_col_cnt' class='width_60' value='<?php echo $cinfo['ev_col_cnt'];?>'></td> </tr> <tr> <th>모바일 이미지 width</th> <td><input type='text' name='ev_width_m' class='width_100' value='<?php echo $cinfo['ev_width_m'];?>'> px</td> <th>모바일 이미지 height</th> <td><input type='text' name='ev_height_m' class='width_100' value='<?php echo $cinfo['ev_height_m'];?>'> px</td> </tr>
<tr> <th>모바일 상품갯수</th> <td colspan=3><input type='text' name='ev_cnt_m' class='width_60' value='<?php echo $cinfo['ev_cnt_m'];?>'></td> </tr> <tr> <th>이벤트 배너</th> <td colspan=3> <input type='file' name='ev_banner' class='' value=''> <span class='help_info'>쇼핑몰 레이아웃에서 글자 대신 이미지로 출력할 경우 사용합니다. 쇼핑몰 구성에 따라 표시 안될수도 있습니다.</span> <?php if(file_exists("{$j3_data_path}/ico/ev_banner_{$code}")){?> <br><img src='<?php echo "{$j3_data_url}/ico/ev_banner_{$code}";?>'> <input type='checkbox' name='ev_banner_del' value='1'> 삭제 <?php }?> </td> </tr> <tr> <th>모바일 이벤트 배너</th> <td colspan=3> <input type='file' name='ev_banner_m' class='' value=''> <span class='help_info'>쇼핑몰 레이아웃에서 글자 대신 이미지로 출력할 경우 사용합니다. 쇼핑몰 구성에 따라 표시 안될수도 있습니다.</span> <?php if(file_exists("{$j3_data_path}/ico/ev_banner_m_{$code}")){?> <br><img src='<?php echo "{$j3_data_url}/ico/ev_banner_m_{$code}";?>'> <input type='checkbox' name='ev_banner_m_del' value='1'> 삭제 <?php }?> </td> </tr> <tr> <th>상단 이미지</th> <td colspan=3> <input type='file' name='ev_hd_image' class='' value=''> <span class='help_info'>상단에 이벤트용 이미지를 넣습니다. 상단내용보다 먼저 위치합니다.</span> <?php if(file_exists("{$j3_data_path}/ico/ev_hd_image_{$code}")){?> <br><img src='<?php echo "{$j3_data_url}/ico/ev_hd_image_{$code}";?>' style='max-width:800px;'> <input type='checkbox' name='ev_hd_image_del' value='1'> 삭제 <?php }?> </td> </tr> <tr> <th>하단 이미지</th> <td colspan=3> <input type='file' name='ev_ft_image' class='' value=''> <span class='help_info'>하단에 이벤트용 이미지를 넣습니다. 하단내용보다 먼저 위치합니다.</span> <?php if(file_exists("{$j3_data_path}/ico/ev_ft_image_{$code}")){?> <br><img src='<?php echo "{$j3_data_url}/ico/ev_ft_image_{$code}";?>' style='max-width:800px;'> <input type='checkbox' name='ev_ft_image_del' value='1'> 삭제 <?php }?> </td> </tr> <tr> <th>이벤트 상단내용</th> <td colspan=3 style='padding:5px;'><textarea name='ev_hd_content' id='ev_hd_content'><?php echo $cinfo['ev_hd_content'];?></textarea></td> </tr> <tr> <th>이벤트 하단내용</th> <td colspan=3 style='padding:5px;'><textarea name='ev_ft_content' id='ev_ft_content'><?php echo $cinfo['ev_ft_content'];?></textarea></td> </tr> <tr> <th>이벤트 상품관리</th> <td colspan=3 style='padding:5px;'> <span class='btn_frmline2 add_ev_product'>상품 추가</span> <table class='bank_table'> <colgroup> <col style="width:50px;"><col style="width:100px;"><col style="width:150px;"><col style="width:100px;"><col style="width:350px;"><col style="width:150px;"><col style="width:100px;"> </colgroup> <thead> <tr> <th><input type='checkbox' class='bank_ck_all'></th> <th>이미지</th> <th>분류명</th> <th>상품코드</th> <th>상품명</th> <th><?php if($configshop['ev_cart_saleprice']=='1'){ echo "이벤트 전용단가"; } else { echo "매출단가"; }?></th> <th>순서</th> </tr> </thead> <tbody> <?php foreach($ev_prod_array as $key=>$info){ if($info['code']!=''){ ?> <tr> <td class='tcenter2'><input type='checkbox' name='prod_idx[]' value='1' class='acc_idx'><input type='hidden' name='ccode[]' value='<?php echo $info['pcode'];?>'></td> <td class='tcenter2'><img src='<?php echo $thumb_file = get_it_thumbnail($info['pcode'],$info['pic1'],50,50);?>' onerror='this.style.display="none"'></td> <td><?php echo $info['cate_name'];?></td> <td class='tcenter2'><?php echo $info['code1'];?></td> <td><?php echo $info['name'];?></td> <td class='cost'> <?php if($configshop['ev_cart_saleprice']=='1'){ ?> <input type='text' name='ev_saleprice[]' value='<?php echo $info['ev_saleprice'];?>' class='width_100'> <?php } else {?> <?php echo $info['ori_saleprice'];?> <?php }?> </td> <td class='tcenter2'><input type='text' name='prod_seq[]' value='<?php echo $info['seq'];?>' class='width_60'></td> </tr> <?php } } ?> </tbody> </table> <?php if($configshop['ev_cart_saleprice']=='1'){ ?> <span class='help_info'>이벤트 전용단가는 0원 이상일경우 동작합니다. 0원이면 동작하지 않습니다.</span><br> <?php }?> <span class='btn_frmline2 del_ev_product' style='margin-bottom:5px;'>선택삭제</span> </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_event_save'>저장</a> <a class="gray-btn" id='btn_cancel_save'>취소</a> </div> </div> </div> </div> <!-- wrap end--> <script> $(function(){ $(".bank_ck_all").click(function(){ // 전체선택 전체선택 해제 if($(this).is(":checked")){ $("input[name='prod_idx[]']").prop("checked",true); } else { $("input[name='prod_idx[]']").prop("checked",false); } });
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);
$("#btn_event_save").click(function(){ // form_save(); });
$("#btn_cancel_save").click(function(){ // 취소 버튼 document.location.href='event.php?<?php echo $_COOKIE['qstr'];?>'; });
$(".add_ev_product").click(function(){ // 상품 검색 선택 $.get("product_list.inc.php?mode=event",function(rtn){ $("#modal_member_box2").html(rtn).dialog({ resizable: true, height:740, width:1150, modal: true, title:"거래처 [검색]", buttons: { 상품선택: function() { add_ev_product(); }, 닫기: function() { $( this ).dialog( "close" ); } } }); }); });
$(".del_ev_product").click(function(){ // 이벤트 상품 선택 삭제 $("input[name='prod_idx[]']").each(function(){ if($(this).is(":checked")){ $(this).closest("tr").remove(); } }); }); });
function form_save(){ var form_obj = $("form[name='event_reg_form']");
if($("input[name='add_type_ck']").is(":checked")){ if($("input[name='add_type_name']").val()==''){ alert('이벤트분류코드를 입력하시기 바랍니다.'); return; } } else { if($("select[name='ev_type'] option").eq(0).val()==undefined){ alert('이벤트분류코드를 선택하시기 바랍니다..'); return; } } if($(form_obj).find("input[name='ev_subject']").val()==''){ alert('제목을 입력하세요.'); return; }
v1 = CKEDITOR.instances.ev_hd_content.getData(); $("#ev_hd_content").val(v1); v2 = CKEDITOR.instances.ev_ft_content.getData(); $("#ev_ft_content").val(v2); $(form_obj).find("input[name='qstr']").val('<?php echo $qstr;?>'); if(confirm('저장하시겠습니까?')){ $("form[name='event_reg_form']").submit(); } }
function add_ev_product(){ // 이벤트용 상품 추가 $form_obj = $("form[name='product_list_form']"); $table_obj = $(".bank_table tbody"); $ck_cnt = 0; $form_obj.find("input[name='code_idx[]']").each(function(){ if($(this).is(":checked")){ $tr_obj = $(this).closest("tr"); $codes = $tr_obj.find("input[name='codes[]']").val(); $code1 = $tr_obj.find("input[name='code1[]']").val(); $pname = $tr_obj.find("input[name='pname[]']").val(); $catename = $tr_obj.find("input[name='catename[]']").val(); $saleprice = $tr_obj.find("input[name='saleprice[]']").val(); $thumb_file = $tr_obj.find("input[name='thumb_file[]']").val();
$flag = ck_ev_product($codes); if($flag==false){ $table_obj.append("<tr><td class='tcenter2'><input type='checkbox' name='prod_idx[]' value='1' class='acc_idx'><input type='hidden' name='ccode[]' value='"+$codes+"'></td><td class='tcenter2'><img src='"+$thumb_file+"' onerror='this.style.display=\"none\"' width=50></td><td>"+$catename+"</td><td class='tcenter2'>"+$code1+"</td><td>"+$pname+"</td><td class='cost'>"+formatCurrency($saleprice)+"</td><td class='tcenter2'><input type='text' name='prod_seq[]' value='0' class='width_60'></td></tr>"); $ck_cnt++; } } }); }
function ck_ev_product(code){ // 이미 등록된 상품인지 체크 $ff = false; $("input[name='ccode[]']").each(function(){ if(code==$(this).val()){ $ff = true;} }); return $ff; }
<?php if($shop_du_size>$limit_mbyte){ ?> CKEDITOR.replace( 'ev_hd_content', { height: 250, filebrowserUploadUrl:"" } ); CKEDITOR.replace( 'ev_ft_content', { height: 250, filebrowserUploadUrl:"" } ); <?php } else { ?> CKEDITOR.replace( 'ev_hd_content', { height: 250 } ); CKEDITOR.replace( 'ev_ft_content', { height: 250 } ); <?php } ?> </script> <?php include($j3_adm_path."/shop_footer.php"); ?> <div id="modal_member_box2" title="거래처수정" style="display:none;width:100%; height:100%; padding-top:3px;padding-left:3px;background-color:#FFFFFF;position:relative;"></div>
|