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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
|
<?php include("./_common.php"); if($modepos=='shop'){ $sub_menu = "150200"; } else if($modepos=='etc'){ $sub_menu = "150300"; } else if($modepos=='shopm'){ $sub_menu = "150500"; } else if($modepos=='etcm'){ $sub_menu = "150600"; } include("./auth_check.php"); // 관리자 권한 체크 include($j3_adm_path."/shop_header.php");
if($modepos=='etc'){ $spa = $sk_pos_array2; $sta = $sk_type_array2; if($sk_pos==''){ $sk_pos = "login"; } } else if($modepos=='shop'){ $spa = $sk_pos_array; $sta = $sk_type_array; if($sk_pos==''){ $sk_pos = "main"; } } else if($modepos=='etcm'){ $spa = $sk_pos_arraym2; $sta = $sk_type_arraym2; if($sk_pos==''){ $sk_pos = "login"; } } else if($modepos=='shopm'){ $spa = $sk_pos_arraym; $sta = $sk_type_arraym; if($sk_pos==''){ $sk_pos = "main"; } }
$laxstr = substr($modepos,strlen($modepos)-1,1); // modepos 끝에 m이 붙으면 모바일 if($laxstr=='m'){ $pos = 'mobile'; $laststr_dir = "m"; $is_mobile = '1'; } else { $pos = 'pc'; $laststr_dir = ""; $is_mobile = '0';} // 모바일일경우 샘플 디렉토리에 마지막 문자 추가함
$click_edit = "click_edit";
if($order_key==''){ if($_COOKIE['ok_skin']!=''){ $_COOKIE['ok_skin'] = str_replace("%20"," ",$_COOKIE['ok_skin']); $order_key = $_COOKIE['ok_skin']; } else { $order_key = 'a.sk_seq, a.idx '; } }
$where = " and a.sk_pos = '{$sk_pos}' and a.pos = '{$pos}' ";
$stx = urldecode($stx);
if($stx!=''){ $where .= " and {$sti} like '%{$stx}%' "; }
if($stc!=''){ $where .= " and prod_cate_code_s = '{$stc}' "; }
if($stpc!=''){ $where .= " and prod_cate_code2 = '{$stpc}' "; }
$sql = "select count(*) as cnt from shop_skin_show a WHERE 1=1 {$where} "; $result = mysql_query($sql,$connect_j3); $row = mysql_fetch_array($result); $total_count = $row['cnt'];
$list_num = $config['page_line']; if($_COOKIE['page_line']!=''){ $list_num = $_COOKIE['page_line']; } $total_page = ceil($total_count / $list_num); // 전체 페이지 계산 if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) $from_record = ($page - 1) * $list_num; // 시작 열을 구함
$sql = "select a.*, b.sk_type, b.sk_name, b.sk_filename from shop_skin_show a left join shop_skin b on a.sk_idx = b.idx WHERE 1=1 $where order by $order_key limit $from_record, $list_num "; $result = mysql_query($sql,$connect_j3);
//_pr($sql); while($cus_info=mysql_fetch_array($result)){ $list_array[] = $cus_info; }
$qstr = $_SERVER['QUERY_STRING'];
// 분류명 가져오기 $sql = "select a.* from product_category_s a where 1=1 and lv = 2 "; $result = mysql_query($sql,$connect_j3); while($cus_info=mysql_fetch_array($result)){ $cate_array[] = $cus_info; }
// 상품그룹 가져오기 /*$sql = "select a.* from product_category2 a where 1=1 order by code"; $result = mysql_query($sql,$connect_j3); while($cus_info=mysql_fetch_array($result)){ $cate2_array[] = $cus_info; }*/ ?> <!--<div id="contents" style="background:#999"><img src="http://placehold.it/960x150" alt="롤링배너"></div>--> <style> /* 탭 영역 */ .item_tab { margin-top:10px;} .item_tab_navi { overflow: hidden;height:41px;border-bottom: 1px solid #999;} .item_tab_navi a { display:block;float:left;margin-right:5px;width:70px;height:42px; font-size:1.025em;font-weight:600;text-align:center;line-height:42px;cursor:pointer; box-shadow:inset 0px 1px 1px 0px #ffffff; background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f6f6f6), color-stop(0.09, #ffffff)); background:-moz-linear-gradient(top, #f6f6f6 5%, #ffffff 90%); background:-webkit-linear-gradient(top, #f6f6f6 5%, #ffffff 90%); background:-o-linear-gradient(top, #f6f6f6 5%, #ffffff 90%); background:-ms-linear-gradient(top, #f6f6f6 5%, #ffffff 90%); background:linear-gradient(to bottom, #f6f6f6 5%, #ffffff 90%); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#ffffff',GradientType=0); background-color:#f6f6f6; } .item_tab_navi a span { position:absolute;display:block;width:70px;height:41px;font-size:10.5px;border:1px solid #ddd;border-bottom:0px;} .item_tab_navi a.on span { border:1px solid #999;border-bottom:0px none;padding-bottom: 1px; background:#fff; -webkit-transition: .3s; transition: .3s; } </style> <div id="wrap" class='container_wrap'> <div id="sub-title"> <h2>스킨설정 관리<?php if(substr($modepos,0,4)=='shop'){?>(쇼핑몰)<?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='product_search_form' method='get'> <input type='hidden' name='biztype' size='' value='<?php echo $biztype;?>'> <input type='hidden' name='modepos' size='' value='<?php echo $modepos;?>'> <div id="sub-contents-area"> <div class="sub-btn-area"> <div class="sub-btn"> <a class="lignt-blue-btn" id='btn_order_new'>신규등록</a><a class="blue-btn" id='sel_edit'>선택수정</a><!--<a class="blue-btn">주문복사</a><?php if($Orow['ordstate']==0){ ?><a class="black-btn">전체삭제</a><?php }?><a class="gray-btn" id='buy_print'>인쇄</a><a class="gray-btn" id='xls_down'>엑셀</a>--><a class="black-btn" id='sel_delete'>선택삭제</a> </div> </div> <div class="sub-btn-area"> <div class="sub-btn sub-btn-search"> <select name='sti'> <option value='b.sk_name' <?php if($sti=='a.name'){?>selected<?php }?>>스킨명</option> <option value='b.sk_type' <?php if($sti=='a.code1'){?>selected<?php }?>>종류코드</option> </select> <input type='text' id='stx' name='stx' size='' value='<?php echo $stx;?>' class="stx_class"> <a href="#" class="black-btn" id='search_btn_press'>검색</a> </div> </div> </div> </form> <div class="item_tab"> <div class="item_tab_navi"> <?php foreach($spa as $key=>$val){ $val = str_replace("(m)","",$val); ?> <a value='<?php echo $key;?>' class="<?php if($sk_pos==$key){?>on<?php }?>"><span><?php echo $val;?></span></a> <?php } ?> <!-- <a value='header' class="<?php if($sk_pos=='header'){?>on<?php }?>"><span>상단</span></a> <a value='main' class="<?php if($sk_pos=='main'){?>on<?php }?>"><span>메인</span></a> <a value='footer' class="<?php if($sk_pos=='footer'){?>on<?php }?>"><span>하단</span></a> <a value='menu' class="<?php if($sk_pos=='menu'){?>on<?php }?>"><span>메뉴</span></a>--> </div> </div>
<form name='skin_list_form' method='post'> <input type='hidden' name='sel_del' value=''> <div class="div-list-area"> <div class="cust-list-area"> <table class="order-sheet2"> <caption class="screen_out">매입처 원장 조회<caption> <colgroup> <col style="width:30px;"> <col style="width:100px;"><col style="width:100px;"><col style="width:240px;"><col style="width:60px;"><col style="width:60px;"> <col style="width:100px;"><col style="width:60px;"><col style="width:60px;"> </colgroup>
<thead> <tr> <th scope="col"><input type='checkbox' name='ck_all' class='check_all_class'></th> <th scope="col">스킨위치</th><th scope="col">스킨종류</th><th scope="col">선택스킨</th><th scope="col">순서</th><th scope="col">숨기기</th> <th scope="col">등록일</th><th scope="col">샘플</th><th scope="col">모듈수정</th> </tr> </thead> <tbody class='change_check_class'> <?php for($i=0;$i<count($list_array);$i++){ $info = $list_array[$i]; $v = explode(".",$info['sk_filename']); $sk_file_dir = $v[0]; ?> <tr> <td class="tcenter "> <input type='checkbox' name='code_idx[]' value='<?php echo $i;?>' class='code_idx_calss'> <input type='hidden' name='codes[]' value='<?php echo $info['idx'];?>'> <input type='hidden' name='sk_file_dir[]' value='<?php echo $sk_file_dir;?>'> <input type='hidden' name='sk_idx[]' value='<?php echo $info['sk_idx'];?>'> </td> <td class="linetxt padd_5px"><?php echo $spa[$info['sk_pos']]." ({$info['sk_pos']})"?></td> <td class="linetxt "> <?php echo $sta[$info['sk_pos']][$info['sk_type']]." ({$info['sk_type']})";?> </td> <td class="linetxt "> <?php echo $info['sk_name'];?> </td> <td class="tcenter "> <input type='text' name='sk_seq[]' class='width_60 number_class' value='<?php echo $info['sk_seq']?>'> </td> <td class="tcenter "> <input type='checkbox' name='sk_use[<?php echo $i;?>]' value='0' <?php if($info['sk_use']=='0'){ echo "checked"; }?>> </td> <td class="tcenter "> <?php echo $info['reg_date'];?> </td> <td class="tcenter "><a class='sk_sample_class'>[보기]</a></td> <td class="tcenter "><a class='click_edit'>[수정]</a></td> </tr> <?php } ?> </tbody> </table> </div> <span class='help_info'>샘플보기할때 장바구니나 주문하기등의 로그인이나 권한이 필요한 모듈은 같은 탭내에서 회원로그인을 따로 하시면 확인하실수 있습니다.</span> </div> </form>
<div class='pg_wrap' style='padding-top:0px;'> <?php echo get_paging($list_num, $page, $total_page, "?$qstr");?> </div>
</div><!--//wrap-->
<script> var qstr = '<?php echo $qstr;?>'; $(function(){ $(".item_tab_navi a").click(function(){ //네비게이션 탭 처리 v = $(this).attr("value"); document.location.href="?modepos=<?php echo $modepos;?>&sk_pos="+v; });
$(".check_all_class").click(function(){ // 전체선택 전체선택 해제 if($(this).is(":checked")){ $("input[name='code_idx[]']").prop("checked",true); } else { $("input[name='code_idx[]']").prop("checked",false); } });
$(".sub-btn #btn_order_new").click(function(){ // 신규 버튼 setsave("qstr",qstr,1); skin_add(''); });
$(document).on("change",".change_check_class input, .change_check_class select",function(){ // input이나 select값이 변경되면 해당 라인을 체크해줌 $tr_obj = $(this).closest("tr"); $tr_obj.find(".code_idx_calss").prop("checked",true); });
$("#sel_edit").click(function(){ // 선택수정 var ck_cnt = 0; var v = $("input[name='code_idx[]']").each(function(){ if($(this).is(":checked")){ ck_cnt++; } }); if(ck_cnt==0){ alert('수정하실 스킨을 선택하세요.'); return; } if(confirm('정말로 선택하신 '+ck_cnt+'개의 스킨을 수정하시겠습니까?')){ $("input[name='sel_del']").val("EDIT"); var form_data = $("form[name='skin_list_form']").serialize();
$.ajax({type:"post", url:"ajax.skin_reg_process.php", data:form_data, async:false, dataType : "xml", success:function(xml){ var v_mode = $(xml).find("mode").text(); var v_mode_ok = $(xml).find("mode_ok").text(); var v_msg = $(xml).find("msg").text(); if(v_mode_ok!='Y'){ alert(v_msg); } else { //$(".code_idx_calss").prop("checked",false); document.location.href='?<?php echo $qstr."&time=".time();?>'; } }, error:function(rtn,status,error){ alert(error); } }); } });
$("#sel_delete").click(function(){ // 선택삭제 var ck_cnt = 0; var v = $("input[name='code_idx[]']").each(function(){ if($(this).is(":checked")){ ck_cnt++; } }); if(ck_cnt==0){ alert('삭제하실 스킨모듈을 선택하세요.'); return; }
if(confirm('정말로 '+ck_cnt+'개의 스킨모듈을 삭제하시겠습니까?')){ $("input[name='sel_del']").val("Y"); var form_data = $("form[name='skin_list_form']").serialize();
$.ajax({type:"post", url:"ajax.skin_reg_process.php?", data:form_data, async:false, dataType : "xml", success:function(xml){ var v_mode = $(xml).find("mode").text(); var v_mode_ok = $(xml).find("mode_ok").text(); var v_msg = $(xml).find("msg").text(); var v_skin_cnt = $(xml).find("skin_cnt").text(); if(v_mode_ok=='Y'){ document.location.reload(); } else { alert(v_msg); } }, error:function(rtn,status,error){ alert(error); } }); } });
$(".sk_sample_class").css("cursor","pointer").click(function(){ // 샘플 파일 보기 $v = $(this).closest("tr").find("input[name='sk_idx[]']").val(); if('<?php echo $is_mobile?>'=='1'){ window.open("<?php echo "{$j3_shopm_url}/sample_view.php?pos={$sk_pos}&is_mobile={$is_mobile}&sample_idx=";?>"+$v,"sample_win","width=380, height=800, scrollbars=yes"); } else { window.open("<?php echo "{$j3_shop_url}/sample_view.php?pos={$sk_pos}&is_mobile={$is_mobile}&sample_idx=";?>"+$v,"sample_win","width=1250, height=800, scrollbars=yes"); } /*$tr_obj = $(this).closest("tr"); $sk_dir = $tr_obj.find("input[name='sk_file_dir[]']").val(); $img = "<img src='<?php echo $j3_img_url.$laststr_dir;?>/"+$sk_dir+"/sample' onerror=\"this.src='http://via.placeholder.com/420x220&text=please_add_sample';\">"; // 이미지가 없을경우 대체 이미지 표시 $("#modal_member_box").html($img).dialog({ resizable: true, height:600, width:1200, modal: true, title:"샘플보기", buttons: { 닫기: function() { $( this ).dialog( "close" ); } } });*/ });
$(".click_edit").css("cursor","pointer").click(function(){ // 수정 var sk_idx = $(this).closest("tr").find("input[name='sk_idx[]']").val(); window.open("skinm.php?idx="+sk_idx,"skinm","width=1200,height=900,scrolbars=yes"); });
$("#xls_down").click(function(){ // 엑셀다운로드 alert('준비중입니다.'); return; document.product_search_form.action='product_xls_down.php'; document.product_search_form.target = '_blank'; document.product_search_form.submit(); document.product_search_form.action='?'; document.product_search_form.target = ''; });
$("#search_btn_press").click(function(){ // 검색버튼 누를때 document.product_search_form.action='?'; document.product_search_form.target = ''; document.product_search_form.submit(); });
});
function skin_add(code){ $.get("skin_reg.inc.php?modepos=<?php echo $modepos;?>&pos=<?php echo $pos;?>&sk_pos=<?php echo $sk_pos;?>&code="+code,function(rtn){ if(code==''){ title = "신규"; } else { title = "수정"; } $("#modal_member_box").html(rtn).dialog({ resizable: true, height:600, width:1050, modal: true, title:"스킨모듈 ["+title+"]", buttons: { 저장: function() { form_save(); }, 닫기: function() { $( this ).dialog( "close" ); } } }); }); }
function form_save(){ var form_obj = $("form[name='skin_reg_form']"); $(form_obj).find("input[name='qstr']").val('<?php echo $qstr;?>'); if(confirm('저장하시겠습니까?')){ var form_data = $(form_obj).serialize();
$.ajax({type:"post", url:"ajax.skin_reg_process.php", data:form_data, async:false, dataType : "xml", success:function(xml){ var v_mode = $(xml).find("mode").text(); var v_mode_ok = $(xml).find("mode_ok").text(); var v_msg = $(xml).find("msg").text(); var v_after_add = $(xml).find("after_add").text(); if(v_mode_ok!='Y'){ alert(v_msg); } else { document.location.reload(); } }, error:function(rtn,status,error){ alert(error); } }); } } </script> <script src="http://dmaps.daum.net/map_js_init/postcode.v2.js"></script> <?php //_pr($_COOKIE['qstr']); include($j3_adm_path."/shop_footer.php"); ?> <div id="modal_member_box" title="거래처수정" style="display:none;width:100%; height:100%; padding-top:3px;padding-left:3px;background-color:#FFFFFF;position:relative;"></div>
|