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
|
<?php $sub_menu = '300820'; include_once('./_common.php');
auth_check($auth[$sub_menu], "r");
if($_GET['page_row']!=''){ $_SESSION['page_row_cnt'] = $_GET['page_row']; }
$g5['title'] = '오픈마켓 Q&A가져오기'; include_once (G5_ADMIN_PATH.'/admin.head.php'); $pg_anchor = '<ul class="anchor"> <li><a href="#anc_pricecompare_info">오픈마켓 연동 안내</a></li> <li><a href="#anc_pricecompare_auction">옥션/지마켓 상품 가져오기</a></li> <li><a href="#anc_pricecompare_11st">11번가 상품 가져오기</a></li> </ul>';
$otms_qna_table = "otms_qna";
$sql = "select count(*) as cnt from {$otms_qna_table} where 1=1 "; $res = mysql_query($sql); $info = mysql_fetch_array($res); $cnt_au = $info['cnt'];
$sql_search = " where 1 "; if ($search != "") { if ($sel_field != "") { $sql_search .= " and $sel_field like '%$search%' "; } }
if ($sel_ca_id != "") { $sql_search .= " and ca_id like '$sel_ca_id%' "; }
if ($sel_field == "") $sel_field = "it_name"; if ($sort1 == "") $sort1 = "InsDate"; if ($sort2 == "") $sort2 = "desc";
$sql_common = " from {$otms_qna_table} "; $sql_common .= $sql_search;
// 테이블의 전체 레코드수만 얻음 $sql = " select count(*) as cnt " . $sql_common; $row = sql_fetch($sql); $total_count = $row['cnt'];
if($_SESSION['page_row_cnt']==''){ $rows = 15; } else { $rows = $_SESSION['page_row_cnt']; } //$rows = 2; $total_page = ceil($total_count / $rows); // 전체 페이지 계산 if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지) $from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select * $sql_common order by $sort1 $sort2 limit $from_record, $rows "; $result = sql_query($sql);
$qstr1 = 'sel_ca_id='.$sel_ca_id.'&sel_field='.$sel_field.'&search='.$search; $qstr = $qstr1.'&sort1='.$sort1.'&sort2='.$sort2.'&page='.$page;
?> <script type="text/javascript" src="https://www.11st.co.kr/js/common/rsa.js?noCache=<?php echo $microtime;?>"></script> <script type="text/javascript" src="https://login.soffice.11st.co.kr/jsp/ktb/ktb.agent.jsp"></script> <script>
function ck_save(){
var xx = rsa.encrypt("<?php echo trim($default['de_otms_id_11st'])?>"); var yy = rsa.encrypt("<?php echo trim($default['de_otms_pw_11st'])?>"); $("input[name=id_11]").val(xx); $("input[name=pw_11]").val(yy); $("input[name=priority]").val(priority); $("input[name=ktb_agent]").val(ktb.getScanResult()); //alert(ktb.getScanResult()); //return false;
var ck_flag = 0; $(".ck_id_list").each(function(key,val){ if(val.checked==true){ ck_flag++; } }); if(ck_flag==0){ alert('등록할 Q&A를 선택을 하시기 바랍니다.'); return false; } if($("#reply_cont").val()==''){ alert('답변을 입력 하시기 바랍니다.'); return false; } if(confirm('등록하시겠습니까?')){ return true; } return false; } $(function(){ $("#ck_all").click(function(){ var ck_flag = $(this).is(":checked"); $(".ck_id_list").each(function(key,val){ if(ck_flag){ val.checked = true; } else { val.checked = false; } }); });
$("#sch_target").click(function() { var cp_method = $("#cp_method").val(); var opt = "left=50,top=50,width=520,height=600,scrollbars=1"; var url = "./otmstarget.php?sch_target=";
window.open(url+"1", "win_target", opt); }); });
function ch_page_row(v){ location.href='?page_row='+v.value; } </script> <section id="anc_pricecompare_info"> <h2>오픈마켓 Q&A 리스트</h2> <?php //echo $pg_anchor; ?>
<div class="local_desc01 local_desc"> <ol> <li>오픈마켓에서 가져오기한 Q&A들이 표시가 됩니다.</li> <li>가져온 Q&A들을 선택해서 등록/업데이트가 가능합니다.</li> <li>이미 등록한 Q&A의 경우 업데이트 처리가 되기 때문에 쇼핑몰에서 수정한 부분은 오픈마켓 기준으로 초기화 됩니다.</li> </ol> </div> </section>
<section style='padding-left:40px;padding-bottom:5px; '> 페이지당 상품수 : <select name='page_row' onchange="ch_page_row(this)"> <option value='15' <?php if($page_row==15){?>selected<?php }?>>15 <option value='50' <?php if($page_row==50){?>selected<?php }?>>50 <option value='100' <?php if($page_row==100){?>selected<?php }?>>100 <option value='200' <?php if($page_row==100){?>selected<?php }?>>200 </select> </section>
<form name="flist" class="local_sch01 local_sch" method='post' action='otms_qna_process.php' onsubmit='return ck_save();'> <input type="hidden" name="doc" value="<?php echo $doc; ?>"> <input type="hidden" name="sort1" value="<?php echo $sort1; ?>"> <input type="hidden" name="sort2" value="<?php echo $sort2; ?>"> <input type="hidden" name="page" value="<?php echo $page; ?>"> <input type="hidden" name="id_11" value=""> <input type="hidden" name="pw_11" value=""> <input type="hidden" name="priority" value=""> <input type="hidden" name="ktb_agent" value="">
<div class="tbl_head01 tbl_wrap"> <table> <caption><?php echo $g5['title']; ?> 목록</caption> <thead> <tr> <th scope="col"><input type='checkbox' name='ck_all' id='ck_all'>선택</th> <th scope="col">사이트구분</th> <th scope="col">셀러ID</th> <th scope="col">상품코드</th> <th scope="col">질문분류</th> <th scope="col">제목</th> <th scope="col">내용</th> <th scope="col">회원ID</th> <th scope="col">회원명</th> <th scope="col">등록일자</th> <th scope="col">수정일자</th> <th scope="col">답변</th> <th scope="col">답변여부</th> </tr> </thead> <tbody> <?php for ($i=0; $row=mysql_fetch_array($result); $i++) { $href = G5_SHOP_URL."/item.php?it_id={$row['it_id']}";
$bg = 'bg'.($i%2);
/*$sql = "select count(*) as cnt from {$g5['g5_shop_item_table']} where it_5 = '{$row['SiteGoodsNo']}' "; $res = sql_query($sql); $info = mysql_fetch_array($res); $it_cnt = $info['cnt'];*/
?> <tr class="<?php echo $bg; ?>"> <td class="td_numbig"> <input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['idx']; ?>"> <input type='checkbox' name='ck_id[]' class='ck_id_list' value='<?php echo $i; ?>'> </td> <td class="td_numbig"><?php if($row['SiteId']=='au'){ echo "옥션 ({$row['SiteId']})"; } else if($row['SiteId']=='gm'){ echo "지마켓 ({$row['SiteId']})"; } else if($row['SiteId']=='11'){ echo "11번가 ({$row['SiteId']})"; } ?> </td> <td class="td_img"><?php echo $row['SellerId']; ?></td> <td class="td_img"><?php echo $row['ItemNo']; ?></td> <td class="td_img"><?php echo $row['QueryType']; ?></td> <td class="td_img"><?php echo $row['Title']; ?></td> <td class="td_img"><?php echo $row['Content']; ?></td> <td class="td_img"><?php echo $row['BuyerIdTemp']; ?></td> <td class="td_img"><?php echo $row['BuyerName']; ?></td> <td class="td_img"><?php echo $row['InsDate']; ?></td> <td class="td_img"><?php echo $row['UpdDate']; ?></td> <td class="td_img"><?php echo $row['ReplyContent']; ?></td> <td class="td_img"><?php if($row['ReplyContent']!=''){ echo "등록됨"; } else { echo "<b>등록안됨</b>"; }?></td> </tr> <?php } if (!$i) echo '<tr><td colspan="11" class="empty_table"><span>자료가 없습니다.</span></td></tr>'; ?> </tbody> </table> </div>
<div class="btn_confirm01 btn_confirm"> <input type="hidden" name="cp_target" value="" id="cp_target" class="frm_input"> <!--<input type="text" name="cp_target_name" value="" id="cp_target_name" readonly class="frm_input">--> <textarea name='reply_cont' id='reply_cont' style='width:300px; height:100px;'></textarea> <!--<button type="button" id="sch_target" class="btn_frmline">분류선택</button>--> <input type="submit" value="답변등록" class="btn_submit" style='width:70px;height:30px;padding:10px;'> <br><br>옥션/지마켓은 기존의 답변이 있으면 답변이 추가가 되며, 11번가는 답변이 수정이 됩니다. </div>
</form>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&page="); ?>
<?php include_once (G5_ADMIN_PATH.'/admin.tail.php'); ?>
|