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
|
<?php $sub_menu = '270250'; include_once('./_common.php');
auth_check($auth[$sub_menu], "w");
$g5['title'] = '개인결제 관리';
if ($w == 'u') { $html_title = '개인결제 수정';
$sql = " select * from {$g5['g5_shop_personalpay_table']} where pp_id = '$pp_id' "; $pp = sql_fetch($sql); if (!$pp['pp_id']) alert('등록된 자료가 없습니다.'); } else { $html_title = '개인결제 입력'; $pp['pp_use'] = 1; }
$wrp_tag_st = ''; $wrp_tag_end = ''; if($popup == 'yes') { // 팝업창일 때 include_once(G5_PATH.'/head.sub.php'); $pp['od_id'] = $od_id; $sql = " select od_id, od_name, od_misu from {$g5['g5_shop_order_table']} where od_id = '$od_id' "; $od = sql_fetch($sql);
if(!$od['od_id']) alert_close('주문정보가 존재하지 않습니다.');
$pp['pp_name'] = $od['od_name'];
if($od['od_misu'] > 0) $pp['pp_price'] = $od['od_misu']; $wrp_tag_st = '<div class="new_win">'.PHP_EOL.'<h1 id="new_win_title">'.$html_title.'</h1>'; $wrp_tag_end = '</div>'; } else { // 현재페이지일 때 include_once (G5_ADMIN_PATH.'/admin.head.php'); } $pg_anchor = '<ul class="anchor"> <li><a href="#anc_spp_info">주문 정보</a></li> <li><a href="#anc_spp_pay">결제 정보</a></li> </ul>';
// pg 설정 필드 추가 if(!sql_query(" select pp_pg from {$g5['g5_shop_personalpay_table']} limit 1 ", false)) { sql_query(" ALTER TABLE `{$g5['g5_shop_personalpay_table']}` ADD `pp_pg` varchar(255) NOT NULL DEFAULT '' AFTER `pp_price` ", true);
// 개인결제 PG kcp로 설정 sql_query(" update {$g5['g5_shop_personalpay_table']} set pp_pg = 'kcp' "); }
// 현금영수증 필드 추가 if(!sql_query(" select pp_cash from {$g5['g5_shop_personalpay_table']} limit 1 ", false)) { sql_query(" ALTER TABLE `{$g5['g5_shop_personalpay_table']}` ADD `pp_cash` tinyint(4) NOT NULL DEFAULT '0' AFTER `pp_shop_memo`, ADD `pp_cash_no` varchar(255) NOT NULL DEFAULT '' AFTER `pp_cash`, ADD `pp_cash_info` text NOT NULL AFTER `pp_cash_no`, ADD `pp_email` varchar(255) NOT NULL DEFAULT '' AFTER `pp_name`, ADD `pp_hp` varchar(255) NOT NULL DEFAULT '' AFTER `pp_email`, ADD `pp_casseqno` varchar(255) NOT NULL DEFAULT '' AFTER `pp_app_no` ", true); } ?>
<form name="fpersonalpayform" action="./personalpayformupdate.php" method="post" onsubmit="return form_check(this);"> <input type="hidden" name="w" value="<?php echo $w; ?>"> <input type="hidden" name="pp_id" value="<?php echo $pp_id; ?>"> <input type="hidden" name="sst" value="<?php echo $sst; ?>"> <input type="hidden" name="sod" value="<?php echo $sod; ?>"> <input type="hidden" name="sfl" value="<?php echo $sfl; ?>"> <input type="hidden" name="stx" value="<?php echo $stx; ?>"> <input type="hidden" name="page" value="<?php echo $page; ?>"> <input type="hidden" name="popup" value="<?php echo $popup; ?>"> <?php if($popup == 'yes') { ?> <input type="hidden" name="pp_use" value="1"> <?php } ?>
<?php echo $wrp_tag_st; ?>
<section id="anc_spp_info"> <h2 class="h2_frm">주문 정보</h2> <?php if($popup != 'yes') echo $pg_anchor; ?> <div class="local_desc02 local_desc"> <p>주문 관련 기본 정보입니다.</p> </div>
<div class="tbl_frm01 tbl_wrap"> <table> <caption>주문 정보 목록</caption> <colgroup> <col class="grid_4"> <col> </colgroup> <tbody> <tr> <th scope="row"><label for="pp_name">이름</label></th> <td><input type="text" name="pp_name" value="<?php echo $pp['pp_name']; ?>" id="pp_name" required class="required frm_input"></td> </tr> <tr> <th scope="row"><label for="pp_price">주문금액</label></th> <td><input type="text" name="pp_price" value="<?php echo $pp['pp_price']; ?>" id="pp_price" required class="required frm_input" size="15"> 원</td> </tr> <tr> <th scope="row"><label for="od_id">주문번호</label></th> <td><input type="text" name="od_id" value="<?php echo $pp['od_id'] ? $pp['od_id'] : ''; ?>" id="od_id" class="frm_input" size="20"></td> </tr> <tr> <th scope="row"><label for="pp_content">내용</label></th> <td><textarea name="pp_content" id="pp_content" rows="8"><?php echo $pp['pp_content']; ?></textarea></td> </tr> </tbody> </table> </div> </section>
<div class="btn_confirm01 btn_confirm"> <input type="submit" value="확인" class="btn_submit" accesskey="s"> <?php if($popup == 'yes') { ?> <button type="button" onclick="self.close();">닫기</button> <?php } else { ?> <a href="./personalpaylist.php?<?php echo $qstr; ?>">목록</a> <?php } ?> <?php if($w == 'u') { ?> <a href="./personalpayformupdate.php?w=d&pp_id=<?php echo $pp['pp_id']; ?>" onclick="return del_confirm();">삭제</a> <?php } ?> </div>
<?php if($popup != 'yes') { ?> <section id="anc_spp_pay" class="cbox"> <h2>결제 정보</h2> <?php echo $pg_anchor; ?> <div class="local_desc02 local_desc"> <p>결제 관련 정보입니다.</p> </div>
<div class="tbl_frm01 tbl_wrap"> <table> <caption>결제 정보 목록</caption> <colgroup> <col class="grid_4"> <col> </colgroup> <tbody> <?php if($popup != 'yes') { ?> <tr> <th scope="row"><label for="pp_receipt_price">결제금액</label></th> <td><input type="text" name="pp_receipt_price" value="<?php echo $pp['pp_receipt_price'] ? $pp['pp_receipt_price'] : ''; ?>" id="pp_receipt_price" class="frm_input" size="15"> 원</td> </tr> <tr> <th scope="row"><label for="pp_settle_case">결제방법</label></th> <td> <select name="pp_settle_case" id="pp_settle_case"> <option value="" <?php echo get_selected($pp['pp_settle_case'], ''); ?>>선택</option> <option value="무통장" <?php echo get_selected($pp['pp_settle_case'], '무통장'); ?>>무통장</option> <option value="계좌이체" <?php echo get_selected($pp['pp_settle_case'], '계좌이체'); ?>>계좌이체</option> <option value="가상계좌" <?php echo get_selected($pp['pp_settle_case'], '가상계좌'); ?>>가상계좌</option> <option value="신용카드" <?php echo get_selected($pp['pp_settle_case'], '신용카드'); ?>>신용카드</option> <option value="휴대폰" <?php echo get_selected($pp['pp_settle_case'], '휴대폰'); ?>>휴대폰</option> </select> </td> </tr> <tr> <th scope="row"><label for="pp_receipt_time">결제일시</label></th> <td> <input type="checkbox" name="pp_receipt_chk" id="pp_receipt_chk" value="<?php echo date("Y-m-d H:i:s", G5_SERVER_TIME); ?>" onclick="if (this.checked == true) this.form.pp_receipt_time.value=this.form.pp_receipt_chk.value; else this.form.pp_receipt_time.value = this.form.pp_receipt_time.defaultValue;"> <label for="pp_receipt_chk">현재 시간으로 설정</label><br> <input type="text" name="pp_receipt_time" value="<?php echo is_null_time($pp['pp_receipt_time']) ? "" : $pp['pp_receipt_time']; ?>" id="pp_receipt_time" class="frm_input" maxlength="19"> </td> </tr> <?php $is_cash_receipt = true;
// 주문내역이 있으면 현금영수증 발급하지 않음 if($pp['od_id']) { $sql = " select count(od_id) as cnt from {$g5['g5_shop_order_table']} where od_id = '{$pp['od_id']}' "; $row = sql_fetch($sql);
if($row['cnt'] > 0) $is_cash_receipt = false; }
if ($is_cash_receipt && ($pp['pp_price'] - $pp['pp_receipt_price']) == 0) { if ($pp['pp_receipt_price'] && ($pp['pp_settle_case'] == '무통장' || $pp['pp_settle_case'] == '가상계좌' || $pp['pp_settle_case'] == '계좌이체')) { ?> <tr> <th scope="row">현금영수증</th> <td> <?php if ($pp['pp_cash']) { if($pp['pp_pg'] == 'lg') { require G5_SHOP_PATH.'/settle_lg.inc.php';
switch($pp['pp_settle_case']) { case '계좌이체': $trade_type = 'BANK'; break; case '가상계좌': $trade_type = 'CAS'; break; default: $trade_type = 'CR'; break; } $cash_receipt_script = 'javascript:showCashReceipts(\''.$LGD_MID.'\',\''.$pp['pp_id'].'\',\''.$pp['pp_casseqno'].'\',\''.$trade_type.'\',\''.$CST_PLATFORM.'\');'; } else if($pp['pp_pg'] == 'inicis') { $cash = unserialize($pp['pp_cash_info']); $cash_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/Cash_mCmReceipt.jsp?noTid='.$cash['TID'].'&clpaymethod=22\',\'showreceipt\',\'width=380,height=540,scrollbars=no,resizable=no\');'; } else { require G5_SHOP_PATH.'/settle_kcp.inc.php';
$cash = unserialize($pp['pp_cash_info']); $cash_receipt_script = 'window.open(\''.G5_CASH_RECEIPT_URL.$default['de_kcp_mid'].'&orderid='.$pp_id.'&bill_yn=Y&authno='.$cash['receipt_no'].'\', \'taxsave_receipt\', \'width=360,height=647,scrollbars=0,menus=0\');'; } ?> <a href="javascript:;" onclick="<?php echo $cash_receipt_script; ?>">현금영수증 확인</a> <?php } else { ?> <a href="javascript:;" onclick="window.open('<?php echo G5_SHOP_URL; ?>/taxsave.php?tx=personalpay&od_id=<?php echo $pp_id; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');">현금영수증 발급</a> <?php } ?> </td> </tr> <?php } } ?> <?php } ?> <tr> <th scope="row"><label for="pp_shop_memo">상점메모</label></th> <td><textarea name="pp_shop_memo" id="pp_shop_memo" rows="8"><?php echo $pp['pp_shop_memo']; ?></textarea></td> </tr> <tr> <th scope="row"><label for="pp_use">사용</label></th> <td> <select name="pp_use" id="pp_use"> <option value="1" <?php echo get_selected($pp['pp_use'], 1); ?>>사용함</option> <option value="0" <?php echo get_selected($pp['pp_use'], 0); ?>>사용안함</option> </select> </td> </tr> </tbody> </table> </div> </section>
<div class="btn_confirm01 btn_confirm"> <input type="submit" value="확인" class="btn_submit" accesskey="s"> <?php if($popup == 'yes') { ?> <button type="button" onclick="self.close();">닫기</button> <?php } else { ?> <a href="./personalpaylist.php?<?php echo $qstr; ?>">목록</a> <?php } ?> <?php if($w == 'u') { ?> <a href="./personalpayformupdate.php?w=d&pp_id=<?php echo $pp['pp_id']; ?>" onclick="return del_confirm();">삭제</a> <?php } ?> </div> <?php } ?>
<?php echo $wrp_tag_end; ?> </form>
<script> function form_check(f) { if(f.pp_price.value.replace(/[0-9]/g, "").length > 0) { alert("주문금액은 숫자만 입력해 주십시오"); return false; }
return true; }
function del_confirm() { return confirm("개인결제 정보를 삭제하시겠습니까?\n\n삭제한 정보는 복구할 수 없습니다."); } </script>
<?php if($popup == 'yes') include_once(G5_PATH.'/tail.sub.php'); else include_once (G5_ADMIN_PATH.'/admin.tail.php'); ?>
|