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
|
<?php $dir = "."; include_once($dir."/_common.php"); include('./include/header.php');
if($eid==''){ alert('e천년경영 로그인 후에 이용가능합니다.',"index.php"); exit; }
if($cs_dbip==''){ if($ss_cs_dbip!=''){ $cs_dbip = $ss_cs_dbip; } else { $cs_dbip = "119.201.210.73"; } } if($ocode==''){ $ocode = '1'; } if($type==''){ $type = 'item'; } if($shop_id==''){ if($ss_shop_id!=''){ $shop_id = $ss_shop_id; } }
$_SESSION['ss_cs_dbip'] = $cs_dbip; $_SESSION['ss_shop_id'] = $shop_id;
$g5['jego_cs_db'] = "jegocs_{$shop_id}";
$sql = "select * from {$g5['jego_cs_db']}.options"; $res = mysql_query($sql, $connect_sp); while($info=mysql_fetch_object($res)){ $options[$info->optname] = $info->optvalue; } //_pr($options);
if($type=='item'){ if($s_type=='it_id'){ if($ocode=='0'){ $ocode_where = " "; } else { $ocode_where = " and b.ocode = {$ocode} "; } $sql = "select * from g5_shop_item a left join {$g5['jego_cs_db']}.shop_item_mapping b on a.it_id = b.it_id and b.io_id = '{$io_id}' {$ocode_where} left join {$g5['jego_cs_db']}.product_m c on b.code = c.code left join {$g5['jego_cs_db']}.product_d d on c.code = d.pcode and d.ocode = b.ocode left join {$g5['jego_cs_db']}.invn_real e on c.code = e.pcode and e.ocode = b.ocode where a.it_id = '{$st_val}' limit 500 "; } else if($s_type=='it_name'){ if($ocode=='0'){ $ocode_where = " "; } else { $ocode_where = " and b.ocode = {$ocode} "; } $sql = "select * from g5_shop_item a left join {$g5['jego_cs_db']}.shop_item_mapping b on a.it_id = b.it_id and b.io_id = '{$io_id}' {$ocode_where} left join {$g5['jego_cs_db']}.product_m c on b.code = c.code left join {$g5['jego_cs_db']}.product_d d on c.code = d.pcode and d.ocode = b.ocode left join {$g5['jego_cs_db']}.invn_real e on c.code = e.pcode and e.ocode = b.ocode where concat(a.it_name,' ',c.name) like '%{$st_val}%' limit 500 "; } //_pr($sql); exit; } else if($type=='member'){ if($s_type=='mb_id'){ $sql = "select * from g5_member a left join {$g5['jego_cs_db']}.shop_member_mapping b on a.mb_no = b.shop_code left join {$g5['jego_cs_db']}.customer c on b.jego_code = c.code where a.mb_id = '{$st_val}' "; } else if($s_type=='mb_4'){ $sql = "select * from g5_member a left join {$g5['jego_cs_db']}.shop_member_mapping b on a.mb_no = b.shop_code left join {$g5['jego_cs_db']}.customer c on b.jego_code = c.code where concat(a.mb_4,' ',c.compname) like '%{$st_val}%' "; } } else if($type=='order'){ if($s_type=='od_id'){ $sql = "select * from g5_shop_order a inner join g5_shop_cart aa on a.od_id = aa.od_id left join {$g5['jego_cs_db']}.shop_order_mapping b on a.od_id = b.od_id and aa.ct_id = b.ct_id left join {$g5['jego_cs_db']}.sale c on b.ordno = c.code where a.od_id = '{$st_val}'; "; } else if($s_type=='it_name'){ $sql = "select * from g5_shop_order a inner join g5_shop_cart aa on a.od_id = aa.od_id left join {$g5['jego_cs_db']}.shop_order_mapping b on a.od_id = b.od_id and aa.ct_id = b.ct_id left join {$g5['jego_cs_db']}.sale c on b.ordno = c.code where aa.it_name like '%{$st_val}%' "; } } else if($type=='price'){ if($ocode=='0'){ $ocode_where = " "; } else { $ocode_where = " and b.ocode = {$ocode} "; }
$sql = "select '특별단가' as danga_name, a.*, b.*, c.* from {$g5['jego_cs_db']}.special_price a inner join (select b.jego_code, c.ocode, c.multypriceno from g5_member a left join {$g5['jego_cs_db']}.shop_member_mapping b on a.mb_no = b.shop_code left join {$g5['jego_cs_db']}.customer c on b.shop_code = c.code where a.mb_id = '{$mb_id}') b on a.ccode = b.jego_code inner join (select c.code, d.ocode, b.io_id from g5_shop_item a left join {$g5['jego_cs_db']}.shop_item_mapping b on a.it_id = b.it_id and b.io_id like '{$io_id}%' {$ocode_where} left join {$g5['jego_cs_db']}.product_m c on b.code = c.code left join {$g5['jego_cs_db']}.product_d d on c.code = d.pcode where a.it_id = '{$it_id}') c on a.pcode = c.code and b.ocode = c.ocode where 1=1;";
//_pr($sql); exit;
$res = mysql_query($sql, $connect_sp); while($info=mysql_fetch_object($res)){ $info_array[] = $info; }
$sql = "select '다중단가' as danga_name, a.*, b.*, c.* from {$g5['jego_cs_db']}.multy_price a inner join (select b.jego_code, c.ocode, c.multypriceno from g5_member a left join {$g5['jego_cs_db']}.shop_member_mapping b on a.mb_no = b.shop_code left join {$g5['jego_cs_db']}.customer c on b.jego_code = c.code where a.mb_id = '{$mb_id}') b on a.pseq = b.multypriceno inner join (select c.code, d.ocode, d.saleprice, d.buyprice, b.io_id from g5_shop_item a left join {$g5['jego_cs_db']}.shop_item_mapping b on a.it_id = b.it_id and b.io_id like '{$io_id}%' {$ocode_where} left join {$g5['jego_cs_db']}.product_m c on b.code = c.code left join {$g5['jego_cs_db']}.product_d d on c.code = d.pcode where a.it_id = '{$it_id}') c on b.ocode = c.ocode and a.pcode = c.code where 1=1 order by io_id"; $res = mysql_query($sql, $connect_sp); while($info=mysql_fetch_object($res)){ if($options['다중단가계산기준']=='1'){ $mprice = $info->saleprice; } else { $mprice = $info->buyprice; }
if($info->pricetype=='0'){ // 금액 그대로 일경우 $v = $info->price; //return $minfo['price']; } else if($info->pricetype=='1'){ // 다중단가를 +- 한다. $v = $mprice+$info->price; //return $v; } else { // 그외엔 다중단가를 %로 계산한다. $v = round($mprice*$info->price/100); //return $v; }
$info->dajung_price = $v; $info_array[] = $info; } }
//_pr($sql); if($type!='price'){ $res = mysql_query($sql, $connect_sp); while($info=mysql_fetch_object($res)){ $info_array[] = $info; } }
//_pr($info_array);
?>
<style> .th_class, .td_class {padding-left:3px !important; padding-right:3px !important;min-width:130px;} .td_class {word-break:break-all; line-height:20px !important; } .wrap_class {overflow:auto;max-width:1200px; max-height:600px; } .sql_view { display:none; } .line_bg { background:#f0f0f0; } .line_yellow_bg { background:#33ffff !important; } </style>
<!--<div id="contents" style="background:#999"><img src="http://placehold.it/960x150" alt="롤링배너"></div>--> <div id="contents" style="height:2px;border-bottom:1px solid #eee;background:#2f6ba9"> <span class="screen_out">header 하단 선</span> </div>
<div id="wrap" class='container_wrap'> <div id="sub-title"> <h2>쇼핑몰 동기화 확인</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='type' size='' value='<?php echo $type;?>'> <div id="sub-contents-area"> <div class="sub-btn-area"> <div class="sub-btn"> dbip : <!--<select name='cs_dbip' style='width:180px;'> <option value='119.201.210.73' <?php if($cs_dbip=='119.201.210.73'){ echo "selected"; }?>>쇼핑몰(119.201.210.73)</option> <option value='59.23.231.212' <?php if($cs_dbip=='59.23.231.212'){ echo "selected"; }?>>59.23.231.212</option> <option value='59.23.231.219' <?php if($cs_dbip=='59.23.231.219'){ echo "selected"; }?>>59.23.231.219</option> </select>--> <input type='text' id='cs_dbip' name='cs_dbip' size='' value='<?php echo $$cs_dbip;?>' class="stx_class"> 쇼핑몰id : <input type='text' id='shop_id' name='shop_id' size='' value='<?php echo $shop_id;?>' class="stx_class"> </div> </div> <div class="sub-btn-area"> <div class="sub-btn sub-btn-search"> <?php if($type=='item'){ ?> 사업장코드(0입력시전체사업장) : <input type="text" name="ocode" value="<?php echo $ocode; ?>" id="ocode" class="frm_input" size=2> <select name='s_type'> <option value='it_id' <?php if($s_type=='it_id'){ echo "selected"; }?>>상품코드</option> <option value='it_name' <?php if($s_type=='it_name'){ echo "selected"; }?>>상품명</option> </select> <input type="text" name="st_val" value="<?php echo $st_val; ?>" id="st_val" class="frm_input"> 옵션id : <input type="text" name="io_id" value="<?php echo $io_id; ?>" id="io_id" class="frm_input" size=15> <?php } else if($type=='member'){?> <!--사업장코드 : <input type="text" name="ocode" value="<?php echo $ocode; ?>" id="ocode" class="frm_input" size=2> --> <select name='s_type'> <option value='mb_id' <?php if($s_type=='it_id'){ echo "selected"; }?>>회원아이디</option> <option value='mb_4' <?php if($s_type=='mb_4'){ echo "selected"; }?>>거래처명</option> </select> <input type="text" name="st_val" value="<?php echo $st_val; ?>" id="st_val" class="frm_input"> <?php } else if($type=='order'){?> <!--사업장코드 : <input type="text" name="ocode" value="<?php echo $ocode; ?>" id="ocode" class="frm_input" size=2> --> <select name='s_type'> <option value='od_id' <?php if($s_type=='od_id'){ echo "selected"; }?>>주문번호</option> <option value='it_name' <?php if($s_type=='it_name'){ echo "selected"; }?>>상품명</option> </select> <input type="text" name="st_val" value="<?php echo $st_val; ?>" id="st_val" class="frm_input"> <?php } else if($type=='price'){?> 사업장코드(0입력시전체사업장) : <input type="text" name="ocode" value="<?php echo $ocode; ?>" id="ocode" class="frm_input" size=2> 회원아이디 : <input type="text" name="mb_id" value="<?php echo $mb_id; ?>" id="mb_id" class="frm_input" size=12> 상품코드 : <input type="text" name="it_id" value="<?php echo $it_id; ?>" id="it_id" class="frm_input" size=15> 옵션id : <input type="text" name="io_id" value="<?php echo $io_id; ?>" id="io_id" class="frm_input" size=15> <!--<input type="text" name="st_val" value="<?php echo $st_val; ?>" id="st_val" class="frm_input">--> <?php } ?> <a href="#" class="black-btn" id='search_btn_press'>검색</a> </div> </div> </div> </form> <div class="item_tab"> <div class="item_tab_navi"> <a value='0' <?php if($type=='item'){ echo "class='on'"; }?>><span>상품 확인</span></a> <a value='1' <?php if($type=='member'){ echo "class='on'"; }?>><span>회원 확인</span></a> <a value='2' <?php if($type=='order'){ echo "class='on'"; }?>><span>주문 확인</span></a> <a value='3' <?php if($type=='price'){ echo "class='on'"; }?>><span>회원별 상품단가</span></a> </div> </div>
<form name='product_list_form' method='post'> <input type='hidden' name='sel_del' value=''> <div class="div-list-area"> <div class="cust-list-area wrap_class"> <table class="order-sheet2"> <?php if($type=='price'){ $max_cnt = 0; foreach($info_array as $kk=>$info){ $cnt = 0; echo "<thead>"; foreach($info as $key=>$val){ echo "<th scope='col' class='th_class'>{$key}</th>"; $cnt++; } echo "</thead>"; if($cnt>$max_cnt){ $max_cnt = $cnt; } echo "<tbody>"; foreach($info as $key=>$val){ echo "<td class='td_class'>{$val}</td>"; } echo "</tbody>"; } ?> <style> .order-sheet2 {width:<?php echo 130*$max_cnt?>px !important;} </style> <?php } else { echo "<thead>"; $cnt = 0; foreach($info_array[0] as $key=>$val){ echo "<th scope='col' class='th_class'>{$key}</th>"; $cnt++; } ?> </thead> <style> .order-sheet2 {width:<?php echo 130*$cnt?>px !important;} </style> <tbody> <?php $cnt = 0; foreach($info_array as $key=>$row) { if($cnt%2==0){ $bg = "line_bg"; } else { $bg = ""; } ?> <tr class='<?php echo $bg;?> tr_line_class'> <?php foreach($row as $k=>$v) { $v = strip_tags($v); if($k=='it_info_value'){ $v = ""; } echo "<td class='td_class'>{$v}</td>"; } ?> </tr> <?php $cnt++; } } ?> </tbody> </table> </div> </div> </form>
<div class='pg_wrap' style='padding-top:0px;'> <?php echo get_paging($list_num, $page, $total_page, "?$qstr");?> </div>
<span class='sql_check_class'>[SQL보기]</span> <div class='sql_view'><?php echo $sql;?></div>
</div><!--//wrap-->
<script> var qstr = '<?php echo $qstr;?>'; $(function(){ $(".item_tab_navi a").click(function(){ //네비게이션 탭 처리 v = $(this).attr("value"); if(v==0){ document.location.href="./shop_sync_check.php?type=item"; } else if(v==1){ document.location.href="./shop_sync_check.php?type=member"; } else if(v==2){ document.location.href="./shop_sync_check.php?type=order"; } else if(v==3){ document.location.href="./shop_sync_check.php?type=price"; } });
$(".sql_check_class").css("cursor","pointer").click(function(){ $(".sql_view").toggle(); });
$("#st_val").keypress(function(){ if(event.keyCode==13){ $("#search_btn_press").click(); } });
$("#search_btn_press").click(function(){ $("form[name='product_search_form']").submit(); });
$(".tr_line_class").click(function(){ if($(this).hasClass('line_yellow_bg')){ $(this).removeClass('line_yellow_bg'); } else { $(this).addClass('line_yellow_bg'); } }); });
</script> <?php include('./include/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>
|