Merge branch 'patch'
4
.gitignore
vendored
@ -6,8 +6,12 @@ sirgle/
|
||||
test.php
|
||||
*.key
|
||||
*.sh
|
||||
log
|
||||
g5_tree
|
||||
cheditor*/
|
||||
ckeditor*/
|
||||
log/
|
||||
g5_tree/
|
||||
naver*.html
|
||||
initests01/
|
||||
SIRsoft000/
|
||||
|
||||
@ -1,3 +1,11 @@
|
||||
<?php
|
||||
include_once('./common.php');
|
||||
|
||||
// 커뮤니티 사용여부
|
||||
if(G5_COMMUNITY_USE === false) {
|
||||
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
|
||||
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
|
||||
|
||||
define('_SHOP_', true);
|
||||
}
|
||||
?>
|
||||
@ -74,10 +74,10 @@ function imageview(id, w, h)
|
||||
<ul id="tnb">
|
||||
<li><a href="<?php echo G5_ADMIN_URL ?>/member_form.php?w=u&mb_id=<?php echo $member['mb_id'] ?>">관리자정보</a></li>
|
||||
<li><a href="<?php echo G5_ADMIN_URL ?>/config_form.php">기본환경</a></li>
|
||||
<li><a href="<?php echo G5_ADMIN_URL ?>/service.php">부가서비스</a></li>
|
||||
<li><a href="<?php echo G5_URL ?>/">커뮤니티</a></li>
|
||||
<?php if(defined('G5_USE_SHOP')) { ?>
|
||||
<li><a href="<?php echo G5_ADMIN_URL ?>/shop_admin/configform.php">쇼핑몰환경</a></li>
|
||||
<li><a href="<?php echo G5_ADMIN_URL ?>/service.php">부가서비스</a></li>
|
||||
<li><a href="<?php echo G5_SHOP_URL ?>/">쇼핑몰</a></li>
|
||||
<?php } ?>
|
||||
<li id="tnb_logout"><a href="<?php echo G5_BBS_URL ?>/logout.php">로그아웃</a></li>
|
||||
|
||||
@ -375,7 +375,7 @@ if (get_session('ss_mb_key') !== $admin_key) {
|
||||
|
||||
include_once(G5_LIB_PATH.'/mailer.lib.php');
|
||||
// 메일 알림
|
||||
mailer($member['mb_nick'], $member['mb_email'], $member['mb_email'], 'XSS 공격 알림', $_SERVER['REMOTE_ADDR'].' 아이피로 XSS 공격이 있었습니다.\n\n관리자 권한을 탈취하려는 접근이므로 주의하시기 바랍니다.\n\n해당 아이피는 차단하시고 의심되는 게시물이 있는지 확인하시기 바랍니다.\n\n'.G5_URL, 0);
|
||||
mailer($member['mb_nick'], $member['mb_email'], $member['mb_email'], 'XSS 공격 알림', $_SERVER['REMOTE_ADDR'].' 아이피로 XSS 공격이 있었습니다.<br><br>관리자 권한을 탈취하려는 접근이므로 주의하시기 바랍니다.<br><br>해당 아이피는 차단하시고 의심되는 게시물이 있는지 확인하시기 바랍니다.'.G5_URL, 0);
|
||||
|
||||
alert_close('정상적으로 로그인하여 접근하시기 바랍니다.');
|
||||
}
|
||||
|
||||
19
adm/admin.menu400.shop_1of2.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP) return;
|
||||
|
||||
$menu['menu400'] = array (
|
||||
array('400000', '쇼핑몰관리', G5_ADMIN_URL.'/shop_admin/', 'shop_config'),
|
||||
array('400100', '쇼핑몰설정', G5_ADMIN_URL.'/shop_admin/configform.php', 'scf_config'),
|
||||
array('400400', '주문내역', G5_ADMIN_URL.'/shop_admin/orderlist.php', 'scf_order', 1),
|
||||
array('400440', '개인결제관리', G5_ADMIN_URL.'/shop_admin/personalpaylist.php', 'scf_personalpay', 1),
|
||||
array('400200', '분류관리', G5_ADMIN_URL.'/shop_admin/categorylist.php', 'scf_cate'),
|
||||
array('400300', '상품관리', G5_ADMIN_URL.'/shop_admin/itemlist.php', 'scf_item'),
|
||||
array('400660', '상품문의', G5_ADMIN_URL.'/shop_admin/itemqalist.php', 'scf_item_qna'),
|
||||
array('400650', '사용후기', G5_ADMIN_URL.'/shop_admin/itemuselist.php', 'scf_ps'),
|
||||
array('400620', '상품재고관리', G5_ADMIN_URL.'/shop_admin/itemstocklist.php', 'scf_item_stock'),
|
||||
array('400610', '상품유형관리', G5_ADMIN_URL.'/shop_admin/itemtypelist.php', 'scf_item_type'),
|
||||
array('400500', '상품옵션재고관리', G5_ADMIN_URL.'/shop_admin/optionstocklist.php', 'scf_item_option'),
|
||||
array('400800', '쿠폰관리', G5_ADMIN_URL.'/shop_admin/couponlist.php', 'scf_coupon'),
|
||||
array('400750', '추가배송비관리', G5_ADMIN_URL.'/shop_admin/sendcostlist.php', 'scf_sendcost', 1)
|
||||
);
|
||||
?>
|
||||
16
adm/admin.menu500.shop_2of2.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP) return;
|
||||
|
||||
$menu['menu500'] = array (
|
||||
array('500000', '쇼핑몰현황/기타', G5_ADMIN_URL.'/shop_admin/itemsellrank.php', 'shop_stats'),
|
||||
array('500110', '매출현황', G5_ADMIN_URL.'/shop_admin/sale1.php', 'sst_order_stats'),
|
||||
array('500100', '상품판매순위', G5_ADMIN_URL.'/shop_admin/itemsellrank.php', 'sst_rank'),
|
||||
array('500120', '주문내역출력', G5_ADMIN_URL.'/shop_admin/orderprint.php', 'sst_print_order', 1),
|
||||
array('500400', '재입고SMS알림', G5_ADMIN_URL.'/shop_admin/itemstocksms.php', 'sst_stock_sms', 1),
|
||||
array('500300', '이벤트관리', G5_ADMIN_URL.'/shop_admin/itemevent.php', 'scf_event'),
|
||||
array('500310', '이벤트일괄처리', G5_ADMIN_URL.'/shop_admin/itemeventlist.php', 'scf_event_mng'),
|
||||
array('500500', '배너관리', G5_ADMIN_URL.'/shop_admin/bannerlist.php', 'scf_banner', 1),
|
||||
array('500140', '보관함현황', G5_ADMIN_URL.'/shop_admin/wishlist.php', 'sst_wish'),
|
||||
array('500210', '가격비교사이트', G5_ADMIN_URL.'/shop_admin/price.php', 'sst_compare', 1)
|
||||
);
|
||||
?>
|
||||
@ -8,8 +8,11 @@ html, h1, h2, h3, h4, h5, h6, form, fieldset, img {margin:0;padding:0;border:0}
|
||||
h1, h2, h3, h4, h5, h6 {font-size:1em;font-family:dotum}
|
||||
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {display:block}
|
||||
header ul, nav ul, aside ul, footer ul {margin:0;padding:0;list-style:none}
|
||||
|
||||
label, input, button, select, img {vertical-align:middle}
|
||||
|
||||
textarea, select {font-family:dotum;font-size:1em}
|
||||
|
||||
input {margin:0;padding:0;border-radius:0;font-family:dotum}
|
||||
input[type=text], input[type=password], input[type=submit], input[type=image] {-webkit-appearance:none}
|
||||
button {border-radius:0;font-size:1em;font-family:dotum;-webkit-appearance:none;cursor:pointer}
|
||||
@ -23,6 +26,7 @@ a:focus, a:hover, a:active {text-decoration:underline}
|
||||
h1 {margin:0 0 10px;padding:0 20px 10px;min-width:960px;border-bottom:1px solid #e9e9e9;color:#333;font-size:1.5em;font-family:dotum;letter-spacing:-0.1em}
|
||||
h2 {margin:0 0 10px;padding:0 20px;font-size:1.2em}
|
||||
h2.h2_frm {padding-top:15px}
|
||||
h3 {margin:0 20px}
|
||||
|
||||
/* 레이아웃 */
|
||||
#hd {z-index:10;min-width:1000px;background:url('../img/hd_bg.jpg') #383b3f repeat-x}
|
||||
@ -63,7 +67,9 @@ h2.h2_frm {padding-top:15px}
|
||||
|
||||
.gnb_grp_div {border-top:1px solid #eee}
|
||||
|
||||
|
||||
#lnb {margin:0;padding:15px;min-width:970px;border-bottom:1px solid #e9e9e9;list-style:none;zoom:1}
|
||||
|
||||
#lnb:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
#lnb li {float:left}
|
||||
#lnb a {display:inline-block;padding:0 10px;border-right:1px solid #ccc;font-size:0.95em;letter-spacing:-0.1em}
|
||||
@ -72,6 +78,7 @@ h2.h2_frm {padding-top:15px}
|
||||
#wrapper {z-index:5;margin:20px 0;min-width:1000px;zoom:1}
|
||||
#wrapper:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
|
||||
|
||||
#container {z-index:4;position:relative}
|
||||
|
||||
/* 텍스트 크기 조절 */
|
||||
@ -104,13 +111,13 @@ h2.h2_frm {padding-top:15px}
|
||||
/* 공통박스 */
|
||||
.compare_wrap {margin:0 20px 10px;zoom:1}
|
||||
.compare_wrap:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
.compare_wrap section {margin:10px 0;padding-top:10px}
|
||||
.compare_wrap section {margin:10px 0;padding:2%;background:#f2f5f9}
|
||||
.compare_wrap h3 {margin:10px 0 20px;text-align:center}
|
||||
.compare_wrap .tbl_frm {margin:0}
|
||||
.compare_wrap .frm_input {background:#fff}
|
||||
.compare_wrap .frm_input, .compare_wrap .required {background-color:#fff !important}
|
||||
.compare_wrap .btn_confirm {padding:10px 0 0}
|
||||
.compare_left {float:left;width:49%}
|
||||
.compare_right {float:right;width:49%}
|
||||
.compare_left {float:left;width:45%}
|
||||
.compare_right {float:right;width:45%}
|
||||
|
||||
/* 버튼 */
|
||||
.btn_confirm {margin:0 20px 10px}
|
||||
@ -125,7 +132,9 @@ h2.h2_frm {padding-top:15px}
|
||||
.btn_confirm02 a {display:inline-block;padding:0 15px;height:30px;background:#617d46;color:#fff;text-decoration:none;line-height:2.5em;vertical-align:middle}
|
||||
.btn_confirm02 a:focus {background:#555}
|
||||
|
||||
|
||||
.btn_submit {margin:0;padding:0;border:0;background:#ff3061;color:#fff;cursor:pointer}
|
||||
|
||||
.btn_confirm .btn_submit {padding:0 15px;border:0;height:30px;color:#fff}
|
||||
.btn_cancel {display:inline-block;padding:0 15px;height:30px;border:0;background:#617d46;color:#fff;text-decoration:none}
|
||||
a.btn_cancel {line-height:2.5em;vertical-align:middle}
|
||||
@ -161,6 +170,7 @@ a.btn_cancel {line-height:2.5em;vertical-align:middle}
|
||||
|
||||
.btn_add {margin:0 20px 10px} /* 목록용 추가 */
|
||||
|
||||
|
||||
.btn_add01 {text-align:right}
|
||||
.btn_add01 a, .btn_add01 button {padding:10px;border:1px solid #ccc;background:#f0f0f0;text-decoration:none;cursor:pointer}
|
||||
.btn_add01 a {display:inline-block;vertical-align:middle}
|
||||
@ -192,17 +202,22 @@ legend {position:absolute;width:0;height:0;font-size:0;line-height:0;text-indent
|
||||
.anchor a {display:inline-block;padding:5px 10px;border:1px solid #c8ced1;background:#d6dde1;text-decoration:none}
|
||||
.anchor a:focus, .anchor a:hover {background:#c8d2d8}
|
||||
|
||||
|
||||
#sort_mb {width:800px}
|
||||
|
||||
#sort_sodr {width:600px}
|
||||
|
||||
|
||||
/* 하단 레이아웃 */
|
||||
#ft {clear:both;margin:20px 0;padding:10px 20px;min-width:960px;border-top:1px solid #d0d6d8}
|
||||
|
||||
/* 페이지 내 검색 */
|
||||
|
||||
.local_sch {min-width:960px}
|
||||
|
||||
.local_sch .btn_submit {padding:0 5px;height:24px;border:0;color:#fff;font-size:0.95em;vertical-align:middle;cursor:pointer}
|
||||
|
||||
|
||||
.local_sch01 {margin:0 0 10px;padding:0 20px 10px;border-bottom:1px solid #e9e9e9}
|
||||
.local_sch01 span {display:block;margin:0 0 5px}
|
||||
|
||||
@ -219,7 +234,7 @@ legend {position:absolute;width:0;height:0;font-size:0;line-height:0;text-indent
|
||||
|
||||
.local_cmd01 {margin:0 0 10px;padding:0 20px}
|
||||
.local_cmd01 .cmd_tit {font-weight:bold}
|
||||
.local_cmd01 .btn_submit {padding:3px 5px;border:1px solid #ff3061;color:#fff;font-size:0.95em;vertical-align:middle;cursor:pointer}
|
||||
.local_cmd01 .btn_submit {padding:3px 5px;border:1px solid #ff3061;color:#fff;font-size:0.95em;vertical-align:middle}
|
||||
|
||||
/* 페이지 내 안내문 */
|
||||
.local_desc {}
|
||||
@ -238,7 +253,9 @@ legend {position:absolute;width:0;height:0;font-size:0;line-height:0;text-indent
|
||||
|
||||
.local_ov01 {position:relative;margin:-10px 0 10px;padding:10px 20px;border-bottom:1px solid #e9e9e9;background:#f2f5f9}
|
||||
.local_ov01 .ov_listall {display:inline-block;margin:0 5px 0 0;padding:0 10px 0 0;border-right:1px solid #ccc}
|
||||
.local_ov01 .ov_a {display:inline-block;margin:0 0 0 5px;padding:0 0 0 10px;border-left:1px solid #ccc;color:#ff3061}
|
||||
|
||||
|
||||
/* 테이블 */
|
||||
table {clear:both;width:100%;border-collapse:collapse;border-spacing:0}
|
||||
table caption {height:0;font-size:0;line-height:0;overflow:hidden}
|
||||
@ -252,7 +269,8 @@ tfoot td {font-weight:bold;text-align:center}
|
||||
/* thead 한 줄 테이블 */
|
||||
.tbl_head01 {}
|
||||
.tbl_head01 table {clear:both;width:100%;border-collapse:collapse;border-spacing:0}
|
||||
.tbl_head01 thead th {padding:10px 0;border:1px solid #d1dee2;background:#e5ecef;color:#383838;font-size:0.95em;letter-spacing:-0.1em}
|
||||
.tbl_head01 thead th, .tbl_head01 tbody th {padding:10px 0;border:1px solid #d1dee2;background:#e5ecef;color:#383838;letter-spacing:-0.1em}
|
||||
.tbl_head01 thead th {font-size:0.95em}
|
||||
.tbl_head01 thead input {vertical-align:top} /* middle 로 하면 게시판 읽기에서 목록 사용시 체크박스 라인 깨짐 */
|
||||
.tbl_head01 thead a {color:#383838;text-decoration:underline}
|
||||
.tbl_head01 tbody th {}
|
||||
@ -261,11 +279,22 @@ tfoot td {font-weight:bold;text-align:center}
|
||||
/* thead 두 줄 테이블 */
|
||||
.tbl_head02 {}
|
||||
.tbl_head02 table {clear:both;width:100%;border-collapse:collapse;border-spacing:0}
|
||||
.tbl_head02 thead th {padding:5px 0;border:1px solid #d1dee2;background:#e5ecef;color:#383838;font-size:0.95em;letter-spacing:-0.1em}
|
||||
.tbl_head02 thead th, .tbl_head02 tbody th {padding:5px 0;border:1px solid #d1dee2;background:#e5ecef;color:#383838;letter-spacing:-0.1em}
|
||||
.tbl_head02 thead th {font-size:0.95em}
|
||||
.tbl_head02 thead input {vertical-align:top} /* middle 로 하면 게시판 읽기에서 목록 사용시 체크박스 라인 깨짐 */
|
||||
.tbl_head02 thead a {color:#383838;text-decoration:underline}
|
||||
.tbl_head02 tbody th {}
|
||||
.tbl_head02 tbody td {padding:5px 3px;line-height:1.4em;word-break:break-all}
|
||||
.tbl_head02 tbody td {padding:7px 5px;line-height:1.4em;word-break:break-all}
|
||||
|
||||
/* UL */
|
||||
.ul_wrap {}
|
||||
|
||||
.ul_01 ul {margin:0;padding:0;list-style:none}
|
||||
.ul_01 li {padding:10px 0;border-bottom:1px solid #e9e9e9}
|
||||
|
||||
/* 자료 없는 목록 */
|
||||
.empty_table {padding:100px 0 !important;text-align:center}
|
||||
.empty_list {padding:20px 0 !important;text-align:center}
|
||||
|
||||
/* 폼 테이블 */
|
||||
.tbl_frm01 th {padding:0;border-top:1px solid #ececec;border-bottom:1px solid #ececec;text-align:left}
|
||||
@ -274,10 +303,6 @@ tfoot td {font-weight:bold;text-align:center}
|
||||
.tbl_frm01 #captcha {margin:0;padding:0;border:0;background:transparent}
|
||||
.tbl_frm01 #captcha input {margin-left:5px;text-align:center}
|
||||
|
||||
/* 자료 없는 목록 */
|
||||
.empty_table {padding:100px 0 !important;text-align:center}
|
||||
.empty_list {padding:20px 0 !important;text-align:center}
|
||||
|
||||
/* 테이블 그리드 */
|
||||
.grid_1 {width:50px}
|
||||
.grid_2 {width:100px}
|
||||
@ -338,20 +363,27 @@ tfoot td {font-weight:bold;text-align:center}
|
||||
|
||||
/* 공통 */
|
||||
.td_addr {text-align:left !important}
|
||||
|
||||
.td_alignc {text-align:center}
|
||||
|
||||
.td_addr_line {line-height:2em}
|
||||
|
||||
.td_amount {width:70px;text-align:center}
|
||||
.td_auth {width:100px;text-align:center}
|
||||
.td_auth_mbnick {width:200px}
|
||||
.td_boolean {width:50px;text-align:center}
|
||||
.td_category {width:120px;text-align:center}
|
||||
.td_categorysmall {width:60px;text-align:center}
|
||||
.td_chk {width:30px;text-align:center}
|
||||
.td_cnt {width:100px;font-size:0.95em;text-align:center}
|
||||
.td_cntsmall {width:50px;font-size:0.95em;text-align:center}
|
||||
.td_code {width:60px}
|
||||
.td_code {width:80px;text-align:center}
|
||||
.td_confirm {width:90px;text-align:center}
|
||||
.td_date {width:70px;text-align:center}
|
||||
.td_datetime {width:130px;text-align:center}
|
||||
.td_delicom {width:100px}
|
||||
.td_delino {width:130px}
|
||||
.td_device {width:70px;text-align:center}
|
||||
.td_etc {width:80px;text-align:center}
|
||||
.td_extra label {display:inline-block;width:100px}
|
||||
.td_extra input {margin-right:5px;width:130px}
|
||||
@ -359,7 +391,9 @@ tfoot td {font-weight:bold;text-align:center}
|
||||
td.td_grpset {width:160px;border-left:1px solid #e9ecee;text-align:center}
|
||||
.td_id {width:150px}
|
||||
.td_idsmall {width:75px}
|
||||
.td_itname {text-align:left !important}
|
||||
.td_itopt {width:200px}
|
||||
.td_itopt_tl {text-align:left !important}
|
||||
.td_img {text-align:center}
|
||||
.td_imgline {width:70px;text-align:center}
|
||||
.td_input input {width:94%}
|
||||
@ -371,7 +405,8 @@ td.td_grpset {width:160px;border-left:1px solid #e9ecee;text-align:center}
|
||||
.td_mng button, .td_mngsmall button {margin:0;padding:0;border:0;background:transparent}
|
||||
.td_num {width:60px;text-align:center}
|
||||
.td_numbig {width:100px;text-align:center}
|
||||
.td_numcancel {color:#999;text-decoration:line-through}
|
||||
.td_numcancel0 {color:#999;text-align:center}
|
||||
.td_numcancel1 {color:#ff3061;font-weight:bold;text-align:center}
|
||||
.td_numcoupon {color:#86b325;text-align:center}
|
||||
.td_numincome {color:#357dbb;text-align:center}
|
||||
.td_numsmall {width:30px;text-align:center}
|
||||
@ -386,18 +421,21 @@ td.td_grpset {width:160px;border-left:1px solid #e9ecee;text-align:center}
|
||||
.td_paybybig {width:140px;text-align:center;letter-spacing:-0.1em}
|
||||
.td_possible {width:70px;text-align:center}
|
||||
.td_postal {width:60px;text-align:center}
|
||||
.td_bigpostal {width:140px;text-align:center}
|
||||
.td_postalbig {width:140px;text-align:center}
|
||||
.td_price {text-align:right}
|
||||
.td_pt {text-align:right !important}
|
||||
.td_scate {padding-right:15px;text-align:right;vertical-align:top}
|
||||
.td_send {width:50px;text-align:center}
|
||||
.td_sendcost_by {width:50px;text-align:center}
|
||||
.td_sendcost_add {width:100px;text-align:center}
|
||||
.td_stat {width:70px;text-align:center}
|
||||
.td_tdiv {border-bottom:1px solid #c9c9c9 !important}
|
||||
.td_tel {width:80px;text-align:center}
|
||||
.td_telbig {width:100px;text-align:center}
|
||||
.td_test {width:50px;text-align:center}
|
||||
|
||||
.txt_true {color:#e8180c}
|
||||
.txt_false {color:#ccc}
|
||||
|
||||
.txt_succeed {color:#40b300}
|
||||
.txt_fail {color:#ce4242}
|
||||
|
||||
@ -405,6 +443,8 @@ td.td_grpset {width:160px;border-left:1px solid #e9ecee;text-align:center}
|
||||
.banner_or_img button {display:block;margin:5px 0 0}
|
||||
.txt_active {color:#5d910b}
|
||||
.txt_expired {color:#ccc}
|
||||
#sct_mobileimg{width:125px}
|
||||
|
||||
|
||||
/* 환경설정 */
|
||||
.cf_cert_hide {display:none}
|
||||
@ -413,15 +453,71 @@ td.td_grpset {width:160px;border-left:1px solid #e9ecee;text-align:center}
|
||||
#add_admin fieldset {margin-top:20px}
|
||||
|
||||
/* 메일 테스트 */
|
||||
|
||||
#fsendmailtest {margin:50px 0;text-align:center}
|
||||
#fsendmailtest .btn_submit {padding:3px 5px;border:1px solid #ff3061;color:#fff;font-size:0.95em;vertical-align:middle;cursor:pointer}
|
||||
#fsendmailtest .btn_submit {padding:3px 5px;border:1px solid #ff3061;color:#fff;font-size:0.95em;vertical-align:middle}
|
||||
|
||||
/* ########## 쇼핑몰 사용시 적용 ########## */
|
||||
.sidx {padding:20px 0 30px;zoom:1}
|
||||
.sidx:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
|
||||
.sidx_anchor {position:absolute;margin:0;padding:0;width:1px;height:1px;font-size:0;line-height:0;overflow:hidden}
|
||||
|
||||
/* idx 쇼핑몰 */
|
||||
#anc_sidx_ord {float:left;width:66%}
|
||||
#sidx_graph {position:relative}
|
||||
#sidx_graph_price {position:absolute;top:10px;left:20px;margin:0;padding:0;width:12%;list-style:none}
|
||||
#sidx_graph_price li {position:relative;padding:0 10% 0 0;height:48px;font-family:tahoma;text-align:right}
|
||||
#sidx_graph_price li span {position:absolute;top:7px;right:-10%;width:10px;height:1px;background:#e9e9e9}
|
||||
#sidx_graph_area {position:absolute;top:0;left:15%;margin:0;padding:0;width:85%;height:260px;border:1px solid #e9e9e9;list-style:none}
|
||||
#sidx_graph_area li {position:relative;float:left;padding:0 1% 0 0;width:13%;height:100%}
|
||||
#sidx_graph_area .graph {position:absolute;bottom:0;width:40%;height:0}
|
||||
#sidx_graph_area .order {background:#a0ca30;left:7%}
|
||||
#sidx_graph_area .cancel {background:#ff8db6;right:7%}
|
||||
#sidx_graph_area #price_tooltip {display:none;position:absolute;top:-18px;left:0;background-color:#fff;border:1px solid gray}
|
||||
#sidx_graph_area #price_tooltip div {white-space:nowrap}
|
||||
#sidx_graph_date {position:absolute;top:275px;left:15%;margin:0;padding:0;width:85%;border:1px solid #fff;list-style:none}
|
||||
#sidx_graph_date li {position:relative;float:left;width:14%;font-family:tahoma;text-align:center}
|
||||
#sidx_graph_date li span {position:absolute;top:-19px;right:0;width:1px;height:10px;background:#e9e9e9}
|
||||
#sidx_graph_legend {position:absolute;top:-25px;left:15%}
|
||||
#sidx_graph_legend span {display:inline-block;width:13px;height:13px;vertical-align:middle}
|
||||
#sidx_graph_legend #legend_order {background:#a0ca30}
|
||||
#sidx_graph_legend #legend_cancel {margin:0 0 0 10px;background:#ff8db6}
|
||||
|
||||
#anc_sidx_settle {margin:0 0 30px;padding:30px 0;border-top:1px solid #e9e9e9;border-bottom:1px solid #e9e9e9}
|
||||
#anc_sidx_settle table {text-align:center}
|
||||
|
||||
#sidx_stat {float:right;width:32%}
|
||||
#sidx_stat h2 {padding:0 20px 0 0}
|
||||
#sidx_stat .tbl_wrap {padding:0 20px 0 0}
|
||||
|
||||
/* idx 1:1문의/상품문의/사용후기 */
|
||||
.sidx_cs {}
|
||||
.sidx_cs section {float:left;margin:0 2% 0 0;width:32%}
|
||||
.sidx_cs #anc_sidx_ps {margin:0}
|
||||
.sidx_cs h2 {padding:0}
|
||||
.sidx_cs .ul_wrap {margin:0 0 20px}
|
||||
.sidx_cs .btn_list03 {margin:0}
|
||||
.sidx_cs #anc_sidx_oneq h2 {padding:0 0 0 20px}
|
||||
.sidx_cs #anc_sidx_oneq .ul_wrap {padding:0 0 0 20px}
|
||||
.sidx_cs #anc_sidx_ps h2 {padding:0 20px 0 0}
|
||||
.sidx_cs #anc_sidx_ps .ul_wrap {padding:0 20px 0 0}
|
||||
.sidx_cs #anc_sidx_ps .btn_list03 {margin:0 20px 0 0}
|
||||
|
||||
.sidx_cs #anc_sidx_oneq .oneq_cate {font-weight:bold}
|
||||
.sidx_cs #anc_sidx_oneq .oneq_link {display:block;margin:5px 0}
|
||||
|
||||
.sidx_cs #anc_sidx_qna .qna_link {display:block;margin:5px 0}
|
||||
|
||||
.sidx_cs #anc_sidx_ps .ps_link {display:block;margin:5px 0}
|
||||
|
||||
/* 쇼핑몰 설정 */
|
||||
#anc_scf_payment textarea {height:50px}
|
||||
|
||||
#scf_cardtest_btn {margin-left:5px;vertical-align:middle}
|
||||
.scf_pgreg {display:inline-block;margin:5px 0 0;padding:5px 10px;background:#ff4f91;color:#fff;font-weight:normal;text-decoration:none}
|
||||
|
||||
.scf_cardtest {margin:5px 0 0}
|
||||
.scf_cardtest_btn {margin-left:5px;vertical-align:middle}
|
||||
#scf_cardtest_tip {margin:10px 0 0;padding:10px;border:3px solid #ddd}
|
||||
#scf_cardtest_tip strong {display:inline-block;margin:0 0 5px}
|
||||
#scf_cardtest_tip dl {margin:0 0 15px;padding:0;zoom:1}
|
||||
@ -429,16 +525,17 @@ td.td_grpset {width:160px;border-left:1px solid #e9ecee;text-align:center}
|
||||
#scf_cardtest_tip dt {float:left;width:100px}
|
||||
#scf_cardtest_tip dd {padding:0;overflow:hidden}
|
||||
.scf_cardtest_tip {display:none}
|
||||
.scf_cardtest_hide {display:none}
|
||||
.scf_cardtest_tip_adm_hide {display:none}
|
||||
|
||||
.scf_img {display:none}
|
||||
|
||||
#scf_sms_pre h3 {padding:10px 0 0}
|
||||
#scf_sms_pre dl {margin:10px 0 0;zoom:1}
|
||||
#scf_sms_pre h3 {padding:10px 0}
|
||||
#scf_sms_pre dl {margin:0 0 10px;zoom:1}
|
||||
#scf_sms_pre dl:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
#scf_sms_pre dt {clear:both;float:left;padding:5px 0;width:100px}
|
||||
#scf_sms_pre dd {padding:5px 0;overflow:hidden}
|
||||
#scf_sms_pre p {margin:0 0 20px}
|
||||
#scf_sms {margin:0 0 30px;zoom:1}
|
||||
#scf_sms {margin:0 20px 30px;padding:20px 0 0;zoom:1}
|
||||
#scf_sms:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
.scf_sms_box {float:left;margin:0 8px 0 9px;width:163px;text-align:center}
|
||||
.scf_sms_box h4 {margin:0 0 5px}
|
||||
@ -448,7 +545,17 @@ td.td_grpset {width:160px;border-left:1px solid #e9ecee;text-align:center}
|
||||
.scf_sms_cnt {display:block}
|
||||
|
||||
/* 주문내역 */
|
||||
#sodr_list {text-align:center}
|
||||
#sodr_list td {text-align:center}
|
||||
#sodr_list .td_name {text-align:center !important}
|
||||
#orderitemlist {position:relative}
|
||||
#orderitemlist .itemlist {position:absolute;top:0;left:0}
|
||||
|
||||
#orderitemlist {position:relative}
|
||||
#orderitemlist .itemlist {z-index:2;position:absolute;top:0;left:-41px;width:958px;border:1px solid #a2a5a9;background:#f2f5f9}
|
||||
#orderitemlist td {background:#fff}
|
||||
#orderitemlist #orderitemlist_close {padding:0 20px 10px;text-align:right}
|
||||
|
||||
#sodr_list .list_escrow {display:block;color:#80bc0d;text-align:center}
|
||||
|
||||
/* 주문내역 수정 */
|
||||
.sodr_nonpay {color:#ff6600}
|
||||
@ -456,11 +563,11 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
||||
.sodr_sppay {color:#1f9bff}
|
||||
#anc_sodr_memo textarea {width:98%}
|
||||
#anc_sodr_memo .btn_confirm {margin:10px 0 0}
|
||||
#anc_sodr_payer #od_addr1,
|
||||
#anc_sodr_payer #od_addr2 {margin:5px 0 0}
|
||||
#anc_sodr_addressee #od_b_addr1,
|
||||
#anc_sodr_addressee #od_b_addr2 {margin:5px 0 0}
|
||||
#anc_sodr_orderer #od_addr1, #anc_sodr_orderer #od_addr2, #anc_sodr_orderer #od_addr3 {margin:5px 0 0}
|
||||
#anc_sodr_taker #od_b_addr1, #anc_sodr_taker #od_b_addr2, #anc_sodr_taker #od_b_addr3 {margin:5px 0 0}
|
||||
#anc_sodr_orderer #od_addr_jibeon, #anc_sodr_taker #od_b_addr_jibeon {display:block;margin:5px 0 0}
|
||||
|
||||
#sodr_qty_log {padding:0 20px}
|
||||
#sodr_qty_log h3 {margin:20px 0 10px}
|
||||
#sodr_qty_log div {padding:10px;height:auto !important;height:200px;max-height:200px;border:1px solid #e9e9e9;background:#f5f6fa;line-height:1.8em;overflow-y:scroll}
|
||||
|
||||
@ -478,6 +585,8 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
||||
#sodr_request_list {padding:10px;height:auto !important;height:200px;max-height:200px;border:1px solid #e9e9e9;background:#f5f6fa;overflow-y:scroll}
|
||||
#sodr_request_list p {position:relative;padding:5px 0;border-bottom:1px solid #e9e9e9}
|
||||
|
||||
#anc_sodr_chk .dvr_link {color:#ff3061;text-decoration:underline}
|
||||
|
||||
/* 주문통합내역 */
|
||||
#sodr_sort {margin:0 20px 20px;padding:0;list-style:none;zoom:1}
|
||||
#sodr_sort:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
@ -512,7 +621,14 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
||||
#sodr_total th {width:125px}
|
||||
|
||||
/* 분류관리 목록 */
|
||||
.cate_list_lbl {display:inline-block;width:13px;height:13px;background:url('../shop_admin/img/icon_reply.gif') 0 0 no-repeat}
|
||||
#sct .sct_name {width:130px}
|
||||
|
||||
#sct .sct_name div {position:relative}
|
||||
#sct .sct_name1 {padding-left:25px}
|
||||
#sct .sct_name2 {padding-left:50px}
|
||||
#sct .sct_name3 {padding-left:75px}
|
||||
#sct .sct_name4 {padding-left:100px}
|
||||
#sct .name_lbl {position:absolute;top:0;left:-20px;width:13px;height:13px;background:url('../shop_admin/img/icon_reply.gif') 0 0 no-repeat}
|
||||
|
||||
/* 분류 추가/수정 */
|
||||
.frm_ca_id {display:inline-block;margin:0 10px 0 0;font-weight:bold}
|
||||
@ -536,7 +652,7 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
||||
|
||||
.sit_option {margin:0 0 10px;padding:10px 10px 0;border:1px solid #e9e9e9;background:#f7f7f7}
|
||||
.sit_option .frm_input {background:#fff !important;color:#000}
|
||||
.sit_option_frm_wrapper {margin:0 0 10px;height:auto !important;height:500px;max-height:500px;border:1px solid #484848;overflow-y:scroll}
|
||||
.sit_option_frm_wrapper {margin:0 0 10px;height:auto !important;height:500px;max-height:500px;border:1px solid #ccc;overflow-y:scroll}
|
||||
.sit_option_frm_wrapper th {padding:5px 0 !important;text-align:center !important}
|
||||
|
||||
#sit_option_frm .btn_list {margin:0 0 10px}
|
||||
@ -557,10 +673,13 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
||||
/* 상품 일괄 등록 */
|
||||
#excelfile_upload {margin:10px auto 20px;padding:20px;width:86%;border:1px solid #e9e9e9;background:#fff}
|
||||
#excelfile_upload label {font-weight:bold}
|
||||
#excelfile_result {margin:0 auto 20px;padding:20px;width:86%;border:1px solid #e9e9e9;background:#fff;zoom:1}
|
||||
#excelfile_input {margin:0 0 20px;text-align:center}
|
||||
#excelfile_result {margin:0 20px 20px;border-bottom:1px solid #e9e9e9;zoom:1}
|
||||
#excelfile_result:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
#excelfile_result dt {clear:both;float:left;padding:10px 0;width:40%}
|
||||
#excelfile_result dt {clear:both;float:left;padding:10px 0;width:40%;font-weight:bold}
|
||||
#excelfile_result dd {float:left;margin:0;padding:10px 0;width:60%}
|
||||
#excelfile_result .result_done {color:#5d910b}
|
||||
#excelfile_result .result_fail {color:#ff3061}
|
||||
|
||||
/* 상품옵션재고관리 */
|
||||
.sit_stock_qty_alert {color:#ff1133;font-weight:bold}
|
||||
@ -573,15 +692,19 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
||||
|
||||
/* 관련 상품, 관련 이벤트 입력/수정 */
|
||||
.srel section ul {margin:0;padding:10px;list-style:none}
|
||||
.srel section li {position:relative;border-bottom:1px solid #e9e9e9}
|
||||
.srel .srel_list {height:auto !important;height:200px;max-height:200px;border:1px solid #ced9de;background:#f6f6f6;overflow-y:scroll}
|
||||
.srel section li {padding:5px 0;border-bottom:1px solid #e9e9e9;zoom:1}
|
||||
.srel section li:after {display:block;visibility:hidden;clear:both;content:''}
|
||||
.srel .srel_list, .srel .srel_sel {height:auto !important;height:200px;max-height:200px;border:1px solid #ced9de;background:#f6f6f6;overflow-y:scroll}
|
||||
.srel .list_item {float:left;width:80%}
|
||||
.srel .list_item img {float:left;margin:0 10px 0 0}
|
||||
.srel .list_item_btn {float:right}
|
||||
.srel .srel_sel {border:1px solid #ced9de;background:#fcfff2}
|
||||
.srel .srel_list p, .srel .srel_sel p {padding:10px 0;text-align:center}
|
||||
.srel .compare_left ul {margin:0;list-style:none}
|
||||
.srel button {position:absolute;top:12px;right:0}
|
||||
.srel .srel_noneimg li {padding:7px 0}
|
||||
.srel .srel_noneimg button {top:0;right:0}
|
||||
.srel .srel_pad {display:block;height:30px}
|
||||
.srel .srel_pad button {position:static}
|
||||
|
||||
/* 쿠폰관리 */
|
||||
.scp_new_win .empty_table {padding:30px 0}
|
||||
@ -620,6 +743,10 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
||||
#sodr_print_pop_total span {display:block;margin:0 0 10px;font-size:1.5em}
|
||||
#sodr_print_pop_total strong {color:#ff3600}
|
||||
|
||||
/* 배너관리 */
|
||||
.sbn_img {text-align:center}
|
||||
.sbn_image {display:none;margin:0 0 10px;text-align:left}
|
||||
|
||||
/* SMS문자전송 */
|
||||
#sms_send {padding-bottom:100px;zoom:1}
|
||||
#sms_send:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
@ -632,12 +759,14 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
||||
#sms_sm_text {position:absolute;top:75px;left:27px;width:180px;color:#fff;font-size:2em;word-break:break-all}
|
||||
#sms_sm p {position:absolute;bottom:-70px;left:0;font-size:0.95em;letter-spacing:-0.1em}
|
||||
|
||||
/* 가격비교사이트 */
|
||||
#anc_pricecompare_info li {margin:5px 0}
|
||||
#sms_send .local_desc01 {min-width:320px}
|
||||
|
||||
#anc_pricecompare_engine dt a {font-weight:bold}
|
||||
#anc_pricecompare_engine dd {margin:0 0 30px}
|
||||
#anc_pricecompare_engine li {margin:5px 0}
|
||||
/* 가격비교사이트 */
|
||||
#anc_pricecompare_info li {margin:5px 0 5px -1px}
|
||||
|
||||
.price_engine dt a {font-weight:bold}
|
||||
.price_engine dd {margin:0 0 15px}
|
||||
.price_engine li {margin:5px 0 5px -1px}
|
||||
|
||||
/* 새창 기본 스타일 */
|
||||
.new_win {}
|
||||
@ -646,17 +775,23 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
||||
.new_win_ul {margin:-20px 0 20px 0;padding:0 0 0 20px;border-bottom:1px solid #515151;background:#484848;list-style:none;zoom:1}
|
||||
.new_win_ul:after {display:block;visibility:hidden;clear:both;content:""}
|
||||
.new_win_ul li {float:left;margin-left:-1px}
|
||||
|
||||
.new_win_ul a {display:block;padding:10px 10px 8px;border-right:1px solid #595959;border-left:1px solid #595959;color:#fff;font-family:dotum;font-weight:bold;text-decoration:none}
|
||||
|
||||
|
||||
.new_win_desc {margin:0 20px}
|
||||
.new_win .anchor {margin:0 20px 5px}
|
||||
|
||||
.new_win .tbl_wrap {margin:0 20px 20px;padding:0}
|
||||
|
||||
|
||||
.new_win .win_btn {clear:both;padding:20px;text-align:center} /* 새창용 */
|
||||
.new_win .win_btn button {display:inline-block;padding:0 10px;height:30px;border:0;background:#4b545e;color:#fff;line-height:2em;cursor:pointer}
|
||||
.new_win .win_btn input {padding:0 10px;height:30px;line-height:2em}
|
||||
.new_win .win_btn a {display:inline-block;padding:0 10px;height:30px;background:#4b545e;color:#fff;vertical-align:middle;line-height:2.4em}
|
||||
.new_win .win_btn a:focus, .new_win .win_btn a:hover {text-decoration:none}
|
||||
|
||||
|
||||
.new_win .local_sch, .new_win .local_cmd, .new_win .local_desc01, .new_win .local_desc02, .new_win .local_ov {min-width:320px}
|
||||
|
||||
/* 자바스크립트 alert 대안 */
|
||||
@ -688,32 +823,63 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
||||
.pg_end, .pg_next {/* 다음 */}
|
||||
.pg_current {display:inline-block;margin:0 4px 0 0;background:#333;color:#fff;font-weight:normal}
|
||||
|
||||
|
||||
/* 우편번호 검색 */
|
||||
#post_code p {margin:0 20px 10px}
|
||||
#post_code #code_sch {margin:0 20px}
|
||||
#post_code #code_sch .btn_submit {padding:2px 8px 1px;border:0;color:#fff}
|
||||
#post_code #result {margin:0 20px 20px}
|
||||
#post_code #result_b4 {display:block;padding:30px 0;border-bottom:1px solid #dde4e9;text-align:center}
|
||||
#post_code #result .result_msg {padding:15px 0}
|
||||
#post_code #result .result_fail {border:1px solid #dde4e9;background:#f0f5fc;color:#ff3061;text-align:center}
|
||||
#post_code #result ul {margin:0;padding:0;border-bottom:1px solid #dde4e9;background:#f0f5fc;list-style:none}
|
||||
#post_code #result li {padding:10px;border:1px solid #dde4e9;border-bottom:0}
|
||||
#post_code #result li div {margin:4px 0 0;color:#738D94}
|
||||
#post_code #result li div:before {content:"▶ "}
|
||||
|
||||
|
||||
/*부가서비스*/
|
||||
.lnb_svc{color:#ff3061;font-weight:bold}
|
||||
.service_wrap{width:960px; margin:0 20px 10px;overflow:hidden}
|
||||
.sevice_1{border:1px solid #ebe8e8;width:330px;float:left;border-radius:5px;text-align:center;margin-right:6px;}
|
||||
.sevice_1 .svc_img{padding:30px 0 0;}
|
||||
.sevice_1 h3{font-size:16px;margin:15px 0;color:#525252}
|
||||
.sevice_1 p{padding:20px;background:#f8f8f8;height:90px;font-size:12px;text-align:left; color:#898989;line-height:18px}
|
||||
.sevice_1{border:1px solid #ebe8e8;width:309px;float:left;border-radius:5px;text-align:center;}
|
||||
.sevice_1 h3{font-size:16px;color:#525252;margin-top:193px;height:43px;}
|
||||
.sevice_1 h3 span{font-size:12px;}
|
||||
.sevice_1 p{padding:20px;background:#f8f8f8;height:102px;font-size:12px;text-align:left; color:#898989;line-height:18px}
|
||||
.sevice_1 ul {width:100%;padding:0; margin:0;border-top:1px solid #ebe8e8;}
|
||||
.sevice_1 ul li{list-style:none;float:left;border-right:1px solid #ebe8e8;width:33%;}
|
||||
.sevice_1 ul li a{display:inline-block;height:76px;width:100%}
|
||||
.sevice_1 ul li{list-style:none;float:left;border-right:1px solid #ebe8e8;}
|
||||
.sevice_1 ul li a{display:inline-block;height:75px;width:100%}
|
||||
.sevice_1 ul li img{padding:10px 0 0;}
|
||||
.sevice_1 ul li.last{border:0}
|
||||
.sevice_1 h4{width:100%;padding:0; margin:0;border-top:1px solid #ebe8e8;}
|
||||
.sevice_1 h4 a{display:inline-block;height:66px;padding:10px 0 0;width:100%}
|
||||
.sevice_1 h4 a{display:inline-block;height:65px;padding:10px 0 0;width:100%}
|
||||
|
||||
.sevice_2{border:1px solid #ebe8e8;float:left;width:282px;}
|
||||
.sevice_2 .svc_a{padding:33px 0 0;}
|
||||
.sevice_2 .svc_a h3{font-size:14px;letter-spacing:-1px;color:#525252;margin-bottom:5px;padding:0 20px 0}
|
||||
.sevice_2 .svc_a p{color:#898989;line-height:18px;letter-spacing:-1px;padding:5px 20px 0;}
|
||||
.sevice_2 .svc_btn{text-align:center;position:absolute;bottom:0;left:0;width:282px;}
|
||||
.sevice_2 .svc_btn a{display:inline-block; background:#ff3061;text-align:center;color:#fff;padding:10px 20px;}
|
||||
.sevice_2 .svc_btn a:hover{text-decoration:none;}
|
||||
.sevice_2 .svc_sms{overflow:hidden; height:212px;position:relative}
|
||||
.sevice_2 .svc_sms .svc_btn a{display:inline-block; background:#f8f8f8;width:100%;text-align:center;margin:0;padding:10px 0 0 }
|
||||
.sevice_2 .svc_design{overflow:hidden;height:210px;position:relative}
|
||||
.sevice_2 .svc_design .svc_btn a{margin:0 0 20px}
|
||||
.svc_card{background:url('../img/service_img1.jpg') no-repeat top center;margin-right:13px;}
|
||||
.svc_card ul li{width:33%;}
|
||||
.svc_phone {background:url('../img/service_img2.jpg') no-repeat top center;margin-right:13px;}
|
||||
.svc_phone ul li{width:33%;}
|
||||
.svc_ipin {background:url('../img/service_img3.jpg') no-repeat top center;}
|
||||
|
||||
.service_2{padding-top:15px;clear:both}
|
||||
.service_2 h3{font-size:14px;letter-spacing:-1px;color:#525252;margin:0 0 4px}
|
||||
|
||||
.service_2 .svc_a p{color:#898989;line-height:16px;letter-spacing:-1px;}
|
||||
|
||||
.svc_keyword{clear:both ;}
|
||||
.svc_keyword .svc_a{float:left;width:230px;padding:46px 0 0 15px ;height:120px; }
|
||||
|
||||
.service_2 .svc_ri .svc_a{padding:25px 0 0 22px;}
|
||||
|
||||
.service_2 .svc_btn{float:right;}
|
||||
.service_2 .svc_btn a{display:inline-block;width:126px; height:37px;background:#ff3061;color:#fff;line-height:37px;text-align:center;margin:22px 13px 0;}
|
||||
.service_2 .svc_btn a:hover,.service_2 .svc_btn a:focus,.service_2 .svc_btn a:active{text-decoration:none}
|
||||
.svc_keyword{background:#e6f2f4}
|
||||
.svc_keyword .svc_btn{margin:40px 0 0 ;}
|
||||
.svc_keyword .svc_btn a{width:160px;}
|
||||
|
||||
.svc_sms{border:1px solid #ebe8e8;position:relative;height:83px}
|
||||
.svc_sms:after{display:block;visibility:hidden;clear:both;content:""}
|
||||
.svc_sms .svc_btn2{position:absolute;top:0;right:0}
|
||||
.svc_sms .svc_btn2 a{display:inline-block; width:220px; height:63px; background:#fbfbfb; text-align:center; padding:20px 0 0;}
|
||||
|
||||
/*테마*/
|
||||
.theme_p{padding:0 20px}
|
||||
@ -730,7 +896,7 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
||||
#theme_list li .tmli_if:hover button.tmli_dt{display:block}
|
||||
#theme_list li .theme_sl{float:left;border:none;margin-top:5px;padding:0 5px;height:26px;background:#999;color:#fff}
|
||||
#theme_list li .theme_sl:hover{background:#ff3061}
|
||||
#theme_list li .theme_deactive{margin-left:4px}
|
||||
#theme_list li .theme_deactive{margin-left:4px}
|
||||
#theme_list li .theme_sl_use{background:#ff3061;line-height:26px}
|
||||
#theme_list li .theme_pr{float:right;margin-top:5px;padding:0 5px;height:24px;line-height:24px; border: 1px solid #ccc; background: #fafafa; }
|
||||
#theme_list li .theme_preview{ float: right; margin-top: 5px; padding:0 5px;height:26px; border: 1px solid #ccc; background: #fafafa; margin-right:3px}
|
||||
@ -758,4 +924,4 @@ strong.sodr_nonpay {display:block;padding:5px 0;text-align:right}
|
||||
#grp_color li span{width:10px;height:10px; display:inline-block;background:rgb(75, 178, 197);margin-right:5px;}
|
||||
#grp_color li.color2 span{background:rgb(234, 162, 40);}
|
||||
#chart_wr h5{text-align:center;border:1px solid #eee;padding:30px 0}
|
||||
#chart_wr{margin:20px }
|
||||
#chart_wr{margin:20px }
|
||||
|
||||
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 8.0 KiB |
BIN
adm/img/service_img3.jpg
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.8 KiB |
BIN
adm/img/svc_btn_06.jpg
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
@ -5,6 +5,10 @@ include_once(G5_EDITOR_LIB);
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
// 팝업레이어 테이블에 쇼핑몰, 커뮤니티 인지 구분하는 여부 필드 추가
|
||||
$sql = " ALTER TABLE `{$g5['new_win_table']}` ADD `nw_division` VARCHAR(10) NOT NULL DEFAULT 'both' ";
|
||||
sql_query($sql, false);
|
||||
|
||||
$html_title = "팝업레이어";
|
||||
if ($w == "u")
|
||||
{
|
||||
@ -45,6 +49,17 @@ include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><label for="nw_division">구분</label></th>
|
||||
<td>
|
||||
<?php echo help("커뮤니티에 표시될 것인지 쇼핑몰에 표시될 것인지를 설정합니다."); ?>
|
||||
<select name="nw_division" id="nw_division">
|
||||
<option value="both"<?php echo get_selected($nw['nw_division'], 'both', true); ?>>커뮤니티와 쇼핑몰</option>
|
||||
<option value="comm"<?php echo get_selected($nw['nw_division'], 'comm'); ?>>커뮤니티</option>
|
||||
<option value="shop"<?php echo get_selected($nw['nw_division'], 'shop'); ?>>쇼핑몰</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="nw_device">접속기기</label></th>
|
||||
<td>
|
||||
|
||||
@ -10,7 +10,8 @@ if ($w == 'd')
|
||||
else
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$sql_common = " nw_device = '{$_POST['nw_device']}',
|
||||
$sql_common = " nw_division = '{$_POST['nw_division']}',
|
||||
nw_device = '{$_POST['nw_device']}',
|
||||
nw_begin_time = '{$_POST['nw_begin_time']}',
|
||||
nw_end_time = '{$_POST['nw_end_time']}',
|
||||
nw_disable_hours = '{$_POST['nw_disable_hours']}',
|
||||
|
||||
@ -14,6 +14,7 @@ if(!sql_query(" DESCRIBE {$g5['new_win_table']} ", false)) {
|
||||
} else {
|
||||
$query_cp = sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['new_win_table']}` (
|
||||
`nw_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`nw_division` varchar(10) NOT NULL DEFAULT 'both',
|
||||
`nw_device` varchar(10) NOT NULL DEFAULT 'both',
|
||||
`nw_begin_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`nw_end_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
|
||||
@ -9,38 +9,51 @@ include_once('./admin.head.php');
|
||||
?>
|
||||
|
||||
<div class="local_desc02 local_desc">
|
||||
<p>아래의 서비스들은 그누보드에서 이미 지원하는 기능으로 별도의 개발이 필요 없으며 서비스 신청후 바로 사용 할수 있습니다.</p>
|
||||
<p>아래의 서비스들은 영카트에서 이미 지원하는 기능으로 별도의 개발이 필요 없으며 서비스 신청후 바로 사용 할수 있습니다.</p>
|
||||
</div>
|
||||
|
||||
<div class="service_wrap">
|
||||
<div class="sevice_1">
|
||||
<img src="<?php echo G5_ADMIN_URL ?>/img/service_img1.jpg" alt="휴대폰 본인확인 서비스" class="svc_img">
|
||||
<div class="sevice_1 svc_card">
|
||||
<h3>신용카드 전자결제 서비스<br><span>(계좌이체, 가상계좌 결제 포함)</span></h3>
|
||||
<p>이곳을 통하여 가입하시면 신용카드 결제를 국내 최저 수수료인 3.2%에 이용 할 수 있습니다. 영카트를 사용하지 않아도 이 수수료를 적용 받을 수 있습니다. 아래 가입을 희망하시는 회사의 로고를 클릭하시면 가입페이지로 이동합니다.</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="http://sir.co.kr/main/service/p_pg.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_01.jpg" alt="KCP 신용카드 전자결제 신청하기"></a></li>
|
||||
<li ><a href="http://sir.co.kr/main/service/lg_pg.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_02.jpg" alt="LG유플러스 신용카드 전자결제 신청하기"></a></li>
|
||||
<li class="last"><a href="http://sir.co.kr/main/service/inicis_pg.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_06.jpg" alt="KG 이니시스 전자결제 신청하기"></a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="sevice_1 svc_phone">
|
||||
<h3>휴대폰 본인확인 서비스</h3>
|
||||
<p>정보통신망법 23조 2항(주민등록번호의 사용제한)에 따라 기존 주민등록번호 기반의 인증서비스 이용이 불가합니다. 주민등록번호 대체수단으로 최소한의 정보(생년월일, 휴대폰번호, 성별)를 입력받아 본인임을 확인하는 인증수단 입니다</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="http://sir.co.kr/main/service/p_cert.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_01.jpg" alt="KCP 휴대폰 본인확인 신청하기"></a></li>
|
||||
<li><a href="http://sir.co.kr/main/service/lg_cert.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_02.jpg" alt="LG유플러스 휴대폰대체인증 신청하기"></a></li>
|
||||
<li class="last"><a href="http://sir.co.kr/main/service/b_cert.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_03.jpg" alt="OKname 휴대폰 본인확인 신청하기"></a></li>
|
||||
<li><a href="http://sir.co.kr/main/service/lg_cert.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_02.jpg" alt="유플러스 휴대폰 본인확인 신청하기"></a></li>
|
||||
<li class="last"><a href="http://sir.co.kr/main/service/b_cert.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_03.jpg" alt="오케이네임 휴대폰대체인증 신청하기"></a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="sevice_1">
|
||||
<img src="<?php echo G5_ADMIN_URL ?>/img/service_img2.jpg" alt="아이핀 본인확인 서비스" class="svc_img">
|
||||
<div class="sevice_1 svc_ipin">
|
||||
<h3>아이핀 본인확인 서비스</h3>
|
||||
<p>정부가 주관하는 주민등록번호 대체 수단으로 본인의 개인정보를 아이핀 사이트에 한번만 발급해 놓고, 이후부터는 아이디와 패스워드 만으로
|
||||
본인임을 확인하는 인증수단 입니다.</p>
|
||||
<p>정부가 주관하는 주민등록번호 대체 수단으로 본인의 개인정보를 아이핀 사이트에 한번만 발급해 놓고, 이후부터는 아이디와 패스워드 만으로 본인임을 확인하는 인증수단 입니다. </p>
|
||||
|
||||
<h4><a href="http://sir.co.kr/main/service/b_ipin.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_04.jpg" alt="오케이네임 아이핀 본인확인 신청하기"></a></h4>
|
||||
|
||||
<h4><a href="http://sir.co.kr/main/service/b_ipin.php" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_04.jpg" alt="OKname 아이핀 본인확인 신청하기"></a></h4>
|
||||
</div>
|
||||
<div class="sevice_2">
|
||||
<div class="svc_sms">
|
||||
|
||||
|
||||
<div class="service_2">
|
||||
<div class="svc_ri svc_sms">
|
||||
<div class="svc_a">
|
||||
<h3>SMS 문자 서비스</h3>
|
||||
<p>사이트 관리자 또는 회원이 다른 회원의 <br>휴대폰으로 단문메세지(최대 한글 40자, 영문 80자)를 발송할 수 있습니다.</p>
|
||||
<p>주문이나 배송시에 상점운영자 또는 고객에게 휴대폰으로 단문메세지 (최대 한글 40자, 영문 80자)를 발송합니다.</p>
|
||||
</div>
|
||||
<div class="svc_btn"><a href="http://icodekorea.com/res/join_company_fix_a.php?sellid=sir2" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_05.jpg" alt="아이코드 SMS 서비스 신청하기"></a></div>
|
||||
</div>
|
||||
|
||||
<div class="svc_btn2"><a href="http://icodekorea.com/res/join_company_fix_a.php?sellid=sir2" target="_blank"><img src="<?php echo G5_ADMIN_URL ?>/img/svc_btn_05.jpg" alt="아이코드 SMS 서비스 신청하기"></a></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
9
adm/shop_admin/_common.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
define('G5_IS_ADMIN', true);
|
||||
include_once ('../../common.php');
|
||||
|
||||
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
|
||||
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
|
||||
|
||||
include_once(G5_ADMIN_PATH.'/admin.lib.php');
|
||||
?>
|
||||
122
adm/shop_admin/admin.shop.lib.php
Normal file
@ -0,0 +1,122 @@
|
||||
<?php
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
|
||||
// 상품옵션별재고 또는 상품재고에 더하기
|
||||
function add_io_stock($it_id, $ct_qty, $io_id="", $io_type=0)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
if($io_id) {
|
||||
$sql = " update {$g5['g5_shop_item_option_table']}
|
||||
set io_stock_qty = io_stock_qty + '{$ct_qty}'
|
||||
where it_id = '{$it_id}'
|
||||
and io_id = '{$io_id}'
|
||||
and io_type = '{$io_type}' ";
|
||||
} else {
|
||||
$sql = " update {$g5['g5_shop_item_table']}
|
||||
set it_stock_qty = it_stock_qty + '{$ct_qty}'
|
||||
where it_id = '{$it_id}' ";
|
||||
}
|
||||
return sql_query($sql);
|
||||
}
|
||||
|
||||
|
||||
// 상품옵션별재고 또는 상품재고에서 빼기
|
||||
function subtract_io_stock($it_id, $ct_qty, $io_id="", $io_type=0)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
if($io_id) {
|
||||
$sql = " update {$g5['g5_shop_item_option_table']}
|
||||
set io_stock_qty = io_stock_qty - '{$ct_qty}'
|
||||
where it_id = '{$it_id}'
|
||||
and io_id = '{$io_id}'
|
||||
and io_type = '{$io_type}' ";
|
||||
} else {
|
||||
$sql = " update {$g5['g5_shop_item_table']}
|
||||
set it_stock_qty = it_stock_qty - '{$ct_qty}'
|
||||
where it_id = '{$it_id}' ";
|
||||
}
|
||||
return sql_query($sql);
|
||||
}
|
||||
|
||||
|
||||
// 주문과 장바구니의 상태를 변경한다.
|
||||
function change_status($od_id, $current_status, $change_status)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$sql = " update {$g5['g5_shop_order_table']} set od_status = '{$change_status}' where od_id = '{$od_id}' and od_status = '{$current_status}' ";
|
||||
sql_query($sql, true);
|
||||
|
||||
$sql = " update {$g5['g5_shop_cart_table']} set ct_status = '{$change_status}' where od_id = '{$od_id}' and ct_status = '{$current_status}' ";
|
||||
sql_query($sql, true);
|
||||
}
|
||||
|
||||
|
||||
// 주문서에 입금시 update
|
||||
function order_update_receipt($od_id)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$sql = " update {$g5['g5_shop_order_table']} set od_receipt_price = od_misu, od_misu = 0, od_receipt_time = '".G5_TIME_YMDHIS."' where od_id = '$od_id' and od_status = '입금' ";
|
||||
return sql_query($sql);
|
||||
}
|
||||
|
||||
|
||||
// 주문서에 배송시 update
|
||||
function order_update_delivery($od_id, $mb_id, $change_status, $delivery)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
if($change_status != '배송')
|
||||
return;
|
||||
|
||||
$sql = " update {$g5['g5_shop_order_table']} set od_delivery_company = '{$delivery['delivery_company']}', od_invoice = '{$delivery['invoice']}', od_invoice_time = '{$delivery['invoice_time']}' where od_id = '$od_id' and od_status = '준비' ";
|
||||
sql_query($sql);
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_cart_table']} where od_id = '$od_id' ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
// 재고를 사용하지 않았다면
|
||||
$stock_use = $row['ct_stock_use'];
|
||||
|
||||
if(!$row['ct_stock_use'])
|
||||
{
|
||||
// 재고에서 뺀다.
|
||||
subtract_io_stock($row['it_id'], $row['ct_qty'], $row['io_id'], $row['io_type']);
|
||||
$stock_use = 1;
|
||||
|
||||
$sql = " update {$g5['g5_shop_cart_table']} set ct_stock_use = '$stock_use' where ct_id = '{$row['ct_id']}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 처리내용 SMS
|
||||
function conv_sms_contents($od_id, $contents)
|
||||
{
|
||||
global $g5, $config, $default;
|
||||
|
||||
$sms_contents = '';
|
||||
|
||||
if ($od_id && $config['cf_sms_use'] == 'icode')
|
||||
{
|
||||
$sql = " select od_id, od_name, od_invoice, od_receipt_price, od_delivery_company
|
||||
from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
|
||||
$od = sql_fetch($sql);
|
||||
|
||||
$sms_contents = $contents;
|
||||
$sms_contents = str_replace("{이름}", $od['od_name'], $sms_contents);
|
||||
$sms_contents = str_replace("{입금액}", number_format($od['od_receipt_price']), $sms_contents);
|
||||
$sms_contents = str_replace("{택배회사}", $od['od_delivery_company'], $sms_contents);
|
||||
$sms_contents = str_replace("{운송장번호}", $od['od_invoice'], $sms_contents);
|
||||
$sms_contents = str_replace("{주문번호}", $od['od_id'], $sms_contents);
|
||||
$sms_contents = str_replace("{회사명}", $default['de_admin_company_name'], $sms_contents);
|
||||
}
|
||||
|
||||
return iconv("utf-8", "euc-kr", stripslashes($sms_contents));
|
||||
}
|
||||
?>
|
||||
17
adm/shop_admin/ajax.ca_id.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$ca_id = trim($_POST['ca_id']);
|
||||
if (preg_match("/[^0-9a-z]/i", $ca_id)) {
|
||||
die("{\"error\":\"분류코드는 영문자 숫자 만 입력 가능합니다.\"}");
|
||||
}
|
||||
|
||||
$sql = " select ca_name from {$g5['g5_shop_category_table']} where ca_id = '{$ca_id}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['ca_name']) {
|
||||
$ca_name = addslashes($row['ca_name']);
|
||||
die("{\"error\":\"이미 등록된 분류코드 입니다.\\n\\n분류명 : {$ca_name}\"}");
|
||||
}
|
||||
|
||||
die("{\"error\":\"\"}"); // 정상
|
||||
?>
|
||||
17
adm/shop_admin/ajax.it_id.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$it_id = trim($_POST['it_id']);
|
||||
if (preg_match("/[^\w\-]/", $it_id)) { // \w : 0-9 A-Z a-z _
|
||||
die("{\"error\":\"상품코드는 영문자 숫자 _ - 만 입력 가능합니다.\"}");
|
||||
}
|
||||
|
||||
$sql = " select it_name from {$g5['g5_shop_item_table']} where it_id = '{$it_id}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['it_name']) {
|
||||
$it_name = addslashes($row['it_name']);
|
||||
die("{\"error\":\"이미 등록된 상품코드 입니다.\\n\\n상품명 : {$it_name}\"}");
|
||||
}
|
||||
|
||||
die("{\"error\":\"\"}"); // 정상
|
||||
?>
|
||||
124
adm/shop_admin/ajax.orderitem.php
Normal file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
$sub_menu = '400400';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$od_id = $_POST['od_id'];
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
|
||||
$od = sql_fetch($sql);
|
||||
|
||||
if(!$od['od_id'])
|
||||
die('<div>주문정보가 존재하지 않습니다.</div>');
|
||||
|
||||
// 상품목록
|
||||
$sql = " select it_id,
|
||||
it_name,
|
||||
cp_price,
|
||||
ct_notax,
|
||||
ct_send_cost,
|
||||
it_sc_type
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where od_id = '$od_id'
|
||||
group by it_id
|
||||
order by ct_id ";
|
||||
$result = sql_query($sql);
|
||||
?>
|
||||
|
||||
<section id="cart_list">
|
||||
<h2 class="h2_frm">주문상품 목록</h2>
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption>주문 상품 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<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>
|
||||
<th scope="col">배송비</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
// 상품이미지
|
||||
$image = get_it_image($row['it_id'], 50, 50);
|
||||
|
||||
// 상품의 옵션정보
|
||||
$sql = " select ct_id, it_id, ct_price, ct_qty, ct_option, ct_status, cp_price, ct_send_cost, io_type, io_price
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where od_id = '$od_id'
|
||||
and it_id = '{$row['it_id']}'
|
||||
order by io_type asc, ct_id asc ";
|
||||
$res = sql_query($sql);
|
||||
$rowspan = mysql_num_rows($res);
|
||||
|
||||
// 배송비
|
||||
switch($row['ct_send_cost'])
|
||||
{
|
||||
case 1:
|
||||
$ct_send_cost = '착불';
|
||||
break;
|
||||
case 2:
|
||||
$ct_send_cost = '무료';
|
||||
break;
|
||||
default:
|
||||
$ct_send_cost = '선불';
|
||||
break;
|
||||
}
|
||||
|
||||
// 조건부무료
|
||||
if($row['it_sc_type'] == 2) {
|
||||
$sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $s_cart_id);
|
||||
|
||||
if($sendcost == 0)
|
||||
$ct_send_cost = '무료';
|
||||
|
||||
$save_it_id = $row['it_id'];
|
||||
}
|
||||
|
||||
for($k=0; $opt=sql_fetch_array($res); $k++) {
|
||||
if($opt['io_type'])
|
||||
$opt_price = $opt['io_price'];
|
||||
else
|
||||
$opt_price = $opt['ct_price'] + $opt['io_price'];
|
||||
|
||||
// 소계
|
||||
$ct_price['stotal'] = $opt_price * $opt['ct_qty'];
|
||||
$ct_point['stotal'] = $opt['ct_point'] * $opt['ct_qty'];
|
||||
?>
|
||||
<tr>
|
||||
<?php if($k == 0) { ?>
|
||||
<td class="td_itname" rowspan="<?php echo $rowspan; ?>">
|
||||
<a href="./itemform.php?w=u&it_id=<?php echo $row['it_id']; ?>"><?php echo $image; ?> <?php echo stripslashes($row['it_name']); ?></a>
|
||||
<?php if($od['od_tax_flag'] && $row['ct_notax']) echo '[비과세상품]'; ?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
<td class="td_itopt_tl">
|
||||
<?php echo $opt['ct_option']; ?>
|
||||
</td>
|
||||
<td class="td_mngsmall"><?php echo $opt['ct_status']; ?></td>
|
||||
<td class="td_cntsmall"><?php echo $opt['ct_qty']; ?></td>
|
||||
<td class="td_num"><?php echo number_format($opt_price); ?></td>
|
||||
<td class="td_num"><?php echo number_format($ct_price['stotal']); ?></td>
|
||||
<td class="td_num"><?php echo number_format($opt['cp_price']); ?></td>
|
||||
<td class="td_num"><?php echo number_format($ct_point['stotal']); ?></td>
|
||||
<td class="td_sendcost_by"><?php echo $ct_send_cost; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
17
adm/shop_admin/ajax.skinfile.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
if($type == 'mobile') {
|
||||
if(preg_match('#^theme/(.+)$#', $dir, $match))
|
||||
$skin_dir = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
|
||||
else
|
||||
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$dir;
|
||||
} else {
|
||||
if(preg_match('#^theme/(.+)$#', $dir, $match))
|
||||
$skin_dir = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
|
||||
else
|
||||
$skin_dir = G5_PATH.'/'.G5_SKIN_DIR.'/shop/'.$dir;
|
||||
}
|
||||
|
||||
echo get_list_skin_options("^list.[0-9]+\.skin\.php", $skin_dir, $sval);
|
||||
?>
|
||||
164
adm/shop_admin/bannerform.php
Normal file
@ -0,0 +1,164 @@
|
||||
<?php
|
||||
$sub_menu = '500500';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$html_title = '배너';
|
||||
$g5['title'] = $html_title.'관리';
|
||||
|
||||
if ($w=="u")
|
||||
{
|
||||
$html_title .= ' 수정';
|
||||
$sql = " select * from {$g5['g5_shop_banner_table']} where bn_id = '$bn_id' ";
|
||||
$bn = sql_fetch($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$html_title .= ' 입력';
|
||||
$bn['bn_url'] = "http://";
|
||||
$bn['bn_begin_time'] = date("Y-m-d 00:00:00", time());
|
||||
$bn['bn_end_time'] = date("Y-m-d 00:00:00", time()+(60*60*24*31));
|
||||
}
|
||||
|
||||
// 접속기기 필드 추가
|
||||
if(!sql_query(" select bn_device from {$g5['g5_shop_banner_table']} limit 0, 1 ")) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_banner_table']}`
|
||||
ADD `bn_device` varchar(10) not null default '' AFTER `bn_url` ", true);
|
||||
sql_query(" update {$g5['g5_shop_banner_table']} set bn_device = 'pc' ", true);
|
||||
}
|
||||
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
?>
|
||||
|
||||
<form name="fbanner" action="./bannerformupdate.php" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="w" value="<?php echo $w; ?>">
|
||||
<input type="hidden" name="bn_id" value="<?php echo $bn_id; ?>">
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?></caption>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">이미지</th>
|
||||
<td>
|
||||
<input type="file" name="bn_bimg">
|
||||
<?php
|
||||
$bimg_str = "";
|
||||
$bimg = G5_DATA_PATH."/banner/{$bn['bn_id']}";
|
||||
if (file_exists($bimg) && $bn['bn_id']) {
|
||||
$size = @getimagesize($bimg);
|
||||
if($size[0] && $size[0] > 750)
|
||||
$width = 750;
|
||||
else
|
||||
$width = $size[0];
|
||||
|
||||
echo '<input type="checkbox" name="bn_bimg_del" value="1" id="bn_bimg_del"> <label for="bn_bimg_del">삭제</label>';
|
||||
$bimg_str = '<img src="'.G5_DATA_URL.'/banner/'.$bn['bn_id'].'" width="'.$width.'">';
|
||||
}
|
||||
if ($bimg_str) {
|
||||
echo '<div class="banner_or_img">';
|
||||
echo $bimg_str;
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_alt">이미지 설명</label></th>
|
||||
<td>
|
||||
<?php echo help("img 태그의 alt, title 에 해당되는 내용입니다.\n배너에 마우스를 오버하면 이미지의 설명이 나옵니다."); ?>
|
||||
<input type="text" name="bn_alt" value="<?php echo $bn['bn_alt']; ?>" id="bn_alt" class="frm_input" size="80">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_url">링크</label></th>
|
||||
<td>
|
||||
<?php echo help("배너클릭시 이동하는 주소입니다."); ?>
|
||||
<input type="text" name="bn_url" size="80" value="<?php echo $bn['bn_url']; ?>" id="bn_url" class="frm_input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_device">접속기기</label></th>
|
||||
<td>
|
||||
<?php echo help('배너를 표시할 접속기기를 선택합니다.'); ?>
|
||||
<select name="bn_device" id="bn_device">
|
||||
<option value="both"<?php echo get_selected($bn['bn_device'], 'both', true); ?>>PC와 모바일</option>
|
||||
<option value="pc"<?php echo get_selected($bn['bn_device'], 'pc'); ?>>PC</option>
|
||||
<option value="mobile"<?php echo get_selected($bn['bn_device'], 'mobile'); ?>>모바일</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_position">출력위치</label></th>
|
||||
<td>
|
||||
<?php echo help("왼쪽 : 쇼핑몰화면 왼쪽에 출력합니다.\n메인 : 쇼핑몰 메인화면(index.php)에만 출력합니다."); ?>
|
||||
<select name="bn_position" id="bn_position">
|
||||
<option value="왼쪽" <?php echo get_selected($bn['bn_position'], '왼쪽'); ?>>왼쪽</option>
|
||||
<option value="메인" <?php echo get_selected($bn['bn_position'], '메인'); ?>>메인</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_border">테두리</label></th>
|
||||
<td>
|
||||
<?php echo help("배너이미지에 테두리를 넣을지를 설정합니다.", 50); ?>
|
||||
<select name="bn_border" id="bn_border">
|
||||
<option value="0" <?php echo get_selected($bn['bn_border'], 0); ?>>사용안함</option>
|
||||
<option value="1" <?php echo get_selected($bn['bn_border'], 1); ?>>사용</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_new_win">새창</label></th>
|
||||
<td>
|
||||
<?php echo help("배너클릭시 새창을 띄울지를 설정합니다.", 50); ?>
|
||||
<select name="bn_new_win" id="bn_new_win">
|
||||
<option value="0" <?php echo get_selected($bn['bn_new_win'], 0); ?>>사용안함</option>
|
||||
<option value="1" <?php echo get_selected($bn['bn_new_win'], 1); ?>>사용</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_begin_time">시작일시</label></th>
|
||||
<td>
|
||||
<?php echo help("배너 게시 시작일시를 설정합니다."); ?>
|
||||
<input type="text" name="bn_begin_time" value="<?php echo $bn['bn_begin_time']; ?>" id="bn_begin_time" class="frm_input" size="21" maxlength="19">
|
||||
<input type="checkbox" name="bn_begin_chk" value="<?php echo date("Y-m-d 00:00:00", time()); ?>" id="bn_begin_chk" onclick="if (this.checked == true) this.form.bn_begin_time.value=this.form.bn_begin_chk.value; else this.form.bn_begin_time.value = this.form.bn_begin_time.defaultValue;">
|
||||
<label for="bn_begin_chk">오늘</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_end_time">종료일시</label></th>
|
||||
<td>
|
||||
<?php echo help("배너 게시 종료일시를 설정합니다."); ?>
|
||||
<input type="text" name="bn_end_time" value="<?php echo $bn['bn_end_time']; ?>" id="bn_end_time" class="frm_input" size=21 maxlength=19>
|
||||
<input type="checkbox" name="bn_end_chk" value="<?php echo date("Y-m-d 23:59:59", time()+60*60*24*31); ?>" id="bn_end_chk" onclick="if (this.checked == true) this.form.bn_end_time.value=this.form.bn_end_chk.value; else this.form.bn_end_time.value = this.form.bn_end_time.defaultValue;">
|
||||
<label for="bn_end_chk">오늘+31일</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="bn_order">출력 순서</label></th>
|
||||
<td>
|
||||
<?php echo help("배너를 출력할 때 순서를 정합니다. 숫자가 작을수록 먼저 출력됩니다."); ?>
|
||||
<?php echo order_select("bn_order", $bn['bn_order']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="확인" class="btn_submit" accesskey="s">
|
||||
<a href="./bannerlist.php">목록</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
74
adm/shop_admin/bannerformupdate.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
$sub_menu = '500500';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
if ($W == 'd')
|
||||
auth_check($auth[$sub_menu], "d");
|
||||
else
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
@mkdir(G5_DATA_PATH."/banner", G5_DIR_PERMISSION);
|
||||
@chmod(G5_DATA_PATH."/banner", G5_DIR_PERMISSION);
|
||||
|
||||
$bn_bimg = $_FILES['bn_bimg']['tmp_name'];
|
||||
$bn_bimg_name = $_FILES['bn_bimg']['name'];
|
||||
|
||||
if ($bn_bimg_del) @unlink(G5_DATA_PATH."/banner/$bn_id");
|
||||
|
||||
if ($w=="")
|
||||
{
|
||||
if (!$bn_bimg_name) alert('배너 이미지를 업로드 하세요.');
|
||||
|
||||
sql_query(" alter table {$g5['g5_shop_banner_table']} auto_increment=1 ");
|
||||
|
||||
$sql = " insert into {$g5['g5_shop_banner_table']}
|
||||
set bn_alt = '$bn_alt',
|
||||
bn_url = '$bn_url',
|
||||
bn_device = '$bn_device',
|
||||
bn_position = '$bn_position',
|
||||
bn_border = '$bn_border',
|
||||
bn_new_win = '$bn_new_win',
|
||||
bn_begin_time = '$bn_begin_time',
|
||||
bn_end_time = '$bn_end_time',
|
||||
bn_time = '$now',
|
||||
bn_hit = '0',
|
||||
bn_order = '$bn_order' ";
|
||||
sql_query($sql);
|
||||
|
||||
$bn_id = mysql_insert_id();
|
||||
}
|
||||
else if ($w=="u")
|
||||
{
|
||||
$sql = " update {$g5['g5_shop_banner_table']}
|
||||
set bn_alt = '$bn_alt',
|
||||
bn_url = '$bn_url',
|
||||
bn_device = '$bn_device',
|
||||
bn_position = '$bn_position',
|
||||
bn_border = '$bn_border',
|
||||
bn_new_win = '$bn_new_win',
|
||||
bn_begin_time = '$bn_begin_time',
|
||||
bn_end_time = '$bn_end_time',
|
||||
bn_order = '$bn_order'
|
||||
where bn_id = '$bn_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
else if ($w=="d")
|
||||
{
|
||||
@unlink(G5_DATA_PATH."/banner/$bn_id");
|
||||
|
||||
$sql = " delete from {$g5['g5_shop_banner_table']} where bn_id = $bn_id ";
|
||||
$result = sql_query($sql);
|
||||
}
|
||||
|
||||
|
||||
if ($w == "" || $w == "u")
|
||||
{
|
||||
if ($_FILES['bn_bimg']['name']) upload_file($_FILES['bn_bimg']['tmp_name'], $bn_id, G5_DATA_PATH."/banner");
|
||||
|
||||
goto_url("./bannerform.php?w=u&bn_id=$bn_id");
|
||||
} else {
|
||||
goto_url("./bannerlist.php");
|
||||
}
|
||||
?>
|
||||
136
adm/shop_admin/bannerlist.php
Normal file
@ -0,0 +1,136 @@
|
||||
<?php
|
||||
$sub_menu = '500500';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '배너관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_banner_table']} ";
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
등록된 배너 <?php echo $total_count; ?>개
|
||||
</div>
|
||||
|
||||
<div class="btn_add01 btn_add">
|
||||
<a href="./bannerform.php">배너추가</a>
|
||||
</div>
|
||||
|
||||
<div class="tbl_head02 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" rowspan="2" id="th_id">ID</th>
|
||||
<th scope="col" id="th_dvc">접속기기</th>
|
||||
<th scope="col" id="th_loc">위치</th>
|
||||
<th scope="col" id="th_st">시작일시</th>
|
||||
<th scope="col" id="th_end">종료일시</th>
|
||||
<th scope="col" id="th_odr">출력순서</th>
|
||||
<th scope="col" id="th_hit">조회</th>
|
||||
<th scope="col" id="th_mng">관리</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="col" colspan="7" id="th_img">이미지</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$sql = " select * from {$g5['g5_shop_banner_table']}
|
||||
order by bn_order, bn_id desc
|
||||
limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=mysql_fetch_array($result); $i++) {
|
||||
// 테두리 있는지
|
||||
$bn_border = $row['bn_border'];
|
||||
// 새창 띄우기인지
|
||||
$bn_new_win = ($row['bn_new_win']) ? 'target="_blank"' : '';
|
||||
|
||||
$bimg = G5_DATA_PATH.'/banner/'.$row['bn_id'];
|
||||
if(file_exists($bimg)) {
|
||||
$size = @getimagesize($bimg);
|
||||
if($size[0] && $size[0] > 800)
|
||||
$width = 800;
|
||||
else
|
||||
$width = $size[0];
|
||||
|
||||
$bn_img = "";
|
||||
if ($row['bn_url'] && $row['bn_url'] != "http://")
|
||||
$bn_img .= '<a href="'.$row['bn_url'].'" '.$bn_new_win.'>';
|
||||
$bn_img .= '<img src="'.G5_DATA_URL.'/banner/'.$row['bn_id'].'" width="'.$width.'" alt="'.$row['bn_alt'].'"></a>';
|
||||
}
|
||||
|
||||
switch($row['bn_device']) {
|
||||
case 'pc':
|
||||
$bn_device = 'PC';
|
||||
break;
|
||||
case 'mobile':
|
||||
$bn_device = '모바일';
|
||||
break;
|
||||
default:
|
||||
$bn_device = 'PC와 모바일';
|
||||
break;
|
||||
}
|
||||
|
||||
$bn_begin_time = substr($row['bn_begin_time'], 2, 14);
|
||||
$bn_end_time = substr($row['bn_end_time'], 2, 14);
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td headers="th_id" rowspan="2" class="td_num"><?php echo $row['bn_id']; ?></td>
|
||||
<td headers="th_dvc"><?php echo $bn_device; ?></td>
|
||||
<td headers="th_loc"><?php echo $row['bn_position']; ?></td>
|
||||
<td headers="th_st" class="td_datetime"><?php echo $bn_begin_time; ?></td>
|
||||
<td headers="th_end" class="td_datetime"><?php echo $bn_end_time; ?></td>
|
||||
<td headers="th_odr" class="td_num"><?php echo $row['bn_order']; ?></td>
|
||||
<td headers="th_hit" class="td_num"><?php echo $row['bn_hit']; ?></td>
|
||||
<td headers="th_mng" class="td_mngsmall">
|
||||
<a href="./bannerform.php?w=u&bn_id=<?php echo $row['bn_id']; ?>">수정</a></li>
|
||||
<a href="./bannerformupdate.php?w=d&bn_id=<?php echo $row['bn_id']; ?>" onclick="return delete_confirm();">삭제</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td headers="th_img" colspan="7" class="td_img_view sbn_img">
|
||||
<div class="sbn_image"><?php echo $bn_img; ?></div>
|
||||
<button type="button" class="sbn_img_view btn_frmline">이미지확인</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
if ($i == 0) {
|
||||
echo '<tr><td colspan="8" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&page="); ?>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$(".sbn_img_view").on("click", function() {
|
||||
$(this).closest(".td_img_view").find(".sbn_image").slideToggle();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
562
adm/shop_admin/categoryform.php
Normal file
@ -0,0 +1,562 @@
|
||||
<?php
|
||||
$sub_menu = '400200';
|
||||
include_once('./_common.php');
|
||||
include_once(G5_EDITOR_LIB);
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_category_table']} ";
|
||||
if ($is_admin != 'super')
|
||||
$sql_common .= " where ca_mb_id = '{$member['mb_id']}' ";
|
||||
|
||||
if ($w == "")
|
||||
{
|
||||
if ($is_admin != 'super' && !$ca_id)
|
||||
alert("최고관리자만 1단계 분류를 추가할 수 있습니다.");
|
||||
|
||||
$len = strlen($ca_id);
|
||||
if ($len == 10)
|
||||
alert("분류를 더 이상 추가할 수 없습니다.\\n\\n5단계 분류까지만 가능합니다.");
|
||||
|
||||
$len2 = $len + 1;
|
||||
|
||||
$sql = " select MAX(SUBSTRING(ca_id,$len2,2)) as max_subid from {$g5['g5_shop_category_table']}
|
||||
where SUBSTRING(ca_id,1,$len) = '$ca_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
$subid = base_convert($row['max_subid'], 36, 10);
|
||||
$subid += 36;
|
||||
if ($subid >= 36 * 36)
|
||||
{
|
||||
//alert("분류를 더 이상 추가할 수 없습니다.");
|
||||
// 빈상태로
|
||||
$subid = " ";
|
||||
}
|
||||
$subid = base_convert($subid, 10, 36);
|
||||
$subid = substr("00" . $subid, -2);
|
||||
$subid = $ca_id . $subid;
|
||||
|
||||
$sublen = strlen($subid);
|
||||
|
||||
if ($ca_id) // 2단계이상 분류
|
||||
{
|
||||
$sql = " select * from {$g5['g5_shop_category_table']} where ca_id = '$ca_id' ";
|
||||
$ca = sql_fetch($sql);
|
||||
$html_title = $ca['ca_name'] . " 하위분류추가";
|
||||
$ca['ca_name'] = "";
|
||||
}
|
||||
else // 1단계 분류
|
||||
{
|
||||
$html_title = "1단계분류추가";
|
||||
$ca['ca_use'] = 1;
|
||||
$ca['ca_explan_html'] = 1;
|
||||
$ca['ca_img_width'] = $default['de_simg_width'];
|
||||
$ca['ca_img_height'] = $default['de_simg_height'];
|
||||
$ca['ca_mobile_img_width'] = $default['de_simg_width'];
|
||||
$ca['ca_mobile_img_height'] = $default['de_simg_height'];
|
||||
$ca['ca_list_mod'] = 3;
|
||||
$ca['ca_list_row'] = 5;
|
||||
$ca['ca_mobile_list_mod'] = 3;
|
||||
$ca['ca_mobile_list_row'] = 5;
|
||||
$ca['ca_stock_qty'] = 99999;
|
||||
}
|
||||
$ca['ca_skin'] = "list.10.skin.php";
|
||||
$ca['ca_mobile_skin'] = "list.10.skin.php";
|
||||
}
|
||||
else if ($w == "u")
|
||||
{
|
||||
$sql = " select * from {$g5['g5_shop_category_table']} where ca_id = '$ca_id' ";
|
||||
$ca = sql_fetch($sql);
|
||||
if (!$ca['ca_id'])
|
||||
alert("자료가 없습니다.");
|
||||
|
||||
$html_title = $ca['ca_name'] . " 수정";
|
||||
$ca['ca_name'] = get_text($ca['ca_name']);
|
||||
}
|
||||
|
||||
$g5['title'] = $html_title;
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$pg_anchor ='<ul class="anchor">
|
||||
<li><a href="#anc_scatefrm_basic">필수입력</a></li>
|
||||
<li><a href="#anc_scatefrm_optional">선택입력</a></li>
|
||||
<li><a href="#anc_scatefrm_extra">여분필드</a></li>';
|
||||
if ($w == 'u') $pg_anchor .= '<li><a href="#frm_etc">기타설정</a></li>';
|
||||
$pg_anchor .= '</ul>';
|
||||
|
||||
$frm_submit = '<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="확인" class="btn_submit" accesskey="s">
|
||||
<a href="./categorylist.php?'.$qstr.'">목록</a>
|
||||
</div>';
|
||||
|
||||
// 쿠폰 적용 불가 설정 필드 추가
|
||||
if(!sql_query(" select ca_nocoupon from {$g5['g5_shop_category_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}`
|
||||
ADD `ca_nocoupon` tinyint(4) NOT NULL DEFAULT '0' AFTER `ca_adult_use` ", true);
|
||||
}
|
||||
|
||||
// 스킨 디렉토리 필드 추가
|
||||
if(!sql_query(" select ca_skin_dir from {$g5['g5_shop_category_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}`
|
||||
ADD `ca_skin_dir` varchar(255) NOT NULL DEFAULT '' AFTER `ca_name`,
|
||||
ADD `ca_mobile_skin_dir` varchar(255) NOT NULL DEFAULT '' AFTER `ca_skin_dir` ", true);
|
||||
}
|
||||
|
||||
// 분류 출력순서 필드 추가
|
||||
if(!sql_query(" select ca_order from {$g5['g5_shop_category_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}`
|
||||
ADD `ca_order` int(11) NOT NULL DEFAULT '0' AFTER `ca_name` ", true);
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}` ADD INDEX(`ca_order`) ", true);
|
||||
}
|
||||
|
||||
// 모바일 상품 출력줄수 필드 추가
|
||||
if(!sql_query(" select ca_mobile_list_row from {$g5['g5_shop_category_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_category_table']}`
|
||||
ADD `ca_mobile_list_row` int(11) NOT NULL DEFAULT '0' AFTER `ca_mobile_list_mod` ", true);
|
||||
}
|
||||
|
||||
// 스킨 Path
|
||||
if(!$ca['ca_skin_dir'])
|
||||
$g5_shop_skin_path = G5_SHOP_SKIN_PATH;
|
||||
else {
|
||||
if(preg_match('#^theme/(.+)$#', $ca['ca_skin_dir'], $match))
|
||||
$g5_shop_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
|
||||
else
|
||||
$g5_shop_skin_path = G5_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_skin_dir'];
|
||||
}
|
||||
|
||||
if(!$ca['ca_mobile_skin_dir'])
|
||||
$g5_mshop_skin_path = G5_MSHOP_SKIN_PATH;
|
||||
else {
|
||||
if(preg_match('#^theme/(.+)$#', $ca['ca_mobile_skin_dir'], $match))
|
||||
$g5_mshop_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
|
||||
else
|
||||
$g5_mshop_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_mobile_skin_dir'];
|
||||
}
|
||||
?>
|
||||
|
||||
<form name="fcategoryform" action="./categoryformupdate.php" onsubmit="return fcategoryformcheck(this);" method="post" enctype="multipart/form-data">
|
||||
|
||||
<input type="hidden" name="codedup" value="<?php echo $default['de_code_dup_use']; ?>">
|
||||
<input type="hidden" name="w" value="<?php echo $w; ?>">
|
||||
<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="ca_explan_html" value="<?php echo $ca['ca_explan_html']; ?>">
|
||||
|
||||
<section id="anc_scatefrm_basic">
|
||||
<h2 class="h2_frm">필수입력</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<caption>분류 추가 필수입력</caption>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_id">분류코드</label></th>
|
||||
<td>
|
||||
<?php if ($w == "") { ?>
|
||||
<?php echo help("자동으로 보여지는 분류코드를 사용하시길 권해드리지만 직접 입력한 값으로도 사용할 수 있습니다.\n분류코드는 나중에 수정이 되지 않으므로 신중하게 결정하여 사용하십시오.\n\n분류코드는 2자리씩 10자리를 사용하여 5단계를 표현할 수 있습니다.\n0~z까지 입력이 가능하며 한 분류당 최대 1296가지를 표현할 수 있습니다.\n그러므로 총 3656158440062976가지의 분류를 사용할 수 있습니다."); ?>
|
||||
<input type="text" name="ca_id" value="<?php echo $subid; ?>" id="ca_id" required class="required frm_input" size="<?php echo $sublen; ?>" maxlength="<?php echo $sublen; ?>">
|
||||
<!-- <?php if ($default['de_code_dup_use']) { ?><a href="javascript:;" onclick="codedupcheck(document.getElementById('ca_id').value)">코드 중복검사</a><?php } ?> -->
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="ca_id" value="<?php echo $ca['ca_id']; ?>">
|
||||
<span class="frm_ca_id"><?php echo $ca['ca_id']; ?></span>
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/list.php?ca_id=<?php echo $ca_id; ?>" class="btn_frmline">미리보기</a>
|
||||
<a href="./categoryform.php?ca_id=<?php echo $ca_id; ?>&<?php echo $qstr; ?>" class="btn_frmline">하위분류 추가</a>
|
||||
<a href="./itemlist.php?sca=<?php echo $ca['ca_id']; ?>" class="btn_frmline">상품리스트</a>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_name">분류명</label></th>
|
||||
<td><input type="text" name="ca_name" value="<?php echo $ca['ca_name']; ?>" id="ca_name" size="38" required class="required frm_input"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_order">출력순서</label></th>
|
||||
<td>
|
||||
<?php echo help("숫자가 작을 수록 상위에 출력됩니다. 음수 입력도 가능하며 입력 가능 범위는 -2147483648 부터 2147483647 까지입니다.\n<b>입력하지 않으면 자동으로 출력됩니다.</b>"); ?>
|
||||
<input type="text" name="ca_order" value="<?php echo $ca['ca_order']; ?>" id="ca_order" class="frm_input" size="12">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php if ($is_admin == 'super') { ?><label for="ca_mb_id"><?php } ?>관리 회원아이디<?php if ($is_admin == 'super') { ?></label><?php } ?></th>
|
||||
<td>
|
||||
<?php if ($is_admin == 'super') { ?>
|
||||
<input type="text" name="ca_mb_id" value="<?php echo $ca['ca_mb_id']; ?>" id="ca_mb_id" class="frm_input" maxlength="20">
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="ca_mb_id" value="<?php echo $ca['ca_mb_id']; ?>">
|
||||
<?php echo $ca['ca_mb_id']; ?>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_skin_dir">PC용 스킨명</label></th>
|
||||
<td colspan="3">
|
||||
<?php echo get_skin_select('shop', 'ca_skin_dir', 'ca_skin_dir', $ca['ca_skin_dir']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_mobile_skin_dir">모바일용 스킨명</label></th>
|
||||
<td colspan="3">
|
||||
<?php echo get_mobile_skin_select('shop', 'ca_mobile_skin_dir', 'ca_mobile_skin_dir', $ca['ca_mobile_skin_dir']); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">본인확인 체크</th>
|
||||
<td>
|
||||
<input type="radio" name="ca_cert_use" value="1" id="ca_cert_use_yes" <?php if($ca['ca_cert_use']) echo 'checked="checked"'; ?>>
|
||||
<label for="ca_cert_use_yes">사용함</label>
|
||||
<input type="radio" name="ca_cert_use" value="0" id="ca_cert_use_no" <?php if(!$ca['ca_cert_use']) echo 'checked="checked"'; ?>>
|
||||
<label for="ca_cert_use_no">사용안함</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">성인인증 체크</th>
|
||||
<td>
|
||||
<input type="radio" name="ca_adult_use" value="1" id="ca_adult_use_yes" <?php if($ca['ca_adult_use']) echo 'checked="checked"'; ?>>
|
||||
<label for="ca_adult_use_yes">사용함</label>
|
||||
<input type="radio" name="ca_adult_use" value="0" id="ca_adult_use_no" <?php if(!$ca['ca_adult_use']) echo 'checked="checked"'; ?>>
|
||||
<label for="ca_adult_use_no">사용안함</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_skin">출력스킨</label></th>
|
||||
<td>
|
||||
<?php echo help('기본으로 제공하는 스킨은 '.str_replace(G5_PATH.'/', '', $g5_shop_skin_path).'/list.*.skin.php 입니다.'); ?>
|
||||
<select id="ca_skin" name="ca_skin" required class="required">
|
||||
<?php echo get_list_skin_options("^list.[0-9]+\.skin\.php", $g5_shop_skin_path, $ca['ca_skin']); ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_img_width">출력이미지 폭</label></th>
|
||||
<td>
|
||||
<?php echo help("쇼핑몰환경설정 > 이미지(소) 넓이가 기본값으로 설정됩니다.\n".G5_SHOP_URL."/list.php에서 출력되는 이미지의 폭입니다."); ?>
|
||||
<input type="text" name="ca_img_width" value="<?php echo $ca['ca_img_width']; ?>" id="ca_img_width" required class="required frm_input" size="5" > 픽셀
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_img_height">출력이미지 높이</label></th>
|
||||
<td>
|
||||
<?php echo help("쇼핑몰환경설정 > 이미지(소) 높이가 기본값으로 설정됩니다.\n".G5_SHOP_URL."/list.php에서 출력되는 이미지의 높이입니다."); ?>
|
||||
<input type="text" name="ca_img_height" value="<?php echo $ca['ca_img_height']; ?>" id="ca_img_height" required class="required frm_input" size="5" > 픽셀
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_list_mod">1줄당 이미지 수</label></th>
|
||||
<td>
|
||||
<?php echo help("한 줄에 설정한 값만큼의 상품을 출력하지만 스킨에 따라 한 줄에 하나의 상품만 출력할 수도 있습니다."); ?>
|
||||
<input type="text" name="ca_list_mod" size="3" value="<?php echo $ca['ca_list_mod']; ?>" id="ca_list_mod" required class="required frm_input"> 개
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_list_row">이미지 줄 수</label></th>
|
||||
<td>
|
||||
<?php echo help("한 페이지에 출력할 이미지 줄 수를 설정합니다.\n한 페이지에서 표시하는 상품수는 (1줄당 이미지 수 x 줄 수) 입니다."); ?>
|
||||
<input type="text" name="ca_list_row" value='<?php echo $ca['ca_list_row']; ?>' id="ca_list_row" required class="required frm_input" size="3"> 줄
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_mobile_skin">모바일 출력스킨</label></th>
|
||||
<td>
|
||||
<?php echo help('기본으로 제공하는 스킨은 '.str_replace(G5_PATH.'/', '', $g5_mshop_skin_path).'/list.*.skin.php 입니다.'); ?>
|
||||
<select id="ca_mobile_skin" name="ca_mobile_skin" required class="required">
|
||||
<?php echo get_list_skin_options("^list.[0-9]+\.skin\.php", $g5_mshop_skin_path, $ca['ca_mobile_skin']); ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_mobile_img_width">모바일 출력이미지 폭</label></th>
|
||||
<td>
|
||||
<?php echo help("쇼핑몰환경설정 > 이미지(소) 넓이가 기본값으로 설정됩니다.\n".G5_SHOP_URL."/list.php에서 출력되는 이미지의 폭입니다."); ?>
|
||||
<input type="text" name="ca_mobile_img_width" value="<?php echo $ca['ca_mobile_img_width']; ?>" id="ca_mobile_img_width" required class="required frm_input" size="5" > 픽셀
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_mobile_img_height">모바일 출력이미지 높이</label></th>
|
||||
<td>
|
||||
<?php echo help("쇼핑몰환경설정 > 이미지(소) 높이가 기본값으로 설정됩니다.\n".G5_SHOP_URL."/list.php에서 출력되는 이미지의 높이입니다."); ?>
|
||||
<input type="text" name="ca_mobile_img_height" value="<?php echo $ca['ca_mobile_img_height']; ?>" id="ca_mobile_img_height" required class="required frm_input" size="5" > 픽셀
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_mobile_list_mod">모바일 1줄당 이미지 수</label></th>
|
||||
<td>
|
||||
<?php echo help("한 줄에 설정한 값만큼의 상품을 출력하지만 스킨에 따라 한 줄에 하나의 상품만 출력할 수도 있습니다."); ?>
|
||||
<input type="text" name="ca_mobile_list_mod" value='<?php echo $ca['ca_mobile_list_mod']; ?>' id="ca_mobile_list_mod" required class="required frm_input" size="3"> 개
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_mobile_list_row">모바일 이미지 줄 수</label></th>
|
||||
<td>
|
||||
<?php echo help("한 페이지에 출력할 이미지 줄 수를 설정합니다.\n한 페이지에서 표시하는 상품수는 (1줄당 이미지 수 x 줄 수) 입니다."); ?>
|
||||
<input type="text" name="ca_mobile_list_row" value='<?php echo $ca['ca_mobile_list_row']; ?>' id="ca_mobile_list_row" required class="required frm_input" size="3"> 줄
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_stock_qty">재고수량</label></th>
|
||||
<td>
|
||||
<?php echo help("상품의 기본재고 수량을 설정합니다.\n재고를 사용하지 않는다면 숫자를 크게 입력하여 주십시오. 예) 999999"); ?>
|
||||
<input type="text" name="ca_stock_qty" size="10" value="<?php echo $ca['ca_stock_qty']; ?>" id="ca_stock_qty" class="frm_input"> 개
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_sell_email">판매자 E-mail</label></th>
|
||||
<td>
|
||||
<?php echo help("운영자와 판매자가 다른 경우에 사용합니다.\n이 분류에 속한 상품을 등록할 경우에 기본값으로 입력됩니다."); ?>
|
||||
<input type="text" name="ca_sell_email" size="40" value="<?php echo $ca['ca_sell_email']; ?>" id="ca_sell_email" class="frm_input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_use">판매가능</label></th>
|
||||
<td>
|
||||
<?php echo help("재고가 없거나 일시적으로 판매를 중단하시려면 체크 해제하십시오.\n체크 해제하시면 상품 출력을 하지 않으며, 주문도 받지 않습니다."); ?>
|
||||
<input type="checkbox" name="ca_use" <?php echo ($ca['ca_use']) ? "checked" : ""; ?> value="1" id="ca_use">
|
||||
예
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_nocoupon">쿠폰적용안함</label></th>
|
||||
<td>
|
||||
<?php echo help("설정에 체크하시면 쿠폰생성 때 분류 검색 결과에 노출되지 않습니다."); ?>
|
||||
<input type="checkbox" name="ca_nocoupon" <?php echo ($ca['ca_nocoupon']) ? "checked" : ""; ?> value="1" id="ca_nocoupon">
|
||||
예
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php echo preg_replace('#</div>$#i', '<button type="button" class="shop_category">테마설정 가져오기</button></div>', $frm_submit); ?>
|
||||
|
||||
<section id="anc_scatefrm_optional">
|
||||
<h2 class="h2_frm">선택 입력</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<caption>분류 추가 선택입력</caption>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_include_head">상단파일경로</label></th>
|
||||
<td>
|
||||
<?php echo help("입력하지 않으면 기본 상단 파일을 사용합니다.<br>상단 내용과 달리 PHP 코드를 사용할 수 있습니다."); ?>
|
||||
<input type="text" name="ca_include_head" value="<?php echo $ca['ca_include_head']; ?>" id="ca_include_head" class="frm_input" size="60">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ca_include_tail">하단 파일 경로</label></th>
|
||||
<td>
|
||||
<?php echo help("입력하지 않으면 기본 하단 파일을 사용합니다.<br>하단 내용과 달리 PHP 코드를 사용할 수 있습니다."); ?>
|
||||
<input type="text" name="ca_include_tail" value="<?php echo $ca['ca_include_tail']; ?>" id="ca_include_tail" class="frm_input" size="60">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">상단내용</th>
|
||||
<td>
|
||||
<?php echo help("상품리스트 페이지 상단에 출력하는 HTML 내용입니다."); ?>
|
||||
<?php echo editor_html('ca_head_html', get_text($ca['ca_head_html'], 0)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">하단내용</th>
|
||||
<td>
|
||||
<?php echo help("상품리스트 페이지 하단에 출력하는 HTML 내용입니다."); ?>
|
||||
<?php echo editor_html('ca_tail_html', get_text($ca['ca_tail_html'], 0)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">모바일 상단내용</th>
|
||||
<td>
|
||||
<?php echo help("상품리스트 페이지 상단에 출력하는 HTML 내용입니다."); ?>
|
||||
<?php echo editor_html('ca_mobile_head_html', get_text($ca['ca_mobile_head_html'], 0)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">모바일 하단내용</th>
|
||||
<td>
|
||||
<?php echo help("상품리스트 페이지 하단에 출력하는 HTML 내용입니다."); ?>
|
||||
<?php echo editor_html('ca_mobile_tail_html', get_text($ca['ca_mobile_tail_html'], 0)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php echo $frm_submit; ?>
|
||||
|
||||
<section id="anc_scatefrm_extra">
|
||||
<h2>여분필드 설정</h2>
|
||||
<?php echo $pg_anchor ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_3">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<?php for ($i=1; $i<=10; $i++) { ?>
|
||||
<tr>
|
||||
<th scope="row">여분필드<?php echo $i ?></th>
|
||||
<td class="td_extra">
|
||||
<label for="ca_<?php echo $i ?>_subj">여분필드 <?php echo $i ?> 제목</label>
|
||||
<input type="text" name="ca_<?php echo $i ?>_subj" id="ca_<?php echo $i ?>_subj" value="<?php echo get_text($ca['ca_'.$i.'_subj']) ?>" class="frm_input">
|
||||
<label for="ca_<?php echo $i ?>">여분필드 <?php echo $i ?> 값</label>
|
||||
<input type="text" name="ca_<?php echo $i ?>" value="<?php echo get_text($ca['ca_'.$i]) ?>" id="ca_<?php echo $i ?>" class="frm_input">
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php echo $frm_submit; ?>
|
||||
|
||||
<?php if ($w == "u") { ?>
|
||||
<section id="frm_etc">
|
||||
<h2 class="h2_frm">기타설정</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<caption>분류 추가 기타설정</caption>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">하위분류</th>
|
||||
<td>
|
||||
<?php echo help("이 분류의 코드가 10 이라면 10 으로 시작하는 하위분류의 설정값을 이 분류와 동일하게 설정합니다.\n<strong>이 작업은 실행 후 복구할 수 없습니다.</strong>"); ?>
|
||||
<label for="sub_category">이 분류의 하위분류 설정을, 이 분류와 동일하게 일괄수정</label>
|
||||
<input type="checkbox" name="sub_category" value="1" id="sub_category" onclick="if (this.checked) if (confirm('이 분류에 속한 하위 분류의 속성을 똑같이 변경합니다.\n\n이 작업은 되돌릴 방법이 없습니다.\n\n그래도 변경하시겠습니까?')) return ; this.checked = false;">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
<?php echo $frm_submit; ?>
|
||||
<?php } ?>
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
<?php if ($w == 'u') { ?>
|
||||
$(".banner_or_img").addClass("sit_wimg");
|
||||
$(function() {
|
||||
$(".sit_wimg_view").bind("click", function() {
|
||||
var sit_wimg_id = $(this).attr("id").split("_");
|
||||
var $img_display = $("#"+sit_wimg_id[1]);
|
||||
|
||||
$img_display.toggle();
|
||||
|
||||
if($img_display.is(":visible")) {
|
||||
$(this).text($(this).text().replace("확인", "닫기"));
|
||||
} else {
|
||||
$(this).text($(this).text().replace("닫기", "확인"));
|
||||
}
|
||||
|
||||
var $img = $("#"+sit_wimg_id[1]).children("img");
|
||||
var width = $img.width();
|
||||
var height = $img.height();
|
||||
if(width > 700) {
|
||||
var img_width = 700;
|
||||
var img_height = Math.round((img_width * height) / width);
|
||||
|
||||
$img.width(img_width).height(img_height);
|
||||
}
|
||||
});
|
||||
$(".sit_wimg_close").bind("click", function() {
|
||||
var $img_display = $(this).parents(".banner_or_img");
|
||||
var id = $img_display.attr("id");
|
||||
$img_display.toggle();
|
||||
var $button = $("#ca_"+id+"_view");
|
||||
$button.text($button.text().replace("닫기", "확인"));
|
||||
});
|
||||
});
|
||||
<?php } ?>
|
||||
|
||||
function fcategoryformcheck(f)
|
||||
{
|
||||
if (f.w.value == "") {
|
||||
var error = "";
|
||||
$.ajax({
|
||||
url: "./ajax.ca_id.php",
|
||||
type: "POST",
|
||||
data: {
|
||||
"ca_id": f.ca_id.value
|
||||
},
|
||||
dataType: "json",
|
||||
async: false,
|
||||
cache: false,
|
||||
success: function(data, textStatus) {
|
||||
error = data.error;
|
||||
}
|
||||
});
|
||||
|
||||
if (error) {
|
||||
alert(error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
<?php echo get_editor_js('ca_head_html'); ?>
|
||||
<?php echo get_editor_js('ca_tail_html'); ?>
|
||||
<?php echo get_editor_js('ca_mobile_head_html'); ?>
|
||||
<?php echo get_editor_js('ca_mobile_tail_html'); ?>
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$(".shop_category").on("click", function() {
|
||||
if(!confirm("현재 테마의 스킨, 이미지 사이즈 등의 설정을 적용하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "../theme_config_load.php",
|
||||
cache: false,
|
||||
async: false,
|
||||
data: { type: 'shop_category' },
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.error) {
|
||||
alert(data.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
$.each(data, function(key, val) {
|
||||
if(key == "error")
|
||||
return true;
|
||||
|
||||
$("#"+key).val(val);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/*document.fcategoryform.ca_name.focus(); 포커스 해제*/
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
156
adm/shop_admin/categoryformupdate.php
Normal file
@ -0,0 +1,156 @@
|
||||
<?php
|
||||
$sub_menu = '400200';
|
||||
include_once('./_common.php');
|
||||
|
||||
if ($file = $_POST['ca_include_head']) {
|
||||
if (!preg_match("/\.(php|htm[l]?)$/i", $file)) {
|
||||
alert("상단 파일 경로가 php, html 파일이 아닙니다.");
|
||||
}
|
||||
}
|
||||
|
||||
if ($file = $_POST['ca_include_tail']) {
|
||||
if (!preg_match("/\.(php|htm[l]?)$/i", $file)) {
|
||||
alert("하단 파일 경로가 php, html 파일이 아닙니다.");
|
||||
}
|
||||
}
|
||||
|
||||
if ($w == "u" || $w == "d")
|
||||
check_demo();
|
||||
|
||||
auth_check($auth[$sub_menu], "d");
|
||||
|
||||
if ($w == 'd' && $is_admin != 'super')
|
||||
alert("최고관리자만 분류를 삭제할 수 있습니다.");
|
||||
|
||||
if ($w == "" || $w == "u")
|
||||
{
|
||||
if ($ca_mb_id)
|
||||
{
|
||||
$sql = " select mb_id from {$g5['member_table']} where mb_id = '$ca_mb_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row['mb_id'])
|
||||
alert("\'$ca_mb_id\' 은(는) 존재하는 회원아이디가 아닙니다.");
|
||||
}
|
||||
}
|
||||
|
||||
$sql_common = " ca_order = '$ca_order',
|
||||
ca_skin_dir = '$ca_skin_dir',
|
||||
ca_mobile_skin_dir = '$ca_mobile_skin_dir',
|
||||
ca_skin = '$ca_skin',
|
||||
ca_mobile_skin = '$ca_mobile_skin',
|
||||
ca_img_width = '$ca_img_width',
|
||||
ca_img_height = '$ca_img_height',
|
||||
ca_list_mod = '$ca_list_mod',
|
||||
ca_list_row = '$ca_list_row',
|
||||
ca_mobile_img_width = '$ca_mobile_img_width',
|
||||
ca_mobile_img_height = '$ca_mobile_img_height',
|
||||
ca_mobile_list_mod = '$ca_mobile_list_mod',
|
||||
ca_mobile_list_row = '$ca_mobile_list_row',
|
||||
ca_sell_email = '$ca_sell_email',
|
||||
ca_use = '$ca_use',
|
||||
ca_stock_qty = '$ca_stock_qty',
|
||||
ca_explan_html = '$ca_explan_html',
|
||||
ca_head_html = '$ca_head_html',
|
||||
ca_tail_html = '$ca_tail_html',
|
||||
ca_mobile_head_html = '$ca_mobile_head_html',
|
||||
ca_mobile_tail_html = '$ca_mobile_tail_html',
|
||||
ca_include_head = '$ca_include_head',
|
||||
ca_include_tail = '$ca_include_tail',
|
||||
ca_mb_id = '$ca_mb_id',
|
||||
ca_cert_use = '$ca_cert_use',
|
||||
ca_adult_use = '$ca_adult_use',
|
||||
ca_nocoupon = '$ca_nocoupon',
|
||||
ca_1_subj = '$ca_1_subj',
|
||||
ca_2_subj = '$ca_2_subj',
|
||||
ca_3_subj = '$ca_3_subj',
|
||||
ca_4_subj = '$ca_4_subj',
|
||||
ca_5_subj = '$ca_5_subj',
|
||||
ca_6_subj = '$ca_6_subj',
|
||||
ca_7_subj = '$ca_7_subj',
|
||||
ca_8_subj = '$ca_8_subj',
|
||||
ca_9_subj = '$ca_9_subj',
|
||||
ca_10_subj = '$ca_10_subj',
|
||||
ca_1 = '$ca_1',
|
||||
ca_2 = '$ca_2',
|
||||
ca_3 = '$ca_3',
|
||||
ca_4 = '$ca_4',
|
||||
ca_5 = '$ca_5',
|
||||
ca_6 = '$ca_6',
|
||||
ca_7 = '$ca_7',
|
||||
ca_8 = '$ca_8',
|
||||
ca_9 = '$ca_9',
|
||||
ca_10 = '$ca_10' ";
|
||||
|
||||
|
||||
if ($w == "")
|
||||
{
|
||||
if (!trim($ca_id))
|
||||
alert("분류 코드가 없으므로 분류를 추가하실 수 없습니다.");
|
||||
|
||||
// 소문자로 변환
|
||||
$ca_id = strtolower($ca_id);
|
||||
|
||||
$sql = " insert {$g5['g5_shop_category_table']}
|
||||
set ca_id = '$ca_id',
|
||||
ca_name = '$ca_name',
|
||||
$sql_common ";
|
||||
sql_query($sql);
|
||||
}
|
||||
else if ($w == "u")
|
||||
{
|
||||
$sql = " update {$g5['g5_shop_category_table']}
|
||||
set ca_name = '$ca_name',
|
||||
$sql_common
|
||||
where ca_id = '$ca_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 하위분류를 똑같은 설정으로 반영
|
||||
if ($sub_category) {
|
||||
$len = strlen($ca_id);
|
||||
$sql = " update {$g5['g5_shop_category_table']}
|
||||
set $sql_common
|
||||
where SUBSTRING(ca_id,1,$len) = '$ca_id' ";
|
||||
if ($is_admin != 'super')
|
||||
$sql .= " and ca_mb_id = '{$member['mb_id']}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
else if ($w == "d")
|
||||
{
|
||||
// 분류의 길이
|
||||
$len = strlen($ca_id);
|
||||
|
||||
$sql = " select COUNT(*) as cnt from {$g5['g5_shop_category_table']}
|
||||
where SUBSTRING(ca_id,1,$len) = '$ca_id'
|
||||
and ca_id <> '$ca_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
if ($row['cnt'] > 0)
|
||||
alert("이 분류에 속한 하위 분류가 있으므로 삭제 할 수 없습니다.\\n\\n하위분류를 우선 삭제하여 주십시오.");
|
||||
|
||||
$str = $comma = "";
|
||||
$sql = " select it_id from {$g5['g5_shop_item_table']} where ca_id = '$ca_id' ";
|
||||
$result = sql_query($sql);
|
||||
$i=0;
|
||||
while ($row = mysql_fetch_array($result))
|
||||
{
|
||||
$i++;
|
||||
if ($i % 10 == 0) $str .= "\\n";
|
||||
$str .= "$comma{$row['it_id']}";
|
||||
$comma = " , ";
|
||||
}
|
||||
|
||||
if ($str)
|
||||
alert("이 분류와 관련된 상품이 총 {$i} 건 존재하므로 상품을 삭제한 후 분류를 삭제하여 주십시오.\\n\\n$str");
|
||||
|
||||
// 분류 삭제
|
||||
$sql = " delete from {$g5['g5_shop_category_table']} where ca_id = '$ca_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
if ($w == "" || $w == "u")
|
||||
{
|
||||
goto_url("./categoryform.php?w=u&ca_id=$ca_id&$qstr");
|
||||
} else {
|
||||
goto_url("./categorylist.php?$qstr");
|
||||
}
|
||||
?>
|
||||
287
adm/shop_admin/categorylist.php
Normal file
@ -0,0 +1,287 @@
|
||||
<?php
|
||||
$sub_menu = '400200';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '분류관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$where = " where ";
|
||||
$sql_search = "";
|
||||
if ($stx != "") {
|
||||
if ($sfl != "") {
|
||||
$sql_search .= " $where $sfl like '%$stx%' ";
|
||||
$where = " and ";
|
||||
}
|
||||
if ($save_stx != $stx)
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_category_table']} ";
|
||||
if ($is_admin != 'super')
|
||||
$sql_common .= " $where ca_mb_id = '{$member['mb_id']}' ";
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
if (!$sst)
|
||||
{
|
||||
$sst = "ca_id";
|
||||
$sod = "asc";
|
||||
}
|
||||
$sql_order = "order by $sst $sod";
|
||||
|
||||
// 출력할 레코드를 얻음
|
||||
$sql = " select *
|
||||
$sql_common
|
||||
$sql_order
|
||||
limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall; ?>
|
||||
생성된 분류 수 <?php echo number_format($total_count); ?>개
|
||||
</div>
|
||||
|
||||
<form name="flist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="save_stx" value="<?php echo $stx; ?>">
|
||||
|
||||
<label for="sfl" class="sound_only">검색대상</label>
|
||||
<select name="sfl" id="sfl">
|
||||
<option value="ca_name"<?php echo get_selected($_GET['sfl'], "ca_name", true); ?>>분류명</option>
|
||||
<option value="ca_id"<?php echo get_selected($_GET['sfl'], "ca_id", true); ?>>분류코드</option>
|
||||
<option value="ca_mb_id"<?php echo get_selected($_GET['sfl'], "ca_mb_id", true); ?>>회원아이디</option>
|
||||
</select>
|
||||
|
||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="stx" value="<?php echo $stx; ?>" id="stx" required class="required frm_input">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<?php if ($is_admin == 'super') {?>
|
||||
<div class="btn_add01 btn_add">
|
||||
<a href="./categoryform.php" id="cate_add">분류 추가</a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<form name="fcategorylist" method="post" action="./categorylistupdate.php" autocomplete="off">
|
||||
<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; ?>">
|
||||
|
||||
<div id="sct" class="tbl_head02 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" rowspan="2"><?php echo subject_sort_link("ca_id"); ?>분류코드</a></th>
|
||||
<th scope="col" id="sct_cate"><?php echo subject_sort_link("ca_name"); ?>분류명</a></th>
|
||||
<th scope="col" id="sct_amount">상품수</th>
|
||||
<th scope="col" id="sct_imgw">이미지 폭</th>
|
||||
<th scope="col" id="sct_imgh">이미지 높이</th>
|
||||
<th scope="col" id="sct_imgcol">1행이미지수</th>
|
||||
<th scope="col" id="sct_mobileimg">모바일 1행이미지수</th>
|
||||
<th scope="col" id="sct_pcskin">PC스킨지정</th>
|
||||
<th scope="col" rowspan="2">관리</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="col" id="sct_admin"><?php echo subject_sort_link("ca_mb_id"); ?>관리회원아이디</a></th>
|
||||
<th scope="col" id="sct_sell"><?php echo subject_sort_link("ca_use"); ?>판매가능</a></th>
|
||||
<th scope="col" id="sct_hpcert">본인인증</th>
|
||||
<th scope="col" id="sct_adultcert">성인인증</th>
|
||||
<th scope="col" id="sct_imgrow">이미지 행수</th>
|
||||
<th scope="col" id="sct_mobilerow">모바일 이미지 행수</th>
|
||||
<th scope="col" id="sct_mskin">모바일스킨지정</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$level = strlen($row['ca_id']) / 2 - 1;
|
||||
$p_ca_name = '';
|
||||
|
||||
if ($level > 0) {
|
||||
$class = 'class="name_lbl"'; // 2단 이상 분류의 label 에 스타일 부여 - 지운아빠 2013-04-02
|
||||
// 상위단계의 분류명
|
||||
$p_ca_id = substr($row['ca_id'], 0, $level*2);
|
||||
$sql = " select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$p_ca_id' ";
|
||||
$temp = sql_fetch($sql);
|
||||
$p_ca_name = $temp['ca_name'].'의하위';
|
||||
} else {
|
||||
$class = '';
|
||||
}
|
||||
|
||||
$s_level = '<div><label for="ca_name_'.$i.'" '.$class.'><span class="sound_only">'.$p_ca_name.''.($level+1).'단 분류</span></label></div>';
|
||||
$s_level_input_size = 25 - $level *2; // 하위 분류일 수록 입력칸 넓이 작아짐 - 지운아빠 2013-04-02
|
||||
|
||||
if ($level+2 < 6) $s_add = '<a href="./categoryform.php?ca_id='.$row['ca_id'].'&'.$qstr.'">추가</a> '; // 분류는 5단계까지만 가능
|
||||
else $s_add = '';
|
||||
$s_upd = '<a href="./categoryform.php?w=u&ca_id='.$row['ca_id'].'&'.$qstr.'"><span class="sound_only">'.get_text($row['ca_name']).' </span>수정</a> ';
|
||||
|
||||
if ($is_admin == 'super')
|
||||
$s_del = '<a href="./categoryformupdate.php?w=d&ca_id='.$row['ca_id'].'&'.$qstr.'" onclick="return delete_confirm();"><span class="sound_only">'.get_text($row['ca_name']).' </span>삭제</a> ';
|
||||
|
||||
// 해당 분류에 속한 상품의 수
|
||||
$sql1 = " select COUNT(*) as cnt from {$g5['g5_shop_item_table']}
|
||||
where ca_id = '{$row['ca_id']}'
|
||||
or ca_id2 = '{$row['ca_id']}'
|
||||
or ca_id3 = '{$row['ca_id']}' ";
|
||||
$row1 = sql_fetch($sql1);
|
||||
|
||||
// 스킨 Path
|
||||
if(!$row['ca_skin_dir'])
|
||||
$g5_shop_skin_path = G5_SHOP_SKIN_PATH;
|
||||
else {
|
||||
if(preg_match('#^theme/(.+)$#', $row['ca_skin_dir'], $match))
|
||||
$g5_shop_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
|
||||
else
|
||||
$g5_shop_skin_path = G5_PATH.'/'.G5_SKIN_DIR.'/shop/'.$row['ca_skin_dir'];
|
||||
}
|
||||
|
||||
if(!$row['ca_mobile_skin_dir'])
|
||||
$g5_mshop_skin_path = G5_MSHOP_SKIN_PATH;
|
||||
else {
|
||||
if(preg_match('#^theme/(.+)$#', $row['ca_mobile_skin_dir'], $match))
|
||||
$g5_mshop_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
|
||||
else
|
||||
$g5_mshop_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$row['ca_mobile_skin_dir'];
|
||||
}
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td class="td_code" rowspan="2">
|
||||
<input type="hidden" name="ca_id[<?php echo $i; ?>]" value="<?php echo $row['ca_id']; ?>">
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/list.php?ca_id=<?php echo $row['ca_id']; ?>"><?php echo $row['ca_id']; ?></a>
|
||||
</td>
|
||||
<td headers="sct_cate" class="sct_name sct_name<?php echo $level; ?>"><?php echo $s_level; ?> <input type="text" name="ca_name[<?php echo $i; ?>]" value="<?php echo get_text($row['ca_name']); ?>" id="ca_name_<?php echo $i; ?>" required class="frm_input full_input required"></td>
|
||||
<td headers="sct_amount" class="td_amount"><a href="./itemlist.php?sca=<?php echo $row['ca_id']; ?>"><?php echo $row1['cnt']; ?></a></td>
|
||||
<td headers="sct_imgw" class="td_output">
|
||||
<label for="ca_out_width<?php echo $i; ?>" class="sound_only">출력이미지 폭</label>
|
||||
<input type="text" name="ca_img_width[<?php echo $i; ?>]" value="<?php echo get_text($row['ca_img_width']); ?>" id="ca_out_width<?php echo $i; ?>" required class="required frm_input" size="3" > <span class="sound_only">픽셀</span>
|
||||
</td>
|
||||
<td headers="sct_imgh" class="td_output">
|
||||
<label for="ca_img_height<?php echo $i; ?>" class="sound_only">출력이미지 높이</label>
|
||||
<input type="text" name="ca_img_height[<?php echo $i; ?>]" value="<?php echo $row['ca_img_height']; ?>" id="ca_img_height<?php echo $i; ?>" required class="required frm_input" size="3" > <span class="sound_only">픽셀</span>
|
||||
</td>
|
||||
<td headers="sct_imgcol" class="td_imgline">
|
||||
<label for="ca_lineimg_num<?php echo $i; ?>" class="sound_only">1줄당 이미지 수</label>
|
||||
<input type="text" name="ca_list_mod[<?php echo $i; ?>]" size="3" value="<?php echo $row['ca_list_mod']; ?>" id="ca_lineimg_num<?php echo $i; ?>" required class="required frm_input"> <span class="sound_only">개</span>
|
||||
</td>
|
||||
<td headers="sct_mobileimg" class="td_output">
|
||||
<label for="ca_mobileimg_num<?php echo $i; ?>" class="sound_only">모바일 1줄당 이미지 수</label>
|
||||
<input type="text" name="ca_mobile_list_mod[<?php echo $i; ?>]" size="3" value="<?php echo $row['ca_mobile_list_mod']; ?>" id="ca_mobileimg_num<?php echo $i; ?>" required class="required frm_input"> <span class="sound_only">개</span>
|
||||
</td>
|
||||
<td headers="sct_pcskin">
|
||||
<label for="ca_skin_dir<?php echo $i; ?>" class="sound_only">PC스킨폴더</label>
|
||||
<?php echo get_skin_select('shop', 'ca_skin_dir'.$i, 'ca_skin_dir['.$i.']', $row['ca_skin_dir'], 'class="skin_dir"'); ?>
|
||||
<label for="ca_skin<?php echo $i; ?>" class="sound_only">PC스킨파일</label>
|
||||
<select id="ca_skin<?php echo $i; ?>" name="ca_skin[<?php echo $i; ?>]" required class="required">
|
||||
<?php echo get_list_skin_options("^list.[0-9]+\.skin\.php", $g5_shop_skin_path, $row['ca_skin']); ?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="td_mng" rowspan="2">
|
||||
<?php echo $s_add; ?>
|
||||
<?php echo $s_vie; ?>
|
||||
<?php echo $s_upd; ?>
|
||||
<?php echo $s_del; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td headers="sct_admin" class="td_mng">
|
||||
<?php if ($is_admin == 'super') {?>
|
||||
<label for="ca_mb_id<?php echo $i; ?>" class="sound_only">관리회원아이디</label>
|
||||
<input type="text" name="ca_mb_id[<?php echo $i; ?>]" value="<?php echo $row['ca_mb_id']; ?>" id="ca_mb_id<?php echo $i; ?>" class="frm_input full_input" size="15" maxlength="20">
|
||||
<?php } else { ?>
|
||||
<input type="hidden" name="ca_mb_id[<?php echo $i; ?>]" value="<?php echo $row['ca_mb_id']; ?>">
|
||||
<?php echo $row['ca_mb_id']; ?>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td headers="sct_sell" class="td_possible">
|
||||
<input type="checkbox" name="ca_use[<?php echo $i; ?>]" value="1" id="ca_use<?php echo $i; ?>" <?php echo ($row['ca_use'] ? "checked" : ""); ?>>
|
||||
<label for="ca_use<?php echo $i; ?>">판매</label>
|
||||
</td>
|
||||
<td headers="sct_hpcert" class="td_confirm">
|
||||
<input type="checkbox" name="ca_cert_use[<?php echo $i; ?>]" value="1" id="ca_cert_use_yes<?php echo $i; ?>" <?php if($row['ca_cert_use']) echo 'checked="checked"'; ?>>
|
||||
<label for="ca_cert_use_yes<?php echo $i; ?>">사용</label>
|
||||
</td>
|
||||
<td headers="sct_adultcert" class="td_confirm">
|
||||
<input type="checkbox" name="ca_adult_use[<?php echo $i; ?>]" value="1" id="ca_adult_use_yes<?php echo $i; ?>" <?php if($row['ca_adult_use']) echo 'checked="checked"'; ?>>
|
||||
<label for="ca_adult_use_yes<?php echo $i; ?>">사용</label>
|
||||
</td>
|
||||
<td headers="sct_imgrow" class="td_imgline">
|
||||
<label for="ca_imgline_num<?php echo $i; ?>" class="sound_only">이미지 줄 수</label>
|
||||
<input type="text" name="ca_list_row[<?php echo $i; ?>]" value='<?php echo $row['ca_list_row']; ?>' id="ca_imgline_num<?php echo $i; ?>" required class="required frm_input" size="3"> <span class="sound_only">줄</span>
|
||||
</td>
|
||||
<td headers="sct_mobilerow" class="td_output">
|
||||
<label for="ca_mobileimg_row<?php echo $i; ?>" class="sound_only">모바일 이미지 줄 수</label>
|
||||
<input type="text" name="ca_mobile_list_row[<?php echo $i; ?>]" value='<?php echo $row['ca_mobile_list_row']; ?>' id="ca_mobileimg_row<?php echo $i; ?>" required class="required frm_input" size="3">
|
||||
</td>
|
||||
<td headers="sct_mskin">
|
||||
<label for="ca_mobile_skin_dir<?php echo $i; ?>" class="sound_only">모바일스킨폴더</label>
|
||||
<?php echo get_mobile_skin_select('shop', 'ca_mobile_skin_dir'.$i, 'ca_mobile_skin_dir['.$i.']', $row['ca_mobile_skin_dir'], 'class="skin_dir"'); ?>
|
||||
<label for="ca_mobile_skin<?php echo $i; ?>" class="sound_only">모바일스킨파일</label>
|
||||
<select id="ca_mobile_skin<?php echo $i; ?>" name="ca_mobile_skin[<?php echo $i; ?>]" required class="required">
|
||||
<?php echo get_list_skin_options("^list.[0-9]+\.skin\.php", $g5_mshop_skin_path, $row['ca_mobile_skin']); ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
if ($i == 0) echo "<tr><td colspan=\"9\" class=\"empty_table\">자료가 한 건도 없습니다.</td></tr>\n";
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_list01 btn_list">
|
||||
<input type="submit" value="일괄수정">
|
||||
</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="); ?>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$("select.skin_dir").on("change", function() {
|
||||
var type = "";
|
||||
var dir = $(this).val();
|
||||
if(!dir)
|
||||
return false;
|
||||
|
||||
var id = $(this).attr("id");
|
||||
var $sel = $(this).siblings("select");
|
||||
var sval = $sel.find("option:selected").val();
|
||||
|
||||
if(id.search("mobile") > -1)
|
||||
type = "mobile";
|
||||
|
||||
$sel.load(
|
||||
"./ajax.skinfile.php",
|
||||
{ dir : dir, type : type, sval: sval }
|
||||
);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
41
adm/shop_admin/categorylistupdate.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
$sub_menu = '400200';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
for ($i=0; $i<count($_POST['ca_id']); $i++)
|
||||
{
|
||||
if ($_POST['ca_mb_id'][$i])
|
||||
{
|
||||
$sql = " select mb_id from {$g5['member_table']} where mb_id = '{$_POST['ca_mb_id'][$i]}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row['mb_id'])
|
||||
alert("\'{$_POST['ca_mb_id'][$i]}\' 은(는) 존재하는 회원아이디가 아닙니다.", "./categorylist.php?$qstr");
|
||||
}
|
||||
|
||||
$sql = " update {$g5['g5_shop_category_table']}
|
||||
set ca_name = '{$_POST['ca_name'][$i]}',
|
||||
ca_mb_id = '{$_POST['ca_mb_id'][$i]}',
|
||||
ca_use = '{$_POST['ca_use'][$i]}',
|
||||
ca_list_mod = '{$_POST['ca_list_mod'][$i]}',
|
||||
ca_cert_use = '{$_POST['ca_cert_use'][$i]}',
|
||||
ca_adult_use = '{$_POST['ca_adult_use'][$i]}',
|
||||
ca_skin = '{$_POST['ca_skin'][$i]}',
|
||||
ca_mobile_skin = '{$_POST['ca_mobile_skin'][$i]}',
|
||||
ca_skin_dir = '{$_POST['ca_skin_dir'][$i]}',
|
||||
ca_mobile_skin_dir = '{$_POST['ca_mobile_skin_dir'][$i]}',
|
||||
ca_img_width = '{$_POST['ca_img_width'][$i]}',
|
||||
ca_img_height = '{$_POST['ca_img_height'][$i]}',
|
||||
ca_list_row = '{$_POST['ca_list_row'][$i]}',
|
||||
ca_mobile_list_mod = '{$_POST['ca_mobile_list_mod'][$i]}',
|
||||
ca_mobile_list_row = '{$_POST['ca_mobile_list_row'][$i]}'
|
||||
where ca_id = '{$_POST['ca_id'][$i]}' ";
|
||||
sql_query($sql);
|
||||
|
||||
}
|
||||
|
||||
goto_url("./categorylist.php?$qstr");
|
||||
?>
|
||||
22
adm/shop_admin/codedupcheck.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$name = '';
|
||||
|
||||
if ($it_id)
|
||||
{
|
||||
$sql = " select it_name from {$g5['g5_shop_item_table']} where it_id = '$it_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
$code = $it_id;
|
||||
$name = $row['it_name'];
|
||||
}
|
||||
else if ($ca_id)
|
||||
{
|
||||
$sql = " select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$ca_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
$code = $ca_id;
|
||||
$name = $row['ca_name'];
|
||||
}
|
||||
|
||||
echo '{ "code": "' . $code . '", "name": "' . $name . '" }';
|
||||
?>
|
||||
1551
adm/shop_admin/configform.php
Normal file
201
adm/shop_admin/configformupdate.php
Normal file
@ -0,0 +1,201 @@
|
||||
<?php
|
||||
$sub_menu = '400100';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
// 로그인을 바로 이 주소로 하는 경우 쇼핑몰설정값이 사라지는 현상을 방지
|
||||
if (!$_POST['de_admin_company_owner']) goto_url("./configform.php");
|
||||
|
||||
if ($_POST['logo_img_del']) @unlink(G5_DATA_PATH."/common/logo_img");
|
||||
if ($_POST['logo_img_del2']) @unlink(G5_DATA_PATH."/common/logo_img2");
|
||||
if ($_POST['mobile_logo_img_del']) @unlink(G5_DATA_PATH."/common/mobile_logo_img");
|
||||
if ($_POST['mobile_logo_img_del2']) @unlink(G5_DATA_PATH."/common/mobile_logo_img2");
|
||||
|
||||
if ($_FILES['logo_img']['name']) upload_file($_FILES['logo_img']['tmp_name'], "logo_img", G5_DATA_PATH."/common");
|
||||
if ($_FILES['logo_img2']['name']) upload_file($_FILES['logo_img2']['tmp_name'], "logo_img2", G5_DATA_PATH."/common");
|
||||
if ($_FILES['mobile_logo_img']['name']) upload_file($_FILES['mobile_logo_img']['tmp_name'], "mobile_logo_img", G5_DATA_PATH."/common");
|
||||
if ($_FILES['mobile_logo_img2']['name']) upload_file($_FILES['mobile_logo_img2']['tmp_name'], "mobile_logo_img2", G5_DATA_PATH."/common");
|
||||
|
||||
$de_kcp_mid = substr($_POST['de_kcp_mid'],0,3);
|
||||
|
||||
// kcp 전자결제를 사용할 때 site key 입력체크
|
||||
if($_POST['de_pg_service'] == 'kcp' && ($_POST['de_iche_use'] || $_POST['de_vbank_use'] || $_POST['de_hp_use'] || $_POST['de_card_use'])) {
|
||||
if(trim($_POST['de_kcp_site_key']) == '')
|
||||
alert('KCP SITE KEY를 입력해 주십시오.');
|
||||
}
|
||||
|
||||
//
|
||||
// 영카트 default
|
||||
//
|
||||
$sql = " update {$g5['g5_shop_default_table']}
|
||||
set de_admin_company_owner = '{$_POST['de_admin_company_owner']}',
|
||||
de_admin_company_name = '{$_POST['de_admin_company_name']}',
|
||||
de_admin_company_saupja_no = '{$_POST['de_admin_company_saupja_no']}',
|
||||
de_admin_company_tel = '{$_POST['de_admin_company_tel']}',
|
||||
de_admin_company_fax = '{$_POST['de_admin_company_fax']}',
|
||||
de_admin_tongsin_no = '{$_POST['de_admin_tongsin_no']}',
|
||||
de_admin_company_zip = '{$_POST['de_admin_company_zip']}',
|
||||
de_admin_company_addr = '{$_POST['de_admin_company_addr']}',
|
||||
de_admin_info_name = '{$_POST['de_admin_info_name']}',
|
||||
de_admin_info_email = '{$_POST['de_admin_info_email']}',
|
||||
de_shop_skin = '{$_POST['de_shop_skin']}',
|
||||
de_shop_mobile_skin = '{$_POST['de_shop_mobile_skin']}',
|
||||
de_type1_list_use = '{$_POST['de_type1_list_use']}',
|
||||
de_type1_list_skin = '{$_POST['de_type1_list_skin']}',
|
||||
de_type1_list_mod = '{$_POST['de_type1_list_mod']}',
|
||||
de_type1_list_row = '{$_POST['de_type1_list_row']}',
|
||||
de_type1_img_width = '{$_POST['de_type1_img_width']}',
|
||||
de_type1_img_height = '{$_POST['de_type1_img_height']}',
|
||||
de_type2_list_use = '{$_POST['de_type2_list_use']}',
|
||||
de_type2_list_skin = '{$_POST['de_type2_list_skin']}',
|
||||
de_type2_list_mod = '{$_POST['de_type2_list_mod']}',
|
||||
de_type2_list_row = '{$_POST['de_type2_list_row']}',
|
||||
de_type2_img_width = '{$_POST['de_type2_img_width']}',
|
||||
de_type2_img_height = '{$_POST['de_type2_img_height']}',
|
||||
de_type3_list_use = '{$_POST['de_type3_list_use']}',
|
||||
de_type3_list_skin = '{$_POST['de_type3_list_skin']}',
|
||||
de_type3_list_mod = '{$_POST['de_type3_list_mod']}',
|
||||
de_type3_list_row = '{$_POST['de_type3_list_row']}',
|
||||
de_type3_img_width = '{$_POST['de_type3_img_width']}',
|
||||
de_type3_img_height = '{$_POST['de_type3_img_height']}',
|
||||
de_type4_list_use = '{$_POST['de_type4_list_use']}',
|
||||
de_type4_list_skin = '{$_POST['de_type4_list_skin']}',
|
||||
de_type4_list_mod = '{$_POST['de_type4_list_mod']}',
|
||||
de_type4_list_row = '{$_POST['de_type4_list_row']}',
|
||||
de_type4_img_width = '{$_POST['de_type4_img_width']}',
|
||||
de_type4_img_height = '{$_POST['de_type4_img_height']}',
|
||||
de_type5_list_use = '{$_POST['de_type5_list_use']}',
|
||||
de_type5_list_skin = '{$_POST['de_type5_list_skin']}',
|
||||
de_type5_list_mod = '{$_POST['de_type5_list_mod']}',
|
||||
de_type5_list_row = '{$_POST['de_type5_list_row']}',
|
||||
de_type5_img_width = '{$_POST['de_type5_img_width']}',
|
||||
de_type5_img_height = '{$_POST['de_type5_img_height']}',
|
||||
de_mobile_type1_list_use = '{$_POST['de_mobile_type1_list_use']}',
|
||||
de_mobile_type1_list_skin = '{$_POST['de_mobile_type1_list_skin']}',
|
||||
de_mobile_type1_list_mod = '{$_POST['de_mobile_type1_list_mod']}',
|
||||
de_mobile_type1_list_row = '{$_POST['de_mobile_type1_list_row']}',
|
||||
de_mobile_type1_img_width = '{$_POST['de_mobile_type1_img_width']}',
|
||||
de_mobile_type1_img_height = '{$_POST['de_mobile_type1_img_height']}',
|
||||
de_mobile_type2_list_use = '{$_POST['de_mobile_type2_list_use']}',
|
||||
de_mobile_type2_list_skin = '{$_POST['de_mobile_type2_list_skin']}',
|
||||
de_mobile_type2_list_mod = '{$_POST['de_mobile_type2_list_mod']}',
|
||||
de_mobile_type2_list_row = '{$_POST['de_mobile_type2_list_row']}',
|
||||
de_mobile_type2_img_width = '{$_POST['de_mobile_type2_img_width']}',
|
||||
de_mobile_type2_img_height = '{$_POST['de_mobile_type2_img_height']}',
|
||||
de_mobile_type3_list_use = '{$_POST['de_mobile_type3_list_use']}',
|
||||
de_mobile_type3_list_skin = '{$_POST['de_mobile_type3_list_skin']}',
|
||||
de_mobile_type3_list_mod = '{$_POST['de_mobile_type3_list_mod']}',
|
||||
de_mobile_type3_list_row = '{$_POST['de_mobile_type3_list_row']}',
|
||||
de_mobile_type3_img_width = '{$_POST['de_mobile_type3_img_width']}',
|
||||
de_mobile_type3_img_height = '{$_POST['de_mobile_type3_img_height']}',
|
||||
de_mobile_type4_list_use = '{$_POST['de_mobile_type4_list_use']}',
|
||||
de_mobile_type4_list_skin = '{$_POST['de_mobile_type4_list_skin']}',
|
||||
de_mobile_type4_list_mod = '{$_POST['de_mobile_type4_list_mod']}',
|
||||
de_mobile_type4_list_row = '{$_POST['de_mobile_type4_list_row']}',
|
||||
de_mobile_type4_img_width = '{$_POST['de_mobile_type4_img_width']}',
|
||||
de_mobile_type4_img_height = '{$_POST['de_mobile_type4_img_height']}',
|
||||
de_mobile_type5_list_use = '{$_POST['de_mobile_type5_list_use']}',
|
||||
de_mobile_type5_list_skin = '{$_POST['de_mobile_type5_list_skin']}',
|
||||
de_mobile_type5_list_mod = '{$_POST['de_mobile_type5_list_mod']}',
|
||||
de_mobile_type5_list_row = '{$_POST['de_mobile_type5_list_row']}',
|
||||
de_mobile_type5_img_width = '{$_POST['de_mobile_type5_img_width']}',
|
||||
de_mobile_type5_img_height = '{$_POST['de_mobile_type5_img_height']}',
|
||||
de_rel_list_use = '{$_POST['de_rel_list_use']}',
|
||||
de_rel_list_skin = '{$_POST['de_rel_list_skin']}',
|
||||
de_rel_list_mod = '{$_POST['de_rel_list_mod']}',
|
||||
de_rel_img_width = '{$_POST['de_rel_img_width']}',
|
||||
de_rel_img_height = '{$_POST['de_rel_img_height']}',
|
||||
de_mobile_rel_list_use = '{$_POST['de_mobile_rel_list_use']}',
|
||||
de_mobile_rel_list_skin = '{$_POST['de_mobile_rel_list_skin']}',
|
||||
de_mobile_rel_list_mod = '{$_POST['de_mobile_rel_list_mod']}',
|
||||
de_mobile_rel_img_width = '{$_POST['de_mobile_rel_img_width']}',
|
||||
de_mobile_rel_img_height = '{$_POST['de_mobile_rel_img_height']}',
|
||||
de_search_list_skin = '{$_POST['de_search_list_skin']}',
|
||||
de_search_list_mod = '{$_POST['de_search_list_mod']}',
|
||||
de_search_list_row = '{$_POST['de_search_list_row']}',
|
||||
de_search_img_width = '{$_POST['de_search_img_width']}',
|
||||
de_search_img_height = '{$_POST['de_search_img_height']}',
|
||||
de_mobile_search_list_skin = '{$_POST['de_mobile_search_list_skin']}',
|
||||
de_mobile_search_list_mod = '{$_POST['de_mobile_search_list_mod']}',
|
||||
de_mobile_search_list_row = '{$_POST['de_mobile_search_list_row']}',
|
||||
de_mobile_search_img_width = '{$_POST['de_mobile_search_img_width']}',
|
||||
de_mobile_search_img_height = '{$_POST['de_mobile_search_img_height']}',
|
||||
de_bank_use = '{$_POST['de_bank_use']}',
|
||||
de_bank_account = '{$_POST['de_bank_account']}',
|
||||
de_card_test = '{$_POST['de_card_test']}',
|
||||
de_card_use = '{$_POST['de_card_use']}',
|
||||
de_easy_pay_use = '{$_POST['de_easy_pay_use']}',
|
||||
de_card_noint_use = '{$_POST['de_card_noint_use']}',
|
||||
de_card_point = '{$_POST['de_card_point']}',
|
||||
de_settle_min_point = '{$_POST['de_settle_min_point']}',
|
||||
de_settle_max_point = '{$_POST['de_settle_max_point']}',
|
||||
de_settle_point_unit = '{$_POST['de_settle_point_unit']}',
|
||||
de_level_sell = '{$_POST['de_level_sell']}',
|
||||
de_delivery_company = '{$_POST['de_delivery_company']}',
|
||||
de_send_cost_case = '{$_POST['de_send_cost_case']}',
|
||||
de_send_cost_limit = '{$_POST['de_send_cost_limit']}',
|
||||
de_send_cost_list = '{$_POST['de_send_cost_list']}',
|
||||
de_hope_date_use = '{$_POST['de_hope_date_use']}',
|
||||
de_hope_date_after = '{$_POST['de_hope_date_after']}',
|
||||
de_baesong_content = '{$_POST['de_baesong_content']}',
|
||||
de_change_content = '{$_POST['de_change_content']}',
|
||||
de_point_days = '{$_POST['de_point_days']}',
|
||||
de_simg_width = '{$_POST['de_simg_width']}',
|
||||
de_simg_height = '{$_POST['de_simg_height']}',
|
||||
de_mimg_width = '{$_POST['de_mimg_width']}',
|
||||
de_mimg_height = '{$_POST['de_mimg_height']}',
|
||||
de_pg_service = '{$_POST['de_pg_service']}',
|
||||
de_kcp_mid = '{$_POST['de_kcp_mid']}',
|
||||
de_kcp_site_key = '{$_POST['de_kcp_site_key']}',
|
||||
de_inicis_mid = '{$_POST['de_inicis_mid']}',
|
||||
de_inicis_admin_key = '{$_POST['de_inicis_admin_key']}',
|
||||
de_iche_use = '{$_POST['de_iche_use']}',
|
||||
de_sms_cont1 = '{$_POST['de_sms_cont1']}',
|
||||
de_sms_cont2 = '{$_POST['de_sms_cont2']}',
|
||||
de_sms_cont3 = '{$_POST['de_sms_cont3']}',
|
||||
de_sms_cont4 = '{$_POST['de_sms_cont4']}',
|
||||
de_sms_cont5 = '{$_POST['de_sms_cont5']}',
|
||||
de_sms_use1 = '{$_POST['de_sms_use1']}',
|
||||
de_sms_use2 = '{$_POST['de_sms_use2']}',
|
||||
de_sms_use3 = '{$_POST['de_sms_use3']}',
|
||||
de_sms_use4 = '{$_POST['de_sms_use4']}',
|
||||
de_sms_use5 = '{$_POST['de_sms_use5']}',
|
||||
de_sms_hp = '{$_POST['de_sms_hp']}',
|
||||
de_item_use_use = '{$_POST['de_item_use_use']}',
|
||||
de_item_use_write = '{$_POST['de_item_use_write']}',
|
||||
de_code_dup_use = '{$_POST['de_code_dup_use']}',
|
||||
de_cart_keep_term = '{$_POST['de_cart_keep_term']}',
|
||||
de_guest_cart_use = '{$_POST['de_guest_cart_use']}',
|
||||
de_admin_buga_no = '{$_POST['de_admin_buga_no']}',
|
||||
de_vbank_use = '{$_POST['de_vbank_use']}',
|
||||
de_taxsave_use = '{$_POST['de_taxsave_use']}',
|
||||
de_guest_privacy = '{$_POST['de_guest_privacy']}',
|
||||
de_hp_use = '{$_POST['de_hp_use']}',
|
||||
de_escrow_use = '{$_POST['de_escrow_use']}',
|
||||
de_tax_flag_use = '{$_POST['de_tax_flag_use']}',
|
||||
de_member_reg_coupon_use = '{$_POST['de_member_reg_coupon_use']}',
|
||||
de_member_reg_coupon_term = '{$_POST['de_member_reg_coupon_term']}',
|
||||
de_member_reg_coupon_price = '{$_POST['de_member_reg_coupon_price']}',
|
||||
de_member_reg_coupon_minimum = '{$_POST['de_member_reg_coupon_minimum']}'
|
||||
";
|
||||
sql_query($sql);
|
||||
|
||||
// 환경설정 > 포인트 사용
|
||||
sql_query(" update {$g5['config_table']} set cf_use_point = '{$_POST['cf_use_point']}' ");
|
||||
|
||||
// LG, 아이코드 설정
|
||||
$sql = " update {$g5['config_table']}
|
||||
set cf_sms_use = '{$_POST['cf_sms_use']}',
|
||||
cf_icode_id = '{$_POST['cf_icode_id']}',
|
||||
cf_icode_pw = '{$_POST['cf_icode_pw']}',
|
||||
cf_icode_server_ip = '{$_POST['cf_icode_server_ip']}',
|
||||
cf_icode_server_port = '{$_POST['cf_icode_server_port']}',
|
||||
cf_lg_mid = '{$_POST['cf_lg_mid']}',
|
||||
cf_lg_mert_key = '{$_POST['cf_lg_mert_key']}' ";
|
||||
sql_query($sql);
|
||||
|
||||
goto_url("./configform.php");
|
||||
?>
|
||||
283
adm/shop_admin/couponform.php
Normal file
@ -0,0 +1,283 @@
|
||||
<?php
|
||||
$sub_menu = '400800';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$g5['title'] = '쿠폰관리';
|
||||
|
||||
if ($w == 'u') {
|
||||
$html_title = '쿠폰 수정';
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_coupon_table']} where cp_id = '$cp_id' ";
|
||||
$cp = sql_fetch($sql);
|
||||
if (!$cp['cp_id']) alert('등록된 자료가 없습니다.');
|
||||
}
|
||||
else
|
||||
{
|
||||
$html_title = '쿠폰 입력';
|
||||
$cp['cp_start'] = G5_TIME_YMD;
|
||||
$cp['cp_end'] = date('Y-m-d', (G5_SERVER_TIME + 86400 * 7));
|
||||
}
|
||||
|
||||
if($cp['cp_method'] == 1) {
|
||||
$cp_target_label = '적용분류';
|
||||
$cp_target_btn = '분류검색';
|
||||
} else {
|
||||
$cp_target_label = '적용상품';
|
||||
$cp_target_btn = '상품검색';
|
||||
}
|
||||
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
||||
?>
|
||||
|
||||
<form name="fcouponform" action="./couponformupdate.php" method="post" onsubmit="return form_check(this);">
|
||||
<input type="hidden" name="w" value="<?php echo $w; ?>">
|
||||
<input type="hidden" name="cp_id" value="<?php echo $cp_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;?>">
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?></caption>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row"><label for="cp_subject">쿠폰이름</label></th>
|
||||
<td>
|
||||
<input type="text" name="cp_subject" value="<?php echo stripslashes($cp['cp_subject']); ?>" id="cp_subject" required class="required frm_input" size="50">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cp_method">쿠폰종류</label></th>
|
||||
<td>
|
||||
<?php echo help("쿠폰 종류를 변경하시면 입력 서식도 일부 변경됩니다."); ?>
|
||||
<select name="cp_method" id="cp_method">
|
||||
<option value="0"<?php echo get_selected('0', $cp['cp_method']); ?>>개별상품할인</option>
|
||||
<option value="1"<?php echo get_selected('1', $cp['cp_method']); ?>>카테고리할인</option>
|
||||
<option value="2"<?php echo get_selected('2', $cp['cp_method']); ?>>주문금액할인</option>
|
||||
<option value="3"<?php echo get_selected('3', $cp['cp_method']); ?>>배송비할인</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="tr_cp_target">
|
||||
<th scope="row"><label for="cp_target"><?php echo $cp_target_label; ?></label></th>
|
||||
<td>
|
||||
<input type="text" name="cp_target" value="<?php echo stripslashes($cp['cp_target']); ?>" id="cp_target" required class="required frm_input">
|
||||
<button type="button" id="sch_target" class="btn_frmline"><?php echo $cp_target_btn; ?></button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="mb_id">회원아이디</label></th>
|
||||
<td>
|
||||
<input type="text" name="mb_id" value="<?php echo stripslashes($cp['mb_id']); ?>" id="mb_id" class="frm_input">
|
||||
<button type="button" id="sch_member" class="btn_frmline">회원검색</button>
|
||||
<input type="checkbox" name="chk_all_mb" id="chk_all_mb" value="1">
|
||||
<label for="chk_all_mb">전체회원</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cp_start">사용시작일</label></th>
|
||||
<td>
|
||||
<?php echo help('입력 예: '.date('Y-m-d')); ?>
|
||||
<input type="text" name="cp_start" value="<?php echo stripslashes($cp['cp_start']); ?>" id="cp_start" required class="frm_input required">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cp_end">사용종료일</label></th>
|
||||
<td>
|
||||
<?php echo help('입력 예: '.date('Y-m-d')); ?>
|
||||
<input type="text" name="cp_end" value="<?php echo stripslashes($cp['cp_end']); ?>" id="cp_end" required class="frm_input required">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cp_type">쿠폰타입</label></th>
|
||||
<td>
|
||||
<?php echo help("쿠폰 타입을 변경하시면 입력 서식도 일부 변경됩니다."); ?>
|
||||
<select name="cp_type" id="cp_type">
|
||||
<option value="0"<?php echo get_selected('0', $cp['cp_type']); ?>>정액할인(원)</option>
|
||||
<option value="1"<?php echo get_selected('1', $cp['cp_type']); ?>>정률할인(%)</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cp_price"><?php echo $cp['cp_type'] ? '할인비율' : '할인금액'; ?></label></th>
|
||||
<td>
|
||||
<input type="text" name="cp_price" value="<?php echo stripslashes($cp['cp_price']); ?>" id="cp_price" required class="frm_input required"> <span id="cp_price_unit"><?php echo $cp['cp_type'] ? '%' : '원'; ?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="tr_cp_trunc">
|
||||
<th scope="row"><label for="cp_trunc">절사금액</label></th>
|
||||
<td>
|
||||
<select name="cp_trunc" id="cp_trunc">
|
||||
<option value="1"<?php echo get_selected('1', $cp['cp_trunc']); ?>>1원단위</option>
|
||||
<option value="10"<?php echo get_selected('10', $cp['cp_trunc']); ?>>10원단위</option>
|
||||
<option value="100"<?php echo get_selected('100', $cp['cp_trunc']); ?>>100원단위</option>
|
||||
<option value="1000"<?php echo get_selected('1000', $cp['cp_trunc']); ?>>1,000원단위</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="cp_minimum">최소주문금액</label></th>
|
||||
<td>
|
||||
<input type="text" name="cp_minimum" value="<?php echo stripslashes($cp['cp_minimum']); ?>" id="cp_minimum" class="frm_input"> 원
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="tr_cp_maximum">
|
||||
<th scope="row"><label for="cp_maximum">최대할인금액</label></th>
|
||||
<td>
|
||||
<input type="text" name="cp_maximum" value="<?php echo stripslashes($cp['cp_maximum']); ?>" id="cp_maximum" class="frm_input"> 원
|
||||
</td>
|
||||
</tr>
|
||||
<?php if($w == '') { ?>
|
||||
<tr>
|
||||
<th scope="row">쿠폰발행알림</th>
|
||||
<td>
|
||||
<label for="cp_sms_send">SMS발송</label>
|
||||
<input type="checkbox" name="cp_sms_send" value="1" id="cp_sms_send" checked>
|
||||
<label for="cp_email_send">이메일발송</label>
|
||||
<input type="checkbox" name="cp_email_send" value="1" id="cp_email_send" checked>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="확인" class="btn_submit" accesskey="s">
|
||||
<a href="./couponlist.php">목록</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
<?php if($cp['cp_method'] == 2 || $cp['cp_method'] == 3) { ?>
|
||||
$("#tr_cp_target").hide();
|
||||
$("#tr_cp_target").find("input").attr("required", false).removeClass("required");
|
||||
<?php } ?>
|
||||
<?php if($cp['cp_type'] != 1) { ?>
|
||||
$("#tr_cp_maximum").hide();
|
||||
$("#tr_cp_trunc").hide();
|
||||
<?php } ?>
|
||||
$("#cp_method").change(function() {
|
||||
var cp_method = $(this).val();
|
||||
change_method(cp_method);
|
||||
});
|
||||
|
||||
$("#cp_type").change(function() {
|
||||
var cp_type = $(this).val();
|
||||
change_type(cp_type);
|
||||
});
|
||||
|
||||
$("#sch_target").click(function() {
|
||||
var cp_method = $("#cp_method").val();
|
||||
var opt = "left=50,top=50,width=520,height=600,scrollbars=1";
|
||||
var url = "./coupontarget.php?sch_target=";
|
||||
|
||||
if(cp_method == "0") {
|
||||
window.open(url+"0", "win_target", opt);
|
||||
} else if(cp_method == "1") {
|
||||
window.open(url+"1", "win_target", opt);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$("#sch_member").click(function() {
|
||||
if($("#chk_all_mb").is(":checked")) {
|
||||
alert("전체회원 체크를 해제 후 이용해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var opt = "left=50,top=50,width=520,height=600,scrollbars=1";
|
||||
var url = "./couponmember.php";
|
||||
window.open(url, "win_member", opt);
|
||||
});
|
||||
|
||||
$("#cp_start, #cp_end").datepicker(
|
||||
{ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", showButtonPanel: true, yearRange: "c-99:c+99" }
|
||||
);
|
||||
});
|
||||
|
||||
function change_method(cp_method)
|
||||
{
|
||||
if(cp_method == "0") {
|
||||
$("#sch_target").text("상품검색");
|
||||
$("#tr_cp_target").find("label").text("적용상품");
|
||||
$("#tr_cp_target").find("input").attr("required", true).addClass("required");
|
||||
$("#tr_cp_target").show();
|
||||
} else if(cp_method == "1") {
|
||||
$("#sch_target").text("분류검색");
|
||||
$("#tr_cp_target").find("label").text("적용분류");
|
||||
$("#tr_cp_target").find("input").attr("required", true).addClass("required");
|
||||
$("#tr_cp_target").show();
|
||||
} else {
|
||||
$("#tr_cp_target").hide();
|
||||
$("#tr_cp_target").find("input").attr("required", false).removeClass("required");
|
||||
}
|
||||
}
|
||||
|
||||
function change_type(cp_type)
|
||||
{
|
||||
if(cp_type == "0") {
|
||||
$("#cp_price_unit").text("원");
|
||||
$("#cp_price_unit").closest("tr").find("label").text("할인금액");
|
||||
$("#tr_cp_maximum").hide();
|
||||
$("#tr_cp_trunc").hide();
|
||||
} else {
|
||||
$("#cp_price_unit").text("%");
|
||||
$("#cp_price_unit").closest("tr").find("label").text("할인비율");
|
||||
$("#tr_cp_maximum").show();
|
||||
$("#tr_cp_trunc").show();
|
||||
}
|
||||
}
|
||||
|
||||
function form_check(f)
|
||||
{
|
||||
var sel_type = f.cp_type;
|
||||
var cp_type = sel_type.options[sel_type.selectedIndex].value;
|
||||
var cp_price = f.cp_price.value;
|
||||
|
||||
if(!f.chk_all_mb.checked && f.mb_id.value == "") {
|
||||
alert("회원아이디를 입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(isNaN(cp_price)) {
|
||||
if(cp_type == "1")
|
||||
alert("할인비율을 숫자로 입력해 주십시오.");
|
||||
else
|
||||
alert("할인금액을 숫자로 입력해 주십시오.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
cp_price = parseInt(cp_price);
|
||||
|
||||
if(cp_type == "1" && (cp_price < 1 || cp_price > 99)) {
|
||||
alert("할인비율을 1과 99 사이의 숫자로 입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 전체회원일 때 쿠폰알림 체크되어 있으면 확인창
|
||||
if(f.chk_all_mb.checked && (f.cp_sms_send.checked || f.cp_email_send.checked)) {
|
||||
if(!confirm("전체회원에게 쿠폰발행알림을 발송하시겠습니까?"))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
205
adm/shop_admin/couponformupdate.php
Normal file
@ -0,0 +1,205 @@
|
||||
<?php
|
||||
$sub_menu = '400800';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$_POST = array_map('trim', $_POST);
|
||||
|
||||
if(!$_POST['cp_subject'])
|
||||
alert('쿠폰이름을 입력해 주십시오.');
|
||||
|
||||
if($_POST['cp_method'] == 0 && !$_POST['cp_target'])
|
||||
alert('적용상품을 입력해 주십시오.');
|
||||
|
||||
if($_POST['cp_method'] == 1 && !$_POST['cp_target'])
|
||||
alert('적용분류를 입력해 주십시오.');
|
||||
|
||||
if(!$_POST['mb_id'] && !$_POST['chk_all_mb'])
|
||||
alert('회원아이디를 입력해 주십시오.');
|
||||
|
||||
if(!$_POST['cp_start'] || !$_POST['cp_end'])
|
||||
alert('사용 시작일과 종료일을 입력해 주십시오.');
|
||||
|
||||
if($_POST['cp_start'] > $_POST['cp_end'])
|
||||
alert('사용 시작일은 종료일 이전으로 입력해 주십시오.');
|
||||
|
||||
if($_POST['cp_end'] < G5_TIME_YMD)
|
||||
alert('종료일은 오늘('.G5_TIME_YMD.')이후로 입력해 주십시오.');
|
||||
|
||||
if(!$_POST['cp_price']) {
|
||||
if($_POST['cp_type'])
|
||||
alert('할인비율을 입력해 주십시오.');
|
||||
else
|
||||
alert('할인금액을 입력해 주십시오.');
|
||||
}
|
||||
|
||||
if($_POST['cp_type'] && ($_POST['cp_price'] < 1 || $_POST['cp_price'] > 99))
|
||||
alert('할인비율을은 1과 99사이 값으로 입력해 주십시오.');
|
||||
|
||||
if($_POST['cp_method'] == 0) {
|
||||
$sql = " select count(*) as cnt from {$g5['g5_shop_item_table']} where it_id = '$cp_target' and it_nocoupon = '0' ";
|
||||
$row = sql_fetch($sql);
|
||||
if(!$row['cnt'])
|
||||
alert('입력하신 상품코드는 존재하지 않는 코드이거나 쿠폰적용안함으로 설정된 상품입니다.');
|
||||
} else if($_POST['cp_method'] == 1) {
|
||||
$sql = " select count(*) as cnt from {$g5['g5_shop_category_table']} where ca_id = '$cp_target' and ca_nocoupon = '0' ";
|
||||
$row = sql_fetch($sql);
|
||||
if(!$row['cnt'])
|
||||
alert('입력하신 분류코드는 존재하지 않는 분류코드이거나 쿠폰적용안함으로 설정된 분류입니다.');
|
||||
}
|
||||
|
||||
if($w == '') {
|
||||
if($_POST['chk_all_mb']) {
|
||||
$mb_id = '전체회원';
|
||||
} else {
|
||||
$sql = " select mb_id from {$g5['member_table']} where mb_id = '{$_POST['mb_id']}' and mb_leave_date = '' and mb_intercept_date = '' ";
|
||||
$row = sql_fetch($sql);
|
||||
if(!$row['mb_id'])
|
||||
alert('입력하신 회원아이디는 존재하지 않거나 탈퇴 또는 차단된 회원아이디입니다.');
|
||||
|
||||
$mb_id = $_POST['mb_id'];
|
||||
}
|
||||
|
||||
$j = 0;
|
||||
do {
|
||||
$cp_id = get_coupon_id();
|
||||
|
||||
$sql3 = " select count(*) as cnt from {$g5['g5_shop_coupon_table']} where cp_id = '$cp_id' ";
|
||||
$row3 = sql_fetch($sql3);
|
||||
|
||||
if(!$row3['cnt'])
|
||||
break;
|
||||
else {
|
||||
if($j > 20)
|
||||
die('Coupon ID Error');
|
||||
}
|
||||
} while(1);
|
||||
|
||||
$sql = " INSERT INTO {$g5['g5_shop_coupon_table']}
|
||||
( cp_id, cp_subject, cp_method, cp_target, mb_id, cp_start, cp_end, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum, cp_datetime )
|
||||
VALUES
|
||||
( '$cp_id', '$cp_subject', '$cp_method', '$cp_target', '$mb_id', '$cp_start', '$cp_end', '$cp_type', '$cp_price', '$cp_trunc', '$cp_minimum', '$cp_maximum', '".G5_TIME_YMDHIS."' ) ";
|
||||
|
||||
sql_query($sql);
|
||||
} else if($w == 'u') {
|
||||
$sql = " select * from {$g5['g5_shop_coupon_table']} where cp_id = '$cp_id' ";
|
||||
$cp = sql_fetch($sql);
|
||||
|
||||
if(!$cp['cp_id'])
|
||||
alert('쿠폰정보가 존해하지 않습니다.', './couponlist.php');
|
||||
|
||||
if($_POST['chk_all_mb']) {
|
||||
$mb_id = '전체회원';
|
||||
}
|
||||
|
||||
$sql = " update {$g5['g5_shop_coupon_table']}
|
||||
set cp_subject = '$cp_subject',
|
||||
cp_method = '$cp_method',
|
||||
cp_target = '$cp_target',
|
||||
mb_id = '$mb_id',
|
||||
cp_start = '$cp_start',
|
||||
cp_end = '$cp_end',
|
||||
cp_type = '$cp_type',
|
||||
cp_price = '$cp_price',
|
||||
cp_trunc = '$cp_trunc',
|
||||
cp_maximum = '$cp_maximum',
|
||||
cp_minimum = '$cp_minimum'
|
||||
where cp_id = '$cp_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
// 쿠폰생성알림 발송
|
||||
if($w == '' && ($_POST['cp_sms_send'] || $_POST['cp_email_send'])) {
|
||||
include_once(G5_LIB_PATH.'/mailer.lib.php');
|
||||
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
|
||||
|
||||
$sms_count = 0;
|
||||
if($config['cf_sms_use'] == 'icode' && $_POST['cp_sms_send'])
|
||||
{
|
||||
$SMS = new SMS;
|
||||
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
|
||||
}
|
||||
|
||||
$arr_send_list = array();
|
||||
|
||||
if($_POST['chk_all_mb']) {
|
||||
$sql = " select mb_id, mb_name, mb_hp, mb_email, mb_mailling, mb_sms
|
||||
from {$g5['member_table']}
|
||||
where mb_leave_date = ''
|
||||
and mb_intercept_date = ''
|
||||
and ( mb_mailling = '1' or mb_sms = '1' )
|
||||
and mb_id <> '{$config['cf_admin']}' ";
|
||||
} else {
|
||||
$sql = " select mb_id, mb_name, mb_hp, mb_email, mb_mailling, mb_sms
|
||||
from {$g5['member_table']}
|
||||
where mb_id = '$mb_id' ";
|
||||
}
|
||||
|
||||
$result = sql_query($sql);
|
||||
|
||||
for($i=0; $row = sql_fetch_array($result); $i++) {
|
||||
$arr_send_list[] = $row;
|
||||
}
|
||||
|
||||
$count = count($arr_send_list);
|
||||
|
||||
for($i=0; $i<$count; $i++) {
|
||||
if(!$arr_send_list[$i]['mb_id'])
|
||||
continue;
|
||||
|
||||
// SMS
|
||||
if($config['cf_sms_use'] == 'icode' && $_POST['cp_sms_send'] && $arr_send_list[$i]['mb_hp'] && $arr_send_list[$i]['mb_sms']) {
|
||||
$sms_contents = $cp_subject.' 쿠폰이 '.get_text($arr_send_list[$i]['mb_name']).'님께 발행됐습니다. 쿠폰만료 : '.$cp_end.' '.str_replace('http://', '', G5_URL);
|
||||
$sms_contents = iconv_euckr($sms_contents);
|
||||
|
||||
if($sms_contents) {
|
||||
$receive_number = preg_replace("/[^0-9]/", "", $arr_send_list[$i]['mb_hp']); // 수신자번호
|
||||
$send_number = preg_replace("/[^0-9]/", "", $default['de_admin_company_tel']); // 발신자번호
|
||||
|
||||
if($receive_number && $send_number) {
|
||||
$SMS->Add($receive_number, $send_number, $config['cf_icode_id'], $sms_contents, "");
|
||||
$sms_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// E-MAIL
|
||||
if($config['cf_email_use'] && $_POST['cp_email_send'] && $arr_send_list[$i]['mb_email'] && $arr_send_list[$i]['mb_mailling']) {
|
||||
$mb_name = get_text($arr_send_list[$i]['mb_name']);
|
||||
switch($cp_method) {
|
||||
case 2:
|
||||
$coupon_method = '결제금액할인';
|
||||
break;
|
||||
case 3:
|
||||
$coupon_method = '배송비할인';
|
||||
break;
|
||||
default:
|
||||
$coupon_method = '개별상품할인';
|
||||
break;
|
||||
}
|
||||
$contents = '쿠폰명 : '.$cp_subject.'<br>';
|
||||
$contents .= '적용대상 : '.$coupon_method.'<br>';
|
||||
$contents .= '쿠폰만료 : '.$cp_end;
|
||||
|
||||
$title = $config['cf_title'].' - 쿠폰발행알림 메일';
|
||||
$email = $arr_send_list[$i]['mb_email'];
|
||||
|
||||
ob_start();
|
||||
include G5_SHOP_PATH.'/mail/couponmail.mail.php';
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $email, $title, $content, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// SMS발송
|
||||
if($config['cf_sms_use'] == 'icode' && $_POST['cp_sms_send'] && $sms_count)
|
||||
{
|
||||
$SMS->Send();
|
||||
}
|
||||
}
|
||||
|
||||
goto_url('./couponlist.php');
|
||||
?>
|
||||
193
adm/shop_admin/couponlist.php
Normal file
@ -0,0 +1,193 @@
|
||||
<?php
|
||||
$sub_menu = '400800';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$token = get_token();
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_coupon_table']} ";
|
||||
|
||||
$sql_search = " where (1) ";
|
||||
if ($stx) {
|
||||
$sql_search .= " and ( ";
|
||||
switch ($sfl) {
|
||||
case 'mb_id' :
|
||||
$sql_search .= " ({$sfl} = '{$stx}') ";
|
||||
break;
|
||||
default :
|
||||
$sql_search .= " ({$sfl} like '%{$stx}%') ";
|
||||
break;
|
||||
}
|
||||
$sql_search .= " ) ";
|
||||
}
|
||||
|
||||
if (!$sst) {
|
||||
$sst = "cp_no";
|
||||
$sod = "desc";
|
||||
}
|
||||
$sql_order = " order by {$sst} {$sod} ";
|
||||
|
||||
$sql = " select count(*) as cnt
|
||||
{$sql_common}
|
||||
{$sql_search}
|
||||
{$sql_order} ";
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql = " select *
|
||||
{$sql_common}
|
||||
{$sql_search}
|
||||
{$sql_order}
|
||||
limit {$from_record}, {$rows} ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$g5['title'] = '쿠폰관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$colspan = 9;
|
||||
?>
|
||||
|
||||
<form name="fsearch" id="fsearch" class="local_sch01 local_sch" method="get">
|
||||
<span>
|
||||
전체 <?php echo number_format($total_count) ?> 개
|
||||
</span>
|
||||
<select name="sfl" title="검색대상">
|
||||
<option value="mb_id"<?php echo get_selected($_GET['sfl'], "mb_id"); ?>>회원아이디</option>
|
||||
<option value="cp_subject"<?php echo get_selected($_GET['sfl'], "cp_subject"); ?>>쿠폰이름</option>
|
||||
<option value="cp_id"<?php echo get_selected($_GET['sfl'], "cp_id"); ?>>쿠폰코드</option>
|
||||
</select>
|
||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="required frm_input">
|
||||
<input type="submit" class="btn_submit" value="검색">
|
||||
</form>
|
||||
|
||||
<div class="btn_add01 btn_add">
|
||||
<a href="./couponform.php" id="coupon_add">쿠폰 추가</a>
|
||||
</div>
|
||||
|
||||
<form name="fcouponlist" id="fcouponlist" method="post" action="./couponlist_delete.php" onsubmit="return fcouponlist_submit(this);">
|
||||
<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="token" value="<?php echo $token; ?>">
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?></caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="chkall" class="sound_only">쿠폰 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<th scope="col">쿠폰종류</th>
|
||||
<th scope="col">쿠폰코드</th>
|
||||
<th scope="col">쿠폰이름</th>
|
||||
<th scope="col">적용대상</th>
|
||||
<th scope="col"><?php echo subject_sort_link('mb_id') ?>회원아이디</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link('cp_end') ?>사용기한</a></th>
|
||||
<th scope="col">사용회수</th>
|
||||
<th scope="col">관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
switch($row['cp_method']) {
|
||||
case '0':
|
||||
$sql3 = " select it_name from {$g5['g5_shop_item_table']} where it_id = '{$row['cp_target']}' ";
|
||||
$row3 = sql_fetch($sql3);
|
||||
$cp_method = '개별상품할인';
|
||||
$cp_target = get_text($row3['it_name']);
|
||||
break;
|
||||
case '1':
|
||||
$sql3 = " select ca_name from {$g5['g5_shop_category_table']} where ca_id = '{$row['cp_target']}' ";
|
||||
$row3 = sql_fetch($sql3);
|
||||
$cp_method = '카테고리할인';
|
||||
$cp_target = get_text($row3['ca_name']);
|
||||
break;
|
||||
case '2':
|
||||
$cp_method = '주문금액할인';
|
||||
$cp_target = '주문금액';
|
||||
break;
|
||||
case '3':
|
||||
$cp_method = '배송비할인';
|
||||
$cp_target = '배송비';
|
||||
break;
|
||||
}
|
||||
|
||||
$link1 = '<a href="./orderform.php?od_id='.$row['od_id'].'">';
|
||||
$link2 = '</a>';
|
||||
|
||||
// 쿠폰사용회수
|
||||
$sql = " select count(*) as cnt from {$g5['g5_shop_coupon_log_table']} where cp_id = '{$row['cp_id']}' ";
|
||||
$tmp = sql_fetch($sql);
|
||||
$used_count = $tmp['cnt'];
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td class="td_chk">
|
||||
<input type="hidden" id="cp_id_<?php echo $i; ?>" name="cp_id[<?php echo $i; ?>]" value="<?php echo $row['cp_id']; ?>">
|
||||
<input type="checkbox" id="chk_<?php echo $i; ?>" name="chk[]" value="<?php echo $i; ?>" title="내역선택">
|
||||
</td>
|
||||
<td><?php echo $cp_method; ?></td>
|
||||
<td><?php echo $row['cp_id']; ?></td>
|
||||
<td><?php echo $row['cp_subject']; ?></td>
|
||||
<td><?php echo $cp_target; ?></td>
|
||||
<td class="td_name sv_use"><div><?php echo $row['mb_id']; ?></div></td>
|
||||
<td class="td_datetime"><?php echo substr($row['cp_start'], 2, 8); ?> ~ <?php echo substr($row['cp_end'], 2, 8); ?></td>
|
||||
<td class="td_cntsmall"><?php echo number_format($used_count); ?></td>
|
||||
<td class="td_mngsmall">
|
||||
<a href="./couponform.php?w=u&cp_id=<?php echo $row['cp_id']; ?>&<?php echo $qstr; ?>"><span class="sound_only"><?php echo $row['cp_id']; ?> </span>수정</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_list01 btn_list">
|
||||
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
|
||||
</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="); ?>
|
||||
|
||||
<script>
|
||||
function fcouponlist_submit(f)
|
||||
{
|
||||
if (!is_checked("chk[]")) {
|
||||
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(document.pressed == "선택삭제") {
|
||||
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
25
adm/shop_admin/couponlist_delete.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
$sub_menu = '400800';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
auth_check($auth[$sub_menu], 'd');
|
||||
|
||||
check_token();
|
||||
|
||||
$count = count($_POST['chk']);
|
||||
if(!$count)
|
||||
alert('선택삭제 하실 항목을 하나이상 선택해 주세요.');
|
||||
|
||||
for ($i=0; $i<$count; $i++)
|
||||
{
|
||||
// 실제 번호를 넘김
|
||||
$k = $_POST['chk'][$i];
|
||||
|
||||
$sql = " delete from {$g5['g5_shop_coupon_table']} where cp_id = '{$_POST['cp_id'][$k]}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
goto_url('./couponlist.php');
|
||||
?>
|
||||
96
adm/shop_admin/couponmember.php
Normal file
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
$sub_menu = '400800';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$html_title = '회원검색';
|
||||
|
||||
$g5['title'] = $html_title;
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
$sql_common = " from {$g5['member_table']} ";
|
||||
$sql_where = " where mb_id <> '{$config['cf_admin']}' and mb_leave_date = '' and mb_intercept_date ='' ";
|
||||
|
||||
if($_GET['mb_name'])
|
||||
$sql_where .= " and mb_name like '%$mb_name%' ";
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common . $sql_where;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql = " select mb_id, mb_name
|
||||
$sql_common
|
||||
$sql_where
|
||||
order by mb_id
|
||||
limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$qstr1 = 'mb_name='.$_GET['mb_name'];
|
||||
?>
|
||||
|
||||
<div id="sch_member_frm" class="new_win scp_new_win">
|
||||
<h1>쿠폰 적용 회원선택</h1>
|
||||
|
||||
<form name="fmember" method="get">
|
||||
<div id="scp_list_find">
|
||||
<label for="mb_name">회원이름</label>
|
||||
<input type="text" name="mb_name" id="mb_name" value="<?php echo $mb_name; ?>" class="frm_input required" required size="20">
|
||||
<input type="submit" value="검색" class="btn_frmline">
|
||||
</div>
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption>검색결과</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>회원이름</th>
|
||||
<th>회원아이디</th>
|
||||
<th>선택</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
?>
|
||||
<tr>
|
||||
<td class="td_mbname"><?php echo get_text($row['mb_name']); ?></td>
|
||||
<td><?php echo $row['mb_id']; ?></td>
|
||||
<td class="scp_find_select"><button type="button" class="btn_frmline" onclick="sel_member_id('<?php echo $row['mb_id']; ?>');">선택</button></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
if($i ==0)
|
||||
echo '<tr><td colspan="3" class="empty_table">검색된 자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, '?'.$qstr1.'&page='); ?>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<button type="button" onclick="window.close();">닫기</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function sel_member_id(id)
|
||||
{
|
||||
var f = window.opener.document.fcouponform;
|
||||
f.mb_id.value = id;
|
||||
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
124
adm/shop_admin/coupontarget.php
Normal file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
$sub_menu = '400800';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
if($_GET['sch_target'] == 1) {
|
||||
$html_title = '분류';
|
||||
$t_name = '분류명';
|
||||
$t_id = '분류코드';
|
||||
$t_desc1 = '분류를';
|
||||
$t_desc2 = '분류가';
|
||||
} else {
|
||||
$html_title = '상품';
|
||||
$t_name = '상품명';
|
||||
$t_id = '상품코드';
|
||||
$t_desc1 = '상품을';
|
||||
$t_desc2 = '상품이';
|
||||
}
|
||||
|
||||
$g5['title'] = $html_title.'검색';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
if($_GET['sch_target'] == 1) {
|
||||
$sql_common = " from {$g5['g5_shop_category_table']} ";
|
||||
$sql_where = " where ca_use = '1' and ca_nocoupon = '0' ";
|
||||
if($_GET['sch_word'])
|
||||
$sql_where .= " and ca_name like '%$sch_word%' ";
|
||||
$sql_select = " select ca_id as t_id, ca_name as t_name ";
|
||||
$sql_order = " order by ca_order, ca_name ";
|
||||
} else {
|
||||
$sql_common = " from {$g5['g5_shop_item_table']} ";
|
||||
$sql_where = " where it_use = '1' and it_nocoupon = '0' ";
|
||||
if($_GET['sch_word'])
|
||||
$sql_where .= " and it_name like '%$sch_word%' ";
|
||||
$sql_select = " select it_id as t_id, it_name as t_name ";
|
||||
$sql_order = " order by it_order, it_name ";
|
||||
}
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common . $sql_where;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql = $sql_select . $sql_common . $sql_where . $sql_order . " limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$qstr1 = 'sch_target='.$_GET['sch_target'].'&sch_word='.$_GET['sch_word'];
|
||||
?>
|
||||
|
||||
<div id="sch_target_frm" class="new_win scp_new_win">
|
||||
<h1>쿠폰 적용 <?php echo $html_title; ?>선택</h1>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>
|
||||
쿠폰을 적용할 <?php echo $t_desc1; ?> 선택하세요.<br>
|
||||
<?php echo $t_desc2; ?> 많을 경우에는 검색 기능을 이용하세요.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form name="ftarget" method="get">
|
||||
<input type="hidden" name="sch_target" value="<?php echo $_GET['sch_target']; ?>">
|
||||
|
||||
<div id="scp_list_find">
|
||||
<label for="sch_word"><?php echo $t_name; ?></label>
|
||||
<input type="text" name="sch_word" id="sch_word" value="<?php echo $sch_word; ?>" class="frm_input required" required size="20">
|
||||
<input type="submit" value="검색" class="btn_frmline">
|
||||
</div>
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption>검색결과</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?php echo $t_name; ?></th>
|
||||
<th scope="col"><?php echo $t_id; ?></th>
|
||||
<th scope="col">선택</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $row['t_name']; ?></td>
|
||||
<td class="scp_target_code"><?php echo $row['t_id']; ?></td>
|
||||
<td class="scp_target_select"><button type="button" class="btn_frmline" onclick="sel_target_id('<?php echo $row['t_id']; ?>');">선택</button>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
if($i ==0)
|
||||
echo '<tr><td colspan="3" class="empty_table">검색된 자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, '?'.$qstr1.'&page='); ?>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<button type="button" onclick="window.close();">닫기</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function sel_target_id(id)
|
||||
{
|
||||
var f = window.opener.document.fcouponform;
|
||||
f.cp_target.value = id;
|
||||
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
BIN
adm/shop_admin/img/icon_reply.gif
Normal file
|
After Width: | Height: | Size: 77 B |
BIN
adm/shop_admin/img/mobilebg.jpg
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
adm/shop_admin/img/sms_back.gif
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
542
adm/shop_admin/index.php
Normal file
@ -0,0 +1,542 @@
|
||||
<?php
|
||||
$sub_menu = '400000';
|
||||
include_once('./_common.php');
|
||||
|
||||
$max_limit = 7; // 몇행 출력할 것인지?
|
||||
|
||||
$g5['title'] = ' 쇼핑몰관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$pg_anchor = '<ul class="anchor sidx_anchor">
|
||||
<li><a href="#anc_sidx_ord">주문현황</a></li>
|
||||
<li><a href="#anc_sidx_rdy">입금완료미배송내역</a></li>
|
||||
<li><a href="#anc_sidx_wait">미입금주문내역</a></li>
|
||||
<li><a href="#anc_sidx_ps">사용후기</a></li>
|
||||
<li><a href="#anc_sidx_qna">상품문의</a></li>
|
||||
</ul>';
|
||||
|
||||
// 주문상태에 따른 합계 금액
|
||||
function get_order_status_sum($status)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$sql = " select count(*) as cnt,
|
||||
sum(od_cart_price + od_send_cost + od_send_cost2 - od_cancel_price) as price
|
||||
from {$g5['g5_shop_order_table']}
|
||||
where od_status = '$status' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
$info = array();
|
||||
$info['count'] = (int)$row['cnt'];
|
||||
$info['price'] = (int)$row['price'];
|
||||
$info['href'] = './orderlist.php?od_status='.urlencode($status);
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
// 일자별 주문 합계 금액
|
||||
function get_order_date_sum($date)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$sql = " select sum(od_cart_price + od_send_cost + od_send_cost2) as orderprice,
|
||||
sum(od_cancel_price) as cancelprice
|
||||
from {$g5['g5_shop_order_table']}
|
||||
where SUBSTRING(od_time, 1, 10) = '$date' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
$info = array();
|
||||
$info['order'] = (int)$row['orderprice'];
|
||||
$info['cancel'] = (int)$row['cancelprice'];
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
// 일자별 결제수단 주문 합계 금액
|
||||
function get_order_settle_sum($date)
|
||||
{
|
||||
global $g5, $default;
|
||||
|
||||
$case = array('신용카드', '계좌이체', '가상계좌', '무통장', '휴대폰');
|
||||
$info = array();
|
||||
|
||||
// 결제수단별 합계
|
||||
foreach($case as $val)
|
||||
{
|
||||
$sql = " select sum(od_cart_price + od_send_cost + od_send_cost2 - od_receipt_point - od_cart_coupon - od_coupon - od_send_coupon) as price,
|
||||
count(*) as cnt
|
||||
from {$g5['g5_shop_order_table']}
|
||||
where SUBSTRING(od_time, 1, 10) = '$date'
|
||||
and od_settle_case = '$val' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
$info[$val]['price'] = (int)$row['price'];
|
||||
$info[$val]['count'] = (int)$row['cnt'];
|
||||
}
|
||||
|
||||
// 포인트 합계
|
||||
$sql = " select sum(od_receipt_point) as price,
|
||||
count(*) as cnt
|
||||
from {$g5['g5_shop_order_table']}
|
||||
where SUBSTRING(od_time, 1, 10) = '$date'
|
||||
and od_receipt_point > 0 ";
|
||||
$row = sql_fetch($sql);
|
||||
$info['포인트']['price'] = (int)$row['price'];
|
||||
$info['포인트']['count'] = (int)$row['cnt'];
|
||||
|
||||
// 쿠폰 합계
|
||||
$sql = " select sum(od_cart_coupon + od_coupon + od_send_coupon) as price,
|
||||
count(*) as cnt
|
||||
from {$g5['g5_shop_order_table']}
|
||||
where SUBSTRING(od_time, 1, 10) = '$date'
|
||||
and ( od_cart_coupon > 0 or od_coupon > 0 or od_send_coupon > 0 ) ";
|
||||
$row = sql_fetch($sql);
|
||||
$info['쿠폰']['price'] = (int)$row['price'];
|
||||
$info['쿠폰']['count'] = (int)$row['cnt'];
|
||||
|
||||
return $info;
|
||||
}
|
||||
|
||||
function get_max_value($arr)
|
||||
{
|
||||
foreach($arr as $key => $val)
|
||||
{
|
||||
if(is_array($val))
|
||||
{
|
||||
$arr[$key] = get_max_value($val);
|
||||
}
|
||||
}
|
||||
|
||||
sort($arr);
|
||||
|
||||
return array_pop($arr);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="sidx">
|
||||
<section id="anc_sidx_ord">
|
||||
<h2>주문현황</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
|
||||
<?php
|
||||
$arr_order = array();
|
||||
$x_val = array();
|
||||
for($i=6; $i>=0; $i--) {
|
||||
$date = date('Y-m-d', strtotime('-'.$i.' days', G5_SERVER_TIME));
|
||||
|
||||
$x_val[] = $date;
|
||||
$arr_order[] = get_order_date_sum($date);
|
||||
}
|
||||
|
||||
$max_y = get_max_value($arr_order);
|
||||
$max_y = ceil(($max_y) / 1000) * 1000;
|
||||
$y_val = array();
|
||||
$y_val[] = $max_y;
|
||||
|
||||
for($i=4; $i>=1; $i--) {
|
||||
$y_val[] = $max_y * (($i * 2) / 10);
|
||||
}
|
||||
|
||||
$max_height = 230;
|
||||
$h_val = array();
|
||||
$js_val = array();
|
||||
$offset = 10; // 금액이 상대적으로 작아 높이가 0일 때 기본 높이로 사용
|
||||
foreach($arr_order as $val) {
|
||||
if($val['order'] > 0)
|
||||
$h1 = intval(($max_height * $val['order']) / $max_y) + $offset;
|
||||
else
|
||||
$h1 = 0;
|
||||
|
||||
if($val['cancel'] > 0)
|
||||
$h2 = intval(($max_height * $val['cancel']) / $max_y) + $offset;
|
||||
else
|
||||
$h2 = 0 ;
|
||||
|
||||
$h_val['order'][] = $h1;
|
||||
$h_val['cancel'][] = $h2;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="sidx_graph">
|
||||
<ul id="sidx_graph_price">
|
||||
<?php
|
||||
foreach($y_val as $val) {
|
||||
?>
|
||||
<li><span></span><?php echo number_format($val); ?></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<ul id="sidx_graph_area">
|
||||
<?php
|
||||
for($i=0; $i<count($x_val); $i++) {
|
||||
$order_title = date("n월 j일", strtotime($x_val[$i])).' 주문: '.display_price($arr_order[$i]['order']);
|
||||
$cancel_title = date("n월 j일", strtotime($x_val[$i])).' 취소: '.display_price($arr_order[$i]['cancel']);
|
||||
$k = 10 - $i;
|
||||
$li_bg = 'bg'.($i%2);
|
||||
?>
|
||||
<li class="<?php echo $li_bg; ?>" style="z-index:<?php echo $k; ?>">
|
||||
<div class="graph order" title="<?php echo $order_title; ?>">
|
||||
|
||||
</div>
|
||||
<div class="graph cancel" title="<?php echo $cancel_title; ?>">
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<ul id="sidx_graph_date">
|
||||
<?php
|
||||
foreach($x_val as $val) {
|
||||
?>
|
||||
<li><span></span><?php echo substr($val, 5, 5).' ('.get_yoil($val).')'; ?></li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<div id="sidx_graph_legend">
|
||||
<span id="legend_order"></span> 주문
|
||||
<span id="legend_cancel"></span> 취소
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div id="sidx_stat">
|
||||
<section id="anc_sidx_act">
|
||||
<h2>처리할 주문</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
|
||||
<div id="sidx_take_act" class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="td_mng">상태변경</th>
|
||||
<th scope="col">건수</th>
|
||||
<th scope="col">금액</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<?php
|
||||
$info = get_order_status_sum('주문');
|
||||
?>
|
||||
<th scope="row">주문 -> 입금</th>
|
||||
<td class="td_numbig"><a href="<?php echo $info['href']; ?>"><?php echo number_format($info['count']); ?></a></td>
|
||||
<td class="td_price"><a href="<?php echo $info['href']; ?>"><?php echo number_format($info['price']); ?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$info = get_order_status_sum('입금');
|
||||
?>
|
||||
<th scope="row">입금 -> 준비</th>
|
||||
<td class="td_numbig"><a href="<?php echo $info['href']; ?>"><?php echo number_format($info['count']); ?></a></td>
|
||||
<td class="td_price"><a href="<?php echo $info['href']; ?>"><?php echo number_format($info['price']); ?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$info = get_order_status_sum('준비');
|
||||
?>
|
||||
<th scope="row">준비 -> 배송</th>
|
||||
<td class="td_numbig"><a href="<?php echo $info['href']; ?>"><?php echo number_format($info['count']); ?></a></td>
|
||||
<td class="td_price"><a href="<?php echo $info['href']; ?>"><?php echo number_format($info['price']); ?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
$info = get_order_status_sum('배송');
|
||||
?>
|
||||
<th scope="row">배송 -> 완료</th>
|
||||
<td class="td_numbig"><a href="<?php echo $info['href']; ?>"><?php echo number_format($info['count']); ?></a></td>
|
||||
<td class="td_price"><a href="<?php echo $info['href']; ?>"><?php echo number_format($info['price']); ?></a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="anc_sidx_stock">
|
||||
<h2>재고현황</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
|
||||
<?php
|
||||
// 재고부족 상품
|
||||
$item_noti = 0;
|
||||
$sql = " select count(*) as cnt
|
||||
from {$g5['g5_shop_item_table']}
|
||||
where it_use = '1'
|
||||
and it_option_subject = ''
|
||||
and it_stock_qty <= it_noti_qty ";
|
||||
$row = sql_fetch($sql);
|
||||
$item_noti = (int)$row['cnt'];
|
||||
|
||||
// 재고부족 옵션
|
||||
$option_noti = 0;
|
||||
$sql = " select count(*) as cnt
|
||||
from {$g5['g5_shop_item_option_table']}
|
||||
where io_use = '1'
|
||||
and io_stock_qty <= io_noti_qty ";
|
||||
$row = sql_fetch($sql);
|
||||
$option_noti = (int)$row['cnt'];
|
||||
|
||||
// SMS 정보
|
||||
if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
|
||||
$userinfo = get_icode_userinfo($config['cf_icode_id'], $config['cf_icode_pw']);
|
||||
}
|
||||
?>
|
||||
<div id="sidx_stock" class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">재고부족 상품</th>
|
||||
<th scope="col">재고부족 옵션</th>
|
||||
<th scope="col">SMS 잔여금액</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="td_numbig"><a href="./itemstocklist.php"><?php echo number_format($item_noti); ?></a></td>
|
||||
<td class="td_numbig"><a href="./optionstocklist.php"><?php echo number_format($option_noti); ?></a></td>
|
||||
<td class="td_price"><?php echo display_price(intval($userinfo['coin'])); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section id="anc_sidx_settle">
|
||||
<h2>결제수단별 주문현황</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
|
||||
<div id="sidx_settle" class="tbl_head02 tbl_wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" rowspan="2">구분</th>
|
||||
<?php
|
||||
$term = 3;
|
||||
$info = array();
|
||||
$info_key = array();
|
||||
for($i=($term - 1); $i>=0; $i--) {
|
||||
$date = date("Y-m-d", strtotime('-'.$i.' days', G5_SERVER_TIME));
|
||||
$info[$date] = get_order_settle_sum($date);
|
||||
|
||||
$day = substr($date, 5, 5).' ('.get_yoil($date).')';
|
||||
$info_key[] = $date;
|
||||
?>
|
||||
<th scope="col" colspan="2"><?php echo $day; ?></th>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
for($i=0; $i<$term; $i++) {
|
||||
?>
|
||||
<th scope="col">건수</th>
|
||||
<th scope="col">금액</th>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$case = array('신용카드', '계좌이체', '가상계좌', '무통장', '휴대폰', '포인트', '쿠폰');
|
||||
|
||||
foreach($case as $val)
|
||||
{
|
||||
$val_cnt ++;
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row" id="th_val_<?php echo $val_cnt; ?>" class="td_category"><?php echo $val; ?></th>
|
||||
<?php
|
||||
foreach($info_key as $date)
|
||||
{
|
||||
?>
|
||||
<td><?php echo number_format($info[$date][$val]['count']); ?></td>
|
||||
<td><?php echo number_format($info[$date][$val]['price']); ?></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="sidx sidx_cs">
|
||||
<section id="anc_sidx_oneq">
|
||||
<h2>1:1문의</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
|
||||
<div class="ul_01 ul_wrap">
|
||||
<ul>
|
||||
<?php
|
||||
$sql = " select * from {$g5['qa_content_table']}
|
||||
where qa_status = '0'
|
||||
and qa_type = '0'
|
||||
order by qa_num
|
||||
limit $max_limit ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$sql1 = " select * from {$g5['member_table']} where mb_id = '{$row['mb_id']}' ";
|
||||
$row1 = sql_fetch($sql1);
|
||||
|
||||
$name = get_sideview($row['mb_id'], get_text($row['qa_name']), $row1['mb_email'], $row1['mb_homepage']);
|
||||
?>
|
||||
<li>
|
||||
<span class="oneq_cate oneq_span"><?php echo get_text($row['qa_category']); ?></span>
|
||||
<a href="<?php echo G5_BBS_URL; ?>/qaview.php?qa_id=<?php echo $row['qa_id']; ?>" target="_blank" class="oneq_link"><?php echo conv_subject($row['qa_subject'],40); ?></a>
|
||||
<?php echo $name; ?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($i == 0)
|
||||
echo '<li class="empty_list">자료가 없습니다.</li>';
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="btn_list03 btn_list">
|
||||
<a href="<?php echo G5_BBS_URL; ?>/qalist.php" target="_blank">1:1문의 더보기</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="anc_sidx_qna">
|
||||
<h2>상품문의</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
|
||||
<div class="ul_01 ul_wrap">
|
||||
<ul>
|
||||
<?php
|
||||
$sql = " select * from {$g5['g5_shop_item_qa_table']}
|
||||
where iq_answer = ''
|
||||
order by iq_id desc
|
||||
limit $max_limit ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$sql1 = " select * from {$g5['member_table']} where mb_id = '{$row['mb_id']}' ";
|
||||
$row1 = sql_fetch($sql1);
|
||||
|
||||
$name = get_sideview($row['mb_id'], get_text($row['iq_name']), $row1['mb_email'], $row1['mb_homepage']);
|
||||
?>
|
||||
<li>
|
||||
<a href="./itemqaform.php?w=u&iq_id=<?php echo $row['iq_id']; ?>" class="qna_link"><?php echo conv_subject($row['iq_subject'],40); ?></a>
|
||||
<?php echo $name; ?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($i == 0)
|
||||
echo '<li class="empty_list">자료가 없습니다.</li>';
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="btn_list03 btn_list">
|
||||
<a href="./itemqalist.php?sort1=iq_answer&sort2=asc">상품문의 더보기</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section id="anc_sidx_ps">
|
||||
<h2>사용후기</h2>
|
||||
<?php echo $pg_anchor; ?>
|
||||
|
||||
<div class="ul_01 ul_wrap">
|
||||
<ul>
|
||||
<?php
|
||||
$sql = " select * from {$g5['g5_shop_item_use_table']}
|
||||
where is_confirm = 0
|
||||
order by is_id desc
|
||||
limit $max_limit ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$sql1 = " select * from {$g5['member_table']} where mb_id = '{$row['mb_id']}' ";
|
||||
$row1 = sql_fetch($sql1);
|
||||
|
||||
$name = get_sideview($row['mb_id'], get_text($row['is_name']), $row1['mb_email'], $row1['mb_homepage']);
|
||||
?>
|
||||
<li>
|
||||
<a href="./itemuseform.php?w=u&is_id=<?php echo $row['is_id']; ?>" class="ps_link"><?php echo conv_subject($row['is_subject'],40); ?></a>
|
||||
<?php echo $name; ?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
if ($i == 0) echo '<li class="empty_list">자료가 없습니다.</li>';
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="btn_list03 btn_list">
|
||||
<a href="./itemuselist.php?sort1=is_confirm&sort2=asc">사용후기 더보기</a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
graph_draw();
|
||||
|
||||
$("#sidx_graph_area div").hover(
|
||||
function() {
|
||||
if($(this).is(":animated"))
|
||||
return false;
|
||||
|
||||
var title = $(this).attr("title");
|
||||
if(title && $(this).data("title") == undefined)
|
||||
$(this).data("title", title);
|
||||
var left = parseInt($(this).css("left")) + 10;
|
||||
var bottom = $(this).height() + 5;
|
||||
|
||||
$(this)
|
||||
.attr("title", "")
|
||||
.append("<div id=\"price_tooltip\"><div></div></div>");
|
||||
$("#price_tooltip")
|
||||
.find("div")
|
||||
.html(title)
|
||||
.end()
|
||||
// .css({ left: left+"px", bottom: bottom+"px" })
|
||||
.show(200);
|
||||
},
|
||||
function() {
|
||||
if($(this).is(":animated"))
|
||||
return false;
|
||||
|
||||
$(this).attr("title", $(this).data("title"));
|
||||
$("#price_tooltip").remove();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
function graph_draw()
|
||||
{
|
||||
var g_h1 = new Array("<?php echo implode('", "', $h_val['order']); ?>");
|
||||
var g_h2 = new Array("<?php echo implode('", "', $h_val['cancel']); ?>");
|
||||
var duration = 600;
|
||||
|
||||
var $el = $("#sidx_graph_area li");
|
||||
var h1, h2;
|
||||
var $g1, $g2;
|
||||
|
||||
$el.each(function(index) {
|
||||
h1 = g_h1[index];
|
||||
h2 = g_h2[index];
|
||||
|
||||
$g1 = $(this).find(".order");
|
||||
$g2 = $(this).find(".cancel");
|
||||
|
||||
$g1.animate({ height: h1+"px" }, duration);
|
||||
$g2.animate({ height: h2+"px" }, duration);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
46
adm/shop_admin/itemcopy.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
$sub_menu = '400300';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '상품 복사';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
?>
|
||||
|
||||
<div class="new_win">
|
||||
<h1>상품 복사</h1>
|
||||
<form name="fitemcopy">
|
||||
|
||||
<div id="sit_copy">
|
||||
<label for="new_it_id">상품코드</label>
|
||||
<input type="text" name="new_it_id" value="<?php echo time(); ?>" id="new_it_id" class="frm_input" maxlength="20">
|
||||
</div>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="button" value="복사하기" class="btn_submit" onclick="_copy('itemcopyupdate.php?it_id=<?php echo $it_id; ?>&ca_id=<?php echo $ca_id; ?>');">
|
||||
<button type="button" onclick="self.close();">창닫기</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// <![CDATA[
|
||||
function _copy(link)
|
||||
{
|
||||
var new_it_id = document.getElementById('new_it_id').value;
|
||||
var t_it_id = new_it_id.replace(/[A-Za-z0-9\-_]/g, "");
|
||||
if(t_it_id.length > 0) {
|
||||
alert("상품코드는 영문자, 숫자, -, _ 만 사용할 수 있습니다.");
|
||||
return false;
|
||||
}
|
||||
opener.parent.location.href = encodeURI(link+'&new_it_id='+new_it_id);
|
||||
self.close();
|
||||
}
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
165
adm/shop_admin/itemcopyupdate.php
Normal file
@ -0,0 +1,165 @@
|
||||
<?php
|
||||
$sub_menu = '400300';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
if ($is_admin != "super")
|
||||
alert("최고관리자만 접근 가능합니다.");
|
||||
|
||||
if (!trim($it_id))
|
||||
alert("복사할 상품코드가 없습니다.");
|
||||
|
||||
$t_it_id = preg_replace("/[A-Za-z0-9\-_]/", "", $new_it_id);
|
||||
if($t_it_id)
|
||||
alert("상품코드는 영문자, 숫자, -, _ 만 사용할 수 있습니다.");
|
||||
|
||||
$row = sql_fetch(" select count(*) as cnt from {$g5['g5_shop_item_table']} where it_id = '$new_it_id' ");
|
||||
if ($row['cnt'])
|
||||
alert('이미 존재하는 상품코드 입니다.');
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_item_table']} where it_id = '$it_id' limit 1 ";
|
||||
$cp = sql_fetch($sql);
|
||||
|
||||
|
||||
// 상품테이블의 필드가 추가되어도 수정하지 않도록 필드명을 추출하여 insert 퀴리를 생성한다. (상품코드만 새로운것으로 대체)
|
||||
$sql_common = "";
|
||||
$fields = mysql_list_fields(G5_MYSQL_DB, $g5['g5_shop_item_table']);
|
||||
$columns = mysql_num_fields($fields);
|
||||
for ($i = 0; $i < $columns; $i++) {
|
||||
$fld = mysql_field_name($fields, $i);
|
||||
if ($fld == 'it_id' || $fld == 'it_sum_qty' || $fld == 'it_use_cnt' || $fld == 'it_use_avg')
|
||||
continue;
|
||||
|
||||
$sql_common .= " , $fld = '".addslashes($cp[$fld])."' ";
|
||||
}
|
||||
|
||||
$sql = " insert {$g5['g5_shop_item_table']}
|
||||
set it_id = '$new_it_id'
|
||||
$sql_common ";
|
||||
sql_query($sql);
|
||||
|
||||
// 선택/추가 옵션 copy
|
||||
$opt_sql = " insert ignore into {$g5['g5_shop_item_option_table']} ( io_id, io_type, it_id, io_price, io_stock_qty, io_noti_qty, io_use )
|
||||
select io_id, io_type, '$new_it_id', io_price, io_stock_qty, io_noti_qty, io_use
|
||||
from {$g5['g5_shop_item_option_table']}
|
||||
where it_id = '$it_id'
|
||||
order by io_no asc ";
|
||||
sql_query($opt_sql);
|
||||
|
||||
// html 에디터로 첨부된 이미지 파일 복사
|
||||
if($cp['it_explan']) {
|
||||
$matchs = get_editor_image($cp['it_explan'], false);
|
||||
|
||||
// 파일의 경로를 얻어 복사
|
||||
for($i=0;$i<count($matchs[1]);$i++) {
|
||||
$p = parse_url($matchs[1][$i]);
|
||||
if(strpos($p['path'], "/data/") != 0)
|
||||
$src_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
|
||||
else
|
||||
$src_path = $p['path'];
|
||||
|
||||
$srcfile = G5_PATH.$src_path;
|
||||
$dstfile = preg_replace("/\.([^\.]+)$/", "_".$new_it_id.".\\1", $srcfile);
|
||||
|
||||
if(is_file($srcfile)) {
|
||||
copy($srcfile, $dstfile);
|
||||
|
||||
$newfile = preg_replace("/\.([^\.]+)$/", "_".$new_it_id.".\\1", $matchs[1][$i]);
|
||||
$cp['it_explan'] = str_replace($matchs[1][$i], $newfile, $cp['it_explan']);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = " update {$g5['g5_shop_item_table']} set it_explan = '".addslashes($cp['it_explan'])."' where it_id = '$new_it_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
if($cp['it_mobile_explan']) {
|
||||
$matchs = get_editor_image($cp['it_mobile_explan'], false);
|
||||
|
||||
// 파일의 경로를 얻어 복사
|
||||
for($i=0;$i<count($matchs[1]);$i++) {
|
||||
$p = parse_url($matchs[1][$i]);
|
||||
if(strpos($p['path'], "/data/") != 0)
|
||||
$src_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
|
||||
else
|
||||
$src_path = $p['path'];
|
||||
|
||||
$srcfile = G5_PATH.$src_path;
|
||||
$dstfile = preg_replace("/\.([^\.]+)$/", "_".$new_it_id.".\\1", $srcfile);
|
||||
|
||||
if(is_file($srcfile)) {
|
||||
copy($srcfile, $dstfile);
|
||||
|
||||
$newfile = preg_replace("/\.([^\.]+)$/", "_".$new_it_id.".\\1", $matchs[1][$i]);
|
||||
$cp['it_mobile_explan'] = str_replace($matchs[1][$i], $newfile, $cp['it_mobile_explan']);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = " update {$g5['g5_shop_item_table']} set it_mobile_explan = '".addslashes($cp['it_mobile_explan'])."' where it_id = '$new_it_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
// 상품이미지 복사
|
||||
function copy_directory($src_dir, $dest_dir)
|
||||
{
|
||||
if($src_dir == $dest_dir)
|
||||
return false;
|
||||
|
||||
if(!is_dir($src_dir))
|
||||
return false;
|
||||
|
||||
if(!is_dir($dest_dir)) {
|
||||
@mkdir($dest_dir, G5_DIR_PERMISSION);
|
||||
@chmod($dest_dir, G5_DIR_PERMISSION);
|
||||
}
|
||||
|
||||
$dir = opendir($src_dir);
|
||||
while (false !== ($filename = readdir($dir))) {
|
||||
if($filename == "." || $filename == "..")
|
||||
continue;
|
||||
|
||||
$files[] = $filename;
|
||||
}
|
||||
|
||||
for($i=0; $i<count($files); $i++) {
|
||||
$src_file = $src_dir.'/'.$files[$i];
|
||||
$dest_file = $dest_dir.'/'.$files[$i];
|
||||
if(is_file($src_file)) {
|
||||
copy($src_file, $dest_file);
|
||||
@chmod($dest_file, G5_FILE_PERMISSION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 파일복사
|
||||
$dest_path = G5_DATA_PATH.'/item/'.$new_it_id;
|
||||
@mkdir($dest_path, G5_DIR_PERMISSION);
|
||||
@chmod($dest_path, G5_DIR_PERMISSION);
|
||||
$comma = '';
|
||||
$sql_img = '';
|
||||
|
||||
for($i=1; $i<=10; $i++) {
|
||||
$file = G5_DATA_PATH.'/item/'.$cp['it_img'.$i];
|
||||
$new_img = '';
|
||||
|
||||
if(is_file($file)) {
|
||||
$dstfile = $dest_path.'/'.basename($file);
|
||||
copy($file, $dstfile);
|
||||
@chmod($dstfile, G5_FILE_PERMISSION);
|
||||
$new_img = $new_it_id.'/'.basename($file);
|
||||
}
|
||||
|
||||
$sql_img .= $comma." it_img{$i} = '$new_img' ";
|
||||
$comma = ',';
|
||||
}
|
||||
|
||||
$sql = " update {$g5['g5_shop_item_table']}
|
||||
set $sql_img
|
||||
where it_id = '$new_it_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
$qstr = "ca_id=$ca_id&sfl=$sfl&sca=$sca&page=$page&stx=".urlencode($stx)."&save_stx=".urlencode($save_stx);
|
||||
|
||||
goto_url("itemlist.php?$qstr");
|
||||
?>
|
||||
109
adm/shop_admin/itemdelete.inc.php
Normal file
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
// itemlistdelete.php 에서 include 하는 파일
|
||||
|
||||
if (!defined('_GNUBOARD_')) exit;
|
||||
if (!defined('_ITEM_DELETE_')) exit; // 개별 페이지 접근 불가
|
||||
|
||||
if (!function_exists("itemdelete")) {
|
||||
|
||||
// 상품삭제
|
||||
// 메세지출력후 주문개별내역페이지로 이동
|
||||
function itemdelete($it_id)
|
||||
{
|
||||
global $g5, $is_admin;
|
||||
|
||||
$sql = " select it_explan, it_mobile_explan, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10
|
||||
from {$g5['g5_shop_item_table']} where it_id = '$it_id' ";
|
||||
$it = sql_fetch($sql);
|
||||
|
||||
// 상품 이미지 삭제
|
||||
$dir_list = array();
|
||||
for($i=1; $i<=10; $i++) {
|
||||
$file = G5_DATA_PATH.'/item/'.$it['it_img'.$i];
|
||||
if(is_file($file) && $it['it_img'.$i]) {
|
||||
@unlink($file);
|
||||
$dir = dirname($file);
|
||||
delete_item_thumbnail($dir, basename($file));
|
||||
|
||||
if(!in_array($dir, $dir_list))
|
||||
$dir_list[] = $dir;
|
||||
}
|
||||
}
|
||||
|
||||
// 이미지디렉토리 삭제
|
||||
for($i=0; $i<count($dir_list); $i++) {
|
||||
if(is_dir($dir_list[$i]))
|
||||
rmdir($dir_list[$i]);
|
||||
}
|
||||
|
||||
// 상, 하단 이미지 삭제
|
||||
@unlink(G5_DATA_PATH."/item/$it_id"."_h");
|
||||
@unlink(G5_DATA_PATH."/item/$it_id"."_t");
|
||||
|
||||
// 장바구니 삭제
|
||||
$sql = " delete from {$g5['g5_shop_cart_table']} where it_id = '$it_id' and ct_status = '쇼핑' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 이벤트삭제
|
||||
$sql = " delete from {$g5['g5_shop_event_item_table']} where it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 사용후기삭제
|
||||
$sql = " delete from {$g5['g5_shop_item_use_table']} where it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 상품문의삭제
|
||||
$sql = " delete from {$g5['g5_shop_item_qa_table']} where it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 관련상품삭제
|
||||
$sql = " delete from {$g5['g5_shop_item_relation_table']} where it_id = '$it_id' or it_id2 = '$it_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 옵션삭제
|
||||
sql_query(" delete from {$g5['g5_shop_item_option_table']} where it_id = '$it_id' ");
|
||||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// HTML 내용에서 에디터에 올라간 이미지의 경로를 얻어 삭제함
|
||||
//------------------------------------------------------------------------
|
||||
$imgs = get_editor_image($it['it_explan'], false);
|
||||
|
||||
for($i=0;$i<count($imgs[1]);$i++) {
|
||||
$p = parse_url($imgs[1][$i]);
|
||||
if(strpos($p['path'], "/data/") != 0)
|
||||
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
|
||||
else
|
||||
$data_path = $p['path'];
|
||||
|
||||
$destfile = G5_PATH.$data_path;
|
||||
|
||||
if(is_file($destfile))
|
||||
@unlink($destfile);
|
||||
}
|
||||
|
||||
$imgs = get_editor_image($it['it_mobile_explan'], false);
|
||||
|
||||
for($i=0;$i<count($imgs[1]);$i++) {
|
||||
$p = parse_url($imgs[1][$i]);
|
||||
if(strpos($p['path'], "/data/") != 0)
|
||||
$data_path = preg_replace("/^\/.*\/data/", "/data", $p['path']);
|
||||
else
|
||||
$data_path = $p['path'];
|
||||
|
||||
$destfile = G5_PATH.$data_path;
|
||||
|
||||
if(is_file($destfile))
|
||||
@unlink($destfile);
|
||||
}
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
|
||||
// 상품 삭제
|
||||
$sql = " delete from {$g5['g5_shop_item_table']} where it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
itemdelete($it_id);
|
||||
?>
|
||||
89
adm/shop_admin/itemevent.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
$sub_menu = '500300';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '이벤트관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_event_table']} ";
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$sql = "select * $sql_common order by ev_id desc ";
|
||||
$result = sql_query($sql);
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
전체 이벤트 <?php echo $total_count ?>건
|
||||
</div>
|
||||
|
||||
|
||||
<div class="btn_add01 btn_add">
|
||||
<a href="./itemeventform.php">이벤트 추가</a>
|
||||
</div>
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<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 = "";
|
||||
$sql = " select count(ev_id) as cnt from {$g5['g5_shop_event_item_table']} where ev_id = '{$row['ev_id']}' ";
|
||||
$ev = sql_fetch($sql);
|
||||
if ($ev['cnt']) {
|
||||
$href = '<a href="javascript:;" onclick="itemeventwin('.$row['ev_id'].');">';
|
||||
$href_close = '</a>';
|
||||
}
|
||||
if ($row['ev_subject_strong']) $subject = '<strong>'.$row['ev_subject'].'</strong>';
|
||||
else $subject = $row['ev_subject'];
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td class="td_num"><?php echo $row['ev_id']; ?></td>
|
||||
<td><?php echo $subject; ?></td>
|
||||
<td class="td_num"><?php echo $href; ?><?php echo $ev['cnt']; ?><?php echo $href_close; ?></td>
|
||||
<td class="td_boolean"><?php echo $row['ev_use'] ? '<span class="txt_true">예</span>' : '<span class="txt_false">아니오</span>'; ?></td>
|
||||
<td class="td_mng">
|
||||
<a href="./itemeventform.php?w=u&ev_id=<?php echo $row['ev_id']; ?>">수정</a>
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/event.php?ev_id=<?php echo $row['ev_id']; ?>">보기</a>
|
||||
<a href="./itemeventformupdate.php?w=d&ev_id=<?php echo $row['ev_id']; ?>" onclick="return delete_confirm();">삭제</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($i == 0) {
|
||||
echo '<tr><td colspan="5" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function itemeventwin(ev_id)
|
||||
{
|
||||
window.open("./itemeventwin.php?ev_id="+ev_id, "itemeventwin", "left=10,top=10,width=500,height=600,scrollbars=1");
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
445
adm/shop_admin/itemeventform.php
Normal file
@ -0,0 +1,445 @@
|
||||
<?php
|
||||
$sub_menu = '500300';
|
||||
include_once('./_common.php');
|
||||
include_once(G5_EDITOR_LIB);
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$html_title = "이벤트";
|
||||
$g5['title'] = $html_title.' 관리';
|
||||
|
||||
if ($w == "u")
|
||||
{
|
||||
$html_title .= " 수정";
|
||||
$readonly = " readonly";
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_event_table']} where ev_id = '$ev_id' ";
|
||||
$ev = sql_fetch($sql);
|
||||
if (!$ev['ev_id'])
|
||||
alert("등록된 자료가 없습니다.");
|
||||
|
||||
// 등록된 이벤트 상품
|
||||
$sql = " select b.it_id, b.it_name
|
||||
from {$g5['g5_shop_event_item_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id )
|
||||
where a.ev_id = '$ev_id' ";
|
||||
$res_item = sql_query($sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$html_title .= " 입력";
|
||||
$ev['ev_skin'] = 'list.10.skin.php';
|
||||
$ev['ev_mobile_skin'] = 'list.10.skin.php';
|
||||
$ev['ev_use'] = 1;
|
||||
|
||||
$ev['ev_img_width'] = 230;
|
||||
$ev['ev_img_height'] = 230;
|
||||
$ev['ev_list_mod'] = 3;
|
||||
$ev['ev_list_row'] = 5;
|
||||
$ev['ev_mobile_img_width'] = 230;
|
||||
$ev['ev_mobile_img_height'] = 230;
|
||||
$ev['ev_mobile_list_mod'] = 3;
|
||||
$ev['ev_mobile_list_row'] = 5;
|
||||
}
|
||||
|
||||
// 분류리스트
|
||||
$category_select = '';
|
||||
$sql = " select * from {$g5['g5_shop_category_table']} ";
|
||||
if ($is_admin != 'super')
|
||||
$sql .= " where ca_mb_id = '{$member['mb_id']}' ";
|
||||
$sql .= " order by ca_order, ca_id ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$len = strlen($row['ca_id']) / 2 - 1;
|
||||
|
||||
$nbsp = "";
|
||||
for ($i=0; $i<$len; $i++)
|
||||
$nbsp .= " ";
|
||||
|
||||
$category_select .= "<option value=\"{$row['ca_id']}\">$nbsp{$row['ca_name']}</option>\n";
|
||||
}
|
||||
|
||||
// 모바일 1줄당 이미지수 필드 추가
|
||||
if(!sql_query(" select ev_mobile_list_row from {$g5['g5_shop_event_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_event_table']}`
|
||||
ADD `ev_mobile_list_row` int(11) NOT NULL DEFAULT '0' AFTER `ev_mobile_list_mod` ", true);
|
||||
}
|
||||
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
?>
|
||||
|
||||
<form name="feventform" action="./itemeventformupdate.php" onsubmit="return feventform_check(this);" method="post" enctype="MULTIPART/FORM-DATA">
|
||||
<input type="hidden" name="w" value="<?php echo $w; ?>">
|
||||
<input type="hidden" name="ev_id" value="<?php echo $ev_id; ?>">
|
||||
<input type="hidden" name="ev_item" value="">
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?></caption>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<?php if ($w == "u") { ?>
|
||||
<tr>
|
||||
<th>이벤트번호</th>
|
||||
<td>
|
||||
<span class="frm_ev_id"><?php echo $ev_id; ?></span>
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/event.php?ev_id=<?php echo $ev['ev_id']; ?>" class="btn_frmline">이벤트바로가기</a>
|
||||
<button type="button" class="btn_frmline shop_event">테마설정 가져오기</button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_skin">출력스킨</label></th>
|
||||
<td>
|
||||
<?php echo help('기본으로 제공하는 스킨은 '.str_replace(G5_PATH.'/', '', G5_SHOP_SKIN_PATH).'/list.*.skin.php 입니다.'.PHP_EOL.G5_SHOP_DIR.'/event.php?ev_id=1234567890&skin=userskin.php 처럼 직접 만든 스킨을 사용할 수도 있습니다.'); ?>
|
||||
<select name="ev_skin" id="ev_skin">
|
||||
<?php echo get_list_skin_options("^list.[0-9]+\.skin\.php", G5_SHOP_SKIN_PATH, $ev['ev_skin']); ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_mobile_skin">모바일 출력스킨</label></th>
|
||||
<td>
|
||||
<?php echo help('기본으로 제공하는 스킨은 '.str_replace(G5_PATH.'/', '', G5_MSHOP_SKIN_PATH).'/list.*.skin.php 입니다.'.PHP_EOL.G5_SHOP_DIR.'/event.php?ev_id=1234567890&skin=userskin.php 처럼 직접 만든 스킨을 사용할 수도 있습니다.'); ?>
|
||||
<select name="ev_mobile_skin" id="ev_mobile_skin">
|
||||
<?php echo get_list_skin_options("^list.[0-9]+\.skin\.php", G5_MSHOP_SKIN_PATH, $ev['ev_mobile_skin']); ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_img_width">출력이미지 폭</label></th>
|
||||
<td>
|
||||
<input type="text" name="ev_img_width" value="<?php echo $ev['ev_img_width']; ?>" id="ev_img_width" required class="required frm_input" size="5"> 픽셀
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_img_height">출력이미지 높이</label></th>
|
||||
<td>
|
||||
<input type="text" name="ev_img_height" value="<?php echo $ev['ev_img_height']; ?>" id="ev_img_height" required class="required frm_input" size="5"> 픽셀
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_list_mod">1줄당 이미지 수</label></th>
|
||||
<td>
|
||||
<?php echo help("1행에 설정한 값만큼의 상품을 출력합니다. 스킨 설정에 따라 1행에 하나의 상품만 출력할 수도 있습니다."); ?>
|
||||
<input type="text" name="ev_list_mod" value="<?php echo $ev['ev_list_mod']; ?>" id="ev_list_mod" required class="required frm_input" size="3"> 개
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_list_row">이미지 줄 수</label></th>
|
||||
<td>
|
||||
<?php echo help("한 페이지에 출력할 이미지 줄 수를 설정합니다.\n한 페이지에 표시되는 상품수는 (1줄당 이미지 수 x 줄 수) 입니다."); ?>
|
||||
<input type="text" name="ev_list_row" value="<?php echo $ev['ev_list_row']; ?>" id="ev_list_row" required class="required frm_input" size="3"> 줄
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_mobile_img_width">모바일 출력이미지 폭</label></th>
|
||||
<td>
|
||||
<input type="text" name="ev_mobile_img_width" value="<?php echo $ev['ev_mobile_img_width']; ?>" id="ev_mobile_img_width" required class="required frm_input" size="5"> 픽셀
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_mobile_img_height">모바일 출력이미지 높이</label></th>
|
||||
<td>
|
||||
<input type="text" name="ev_mobile_img_height" value="<?php echo $ev['ev_mobile_img_height']; ?>" id="ev_mobile_img_height" required class="required frm_input" size="5"> 픽셀
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_mobile_list_mod">모바일 1줄당 이미지 수</label></th>
|
||||
<td>
|
||||
<?php echo help("1행에 설정한 값만큼의 상품을 출력합니다. 스킨 설정에 따라 1행에 하나의 상품만 출력할 수도 있습니다."); ?>
|
||||
<input type="text" name="ev_mobile_list_mod" value="<?php echo $ev['ev_mobile_list_mod']; ?>" id="ev_mobile_list_mod" required class="required frm_input" size="3"> 개
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_mobile_list_row">모바일 이미지 줄 수</label></th>
|
||||
<td>
|
||||
<?php echo help("한 페이지에 출력할 이미지 줄 수를 설정합니다.\n한 페이지에 표시되는 상품수는 (1줄당 이미지 수 x 줄 수) 입니다."); ?>
|
||||
<input type="text" name="ev_mobile_list_row" value="<?php echo $ev['ev_mobile_list_row']; ?>" id="ev_mobile_list_row" required class="required frm_input" size="3"> 개
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_use">사용</label></th>
|
||||
<td>
|
||||
<?php echo help("사용하지 않으면 레이아웃의 이벤트 메뉴 및 이벤트 관련 페이지에 접근할 수 없습니다."); ?>
|
||||
<select name="ev_use" id="ev_use">
|
||||
<option value="1" <?php echo get_selected($ev['ev_use'], 1); ?>>사용</option>
|
||||
<option value="0" <?php echo get_selected($ev['ev_use'], 0); ?>>사용안함</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_subject">이벤트제목</label></th>
|
||||
<td>
|
||||
<input type="text" name="ev_subject" value="<?php echo htmlspecialchars2($ev['ev_subject']); ?>" id="ev_subject" required class="required frm_input" size="60">
|
||||
<input type="checkbox" name="ev_subject_strong" value="1" id="ev_subject_strong" <?php if($ev['ev_subject_strong']) echo 'checked="checked"'; ?>>
|
||||
<label for="ev_subject_strong">제목 강조</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_mimg">배너이미지</label></th>
|
||||
<td>
|
||||
<?php echo help("쇼핑몰 레이아웃에서 글자 대신 이미지로 출력할 경우 사용합니다."); ?>
|
||||
<input type="file" name="ev_mimg" id="ev_mimg">
|
||||
<?php
|
||||
$mimg_str = "";
|
||||
$mimg = G5_DATA_PATH.'/event/'.$ev['ev_id'].'_m';
|
||||
if (file_exists($mimg)) {
|
||||
$size = @getimagesize($mimg);
|
||||
if($size[0] && $size[0] > 750)
|
||||
$width = 750;
|
||||
else
|
||||
$width = $size[0];
|
||||
|
||||
echo '<input type="checkbox" name="ev_mimg_del" value="1" id="ev_mimg_del"> <label for="ev_mimg_del">삭제</label>';
|
||||
$mimg_str = '<img src="'.G5_DATA_URL.'/event/'.$ev['ev_id'].'_m" width="'.$width.'" alt="">';
|
||||
}
|
||||
if ($mimg_str) {
|
||||
echo '<div class="banner_or_img">';
|
||||
echo $mimg_str;
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">관련상품</th>
|
||||
<td id="sev_it_rel" class="compare_wrap srel">
|
||||
|
||||
<section class="compare_left">
|
||||
<h3>상품검색</h3>
|
||||
<span class="srel_pad">
|
||||
<select name="ca_id" id="sch_ca_id">
|
||||
<option value="">분류선택</option>
|
||||
<?php echo $category_select; ?>
|
||||
</select>
|
||||
<label for="sch_name" class="sound_only">상품명</label>
|
||||
<input type="text" name="sch_name" id="sch_name" class="frm_input" size="15">
|
||||
<button type="button" id="btn_search_item" class="btn_frmline">검색</button>
|
||||
</span>
|
||||
<div id="sch_item_list" class="srel_list">
|
||||
<p>상품의 분류를 선택하시거나 상품명을 입력하신 후 검색하여 주십시오.</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="compare_right">
|
||||
<h3>등록된 상품</h3>
|
||||
<span class="srel_pad"></span>
|
||||
<div id="reg_item_list" class="srel_sel">
|
||||
<?php
|
||||
for($i=0; $row=sql_fetch_array($res_item); $i++) {
|
||||
$it_name = get_it_image($row['it_id'], 50, 50).' '.$row['it_name'];
|
||||
|
||||
if($i==0)
|
||||
echo '<ul>';
|
||||
?>
|
||||
<li>
|
||||
<input type="hidden" name="it_id[]" value="<?php echo $row['it_id']; ?>">
|
||||
<div class="list_item"><?php echo $it_name; ?></div>
|
||||
<div class="list_item_btn"><button type="button" class="del_item btn_frmline">삭제</button></div>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
|
||||
if($i > 0)
|
||||
echo '</ul>';
|
||||
else
|
||||
echo '<p>등록된 상품이 없습니다.</p>';
|
||||
?>
|
||||
</div>
|
||||
</section>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_himg">상단이미지</label></th>
|
||||
<td>
|
||||
<?php echo help("이벤트 페이지 상단에 업로드 한 이미지를 출력합니다."); ?>
|
||||
<input type="file" name="ev_himg" id="ev_himg">
|
||||
<?php
|
||||
$himg_str = "";
|
||||
$himg = G5_DATA_PATH.'/event/'.$ev['ev_id'].'_h';
|
||||
if (file_exists($himg)) {
|
||||
$size = @getimagesize($himg);
|
||||
if($size[0] && $size[0] > 750)
|
||||
$width = 750;
|
||||
else
|
||||
$width = $size[0];
|
||||
|
||||
echo '<input type="checkbox" name="ev_himg_del" value="1" id="ev_himg_del"> <label for="ev_himg_del">삭제</label>';
|
||||
$himg_str = '<img src="'.G5_DATA_URL.'/event/'.$ev['ev_id'].'_h" width="'.$width.'" alt="">';
|
||||
}
|
||||
if ($himg_str) {
|
||||
echo '<div class="banner_or_img">';
|
||||
echo $himg_str;
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ev_timg">하단이미지</label></th>
|
||||
<td>
|
||||
<?php echo help("이벤트 페이지 하단에 업로드 한 이미지를 출력합니다."); ?>
|
||||
<input type="file" name="ev_timg" id="ev_timg">
|
||||
<?php
|
||||
$timg_str = "";
|
||||
$timg = G5_DATA_PATH.'/event/'.$ev['ev_id'].'_t';
|
||||
if (file_exists($timg)) {
|
||||
$size = @getimagesize($timg);
|
||||
if($size[0] && $size[0] > 750)
|
||||
$width = 750;
|
||||
else
|
||||
$width = $size[0];
|
||||
echo '<input type="checkbox" name="ev_timg_del" value="1" id="ev_timg_del"> <label for="ev_timg_del">삭제</label>';
|
||||
$timg_str = '<img src="'.G5_DATA_URL.'/event/'.$ev['ev_id'].'_t" width="'.$width.'" alt="">';
|
||||
}
|
||||
if ($timg_str) {
|
||||
echo '<div class="banner_or_img">';
|
||||
echo $timg_str;
|
||||
echo '</div>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">상단내용</th>
|
||||
<td>
|
||||
<?php echo editor_html('ev_head_html', get_text($ev['ev_head_html'], 0)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">하단내용</th>
|
||||
<td>
|
||||
<?php echo editor_html('ev_tail_html', get_text($ev['ev_tail_html'], 0)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="확인" class="btn_submit" accesskey="s">
|
||||
<a href="./itemevent.php">목록</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$(".shop_event").on("click", function() {
|
||||
if(!confirm("현재 테마의 스킨, 이미지 사이즈 등의 설정을 적용하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "../theme_config_load.php",
|
||||
cache: false,
|
||||
async: false,
|
||||
data: { type: 'shop_event' },
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data.error) {
|
||||
alert(data.error);
|
||||
return false;
|
||||
}
|
||||
|
||||
$.each(data, function(key, val) {
|
||||
if(key == "error")
|
||||
return true;
|
||||
|
||||
$("#"+key).val(val);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#btn_search_item").click(function() {
|
||||
var ca_id = $("#sch_ca_id").val();
|
||||
var it_name = $.trim($("#sch_name").val());
|
||||
|
||||
if(ca_id == "" && it_name == "") {
|
||||
$("#sch_item_list").html("<p>상품의 분류를 선택하시거나 상품명을 입력하신 후 검색하여 주십시오.</p>");
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#sch_item_list").load(
|
||||
"./itemeventsearch.php",
|
||||
{ w: "<?php echo $w; ?>", ev_id: "<?php echo $ev_id; ?>", ca_id: ca_id, it_name: it_name }
|
||||
);
|
||||
});
|
||||
|
||||
$(document).on("click", "#sch_item_list .add_item", function() {
|
||||
// 이미 등록된 상품인지 체크
|
||||
var $li = $(this).closest("li");
|
||||
var it_id = $li.find("input:hidden").val();
|
||||
var it_id2;
|
||||
var dup = false;
|
||||
$("#reg_item_list input[name='it_id[]']").each(function() {
|
||||
it_id2 = $(this).val();
|
||||
if(it_id == it_id2) {
|
||||
dup = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
if(dup) {
|
||||
alert("이미 등록된 상품입니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var cont = "<li>"+$li.html().replace("add_item", "del_item").replace("추가", "삭제")+"</li>";
|
||||
var count = $("#reg_item_list li").size();
|
||||
|
||||
if(count > 0) {
|
||||
$("#reg_item_list li:last").after(cont);
|
||||
} else {
|
||||
$("#reg_item_list").html("<ul>"+cont+"</ul>");
|
||||
}
|
||||
|
||||
$li.remove();
|
||||
});
|
||||
|
||||
$(document).on("click", "#reg_item_list .del_item", function() {
|
||||
if(!confirm("상품을 삭제하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
$(this).closest("li").remove();
|
||||
|
||||
var count = $("#reg_item_list li").size();
|
||||
if(count < 1)
|
||||
$("#reg_item_list").html("<p>등록된 상품이 없습니다.</p>");
|
||||
});
|
||||
});
|
||||
function feventform_check(f)
|
||||
{
|
||||
var item = new Array();
|
||||
var ev_item = it_id = "";
|
||||
|
||||
$("#reg_item_list input[name='it_id[]']").each(function() {
|
||||
it_id = $(this).val();
|
||||
if(it_id == "")
|
||||
return true;
|
||||
|
||||
item.push(it_id);
|
||||
});
|
||||
|
||||
if(item.length > 0)
|
||||
ev_item = item.join();
|
||||
|
||||
$("input[name=ev_item]").val(ev_item);
|
||||
|
||||
<?php echo get_editor_js('ev_head_html'); ?>
|
||||
<?php echo get_editor_js('ev_tail_html'); ?>
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* document.feventform.ev_subject.focus(); 포커스해제*/
|
||||
</script>
|
||||
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
97
adm/shop_admin/itemeventformupdate.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
$sub_menu = '500300';
|
||||
include_once('./_common.php');
|
||||
|
||||
if ($w == "u" || $w == "d")
|
||||
check_demo();
|
||||
|
||||
if ($w == 'd')
|
||||
auth_check($auth[$sub_menu], "d");
|
||||
else
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
@mkdir(G5_DATA_PATH."/event", G5_DIR_PERMISSION);
|
||||
@chmod(G5_DATA_PATH."/event", G5_DIR_PERMISSION);
|
||||
|
||||
if ($ev_mimg_del) @unlink(G5_DATA_PATH."/event/{$ev_id}_m");
|
||||
if ($ev_himg_del) @unlink(G5_DATA_PATH."/event/{$ev_id}_h");
|
||||
if ($ev_timg_del) @unlink(G5_DATA_PATH."/event/{$ev_id}_t");
|
||||
|
||||
$sql_common = " set ev_skin = '$ev_skin',
|
||||
ev_mobile_skin = '$ev_mobile_skin',
|
||||
ev_img_width = '$ev_img_width',
|
||||
ev_img_height = '$ev_img_height',
|
||||
ev_list_mod = '$ev_list_mod',
|
||||
ev_list_row = '$ev_list_row',
|
||||
ev_mobile_img_width = '$ev_mobile_img_width',
|
||||
ev_mobile_img_height= '$ev_mobile_img_height',
|
||||
ev_mobile_list_mod = '$ev_mobile_list_mod',
|
||||
ev_mobile_list_row = '$ev_mobile_list_row',
|
||||
ev_subject = '$ev_subject',
|
||||
ev_head_html = '$ev_head_html',
|
||||
ev_tail_html = '$ev_tail_html',
|
||||
ev_use = '$ev_use',
|
||||
ev_subject_strong = '$ev_subject_strong'
|
||||
";
|
||||
|
||||
if ($w == "")
|
||||
{
|
||||
$ev_id = G5_SERVER_TIME;
|
||||
|
||||
$sql = " insert {$g5['g5_shop_event_table']}
|
||||
$sql_common
|
||||
, ev_id = '$ev_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
else if ($w == "u")
|
||||
{
|
||||
$sql = " update {$g5['g5_shop_event_table']}
|
||||
$sql_common
|
||||
where ev_id = '$ev_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
else if ($w == "d")
|
||||
{
|
||||
@unlink(G5_DATA_PATH."/event/{$ev_id}_m");
|
||||
@unlink(G5_DATA_PATH."/event/{$ev_id}_h");
|
||||
@unlink(G5_DATA_PATH."/event/{$ev_id}_t");
|
||||
|
||||
// 이벤트상품삭제
|
||||
$sql = " delete from {$g5['g5_shop_event_item_table']} where ev_id = '$ev_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
$sql = " delete from {$g5['g5_shop_event_table']} where ev_id = '$ev_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
if ($w == "" || $w == "u")
|
||||
{
|
||||
if ($_FILES['ev_mimg']['name']) upload_file($_FILES['ev_mimg']['tmp_name'], $ev_id."_m", G5_DATA_PATH."/event");
|
||||
if ($_FILES['ev_himg']['name']) upload_file($_FILES['ev_himg']['tmp_name'], $ev_id."_h", G5_DATA_PATH."/event");
|
||||
if ($_FILES['ev_timg']['name']) upload_file($_FILES['ev_timg']['tmp_name'], $ev_id."_t", G5_DATA_PATH."/event");
|
||||
|
||||
// 등록된 이벤트 상품 먼저 삭제
|
||||
$sql = " delete from {$g5['g5_shop_event_item_table']} where ev_id = '$ev_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 이벤트 상품등록
|
||||
$item = explode(',', $ev_item);
|
||||
$count = count($item);
|
||||
|
||||
for($i=0; $i<$count; $i++) {
|
||||
$it_id = $item[$i];
|
||||
if($it_id) {
|
||||
$sql = " insert into {$g5['g5_shop_event_item_table']}
|
||||
set ev_id = '$ev_id',
|
||||
it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
goto_url("./itemeventform.php?w=u&ev_id=$ev_id");
|
||||
}
|
||||
else
|
||||
{
|
||||
goto_url("./itemevent.php");
|
||||
}
|
||||
?>
|
||||
212
adm/shop_admin/itemeventlist.php
Normal file
@ -0,0 +1,212 @@
|
||||
<?php
|
||||
$sub_menu = '500310';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '이벤트일괄처리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$where = " where ";
|
||||
$sql_search = "";
|
||||
if ($search != "") {
|
||||
if ($sel_field != "") {
|
||||
$sql_search .= " $where $sel_field like '%$search%' ";
|
||||
$where = " and ";
|
||||
}
|
||||
}
|
||||
|
||||
if ($sel_ca_id != "") {
|
||||
$sql_search .= " $where ca_id like '$sel_ca_id%' ";
|
||||
}
|
||||
|
||||
if ($sel_field == "") {
|
||||
$sel_field = "it_name";
|
||||
}
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_item_table']} a
|
||||
left join {$g5['g5_shop_event_item_table']} b on (a.it_id=b.it_id and b.ev_id='$ev_id') ";
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
if (!$sort1) {
|
||||
$sort1 = "b.ev_id";
|
||||
}
|
||||
|
||||
if (!$sort2) {
|
||||
$sort2 = "desc";
|
||||
}
|
||||
|
||||
$sql = " select a.*, b.ev_id
|
||||
$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;
|
||||
$qstr1 = 'ev_id='.$ev_id.'&sel_ca_id='.$sel_ca_id.'&sel_field='.$sel_field.'&search='.$search;
|
||||
$qstr = $qstr1.'&sort1='.$sort1.'&sort2='.$sort2.'&page='.$page;
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
|
||||
// 이벤트제목
|
||||
if($ev_id) {
|
||||
$tmp = sql_fetch(" select ev_subject from {$g5['g5_shop_event_table']} where ev_id = '$ev_id' ");
|
||||
$ev_title = $tmp['ev_subject'];
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
전체 이벤트 <?php echo $total_count; ?>건
|
||||
</div>
|
||||
|
||||
<form name="flist" class="local_sch01 local_sch" autocomplete="off">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<label for="ev_id" class="sound_only">이벤트</label>
|
||||
<select name="ev_id" id="ev_id" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>">
|
||||
<?php
|
||||
// 이벤트 옵션처리
|
||||
$event_option = "<option value=''>이벤트를 선택하세요</option>";
|
||||
$sql1 = " select ev_id, ev_subject from {$g5['g5_shop_event_table']} order by ev_id desc ";
|
||||
$result1 = sql_query($sql1);
|
||||
while ($row1=mysql_fetch_array($result1))
|
||||
$event_option .= '<option value="'.$row1['ev_id'].'" '.get_selected($ev_id, $row1['ev_id']).' >'.conv_subject($row1['ev_subject'], 20,"…").'</option>';
|
||||
echo $event_option;
|
||||
?>
|
||||
</select>
|
||||
<input type="submit" value="이동" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<form name="flist" class="local_sch01 local_sch" autocomplete="off">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="ev_id" value="<?php echo $ev_id; ?>">
|
||||
<?php echo $listall; ?>
|
||||
|
||||
<label for="sel_ca_id" class="sound_only">분류선택</label>
|
||||
<select name="sel_ca_id" id="sel_ca_id">
|
||||
<option value=''>전체분류</option>
|
||||
<?php
|
||||
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
|
||||
$result1 = sql_query($sql1);
|
||||
for ($i=0; $row1=mysql_fetch_array($result1); $i++)
|
||||
{
|
||||
$len = strlen($row1['ca_id']) / 2 - 1;
|
||||
$nbsp = "";
|
||||
for ($i=0; $i<$len; $i++) $nbsp .= " ";
|
||||
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sel_ca_id, $row1['ca_id']).'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<label for="sel_field" class="sound_only">검색대상</label>
|
||||
<select name="sel_field" id="sel_field">
|
||||
<option value="it_name" <?php echo get_selected($sel_field, 'it_name'); ?>>상품명</option>
|
||||
<option value="a.it_id" <?php echo get_selected($sel_field, 'a.it_id'); ?>>상품코드</option>
|
||||
</select>
|
||||
|
||||
<label for="search" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="search" value="<?php echo $search; ?>" id="search" required class="frm_input required">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>상품을 이벤트별로 일괄 처리합니다. <?php echo ($ev_title ? '현재 선택된 이벤트는 '.$ev_title.'입니다.' : '이벤트를 선택해 주세요.'); ?></p>
|
||||
</div>
|
||||
|
||||
<form name="fitemeventlistupdate" method="post" action="./itemeventlistupdate.php" onsubmit="return fitemeventlistupdatecheck(this)">
|
||||
<input type="hidden" name="ev_id" value="<?php echo $ev_id; ?>">
|
||||
<input type="hidden" name="sel_ca_id" value="<?php echo $sel_ca_id; ?>">
|
||||
<input type="hidden" name="sel_field" value="<?php echo $sel_field; ?>">
|
||||
<input type="hidden" name="search" value="<?php echo $search; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
|
||||
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">이벤트</th>
|
||||
<th scope="col"><a href="<?php echo title_sort("a.it_id") . '&'.$qstr1.'&ev_id='.$ev_id; ?>">상품코드</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("it_name") . '&&'.$qstr1.'&ev_id='.$ev_id; ?>">상품명</a></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'];
|
||||
|
||||
$sql = " select ev_id from {$g5['g5_shop_event_item_table']}
|
||||
where it_id = '{$row['it_id']}'
|
||||
and ev_id = '$ev_id' ";
|
||||
$ev = sql_fetch($sql);
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td class="td_chk">
|
||||
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
|
||||
<label for="ev_chk_<?php echo $i; ?>" class="sound_only">이벤트 사용</label>
|
||||
<input type="checkbox" name="ev_chk[<?php echo $i; ?>]" value="1" id="ev_chk_<?php echo $i; ?>" <?php echo ($row['ev_id'] ? "checked" : ""); ?>>
|
||||
</td>
|
||||
<td class="td_num"><a href="<?php echo $href; ?>"><?php echo $row['it_id']; ?></a></td>
|
||||
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?> <?php echo cut_str(stripslashes($row['it_name']), 60, "…"); ?></a></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="4" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>
|
||||
<?php if ($ev_title) { ?>
|
||||
현재 선택된 이벤트는 <strong><?php echo $ev_title; ?></strong>입니다.<br>
|
||||
선택된 이벤트의 상품 수정 내용을 반영하시려면 일괄수정 버튼을 누르십시오.
|
||||
<?php } else { ?>
|
||||
이벤트를 선택하지 않으셨습니다. <strong>수정 내용을 반영하기 전에 이벤트를 선택해주십시오.</strong><br>
|
||||
<a href="#ev_id" class="sound_only">이벤트 선택</a>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="일괄수정" class="btn_submit" accesskey="s">
|
||||
</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="); ?>
|
||||
|
||||
<script>
|
||||
function fitemeventlistupdatecheck(f)
|
||||
{
|
||||
if (!f.ev_id.value)
|
||||
{
|
||||
alert('이벤트를 선택하세요');
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
27
adm/shop_admin/itemeventlistupdate.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
$sub_menu = '500310';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
for ($i=0; $i<count($_POST['it_id']); $i++)
|
||||
{
|
||||
$sql = " delete from {$g5['g5_shop_event_item_table']}
|
||||
where ev_id = '$ev_id'
|
||||
and it_id = '{$_POST['it_id'][$i]}' ";
|
||||
sql_query($sql);
|
||||
|
||||
if ($_POST['ev_chk'][$i])
|
||||
{
|
||||
$sql = "insert into {$g5['g5_shop_event_item_table']}
|
||||
set ev_id = '$ev_id',
|
||||
it_id = '{$_POST['it_id'][$i]}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
goto_url('./itemeventlist.php?ev_id='.$ev_id.'&sort1='.$sort1.'&sort2='.$sort2.'&sel_ca_id='.$sel_ca_id.'&sel_field='.$sel_field.'&search='.$search.'&page='.$page);
|
||||
?>
|
||||
49
adm/shop_admin/itemeventsearch.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
$sub_menu = '500300';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$ca_id = trim($ca_id);
|
||||
$it_name = trim(strip_tags($it_name));
|
||||
|
||||
if(!$ca_id && !$it_name)
|
||||
die('<p>상품의 분류를 선택하시거나 상품명을 입력하신 후 검색하여 주십시오.</p>');
|
||||
|
||||
$sql = " select it_id, it_name
|
||||
from {$g5['g5_shop_item_table']}
|
||||
where (1) ";
|
||||
if($ca_id)
|
||||
$sql .= " and ( ca_id like '$ca_id%' or ca_id2 like '$ca_id%' or ca_id3 like '$ca_id%' ) ";
|
||||
|
||||
if($it_name)
|
||||
$sql .= " and it_name like '%$it_name%' ";
|
||||
|
||||
$sql .= " order by ca_id, it_name ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$list = '';
|
||||
for($i=0;$row=sql_fetch_array($result);$i++) {
|
||||
if($w == 'u') {
|
||||
$sql2 = " select count(*) as cnt from {$g5['g5_shop_event_item_table']} where ev_id = '$ev_id' and it_id = '{$row['it_id']}' ";
|
||||
$row2 = sql_fetch($sql2);
|
||||
if ($row2['cnt'])
|
||||
continue;
|
||||
}
|
||||
|
||||
$it_name = get_it_image($row['it_id'], 50, 50).' '.$row['it_name'];
|
||||
|
||||
$list .= '<li>';
|
||||
$list .= '<input type="hidden" name="it_id[]" value="'.$row['it_id'].'">';
|
||||
$list .= '<div class="list_item">'.$it_name.'</div>';
|
||||
$list .= '<div class="list_item_btn"><button type="button" class="add_item btn_frmline">추가</button></div>';
|
||||
$list .= '</li>'.PHP_EOL;
|
||||
}
|
||||
|
||||
if($list)
|
||||
$list = '<ul>'.$list.'</ul>';
|
||||
else
|
||||
$list = '<p>등록된 상품이 없습니다.</p>';
|
||||
|
||||
echo $list;
|
||||
?>
|
||||
65
adm/shop_admin/itemeventwin.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
$sub_menu = '500300';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$sql = " select ev_subject from {$g5['g5_shop_event_table']} where ev_id = '$ev_id' ";
|
||||
$ev = sql_fetch($sql);
|
||||
|
||||
$g5['title'] = $ev['ev_subject'].' 이벤트상품';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
?>
|
||||
|
||||
<div class="new_win">
|
||||
<h1><?php echo $g5['title']; ?></h1>
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 입력</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">상품명</th>
|
||||
<th scope="col">사용</th>
|
||||
<th scope="col">삭제</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$sql = " select b.it_id, b.it_name, b.it_use from {$g5['g5_shop_event_item_table']} a
|
||||
left join {$g5['g5_shop_item_table']} b on (a.it_id=b.it_id)
|
||||
where a.ev_id = '$ev_id'
|
||||
order by b.it_id desc ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$href = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="<?php echo $href; ?>" target="_blank">
|
||||
<?php echo get_it_image($row['it_id'], 40, 40); ?>
|
||||
<?php echo cut_str(stripslashes($row['it_name']), 60, "…"); ?>
|
||||
</a>
|
||||
</td>
|
||||
<td class="td_boolean"><?php echo ($row['it_use']?"사용":"미사용"); ?></td>
|
||||
<td class="td_mngsmall"><a href="javascript:del('./itemeventwindel.php?ev_id=<?php echo $ev_id; ?>&it_id=<?php echo $row['it_id']; ?>');">삭제</a></td>
|
||||
<tr>
|
||||
<?php
|
||||
}
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="3" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_win01 btn_win">
|
||||
<button type="button" onclick="javascript:window.close()">창 닫기</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
13
adm/shop_admin/itemeventwindel.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
$sub_menu = '500300';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
auth_check($auth[$sub_menu], "d");
|
||||
|
||||
$sql = " delete from {$g5['g5_shop_event_item_table']} where ev_id = '$ev_id' and it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
goto_url("./itemeventwin.php?ev_id=$ev_id");
|
||||
?>
|
||||
45
adm/shop_admin/itemexcel.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
$sub_menu = '400300';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$g5['title'] = '엑셀파일로 상품 일괄 등록';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
?>
|
||||
|
||||
<div class="new_win">
|
||||
<h1><?php echo $g5['title']; ?></h1>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>
|
||||
엑셀파일을 이용하여 상품을 일괄등록할 수 있습니다.<br>
|
||||
형식은 <strong>상품일괄등록용 엑셀파일</strong>을 다운로드하여 상품 정보를 입력하시면 됩니다.<br>
|
||||
수정 완료 후 엑셀파일을 업로드하시면 상품이 일괄등록됩니다.<br>
|
||||
엑셀파일을 저장하실 때는 <strong>Excel 97 - 2003 통합문서 (*.xls)</strong> 로 저장하셔야 합니다.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="<?php echo G5_URL; ?>/<?php echo G5_LIB_DIR; ?>/Excel/itemexcel.xls">상품일괄등록용 엑셀파일 다운로드</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form name="fitemexcel" method="post" action="./itemexcelupdate.php" enctype="MULTIPART/FORM-DATA" autocomplete="off">
|
||||
|
||||
<div id="excelfile_upload">
|
||||
<label for="excelfile">파일선택</label>
|
||||
<input type="file" name="excelfile" id="excelfile">
|
||||
</div>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="상품 엑셀파일 등록" class="btn_submit">
|
||||
<button type="button" onclick="window.close();">닫기</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
237
adm/shop_admin/itemexcelupdate.php
Normal file
@ -0,0 +1,237 @@
|
||||
<?php
|
||||
$sub_menu = '400300';
|
||||
include_once('./_common.php');
|
||||
|
||||
// 상품이 많을 경우 대비 설정변경
|
||||
set_time_limit ( 0 );
|
||||
ini_set('memory_limit', '50M');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
function only_number($n)
|
||||
{
|
||||
return preg_replace('/[^0-9]/', '', $n);
|
||||
}
|
||||
|
||||
if($_FILES['excelfile']['tmp_name']) {
|
||||
$file = $_FILES['excelfile']['tmp_name'];
|
||||
|
||||
include_once(G5_LIB_PATH.'/Excel/reader.php');
|
||||
|
||||
$data = new Spreadsheet_Excel_Reader();
|
||||
|
||||
// Set output Encoding.
|
||||
$data->setOutputEncoding('UTF-8');
|
||||
|
||||
/***
|
||||
* if you want you can change 'iconv' to mb_convert_encoding:
|
||||
* $data->setUTFEncoder('mb');
|
||||
*
|
||||
**/
|
||||
|
||||
/***
|
||||
* By default rows & cols indeces start with 1
|
||||
* For change initial index use:
|
||||
* $data->setRowColOffset(0);
|
||||
*
|
||||
**/
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* Some function for formatting output.
|
||||
* $data->setDefaultFormat('%.2f');
|
||||
* setDefaultFormat - set format for columns with unknown formatting
|
||||
*
|
||||
* $data->setColumnFormat(4, '%.3f');
|
||||
* setColumnFormat - set format for column (apply only to number fields)
|
||||
*
|
||||
**/
|
||||
|
||||
$data->read($file);
|
||||
|
||||
/*
|
||||
|
||||
|
||||
$data->sheets[0]['numRows'] - count rows
|
||||
$data->sheets[0]['numCols'] - count columns
|
||||
$data->sheets[0]['cells'][$i][$j] - data from $i-row $j-column
|
||||
|
||||
$data->sheets[0]['cellsInfo'][$i][$j] - extended info about cell
|
||||
|
||||
$data->sheets[0]['cellsInfo'][$i][$j]['type'] = "date" | "number" | "unknown"
|
||||
if 'type' == "unknown" - use 'raw' value, because cell contain value with format '0.00';
|
||||
$data->sheets[0]['cellsInfo'][$i][$j]['raw'] = value if cell without format
|
||||
$data->sheets[0]['cellsInfo'][$i][$j]['colspan']
|
||||
$data->sheets[0]['cellsInfo'][$i][$j]['rowspan']
|
||||
*/
|
||||
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
|
||||
$dup_it_id = array();
|
||||
$fail_it_id = array();
|
||||
$dup_count = 0;
|
||||
$total_count = 0;
|
||||
$fail_count = 0;
|
||||
$succ_count = 0;
|
||||
|
||||
for ($i = 3; $i <= $data->sheets[0]['numRows']; $i++) {
|
||||
$total_count++;
|
||||
|
||||
$j = 1;
|
||||
|
||||
$it_id = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$ca_id = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$ca_id2 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$ca_id3 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_name = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_maker = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_origin = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_brand = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_model = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_type1 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_type2 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_type3 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_type4 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_type5 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_basic = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_explan = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_mobile_explan = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_cust_price = addslashes(only_number($data->sheets[0]['cells'][$i][$j++]));
|
||||
$it_price = addslashes(only_number($data->sheets[0]['cells'][$i][$j++]));
|
||||
$it_tel_inq = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_point = addslashes(only_number($data->sheets[0]['cells'][$i][$j++]));
|
||||
$it_point_type = addslashes(only_number($data->sheets[0]['cells'][$i][$j++]));
|
||||
$it_sell_email = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_use = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_stock_qty = addslashes(only_number($data->sheets[0]['cells'][$i][$j++]));
|
||||
$it_noti_qty = addslashes(only_number($data->sheets[0]['cells'][$i][$j++]));
|
||||
$it_buy_min_qty = addslashes(only_number($data->sheets[0]['cells'][$i][$j++]));
|
||||
$it_buy_max_qty = addslashes(only_number($data->sheets[0]['cells'][$i][$j++]));
|
||||
$it_notax = addslashes(only_number($data->sheets[0]['cells'][$i][$j++]));
|
||||
$it_order = addslashes(only_number($data->sheets[0]['cells'][$i][$j++]));
|
||||
$it_img1 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_img2 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_img3 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_img4 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_img5 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_img6 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_img7 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_img8 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_img9 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_img10 = addslashes($data->sheets[0]['cells'][$i][$j++]);
|
||||
$it_explan2 = strip_tags(trim($it_explan));
|
||||
|
||||
if(!$it_id || !$ca_id || !$it_name) {
|
||||
$fail_count++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// it_id 중복체크
|
||||
$sql2 = " select count(*) as cnt from {$g5['g5_shop_item_table']} where it_id = '$it_id' ";
|
||||
$row2 = sql_fetch($sql2);
|
||||
if($row2['cnt']) {
|
||||
$fail_it_id[] = $it_id;
|
||||
$dup_it_id[] = $it_id;
|
||||
$dup_count++;
|
||||
$fail_count++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// 기본분류체크
|
||||
$sql2 = " select count(*) as cnt from {$g5['g5_shop_category_table']} where ca_id = '$ca_id' ";
|
||||
$row2 = sql_fetch($sql2);
|
||||
if(!$row2['cnt']) {
|
||||
$fail_it_id[] = $it_id;
|
||||
$fail_count++;
|
||||
continue;
|
||||
}
|
||||
|
||||
$sql = " INSERT INTO {$g5['g5_shop_item_table']}
|
||||
SET it_id = '$it_id',
|
||||
ca_id = '$ca_id',
|
||||
ca_id2 = '$ca_id2',
|
||||
ca_id3 = '$ca_id3',
|
||||
it_name = '$it_name',
|
||||
it_maker = '$it_maker',
|
||||
it_origin = '$it_origin',
|
||||
it_brand = '$it_brand',
|
||||
it_model = '$it_model',
|
||||
it_type1 = '$it_type1',
|
||||
it_type2 = '$it_type2',
|
||||
it_type3 = '$it_type3',
|
||||
it_type4 = '$it_type4',
|
||||
it_type5 = '$it_type5',
|
||||
it_basic = '$it_basic',
|
||||
it_explan = '$it_explan',
|
||||
it_explan2 = '$it_explan2',
|
||||
it_mobile_explan = '$it_mobile_explan',
|
||||
it_cust_price = '$it_cust_price',
|
||||
it_price = '$it_price',
|
||||
it_point = '$it_point',
|
||||
it_point_type = '$it_point_type',
|
||||
it_stock_qty = '$it_stock_qty',
|
||||
it_noti_qty = '$it_noti_qty',
|
||||
it_buy_min_qty = '$it_buy_min_qty',
|
||||
it_buy_max_qty = '$it_buy_max_qty',
|
||||
it_notax = '$it_notax',
|
||||
it_use = '$it_use',
|
||||
it_time = '".G5_TIME_YMDHIS."',
|
||||
it_ip = '{$_SERVER['REMOTE_ADDR']}',
|
||||
it_order = '$it_order',
|
||||
it_tel_inq = '$it_tel_inq',
|
||||
it_img1 = '$it_img1',
|
||||
it_img2 = '$it_img2',
|
||||
it_img3 = '$it_img3',
|
||||
it_img4 = '$it_img4',
|
||||
it_img5 = '$it_img5',
|
||||
it_img6 = '$it_img6',
|
||||
it_img7 = '$it_img7',
|
||||
it_img8 = '$it_img8',
|
||||
it_img9 = '$it_img9',
|
||||
it_img10 = '$it_img10' ";
|
||||
sql_query($sql);
|
||||
|
||||
$succ_count++;
|
||||
}
|
||||
}
|
||||
|
||||
$g5['title'] = '상품 엑셀일괄등록 결과';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
?>
|
||||
|
||||
<div class="new_win">
|
||||
<h1><?php echo $g5['title']; ?></h1>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>상품등록을 완료했습니다.</p>
|
||||
</div>
|
||||
|
||||
<dl id="excelfile_result">
|
||||
<dt>총상품수</dt>
|
||||
<dd><?php echo number_format($total_count); ?></dd>
|
||||
<dt>완료건수</dt>
|
||||
<dd><?php echo number_format($succ_count); ?></dd>
|
||||
<dt>실패건수</dt>
|
||||
<dd><?php echo number_format($fail_count); ?></dd>
|
||||
<?php if($fail_count > 0) { ?>
|
||||
<dt>실패상품코드</dt>
|
||||
<dd><?php echo implode(', ', $fail_it_id); ?></dd>
|
||||
<?php } ?>
|
||||
<?php if($dup_count > 0) { ?>
|
||||
<dt>상품코드중복건수</dt>
|
||||
<dd><?php echo number_format($dup_count); ?></dd>
|
||||
<dt>중복상품코드</dt>
|
||||
<dd><?php echo implode(', ', $dup_it_id); ?></dd>
|
||||
<?php } ?>
|
||||
</dl>
|
||||
|
||||
<div class="btn_win01 btn_win">
|
||||
<button type="button" onclick="window.close();">창닫기</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
1867
adm/shop_admin/itemform.php
Normal file
48
adm/shop_admin/itemformrelation.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
$sub_menu = '400300';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$ca_id = trim($ca_id);
|
||||
$it_name = trim(strip_tags($it_name));
|
||||
|
||||
if(!$ca_id && !$it_name)
|
||||
die('<p>상품의 분류를 선택하시거나 상품명을 입력하신 후 검색하여 주십시오.</p>');
|
||||
|
||||
$sql = " select ca_id, it_id, it_name, it_price
|
||||
from {$g5['g5_shop_item_table']}
|
||||
where it_id <> '$it_id' ";
|
||||
if($ca_id)
|
||||
$sql .= " and ( ca_id like '$ca_id%' or ca_id2 like '$ca_id%' or ca_id3 like '$ca_id%' ) ";
|
||||
|
||||
if($it_name)
|
||||
$sql .= " and it_name like '%$it_name%' ";
|
||||
|
||||
$sql .= " order by ca_id, it_name ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$list = '';
|
||||
|
||||
for($i=0;$row=sql_fetch_array($result);$i++) {
|
||||
$sql2 = " select count(*) as cnt from {$g5['g5_shop_item_relation_table']} where it_id = '$it_id' and it_id2 = '{$row['it_id']}' ";
|
||||
$row2 = sql_fetch($sql2);
|
||||
if ($row2['cnt'])
|
||||
continue;
|
||||
|
||||
$it_name = get_it_image($row['it_id'], 50, 50).' '.$row['it_name'];
|
||||
|
||||
$list .= '<li class="list_res">';
|
||||
$list .= '<input type="hidden" name="re_it_id[]" value="'.$row['it_id'].'">';
|
||||
$list .= '<div class="list_item">'.$it_name.'</div>';
|
||||
$list .= '<div class="list_item_btn"><button type="button" class="add_item btn_frmline">추가</button></div>';
|
||||
$list .= '</li>'.PHP_EOL;
|
||||
}
|
||||
|
||||
if($list)
|
||||
$list = '<ul>'.$list.'</ul>';
|
||||
else
|
||||
$list = '<p>등록된 상품이 없습니다.';
|
||||
|
||||
echo $list;
|
||||
?>
|
||||
576
adm/shop_admin/itemformupdate.php
Normal file
@ -0,0 +1,576 @@
|
||||
<?php
|
||||
$sub_menu = '400300';
|
||||
include_once('./_common.php');
|
||||
|
||||
if ($w == "u" || $w == "d")
|
||||
check_demo();
|
||||
|
||||
if ($w == '' || $w == 'u')
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
else if ($w == 'd')
|
||||
auth_check($auth[$sub_menu], "d");
|
||||
|
||||
@mkdir(G5_DATA_PATH."/item", G5_DIR_PERMISSION);
|
||||
@chmod(G5_DATA_PATH."/item", G5_DIR_PERMISSION);
|
||||
|
||||
// input vars 체크
|
||||
check_input_vars();
|
||||
|
||||
// 파일정보
|
||||
if($w == "u") {
|
||||
$sql = " select it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10
|
||||
from {$g5['g5_shop_item_table']}
|
||||
where it_id = '$it_id' ";
|
||||
$file = sql_fetch($sql);
|
||||
|
||||
$it_img1 = $file['it_img1'];
|
||||
$it_img2 = $file['it_img2'];
|
||||
$it_img3 = $file['it_img3'];
|
||||
$it_img4 = $file['it_img4'];
|
||||
$it_img5 = $file['it_img5'];
|
||||
$it_img6 = $file['it_img6'];
|
||||
$it_img7 = $file['it_img7'];
|
||||
$it_img8 = $file['it_img8'];
|
||||
$it_img9 = $file['it_img9'];
|
||||
$it_img10 = $file['it_img10'];
|
||||
}
|
||||
|
||||
$it_img_dir = G5_DATA_PATH.'/item';
|
||||
|
||||
// 파일삭제
|
||||
if ($it_img1_del) {
|
||||
$file_img1 = $it_img_dir.'/'.$it_img1;
|
||||
@unlink($file_img1);
|
||||
delete_item_thumbnail(dirname($file_img1), basename($file_img1));
|
||||
$it_img1 = '';
|
||||
}
|
||||
if ($it_img2_del) {
|
||||
$file_img2 = $it_img_dir.'/'.$it_img2;
|
||||
@unlink($file_img2);
|
||||
delete_item_thumbnail(dirname($file_img2), basename($file_img2));
|
||||
$it_img2 = '';
|
||||
}
|
||||
if ($it_img3_del) {
|
||||
$file_img3 = $it_img_dir.'/'.$it_img3;
|
||||
@unlink($file_img3);
|
||||
delete_item_thumbnail(dirname($file_img3), basename($file_img3));
|
||||
$it_img3 = '';
|
||||
}
|
||||
if ($it_img4_del) {
|
||||
$file_img4 = $it_img_dir.'/'.$it_img4;
|
||||
@unlink($file_img4);
|
||||
delete_item_thumbnail(dirname($file_img4), basename($file_img4));
|
||||
$it_img4 = '';
|
||||
}
|
||||
if ($it_img5_del) {
|
||||
$file_img5 = $it_img_dir.'/'.$it_img5;
|
||||
@unlink($file_img5);
|
||||
delete_item_thumbnail(dirname($file_img5), basename($file_img5));
|
||||
$it_img5 = '';
|
||||
}
|
||||
if ($it_img6_del) {
|
||||
$file_img6 = $it_img_dir.'/'.$it_img6;
|
||||
@unlink($file_img6);
|
||||
delete_item_thumbnail(dirname($file_img6), basename($file_img6));
|
||||
$it_img6 = '';
|
||||
}
|
||||
if ($it_img7_del) {
|
||||
$file_img7 = $it_img_dir.'/'.$it_img7;
|
||||
@unlink($file_img7);
|
||||
delete_item_thumbnail(dirname($file_img7), basename($file_img7));
|
||||
$it_img7 = '';
|
||||
}
|
||||
if ($it_img8_del) {
|
||||
$file_img8 = $it_img_dir.'/'.$it_img8;
|
||||
@unlink($file_img8);
|
||||
delete_item_thumbnail(dirname($file_img8), basename($file_img8));
|
||||
$it_img8 = '';
|
||||
}
|
||||
if ($it_img9_del) {
|
||||
$file_img9 = $it_img_dir.'/'.$it_img9;
|
||||
@unlink($file_img9);
|
||||
delete_item_thumbnail(dirname($file_img9), basename($file_img9));
|
||||
$it_img9 = '';
|
||||
}
|
||||
if ($it_img10_del) {
|
||||
$file_img10 = $it_img_dir.'/'.$it_img10;
|
||||
@unlink($file_img10);
|
||||
delete_item_thumbnail(dirname($file_img10), basename($file_img10));
|
||||
$it_img10 = '';
|
||||
}
|
||||
|
||||
// 이미지업로드
|
||||
if ($_FILES['it_img1']['name']) {
|
||||
if($w == 'u' && $it_img1) {
|
||||
$file_img1 = $it_img_dir.'/'.$it_img1;
|
||||
@unlink($file_img1);
|
||||
delete_item_thumbnail(dirname($file_img1), basename($file_img1));
|
||||
}
|
||||
$it_img1 = it_img_upload($_FILES['it_img1']['tmp_name'], $_FILES['it_img1']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img2']['name']) {
|
||||
if($w == 'u' && $it_img2) {
|
||||
$file_img2 = $it_img_dir.'/'.$it_img2;
|
||||
@unlink($file_img2);
|
||||
delete_item_thumbnail(dirname($file_img2), basename($file_img2));
|
||||
}
|
||||
$it_img2 = it_img_upload($_FILES['it_img2']['tmp_name'], $_FILES['it_img2']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img3']['name']) {
|
||||
if($w == 'u' && $it_img3) {
|
||||
$file_img3 = $it_img_dir.'/'.$it_img3;
|
||||
@unlink($file_img3);
|
||||
delete_item_thumbnail(dirname($file_img3), basename($file_img3));
|
||||
}
|
||||
$it_img3 = it_img_upload($_FILES['it_img3']['tmp_name'], $_FILES['it_img3']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img4']['name']) {
|
||||
if($w == 'u' && $it_img4) {
|
||||
$file_img4 = $it_img_dir.'/'.$it_img4;
|
||||
@unlink($file_img4);
|
||||
delete_item_thumbnail(dirname($file_img4), basename($file_img4));
|
||||
}
|
||||
$it_img4 = it_img_upload($_FILES['it_img4']['tmp_name'], $_FILES['it_img4']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img5']['name']) {
|
||||
if($w == 'u' && $it_img5) {
|
||||
$file_img5 = $it_img_dir.'/'.$it_img5;
|
||||
@unlink($file_img5);
|
||||
delete_item_thumbnail(dirname($file_img5), basename($file_img5));
|
||||
}
|
||||
$it_img5 = it_img_upload($_FILES['it_img5']['tmp_name'], $_FILES['it_img5']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img6']['name']) {
|
||||
if($w == 'u' && $it_img6) {
|
||||
$file_img6 = $it_img_dir.'/'.$it_img6;
|
||||
@unlink($file_img6);
|
||||
delete_item_thumbnail(dirname($file_img6), basename($file_img6));
|
||||
}
|
||||
$it_img6 = it_img_upload($_FILES['it_img6']['tmp_name'], $_FILES['it_img6']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img7']['name']) {
|
||||
if($w == 'u' && $it_img7) {
|
||||
$file_img7 = $it_img_dir.'/'.$it_img7;
|
||||
@unlink($file_img7);
|
||||
delete_item_thumbnail(dirname($file_img7), basename($file_img7));
|
||||
}
|
||||
$it_img7 = it_img_upload($_FILES['it_img7']['tmp_name'], $_FILES['it_img7']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img8']['name']) {
|
||||
if($w == 'u' && $it_img8) {
|
||||
$file_img8 = $it_img_dir.'/'.$it_img8;
|
||||
@unlink($file_img8);
|
||||
delete_item_thumbnail(dirname($file_img8), basename($file_img8));
|
||||
}
|
||||
$it_img8 = it_img_upload($_FILES['it_img8']['tmp_name'], $_FILES['it_img8']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img9']['name']) {
|
||||
if($w == 'u' && $it_img9) {
|
||||
$file_img9 = $it_img_dir.'/'.$it_img9;
|
||||
@unlink($file_img9);
|
||||
delete_item_thumbnail(dirname($file_img9), basename($file_img9));
|
||||
}
|
||||
$it_img9 = it_img_upload($_FILES['it_img9']['tmp_name'], $_FILES['it_img9']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
if ($_FILES['it_img10']['name']) {
|
||||
if($w == 'u' && $it_img10) {
|
||||
$file_img10 = $it_img_dir.'/'.$it_img10;
|
||||
@unlink($file_img10);
|
||||
delete_item_thumbnail(dirname($file_img10), basename($file_img10));
|
||||
}
|
||||
$it_img10 = it_img_upload($_FILES['it_img10']['tmp_name'], $_FILES['it_img10']['name'], $it_img_dir.'/'.$it_id);
|
||||
}
|
||||
|
||||
if ($w == "" || $w == "u")
|
||||
{
|
||||
// 다음 입력을 위해서 옵션값을 쿠키로 한달동안 저장함
|
||||
//@setcookie("ck_ca_id", $ca_id, time() + 86400*31, $default[de_cookie_dir], $default[de_cookie_domain]);
|
||||
//@setcookie("ck_maker", stripslashes($it_maker), time() + 86400*31, $default[de_cookie_dir], $default[de_cookie_domain]);
|
||||
//@setcookie("ck_origin", stripslashes($it_origin), time() + 86400*31, $default[de_cookie_dir], $default[de_cookie_domain]);
|
||||
@set_cookie("ck_ca_id", $ca_id, time() + 86400*31);
|
||||
@set_cookie("ck_ca_id2", $ca_id2, time() + 86400*31);
|
||||
@set_cookie("ck_ca_id3", $ca_id3, time() + 86400*31);
|
||||
@set_cookie("ck_maker", stripslashes($it_maker), time() + 86400*31);
|
||||
@set_cookie("ck_origin", stripslashes($it_origin), time() + 86400*31);
|
||||
}
|
||||
|
||||
|
||||
// 관련상품을 우선 삭제함
|
||||
sql_query(" delete from {$g5['g5_shop_item_relation_table']} where it_id = '$it_id' ");
|
||||
|
||||
// 관련상품의 반대도 삭제
|
||||
sql_query(" delete from {$g5['g5_shop_item_relation_table']} where it_id2 = '$it_id' ");
|
||||
|
||||
// 이벤트상품을 우선 삭제함
|
||||
sql_query(" delete from {$g5['g5_shop_event_item_table']} where it_id = '$it_id' ");
|
||||
|
||||
// 선택옵션
|
||||
sql_query(" delete from {$g5['g5_shop_item_option_table']} where io_type = '0' and it_id = '$it_id' "); // 기존선택옵션삭제
|
||||
|
||||
$option_count = count($_POST['opt_id']);
|
||||
if($option_count) {
|
||||
// 옵션명
|
||||
$opt1_cnt = $opt2_cnt = $opt3_cnt = 0;
|
||||
for($i=0; $i<$option_count; $i++) {
|
||||
$opt_val = explode(chr(30), $_POST['opt_id'][$i]);
|
||||
if($opt_val[0])
|
||||
$opt1_cnt++;
|
||||
if($opt_val[1])
|
||||
$opt2_cnt++;
|
||||
if($opt_val[2])
|
||||
$opt3_cnt++;
|
||||
}
|
||||
|
||||
if($opt1_subject && $opt1_cnt) {
|
||||
$it_option_subject = $opt1_subject;
|
||||
if($opt2_subject && $opt2_cnt)
|
||||
$it_option_subject .= ','.$opt2_subject;
|
||||
if($opt3_subject && $opt3_cnt)
|
||||
$it_option_subject .= ','.$opt3_subject;
|
||||
}
|
||||
}
|
||||
|
||||
// 추가옵션
|
||||
sql_query(" delete from {$g5['g5_shop_item_option_table']} where io_type = '1' and it_id = '$it_id' "); // 기존추가옵션삭제
|
||||
|
||||
$supply_count = count($_POST['spl_id']);
|
||||
if($supply_count) {
|
||||
// 추가옵션명
|
||||
$arr_spl = array();
|
||||
for($i=0; $i<$supply_count; $i++) {
|
||||
$spl_val = explode(chr(30), $_POST['spl_id'][$i]);
|
||||
if(!in_array($spl_val[0], $arr_spl))
|
||||
$arr_spl[] = $spl_val[0];
|
||||
}
|
||||
|
||||
$it_supply_subject = implode(',', $arr_spl);
|
||||
}
|
||||
|
||||
// 상품요약정보
|
||||
$value_array = array();
|
||||
for($i=0; $i<count($_POST['ii_article']); $i++) {
|
||||
$key = $_POST['ii_article'][$i];
|
||||
$val = $_POST['ii_value'][$i];
|
||||
$value_array[$key] = $val;
|
||||
}
|
||||
$it_info_value = addslashes(serialize($value_array));
|
||||
|
||||
// 포인트 비율 값 체크
|
||||
if($it_point_type == 1 && $it_point > 99)
|
||||
alert("포인트 비율을 0과 99 사이의 값으로 입력해 주십시오.");
|
||||
|
||||
$it_name = strip_tags(trim($_POST['it_name']));
|
||||
if ($it_name == "")
|
||||
alert("상품명을 입력해 주십시오.");
|
||||
|
||||
$sql_common = " ca_id = '$ca_id',
|
||||
ca_id2 = '$ca_id2',
|
||||
ca_id3 = '$ca_id3',
|
||||
it_skin = '$it_skin',
|
||||
it_mobile_skin = '$it_mobile_skin',
|
||||
it_name = '$it_name',
|
||||
it_maker = '$it_maker',
|
||||
it_origin = '$it_origin',
|
||||
it_brand = '$it_brand',
|
||||
it_model = '$it_model',
|
||||
it_option_subject = '$it_option_subject',
|
||||
it_supply_subject = '$it_supply_subject',
|
||||
it_type1 = '$it_type1',
|
||||
it_type2 = '$it_type2',
|
||||
it_type3 = '$it_type3',
|
||||
it_type4 = '$it_type4',
|
||||
it_type5 = '$it_type5',
|
||||
it_basic = '$it_basic',
|
||||
it_explan = '$it_explan',
|
||||
it_explan2 = '".strip_tags(trim($_POST['it_explan']))."',
|
||||
it_mobile_explan = '$it_mobile_explan',
|
||||
it_cust_price = '$it_cust_price',
|
||||
it_price = '$it_price',
|
||||
it_point = '$it_point',
|
||||
it_point_type = '$it_point_type',
|
||||
it_supply_point = '$it_supply_point',
|
||||
it_notax = '$it_notax',
|
||||
it_sell_email = '$it_sell_email',
|
||||
it_use = '$it_use',
|
||||
it_nocoupon = '$it_nocoupon',
|
||||
it_soldout = '$it_soldout',
|
||||
it_stock_qty = '$it_stock_qty',
|
||||
it_stock_sms = '$it_stock_sms',
|
||||
it_noti_qty = '$it_noti_qty',
|
||||
it_sc_type = '$it_sc_type',
|
||||
it_sc_method = '$it_sc_method',
|
||||
it_sc_price = '$it_sc_price',
|
||||
it_sc_minimum = '$it_sc_minimum',
|
||||
it_sc_qty = '$it_sc_qty',
|
||||
it_buy_min_qty = '$it_buy_min_qty',
|
||||
it_buy_max_qty = '$it_buy_max_qty',
|
||||
it_head_html = '$it_head_html',
|
||||
it_tail_html = '$it_tail_html',
|
||||
it_mobile_head_html = '$it_mobile_head_html',
|
||||
it_mobile_tail_html = '$it_mobile_tail_html',
|
||||
it_ip = '{$_SERVER['REMOTE_ADDR']}',
|
||||
it_order = '$it_order',
|
||||
it_tel_inq = '$it_tel_inq',
|
||||
it_info_gubun = '$it_info_gubun',
|
||||
it_info_value = '$it_info_value',
|
||||
it_shop_memo = '$it_shop_memo',
|
||||
it_img1 = '$it_img1',
|
||||
it_img2 = '$it_img2',
|
||||
it_img3 = '$it_img3',
|
||||
it_img4 = '$it_img4',
|
||||
it_img5 = '$it_img5',
|
||||
it_img6 = '$it_img6',
|
||||
it_img7 = '$it_img7',
|
||||
it_img8 = '$it_img8',
|
||||
it_img9 = '$it_img9',
|
||||
it_img10 = '$it_img10',
|
||||
it_1_subj = '$it_1_subj',
|
||||
it_2_subj = '$it_2_subj',
|
||||
it_3_subj = '$it_3_subj',
|
||||
it_4_subj = '$it_4_subj',
|
||||
it_5_subj = '$it_5_subj',
|
||||
it_6_subj = '$it_6_subj',
|
||||
it_7_subj = '$it_7_subj',
|
||||
it_8_subj = '$it_8_subj',
|
||||
it_9_subj = '$it_9_subj',
|
||||
it_10_subj = '$it_10_subj',
|
||||
it_1 = '$it_1',
|
||||
it_2 = '$it_2',
|
||||
it_3 = '$it_3',
|
||||
it_4 = '$it_4',
|
||||
it_5 = '$it_5',
|
||||
it_6 = '$it_6',
|
||||
it_7 = '$it_7',
|
||||
it_8 = '$it_8',
|
||||
it_9 = '$it_9',
|
||||
it_10 = '$it_10'
|
||||
";
|
||||
|
||||
if ($w == "")
|
||||
{
|
||||
$it_id = $_POST['it_id'];
|
||||
|
||||
if (!trim($it_id)) {
|
||||
alert('상품 코드가 없으므로 상품을 추가하실 수 없습니다.');
|
||||
}
|
||||
|
||||
$t_it_id = preg_replace("/[A-Za-z0-9\-_]/", "", $it_id);
|
||||
if($t_it_id)
|
||||
alert('상품 코드는 영문자, 숫자, -, _ 만 사용할 수 있습니다.');
|
||||
|
||||
$sql_common .= " , it_time = '".G5_TIME_YMDHIS."' ";
|
||||
$sql_common .= " , it_update_time = '".G5_TIME_YMDHIS."' ";
|
||||
$sql = " insert {$g5['g5_shop_item_table']}
|
||||
set it_id = '$it_id',
|
||||
$sql_common ";
|
||||
sql_query($sql);
|
||||
}
|
||||
else if ($w == "u")
|
||||
{
|
||||
$sql_common .= " , it_update_time = '".G5_TIME_YMDHIS."' ";
|
||||
$sql = " update {$g5['g5_shop_item_table']}
|
||||
set $sql_common
|
||||
where it_id = '$it_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
/*
|
||||
else if ($w == "d")
|
||||
{
|
||||
if ($is_admin != 'super')
|
||||
{
|
||||
$sql = " select it_id from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b
|
||||
where a.it_id = '$it_id'
|
||||
and a.ca_id = b.ca_id
|
||||
and b.ca_mb_id = '{$member['mb_id']}' ";
|
||||
$row = sql_fetch($sql);
|
||||
if (!$row['it_id'])
|
||||
alert("\'{$member['mb_id']}\' 님께서 삭제 할 권한이 없는 상품입니다.");
|
||||
}
|
||||
|
||||
itemdelete($it_id);
|
||||
}
|
||||
*/
|
||||
|
||||
if ($w == "" || $w == "u")
|
||||
{
|
||||
// 관련상품 등록
|
||||
$it_id2 = explode(",", $it_list);
|
||||
for ($i=0; $i<count($it_id2); $i++)
|
||||
{
|
||||
if (trim($it_id2[$i]))
|
||||
{
|
||||
$sql = " insert into {$g5['g5_shop_item_relation_table']}
|
||||
set it_id = '$it_id',
|
||||
it_id2 = '$it_id2[$i]',
|
||||
ir_no = '$i' ";
|
||||
sql_query($sql, false);
|
||||
|
||||
// 관련상품의 반대로도 등록
|
||||
$sql = " insert into {$g5['g5_shop_item_relation_table']}
|
||||
set it_id = '$it_id2[$i]',
|
||||
it_id2 = '$it_id',
|
||||
ir_no = '$i' ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
}
|
||||
|
||||
// 이벤트상품 등록
|
||||
$ev_id = explode(",", $ev_list);
|
||||
for ($i=0; $i<count($ev_id); $i++)
|
||||
{
|
||||
if (trim($ev_id[$i]))
|
||||
{
|
||||
$sql = " insert into {$g5['g5_shop_event_item_table']}
|
||||
set ev_id = '$ev_id[$i]',
|
||||
it_id = '$it_id' ";
|
||||
sql_query($sql, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 선택옵션등록
|
||||
if($option_count) {
|
||||
$comma = '';
|
||||
$sql = " INSERT INTO {$g5['g5_shop_item_option_table']}
|
||||
( `io_id`, `io_type`, `it_id`, `io_price`, `io_stock_qty`, `io_noti_qty`, `io_use` )
|
||||
VALUES ";
|
||||
for($i=0; $i<$option_count; $i++) {
|
||||
$sql .= $comma . " ( '{$_POST['opt_id'][$i]}', '0', '$it_id', '{$_POST['opt_price'][$i]}', '{$_POST['opt_stock_qty'][$i]}', '{$_POST['opt_noti_qty'][$i]}', '{$_POST['opt_use'][$i]}' )";
|
||||
$comma = ' , ';
|
||||
}
|
||||
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
// 추가옵션등록
|
||||
if($supply_count) {
|
||||
$comma = '';
|
||||
$sql = " INSERT INTO {$g5['g5_shop_item_option_table']}
|
||||
( `io_id`, `io_type`, `it_id`, `io_price`, `io_stock_qty`, `io_noti_qty`, `io_use` )
|
||||
VALUES ";
|
||||
for($i=0; $i<$supply_count; $i++) {
|
||||
$sql .= $comma . " ( '{$_POST['spl_id'][$i]}', '1', '$it_id', '{$_POST['spl_price'][$i]}', '{$_POST['spl_stock_qty'][$i]}', '{$_POST['spl_noti_qty'][$i]}', '{$_POST['spl_use'][$i]}' )";
|
||||
$comma = ' , ';
|
||||
}
|
||||
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
// 동일 분류내 상품 동일 옵션 적용
|
||||
$ca_fields = '';
|
||||
if(is_checked('chk_ca_it_skin')) $ca_fields .= " , it_skin = '$it_skin' ";
|
||||
if(is_checked('chk_ca_it_mobile_skin')) $ca_fields .= " , it_mobile_skin = '$it_mobile_skin' ";
|
||||
if(is_checked('chk_ca_it_basic')) $ca_fields .= " , it_basic = '$it_basic' ";
|
||||
if(is_checked('chk_ca_it_order')) $ca_fields .= " , it_order = '$it_order' ";
|
||||
if(is_checked('chk_ca_it_type')) $ca_fields .= " , it_type1 = '$it_type1', it_type2 = '$it_type2', it_type3 = '$it_type3', it_type4 = '$it_type4', it_type5 = '$it_type5' ";
|
||||
if(is_checked('chk_ca_it_maker')) $ca_fields .= " , it_maker = '$it_maker' ";
|
||||
if(is_checked('chk_ca_it_origin')) $ca_fields .= " , it_origin = '$it_origin' ";
|
||||
if(is_checked('chk_ca_it_brand')) $ca_fields .= " , it_brand = '$it_brand' ";
|
||||
if(is_checked('chk_ca_it_model')) $ca_fields .= " , it_model = '$it_model' ";
|
||||
if(is_checked('chk_ca_it_notax')) $ca_fields .= " , it_notax = '$it_notax' ";
|
||||
if(is_checked('chk_ca_it_sell_email')) $ca_fields .= " , it_sell_email = '$it_sell_email' ";
|
||||
if(is_checked('chk_ca_it_shop_memo')) $ca_fields .= " , it_shop_memo = '$it_shop_memo' ";
|
||||
if(is_checked('chk_ca_it_tel_inq')) $ca_fields .= " , it_tel_inq = '$it_tel_inq' ";
|
||||
if(is_checked('chk_ca_it_use')) $ca_fields .= " , it_use = '$it_use' ";
|
||||
if(is_checked('chk_ca_it_nocoupon')) $ca_fields .= " , it_nocoupon = '$it_nocoupon' ";
|
||||
if(is_checked('chk_ca_it_soldout')) $ca_fields .= " , it_soldout = '$it_soldout' ";
|
||||
if(is_checked('chk_ca_it_info')) $ca_fields .= " , it_info_gubun = '$it_info_gubun', it_info_value = '$it_info_value' ";
|
||||
if(is_checked('chk_ca_it_price')) $ca_fields .= " , it_price = '$it_price' ";
|
||||
if(is_checked('chk_ca_it_cust_price')) $ca_fields .= " , it_cust_price = '$it_cust_price' ";
|
||||
if(is_checked('chk_ca_it_point')) $ca_fields .= " , it_point = '$it_point' ";
|
||||
if(is_checked('chk_ca_it_point_type')) $ca_fields .= " , it_point_type = '$it_point_type' ";
|
||||
if(is_checked('chk_ca_it_supply_point')) $ca_fields .= " , it_supply_point = '$it_supply_point' ";
|
||||
if(is_checked('chk_ca_it_stock_qty')) $ca_fields .= " , it_stock_qty = '$it_stock_qty' ";
|
||||
if(is_checked('chk_ca_it_noti_qty')) $ca_fields .= " , it_noti_qty = '$it_noti_qty' ";
|
||||
if(is_checked('chk_ca_it_sendcost')) $ca_fields .= " , it_sc_type = '$it_sc_type', it_sc_method = '$it_sc_method', it_sc_price = '$it_sc_price', it_sc_minimum = '$it_sc_minimum', it_sc_qty = '$it_sc_qty' ";
|
||||
if(is_checked('chk_ca_it_buy_min_qty')) $ca_fields .= " , it_buy_min_qty = '$it_buy_min_qty' ";
|
||||
if(is_checked('chk_ca_it_buy_max_qty')) $ca_fields .= " , it_buy_max_qty = '$it_buy_max_qty' ";
|
||||
if(is_checked('chk_ca_it_head_html')) $ca_fields .= " , it_head_html = '$it_head_html' ";
|
||||
if(is_checked('chk_ca_it_tail_html')) $ca_fields .= " , it_tail_html = '$it_tail_html' ";
|
||||
if(is_checked('chk_ca_it_mobile_head_html')) $ca_fields .= " , it_mobile_head_html = '$it_mobile_head_html' ";
|
||||
if(is_checked('chk_ca_it_mobile_tail_html')) $ca_fields .= " , it_mobile_tail_html = '$it_mobile_tail_html' ";
|
||||
if(is_checked('chk_ca_1')) $ca_fields .= " , it_1_subj = '$it_1_subj', it_1 = '$it_1' ";
|
||||
if(is_checked('chk_ca_2')) $ca_fields .= " , it_2_subj = '$it_2_subj', it_2 = '$it_2' ";
|
||||
if(is_checked('chk_ca_3')) $ca_fields .= " , it_3_subj = '$it_3_subj', it_3 = '$it_3' ";
|
||||
if(is_checked('chk_ca_4')) $ca_fields .= " , it_4_subj = '$it_4_subj', it_4 = '$it_4' ";
|
||||
if(is_checked('chk_ca_5')) $ca_fields .= " , it_5_subj = '$it_5_subj', it_5 = '$it_5' ";
|
||||
if(is_checked('chk_ca_6')) $ca_fields .= " , it_6_subj = '$it_6_subj', it_6 = '$it_6' ";
|
||||
if(is_checked('chk_ca_7')) $ca_fields .= " , it_7_subj = '$it_7_subj', it_7 = '$it_7' ";
|
||||
if(is_checked('chk_ca_8')) $ca_fields .= " , it_8_subj = '$it_8_subj', it_8 = '$it_8' ";
|
||||
if(is_checked('chk_ca_9')) $ca_fields .= " , it_9_subj = '$it_9_subj', it_9 = '$it_9' ";
|
||||
if(is_checked('chk_ca_10')) $ca_fields .= " , it_10_subj = '$it_10_subj', it_10 = '$it_10' ";
|
||||
|
||||
if($ca_fields) {
|
||||
sql_query(" update {$g5['g5_shop_item_table']} set it_name = it_name {$ca_fields} where ca_id = '$ca_id' ");
|
||||
if($ca_id2)
|
||||
sql_query(" update {$g5['g5_shop_item_table']} set it_name = it_name {$ca_fields} where ca_id2 = '$ca_id2' ");
|
||||
if($ca_id3)
|
||||
sql_query(" update {$g5['g5_shop_item_table']} set it_name = it_name {$ca_fields} where ca_id3 = '$ca_id3' ");
|
||||
}
|
||||
|
||||
// 모든 상품 동일 옵션 적용
|
||||
$all_fields = '';
|
||||
if(is_checked('chk_all_it_skin')) $all_fields .= " , it_skin = '$it_skin' ";
|
||||
if(is_checked('chk_all_it_mobile_skin')) $all_fields .= " , it_mobile_skin = '$it_mobile_skin' ";
|
||||
if(is_checked('chk_all_it_basic')) $all_fields .= " , it_basic = '$it_basic' ";
|
||||
if(is_checked('chk_all_it_order')) $all_fields .= " , it_order = '$it_order' ";
|
||||
if(is_checked('chk_all_it_type')) $all_fields .= " , it_type1 = '$it_type1', it_type2 = '$it_type2', it_type3 = '$it_type3', it_type4 = '$it_type4', it_type5 = '$it_type5' ";
|
||||
if(is_checked('chk_all_it_maker')) $all_fields .= " , it_maker = '$it_maker' ";
|
||||
if(is_checked('chk_all_it_origin')) $all_fields .= " , it_origin = '$it_origin' ";
|
||||
if(is_checked('chk_all_it_brand')) $all_fields .= " , it_brand = '$it_brand' ";
|
||||
if(is_checked('chk_all_it_model')) $all_fields .= " , it_model = '$it_model' ";
|
||||
if(is_checked('chk_all_it_notax')) $all_fields .= " , it_notax = '$it_notax' ";
|
||||
if(is_checked('chk_all_it_sell_email')) $all_fields .= " , it_sell_email = '$it_sell_email' ";
|
||||
if(is_checked('chk_all_it_shop_memo')) $all_fields .= " , it_shop_memo = '$it_shop_memo' ";
|
||||
if(is_checked('chk_all_it_tel_inq')) $all_fields .= " , it_tel_inq = '$it_tel_inq' ";
|
||||
if(is_checked('chk_all_it_use')) $all_fields .= " , it_use = '$it_use' ";
|
||||
if(is_checked('chk_all_it_nocoupon')) $all_fields .= " , it_nocoupon = '$it_nocoupon' ";
|
||||
if(is_checked('chk_all_it_soldout')) $all_fields .= " , it_soldout = '$it_soldout' ";
|
||||
if(is_checked('chk_all_it_info')) $all_fields .= " , it_info_gubun = '$it_info_gubun', it_info_value = '$it_info_value' ";
|
||||
if(is_checked('chk_all_it_price')) $all_fields .= " , it_price = '$it_price' ";
|
||||
if(is_checked('chk_all_it_cust_price')) $all_fields .= " , it_cust_price = '$it_cust_price' ";
|
||||
if(is_checked('chk_all_it_point')) $all_fields .= " , it_point = '$it_point' ";
|
||||
if(is_checked('chk_all_it_point_type')) $all_fields .= " , it_point_type = '$it_point_type' ";
|
||||
if(is_checked('chk_all_it_supply_point')) $all_fields .= " , it_supply_point = '$it_supply_point' ";
|
||||
if(is_checked('chk_all_it_stock_qty')) $all_fields .= " , it_stock_qty = '$it_stock_qty' ";
|
||||
if(is_checked('chk_all_it_noti_qty')) $all_fields .= " , it_noti_qty = '$it_noti_qty' ";
|
||||
if(is_checked('chk_all_it_sendcost')) $all_fields .= " , it_sc_type = '$it_sc_type', it_sc_method = '$it_sc_method', it_sc_price = '$it_sc_price', it_sc_minimum = '$it_sc_minimum', it_sc_qty = '$it_sc_qty' ";
|
||||
if(is_checked('chk_all_it_buy_min_qty')) $all_fields .= " , it_buy_min_qty = '$it_buy_min_qty' ";
|
||||
if(is_checked('chk_all_it_buy_max_qty')) $all_fields .= " , it_buy_max_qty = '$it_buy_max_qty' ";
|
||||
if(is_checked('chk_all_it_head_html')) $all_fields .= " , it_head_html = '$it_head_html' ";
|
||||
if(is_checked('chk_all_it_tail_html')) $all_fields .= " , it_tail_html = '$it_tail_html' ";
|
||||
if(is_checked('chk_all_it_mobile_head_html')) $all_fields .= " , it_mobile_head_html = '$it_mobile_head_html' ";
|
||||
if(is_checked('chk_all_it_mobile_tail_html')) $all_fields .= " , it_mobile_tail_html = '$it_mobile_tail_html' ";
|
||||
if(is_checked('chk_all_1')) $all_fields .= " , it_1_subj = '$it_1_subj', it_1 = '$it_1' ";
|
||||
if(is_checked('chk_all_2')) $all_fields .= " , it_2_subj = '$it_2_subj', it_2 = '$it_2' ";
|
||||
if(is_checked('chk_all_3')) $all_fields .= " , it_3_subj = '$it_3_subj', it_3 = '$it_3' ";
|
||||
if(is_checked('chk_all_4')) $all_fields .= " , it_4_subj = '$it_4_subj', it_4 = '$it_4' ";
|
||||
if(is_checked('chk_all_5')) $all_fields .= " , it_5_subj = '$it_5_subj', it_5 = '$it_5' ";
|
||||
if(is_checked('chk_all_6')) $all_fields .= " , it_6_subj = '$it_6_subj', it_6 = '$it_6' ";
|
||||
if(is_checked('chk_all_7')) $all_fields .= " , it_7_subj = '$it_7_subj', it_7 = '$it_7' ";
|
||||
if(is_checked('chk_all_8')) $all_fields .= " , it_8_subj = '$it_8_subj', it_8 = '$it_8' ";
|
||||
if(is_checked('chk_all_9')) $all_fields .= " , it_9_subj = '$it_9_subj', it_9 = '$it_9' ";
|
||||
if(is_checked('chk_all_10')) $all_fields .= " , it_10_subj = '$it_10_subj', it_10 = '$it_10' ";
|
||||
|
||||
if($all_fields) {
|
||||
sql_query(" update {$g5['g5_shop_item_table']} set it_name = it_name {$all_fields} ");
|
||||
}
|
||||
|
||||
$qstr = "$qstr&sca=$sca&page=$page";
|
||||
|
||||
if ($w == "u") {
|
||||
goto_url("./itemform.php?w=u&it_id=$it_id&$qstr");
|
||||
} else if ($w == "d") {
|
||||
$qstr = "ca_id=$ca_id&sfl=$sfl&sca=$sca&page=$page&stx=".urlencode($stx)."&save_stx=".urlencode($save_stx);
|
||||
goto_url("./itemlist.php?$qstr");
|
||||
}
|
||||
|
||||
echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">";
|
||||
?>
|
||||
<script>
|
||||
if (confirm("계속 입력하시겠습니까?"))
|
||||
//location.href = "<?php echo "./itemform.php?it_id=$it_id&sort1=$sort1&sort2=$sort2&sel_ca_id=$sel_ca_id&sel_field=$sel_field&search=$search&page=$page"?>";
|
||||
location.href = "<?php echo "./itemform.php?".str_replace('&', '&', $qstr); ?>";
|
||||
else
|
||||
location.href = "<?php echo "./itemlist.php?".str_replace('&', '&', $qstr); ?>";
|
||||
</script>
|
||||
66
adm/shop_admin/iteminfo.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
include_once(G5_LIB_PATH.'/iteminfo.lib.php');
|
||||
|
||||
if($it['it_id']) {
|
||||
//$it_id = $it['it_id'];
|
||||
$gubun = $it['it_info_gubun'];
|
||||
} else {
|
||||
$it_id = trim($_POST['it_id']);
|
||||
$gubun = $_POST['gubun'] ? $_POST['gubun'] : 'wear';
|
||||
|
||||
$sql = " select it_id, it_info_gubun, it_info_value from {$g5['g5_shop_item_table']} where it_id = '$it_id' ";
|
||||
$it = sql_fetch($sql);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<caption>상품요약정보 입력</caption>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
<col class="grid_3">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<?php
|
||||
if($it['it_info_value'])
|
||||
$info_value = unserialize($it['it_info_value']);
|
||||
$article = $item_info[$gubun]['article'];
|
||||
if ($article) {
|
||||
// $el_no : 분류적용, 전체적용을 한번만 넣기 위해, $el_length : 수직병합할 셀 값 - 지운아빠 2013-05-20
|
||||
$el_no = 0;
|
||||
$el_length = count($article);
|
||||
foreach($article as $key=>$value) {
|
||||
$el_name = $key;
|
||||
$el_title = $value[0];
|
||||
$el_example = $value[1];
|
||||
$el_value = '상품페이지 참고';
|
||||
|
||||
if($gubun == $it['it_info_gubun'] && $info_value[$key])
|
||||
$el_value = $info_value[$key];
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="ii_article_<?php echo $el_name; ?>"><?php echo $el_title; ?></label></th>
|
||||
<td>
|
||||
<input type="hidden" name="ii_article[]" value="<?php echo $el_name; ?>">
|
||||
<?php if ($el_example != "") echo help($el_example); ?>
|
||||
<input type="text" name="ii_value[]" value="<?php echo $el_value; ?>" id="ii_article_<?php echo $el_name; ?>" required class="frm_input required" />
|
||||
</td>
|
||||
<?php if ($el_no == 0) { ?>
|
||||
<td rowspan="<?php echo $el_length; ?>" class="td_grpset">
|
||||
<input type="checkbox" name="chk_ca_it_info" value="1" id="chk_ca_it_info">
|
||||
<label for="chk_ca_it_info">분류적용</label>
|
||||
<input type="checkbox" name="chk_all_it_info" value="1" id="chk_all_it_info">
|
||||
<label for="chk_all_it_info">전체적용</label>
|
||||
</td>
|
||||
<?php } $el_no++; ?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
321
adm/shop_admin/itemlist.php
Normal file
@ -0,0 +1,321 @@
|
||||
<?php
|
||||
$sub_menu = '400300';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '상품관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
// 분류
|
||||
$ca_list = '<option value="">선택</option>'.PHP_EOL;
|
||||
$sql = " select * from {$g5['g5_shop_category_table']} ";
|
||||
if ($is_admin != 'super')
|
||||
$sql .= " where ca_mb_id = '{$member['mb_id']}' ";
|
||||
$sql .= " order by ca_order, ca_id ";
|
||||
$result = sql_query($sql);
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$len = strlen($row['ca_id']) / 2 - 1;
|
||||
$nbsp = '';
|
||||
for ($i=0; $i<$len; $i++) {
|
||||
$nbsp .= ' ';
|
||||
}
|
||||
$ca_list .= '<option value="'.$row['ca_id'].'">'.$nbsp.$row['ca_name'].'</option>'.PHP_EOL;
|
||||
}
|
||||
|
||||
// 스킨
|
||||
$skin_list = '<option value="">선택</option>'.PHP_EOL;
|
||||
$arr = get_skin_dir('shop');
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
$skin_list .= '<option value="'.$arr[$i].'">'.$arr[$i].'</option>'.PHP_EOL;
|
||||
}
|
||||
|
||||
$mskin_list = '<option value="">선택</option>'.PHP_EOL;
|
||||
$arr = get_skin_dir('shop', G5_MOBILE_PATH.'/'.G5_SKIN_DIR);
|
||||
for ($i=0; $i<count($arr); $i++) {
|
||||
$mskin_list .= '<option value="'.$arr[$i].'">'.$arr[$i].'</option>'.PHP_EOL;
|
||||
}
|
||||
|
||||
|
||||
$where = " and ";
|
||||
$sql_search = "";
|
||||
if ($stx != "") {
|
||||
if ($sfl != "") {
|
||||
$sql_search .= " $where $sfl like '%$stx%' ";
|
||||
$where = " and ";
|
||||
}
|
||||
if ($save_stx != $stx)
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
if ($sca != "") {
|
||||
$sql_search .= " $where (a.ca_id like '$sca%' or a.ca_id2 like '$sca%' or a.ca_id3 like '$sca%') ";
|
||||
}
|
||||
|
||||
if ($sfl == "") $sfl = "it_name";
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_item_table']} a ,
|
||||
{$g5['g5_shop_category_table']} b
|
||||
where (a.ca_id = b.ca_id";
|
||||
if ($is_admin != 'super')
|
||||
$sql_common .= " and b.ca_mb_id = '{$member['mb_id']}'";
|
||||
$sql_common .= ") ";
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
if (!$sst) {
|
||||
$sst = "it_id";
|
||||
$sod = "desc";
|
||||
}
|
||||
$sql_order = "order by $sst $sod";
|
||||
|
||||
|
||||
$sql = " select *
|
||||
$sql_common
|
||||
$sql_order
|
||||
limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
//$qstr = $qstr.'&sca='.$sca.'&page='.$page;
|
||||
$qstr = $qstr.'&sca='.$sca.'&page='.$page.'&save_stx='.$stx;
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall; ?>
|
||||
등록된 상품 <?php echo $total_count; ?>건
|
||||
</div>
|
||||
|
||||
<form name="flist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="save_stx" value="<?php echo $stx; ?>">
|
||||
|
||||
<label for="sca" class="sound_only">분류선택</label>
|
||||
<select name="sca" id="sca">
|
||||
<option value="">전체분류</option>
|
||||
<?php
|
||||
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
|
||||
$result1 = sql_query($sql1);
|
||||
for ($i=0; $row1=sql_fetch_array($result1); $i++) {
|
||||
$len = strlen($row1['ca_id']) / 2 - 1;
|
||||
$nbsp = '';
|
||||
for ($i=0; $i<$len; $i++) $nbsp .= ' ';
|
||||
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sca, $row1['ca_id']).'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<label for="sfl" class="sound_only">검색대상</label>
|
||||
<select name="sfl" id="sfl">
|
||||
<option value="it_name" <?php echo get_selected($sfl, 'it_name'); ?>>상품명</option>
|
||||
<option value="it_id" <?php echo get_selected($sfl, 'it_id'); ?>>상품코드</option>
|
||||
<option value="it_maker" <?php echo get_selected($sfl, 'it_maker'); ?>>제조사</option>
|
||||
<option value="it_origin" <?php echo get_selected($sfl, 'it_origin'); ?>>원산지</option>
|
||||
<option value="it_sell_email" <?php echo get_selected($sfl, 'it_sell_email'); ?>>판매자 e-mail</option>
|
||||
</select>
|
||||
|
||||
<label for="stx" class="sound_only">검색어</label>
|
||||
<input type="text" name="stx" value="<?php echo $stx; ?>" id="stx" class="frm_input">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<div class="btn_add01 btn_add">
|
||||
<a href="./itemform.php">상품등록</a>
|
||||
<a href="./itemexcel.php" onclick="return excelform(this.href);" target="_blank">상품일괄등록</a>
|
||||
</div>
|
||||
|
||||
<form name="fitemlistupdate" method="post" action="./itemlistupdate.php" onsubmit="return fitemlist_submit(this);" autocomplete="off">
|
||||
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
|
||||
<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; ?>">
|
||||
|
||||
<div class="tbl_head02 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" rowspan="3">
|
||||
<label for="chkall" class="sound_only">상품 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<th scope="col" rowspan="3"><?php echo subject_sort_link('it_id', 'sca='.$sca); ?>상품코드</a></th>
|
||||
<th scope="col" colspan="5">분류</th>
|
||||
<th scope="col" rowspan="3"><?php echo subject_sort_link('it_order', 'sca='.$sca); ?>순서</a></th>
|
||||
<th scope="col" rowspan="3"><?php echo subject_sort_link('it_use', 'sca='.$sca, 1); ?>판매</a></th>
|
||||
<th scope="col" rowspan="3"><?php echo subject_sort_link('it_soldout', 'sca='.$sca, 1); ?>품절</a></th>
|
||||
<th scope="col" rowspan="3"><?php echo subject_sort_link('it_hit', 'sca='.$sca, 1); ?>조회</a></th>
|
||||
<th scope="col" rowspan="3">관리</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="col" rowspan="2" id="th_img">이미지</th>
|
||||
<th scope="col" rowspan="2" id="th_pc_title"><?php echo subject_sort_link('it_name', 'sca='.$sca); ?>상품명</a></th>
|
||||
<th scope="col" id="th_amt"><?php echo subject_sort_link('it_price', 'sca='.$sca); ?>판매가격</a></th>
|
||||
<th scope="col" id="th_camt"><?php echo subject_sort_link('it_cust_price', 'sca='.$sca); ?>시중가격</a></th>
|
||||
<th scope="col" id="th_skin">PC스킨</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="col" id="th_pt"><?php echo subject_sort_link('it_point', 'sca='.$sca); ?>포인트</a></th>
|
||||
<th scope="col" id="th_qty"><?php echo subject_sort_link('it_stock_qty', 'sca='.$sca); ?>재고</a></th>
|
||||
<th scope="col" id="th_mskin">모바일스킨</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);
|
||||
|
||||
$it_point = $row['it_point'];
|
||||
if($row['it_point_type'])
|
||||
$it_point .= '%';
|
||||
?>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td rowspan="3" class="td_chk">
|
||||
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['it_name']); ?></label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i; ?>">
|
||||
</td>
|
||||
<td rowspan="3" class="td_num">
|
||||
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
|
||||
<?php echo $row['it_id']; ?>
|
||||
</td>
|
||||
<td colspan="5">
|
||||
<label for="ca_id_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['it_name']); ?> 기본분류</label>
|
||||
<select name="ca_id[<?php echo $i; ?>]" id="ca_id_<?php echo $i; ?>">
|
||||
<?php echo conv_selected_option($ca_list, $row['ca_id']); ?>
|
||||
</select>
|
||||
<label for="ca_id2_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['it_name']); ?> 2차분류</label>
|
||||
<select name="ca_id2[<?php echo $i; ?>]" id="ca_id2_<?php echo $i; ?>">
|
||||
<?php echo conv_selected_option($ca_list, $row['ca_id2']); ?>
|
||||
</select>
|
||||
<label for="ca_id3_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['it_name']); ?> 3차분류</label>
|
||||
<select name="ca_id3[<?php echo $i; ?>]" id="ca_id3_<?php echo $i; ?>">
|
||||
<?php echo conv_selected_option($ca_list, $row['ca_id3']); ?>
|
||||
</select>
|
||||
</td>
|
||||
<td rowspan="3" class="td_mngsmall">
|
||||
<label for="order_<?php echo $i; ?>" class="sound_only">순서</label>
|
||||
<input type="text" name="it_order[<?php echo $i; ?>]" value="<?php echo $row['it_order']; ?>" id="order_<?php echo $i; ?>" class="frm_input" size="3">
|
||||
</td>
|
||||
<td rowspan="3" class="td_chk">
|
||||
<label for="use_<?php echo $i; ?>" class="sound_only">판매여부</label>
|
||||
<input type="checkbox" name="it_use[<?php echo $i; ?>]" <?php echo ($row['it_use'] ? 'checked' : ''); ?> value="1" id="use_<?php echo $i; ?>">
|
||||
</td>
|
||||
<td rowspan="3" class="td_chk">
|
||||
<label for="soldout_<?php echo $i; ?>" class="sound_only">품절</label>
|
||||
<input type="checkbox" name="it_soldout[<?php echo $i; ?>]" <?php echo ($row['it_soldout'] ? 'checked' : ''); ?> value="1" id="soldout_<?php echo $i; ?>">
|
||||
</td>
|
||||
<td rowspan="3" class="td_num"><?php echo $row['it_hit']; ?></td>
|
||||
<td rowspan="3" class="td_mng">
|
||||
<a href="./itemform.php?w=u&it_id=<?php echo $row['it_id']; ?>&ca_id=<?php echo $row['ca_id']; ?>&<?php echo $qstr; ?>"><span class="sound_only"><?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?> </span>수정</a>
|
||||
<a href="./itemcopy.php?it_id=<?php echo $row['it_id']; ?>&ca_id=<?php echo $row['ca_id']; ?>" class="itemcopy" target="_blank"><span class="sound_only"><?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?> </span>복사</a>
|
||||
<a href="<?php echo $href; ?>"><span class="sound_only"><?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?> </span>보기</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td rowspan="2" class="td_img"><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?></a></td>
|
||||
<td headers="th_pc_title" rowspan="2" class="td_input">
|
||||
<label for="name_<?php echo $i; ?>" class="sound_only">상품명</label>
|
||||
<input type="text" name="it_name[<?php echo $i; ?>]" value="<?php echo htmlspecialchars2(cut_str($row['it_name'],250, "")); ?>" id="name_<?php echo $i; ?>" required class="frm_input required" size="30">
|
||||
</td>
|
||||
<td headers="th_amt" class="td_numbig td_input">
|
||||
<label for="price_<?php echo $i; ?>" class="sound_only">판매가격</label>
|
||||
<input type="text" name="it_price[<?php echo $i; ?>]" value="<?php echo $row['it_price']; ?>" id="price_<?php echo $i; ?>" class="frm_input sit_amt" size="7">
|
||||
</td>
|
||||
<td headers="th_camt" class="td_numbig td_input">
|
||||
<label for="cust_price_<?php echo $i; ?>" class="sound_only">시중가격</label>
|
||||
<input type="text" name="it_cust_price[<?php echo $i; ?>]" value="<?php echo $row['it_cust_price']; ?>" id="cust_price_<?php echo $i; ?>" class="frm_input sit_camt" size="7">
|
||||
</td>
|
||||
<td headers="th_skin" class="td_numbig td_input">
|
||||
<label for="it_skin_<?php echo $i; ?>" class="sound_only">PC 스킨</label>
|
||||
<select name="it_skin[<?php echo $i; ?>]" id="it_skin_<?php echo $i; ?>">
|
||||
<?php echo conv_selected_option($skin_list, $row['it_skin']); ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td headers="th_pt" class="td_numbig td_input"><?php echo $it_point; ?></td>
|
||||
<td headers="th_qty" class="td_numbig td_input">
|
||||
<label for="stock_qty_<?php echo $i; ?>" class="sound_only">재고</label>
|
||||
<input type="text" name="it_stock_qty[<?php echo $i; ?>]" value="<?php echo $row['it_stock_qty']; ?>" id="stock_qty_<?php echo $i; ?>" class="frm_input sit_qty" size="7">
|
||||
</td>
|
||||
<td headers="th_mskin" class="td_numbig td_input">
|
||||
<label for="it_mobile_skin_<?php echo $i; ?>" class="sound_only">모바일 스킨</label>
|
||||
<select name="it_mobile_skin[<?php echo $i; ?>]" id="it_mobile_skin_<?php echo $i; ?>">
|
||||
<?php echo conv_selected_option($mskin_list, $row['it_mobile_skin']); ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="12" class="empty_table">자료가 한건도 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_list01 btn_list">
|
||||
<input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value">
|
||||
<?php if ($is_admin == 'super') { ?>
|
||||
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
|
||||
<?php } ?>
|
||||
</div>
|
||||
<!-- <div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="일괄수정" class="btn_submit" accesskey="s">
|
||||
</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="); ?>
|
||||
|
||||
<script>
|
||||
function fitemlist_submit(f)
|
||||
{
|
||||
if (!is_checked("chk[]")) {
|
||||
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(document.pressed == "선택삭제") {
|
||||
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$(".itemcopy").click(function() {
|
||||
var href = $(this).attr("href");
|
||||
window.open(href, "copywin", "left=100, top=100, width=300, height=200, scrollbars=0");
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function excelform(url)
|
||||
{
|
||||
var opt = "width=600,height=450,left=10,top=10";
|
||||
window.open(url, "win_excel", opt);
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
58
adm/shop_admin/itemlistupdate.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
$sub_menu = '400300';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
if (!count($_POST['chk'])) {
|
||||
alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요.");
|
||||
}
|
||||
|
||||
if ($_POST['act_button'] == "선택수정") {
|
||||
|
||||
auth_check($auth[$sub_menu], 'w');
|
||||
|
||||
for ($i=0; $i<count($_POST['chk']); $i++) {
|
||||
|
||||
// 실제 번호를 넘김
|
||||
$k = $_POST['chk'][$i];
|
||||
|
||||
$sql = "update {$g5['g5_shop_item_table']}
|
||||
set ca_id = '{$_POST['ca_id'][$k]}',
|
||||
ca_id2 = '{$_POST['ca_id2'][$k]}',
|
||||
ca_id3 = '{$_POST['ca_id3'][$k]}',
|
||||
it_name = '{$_POST['it_name'][$k]}',
|
||||
it_cust_price = '{$_POST['it_cust_price'][$k]}',
|
||||
it_price = '{$_POST['it_price'][$k]}',
|
||||
it_stock_qty = '{$_POST['it_stock_qty'][$k]}',
|
||||
it_skin = '{$_POST['it_skin'][$k]}',
|
||||
it_mobile_skin = '{$_POST['it_mobile_skin'][$k]}',
|
||||
it_use = '{$_POST['it_use'][$k]}',
|
||||
it_soldout = '{$_POST['it_soldout'][$k]}',
|
||||
it_order = '{$_POST['it_order'][$k]}',
|
||||
it_update_time = '".G5_TIME_YMDHIS."'
|
||||
where it_id = '{$_POST['it_id'][$k]}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
} else if ($_POST['act_button'] == "선택삭제") {
|
||||
|
||||
if ($is_admin != 'super')
|
||||
alert('상품 삭제는 최고관리자만 가능합니다.');
|
||||
|
||||
auth_check($auth[$sub_menu], 'd');
|
||||
|
||||
// _ITEM_DELETE_ 상수를 선언해야 itemdelete.inc.php 가 정상 작동함
|
||||
define('_ITEM_DELETE_', true);
|
||||
|
||||
for ($i=0; $i<count($_POST['chk']); $i++) {
|
||||
// 실제 번호를 넘김
|
||||
$k = $_POST['chk'][$i];
|
||||
|
||||
// include 전에 $it_id 값을 반드시 넘겨야 함
|
||||
$it_id = $_POST['it_id'][$k];
|
||||
include ('./itemdelete.inc.php');
|
||||
}
|
||||
}
|
||||
|
||||
goto_url("./itemlist.php?sca=$sca&sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page");
|
||||
?>
|
||||
220
adm/shop_admin/itemoption.php
Normal file
@ -0,0 +1,220 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$po_run = false;
|
||||
|
||||
if($it['it_id']) {
|
||||
$opt_subject = explode(',', $it['it_option_subject']);
|
||||
$opt1_subject = $opt_subject[0];
|
||||
$opt2_subject = $opt_subject[1];
|
||||
$opt3_subject = $opt_subject[2];
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_item_option_table']} where io_type = '0' and it_id = '{$it['it_id']}' order by io_no asc ";
|
||||
$result = sql_query($sql);
|
||||
if(mysql_num_rows($result))
|
||||
$po_run = true;
|
||||
} else if(!empty($_POST)) {
|
||||
$opt1_subject = preg_replace('/[\'\"]/', '', trim(stripslashes($_POST['opt1_subject'])));
|
||||
$opt2_subject = preg_replace('/[\'\"]/', '', trim(stripslashes($_POST['opt2_subject'])));
|
||||
$opt3_subject = preg_replace('/[\'\"]/', '', trim(stripslashes($_POST['opt3_subject'])));
|
||||
|
||||
$opt1_val = preg_replace('/[\'\"]/', '', trim(stripslashes($_POST['opt1'])));
|
||||
$opt2_val = preg_replace('/[\'\"]/', '', trim(stripslashes($_POST['opt2'])));
|
||||
$opt3_val = preg_replace('/[\'\"]/', '', trim(stripslashes($_POST['opt3'])));
|
||||
|
||||
if(!$opt1_subject || !$opt1_val) {
|
||||
echo '옵션1과 옵션1 항목을 입력해 주십시오.';
|
||||
exit;
|
||||
}
|
||||
|
||||
$po_run = true;
|
||||
|
||||
$opt1_count = $opt2_count = $opt3_count = 0;
|
||||
|
||||
if($opt1_val) {
|
||||
$opt1 = explode(',', $opt1_val);
|
||||
$opt1_count = count($opt1);
|
||||
}
|
||||
|
||||
if($opt2_val) {
|
||||
$opt2 = explode(',', $opt2_val);
|
||||
$opt2_count = count($opt2);
|
||||
}
|
||||
|
||||
if($opt3_val) {
|
||||
$opt3 = explode(',', $opt3_val);
|
||||
$opt3_count = count($opt3);
|
||||
}
|
||||
}
|
||||
|
||||
if($po_run) {
|
||||
?>
|
||||
|
||||
<div class="sit_option_frm_wrapper">
|
||||
<table>
|
||||
<caption>옵션 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="opt_chk_all" class="sound_only">전체 옵션</label>
|
||||
<input type="checkbox" name="opt_chk_all" value="1" id="opt_chk_all">
|
||||
</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
|
||||
if($it['it_id']) {
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
$opt_id = $row['io_id'];
|
||||
$opt_val = explode(chr(30), $opt_id);
|
||||
$opt_1 = $opt_val[0];
|
||||
$opt_2 = $opt_val[1];
|
||||
$opt_3 = $opt_val[2];
|
||||
$opt_2_len = strlen($opt_2);
|
||||
$opt_3_len = strlen($opt_3);
|
||||
$opt_price = $row['io_price'];
|
||||
$opt_stock_qty = $row['io_stock_qty'];
|
||||
$opt_noti_qty = $row['io_noti_qty'];
|
||||
$opt_use = $row['io_use'];
|
||||
?>
|
||||
<tr>
|
||||
<td class="td_chk">
|
||||
<input type="hidden" name="opt_id[]" value="<?php echo $opt_id; ?>">
|
||||
<label for="opt_chk_<?php echo $i; ?>" class="sound_only"></label>
|
||||
<input type="checkbox" name="opt_chk[]" id="opt_chk_<?php echo $i; ?>" value="1">
|
||||
</td>
|
||||
<td class="opt-cell"><?php echo $opt_1; if ($opt_2_len) echo ' <small>></small> '.$opt_2; if ($opt_3_len) echo ' <small>></small> '.$opt_3; ?></td>
|
||||
<td class="td_numsmall">
|
||||
<label for="opt_price_<?php echo $i; ?>" class="sound_only"></label>
|
||||
<input type="text" name="opt_price[]" value="<?php echo $opt_price; ?>" id="opt_price_<?php echo $i; ?>" class="frm_input" size="9">
|
||||
</td>
|
||||
<td class="td_num">
|
||||
<label for="opt_stock_qty_<?php echo $i; ?>" class="sound_only"></label>
|
||||
<input type="text" name="opt_stock_qty[]" value="<?php echo $opt_stock_qty; ?>" id="op_stock_qty_<?php echo $i; ?>" class="frm_input" size="5">
|
||||
</td>
|
||||
<td class="td_num">
|
||||
<label for="opt_noti_qty_<?php echo $i; ?>" class="sound_only"></label>
|
||||
<input type="text" name="opt_noti_qty[]" value="<?php echo $opt_noti_qty; ?>" id="opt_noti_qty_<?php echo $i; ?>" class="frm_input" size="5">
|
||||
</td>
|
||||
<td class="td_mng">
|
||||
<label for="opt_use_<?php echo $i; ?>" class="sound_only"></label>
|
||||
<select name="opt_use[]" id="opt_use_<?php echo $i; ?>">
|
||||
<option value="1" <?php echo get_selected('1', $opt_use); ?>>사용함</option>
|
||||
<option value="0" <?php echo get_selected('0', $opt_use); ?>>사용안함</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
} // for
|
||||
} else {
|
||||
for($i=0; $i<$opt1_count; $i++) {
|
||||
$j = 0;
|
||||
do {
|
||||
$k = 0;
|
||||
do {
|
||||
$opt_1 = strip_tags(trim($opt1[$i]));
|
||||
$opt_2 = strip_tags(trim($opt2[$j]));
|
||||
$opt_3 = strip_tags(trim($opt3[$k]));
|
||||
|
||||
$opt_2_len = strlen($opt_2);
|
||||
$opt_3_len = strlen($opt_3);
|
||||
|
||||
$opt_id = $opt_1;
|
||||
if($opt_2_len)
|
||||
$opt_id .= chr(30).$opt_2;
|
||||
if($opt_3_len)
|
||||
$opt_id .= chr(30).$opt_3;
|
||||
$opt_price = 0;
|
||||
$opt_stock_qty = 9999;
|
||||
$opt_noti_qty = 100;
|
||||
$opt_use = 1;
|
||||
|
||||
// 기존에 설정된 값이 있는지 체크
|
||||
if($_POST['w'] == 'u') {
|
||||
$sql = " select io_price, io_stock_qty, io_noti_qty, io_use
|
||||
from {$g5['g5_shop_item_option_table']}
|
||||
where it_id = '{$_POST['it_id']}'
|
||||
and io_id = '$opt_id'
|
||||
and io_type = '0' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if($row) {
|
||||
$opt_price = (int)$row['io_price'];
|
||||
$opt_stock_qty = (int)$row['io_stock_qty'];
|
||||
$opt_noti_qty = (int)$row['io_noti_qty'];
|
||||
$opt_use = (int)$row['io_use'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="td_chk">
|
||||
<input type="hidden" name="opt_id[]" value="<?php echo $opt_id; ?>">
|
||||
<label for="opt_chk_<?php echo $i; ?>" class="sound_only"></label>
|
||||
<input type="checkbox" name="opt_chk[]" id="opt_chk_<?php echo $i; ?>" value="1">
|
||||
</td>
|
||||
<td class="opt1-cell"><?php echo $opt_1; if ($opt_2_len) echo ' <small>></small> '.$opt_2; if ($opt_3_len) echo ' <small>></small> '.$opt_3; ?></td>
|
||||
<td class="td_numsmall">
|
||||
<label for="opt_price_<?php echo $i; ?>" class="sound_only"></label>
|
||||
<input type="text" name="opt_price[]" value="<?php echo $opt_price; ?>" id="opt_price_<?php echo $i; ?>" class="frm_input" size="9">
|
||||
</td>
|
||||
<td class="td_num">
|
||||
<label for="opt_stock_qty_<?php echo $i; ?>" class="sound_only"></label>
|
||||
<input type="text" name="opt_stock_qty[]" value="<?php echo $opt_stock_qty; ?>" id="opt_stock_qty_<?php echo $i; ?>" class="frm_input" size="5">
|
||||
</td>
|
||||
<td class="td_num">
|
||||
<label for="opt_noti_qty_<?php echo $i; ?>" class="sound_only"></label>
|
||||
<input type="text" name="opt_noti_qty[]" value="<?php echo $opt_noti_qty; ?>" id="opt_noti_qty_<?php echo $i; ?>" class="frm_input" size="5">
|
||||
</td>
|
||||
<td class="td_mng">
|
||||
<label for="opt_use_<?php echo $i; ?>" class="sound_only"></label>
|
||||
<select name="opt_use[]" id="opt_use_<?php echo $i; ?>">
|
||||
<option value="1" <?php echo get_selected('1', $opt_use); ?>>사용함</option>
|
||||
<option value="0" <?php echo get_selected('0', $opt_use); ?>>사용안함</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$k++;
|
||||
} while($k < $opt3_count);
|
||||
|
||||
$j++;
|
||||
} while($j < $opt2_count);
|
||||
} // for
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_list01 btn_list">
|
||||
<input type="button" value="선택삭제" id="sel_option_delete">
|
||||
</div>
|
||||
|
||||
<fieldset>
|
||||
<legend>옵션 일괄 적용</legend>
|
||||
<?php echo help('전체 옵션의 추가금액, 재고/통보수량 및 사용여부를 일괄 적용할 수 있습니다. 단, 체크된 수정항목만 일괄 적용됩니다.'); ?>
|
||||
<label for="opt_com_price">추가금액</label>
|
||||
<label for="opt_com_price_chk" class="sound_only">추가금액일괄수정</label><input type="checkbox" name="opt_com_price_chk" value="1" id="opt_com_price_chk" class="opt_com_chk">
|
||||
<input type="text" name="opt_com_price" value="0" id="opt_com_price" class="frm_input" size="5">
|
||||
<label for="opt_com_stock">재고수량</label>
|
||||
<label for="opt_com_stock_chk" class="sound_only">재고수량일괄수정</label><input type="checkbox" name="opt_com_stock_chk" value="1" id="opt_com_stock_chk" class="opt_com_chk">
|
||||
<input type="text" name="opt_com_stock" value="0" id="opt_com_stock" class="frm_input" size="5">
|
||||
<label for="opt_com_noti">통보수량</label>
|
||||
<label for="opt_com_noti_chk" class="sound_only">통보수량일괄수정</label><input type="checkbox" name="opt_com_noti_chk" value="1" id="opt_com_noti_chk" class="opt_com_chk">
|
||||
<input type="text" name="opt_com_noti" value="0" id="opt_com_noti" class="frm_input" size="5">
|
||||
<label for="opt_com_use">사용여부</label>
|
||||
<label for="opt_com_use_chk" class="sound_only">사용여부일괄수정</label><input type="checkbox" name="opt_com_use_chk" value="1" id="opt_com_use_chk" class="opt_com_chk">
|
||||
<select name="opt_com_use" id="opt_com_use">
|
||||
<option value="1">사용함</option>
|
||||
<option value="0">사용안함</option>
|
||||
</select>
|
||||
<button type="button" id="opt_value_apply" class="btn_frmline">일괄적용</button>
|
||||
</fieldset>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
96
adm/shop_admin/itemqaform.php
Normal file
@ -0,0 +1,96 @@
|
||||
<?php
|
||||
$sub_menu = '400660';
|
||||
include_once('./_common.php');
|
||||
include_once(G5_EDITOR_LIB);
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$sql = " select *
|
||||
from {$g5['g5_shop_item_qa_table']} a
|
||||
left join {$g5['member_table']} b on (a.mb_id = b.mb_id)
|
||||
where iq_id = '$iq_id' ";
|
||||
$iq = sql_fetch($sql);
|
||||
if (!$iq['iq_id']) alert('등록된 자료가 없습니다.');
|
||||
|
||||
$name = get_sideview($iq['mb_id'], get_text($iq['iq_name']), $iq['mb_email'], $iq['mb_homepage']);
|
||||
|
||||
$g5['title'] = '상품문의';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$qstr .= ($qstr ? '&' : '').'sca='.$sca;
|
||||
?>
|
||||
|
||||
<form name="fitemqaform" method="post" action="./itemqaformupdate.php" onsubmit="return fitemqaform_submit(this);">
|
||||
<input type="hidden" name="w" value="<?php echo $w; ?>">
|
||||
<input type="hidden" name="iq_id" value="<?php echo $iq_id; ?>">
|
||||
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
|
||||
<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; ?>">
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>상품에 대한 문의에 답변하실 수 있습니다. 상품 문의 내용의 수정도 가능합니다.</p>
|
||||
</div>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 수정</caption>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">이름</th>
|
||||
<td><?php echo $name; ?></td>
|
||||
</tr>
|
||||
<?php if($iq['iq_email']) { ?>
|
||||
<tr>
|
||||
<th scope="row">이메일</th>
|
||||
<td><?php echo get_text($iq['iq_email']); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php if($iq['iq_hp']) { ?>
|
||||
<tr>
|
||||
<th scope="row">휴대폰</th>
|
||||
<td><?php echo hyphen_hp_number($iq['iq_hp']); ?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<th scope="row"><label for="iq_subject">제목</label></th>
|
||||
<td><input type="text" name="iq_subject" value="<?php echo conv_subject($iq['iq_subject'],120); ?>" id="iq_subject" required class="frm_input required" size="95"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="iq_question">질문</label></th>
|
||||
<td><?php echo editor_html('iq_question', get_text($iq['iq_question'], 0)); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="iq_answer">답변</label></th>
|
||||
<td><?php echo editor_html('iq_answer', get_text($iq['iq_answer'], 0)); ?></td>
|
||||
<!-- <td><textarea name="iq_answer" id="iq_answer" rows="7"><?php echo get_text($iq['iq_answer']); ?></textarea></td> -->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" accesskey='s' value="확인" class="btn_submit">
|
||||
<a href="./itemqalist.php?<?php echo $qstr; ?>">목록</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function fitemqaform_submit(f)
|
||||
{
|
||||
<?php echo get_editor_js('iq_question'); ?>
|
||||
<?php echo get_editor_js('iq_answer'); ?>
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
59
adm/shop_admin/itemqaformupdate.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
$sub_menu = '400660';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
if ($w == 'd')
|
||||
auth_check($auth[$sub_menu], "d");
|
||||
else
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
if ($w == "u")
|
||||
{
|
||||
$sql = "update {$g5['g5_shop_item_qa_table']}
|
||||
set iq_subject = '$iq_subject',
|
||||
iq_question = '$iq_question',
|
||||
iq_answer = '$iq_answer'
|
||||
where iq_id = '$iq_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
if(trim($iq_answer)) {
|
||||
$sql = " select a.iq_email, a.iq_hp, b.it_name
|
||||
from {$g5['g5_shop_item_qa_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id )
|
||||
where a.iq_id = '$iq_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
// SMS 알림
|
||||
if($config['cf_sms_use'] == 'icode' && $row['iq_hp']) {
|
||||
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
|
||||
|
||||
$sms_content = get_text($row['it_name']).' 상품문의에 답변이 등록되었습니다.';
|
||||
$send_number = preg_replace('/[^0-9]/', '', $default['de_admin_company_tel']);
|
||||
$recv_number = preg_replace('/[^0-9]/', '', $row['iq_hp']);
|
||||
|
||||
if($recv_number) {
|
||||
$SMS = new SMS; // SMS 연결
|
||||
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
|
||||
$SMS->Add($recv_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_content)), "");
|
||||
$SMS->Send();
|
||||
}
|
||||
}
|
||||
|
||||
// 답변 이메일전송
|
||||
if(trim($row['iq_email'])) {
|
||||
include_once(G5_LIB_PATH.'/mailer.lib.php');
|
||||
|
||||
$subject = $config['cf_title'].' '.$row['it_name'].' 상품문의 답변 알림 메일';
|
||||
$content = conv_content($iq_answer, 1);
|
||||
|
||||
mailer($config['cf_title'], $config['cf_admin_email'], $row['iq_email'], $subject, $content, 1);
|
||||
}
|
||||
}
|
||||
|
||||
goto_url("./itemqaform.php?w=$w&iq_id=$iq_id&sca=$sca&$qstr");
|
||||
}
|
||||
else {
|
||||
alert();
|
||||
}
|
||||
?>
|
||||
203
adm/shop_admin/itemqalist.php
Normal file
@ -0,0 +1,203 @@
|
||||
<?php
|
||||
$sub_menu = '400660';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '상품문의';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$where = " where ";
|
||||
$sql_search = "";
|
||||
if ($stx != "") {
|
||||
if ($sfl != "") {
|
||||
$sql_search .= " $where $sfl like '%$stx%' ";
|
||||
$where = " and ";
|
||||
}
|
||||
if ($save_stx != $stx)
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
if ($sca != "") {
|
||||
$sql_search .= " and ca_id like '$sca%' ";
|
||||
}
|
||||
|
||||
if ($sfl == "") $sfl = "it_name";
|
||||
if (!$sst) {
|
||||
$sst = "iq_id";
|
||||
$sod = "desc";
|
||||
}
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_item_qa_table']} a
|
||||
left join {$g5['g5_shop_item_table']} b on (a.it_id = b.it_id)
|
||||
left join {$g5['member_table']} c on (a.mb_id = c.mb_id) ";
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql = " select *
|
||||
$sql_common
|
||||
order by $sst $sod, iq_id desc
|
||||
limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
//$qstr = 'page='.$page.'&sst='.$sst.'&sod='.$sod.'&stx='.$stx;
|
||||
$qstr .= ($qstr ? '&' : '').'sca='.$sca.'&save_stx='.$stx;
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall; ?>
|
||||
전체 문의내역 <?php echo $total_count; ?>건
|
||||
</div>
|
||||
|
||||
<form name="flist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="save_stx" value="<?php echo $stx; ?>">
|
||||
|
||||
<label for="sca" class="sound_only">분류선택</label>
|
||||
<select name="sca" id="sca">
|
||||
<option value="">전체분류</option>
|
||||
<?php
|
||||
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
|
||||
$result1 = sql_query($sql1);
|
||||
for ($i=0; $row1=mysql_fetch_array($result1); $i++) {
|
||||
$len = strlen($row1['ca_id']) / 2 - 1;
|
||||
$nbsp = "";
|
||||
for ($i=0; $i<$len; $i++) $nbsp .= " ";
|
||||
$selected = ($row1['ca_id'] == $sca) ? ' selected="selected"' : '';
|
||||
echo '<option value="'.$row1['ca_id'].'"'.$selected.'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<label for="sfl" class="sound_only">검색대상</label>
|
||||
<select name="sfl" id="sfl">
|
||||
<option value="it_name" <?php echo get_selected($sfl, 'it_name'); ?>>상품명</option>
|
||||
<option value="a.it_id" <?php echo get_selected($sfl, 'a.it_id'); ?>>상품코드</option>
|
||||
</select>
|
||||
|
||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="stx" value="<?php echo $stx; ?>" id="stx" required class="frm_input required">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<form name="fitemqalist" method="post" action="./itemqalistupdate.php" onsubmit="return fitemqalist_submit(this);" autocomplete="off">
|
||||
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
|
||||
<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; ?>">
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="chkall" class="sound_only">상품문의 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<th scope="col"><?php echo subject_sort_link('it_name'); ?>상품명</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link('iq_subject'); ?>질문</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link('mb_name'); ?>이름</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link('iq_answer'); ?>답변</a></th>
|
||||
<th scope="col">관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=mysql_fetch_array($result); $i++) {
|
||||
$row['iq_subject'] = cut_str($row['iq_subject'], 30, "...");
|
||||
$href = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
|
||||
$name = get_sideview($row['mb_id'], get_text($row['iq_name']), $row['mb_email'], $row['mb_homepage']);
|
||||
$answer = $row['iq_answer'] ? 'Y' : ' ';
|
||||
$iq_question = get_view_thumbnail(conv_content($row['iq_question'], 1), 300);
|
||||
$iq_answer = $row['iq_answer'] ? get_view_thumbnail(conv_content($row['iq_answer'], 1), 300) : "답변이 등록되지 않았습니다.";
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td class="td_chk">
|
||||
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['iq_subject']) ?> 상품문의</label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i; ?>">
|
||||
<input type="hidden" name="iq_id[<?php echo $i; ?>]" value="<?php echo $row['iq_id']; ?>">
|
||||
</td>
|
||||
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?> <?php echo cut_str($row['it_name'],30); ?></a></td>
|
||||
<td>
|
||||
<a href="#" class="qa_href" onclick="return false;" target="<?php echo $i; ?>"><?php echo get_text($row['iq_subject']); ?></a>
|
||||
<div id="qa_div<?php echo $i; ?>" class="qa_div" style="display:none;">
|
||||
<strong>문의내용</strong><br>
|
||||
<?php echo $iq_question; ?>
|
||||
<strong>답변</strong><br>
|
||||
<?php echo $iq_answer; ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="td_name"><?php echo $name; ?></td>
|
||||
<td class="td_boolean"><?php echo $answer; ?></td>
|
||||
<td class="td_mngsmall">
|
||||
<a href="./itemqaform.php?w=u&iq_id=<?php echo $row['iq_id']; ?>&<?php echo $qstr; ?>"><span class="sound_only"><?php echo get_text($row['iq_subject']); ?> </span>수정</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if ($i == 0) {
|
||||
echo '<tr><td colspan="6" class="empty_table"><span>자료가 없습니다.</span></td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_list01 btn_list">
|
||||
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
|
||||
</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="); ?>
|
||||
|
||||
<script>
|
||||
function fitemqalist_submit(f)
|
||||
{
|
||||
if (!is_checked("chk[]")) {
|
||||
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(document.pressed == "선택삭제") {
|
||||
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$(".qa_href").click(function(){
|
||||
var $content = $("#qa_div"+$(this).attr("target"));
|
||||
$(".qa_div").each(function(index, value){
|
||||
if ($(this).get(0) == $content.get(0)) { // 객체의 비교시 .get(0) 를 사용한다.
|
||||
$(this).is(":hidden") ? $(this).show() : $(this).hide();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
25
adm/shop_admin/itemqalistupdate.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
$sub_menu = '400660';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
if (!count($_POST['chk'])) {
|
||||
alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요.");
|
||||
}
|
||||
|
||||
if ($_POST['act_button'] == "선택삭제") {
|
||||
|
||||
auth_check($auth[$sub_menu], 'd');
|
||||
|
||||
for ($i=0; $i<count($_POST['chk']); $i++) {
|
||||
// 실제 번호를 넘김
|
||||
$k = $_POST['chk'][$i];
|
||||
|
||||
$sql = "delete from {$g5['g5_shop_item_qa_table']} where iq_id = '{$_POST['iq_id'][$k]}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
goto_url("./itemqalist.php?sca=$sca&sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page");
|
||||
?>
|
||||
176
adm/shop_admin/itemsellrank.php
Normal file
@ -0,0 +1,176 @@
|
||||
<?php
|
||||
$sub_menu = '500100';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '상품판매순위';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
||||
|
||||
if (!$to_date) $to_date = date("Ymd", time());
|
||||
|
||||
if ($sort1 == "") $sort1 = "ct_status_sum";
|
||||
if ($sort2 == "") $sort2 = "desc";
|
||||
|
||||
$sql = " select a.it_id,
|
||||
b.*,
|
||||
SUM(IF(ct_status = '쇼핑',ct_qty, 0)) as ct_status_1,
|
||||
SUM(IF(ct_status = '주문',ct_qty, 0)) as ct_status_2,
|
||||
SUM(IF(ct_status = '입금',ct_qty, 0)) as ct_status_3,
|
||||
SUM(IF(ct_status = '준비',ct_qty, 0)) as ct_status_4,
|
||||
SUM(IF(ct_status = '배송',ct_qty, 0)) as ct_status_5,
|
||||
SUM(IF(ct_status = '완료',ct_qty, 0)) as ct_status_6,
|
||||
SUM(IF(ct_status = '취소',ct_qty, 0)) as ct_status_7,
|
||||
SUM(IF(ct_status = '반품',ct_qty, 0)) as ct_status_8,
|
||||
SUM(IF(ct_status = '품절',ct_qty, 0)) as ct_status_9,
|
||||
SUM(ct_qty) as ct_status_sum
|
||||
from {$g5['g5_shop_cart_table']} a, {$g5['g5_shop_item_table']} b ";
|
||||
$sql .= " where a.it_id = b.it_id ";
|
||||
if ($fr_date && $to_date)
|
||||
{
|
||||
$fr = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3", $fr_date);
|
||||
$to = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3", $to_date);
|
||||
$sql .= " and ct_time between '$fr 00:00:00' and '$to 23:59:59' ";
|
||||
}
|
||||
if ($sel_ca_id)
|
||||
{
|
||||
$sql .= " and b.ca_id like '$sel_ca_id%' ";
|
||||
}
|
||||
$sql .= " group by a.it_id
|
||||
order by $sort1 $sort2 ";
|
||||
$result = sql_query($sql);
|
||||
$total_count = mysql_num_rows($result);
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$rank = ($page - 1) * $rows;
|
||||
|
||||
$sql = $sql . " limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
//$qstr = 'page='.$page.'&sort1='.$sort1.'&sort2='.$sort2;
|
||||
$qstr1 = $qstr.'&sort1='.$sort1.'&sort2='.$sort2.'&fr_date='.$fr_date.'&to_date='.$to_date.'&sel_ca_id='.$sel_ca_id;
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall; ?>
|
||||
등록상품 <?php echo $total_count; ?>건
|
||||
</div>
|
||||
|
||||
<form name="flist" class="local_sch01 local_sch">
|
||||
<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; ?>">
|
||||
|
||||
<label for="sel_ca_id" class="sound_only">검색대상</label>
|
||||
<select name="sel_ca_id" id="sel_ca_id">
|
||||
<option value=''>전체분류</option>
|
||||
<?php
|
||||
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
|
||||
$result1 = sql_query($sql1);
|
||||
for ($i=0; $row1=mysql_fetch_array($result1); $i++) {
|
||||
$len = strlen($row1['ca_id']) / 2 - 1;
|
||||
$nbsp = "";
|
||||
for ($i=0; $i<$len; $i++) $nbsp .= " ";
|
||||
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sel_ca_id, $row1['ca_id']).'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
기간설정
|
||||
<label for="fr_date" class="sound_only">시작일</label>
|
||||
<input type="text" name="fr_date" value="<?php echo $fr_date; ?>" id="fr_date" required class="required frm_input" size="8" maxlength="8"> 에서
|
||||
<label for="to_date" class="sound_only">종료일</label>
|
||||
<input type="text" name="to_date" value="<?php echo $to_date; ?>" id="to_date" required class="required frm_input" size="8" maxlength="8"> 까지
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>판매량을 합산하여 상품판매순위를 집계합니다.</p>
|
||||
</div>
|
||||
|
||||
<div class="btn_add01 btn_add">
|
||||
<a href="./itemlist.php" class="btn_add01 btn_add_optional">상품등록</a>
|
||||
<a href="./itemstocklist.php" class="btn_add01 btn_add_optional">상품재고관리</a>
|
||||
</div>
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">순위</th>
|
||||
<th scope="col">상품명</th>
|
||||
<th scope="col"><a href="<?php echo title_sort("ct_status_1",1)."&$qstr1"; ?>">쇼핑</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("ct_status_2",1)."&$qstr1"; ?>">주문</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("ct_status_3",1)."&$qstr1"; ?>">입금</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("ct_status_4",1)."&$qstr1"; ?>">준비</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("ct_status_5",1)."&$qstr1"; ?>">배송</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("ct_status_6",1)."&$qstr1"; ?>">완료</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("ct_status_7",1)."&$qstr1"; ?>">취소</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("ct_status_8",1)."&$qstr1"; ?>">반품</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("ct_status_9",1)."&$qstr1"; ?>">품절</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("ct_status_sum",1)."&$qstr1"; ?>">합계</a></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']}";
|
||||
|
||||
$num = $rank + $i + 1;
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td class="td_num"><?php echo $num; ?></td>
|
||||
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?> <?php echo cut_str($row['it_name'],30); ?></a></td>
|
||||
<td class="td_num"><?php echo $row['ct_status_1']; ?></td>
|
||||
<td class="td_num"><?php echo $row['ct_status_2']; ?></td>
|
||||
<td class="td_num"><?php echo $row['ct_status_3']; ?></td>
|
||||
<td class="td_num"><?php echo $row['ct_status_4']; ?></td>
|
||||
<td class="td_num"><?php echo $row['ct_status_5']; ?></td>
|
||||
<td class="td_num"><?php echo $row['ct_status_6']; ?></td>
|
||||
<td class="td_num"><?php echo $row['ct_status_7']; ?></td>
|
||||
<td class="td_num"><?php echo $row['ct_status_8']; ?></td>
|
||||
<td class="td_num"><?php echo $row['ct_status_9']; ?></td>
|
||||
<td class="td_num"><?php echo $row['ct_status_sum']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($i == 0) {
|
||||
echo '<tr><td colspan="12" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr1&page="); ?>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$("#fr_date, #to_date").datepicker({
|
||||
changeMonth: true,
|
||||
changeYear: true,
|
||||
dateFormat: "yymmdd",
|
||||
showButtonPanel: true,
|
||||
yearRange: "c-99:c+99",
|
||||
maxDate: "+0d"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
212
adm/shop_admin/itemstocklist.php
Normal file
@ -0,0 +1,212 @@
|
||||
<?php
|
||||
$sub_menu = '400620';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '상품재고관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$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 = "it_stock_qty";
|
||||
if ($sort2 == "") $sort2 = "asc";
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_item_table']} ";
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql = " select it_id,
|
||||
it_name,
|
||||
it_use,
|
||||
it_stock_qty,
|
||||
it_stock_sms,
|
||||
it_noti_qty,
|
||||
it_soldout
|
||||
$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;
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall; ?>
|
||||
전체 상품 <?php echo $total_count; ?>개
|
||||
</div>
|
||||
|
||||
<form name="flist" class="local_sch01 local_sch">
|
||||
<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; ?>">
|
||||
|
||||
<label for="sel_ca_id" class="sound_only">분류선택</label>
|
||||
<select name="sel_ca_id" id="sel_ca_id">
|
||||
<option value=''>전체분류</option>
|
||||
<?php
|
||||
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
|
||||
$result1 = sql_query($sql1);
|
||||
for ($i=0; $row1=mysql_fetch_array($result1); $i++) {
|
||||
$len = strlen($row1['ca_id']) / 2 - 1;
|
||||
$nbsp = "";
|
||||
for ($i=0; $i<$len; $i++) $nbsp .= " ";
|
||||
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sel_ca_id, $row1['ca_id']).'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<label for="sel_field" class="sound_only">검색대상</label>
|
||||
<select name="sel_field" id="sel_field">
|
||||
<option value="it_name" <?php echo get_selected($sel_field, 'it_name'); ?>>상품명</option>
|
||||
<option value="it_id" <?php echo get_selected($sel_field, 'it_id'); ?>>상품코드</option>
|
||||
</select>
|
||||
|
||||
<label for="search" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="search" value="<?php echo $search; ?>" required class="frm_input required">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>재고수정의 수치를 수정하시면 창고재고의 수치가 변경됩니다.</p>
|
||||
</div>
|
||||
|
||||
<div class="btn_add01 btn_add">
|
||||
<a href="./optionstocklist.php" class="btn_add01 btn_add_optional">상품옵션재고</a>
|
||||
<a href="./itemsellrank.php" class="btn_add01 btn_add_optional">상품판매순위</a>
|
||||
</div>
|
||||
|
||||
<form name="fitemstocklist" action="./itemstocklistupdate.php" method="post">
|
||||
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
|
||||
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
|
||||
<input type="hidden" name="sel_ca_id" value="<?php echo $sel_ca_id; ?>">
|
||||
<input type="hidden" name="sel_field" value="<?php echo $sel_field; ?>">
|
||||
<input type="hidden" name="search" value="<?php echo $search; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><a href="<?php echo title_sort("it_id") . "&$qstr1"; ?>">상품코드</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("it_name") . "&$qstr1"; ?>">상품명</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("it_stock_qty") . "&$qstr1"; ?>">창고재고</a></th>
|
||||
<th scope="col">주문대기</th>
|
||||
<th scope="col">가재고</th>
|
||||
<th scope="col">재고수정</th>
|
||||
<th scope="col">통보수량</th>
|
||||
<th scope="col"><a href="<?php echo title_sort("it_use") . "&$qstr1"; ?>">판매</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("it_soldout") . "&$qstr1"; ?>">품절</a></th>
|
||||
<th scope="col"><a href="<?php echo title_sort("it_stock_sms") . "&$qstr1"; ?>">재입고알림</a></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']}";
|
||||
|
||||
// 선택옵션이 있을 경우 주문대기 수량 계산하지 않음
|
||||
$sql2 = " select count(*) as cnt from {$g5['g5_shop_item_option_table']} where it_id = '{$row['it_id']}' and io_type = '0' and io_use = '1' ";
|
||||
$row2 = sql_fetch($sql2);
|
||||
|
||||
if(!$row2['cnt']) {
|
||||
$sql1 = " select SUM(ct_qty) as sum_qty
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where it_id = '{$row['it_id']}'
|
||||
and ct_stock_use = '0'
|
||||
and ct_status in ('쇼핑', '주문', '입금', '준비') ";
|
||||
$row1 = sql_fetch($sql1);
|
||||
$wait_qty = $row1['sum_qty'];
|
||||
}
|
||||
|
||||
// 가재고 (미래재고)
|
||||
$temporary_qty = $row['it_stock_qty'] - $wait_qty;
|
||||
|
||||
// 통보수량보다 재고수량이 작을 때
|
||||
$it_stock_qty = number_format($row['it_stock_qty']);
|
||||
$it_stock_qty_st = ''; // 스타일 정의
|
||||
if($row['it_stock_qty'] <= $row['it_noti_qty']) {
|
||||
$it_stock_qty_st = ' sit_stock_qty_alert';
|
||||
$it_stock_qty = ''.$it_stock_qty.' !<span class="sound_only"> 재고부족 </span>';
|
||||
}
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
|
||||
?>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td class="td_numbig">
|
||||
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
|
||||
<?php echo $row['it_id']; ?>
|
||||
</td>
|
||||
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?> <?php echo cut_str(stripslashes($row['it_name']), 60, "…"); ?></a></td>
|
||||
<td class="td_num<?php echo $it_stock_qty_st; ?>"><?php echo $it_stock_qty; ?></td>
|
||||
<td class="td_num"><?php echo number_format($wait_qty); ?></td>
|
||||
<td class="td_num"><?php echo number_format($temporary_qty); ?></td>
|
||||
<td class="td_num">
|
||||
<label for="stock_qty_<?php echo $i; ?>" class="sound_only">재고수정</label>
|
||||
<input type="text" name="it_stock_qty[<?php echo $i; ?>]" value="<?php echo $row['it_stock_qty']; ?>" id="stock_qty_<?php echo $i; ?>" class="frm_input" size="10" autocomplete="off">
|
||||
</td>
|
||||
<td class="td_num">
|
||||
<label for="noti_qty_<?php echo $i; ?>" class="sound_only">통보수량</label>
|
||||
<input type="text" name="it_noti_qty[<?php echo $i; ?>]" value="<?php echo $row['it_noti_qty']; ?>" id="noti_qty_<?php echo $i; ?>" class="frm_input" size="10" autocomplete="off">
|
||||
</td>
|
||||
<td class="td_chk">
|
||||
<label for="use_<?php echo $i; ?>" class="sound_only">판매</label>
|
||||
<input type="checkbox" name="it_use[<?php echo $i; ?>]" value="1" id="use_<?php echo $i; ?>" <?php echo ($row['it_use'] ? "checked" : ""); ?>>
|
||||
</td>
|
||||
<td class="td_chk">
|
||||
<label for="soldout_<?php echo $i; ?>" class="sound_only">품절</label>
|
||||
<input type="checkbox" name="it_soldout[<?php echo $i; ?>]" value="1" id="soldout_<?php echo $i; ?>" <?php echo ($row['it_soldout'] ? "checked" : ""); ?>>
|
||||
</td>
|
||||
<td class="td_chk">
|
||||
<label for="stock_sms_<?php echo $i; ?>" class="sound_only">재입고 알림</label>
|
||||
<input type="checkbox" name="it_stock_sms[<?php echo $i; ?>]" value="1" id="stock_sms_<?php echo $i; ?>" <?php echo ($row['it_stock_sms'] ? "checked" : ""); ?>>
|
||||
</td>
|
||||
<td class="td_mngsmall"><a href="./itemform.php?w=u&it_id=<?php echo $row['it_id']; ?>&ca_id=<?php echo $row['ca_id']; ?>&<?php echo $qstr; ?>">수정</a></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="submit" value="일괄수정" class="btn_submit">
|
||||
</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');
|
||||
?>
|
||||
23
adm/shop_admin/itemstocklistupdate.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
$sub_menu = '400620';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
// 재고 일괄수정
|
||||
for ($i=0; $i<count($_POST['it_id']); $i++)
|
||||
{
|
||||
$sql = "update {$g5['g5_shop_item_table']}
|
||||
set it_stock_qty = '{$_POST['it_stock_qty'][$i]}',
|
||||
it_noti_qty = '{$_POST['it_noti_qty'][$i]}',
|
||||
it_use = '{$_POST['it_use'][$i]}',
|
||||
it_soldout = '{$_POST['it_soldout'][$i]}',
|
||||
it_stock_sms = '{$_POST['it_stock_sms'][$i]}'
|
||||
where it_id = '{$_POST['it_id'][$i]}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
goto_url("./itemstocklist.php?sort1=$sort1&sort2=$sort2&sel_ca_id=$sel_ca_id&sel_field=$sel_field&search=$search&page=$page");
|
||||
?>
|
||||
184
adm/shop_admin/itemstocksms.php
Normal file
@ -0,0 +1,184 @@
|
||||
<?php
|
||||
$sub_menu = '500400';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '재입고SMS 알림';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
// 테이블 생성
|
||||
if(!isset($g5['g5_shop_item_stocksms_table']))
|
||||
die('<meta charset="utf-8">dbconfig.php 파일에 <strong>$g5[\'g5_shop_item_stocksms_table\'] = G5_SHOP_TABLE_PREFIX.\'item_stocksms\';</strong> 를 추가해 주세요.');
|
||||
|
||||
if(!sql_query(" select ss_id from {$g5['g5_shop_item_stocksms_table']} limit 1", false)) {
|
||||
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['g5_shop_item_stocksms_table']}` (
|
||||
`ss_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`it_id` varchar(20) NOT NULL DEFAULT '',
|
||||
`ss_hp` varchar(255) NOT NULL DEFAULT '',
|
||||
`ss_send` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`ss_send_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`ss_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`ss_ip` varchar(25) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`ss_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ", true);
|
||||
}
|
||||
|
||||
$sql_search = " where 1 ";
|
||||
if ($search != "") {
|
||||
if ($sel_field != "") {
|
||||
$sql_search .= " and $sel_field like '%$search%' ";
|
||||
}
|
||||
}
|
||||
|
||||
if ($sel_field == "") $sel_field = "it_it";
|
||||
if ($sort1 == "") $sort1 = "ss_send";
|
||||
if ($sort2 == "") $sort2 = "asc";
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_item_stocksms_table']} ";
|
||||
|
||||
// 미전송 건수
|
||||
$sql = " select count(*) as cnt " . $sql_common . " where ss_send = '0' ";
|
||||
$row = sql_fetch($sql);
|
||||
$unsend_count = $row['cnt'];
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql = " select *
|
||||
$sql_common
|
||||
$sql_search
|
||||
order by $sort1 $sort2
|
||||
limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$qstr1 = 'sel_field='.$sel_field.'&search='.$search;
|
||||
$qstr = $qstr1.'&sort1='.$sort1.'&sort2='.$sort2.'&page='.$page;
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall; ?>
|
||||
전체 <?php echo number_format($total_count); ?>건, 미전송 <?php echo number_format($unsend_count); ?>건
|
||||
</div>
|
||||
|
||||
<form name="flist" class="local_sch01 local_sch">
|
||||
<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; ?>">
|
||||
|
||||
<label for="sel_field" class="sound_only">검색대상</label>
|
||||
<select name="sel_field" id="sel_field">
|
||||
<option value="it_id" <?php echo get_selected($sel_field, 'it_id'); ?>>상품코드</option>
|
||||
<option value="ss_hp" <?php echo get_selected($sel_field, 'ss_hp'); ?>>휴대폰번호</option>
|
||||
</select>
|
||||
|
||||
<label for="search" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="search" value="<?php echo $search; ?>" required class="frm_input required">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<form name="fitemstocksms" action="./itemstocksmsupdate.php" method="post" onsubmit="return fitemstocksms_submit(this);">
|
||||
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
|
||||
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
|
||||
<input type="hidden" name="sel_field" value="<?php echo $sel_field; ?>">
|
||||
<input type="hidden" name="search" value="<?php echo $search; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="chkall" class="sound_only">알림요청 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<th scope="col">상품명</th>
|
||||
<th scope="col">휴대폰번호</th>
|
||||
<th scope="col">SMS전송</th>
|
||||
<th scope="col">SMS전송일시</th>
|
||||
<th scope="col">등록일시</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=mysql_fetch_array($result); $i++)
|
||||
{
|
||||
// 상품정보
|
||||
$sql = " select it_name from {$g5['g5_shop_item_table']} where it_id = '{$row['it_id']}' ";
|
||||
$it = sql_fetch($sql);
|
||||
|
||||
if($it['it_name'])
|
||||
$it_name = get_text($it['it_name']);
|
||||
else
|
||||
$it_name = '상품정보 없음';
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
|
||||
?>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td class="td_chk">
|
||||
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo $it_name; ?> 알림요청</label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i; ?>">
|
||||
<input type="hidden" name="ss_id[<?php echo $i; ?>]" value="<?php echo $row['ss_id']; ?>">
|
||||
</td>
|
||||
<td><?php echo $it_name; ?></td>
|
||||
<td class="td_telbig"><?php echo $row['ss_hp']; ?></td>
|
||||
<td class="td_stat"><?php echo ($row['ss_send'] ? '전송완료' : '전송전'); ?></td>
|
||||
<td class="td_datetime"><?php echo (is_null_time($row['ss_send_time']) ? '' : $row['ss_send_time']); ?></td>
|
||||
<td class="td_datetime"><?php echo (is_null_time($row['ss_datetime']) ? '' : $row['ss_datetime']); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if (!$i)
|
||||
echo '<tr><td colspan="6" class="empty_table"><span>자료가 없습니다.</span></td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php if ($is_admin == 'super') { ?>
|
||||
<div class="btn_list01 btn_list">
|
||||
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" name="act_button" value="선택SMS전송" class="btn_submit" onclick="document.pressed=this.value">
|
||||
</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="); ?>
|
||||
|
||||
<script>
|
||||
function fitemstocksms_submit(f)
|
||||
{
|
||||
if (!is_checked("chk[]")) {
|
||||
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(document.pressed == "선택삭제") {
|
||||
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
86
adm/shop_admin/itemstocksmsupdate.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
$sub_menu = '500400';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
if (!count($_POST['chk'])) {
|
||||
alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요.");
|
||||
}
|
||||
|
||||
if ($_POST['act_button'] == "선택SMS전송") {
|
||||
|
||||
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
|
||||
|
||||
if($config['cf_sms_use'] == 'icode')
|
||||
{
|
||||
$SMS = new SMS;
|
||||
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
|
||||
}
|
||||
|
||||
auth_check($auth[$sub_menu], 'w');
|
||||
|
||||
$cnt = 0;
|
||||
|
||||
for ($i=0; $i<count($_POST['chk']); $i++) {
|
||||
|
||||
// 실제 번호를 넘김
|
||||
$k = $_POST['chk'][$i];
|
||||
|
||||
$sql = " select a.ss_id, a.ss_hp, a.ss_send, b.it_id, b.it_name
|
||||
from {$g5['g5_shop_item_stocksms_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id )
|
||||
where a.ss_id = '{$_POST['ss_id'][$k]}' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if(!$row['ss_id'] || !$row['it_id'] || $row['ss_send'])
|
||||
continue;
|
||||
|
||||
// SMS
|
||||
if($config['cf_sms_use'] == 'icode') {
|
||||
$sms_contents = iconv_euckr(get_text($row['it_name']).' 상품이 재입고 되었습니다. '.$default['de_admin_company_name']);
|
||||
$receive_number = preg_replace("/[^0-9]/", "", $row['ss_hp']); // 수신자번호
|
||||
$send_number = preg_replace("/[^0-9]/", "", $default['de_admin_company_tel']); // 발신자번호
|
||||
|
||||
if($receive_number && $send_number) {
|
||||
$SMS->Add($receive_number, $send_number, $config['cf_icode_id'], $sms_contents, "");
|
||||
$cnt++;
|
||||
}
|
||||
}
|
||||
|
||||
// SMS 전송으로 변경함
|
||||
$sql = " update {$g5['g5_shop_item_stocksms_table']}
|
||||
set ss_send = '1',
|
||||
ss_send_time = '".G5_TIME_YMDHIS."'
|
||||
where ss_id = '{$_POST['ss_id'][$k]}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
// SMS
|
||||
if($config['cf_sms_use'] == 'icode' && $cnt)
|
||||
{
|
||||
$SMS->Send();
|
||||
}
|
||||
} else if ($_POST['act_button'] == "선택삭제") {
|
||||
|
||||
if ($is_admin != 'super')
|
||||
alert('자료의 삭제는 최고관리자만 가능합니다.');
|
||||
|
||||
auth_check($auth[$sub_menu], 'd');
|
||||
|
||||
check_token();
|
||||
|
||||
for ($i=0; $i<count($_POST['chk']); $i++) {
|
||||
// 실제 번호를 넘김
|
||||
$k = $_POST['chk'][$i];
|
||||
|
||||
$sql = " delete from {$g5['g5_shop_item_stocksms_table']} where ss_id = '{$_POST['ss_id'][$k]}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$qstr1 = 'sel_field='.$sel_field.'&search='.$search;
|
||||
$qstr = $qstr1.'&sort1='.$sort1.'&sort2='.$sort2.'&page='.$page;
|
||||
|
||||
goto_url('./itemstocksms.php?'.$qstr);
|
||||
?>
|
||||
180
adm/shop_admin/itemsupply.php
Normal file
@ -0,0 +1,180 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$ps_run = false;
|
||||
|
||||
if($it['it_id']) {
|
||||
$sql = " select * from {$g5['g5_shop_item_option_table']} where io_type = '1' and it_id = '{$it['it_id']}' order by io_no asc ";
|
||||
$result = sql_query($sql);
|
||||
if(mysql_num_rows($result))
|
||||
$ps_run = true;
|
||||
} else if(!empty($_POST)) {
|
||||
$subject_count = count($_POST['subject']);
|
||||
$supply_count = count($_POST['supply']);
|
||||
|
||||
if(!$subject_count || !$supply_count) {
|
||||
echo '추가옵션명과 추가옵션항목을 입력해 주십시오.';
|
||||
exit;
|
||||
}
|
||||
|
||||
$ps_run = true;
|
||||
}
|
||||
|
||||
if($ps_run) {
|
||||
?>
|
||||
<div class="sit_option_frm_wrapper">
|
||||
<table>
|
||||
<caption>추가옵션 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="spl_chk_all" class="sound_only">전체 추가옵션</label>
|
||||
<input type="checkbox" name="spl_chk_all" value="1">
|
||||
</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>
|
||||
<?php
|
||||
if($it['it_id']) {
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
$spl_id = $row['io_id'];
|
||||
$spl_val = explode(chr(30), $spl_id);
|
||||
$spl_subject = $spl_val[0];
|
||||
$spl = $spl_val[1];
|
||||
$spl_price = $row['io_price'];
|
||||
$spl_stock_qty = $row['io_stock_qty'];
|
||||
$spl_noti_qty = $row['io_noti_qty'];
|
||||
$spl_use = $row['io_use'];
|
||||
?>
|
||||
<tr>
|
||||
<td class="td_chk">
|
||||
<input type="hidden" name="spl_id[]" value="<?php echo $spl_id; ?>">
|
||||
<label for="spl_chk_<?php echo $i; ?>" class="sound_only"><?php echo $spl_subject.' '.$spl; ?></label>
|
||||
<input type="checkbox" name="spl_chk[]" id="spl_chk_<?php echo $i; ?>" value="1">
|
||||
</td>
|
||||
<td class="spl-subject-cell"><?php echo $spl_subject; ?></td>
|
||||
<td class="spl-cell"><?php echo $spl; ?></td>
|
||||
<td class="td_numsmall">
|
||||
<label for="spl_price_<?php echo $i; ?>" class="sound_only">상품금액</label>
|
||||
<input type="text" name="spl_price[]" value="<?php echo $spl_price; ?>" id="spl_price_<?php echo $i; ?>" class="frm_input" size="5">
|
||||
</td>
|
||||
<td class="td_num">
|
||||
<label for="spl_stock_qty_<?php echo $i; ?>" class="sound_only">재고수량</label>
|
||||
<input type="text" name="spl_stock_qty[]" value="<?php echo $spl_stock_qty; ?>" id="spl_stock_qty_<?php echo $i; ?>" class="frm_input" size="5">
|
||||
</td>
|
||||
<td class="td_num">
|
||||
<label for="spl_noti_qty_<?php echo $i; ?>" class="sound_only">통보수량</label>
|
||||
<input type="text" name="spl_noti_qty[]" value="<?php echo $spl_noti_qty; ?>" id="spl_noti_qty_<?php echo $i; ?>" class="frm_input" size="5">
|
||||
</td>
|
||||
<td class="td_mng">
|
||||
<label for="spl_use_<?php echo $i; ?>" class="sound_only">사용여부</label>
|
||||
<select name="spl_use[]" id="spl_use_<?php echo $i; ?>">
|
||||
<option value="1" <?php echo get_selected('1', $spl_use); ?>>사용함</option>
|
||||
<option value="0" <?php echo get_selected('0', $spl_use); ?>>사용안함</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
} // for
|
||||
} else {
|
||||
for($i=0; $i<$subject_count; $i++) {
|
||||
$spl_subject = preg_replace('/[\'\"]/', '', trim(stripslashes($_POST['subject'][$i])));
|
||||
$spl_val = explode(',', preg_replace('/[\'\"]/', '', trim(stripslashes($_POST['supply'][$i]))));
|
||||
$spl_count = count($spl_val);
|
||||
|
||||
for($j=0; $j<$spl_count; $j++) {
|
||||
$spl = strip_tags(trim($spl_val[$j]));
|
||||
if($spl_subject && strlen($spl)) {
|
||||
$spl_id = $spl_subject.chr(30).$spl;
|
||||
$spl_price = 0;
|
||||
$spl_stock_qty = 9999;
|
||||
$spl_noti_qty = 100;
|
||||
$spl_use = 1;
|
||||
|
||||
// 기존에 설정된 값이 있는지 체크
|
||||
if($_POST['w'] == 'u') {
|
||||
$sql = " select io_price, io_stock_qty, io_noti_qty, io_use
|
||||
from {$g5['g5_shop_item_option_table']}
|
||||
where it_id = '{$_POST['it_id']}'
|
||||
and io_id = '$spl_id'
|
||||
and io_type = '1' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if($row) {
|
||||
$spl_price = (int)$row['io_price'];
|
||||
$spl_stock_qty = (int)$row['io_stock_qty'];
|
||||
$spl_noti_qty = (int)$row['io_noti_qty'];
|
||||
$spl_use = (int)$row['io_use'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td class="td_chk">
|
||||
<input type="hidden" name="spl_id[]" value="<?php echo $spl_id; ?>">
|
||||
<label for="spl_chk_<?php echo $i; ?>" class="sound_only"><?php echo $spl_subject.' '.$spl; ?></label>
|
||||
<input type="checkbox" name="spl_chk[]" id="spl_chk_<?php echo $i; ?>" value="1">
|
||||
</td>
|
||||
<td class="spl-subject-cell"><?php echo $spl_subject; ?></td>
|
||||
<td class="spl-cell"><?php echo $spl; ?></td>
|
||||
<td class="td_numsmall">
|
||||
<label for="spl_price_<?php echo $i; ?>" class="sound_only">상품금액</label>
|
||||
<input type="text" name="spl_price[]" value="<?php echo $spl_price; ?>" id="spl_price_<?php echo $i; ?>" class="frm_input" size="9">
|
||||
</td>
|
||||
<td class="td_num">
|
||||
<label for="spl_stock_qty_<?php echo $i; ?>" class="sound_only">재고수량</label>
|
||||
<input type="text" name="spl_stock_qty[]" value="<?php echo $spl_stock_qty; ?>" id="spl_stock_qty_<?php echo $i; ?>" class="frm_input" size="5">
|
||||
</td>
|
||||
<td class="td_num">
|
||||
<label for="spl_noti_qty_<?php echo $i; ?>" class="sound_only">통보수량</label>
|
||||
<input type="text" name="spl_noti_qty[]" value="<?php echo $spl_noti_qty; ?>" id="spl_noti_qty_<?php echo $i; ?>" class="frm_input" size="5">
|
||||
</td>
|
||||
<td class="td_mng">
|
||||
<label for="spl_use_<?php echo $i; ?>" class="sound_only">사용여부</label>
|
||||
<select name="spl_use[]" id="spl_use_<?php echo $i; ?>">
|
||||
<option value="1" <?php echo get_selected('1', $spl_use); ?>>사용함</option>
|
||||
<option value="0" <?php echo get_selected('0', $spl_use); ?>>사용안함</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
} // if
|
||||
} // for
|
||||
} // for
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_list01 btn_list">
|
||||
<button type="button" id="sel_supply_delete">선택삭제</button>
|
||||
</div>
|
||||
|
||||
<fieldset>
|
||||
<?php echo help('전체 추가 옵션의 상품금액, 재고/통보수량 및 사용여부를 일괄 적용할 수 있습니다. 단, 체크된 수정항목만 일괄 적용됩니다.'); ?>
|
||||
<label for="spl_com_price">상품금액</label>
|
||||
<label for="spl_com_price_chk" class="sound_only">상품금액일괄수정</label><input type="checkbox" name="spl_com_price_chk" value="1" id="spl_com_price_chk" class="spl_com_chk">
|
||||
<input type="text" name="spl_com_price" value="0" id="spl_com_price" class="frm_input" size="9">
|
||||
<label for="spl_com_stock">재고수량</label>
|
||||
<label for="spl_com_stock_chk" class="sound_only">재고수량일괄수정</label><input type="checkbox" name="spl_com_stock_chk" value="1" id="spl_com_stock_chk" class="spl_com_chk">
|
||||
<input type="text" name="spl_com_stock" value="0" id="spl_com_stock" class="frm_input" size="5">
|
||||
<label for="spl_com_noti">통보수량</label>
|
||||
<label for="spl_com_noti_chk" class="sound_only">통보수량일괄수정</label><input type="checkbox" name="spl_com_noti_chk" value="1" id="spl_com_noti_chk" class="spl_com_chk">
|
||||
<input type="text" name="spl_com_noti" value="0" id="spl_com_noti" class="frm_input" size="5">
|
||||
<label for="spl_com_use">사용여부</label>
|
||||
<label for="spl_com_use_chk" class="sound_only">사용여부일괄수정</label><input type="checkbox" name="spl_com_use_chk" value="1" id="spl_com_use_chk" class="spl_com_chk">
|
||||
<select name="spl_com_use" id="spl_com_use">
|
||||
<option value="1">사용함</option>
|
||||
<option value="0">사용안함</option>
|
||||
</select>
|
||||
<button type="button" id="spl_value_apply" class="btn_frmline">일괄적용</button>
|
||||
</fieldset>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
192
adm/shop_admin/itemtypelist.php
Normal file
@ -0,0 +1,192 @@
|
||||
<?php
|
||||
$sub_menu = '400610';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '상품유형관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
/*
|
||||
$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%' or ca_id2 like '$sel_ca_id%' or ca_id3 like '$sel_ca_id%') ";
|
||||
}
|
||||
|
||||
if ($sel_field == "") $sel_field = "it_name";
|
||||
*/
|
||||
|
||||
$where = " where ";
|
||||
$sql_search = "";
|
||||
if ($stx != "") {
|
||||
if ($sfl != "") {
|
||||
$sql_search .= " $where $sfl like '%$stx%' ";
|
||||
$where = " and ";
|
||||
}
|
||||
if ($save_stx != $stx)
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
if ($sca != "") {
|
||||
$sql_search .= " $where (ca_id like '$sca%' or ca_id2 like '$sca%' or ca_id3 like '$sca%') ";
|
||||
}
|
||||
|
||||
if ($sfl == "") $sfl = "it_name";
|
||||
|
||||
if (!$sst) {
|
||||
$sst = "it_id";
|
||||
$sod = "desc";
|
||||
}
|
||||
$sql_order = "order by $sst $sod";
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_item_table']} ";
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql = " select it_id,
|
||||
it_name,
|
||||
it_type1,
|
||||
it_type2,
|
||||
it_type3,
|
||||
it_type4,
|
||||
it_type5
|
||||
$sql_common
|
||||
$sql_order
|
||||
limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$qstr = $qstr.'&sca='.$sca.'&page='.$page.'&save_stx='.$stx;
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall; ?>
|
||||
전체 상품 <?php echo $total_count; ?>개
|
||||
</div>
|
||||
|
||||
<form name="flist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="doc" value="<?php echo $doc; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
|
||||
<label for="sca" class="sound_only">분류선택</label>
|
||||
<select name="sca" id="sca">
|
||||
<option value="">전체분류</option>
|
||||
<?php
|
||||
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
|
||||
$result1 = sql_query($sql1);
|
||||
for ($i=0; $row1=sql_fetch_array($result1); $i++) {
|
||||
$len = strlen($row1['ca_id']) / 2 - 1;
|
||||
$nbsp = "";
|
||||
for ($i=0; $i<$len; $i++) $nbsp .= " ";
|
||||
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sca, $row1['ca_id']).'>'.$nbsp.$row1['ca_name'].PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<label for="sfl" class="sound_only">검색대상</label>
|
||||
<select name="sfl" id="sfl">
|
||||
<option value="it_name" <?php echo get_selected($sfl, 'it_name'); ?>>상품명</option>
|
||||
<option value="it_id" <?php echo get_selected($sfl, 'it_id'); ?>>상품코드</option>
|
||||
</select>
|
||||
|
||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="stx" value="<?php echo $stx; ?>" id="stx" required class="frm_input required">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<form name="fitemtypelist" method="post" action="./itemtypelistupdate.php">
|
||||
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
|
||||
<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; ?>">
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?php echo subject_sort_link("it_id", $qstr, 1); ?>상품코드</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("it_name"); ?>상품명</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("it_type1", $qstr, 1); ?>히트<br>상품</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("it_type2", $qstr, 1); ?>추천<br>상품</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("it_type3", $qstr, 1); ?>신규<br>상품</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("it_type4", $qstr, 1); ?>인기<br>상품</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("it_type5", $qstr, 1); ?>할인<br>상품</a></th>
|
||||
<th scope="col">관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
$href = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td class="td_code">
|
||||
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
|
||||
<?php echo $row['it_id']; ?>
|
||||
</td>
|
||||
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?><?php echo cut_str(stripslashes($row['it_name']), 60, "…"); ?></a></td>
|
||||
<td class="td_chk">
|
||||
<label for="type1_<?php echo $i; ?>" class="sound_only">히트상품</label>
|
||||
<input type="checkbox" name="it_type1[<?php echo $i; ?>]" value="1" id="type1_<?php echo $i; ?>" <?php echo ($row['it_type1'] ? 'checked' : ''); ?>>
|
||||
</td>
|
||||
<td class="td_chk">
|
||||
<label for="type2_<?php echo $i; ?>" class="sound_only">추천상품</label>
|
||||
<input type="checkbox" name="it_type2[<?php echo $i; ?>]" value="1" id="type2_<?php echo $i; ?>" <?php echo ($row['it_type2'] ? 'checked' : ''); ?>>
|
||||
</td>
|
||||
<td class="td_chk">
|
||||
<label for="type3_<?php echo $i; ?>" class="sound_only">신규상품</label>
|
||||
<input type="checkbox" name="it_type3[<?php echo $i; ?>]" value="1" id="type3_<?php echo $i; ?>" <?php echo ($row['it_type3'] ? 'checked' : ''); ?>>
|
||||
</td>
|
||||
<td class="td_chk">
|
||||
<label for="type4_<?php echo $i; ?>" class="sound_only">인기상품</label>
|
||||
<input type="checkbox" name="it_type4[<?php echo $i; ?>]" value="1" id="type4_<?php echo $i; ?>" <?php echo ($row['it_type4'] ? 'checked' : ''); ?>>
|
||||
</td>
|
||||
<td class="td_chk">
|
||||
<label for="type5_<?php echo $i; ?>" class="sound_only">할인상품</label>
|
||||
<input type="checkbox" name="it_type5[<?php echo $i; ?>]" value="1" id="type5_<?php echo $i; ?>" <?php echo ($row['it_type5'] ? 'checked' : ''); ?>>
|
||||
</td>
|
||||
<td class="td_mngsmall">
|
||||
<a href="./itemform.php?w=u&it_id=<?php echo $row['it_id']; ?>&ca_id=<?php echo $row['ca_id']; ?>&<?php echo $qstr; ?>"><span class="sound_only"><?php echo cut_str(stripslashes($row['it_name']), 60, "…"); ?> </span>수정</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (!$i)
|
||||
echo '<tr><td colspan="8" class="empty_table"><span>자료가 없습니다.</span></td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_confirm03 btn_confirm">
|
||||
<input type="submit" value="일괄수정" class="btn_submit">
|
||||
</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');
|
||||
?>
|
||||
23
adm/shop_admin/itemtypelistupdate.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
$sub_menu = '400610';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
for ($i=0; $i<count($_POST['it_id']); $i++)
|
||||
{
|
||||
$sql = "update {$g5['g5_shop_item_table']}
|
||||
set it_type1 = '{$_POST['it_type1'][$i]}',
|
||||
it_type2 = '{$_POST['it_type2'][$i]}',
|
||||
it_type3 = '{$_POST['it_type3'][$i]}',
|
||||
it_type4 = '{$_POST['it_type4'][$i]}',
|
||||
it_type5 = '{$_POST['it_type5'][$i]}'
|
||||
where it_id = '{$_POST['it_id'][$i]}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
//goto_url("./itemtypelist.php?sort1=$sort&sort2=$sort2&sel_ca_id=$sel_ca_id&sel_field=$sel_field&search=$search&page=$page");
|
||||
goto_url("itemtypelist.php?sca=$sca&sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page");
|
||||
?>
|
||||
100
adm/shop_admin/itemuseform.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
$sub_menu = '400650';
|
||||
include_once('./_common.php');
|
||||
include_once(G5_EDITOR_LIB);
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$sql = " select *
|
||||
from {$g5['g5_shop_item_use_table']} a
|
||||
left join {$g5['member_table']} b on (a.mb_id = b.mb_id)
|
||||
left join {$g5['g5_shop_item_table']} c on (a.it_id = c.it_id)
|
||||
where is_id = '$is_id' ";
|
||||
$is = sql_fetch($sql);
|
||||
if (!$is['is_id'])
|
||||
alert('등록된 자료가 없습니다.');
|
||||
|
||||
$name = get_sideview($is['mb_id'], get_text($is['is_name']), $is['mb_email'], $is['mb_homepage']);
|
||||
|
||||
// 확인
|
||||
$is_confirm_yes = $is['is_confirm'] ? 'checked="checked"' : '';
|
||||
$is_confirm_no = !$is['is_confirm'] ? 'checked="checked"' : '';
|
||||
|
||||
$g5['title'] = '사용후기';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$qstr .= ($qstr ? '&' : '').'sca='.$sca;
|
||||
?>
|
||||
|
||||
<form name="fitemuseform" method="post" action="./itemuseformupdate.php" onsubmit="return fitemuseform_submit(this);">
|
||||
<input type="hidden" name="w" value="<?php echo $w; ?>">
|
||||
<input type="hidden" name="is_id" value="<?php echo $is_id; ?>">
|
||||
<input type="hidden" name="it_id" value="<?php echo $is['is_id']; ?>">
|
||||
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
|
||||
<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; ?>">
|
||||
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 수정</caption>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">상품명</th>
|
||||
<td><a href="<?php echo G5_SHOP_URL; ?>/item.php?it_id=<?php echo $is['it_id']; ?>"><?php echo $is['it_name']; ?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">이름</th>
|
||||
<td><?php echo $name; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">평점</th>
|
||||
<td><img src="<?php echo G5_URL; ?>/shop/img/s_star<?php echo $is['is_score']; ?>.png"> (<?php echo $is['is_score']; ?>점)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="is_subject">제목</label></th>
|
||||
<td><input type="text" name="is_subject" required class="required frm_input" id="is_subject" size="100"
|
||||
value='<?php echo conv_subject($is['is_subject'], 120); ?>'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">내용</th>
|
||||
<td><?php echo editor_html('is_content', get_text($is['is_content'], 0)); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">확인</th>
|
||||
<td>
|
||||
<input type="radio" name="is_confirm" value="1" id="is_confirm_yes" <?php echo $is_confirm_yes; ?>>
|
||||
<label for="is_confirm_yes">예</label>
|
||||
<input type="radio" name="is_confirm" value="0" id="is_confirm_no" <?php echo $is_confirm_no; ?>>
|
||||
<label for="is_confirm_no">아니오</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="확인" class="btn_submit" accesskey="s">
|
||||
<a href="./itemuselist.php?<?php echo $qstr; ?>">목록</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function fitemuseform_submit(f)
|
||||
{
|
||||
<?php echo get_editor_js('is_content'); ?>
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
29
adm/shop_admin/itemuseformupdate.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
$sub_menu = '400650';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
if ($w == 'd')
|
||||
auth_check($auth[$sub_menu], "d");
|
||||
else
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
if ($w == "u")
|
||||
{
|
||||
$sql = "update {$g5['g5_shop_item_use_table']}
|
||||
set is_subject = '$is_subject',
|
||||
is_content = '$is_content',
|
||||
is_confirm = '$is_confirm'
|
||||
where is_id = '$is_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
update_use_cnt($_POST['it_id']);
|
||||
|
||||
goto_url("./itemuseform.php?w=$w&is_id=$is_id&sca=$sca&$qstr");
|
||||
}
|
||||
else
|
||||
{
|
||||
alert();
|
||||
}
|
||||
?>
|
||||
218
adm/shop_admin/itemuselist.php
Normal file
@ -0,0 +1,218 @@
|
||||
<?php
|
||||
$sub_menu = '400650';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '사용후기';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$where = " where ";
|
||||
$sql_search = "";
|
||||
if ($stx != "") {
|
||||
if ($sfl != "") {
|
||||
$sql_search .= " $where $sfl like '%$stx%' ";
|
||||
$where = " and ";
|
||||
}
|
||||
if ($save_stx != $stx)
|
||||
$page = 1;
|
||||
}
|
||||
|
||||
if ($sca != "") {
|
||||
$sql_search .= " and ca_id like '$sca%' ";
|
||||
}
|
||||
|
||||
if ($sfl == "") $sfl = "a.it_name";
|
||||
if (!$sst) {
|
||||
$sst = "is_id";
|
||||
$sod = "desc";
|
||||
}
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_item_use_table']} a
|
||||
left join {$g5['g5_shop_item_table']} b on (a.it_id = b.it_id)
|
||||
left join {$g5['member_table']} c on (a.mb_id = c.mb_id) ";
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql = " select *
|
||||
$sql_common
|
||||
order by $sst $sod, is_id desc
|
||||
limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
//$qstr = 'page='.$page.'&sst='.$sst.'&sod='.$sod.'&stx='.$stx;
|
||||
$qstr .= ($qstr ? '&' : '').'sca='.$sca.'&save_stx='.$stx;
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall; ?>
|
||||
전체 후기내역 <?php echo $total_count; ?>건
|
||||
</div>
|
||||
|
||||
<form name="flist" class="local_sch01 local_sch">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="save_stx" value="<?php echo $stx; ?>">
|
||||
|
||||
<label for="sca" class="sound_only">분류선택</label>
|
||||
<select name="sca" id="sca">
|
||||
<option value=''>전체분류</option>
|
||||
<?php
|
||||
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
|
||||
$result1 = sql_query($sql1);
|
||||
for ($i=0; $row1=mysql_fetch_array($result1); $i++) {
|
||||
$len = strlen($row1['ca_id']) / 2 - 1;
|
||||
$nbsp = "";
|
||||
for ($i=0; $i<$len; $i++) $nbsp .= " ";
|
||||
$selected = ($row1['ca_id'] == $sca) ? ' selected="selected"' : '';
|
||||
echo '<option value="'.$row1['ca_id'].'"'.$selected.'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<label for="sfl" class="sound_only">검색대상</label>
|
||||
<select name="sfl" id="sfl">
|
||||
<option value="it_name" <?php echo get_selected($sfl, 'it_name'); ?>>상품명</option>
|
||||
<option value="a.it_id" <?php echo get_selected($sfl, 'a.it_id'); ?>>상품코드</option>
|
||||
<option value="is_name" <?php echo get_selected($sfl, 'is_name'); ?>>이름</option>
|
||||
</select>
|
||||
|
||||
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="stx" value="<?php echo $stx; ?>" required class="frm_input required">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<form name="fitemuselist" method="post" action="./itemuselistupdate.php" onsubmit="return fitemuselist_submit(this);" autocomplete="off">
|
||||
<input type="hidden" name="sca" value="<?php echo $sca; ?>">
|
||||
<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; ?>">
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="chkall" class="sound_only">사용후기 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<th scope="col"><?php echo subject_sort_link("it_name"); ?>상품명</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("mb_name"); ?>이름</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("is_subject"); ?>제목</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("is_score"); ?>평점</a></th>
|
||||
<th scope="col"><?php echo subject_sort_link("is_confirm"); ?>확인</a></th>
|
||||
<th scope="col">관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
$row['is_subject'] = cut_str($row['is_subject'], 30, "...");
|
||||
$href = G5_SHOP_URL.'/item.php?it_id='.$row['it_id'];
|
||||
$name = get_sideview($row['mb_id'], get_text($row['is_name']), $row['mb_email'], $row['mb_homepage']);
|
||||
$is_content = get_view_thumbnail(conv_content($row['is_content'], 1), 300);
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td class="td_chk">
|
||||
<label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['is_subject']) ?> 사용후기</label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i; ?>">
|
||||
<input type="hidden" name="is_id[<?php echo $i; ?>]" value="<?php echo $row['is_id']; ?>">
|
||||
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
|
||||
</td>
|
||||
<td><a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?><?php echo cut_str($row['it_name'],30); ?></a></td>
|
||||
<td class="td_name"><?php echo $name; ?></td>
|
||||
<td class="sit_use_subject">
|
||||
<a href="#" class="use_href" onclick="return false;" target="<?php echo $i; ?>"><?php echo get_text($row['is_subject']); ?></a>
|
||||
<div id="use_div<?php echo $i; ?>" class="use_div" style="display:none;">
|
||||
<?php echo $is_content; ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="td_num">
|
||||
<label for="score_<?php echo $i; ?>" class="sound_only">평점</label>
|
||||
<select name="is_score[<?php echo $i; ?>]" id="score_<?php echo $i; ?>">
|
||||
<option value="5" <?php echo get_selected($row['is_score'], "5"); ?>>매우만족</option>
|
||||
<option value="4" <?php echo get_selected($row['is_score'], "4"); ?>>만족</option>
|
||||
<option value="3" <?php echo get_selected($row['is_score'], "3"); ?>>보통</option>
|
||||
<option value="2" <?php echo get_selected($row['is_score'], "2"); ?>>불만</option>
|
||||
<option value="1" <?php echo get_selected($row['is_score'], "1"); ?>>매우불만</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="td_chk">
|
||||
<label for="confirm_<?php echo $i; ?>" class="sound_only">확인</label>
|
||||
<input type="checkbox" name="is_confirm[<?php echo $i; ?>]" <?php echo ($row['is_confirm'] ? 'checked' : ''); ?> value="1" id="confirm_<?php echo $i; ?>">
|
||||
</td>
|
||||
<td class="td_mngsmall">
|
||||
<a href="./itemuseform.php?w=u&is_id=<?php echo $row['is_id']; ?>&<?php echo $qstr; ?>"><span class="sound_only"><?php echo get_text($row['is_subject']); ?> </span>수정</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
if ($i == 0) {
|
||||
echo '<tr><td colspan="7" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_list01 btn_list">
|
||||
<input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value">
|
||||
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
|
||||
</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="); ?>
|
||||
|
||||
<script>
|
||||
function fitemuselist_submit(f)
|
||||
{
|
||||
if (!is_checked("chk[]")) {
|
||||
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(document.pressed == "선택삭제") {
|
||||
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$(".use_href").click(function(){
|
||||
var $content = $("#use_div"+$(this).attr("target"));
|
||||
$(".use_div").each(function(index, value){
|
||||
if ($(this).get(0) == $content.get(0)) { // 객체의 비교시 .get(0) 를 사용한다.
|
||||
$(this).is(":hidden") ? $(this).show() : $(this).hide();
|
||||
} else {
|
||||
$(this).hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
42
adm/shop_admin/itemuselistupdate.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
$sub_menu = '400650';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
if (!count($_POST['chk'])) {
|
||||
alert($_POST['act_button']." 하실 항목을 하나 이상 체크하세요.");
|
||||
}
|
||||
|
||||
if ($_POST['act_button'] == "선택수정") {
|
||||
auth_check($auth[$sub_menu], 'w');
|
||||
} else if ($_POST['act_button'] == "선택삭제") {
|
||||
auth_check($auth[$sub_menu], 'd');
|
||||
} else {
|
||||
alert("선택수정이나 선택삭제 작업이 아닙니다.");
|
||||
}
|
||||
|
||||
for ($i=0; $i<count($_POST['chk']); $i++)
|
||||
{
|
||||
$k = $_POST['chk'][$i]; // 실제 번호를 넘김
|
||||
|
||||
if ($_POST['act_button'] == "선택수정")
|
||||
{
|
||||
$sql = "update {$g5['g5_shop_item_use_table']}
|
||||
set is_score = '{$_POST['is_score'][$k]}',
|
||||
is_confirm = '{$_POST['is_confirm'][$k]}'
|
||||
where is_id = '{$_POST['is_id'][$k]}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
else if ($_POST['act_button'] == "선택삭제")
|
||||
{
|
||||
$sql = "delete from {$g5['g5_shop_item_use_table']} where is_id = '{$_POST['is_id'][$k]}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
update_use_cnt($_POST['it_id'][$k]);
|
||||
update_use_avg($_POST['it_id'][$k]);
|
||||
}
|
||||
|
||||
goto_url("./itemuselist.php?sca=$sca&sst=$sst&sod=$sod&sfl=$sfl&stx=$stx&page=$page");
|
||||
?>
|
||||
225
adm/shop_admin/optionstocklist.php
Normal file
@ -0,0 +1,225 @@
|
||||
<?php
|
||||
$sub_menu = '400500';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '상품옵션재고관리';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
|
||||
$sql_search = " where b.it_id is not NULL ";
|
||||
if ($search != "") {
|
||||
if ($sel_field != "") {
|
||||
$sql_search .= " and $sel_field like '%$search%' ";
|
||||
}
|
||||
}
|
||||
|
||||
if ($sel_ca_id != "") {
|
||||
$sql_search .= " and b.ca_id like '$sel_ca_id%' ";
|
||||
}
|
||||
|
||||
if ($sel_field == "") $sel_field = "b.it_name";
|
||||
if ($sort1 == "") $sort1 = "a.io_stock_qty";
|
||||
if ($sort2 == "") $sort2 = "asc";
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_item_option_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id ) ";
|
||||
$sql_common .= $sql_search;
|
||||
|
||||
// 테이블의 전체 레코드수만 얻음
|
||||
$sql = " select count(*) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql = " select a.it_id,
|
||||
a.io_id,
|
||||
a.io_type,
|
||||
a.io_stock_qty,
|
||||
a.io_noti_qty,
|
||||
a.io_use,
|
||||
b.it_name,
|
||||
b.it_option_subject
|
||||
$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;
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall; ?>
|
||||
전체 옵션 <?php echo $total_count; ?>개
|
||||
</div>
|
||||
|
||||
<form name="flist" class="local_sch01 local_sch">
|
||||
<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; ?>">
|
||||
|
||||
<label for="sel_ca_id" class="sound_only">분류선택</label>
|
||||
<select name="sel_ca_id" id="sel_ca_id">
|
||||
<option value=''>전체분류</option>
|
||||
<?php
|
||||
$sql1 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} order by ca_order, ca_id ";
|
||||
$result1 = sql_query($sql1);
|
||||
for ($i=0; $row1=mysql_fetch_array($result1); $i++) {
|
||||
$len = strlen($row1['ca_id']) / 2 - 1;
|
||||
$nbsp = "";
|
||||
for ($i=0; $i<$len; $i++) $nbsp .= " ";
|
||||
echo '<option value="'.$row1['ca_id'].'" '.get_selected($sel_ca_id, $row1['ca_id']).'>'.$nbsp.$row1['ca_name'].'</option>'.PHP_EOL;
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
<label for="sel_field" class="sound_only">검색대상</label>
|
||||
<select name="sel_field" id="sel_field">
|
||||
<option value="it_name" <?php echo get_selected($sel_field, 'b.it_name'); ?>>상품명</option>
|
||||
<option value="a.it_id" <?php echo get_selected($sel_field, 'a.it_id'); ?>>상품코드</option>
|
||||
</select>
|
||||
|
||||
<label for="search" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="search" value="<?php echo $search; ?>" required class="frm_input required">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<div class="btn_add01 btn_add">
|
||||
<a href="./itemstocklist.php" class="btn_add01 btn_add_optional">상품재고관리</a>
|
||||
<a href="./itemsellrank.php" class="btn_add01 btn_add_optional">상품판매순위</a>
|
||||
</div>
|
||||
|
||||
<form name="fitemstocklist" action="./optionstocklistupdate.php" method="post">
|
||||
<input type="hidden" name="sort1" value="<?php echo $sort1; ?>">
|
||||
<input type="hidden" name="sort2" value="<?php echo $sort2; ?>">
|
||||
<input type="hidden" name="sel_ca_id" value="<?php echo $sel_ca_id; ?>">
|
||||
<input type="hidden" name="sel_field" value="<?php echo $sel_field; ?>">
|
||||
<input type="hidden" name="search" value="<?php echo $search; ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><a href="<?php echo title_sort("b.it_name") . "&$qstr1"; ?>">상품명</a></th>
|
||||
<th scope="col">옵션항목</th>
|
||||
<th scope="col">옵션타입</th>
|
||||
<th scope="col"><a href="<?php echo title_sort("a.io_stock_qty") . "&$qstr1"; ?>">창고재고</a></th>
|
||||
<th scope="col">주문대기</th>
|
||||
<th scope="col">가재고</th>
|
||||
<th scope="col">재고수정</th>
|
||||
<th scope="col">통보수량</th>
|
||||
<th scope="col"><a href="<?php echo title_sort("a.io_use") . "&$qstr1"; ?>">판매</a></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']}";
|
||||
|
||||
$sql1 = " select SUM(ct_qty) as sum_qty
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where it_id = '{$row['it_id']}'
|
||||
and io_id = '{$row['io_id']}'
|
||||
and ct_stock_use = '0'
|
||||
and ct_status in ('쇼핑', '주문', '입금', '준비') ";
|
||||
$row1 = sql_fetch($sql1);
|
||||
$wait_qty = $row1['sum_qty'];
|
||||
|
||||
// 가재고 (미래재고)
|
||||
$temporary_qty = $row['io_stock_qty'] - $wait_qty;
|
||||
|
||||
$option = '';
|
||||
$option_br = '';
|
||||
if($row['io_type']) {
|
||||
$opt = explode(chr(30), $row['io_id']);
|
||||
if($opt[0] && $opt[1])
|
||||
$option .= $opt[0].' : '.$opt[1];
|
||||
} else {
|
||||
$subj = explode(',', $row['it_option_subject']);
|
||||
$opt = explode(chr(30), $row['io_id']);
|
||||
for($k=0; $k<count($subj); $k++) {
|
||||
if($subj[$k] && $opt[$k]) {
|
||||
$option .= $option_br.$subj[$k].' : '.$opt[$k];
|
||||
$option_br = '<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$type = '선택옵션';
|
||||
if($row['io_type'])
|
||||
$type = '추가옵션';
|
||||
|
||||
// 통보수량보다 재고수량이 작을 때
|
||||
$io_stock_qty = number_format($row['io_stock_qty']);
|
||||
$io_stock_qty_st = ''; // 스타일 정의
|
||||
if($row['io_stock_qty'] <= $row['io_noti_qty']) {
|
||||
$io_stock_qty_st = ' sit_stock_qty_alert';
|
||||
$io_stock_qty = ''.$io_stock_qty.' !<span class="sound_only"> 재고부족 </span>';
|
||||
}
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
?>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td>
|
||||
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
|
||||
<input type="hidden" name="io_id[<?php echo $i; ?>]" value="<?php echo $row['io_id']; ?>">
|
||||
<input type="hidden" name="io_type[<?php echo $i; ?>]" value="<?php echo $row['io_type']; ?>">
|
||||
<a href="<?php echo $href; ?>"><?php echo get_it_image($row['it_id'], 50, 50); ?> <?php echo cut_str(stripslashes($row['it_name']), 60, "…"); ?></a>
|
||||
</td>
|
||||
<td class="td_itopt"><?php echo $option; ?></td>
|
||||
<td class="td_mng"><?php echo $type; ?></td>
|
||||
<td class="td_num<?php echo $io_stock_qty_st; ?>"><?php echo $io_stock_qty; ?></td>
|
||||
<td class="td_num"><?php echo number_format($wait_qty); ?></td>
|
||||
<td class="td_num"><?php echo number_format($temporary_qty); ?></td>
|
||||
<td class="td_num">
|
||||
<label for="stock_qty_<?php echo $i; ?>" class="sound_only">재고수정</label>
|
||||
<input type="text" name="io_stock_qty[<?php echo $i; ?>]" value="<?php echo $row['io_stock_qty']; ?>" id="stock_qty_<?php echo $i; ?>" class="frm_input" size="8" autocomplete="off">
|
||||
</td>
|
||||
<td class="td_num">
|
||||
<label for="noti_qty_<?php echo $i; ?>" class="sound_only">통보수량</label>
|
||||
<input type="text" name="io_noti_qty[<?php echo $i; ?>]" value="<?php echo $row['io_noti_qty']; ?>" id="noti_qty_<?php echo $i; ?>" class="frm_input" size="8" autocomplete="off">
|
||||
</td>
|
||||
<td class="td_chk">
|
||||
<label for="use_<?php echo $i; ?>" class="sound_only">판매</label>
|
||||
<input type="checkbox" name="io_use[<?php echo $i; ?>]" value="1" id="use_<?php echo $i; ?>" <?php echo ($row['io_use'] ? "checked" : ""); ?>>
|
||||
</td>
|
||||
<td class="td_mngsmall"><a href="./itemform.php?w=u&it_id=<?php echo $row['it_id']; ?>&ca_id=<?php echo $row['ca_id']; ?>&<?php echo $qstr; ?>">수정</a></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
if (!$i)
|
||||
echo '<tr><td colspan="10" class="empty_table"><span>자료가 없습니다.</span></td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="일괄수정" class="btn_submit">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>
|
||||
재고수정의 수치를 수정하시면 창고재고의 수치가 변경됩니다.<br>
|
||||
창고재고가 부족한 경우 재고수량 뒤에 <span class="sit_stock_qty_alert">!</span><span class="sound_only"> 혹은 재고부족</span>으로 표시됩니다.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?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');
|
||||
?>
|
||||
23
adm/shop_admin/optionstocklistupdate.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
$sub_menu = '400500';
|
||||
include_once('./_common.php');
|
||||
|
||||
check_demo();
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
// 재고 일괄수정
|
||||
for ($i=0; $i<count($_POST['it_id']); $i++)
|
||||
{
|
||||
$sql = "update {$g5['g5_shop_item_option_table']}
|
||||
set io_stock_qty = '{$_POST['io_stock_qty'][$i]}',
|
||||
io_noti_qty = '{$_POST['io_noti_qty'][$i]}',
|
||||
io_use = '{$_POST['io_use'][$i]}'
|
||||
where it_id = '{$_POST['it_id'][$i]}'
|
||||
and io_id = '{$_POST['io_id'][$i]}'
|
||||
and io_type = '{$_POST['io_type'][$i]}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
goto_url("./optionstocklist.php?sort1=$sort1&sort2=$sort2&sel_ca_id=$sel_ca_id&sel_field=$sel_field&search=$search&page=$page");
|
||||
?>
|
||||
55
adm/shop_admin/orderdelivery.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
$sub_menu = '400400';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$g5['title'] = '엑셀 배송일괄처리';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
?>
|
||||
|
||||
<div class="new_win">
|
||||
<h1><?php echo $g5['title']; ?></h1>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>
|
||||
엑셀파일을 이용하여 배송정보를 일괄등록할 수 있습니다.<br>
|
||||
형식은 <strong>배송처리용 엑셀파일</strong>을 다운로드하여 배송 정보를 입력하시면 됩니다.<br>
|
||||
수정 완료 후 엑셀파일을 업로드하시면 배송정보가 일괄등록됩니다.<br>
|
||||
엑셀파일을 저장하실 때는 <strong>Excel 97 - 2003 통합문서 (*.xls)</strong> 로 저장하셔야 합니다.<br>
|
||||
주문상태가 준비이고 미수금이 0인 주문에 한해 엑셀파일이 생성됩니다.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="<?php echo G5_ADMIN_URL; ?>/shop_admin/orderdeliveryexcel.php">배송정보 일괄등록용 엑셀파일 다운로드</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form name="forderdelivery" method="post" action="./orderdeliveryupdate.php" enctype="MULTIPART/FORM-DATA" autocomplete="off">
|
||||
|
||||
<div id="excelfile_upload">
|
||||
<label for="excelfile">파일선택</label>
|
||||
<input type="file" name="excelfile" id="excelfile">
|
||||
</div>
|
||||
|
||||
<div id="excelfile_input">
|
||||
<input type="checkbox" name="od_send_mail" value="1" id="od_send_mail" checked="checked">
|
||||
<label for="od_send_mail">배송안내 메일</label>
|
||||
<input type="checkbox" name="send_sms" value="1" id="od_send_sms" checked="checked">
|
||||
<label for="od_send_sms">배송안내 SMS</label>
|
||||
<input type="checkbox" name="send_escrow" value="1" id="od_send_escrow">
|
||||
<label for="od_send_escrow">에스크로배송등록</label>
|
||||
</div>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="배송정보 등록" class="btn_submit">
|
||||
<button type="button" onclick="window.close();">닫기</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
60
adm/shop_admin/orderdeliveryexcel.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
$sub_menu = '400400';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
// 주문정보
|
||||
$sql = " select *
|
||||
from {$g5['g5_shop_order_table']}
|
||||
where od_misu = '0'
|
||||
and od_status = '준비'
|
||||
order by od_id desc ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
if(!@mysql_num_rows($result))
|
||||
alert_close('배송처리할 주문 내역이 없습니다.');
|
||||
|
||||
/*================================================================================
|
||||
php_writeexcel http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/
|
||||
=================================================================================*/
|
||||
|
||||
include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_workbook.inc.php');
|
||||
include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_worksheet.inc.php');
|
||||
|
||||
$fname = tempnam(G5_DATA_PATH, "tmp-deliverylist.xls");
|
||||
$workbook = new writeexcel_workbook($fname);
|
||||
$worksheet = $workbook->addworksheet();
|
||||
|
||||
// Put Excel data
|
||||
$data = array('주문번호', '주문자명', '주문자전화1', '주문자전화2', '배송자명', '배송지전화1', '배송지전화2', '배송지주소', '배송회사', '운송장번호');
|
||||
$data = array_map('iconv_euckr', $data);
|
||||
|
||||
$col = 0;
|
||||
foreach($data as $cell) {
|
||||
$worksheet->write(0, $col++, $cell);
|
||||
}
|
||||
|
||||
for($i=1; $row=sql_fetch_array($result); $i++) {
|
||||
$row = array_map('iconv_euckr', $row);
|
||||
|
||||
$worksheet->write($i, 0, ' '.$row['od_id']);
|
||||
$worksheet->write($i, 1, $row['od_name']);
|
||||
$worksheet->write($i, 2, ' '.$row['od_tel']);
|
||||
$worksheet->write($i, 3, ' '.$row['od_hp']);
|
||||
$worksheet->write($i, 4, $row['od_b_name']);
|
||||
$worksheet->write($i, 5, ' '.$row['od_b_tel']);
|
||||
$worksheet->write($i, 6, ' '.$row['od_b_hp']);
|
||||
$worksheet->write($i, 7, print_address($row['od_b_addr1'], $row['od_b_addr2'], $row['od_b_addr3'], $row['od_b_addr_jibeon']));
|
||||
$worksheet->write($i, 8, $row['od_delivery_company']);
|
||||
$worksheet->write($i, 9, $row['od_invoice']);
|
||||
}
|
||||
|
||||
$workbook->close();
|
||||
|
||||
header("Content-Type: application/x-msexcel; name=\"deliverylist-".date("ymd", time()).".xls\"");
|
||||
header("Content-Disposition: inline; filename=\"deliverylist-".date("ymd", time()).".xls\"");
|
||||
$fh=fopen($fname, "rb");
|
||||
fpassthru($fh);
|
||||
unlink($fname);
|
||||
?>
|
||||
184
adm/shop_admin/orderdeliveryupdate.php
Normal file
@ -0,0 +1,184 @@
|
||||
<?php
|
||||
$sub_menu = '400400';
|
||||
include_once('./_common.php');
|
||||
include_once('./admin.shop.lib.php');
|
||||
include_once(G5_LIB_PATH.'/mailer.lib.php');
|
||||
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
define("_ORDERMAIL_", true);
|
||||
|
||||
$sms_count = 0;
|
||||
if($config['cf_sms_use'] == 'icode' && $_POST['send_sms'])
|
||||
{
|
||||
$SMS = new SMS;
|
||||
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
|
||||
}
|
||||
|
||||
if($_FILES['excelfile']['tmp_name']) {
|
||||
$file = $_FILES['excelfile']['tmp_name'];
|
||||
|
||||
include_once(G5_LIB_PATH.'/Excel/reader.php');
|
||||
|
||||
$data = new Spreadsheet_Excel_Reader();
|
||||
|
||||
// Set output Encoding.
|
||||
$data->setOutputEncoding('UTF-8');
|
||||
|
||||
/***
|
||||
* if you want you can change 'iconv' to mb_convert_encoding:
|
||||
* $data->setUTFEncoder('mb');
|
||||
*
|
||||
**/
|
||||
|
||||
/***
|
||||
* By default rows & cols indeces start with 1
|
||||
* For change initial index use:
|
||||
* $data->setRowColOffset(0);
|
||||
*
|
||||
**/
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* Some function for formatting output.
|
||||
* $data->setDefaultFormat('%.2f');
|
||||
* setDefaultFormat - set format for columns with unknown formatting
|
||||
*
|
||||
* $data->setColumnFormat(4, '%.3f');
|
||||
* setColumnFormat - set format for column (apply only to number fields)
|
||||
*
|
||||
**/
|
||||
|
||||
$data->read($file);
|
||||
|
||||
/*
|
||||
|
||||
|
||||
$data->sheets[0]['numRows'] - count rows
|
||||
$data->sheets[0]['numCols'] - count columns
|
||||
$data->sheets[0]['cells'][$i][$j] - data from $i-row $j-column
|
||||
|
||||
$data->sheets[0]['cellsInfo'][$i][$j] - extended info about cell
|
||||
|
||||
$data->sheets[0]['cellsInfo'][$i][$j]['type'] = "date" | "number" | "unknown"
|
||||
if 'type' == "unknown" - use 'raw' value, because cell contain value with format '0.00';
|
||||
$data->sheets[0]['cellsInfo'][$i][$j]['raw'] = value if cell without format
|
||||
$data->sheets[0]['cellsInfo'][$i][$j]['colspan']
|
||||
$data->sheets[0]['cellsInfo'][$i][$j]['rowspan']
|
||||
*/
|
||||
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
|
||||
$fail_od_id = array();
|
||||
$total_count = 0;
|
||||
$fail_count = 0;
|
||||
$succ_count = 0;
|
||||
|
||||
// $i 사용시 ordermail.inc.php의 $i 때문에 무한루프에 빠짐
|
||||
for ($k = 2; $k <= $data->sheets[0]['numRows']; $k++) {
|
||||
$total_count++;
|
||||
|
||||
$od_id = addslashes(trim($data->sheets[0]['cells'][$k][1]));
|
||||
$od_delivery_company = addslashes($data->sheets[0]['cells'][$k][9]);
|
||||
$od_invoice = addslashes($data->sheets[0]['cells'][$k][10]);
|
||||
|
||||
if(!$od_id || !$od_delivery_company || !$od_invoice) {
|
||||
$fail_count++;
|
||||
$fail_od_id[] = $od_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
// 주문정보
|
||||
$od = sql_fetch(" select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ");
|
||||
if (!$od) {
|
||||
$fail_count++;
|
||||
$fail_od_id[] = $od_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
if($od['od_status'] != '준비') {
|
||||
$fail_count++;
|
||||
$fail_od_id[] = $od_id;
|
||||
continue;
|
||||
}
|
||||
|
||||
$delivery['invoice'] = $od_invoice;
|
||||
$delivery['invoice_time'] = G5_TIME_YMDHIS;
|
||||
$delivery['delivery_company'] = $od_delivery_company;
|
||||
|
||||
// 주문정보 업데이트
|
||||
order_update_delivery($od_id, $od['mb_id'], '배송', $delivery);
|
||||
change_status($od_id, '준비', '배송');
|
||||
|
||||
$succ_count++;
|
||||
|
||||
// SMS
|
||||
if($config['cf_sms_use'] == 'icode' && $_POST['send_sms'] && $default['de_sms_use5']) {
|
||||
$sms_contents = conv_sms_contents($od_id, $default['de_sms_cont5']);
|
||||
if($sms_contents) {
|
||||
$receive_number = preg_replace("/[^0-9]/", "", $od['od_hp']); // 수신자번호
|
||||
$send_number = preg_replace("/[^0-9]/", "", $default['de_admin_company_tel']); // 발신자번호
|
||||
|
||||
if($receive_number && $send_number) {
|
||||
$SMS->Add($receive_number, $send_number, $config['cf_icode_id'], $sms_contents, "");
|
||||
$sms_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 메일
|
||||
if($config['cf_email_use'] && $_POST['od_send_mail'])
|
||||
include './ordermail.inc.php';
|
||||
|
||||
// 에스크로 배송
|
||||
if($_POST['send_escrow'] && $od['od_tno'] && $od['od_escrow']) {
|
||||
$escrow_tno = $od['od_tno'];
|
||||
$escrow_numb = $od_invoice;
|
||||
$escrow_corp = $od_delivery_company;
|
||||
|
||||
include(G5_SHOP_PATH.'/'.$od['od_pg'].'/escrow.register.php');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SMS
|
||||
if($config['cf_sms_use'] == 'icode' && $_POST['send_sms'] && $sms_count)
|
||||
{
|
||||
$SMS->Send();
|
||||
}
|
||||
|
||||
$g5['title'] = '엑셀 배송일괄처리 결과';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
?>
|
||||
|
||||
<div class="new_win">
|
||||
<h1><?php echo $g5['title']; ?></h1>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>배송일괄처리를 완료했습니다.</p>
|
||||
</div>
|
||||
|
||||
<dl id="excelfile_result">
|
||||
<dt>총배송건수</dt>
|
||||
<dd><?php echo number_format($total_count); ?></dd>
|
||||
<dt class="result_done">완료건수</dt>
|
||||
<dd class="result_done"><?php echo number_format($succ_count); ?></dd>
|
||||
<dt class="result_fail">실패건수</dt>
|
||||
<dd class="result_fail"><?php echo number_format($fail_count); ?></dd>
|
||||
<?php if($fail_count > 0) { ?>
|
||||
<dt>실패주문코드</dt>
|
||||
<dd><?php echo implode(', ', $fail_od_id); ?></dd>
|
||||
<?php } ?>
|
||||
</dl>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<button type="button" onclick="window.close();">창닫기</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
1029
adm/shop_admin/orderform.php
Normal file
374
adm/shop_admin/orderformcartupdate.php
Normal file
@ -0,0 +1,374 @@
|
||||
<?php
|
||||
$sub_menu = '400400';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$ct_chk_count = count($_POST['ct_chk']);
|
||||
if(!$ct_chk_count)
|
||||
alert('처리할 자료를 하나 이상 선택해 주십시오.');
|
||||
|
||||
$status_normal = array('주문','입금','준비','배송','완료');
|
||||
$status_cancel = array('취소','반품','품절');
|
||||
|
||||
if (in_array($_POST['ct_status'], $status_normal) || in_array($_POST['ct_status'], $status_cancel)) {
|
||||
; // 통과
|
||||
} else {
|
||||
alert('변경할 상태가 올바르지 않습니다.');
|
||||
}
|
||||
|
||||
$mod_history = '';
|
||||
$cnt = count($_POST['ct_id']);
|
||||
$arr_it_id = array();
|
||||
|
||||
for ($i=0; $i<$cnt; $i++)
|
||||
{
|
||||
$k = $_POST['ct_chk'][$i];
|
||||
$ct_id = $_POST['ct_id'][$k];
|
||||
|
||||
if(!$ct_id)
|
||||
continue;
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_cart_table']} where od_id = '$od_id' and ct_id = '$ct_id' ";
|
||||
$ct = sql_fetch($sql);
|
||||
if(!$ct['ct_id'])
|
||||
continue;
|
||||
|
||||
// 수량이 변경됐다면
|
||||
$ct_qty = $_POST['ct_qty'][$k];
|
||||
if($ct['ct_qty'] != $ct_qty) {
|
||||
$diff_qty = $ct['ct_qty'] - $ct_qty;
|
||||
|
||||
// 재고에 차이 반영.
|
||||
if($ct['ct_stock_use']) {
|
||||
if($ct['io_id']) {
|
||||
$sql = " update {$g5['g5_shop_item_option_table']}
|
||||
set io_stock_qty = io_stock_qty + '$diff_qty'
|
||||
where it_id = '{$ct['it_id']}'
|
||||
and io_id = '{$ct['io_id']}'
|
||||
and io_type = '{$ct['io_type']}' ";
|
||||
} else {
|
||||
$sql = " update {$g5['g5_shop_item_table']}
|
||||
set it_stock_qty = it_stock_qty + '$diff_qty'
|
||||
where it_id = '{$ct['it_id']}' ";
|
||||
}
|
||||
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
// 수량변경
|
||||
$sql = " update {$g5['g5_shop_cart_table']}
|
||||
set ct_qty = '$ct_qty'
|
||||
where ct_id = '$ct_id'
|
||||
and od_id = '$od_id' ";
|
||||
sql_query($sql);
|
||||
$mod_history .= G5_TIME_YMDHIS.' '.$ct['ct_option'].' 수량변경 '.$ct['ct_qty'].' -> '.$ct_qty."\n";
|
||||
}
|
||||
|
||||
// 재고를 이미 사용했다면 (재고에서 이미 뺐다면)
|
||||
$stock_use = $ct['ct_stock_use'];
|
||||
if ($ct['ct_stock_use'])
|
||||
{
|
||||
if ($ct_status == '주문' || $ct_status == '취소' || $ct_status == '반품' || $ct_status == '품절')
|
||||
{
|
||||
$stock_use = 0;
|
||||
// 재고에 다시 더한다.
|
||||
if($ct['io_id']) {
|
||||
$sql = " update {$g5['g5_shop_item_option_table']}
|
||||
set io_stock_qty = io_stock_qty + '{$ct['ct_qty']}'
|
||||
where it_id = '{$ct['it_id']}'
|
||||
and io_id = '{$ct['io_id']}'
|
||||
and io_type = '{$ct['io_type']}' ";
|
||||
} else {
|
||||
$sql = " update {$g5['g5_shop_item_table']}
|
||||
set it_stock_qty = it_stock_qty + '{$ct['ct_qty']}'
|
||||
where it_id = '{$ct['it_id']}' ";
|
||||
}
|
||||
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 재고 오류로 인한 수정
|
||||
if ($ct_status == '배송' || $ct_status == '완료')
|
||||
{
|
||||
$stock_use = 1;
|
||||
// 재고에서 뺀다.
|
||||
if($ct['io_id']) {
|
||||
$sql = " update {$g5['g5_shop_item_option_table']}
|
||||
set io_stock_qty = io_stock_qty - '{$ct['ct_qty']}'
|
||||
where it_id = '{$ct['it_id']}'
|
||||
and io_id = '{$ct['io_id']}'
|
||||
and io_type = '{$ct['io_type']}' ";
|
||||
} else {
|
||||
$sql = " update {$g5['g5_shop_item_table']}
|
||||
set it_stock_qty = it_stock_qty - '{$ct['ct_qty']}'
|
||||
where it_id = '{$ct['it_id']}' ";
|
||||
}
|
||||
|
||||
sql_query($sql);
|
||||
}
|
||||
/* 주문 수정에서 "품절" 선택시 해당 상품 자동 품절 처리하기
|
||||
else if ($ct_status == '품절') {
|
||||
$stock_use = 1;
|
||||
// 재고에서 뺀다.
|
||||
$sql =" update {$g5['g5_shop_item_table']} set it_stock_qty = 0 where it_id = '{$ct['it_id']}' ";
|
||||
sql_query($sql);
|
||||
} */
|
||||
}
|
||||
|
||||
$point_use = $ct['ct_point_use'];
|
||||
// 회원이면서 포인트가 0보다 크면
|
||||
// 이미 포인트를 부여했다면 뺀다.
|
||||
if ($mb_id && $ct['ct_point'] && $ct['ct_point_use'])
|
||||
{
|
||||
$point_use = 0;
|
||||
//insert_point($mb_id, (-1) * ($ct[ct_point] * $ct[ct_qty]), "주문번호 $od_id ($ct_id) 취소");
|
||||
delete_point($mb_id, "@delivery", $mb_id, "$od_id,$ct_id");
|
||||
}
|
||||
|
||||
// 히스토리에 남김
|
||||
// 히스토리에 남길때는 작업|아이디|시간|IP|그리고 나머지 자료
|
||||
$now = G5_TIME_YMDHIS;
|
||||
$ct_history="\n$ct_status|{$member['mb_id']}|$now|$REMOTE_ADDR";
|
||||
|
||||
$sql = " update {$g5['g5_shop_cart_table']}
|
||||
set ct_point_use = '$point_use',
|
||||
ct_stock_use = '$stock_use',
|
||||
ct_status = '$ct_status',
|
||||
ct_history = CONCAT(ct_history,'$ct_history')
|
||||
where od_id = '$od_id'
|
||||
and ct_id = '$ct_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
// it_id를 배열에 저장
|
||||
if($ct_status == '주문' || $ct_status == '취소' || $ct_status == '반품' || $ct_status == '품절' || $ct_status == '완료')
|
||||
$arr_it_id[] = $ct['it_id'];
|
||||
}
|
||||
|
||||
// 상품 판매수량 반영
|
||||
if(is_array($arr_it_id) && !empty($arr_it_id)) {
|
||||
$unq_it_id = array_unique($arr_it_id);
|
||||
|
||||
foreach($unq_it_id as $it_id) {
|
||||
$sql2 = " select sum(ct_qty) as sum_qty from {$g5['g5_shop_cart_table']} where it_id = '$it_id' and ct_status = '완료' ";
|
||||
$row2 = sql_fetch($sql2);
|
||||
|
||||
$sql3 = " update {$g5['g5_shop_item_table']} set it_sum_qty = '{$row2['sum_qty']}' where it_id = '$it_id' ";
|
||||
sql_query($sql3);
|
||||
}
|
||||
}
|
||||
|
||||
// 장바구니 상품 모두 취소일 경우 주문상태 변경
|
||||
$cancel_change = false;
|
||||
if (in_array($_POST['ct_status'], $status_cancel)) {
|
||||
$sql = " select count(*) as od_count1,
|
||||
SUM(IF(ct_status = '취소' OR ct_status = '반품' OR ct_status = '품절', 1, 0)) as od_count2
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where od_id = '$od_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if($row['od_count1'] == $row['od_count2']) {
|
||||
$cancel_change = true;
|
||||
|
||||
$pg_res_cd = '';
|
||||
$pg_res_msg = '';
|
||||
$pg_cancel_log = '';
|
||||
|
||||
// PG 신용카드 결제 취소일 때
|
||||
if($pg_cancel == 1) {
|
||||
$sql = " select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
|
||||
$od = sql_fetch($sql);
|
||||
|
||||
if($od['od_tno'] && $od['od_settle_case'] == '신용카드') {
|
||||
switch($od['od_pg']) {
|
||||
case 'lg':
|
||||
include_once(G5_SHOP_PATH.'/settle_lg.inc.php');
|
||||
|
||||
$LGD_TID = $od['od_tno'];
|
||||
|
||||
$xpay = new XPay($configPath, $CST_PLATFORM);
|
||||
|
||||
// Mert Key 설정
|
||||
$xpay->set_config_value('t'.$LGD_MID, $config['cf_lg_mert_key']);
|
||||
$xpay->set_config_value($LGD_MID, $config['cf_lg_mert_key']);
|
||||
|
||||
$xpay->Init_TX($LGD_MID);
|
||||
|
||||
$xpay->Set('LGD_TXNAME', 'Cancel');
|
||||
$xpay->Set('LGD_TID', $LGD_TID);
|
||||
|
||||
if ($xpay->TX()) {
|
||||
$res_cd = $xpay->Response_Code();
|
||||
if($res_cd != '0000' && $res_cd != 'AV11') {
|
||||
$pg_res_cd = $res_cd;
|
||||
$pg_res_msg = $xpay->Response_Msg();
|
||||
}
|
||||
} else {
|
||||
$pg_res_cd = $xpay->Response_Code();
|
||||
$pg_res_msg = $xpay->Response_Msg();
|
||||
}
|
||||
break;
|
||||
case 'inicis':
|
||||
include_once(G5_SHOP_PATH.'/settle_inicis.inc.php');
|
||||
$cancel_msg = iconv_euckr('쇼핑몰 운영자 승인 취소');
|
||||
|
||||
/*********************
|
||||
* 3. 취소 정보 설정 *
|
||||
*********************/
|
||||
$inipay->SetField("type", "cancel"); // 고정 (절대 수정 불가)
|
||||
$inipay->SetField("mid", $default['de_inicis_mid']); // 상점아이디
|
||||
/**************************************************************************************************
|
||||
* admin 은 키패스워드 변수명입니다. 수정하시면 안됩니다. 1111의 부분만 수정해서 사용하시기 바랍니다.
|
||||
* 키패스워드는 상점관리자 페이지(https://iniweb.inicis.com)의 비밀번호가 아닙니다. 주의해 주시기 바랍니다.
|
||||
* 키패스워드는 숫자 4자리로만 구성됩니다. 이 값은 키파일 발급시 결정됩니다.
|
||||
* 키패스워드 값을 확인하시려면 상점측에 발급된 키파일 안의 readme.txt 파일을 참조해 주십시오.
|
||||
**************************************************************************************************/
|
||||
$inipay->SetField("admin", $default['de_inicis_admin_key']); //비대칭 사용키 키패스워드
|
||||
$inipay->SetField("tid", $od['od_tno']); // 취소할 거래의 거래아이디
|
||||
$inipay->SetField("cancelmsg", $cancel_msg); // 취소사유
|
||||
|
||||
/****************
|
||||
* 4. 취소 요청 *
|
||||
****************/
|
||||
$inipay->startAction();
|
||||
|
||||
/****************************************************************
|
||||
* 5. 취소 결과 *
|
||||
* *
|
||||
* 결과코드 : $inipay->getResult('ResultCode') ("00"이면 취소 성공) *
|
||||
* 결과내용 : $inipay->getResult('ResultMsg') (취소결과에 대한 설명) *
|
||||
* 취소날짜 : $inipay->getResult('CancelDate') (YYYYMMDD) *
|
||||
* 취소시각 : $inipay->getResult('CancelTime') (HHMMSS) *
|
||||
* 현금영수증 취소 승인번호 : $inipay->getResult('CSHR_CancelNum') *
|
||||
* (현금영수증 발급 취소시에만 리턴됨) *
|
||||
****************************************************************/
|
||||
|
||||
$res_cd = $inipay->getResult('ResultCode');
|
||||
$res_msg = $inipay->getResult('ResultMsg');
|
||||
|
||||
if($res_cd != '00') {
|
||||
$pg_res_cd = $res_cd;
|
||||
$pg_res_msg = iconv_utf8($res_msg);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
include_once(G5_SHOP_PATH.'/settle_kcp.inc.php');
|
||||
require_once(G5_SHOP_PATH.'/kcp/pp_ax_hub_lib.php');
|
||||
|
||||
// locale ko_KR.euc-kr 로 설정
|
||||
setlocale(LC_CTYPE, 'ko_KR.euc-kr');
|
||||
|
||||
$c_PayPlus = new C_PP_CLI;
|
||||
|
||||
$c_PayPlus->mf_clear();
|
||||
|
||||
$tno = $od['od_tno'];
|
||||
$tran_cd = '00200000';
|
||||
$g_conf_home_dir = G5_SHOP_PATH.'/kcp';
|
||||
$g_conf_key_dir = '';
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
|
||||
{
|
||||
$g_conf_log_dir = G5_SHOP_PATH.'/kcp/log';
|
||||
$g_conf_key_dir = G5_SHOP_PATH.'/kcp/bin/pub.key';
|
||||
}
|
||||
$g_conf_site_cd = $default['de_kcp_mid'];
|
||||
|
||||
if (preg_match("/^T000/", $g_conf_site_cd) || $default['de_card_test']) {
|
||||
$g_conf_gw_url = "testpaygw.kcp.co.kr";
|
||||
} else {
|
||||
$g_conf_gw_url = "paygw.kcp.co.kr";
|
||||
}
|
||||
$cancel_msg = iconv_euckr('쇼핑몰 운영자 승인 취소');
|
||||
$cust_ip = $_SERVER['REMOTE_ADDR'];
|
||||
$bSucc_mod_type = "STSC";
|
||||
|
||||
$c_PayPlus->mf_set_modx_data( "tno", $tno ); // KCP 원거래 거래번호
|
||||
$c_PayPlus->mf_set_modx_data( "mod_type", $bSucc_mod_type ); // 원거래 변경 요청 종류
|
||||
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip ); // 변경 요청자 IP
|
||||
$c_PayPlus->mf_set_modx_data( "mod_desc", $cancel_msg ); // 변경 사유
|
||||
|
||||
$c_PayPlus->mf_do_tx( $tno, $g_conf_home_dir, $g_conf_site_cd,
|
||||
$g_conf_site_key, $tran_cd, "",
|
||||
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib",
|
||||
$ordr_idxx, $cust_ip, "3" ,
|
||||
0, 0, $g_conf_key_dir, $g_conf_log_dir);
|
||||
|
||||
$res_cd = $c_PayPlus->m_res_cd;
|
||||
$res_msg = $c_PayPlus->m_res_msg;
|
||||
|
||||
if($res_cd != '0000') {
|
||||
$pg_res_cd = $res_cd;
|
||||
$pg_res_msg = iconv_utf8($res_msg);
|
||||
}
|
||||
|
||||
// locale 설정 초기화
|
||||
setlocale(LC_CTYPE, '');
|
||||
break;
|
||||
}
|
||||
|
||||
// PG 취소요청 성공했으면
|
||||
if($pg_res_cd == '') {
|
||||
$pg_cancel_log = ' PG 신용카드 승인취소 처리';
|
||||
$sql = " update {$g5['g5_shop_order_table']}
|
||||
set od_refund_price = '{$od['od_receipt_price']}'
|
||||
where od_id = '$od_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 관리자 주문취소 로그
|
||||
$mod_history .= G5_TIME_YMDHIS.' '.$member['mb_id'].' 주문'.$_POST['ct_status'].' 처리'.$pg_cancel_log."\n";
|
||||
}
|
||||
}
|
||||
|
||||
// 미수금 등의 정보
|
||||
$info = get_order_info($od_id);
|
||||
|
||||
if(!$info)
|
||||
alert('주문자료가 존재하지 않습니다.');
|
||||
|
||||
$sql = " update {$g5['g5_shop_order_table']}
|
||||
set od_cart_price = '{$info['od_cart_price']}',
|
||||
od_cart_coupon = '{$info['od_cart_coupon']}',
|
||||
od_coupon = '{$info['od_coupon']}',
|
||||
od_send_coupon = '{$info['od_send_coupon']}',
|
||||
od_cancel_price = '{$info['od_cancel_price']}',
|
||||
od_send_cost = '{$info['od_send_cost']}',
|
||||
od_misu = '{$info['od_misu']}',
|
||||
od_tax_mny = '{$info['od_tax_mny']}',
|
||||
od_vat_mny = '{$info['od_vat_mny']}',
|
||||
od_free_mny = '{$info['od_free_mny']}' ";
|
||||
if ($mod_history) { // 주문변경 히스토리 기록
|
||||
$sql .= " , od_mod_history = CONCAT(od_mod_history,'$mod_history') ";
|
||||
}
|
||||
|
||||
if($cancel_change) {
|
||||
$sql .= " , od_status = '취소' "; // 주문상품 모두 취소, 반품, 품절이면 주문 취소
|
||||
} else {
|
||||
if (in_array($_POST['ct_status'], $status_normal)) { // 정상인 주문상태만 기록
|
||||
$sql .= " , od_status = '{$_POST['ct_status']}' ";
|
||||
}
|
||||
}
|
||||
|
||||
$sql .= " where od_id = '$od_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
$qstr = "sort1=$sort1&sort2=$sort2&sel_field=$sel_field&search=$search&page=$page";
|
||||
|
||||
$url = "./orderform.php?od_id=$od_id&$qstr";
|
||||
|
||||
// 신용카드 취소 때 오류가 있으면 알림
|
||||
if($pg_cancel == 1 && $pg_res_cd && $pg_res_msg) {
|
||||
alert('오류코드 : '.$pg_res_cd.' 오류내용 : '.$pg_res_msg, $url);
|
||||
} else {
|
||||
// 1.06.06
|
||||
$od = sql_fetch(" select od_receipt_point from {$g5['g5_shop_order_table']} where od_id = '$od_id' ");
|
||||
if ($od['od_receipt_point'])
|
||||
alert("포인트로 결제한 주문은,\\n\\n주문상태 변경으로 인해 포인트의 가감이 발생하는 경우\\n\\n회원관리 > 포인트관리에서 수작업으로 포인트를 맞추어 주셔야 합니다.", $url);
|
||||
else
|
||||
goto_url($url);
|
||||
}
|
||||
?>
|
||||
146
adm/shop_admin/orderformreceiptupdate.php
Normal file
@ -0,0 +1,146 @@
|
||||
<?php
|
||||
$sub_menu = '400400';
|
||||
include_once('./_common.php');
|
||||
include_once('./admin.shop.lib.php');
|
||||
include_once(G5_LIB_PATH.'/mailer.lib.php');
|
||||
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
|
||||
$od = sql_fetch($sql);
|
||||
if(!$od['od_id'])
|
||||
alert('주문자료가 존재하지 않습니다.');
|
||||
|
||||
if ($od_receipt_time) {
|
||||
if (check_datetime($od_receipt_time) == false)
|
||||
alert('결제일시 오류입니다.');
|
||||
}
|
||||
|
||||
// 결제정보 반영
|
||||
$sql = " update {$g5['g5_shop_order_table']}
|
||||
set od_deposit_name = '{$_POST['od_deposit_name']}',
|
||||
od_bank_account = '{$_POST['od_bank_account']}',
|
||||
od_receipt_time = '{$_POST['od_receipt_time']}',
|
||||
od_receipt_price = '{$_POST['od_receipt_price']}',
|
||||
od_receipt_point = '{$_POST['od_receipt_point']}',
|
||||
od_refund_price = '{$_POST['od_refund_price']}',
|
||||
od_delivery_company= '{$_POST['od_delivery_company']}',
|
||||
od_invoice = '{$_POST['od_invoice']}',
|
||||
od_invoice_time = '{$_POST['od_invoice_time']}',
|
||||
od_send_cost = '{$_POST['od_send_cost']}',
|
||||
od_send_cost2 = '{$_POST['od_send_cost2']}'
|
||||
where od_id = '$od_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 주문정보
|
||||
$info = get_order_info($od_id);
|
||||
if(!$info)
|
||||
alert('주문자료가 존재하지 않습니다.');
|
||||
|
||||
$od_status = $od['od_status'];
|
||||
$cart_status = false;
|
||||
|
||||
// 미수가 0이고 상태가 주문이었다면 입금으로 변경
|
||||
if($info['od_misu'] == 0 && $od['od_status'] == '주문')
|
||||
{
|
||||
$od_status = '입금';
|
||||
$cart_status = true;
|
||||
}
|
||||
|
||||
// 배송정보가 있으면 주문상태 배송으로 변경
|
||||
$order_status = array('입금', '준비');
|
||||
if($_POST['od_delivery_company'] && $_POST['od_invoice'] && in_array($od['od_status'], $order_status))
|
||||
{
|
||||
$od_status = '배송';
|
||||
$cart_status = true;
|
||||
}
|
||||
|
||||
// 미수금액
|
||||
$od_misu = ( $od['od_cart_price'] - $od['od_cancel_price'] + $_POST['od_send_cost'] + $_POST['od_send_cost2'] )
|
||||
- ( $od['od_cart_coupon'] + $od['od_coupon'] + $od['od_send_coupon'] )
|
||||
- ( $_POST['od_receipt_price'] + $_POST['od_receipt_point'] - $_POST['od_refund_price'] );
|
||||
|
||||
// 미수금 정보 등 반영
|
||||
$sql = " update {$g5['g5_shop_order_table']}
|
||||
set od_misu = '$od_misu',
|
||||
od_tax_mny = '{$info['od_tax_mny']}',
|
||||
od_vat_mny = '{$info['od_vat_mny']}',
|
||||
od_free_mny = '{$info['od_free_mny']}',
|
||||
od_status = '$od_status'
|
||||
where od_id = '$od_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
// 장바구니 상태 변경
|
||||
if($cart_status) {
|
||||
$sql = " update {$g5['g5_shop_cart_table']}
|
||||
set ct_status = '$od_status'
|
||||
where od_id = '$od_id' ";
|
||||
|
||||
switch($od_status) {
|
||||
case '입금':
|
||||
$sql .= " and ct_status = '주문' ";
|
||||
break;
|
||||
case '배송':
|
||||
$sql .= " and ct_status IN ('".implode("', '", $order_status)."') ";
|
||||
break;
|
||||
default:
|
||||
;
|
||||
}
|
||||
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
|
||||
// 배송때 재고반영
|
||||
if($info['od_misu'] == 0 && $od_status == '배송') {
|
||||
$sql = " select * from {$g5['g5_shop_cart_table']} where od_id = '$od_id' ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
// 재고를 사용하지 않았다면
|
||||
$stock_use = $row['ct_stock_use'];
|
||||
|
||||
if(!$row['ct_stock_use'])
|
||||
{
|
||||
// 재고에서 뺀다.
|
||||
subtract_io_stock($row['it_id'], $row['ct_qty'], $row['io_id'], $row['io_type']);
|
||||
$stock_use = 1;
|
||||
|
||||
$sql = " update {$g5['g5_shop_cart_table']} set ct_stock_use = '$stock_use' where ct_id = '{$row['ct_id']}' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
unset($sql);
|
||||
unset($result);
|
||||
unset($row);
|
||||
}
|
||||
|
||||
|
||||
// 메일발송
|
||||
define("_ORDERMAIL_", true);
|
||||
include "./ordermail.inc.php";
|
||||
|
||||
|
||||
// SMS 문자전송
|
||||
define("_ORDERSMS_", true);
|
||||
include "./ordersms.inc.php";
|
||||
|
||||
|
||||
// 에스크로 배송처리
|
||||
if($_POST['od_tno'] && $_POST['od_escrow'] == 1)
|
||||
{
|
||||
$escrow_tno = $_POST['od_tno'];
|
||||
$escrow_corp = $_POST['od_delivery_company'];
|
||||
$escrow_numb = $_POST['od_invoice'];
|
||||
|
||||
include(G5_SHOP_PATH.'/'.$od['od_pg'].'/escrow.register.php');
|
||||
}
|
||||
|
||||
|
||||
$qstr = "sort1=$sort1&sort2=$sort2&sel_field=$sel_field&search=$search&page=$page";
|
||||
|
||||
goto_url("./orderform.php?od_id=$od_id&$qstr");
|
||||
?>
|
||||
43
adm/shop_admin/orderformupdate.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
$sub_menu = '400400';
|
||||
include_once('./_common.php');
|
||||
|
||||
if($_POST['mod_type'] == 'info') {
|
||||
$od_zip1 = substr($_POST['od_zip'], 0, 3);
|
||||
$od_zip2 = substr($_POST['od_zip'], 3);
|
||||
$od_b_zip1 = substr($_POST['od_b_zip'], 0, 3);
|
||||
$od_b_zip2 = substr($_POST['od_b_zip'], 3);
|
||||
|
||||
$sql = " update {$g5['g5_shop_order_table']}
|
||||
set od_name = '$od_name',
|
||||
od_tel = '$od_tel',
|
||||
od_hp = '$od_hp',
|
||||
od_zip1 = '$od_zip1',
|
||||
od_zip2 = '$od_zip2',
|
||||
od_addr1 = '$od_addr1',
|
||||
od_addr2 = '$od_addr2',
|
||||
od_addr3 = '$od_addr3',
|
||||
od_addr_jibeon = '$od_addr_jibeon',
|
||||
od_email = '$od_email',
|
||||
od_b_name = '$od_b_name',
|
||||
od_b_tel = '$od_b_tel',
|
||||
od_b_hp = '$od_b_hp',
|
||||
od_b_zip1 = '$od_b_zip1',
|
||||
od_b_zip2 = '$od_b_zip2',
|
||||
od_b_addr1 = '$od_b_addr1',
|
||||
od_b_addr2 = '$od_b_addr2',
|
||||
od_b_addr3 = '$od_b_addr3',
|
||||
od_b_addr_jibeon = '$od_b_addr_jibeon' ";
|
||||
if ($default['de_hope_date_use'])
|
||||
$sql .= " , od_hope_date = '$od_hope_date' ";
|
||||
} else {
|
||||
$sql = "update {$g5['g5_shop_order_table']}
|
||||
set od_shop_memo = '$od_shop_memo' ";
|
||||
}
|
||||
$sql .= " where od_id = '$od_id' ";
|
||||
sql_query($sql);
|
||||
|
||||
$qstr = "sort1=$sort1&sort2=$sort2&sel_field=$sel_field&search=$search&page=$page";
|
||||
|
||||
goto_url("./orderform.php?od_id=$od_id&$qstr");
|
||||
?>
|
||||
661
adm/shop_admin/orderlist.php
Normal file
@ -0,0 +1,661 @@
|
||||
<?php
|
||||
$sub_menu = '400400';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '주문내역';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
||||
|
||||
$where = array();
|
||||
|
||||
$sql_search = "";
|
||||
if ($search != "") {
|
||||
if ($sel_field != "") {
|
||||
$where[] = " $sel_field like '%$search%' ";
|
||||
}
|
||||
|
||||
if ($save_search != $search) {
|
||||
$page = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($od_status) {
|
||||
switch($od_status) {
|
||||
case '전체취소':
|
||||
$where[] = " od_status = '취소' ";
|
||||
break;
|
||||
case '부분취소':
|
||||
$where[] = " od_status IN('주문', '입금', '준비', '배송', '완료') and od_cancel_price > 0 ";
|
||||
break;
|
||||
default:
|
||||
$where[] = " od_status = '$od_status' ";
|
||||
break;
|
||||
}
|
||||
|
||||
switch ($od_status) {
|
||||
case '주문' :
|
||||
$sort1 = "od_id";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
case '입금' : // 결제완료
|
||||
$sort1 = "od_receipt_time";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
case '배송' : // 배송중
|
||||
$sort1 = "od_invoice_time";
|
||||
$sort2 = "desc";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($od_settle_case) {
|
||||
$where[] = " od_settle_case = '$od_settle_case' ";
|
||||
}
|
||||
|
||||
if ($od_misu) {
|
||||
$where[] = " od_misu != 0 ";
|
||||
}
|
||||
|
||||
if ($od_cancel_price) {
|
||||
$where[] = " od_cancel_price != 0 ";
|
||||
}
|
||||
|
||||
if ($od_refund_price) {
|
||||
$where[] = " od_refund_price != 0 ";
|
||||
}
|
||||
|
||||
if ($od_receipt_point) {
|
||||
$where[] = " od_receipt_point != 0 ";
|
||||
}
|
||||
|
||||
if ($od_coupon) {
|
||||
$where[] = " od_coupon != 0 ";
|
||||
}
|
||||
|
||||
if ($od_escrow) {
|
||||
$where[] = " od_escrow = 1 ";
|
||||
}
|
||||
|
||||
if ($fr_date && $to_date) {
|
||||
$where[] = " od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
|
||||
}
|
||||
|
||||
if ($where) {
|
||||
$sql_search = ' where '.implode(' and ', $where);
|
||||
}
|
||||
|
||||
if ($sel_field == "") $sel_field = "od_id";
|
||||
if ($sort1 == "") $sort1 = "od_id";
|
||||
if ($sort2 == "") $sort2 = "desc";
|
||||
|
||||
$sql_common = " from {$g5['g5_shop_order_table']} $sql_search ";
|
||||
|
||||
$sql = " select count(od_id) as cnt " . $sql_common;
|
||||
$row = sql_fetch($sql);
|
||||
$total_count = $row['cnt'];
|
||||
|
||||
$rows = $config['cf_page_rows'];
|
||||
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
|
||||
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
|
||||
$from_record = ($page - 1) * $rows; // 시작 열을 구함
|
||||
|
||||
$sql = " select *,
|
||||
(od_cart_coupon + od_coupon + od_send_coupon) as couponprice
|
||||
$sql_common
|
||||
order by $sort1 $sort2
|
||||
limit $from_record, $rows ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$qstr1 = "od_status=".urlencode($od_status)."&od_settle_case=".urlencode($od_settle_case)."&od_misu=$od_misu&od_cancel_price=$od_cancel_price&od_refund_price=$od_refund_price&od_receipt_point=$od_receipt_point&od_coupon=$od_coupon&fr_date=$fr_date&to_date=$to_date&sel_field=$sel_field&search=$search&save_search=$search";
|
||||
$qstr = "$qstr1&sort1=$sort1&sort2=$sort2&page=$page";
|
||||
|
||||
$listall = '<a href="'.$_SERVER['SCRIPT_NAME'].'" class="ov_listall">전체목록</a>';
|
||||
|
||||
// 주문삭제 히스토리 테이블 필드 추가
|
||||
if(!sql_query(" select mb_id from {$g5['g5_shop_order_delete_table']} limit 1 ", false)) {
|
||||
sql_query(" ALTER TABLE `{$g5['g5_shop_order_delete_table']}`
|
||||
ADD `mb_id` varchar(20) NOT NULL DEFAULT '' AFTER `de_data`,
|
||||
ADD `de_ip` varchar(255) NOT NULL DEFAULT '' AFTER `mb_id`,
|
||||
ADD `de_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `de_ip` ", true);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall; ?>
|
||||
전체 주문내역 <?php echo number_format($total_count); ?>건
|
||||
<?php if($od_status == '준비' && $total_count > 0) { ?>
|
||||
<a href="./orderdelivery.php" id="order_delivery" class="ov_a">엑셀배송처리</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<form name="frmorderlist" class="local_sch01 local_sch">
|
||||
<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="save_search" value="<?php echo $search; ?>">
|
||||
|
||||
<label for="sel_field" class="sound_only">검색대상</label>
|
||||
<select name="sel_field" id="sel_field">
|
||||
<option value="od_id" <?php echo get_selected($sel_field, 'od_id'); ?>>주문번호</option>
|
||||
<option value="mb_id" <?php echo get_selected($sel_field, 'mb_id'); ?>>회원 ID</option>
|
||||
<option value="od_name" <?php echo get_selected($sel_field, 'od_name'); ?>>주문자</option>
|
||||
<option value="od_tel" <?php echo get_selected($sel_field, 'od_tel'); ?>>주문자전화</option>
|
||||
<option value="od_hp" <?php echo get_selected($sel_field, 'od_hp'); ?>>주문자핸드폰</option>
|
||||
<option value="od_b_name" <?php echo get_selected($sel_field, 'od_b_name'); ?>>받는분</option>
|
||||
<option value="od_b_tel" <?php echo get_selected($sel_field, 'od_b_tel'); ?>>받는분전화</option>
|
||||
<option value="od_b_hp" <?php echo get_selected($sel_field, 'od_b_hp'); ?>>받는분핸드폰</option>
|
||||
<option value="od_deposit_name" <?php echo get_selected($sel_field, 'od_deposit_name'); ?>>입금자</option>
|
||||
<option value="od_invoice" <?php echo get_selected($sel_field, 'od_invoice'); ?>>운송장번호</option>
|
||||
</select>
|
||||
|
||||
<label for="search" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="search" value="<?php echo $search; ?>" id="search" required class="required frm_input" autocomplete="off">
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
|
||||
</form>
|
||||
|
||||
<form class="local_sch02 local_sch">
|
||||
<div>
|
||||
<strong>주문상태</strong>
|
||||
<input type="radio" name="od_status" value="" id="od_status_all" <?php echo get_checked($od_status, ''); ?>>
|
||||
<label for="od_status_all">전체</label>
|
||||
<input type="radio" name="od_status" value="주문" id="od_status_odr" <?php echo get_checked($od_status, '주문'); ?>>
|
||||
<label for="od_status_odr">주문</label>
|
||||
<input type="radio" name="od_status" value="입금" id="od_status_income" <?php echo get_checked($od_status, '입금'); ?>>
|
||||
<label for="od_status_income">입금</label>
|
||||
<input type="radio" name="od_status" value="준비" id="od_status_rdy" <?php echo get_checked($od_status, '준비'); ?>>
|
||||
<label for="od_status_rdy">준비</label>
|
||||
<input type="radio" name="od_status" value="배송" id="od_status_dvr" <?php echo get_checked($od_status, '배송'); ?>>
|
||||
<label for="od_status_dvr">배송</label>
|
||||
<input type="radio" name="od_status" value="완료" id="od_status_done" <?php echo get_checked($od_status, '완료'); ?>>
|
||||
<label for="od_status_done">완료</label>
|
||||
<input type="radio" name="od_status" value="전체취소" id="od_status_cancel" <?php echo get_checked($od_status, '전체취소'); ?>>
|
||||
<label for="od_status_cancel">전체취소</label>
|
||||
<input type="radio" name="od_status" value="부분취소" id="od_status_pcancel" <?php echo get_checked($od_status, '부분취소'); ?>>
|
||||
<label for="od_status_pcancel">부분취소</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>결제수단</strong>
|
||||
<input type="radio" name="od_settle_case" value="" id="od_settle_case01" <?php echo get_checked($od_settle_case, ''); ?>>
|
||||
<label for="od_settle_case01">전체</label>
|
||||
<input type="radio" name="od_settle_case" value="무통장" id="od_settle_case02" <?php echo get_checked($od_settle_case, '무통장'); ?>>
|
||||
<label for="od_settle_case02">무통장</label>
|
||||
<input type="radio" name="od_settle_case" value="가상계좌" id="od_settle_case03" <?php echo get_checked($od_settle_case, '가상계좌'); ?>>
|
||||
<label for="od_settle_case03">가상계좌</label>
|
||||
<input type="radio" name="od_settle_case" value="계좌이체" id="od_settle_case04" <?php echo get_checked($od_settle_case, '계좌이체'); ?>>
|
||||
<label for="od_settle_case04">계좌이체</label>
|
||||
<input type="radio" name="od_settle_case" value="휴대폰" id="od_settle_case05" <?php echo get_checked($od_settle_case, '휴대폰'); ?>>
|
||||
<label for="od_settle_case05">휴대폰</label>
|
||||
<input type="radio" name="od_settle_case" value="신용카드" id="od_settle_case06" <?php echo get_checked($od_settle_case, '신용카드'); ?>>
|
||||
<label for="od_settle_case06">신용카드</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>기타선택</strong>
|
||||
<input type="checkbox" name="od_misu" value="Y" id="od_misu01" <?php echo get_checked($od_misu, 'Y'); ?>>
|
||||
<label for="od_misu01">미수금</label>
|
||||
<input type="checkbox" name="od_cancel_price" value="Y" id="od_misu02" <?php echo get_checked($od_cancel_price, 'Y'); ?>>
|
||||
<label for="od_misu02">반품,품절</label>
|
||||
<input type="checkbox" name="od_refund_price" value="Y" id="od_misu03" <?php echo get_checked($od_refund_price, 'Y'); ?>>
|
||||
<label for="od_misu03">환불</label>
|
||||
<input type="checkbox" name="od_receipt_point" value="Y" id="od_misu04" <?php echo get_checked($od_receipt_point, 'Y'); ?>>
|
||||
<label for="od_misu04">포인트주문</label>
|
||||
<input type="checkbox" name="od_coupon" value="Y" id="od_misu05" <?php echo get_checked($od_coupon, 'Y'); ?>>
|
||||
<label for="od_misu05">쿠폰</label>
|
||||
<?php if($default['de_escrow_use']) { ?>
|
||||
<input type="checkbox" name="od_escrow" value="Y" id="od_misu06" <?php echo get_checked($od_escrow, 'Y'); ?>>
|
||||
<label for="od_misu06">에스크로</label>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="sch_last">
|
||||
<strong>주문일자</strong>
|
||||
<input type="text" id="fr_date" name="fr_date" value="<?php echo $fr_date; ?>" class="frm_input" size="10" maxlength="10"> ~
|
||||
<input type="text" id="to_date" name="to_date" value="<?php echo $to_date; ?>" class="frm_input" size="10" maxlength="10">
|
||||
<button type="button" onclick="javascript:set_date('오늘');">오늘</button>
|
||||
<button type="button" onclick="javascript:set_date('어제');">어제</button>
|
||||
<button type="button" onclick="javascript:set_date('이번주');">이번주</button>
|
||||
<button type="button" onclick="javascript:set_date('이번달');">이번달</button>
|
||||
<button type="button" onclick="javascript:set_date('지난주');">지난주</button>
|
||||
<button type="button" onclick="javascript:set_date('지난달');">지난달</button>
|
||||
<button type="button" onclick="javascript:set_date('전체');">전체</button>
|
||||
<input type="submit" value="검색" class="btn_submit">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form name="forderlist" id="forderlist" onsubmit="return forderlist_submit(this);" method="post" autocomplete="off">
|
||||
<input type="hidden" name="search_od_status" value="<?php echo $od_status; ?>">
|
||||
|
||||
<div class="tbl_head02 tbl_wrap">
|
||||
<table id="sodr_list">
|
||||
<caption>주문 내역 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" rowspan="3">
|
||||
<label for="chkall" class="sound_only">주문 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<!-- <th scope="col" id="th_odrnum"><a href="<?php echo title_sort("od_id", 1)."&$qstr1"; ?>">주문번호</a></th> -->
|
||||
<th scope="col" id="th_odrnum" rowspan="2" colspan="2"><a href="<?php echo title_sort("od_id", 1)."&$qstr1"; ?>">주문번호</a></th>
|
||||
<th scope="col" id="th_odrer">주문자</th>
|
||||
<th scope="col" id="th_odrertel">주문자전화</th>
|
||||
<th scope="col" id="th_recvr">받는분</th>
|
||||
<th scope="col" rowspan="3">주문합계<br>선불배송비포함</th>
|
||||
<th scope="col" rowspan="3">입금합계</th>
|
||||
<th scope="col" rowspan="3">주문취소</th>
|
||||
<th scope="col" rowspan="3">쿠폰</th>
|
||||
<th scope="col" rowspan="3">미수금</th>
|
||||
<th scope="col" rowspan="3">보기</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<!-- <th scope="col" id="th_odrdate">주문일시</th> -->
|
||||
<!-- <th scope="col">결제수단</th> -->
|
||||
<!-- <th scope="col" id="th_odrid"><a href="<?php echo title_sort("mb_id")."&$qstr1"; ?>">회원ID</a></th> -->
|
||||
<th scope="col" id="th_odrid">회원ID</th>
|
||||
<th scope="col" id="th_odrcnt">주문상품수</th>
|
||||
<th scope="col" id="th_odrall">누적주문수</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<!-- <th scope="col">배송일시</th> -->
|
||||
<th scope="col" id="odrstat">주문상태</th>
|
||||
<th scope="col" id="odrpay">결제수단</th>
|
||||
<th scope="col" id="delino">운송장번호</th>
|
||||
<th scope="col" id="delicom">배송회사</th>
|
||||
<th scope="col" id="delidate">배송일시</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
// 결제 수단
|
||||
$s_receipt_way = $s_br = "";
|
||||
if ($row['od_settle_case'])
|
||||
{
|
||||
$s_receipt_way = $row['od_settle_case'];
|
||||
$s_br = '<br />';
|
||||
}
|
||||
else
|
||||
{
|
||||
$s_receipt_way = '결제수단없음';
|
||||
$s_br = '<br />';
|
||||
}
|
||||
|
||||
if ($row['od_receipt_point'] > 0)
|
||||
$s_receipt_way .= $s_br."포인트";
|
||||
|
||||
$mb_nick = get_sideview($row['mb_id'], get_text($row['od_name']), $row['od_email'], '');
|
||||
|
||||
$od_cnt = 0;
|
||||
if ($row['mb_id'])
|
||||
{
|
||||
$sql2 = " select count(*) as cnt from {$g5['g5_shop_order_table']} where mb_id = '{$row['mb_id']}' ";
|
||||
$row2 = sql_fetch($sql2);
|
||||
$od_cnt = $row2['cnt'];
|
||||
}
|
||||
|
||||
// 주문 번호에 device 표시
|
||||
$od_mobile = '';
|
||||
if($row['od_mobile'])
|
||||
$od_mobile = '(M)';
|
||||
|
||||
// 주문번호에 - 추가
|
||||
switch(strlen($row['od_id'])) {
|
||||
case 16:
|
||||
$disp_od_id = substr($row['od_id'],0,8).'-'.substr($row['od_id'],8);
|
||||
break;
|
||||
default:
|
||||
$disp_od_id = substr($row['od_id'],0,6).'-'.substr($row['od_id'],6);
|
||||
break;
|
||||
}
|
||||
|
||||
// 주문 번호에 에스크로 표시
|
||||
$od_paytype = '';
|
||||
if($default['de_escrow_use'] && $row['od_escrow'])
|
||||
$od_paytype = '<span class="list_escrow">에스크로</span>';
|
||||
|
||||
$uid = md5($row['od_id'].$row['od_time'].$row['od_ip']);
|
||||
|
||||
$invoice_time = is_null_time($row['od_invoice_time']) ? G5_TIME_YMDHIS : $row['od_invoice_time'];
|
||||
$delivery_company = $row['od_delivery_company'] ? $row['od_delivery_company'] : $default['de_delivery_company'];
|
||||
|
||||
$bg = 'bg'.($i%2);
|
||||
$td_color = 0;
|
||||
if($row['od_cancel_price'] > 0) {
|
||||
$bg .= 'cancel';
|
||||
$td_color = 1;
|
||||
}
|
||||
?>
|
||||
<tr class="orderlist<?php echo ' '.$bg; ?>">
|
||||
<td rowspan="3" class="td_chk">
|
||||
<input type="hidden" name="od_id[<?php echo $i ?>]" value="<?php echo $row['od_id'] ?>" id="od_id_<?php echo $i ?>">
|
||||
<label for="chk_<?php echo $i; ?>" class="sound_only">주문번호 <?php echo $row['od_id']; ?></label>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
|
||||
</td>
|
||||
<!-- <td headers="th_ordnum" class="td_odrnum2">
|
||||
<?php echo $od_mobile; ?>
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&uid=<?php echo $uid; ?>"><?php echo $row['od_id']; ?></a><br>
|
||||
</td> -->
|
||||
<td headers="th_ordnum" class="td_odrnum2" rowspan="2" colspan="2">
|
||||
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&uid=<?php echo $uid; ?>" class="orderitem"><?php echo $disp_od_id; ?></a>
|
||||
<?php echo $od_mobile; ?>
|
||||
<?php echo $od_paytype; ?>
|
||||
</td>
|
||||
<td headers="th_odrer" class="td_name"><?php echo $mb_nick; ?></td>
|
||||
<td headers="th_odrertel" class="td_tel"><?php echo get_text($row['od_tel']); ?></td>
|
||||
<td headers="th_recvr" class="td_name"><a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?sort1=<?php echo $sort1; ?>&sort2=<?php echo $sort2; ?>&sel_field=od_b_name&search=<?php echo get_text($row['od_b_name']); ?>"><?php echo get_text($row['od_b_name']); ?></a></td>
|
||||
<td rowspan="3" class="td_numsum"><?php echo number_format($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']); ?></td>
|
||||
<td rowspan="3" class="td_numincome"><?php echo number_format($row['od_receipt_price']); ?></td>
|
||||
<td rowspan="3" class="td_numcancel<?php echo $td_color; ?>"><?php echo number_format($row['od_cancel_price']); ?></td>
|
||||
<td rowspan="3" class="td_numcoupon"><?php echo number_format($row['couponprice']); ?></td>
|
||||
<td rowspan="3" class="td_numrdy"><?php echo number_format($row['od_misu']); ?></td>
|
||||
<td rowspan="3" class="td_mngsmall">
|
||||
<a href="./orderform.php?od_id=<?php echo $row['od_id']; ?>&<?php echo $qstr; ?>" class="mng_mod"><span class="sound_only"><?php echo $row['od_id']; ?> </span>보기</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<!-- <td headers="th_odrdate"><span class="sound_only">주문일시 </span><?php echo $row['od_time']; ?></td> -->
|
||||
<!-- <td class="td_payby">
|
||||
<input type="hidden" name="current_settle_case[<?php echo $i ?>]" value="<?php echo $row['od_settle_case'] ?>">
|
||||
<?php echo $s_receipt_way; ?>
|
||||
</td> -->
|
||||
<!-- <td headers="th_odrid" class="td_name"><a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?sort1=<?php echo $sort1; ?>&sort2=<?php echo $sort2; ?>&sel_field=mb_id&search=<?php echo $row['mb_id']; ?>"><?php echo $row['mb_id']; ?></a></td> -->
|
||||
<td headers="th_odrid">
|
||||
<?php if ($row['mb_id']) { ?>
|
||||
<a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?sort1=<?php echo $sort1; ?>&sort2=<?php echo $sort2; ?>&sel_field=mb_id&search=<?php echo $row['mb_id']; ?>"><?php echo $row['mb_id']; ?></a>
|
||||
<?php } else { ?>
|
||||
비회원
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td headers="th_odrcnt"><?php echo $row['od_cart_count']; ?>건</td>
|
||||
<td headers="th_odrall"><?php echo $od_cnt; ?>건</td>
|
||||
</tr>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td headers="th_odrstat" class="td_odrstatus">
|
||||
<input type="hidden" name="current_status[<?php echo $i ?>]" value="<?php echo $row['od_status'] ?>">
|
||||
<?php echo $row['od_status']; ?>
|
||||
</td>
|
||||
<td headers="th_odrpay" class="td_payby">
|
||||
<input type="hidden" name="current_settle_case[<?php echo $i ?>]" value="<?php echo $row['od_settle_case'] ?>">
|
||||
<?php echo $s_receipt_way; ?>
|
||||
</td>
|
||||
<td headers="th_delino" class="td_delino">
|
||||
<?php if ($od_status == '준비') { ?>
|
||||
<input type="text" name="od_invoice[<?php echo $i; ?>]" value="<?php echo $row['od_invoice']; ?>" class="frm_input" size="10">
|
||||
<?php } else {
|
||||
echo ($row['od_invoice'] ? $row['od_invoice'] : '-');
|
||||
} ?>
|
||||
</td>
|
||||
<td headers="th_delicom">
|
||||
<?php if ($od_status == '준비') { ?>
|
||||
<select name="od_delivery_company[<?php echo $i; ?>]">
|
||||
<?php echo get_delivery_company($delivery_company); ?>
|
||||
</select>
|
||||
<?php } else {
|
||||
echo ($row['od_delivery_company'] ? $row['od_delivery_company'] : '-');
|
||||
} ?>
|
||||
</td>
|
||||
<td headers="th_delidate">
|
||||
<?php if ($od_status == '준비') { ?>
|
||||
<input type="text" name="od_invoice_time[<?php echo $i; ?>]" value="<?php echo $invoice_time; ?>" class="frm_input" size="10" maxlength="19">
|
||||
<?php } else {
|
||||
echo (is_null_time($row['od_invoice_time']) ? '-' : substr($row['od_invoice_time'],2,14));
|
||||
} ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$tot_itemcount += $row['od_cart_count'];
|
||||
$tot_orderprice += ($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']);
|
||||
$tot_ordercancel += $row['od_cancel_price'];
|
||||
$tot_receiptprice += $row['od_receipt_price'];
|
||||
$tot_couponprice += $row['couponprice'];
|
||||
$tot_misu += $row['od_misu'];
|
||||
}
|
||||
mysql_free_result($result);
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="12" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="orderlist">
|
||||
<th scope="row" colspan="3"> </th>
|
||||
<td> </td>
|
||||
<td><?php echo number_format($tot_itemcount); ?>건</td>
|
||||
<th scope="row">합 계</th>
|
||||
<td><?php echo number_format($tot_orderprice); ?></td>
|
||||
<td><?php echo number_format($tot_receiptprice); ?></td>
|
||||
<td><?php echo number_format($tot_ordercancel); ?></td>
|
||||
<td><?php echo number_format($tot_couponprice); ?></td>
|
||||
<td><?php echo number_format($tot_misu); ?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="local_cmd01 local_cmd">
|
||||
<?php if (($od_status == '' || $od_status == '완료' || $od_status == '전체취소' || $od_status == '부분취소') == false) {
|
||||
// 검색된 주문상태가 '전체', '완료', '전체취소', '부분취소' 가 아니라면
|
||||
?>
|
||||
<label for="od_status" class="cmd_tit">주문상태 변경</label>
|
||||
<?php
|
||||
$change_status = "";
|
||||
if ($od_status == '주문') $change_status = "입금";
|
||||
if ($od_status == '입금') $change_status = "준비";
|
||||
if ($od_status == '준비') $change_status = "배송";
|
||||
if ($od_status == '배송') $change_status = "완료";
|
||||
?>
|
||||
<label><input type="checkbox" name="od_status" value="<?php echo $change_status; ?>"> '<?php echo $od_status ?>'상태에서 '<strong><?php echo $change_status ?></strong>'상태로 변경합니다.</label>
|
||||
<?php if($od_status == '주문' || $od_status == '준비') { ?>
|
||||
<input type="checkbox" name="od_send_mail" value="1" id="od_send_mail" checked="checked">
|
||||
<label for="od_send_mail"><?php echo $change_status; ?>안내 메일</label>
|
||||
<input type="checkbox" name="send_sms" value="1" id="od_send_sms" checked="checked">
|
||||
<label for="od_send_sms"><?php echo $change_status; ?>안내 SMS</label>
|
||||
<?php } ?>
|
||||
<?php if($od_status == '준비') { ?>
|
||||
<input type="checkbox" name="send_escrow" value="1" id="od_send_escrow">
|
||||
<label for="od_send_escrow">에스크로배송등록</label>
|
||||
<?php } ?>
|
||||
<input type="submit" value="선택수정" class="btn_submit" onclick="document.pressed=this.value">
|
||||
<?php } ?>
|
||||
<?php if ($od_status == '주문') { ?> <span>주문상태에서만 삭제가 가능합니다.</span> <input type="submit" value="선택삭제" class="btn_submit" onclick="document.pressed=this.value"><?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="local_desc02 local_desc">
|
||||
<p>
|
||||
<무통장>인 경우에만 <주문>에서 <입금>으로 변경됩니다. 가상계좌는 입금시 자동으로 <입금>처리됩니다.<br>
|
||||
<준비>에서 <배송>으로 변경시 <에스크로배송등록>을 체크하시면 에스크로 주문에 한해 PG사에 배송정보가 자동 등록됩니다.<br>
|
||||
<strong>주의!</strong> 주문번호를 클릭하여 나오는 주문상세내역의 주소를 외부에서 조회가 가능한곳에 올리지 마십시오.
|
||||
</p>
|
||||
</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="); ?>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#fr_date, #to_date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", showButtonPanel: true, yearRange: "c-99:c+99", maxDate: "+0d" });
|
||||
|
||||
// 주문상품보기
|
||||
$(".orderitem").on("click", function() {
|
||||
var $this = $(this);
|
||||
var od_id = $this.text().replace(/[^0-9]/g, "");
|
||||
|
||||
if($this.next("#orderitemlist").size())
|
||||
return false;
|
||||
|
||||
$("#orderitemlist").remove();
|
||||
|
||||
$.post(
|
||||
"./ajax.orderitem.php",
|
||||
{ od_id: od_id },
|
||||
function(data) {
|
||||
$this.after("<div id=\"orderitemlist\"><div class=\"itemlist\"></div></div>");
|
||||
$("#orderitemlist .itemlist")
|
||||
.html(data)
|
||||
.append("<div id=\"orderitemlist_close\"><button type=\"button\" id=\"orderitemlist-x\" class=\"btn_frmline\">닫기</button></div>");
|
||||
}
|
||||
);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// 상품리스트 닫기
|
||||
$(".orderitemlist-x").on("click", function() {
|
||||
$("#orderitemlist").remove();
|
||||
});
|
||||
|
||||
$("body").on("click", function() {
|
||||
$("#orderitemlist").remove();
|
||||
});
|
||||
|
||||
// 엑셀배송처리창
|
||||
$("#order_delivery").on("click", function() {
|
||||
var opt = "width=600,height=450,left=10,top=10";
|
||||
window.open(this.href, "win_excel", opt);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
function set_date(today)
|
||||
{
|
||||
<?php
|
||||
$date_term = date('w', G5_SERVER_TIME);
|
||||
$week_term = $date_term + 7;
|
||||
$last_term = strtotime(date('Y-m-01', G5_SERVER_TIME));
|
||||
?>
|
||||
if (today == "오늘") {
|
||||
document.getElementById("fr_date").value = "<?php echo G5_TIME_YMD; ?>";
|
||||
document.getElementById("to_date").value = "<?php echo G5_TIME_YMD; ?>";
|
||||
} else if (today == "어제") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME - 86400); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME - 86400); ?>";
|
||||
} else if (today == "이번주") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-d', strtotime('-'.$date_term.' days', G5_SERVER_TIME)); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME); ?>";
|
||||
} else if (today == "이번달") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-01', G5_SERVER_TIME); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-d', G5_SERVER_TIME); ?>";
|
||||
} else if (today == "지난주") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-d', strtotime('-'.$week_term.' days', G5_SERVER_TIME)); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-d', strtotime('-'.($week_term - 6).' days', G5_SERVER_TIME)); ?>";
|
||||
} else if (today == "지난달") {
|
||||
document.getElementById("fr_date").value = "<?php echo date('Y-m-01', strtotime('-1 Month', $last_term)); ?>";
|
||||
document.getElementById("to_date").value = "<?php echo date('Y-m-t', strtotime('-1 Month', $last_term)); ?>";
|
||||
} else if (today == "전체") {
|
||||
document.getElementById("fr_date").value = "";
|
||||
document.getElementById("to_date").value = "";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function forderlist_submit(f)
|
||||
{
|
||||
if (!is_checked("chk[]")) {
|
||||
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
switch (f.od_status.value) {
|
||||
case "" :
|
||||
alert("변경하실 주문상태를 선택하세요.");
|
||||
return false;
|
||||
case '주문' :
|
||||
|
||||
default :
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
if(document.pressed == "선택삭제") {
|
||||
if(confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
|
||||
f.action = "./orderlistdelete.php";
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
var change_status = f.od_status.value;
|
||||
|
||||
if (f.od_status.checked == false) {
|
||||
alert("주문상태 변경에 체크하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var chk = document.getElementsByName("chk[]");
|
||||
|
||||
for (var i=0; i<chk.length; i++)
|
||||
{
|
||||
if (chk[i].checked)
|
||||
{
|
||||
var k = chk[i].value;
|
||||
var current_settle_case = f.elements['current_settle_case['+k+']'].value;
|
||||
var current_status = f.elements['current_status['+k+']'].value;
|
||||
|
||||
switch (change_status)
|
||||
{
|
||||
case "입금" :
|
||||
if (!(current_status == "주문" && current_settle_case == "무통장")) {
|
||||
alert("'주문' 상태의 '무통장'(결제수단)인 경우에만 '입금' 처리 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case "준비" :
|
||||
if (current_status != "입금") {
|
||||
alert("'입금' 상태의 주문만 '준비'로 변경이 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case "배송" :
|
||||
if (current_status != "준비") {
|
||||
alert("'준비' 상태의 주문만 '배송'으로 변경이 가능합니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var invoice = f.elements['od_invoice['+k+']'];
|
||||
var invoice_time = f.elements['od_invoice_time['+k+']'];
|
||||
var delivery_company = f.elements['od_delivery_company['+k+']'];
|
||||
|
||||
if ($.trim(invoice_time.value) == '') {
|
||||
alert("배송일시를 입력하시기 바랍니다.");
|
||||
invoice_time.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($.trim(delivery_company.value) == '') {
|
||||
alert("배송업체를 입력하시기 바랍니다.");
|
||||
delivery_company.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($.trim(invoice.value) == '') {
|
||||
alert("운송장번호를 입력하시기 바랍니다.");
|
||||
invoice.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!confirm("선택하신 주문서의 주문상태를 '"+change_status+"'상태로 변경하시겠습니까?"))
|
||||
return false;
|
||||
|
||||
f.action = "./orderlistupdate.php";
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
42
adm/shop_admin/orderlistdelete.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
$sub_menu = '400400';
|
||||
include_once('./_common.php');
|
||||
|
||||
//print_r2($_POST); exit;
|
||||
|
||||
for ($i=0; $i<count($_POST['chk']); $i++)
|
||||
{
|
||||
// 실제 번호를 넘김
|
||||
$k = $_POST['chk'][$i];
|
||||
$od_id = $_POST['od_id'][$k];
|
||||
|
||||
$od = sql_fetch(" select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ");
|
||||
if (!$od) continue;
|
||||
|
||||
// 주문상태가 주문이 아니면 건너뜀
|
||||
if($od['od_status'] != '주문') continue;
|
||||
|
||||
$data = serialize($od);
|
||||
|
||||
$sql = " insert {$g5['g5_shop_order_delete_table']} set de_key = '$od_id', de_data = '".addslashes($data)."', mb_id = '{$member['mb_id']}', de_ip = '{$_SERVER['REMOTE_ADDR']}', de_datetime = '".G5_TIME_YMDHIS."' ";
|
||||
sql_query($sql, true);
|
||||
|
||||
// cart 테이블의 상품 상태를 삭제로 변경
|
||||
$sql = " update {$g5['g5_shop_cart_table']} set ct_status = '삭제' where od_id = '$od_id' and ct_status = '주문' ";
|
||||
sql_query($sql);
|
||||
|
||||
$sql = " delete from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
$qstr = "sort1=$sort1&sort2=$sort2&sel_field=$sel_field&search=$search";
|
||||
$qstr .= "&od_status=$search_od_status";
|
||||
$qstr .= "&od_settle_case=$od_settle_case";
|
||||
$qstr .= "&od_misu=$od_misu";
|
||||
$qstr .= "&od_cancel_price=$od_cancel_price";
|
||||
$qstr .= "&od_receipt_price=$od_receipt_price";
|
||||
$qstr .= "&od_receipt_point=$od_receipt_point";
|
||||
$qstr .= "&od_receipt_coupon=$od_receipt_coupon";
|
||||
|
||||
goto_url("./orderlist.php?$qstr");
|
||||
?>
|
||||
171
adm/shop_admin/orderlistupdate.php
Normal file
@ -0,0 +1,171 @@
|
||||
<?php
|
||||
$sub_menu = '400400';
|
||||
include_once('./_common.php');
|
||||
include_once('./admin.shop.lib.php');
|
||||
include_once(G5_LIB_PATH.'/mailer.lib.php');
|
||||
include_once(G5_LIB_PATH.'/icode.sms.lib.php');
|
||||
|
||||
define("_ORDERMAIL_", true);
|
||||
|
||||
//print_r2($_POST); exit;
|
||||
|
||||
$sms_count = 0;
|
||||
if($config['cf_sms_use'] == 'icode' && $_POST['send_sms'])
|
||||
{
|
||||
$SMS = new SMS;
|
||||
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
|
||||
}
|
||||
|
||||
for ($i=0; $i<count($_POST['chk']); $i++)
|
||||
{
|
||||
// 실제 번호를 넘김
|
||||
$k = $_POST['chk'][$i];
|
||||
$od_id = $_POST['od_id'][$k];
|
||||
|
||||
$invoice = $_POST['od_invoice'][$k];
|
||||
$invoice_time = $_POST['od_invoice_time'][$k];
|
||||
$delivery_company = $_POST['od_delivery_company'][$k];
|
||||
|
||||
$od = sql_fetch(" select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ");
|
||||
if (!$od) continue;
|
||||
|
||||
//change_order_status($od['od_status'], $_POST['od_status'], $od);
|
||||
//echo $od_id . "<br>";
|
||||
|
||||
$current_status = $od['od_status'];
|
||||
$change_status = $_POST['od_status'];
|
||||
|
||||
switch ($current_status)
|
||||
{
|
||||
case '주문' :
|
||||
if ($change_status != '입금') continue;
|
||||
if ($od['od_settle_case'] != '무통장') continue;
|
||||
change_status($od_id, '주문', '입금');
|
||||
order_update_receipt($od_id);
|
||||
|
||||
// SMS
|
||||
if($config['cf_sms_use'] == 'icode' && $_POST['send_sms'] && $default['de_sms_use4']) {
|
||||
$sms_contents = conv_sms_contents($od_id, $default['de_sms_cont4']);
|
||||
if($sms_contents) {
|
||||
$receive_number = preg_replace("/[^0-9]/", "", $od['od_hp']); // 수신자번호
|
||||
$send_number = preg_replace("/[^0-9]/", "", $default['de_admin_company_tel']); // 발신자번호
|
||||
|
||||
if($receive_number && $send_number) {
|
||||
$SMS->Add($receive_number, $send_number, $config['cf_icode_id'], $sms_contents, "");
|
||||
$sms_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 메일
|
||||
if($config['cf_email_use'] && $_POST['od_send_mail'])
|
||||
include './ordermail.inc.php';
|
||||
|
||||
break;
|
||||
|
||||
case '입금' :
|
||||
if ($change_status != '준비') continue;
|
||||
change_status($od_id, '입금', '준비');
|
||||
break;
|
||||
|
||||
case '준비' :
|
||||
if ($change_status != '배송') continue;
|
||||
|
||||
$delivery['invoice'] = $invoice;
|
||||
$delivery['invoice_time'] = $invoice_time;
|
||||
$delivery['delivery_company'] = $delivery_company;
|
||||
|
||||
order_update_delivery($od_id, $od['mb_id'], $change_status, $delivery);
|
||||
change_status($od_id, '준비', '배송');
|
||||
|
||||
// SMS
|
||||
if($config['cf_sms_use'] == 'icode' && $_POST['send_sms'] && $default['de_sms_use5']) {
|
||||
$sms_contents = conv_sms_contents($od_id, $default['de_sms_cont5']);
|
||||
if($sms_contents) {
|
||||
$receive_number = preg_replace("/[^0-9]/", "", $od['od_hp']); // 수신자번호
|
||||
$send_number = preg_replace("/[^0-9]/", "", $default['de_admin_company_tel']); // 발신자번호
|
||||
|
||||
if($receive_number && $send_number) {
|
||||
$SMS->Add($receive_number, $send_number, $config['cf_icode_id'], $sms_contents, "");
|
||||
$sms_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 메일
|
||||
if($config['cf_email_use'] && $_POST['od_send_mail'])
|
||||
include './ordermail.inc.php';
|
||||
|
||||
// 에스크로 배송
|
||||
if($_POST['send_escrow'] && $od['od_tno'] && $od['od_escrow']) {
|
||||
$escrow_tno = $od['od_tno'];
|
||||
$escrow_numb = $invoice;
|
||||
$escrow_corp = $delivery_company;
|
||||
|
||||
include(G5_SHOP_PATH.'/'.$od['od_pg'].'/escrow.register.php');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case '배송' :
|
||||
if ($change_status != '완료') continue;
|
||||
change_status($od_id, '배송', '완료');
|
||||
|
||||
// 완료인 경우에만 상품구입 합계수량을 상품테이블에 저장한다.
|
||||
$sql2 = " select it_id from {$g5['g5_shop_cart_table']} where od_id = '$od_id' and ct_status = '완료' group by it_id ";
|
||||
$result2 = sql_query($sql2);
|
||||
for ($k=0; $row2=sql_fetch_array($result2); $k++) {
|
||||
$sql3 = " select sum(ct_qty) as sum_qty from {$g5['g5_shop_cart_table']} where it_id = '{$row2['it_id']}' and ct_status = '완료' ";
|
||||
$row3 = sql_fetch($sql3);
|
||||
|
||||
$sql4 = " update {$g5['g5_shop_item_table']} set it_sum_qty = '{$row3['sum_qty']}' where it_id = '{$row2['it_id']}' ";
|
||||
sql_query($sql4);
|
||||
}
|
||||
/*
|
||||
$sql2 = " select it_id, sum(ct_qty) as sum_qty from {$g5['g5_shop_cart_table']} where od_id = '$od_id' and ct_status = '완료' group by it_id ";
|
||||
$result2 = sql_query($sql2);
|
||||
for ($k=0; $row2=sql_fetch_array($result2); $k++) {
|
||||
$sql3 = " update {$g5['g5_shop_item_table']} set it_sum_qty = it_sum_qty + '{$row2['sum_qty']}' where it_id = '{$row2['it_id']}' ";
|
||||
sql_query($sql3);
|
||||
}
|
||||
*/
|
||||
break;
|
||||
|
||||
} // switch end
|
||||
|
||||
|
||||
// 주문정보
|
||||
$info = get_order_info($od_id);
|
||||
if(!$info) continue;
|
||||
|
||||
$sql = " update {$g5['g5_shop_order_table']}
|
||||
set od_misu = '{$info['od_misu']}',
|
||||
od_tax_mny = '{$info['od_tax_mny']}',
|
||||
od_vat_mny = '{$info['od_vat_mny']}',
|
||||
od_free_mny = '{$info['od_free_mny']}',
|
||||
od_send_cost = '{$info['od_send_cost']}'
|
||||
where od_id = '$od_id' ";
|
||||
sql_query($sql, true);
|
||||
|
||||
}
|
||||
|
||||
// SMS
|
||||
if($config['cf_sms_use'] == 'icode' && $_POST['send_sms'] && $sms_count)
|
||||
{
|
||||
$SMS->Send();
|
||||
}
|
||||
|
||||
$qstr = "sort1=$sort1&sort2=$sort2&sel_field=$sel_field&search=$search";
|
||||
$qstr .= "&od_status=$od_status";
|
||||
$qstr .= "&od_settle_case=$od_settle_case";
|
||||
$qstr .= "&od_misu=$od_misu";
|
||||
$qstr .= "&od_cancel_price=$od_cancel_price";
|
||||
$qstr .= "&od_receipt_price=$od_receipt_price";
|
||||
$qstr .= "&od_receipt_point=$od_receipt_point";
|
||||
$qstr .= "&od_receipt_coupon=$od_receipt_coupon";
|
||||
//$qstr .= "&page=$page";
|
||||
|
||||
//exit;
|
||||
|
||||
goto_url("./orderlist.php?$qstr");
|
||||
?>
|
||||
109
adm/shop_admin/ordermail.inc.php
Normal file
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
// 제대로된 include 시에만 실행
|
||||
if (!defined("_ORDERMAIL_")) exit;
|
||||
|
||||
// 주문자님께 메일발송 체크를 했다면
|
||||
if ($od_send_mail)
|
||||
{
|
||||
$od = sql_fetch(" select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ");
|
||||
|
||||
$addmemo = nl2br(stripslashes($addmemo));
|
||||
|
||||
unset($cart_list);
|
||||
unset($card_list);
|
||||
unset($bank_list);
|
||||
unset($point_list);
|
||||
unset($delivery_list);
|
||||
|
||||
$sql = " select *
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where od_id = '{$od['od_id']}'
|
||||
order by ct_id ";
|
||||
$result = sql_query($sql);
|
||||
for ($j=0; $ct=mysql_fetch_array($result); $j++) {
|
||||
$cart_list[$j]['it_id'] = $ct['it_id'];
|
||||
$cart_list[$j]['it_name'] = $ct['it_name'];
|
||||
$cart_list[$j]['it_opt'] = $ct['ct_option'];
|
||||
|
||||
$ct_status = $ct['ct_status'];
|
||||
if ($ct_status == "준비") {
|
||||
$ct_status = "상품준비중";
|
||||
} else if ($ct_status == "배송") {
|
||||
$ct_status = "배송중";
|
||||
}
|
||||
|
||||
$cart_list[$j]['ct_status'] = $ct_status;
|
||||
$cart_list[$j]['ct_qty'] = $ct['ct_qty'];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** 입금정보
|
||||
*/
|
||||
$is_receipt = false;
|
||||
|
||||
// 신용카드 입금
|
||||
if ($od['od_receipt_price'] > 0 && $od['od_settle_case'] == '신용카드') {
|
||||
$card_list['od_receipt_time'] = $od['od_receipt_time'];
|
||||
$card_list['od_receipt_price'] = display_price($od['od_receipt_price']);
|
||||
|
||||
$is_receipt = true;
|
||||
}
|
||||
|
||||
// 무통장 입금
|
||||
if ($od['od_receipt_price'] > 0 && $od['od_settle_case'] == '무통장') {
|
||||
$bank_list['od_receipt_time'] = $od['od_receipt_time'];
|
||||
$bank_list['od_receipt_price'] = display_price($od['od_receipt_price']);
|
||||
$bank_list['od_deposit_name'] = $od['od_deposit_name'];
|
||||
|
||||
$is_receipt = true;
|
||||
}
|
||||
|
||||
// 포인트 입금
|
||||
if ($od['od_receipt_point'] > 0) {
|
||||
$point_list['od_time'] = $od['od_time'];
|
||||
$point_list['od_receipt_point'] = display_point($od['od_receipt_point']);
|
||||
|
||||
$is_receipt = true;
|
||||
}
|
||||
|
||||
// 배송정보
|
||||
$is_delivery = false;
|
||||
if ($od['od_delivery_company'] && $od['od_invoice']) {
|
||||
$delivery_list['dl_company'] = $od['od_delivery_company'];
|
||||
$delivery_list['od_invoice'] = $od['od_invoice'];
|
||||
$delivery_list['od_invoice_time'] = $od['od_invoice_time'];
|
||||
$delivery_list['dl_inquiry'] = get_delivery_inquiry($od['od_delivery_company'], $od['od_invoice'], 'dvr_link');
|
||||
|
||||
$is_delivery = true;
|
||||
}
|
||||
|
||||
// 입금 또는 배송내역이 있다면 메일 발송
|
||||
if ($is_receipt || $is_delivery)
|
||||
{
|
||||
ob_start();
|
||||
include G5_SHOP_PATH.'/mail/ordermail.mail.php';
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
$title = $config['cf_title'].' - '.$od['od_name'].'님 주문 처리 내역 안내';
|
||||
$email = $od['od_email'];
|
||||
|
||||
// 메일 보낸 내역 상점메모에 update
|
||||
$od_shop_memo = G5_TIME_YMDHIS.' - 결제/배송내역 메일발송\n' . $od['od_shop_memo'];
|
||||
/* 1.00.06
|
||||
** 주석처리 - 처리하지 않음
|
||||
if ($receipt_check)
|
||||
$od_shop_memo .= ", 입금확인";
|
||||
if ($invoice_check)
|
||||
$od_shop_memo .= ", 송장번호";
|
||||
*/
|
||||
|
||||
sql_query(" update {$g5['g5_shop_order_table']} set od_shop_memo = '$od_shop_memo' where od_id = '$od_id' ");
|
||||
|
||||
mailer($config['cf_admin_email_name'], $config['cf_admin_email'], $email, $title, $content, 1);
|
||||
}
|
||||
}
|
||||
?>
|
||||
104
adm/shop_admin/orderpartcancel.php
Normal file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
$sub_menu = '400400';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
|
||||
$od = sql_fetch($sql);
|
||||
|
||||
if(!$od['od_id'])
|
||||
alert_close('주문정보가 존해하지 않습니다.');
|
||||
|
||||
if($od['od_pg'] == 'inicis' && $od['od_settle_case'] == '계좌이체')
|
||||
alert_close('KG이니시스는 신용카드만 부분취소가 가능합니다.');
|
||||
|
||||
if($od['od_settle_case'] == '계좌이체' && substr($od['od_receipt_time'], 0, 10) >= G5_TIME_YMD)
|
||||
alert_close('실시간 계좌이체건의 부분취소 요청은 결제일 익일에 가능합니다.');
|
||||
|
||||
if($od['od_receipt_price'] - $od['od_refund_price'] <= 0)
|
||||
alert_close('부분취소 처리할 금액이 없습니다.');
|
||||
|
||||
$g5['title'] = $od['od_settle_case'].' 부분취소';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
// 취소가능금액
|
||||
$od_misu = abs($od['od_misu']);
|
||||
?>
|
||||
|
||||
<form name="forderpartcancel" method="post" action="./orderpartcancelupdate.php" onsubmit="return form_check(this);">
|
||||
<input type="hidden" name="od_id" value="<?php echo $od_id; ?>">
|
||||
|
||||
<div class="new_win">
|
||||
<h1><?php echo $od['od_settle_case']; ?> 부분취소</h1>
|
||||
|
||||
<div class="tbl_frm01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 입력</caption>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">취소가능 금액</th>
|
||||
<td><?php echo display_price($od_misu); ?></td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="mod_tax_mny">과세 취소금액</label></th>
|
||||
<td><input type="text" name="mod_tax_mny" value="" id="mod_tax_mny" class="frm_input"> 원</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="mod_free_mny">비과세 취소금액</label></th>
|
||||
<td><input type="text" name="mod_free_mny" value="" id="mod_free_mny" class="frm_input"> 원</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="mod_memo">요청사유</label></th>
|
||||
<td><input type="text" name="mod_memo" id="mod_memo" required class="required frm_input" size="50"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" value="확인" class="btn_submit" accesskey="s">
|
||||
<button type="button" onclick="self.close();">닫기</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function form_check(f)
|
||||
{
|
||||
var max_mny = parseInt(<?php echo $od_misu; ?>);
|
||||
var tax_mny = parseInt(f.mod_tax_mny.value.replace("/[^0-9]/g", ""));
|
||||
var free_mny = parseInt(f.mod_free_mny.value.replace("/[^0-9]/g", ""));
|
||||
|
||||
if(!tax_mny && !free_mny) {
|
||||
alert("과세 취소금액 또는 비과세 취소금액을 입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if((tax_mny && free_mny) && (tax_mny + free_mny) > max_mny) {
|
||||
alert("과세, 비과세 취소금액의 합을 "+number_format(String(max_mny))+"원 이하로 입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(tax_mny && tax_mny > max_mny) {
|
||||
alert("과세 취소금액을 "+number_format(String(max_mny))+"원 이하로 입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(free_mny && free_mny > max_mny) {
|
||||
alert("비과세 취소금액을 "+number_format(String(max_mny))+"원 이하로 입력해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
52
adm/shop_admin/orderpartcancelupdate.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
$sub_menu = '400400';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "w");
|
||||
|
||||
$tax_mny = preg_replace('/[^0-9]/', '', $_POST['mod_tax_mny']);
|
||||
$free_mny = preg_replace('/[^0-9]/', '', $_POST['mod_free_mny']);
|
||||
|
||||
if(!$tax_mny && !$free_mny)
|
||||
alert('과세 취소금액 또는 비과세 취소금액을 입력해 주십시오.');
|
||||
|
||||
if(!trim($mod_memo))
|
||||
alert('요청사유를 입력해 주십시오.');
|
||||
|
||||
// 주문정보
|
||||
$sql = " select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
|
||||
$od = sql_fetch($sql);
|
||||
|
||||
if(!$od['od_id'])
|
||||
alert_close('주문정보가 존재하지 않습니다.');
|
||||
|
||||
if($od['od_settle_case'] == '계좌이체' && substr($od['od_receipt_time'], 0, 10) >= G5_TIME_YMD)
|
||||
alert_close('실시간 계좌이체건의 부분취소 요청은 결제일 익일에 가능합니다.');
|
||||
|
||||
// 금액비교
|
||||
$od_misu = abs($od['od_misu']);
|
||||
|
||||
if(($tax_mny && $free_mny) && ($tax_mny + $free_mny) > $od_misu)
|
||||
alert('과세, 비과세 취소금액의 합을 '.display_price($od_misu).' 이하로 입력해 주십시오.');
|
||||
|
||||
if($tax_mny && $tax_mny > $od_misu)
|
||||
alert('과세 취소금액을 '.display_price($od_misu).' 이하로 입력해 주십시오.');
|
||||
|
||||
if($free_mny && $free_mny > $od_misu)
|
||||
alert('비과세 취소금액을 '.display_price($od_misu).' 이하로 입력해 주십시오.');
|
||||
|
||||
// PG사별 부분취소 실행
|
||||
include_once(G5_SHOP_PATH.'/'.$od['od_pg'].'/orderpartcancel.inc.php');
|
||||
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
?>
|
||||
|
||||
<script>
|
||||
alert("<?php echo $od['od_settle_case']; ?> 부분취소 처리됐습니다.");
|
||||
opener.document.location.reload();
|
||||
self.close();
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
110
adm/shop_admin/orderprint.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
$sub_menu = '500120';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
$g5['title'] = '주문내역출력';
|
||||
include_once (G5_ADMIN_PATH.'/admin.head.php');
|
||||
include_once(G5_PLUGIN_PATH.'/jquery-ui/datepicker.php');
|
||||
?>
|
||||
|
||||
<div class="local_sch02 local_sch">
|
||||
|
||||
<div>
|
||||
<form name="forderprint" action="./orderprintresult.php" onsubmit="return forderprintcheck(this);" autocomplete="off">
|
||||
<input type="hidden" name="case" value="1">
|
||||
|
||||
<strong class="sch_long">기간별 출력</strong>
|
||||
<input type="radio" name="csv" value="xls" id="xls1">
|
||||
<label for="xls1">MS엑셀 XLS 데이터</label>
|
||||
<input type="radio" name="csv" value="csv" id="csv1">
|
||||
<label for="csv1">MS엑셀 CSV 데이터</label>
|
||||
<label for="ct_status_p" class="sound_only">출력대상</label>
|
||||
<select name="ct_status" id="ct_status_p">
|
||||
<option value="주문">주문</option>
|
||||
<option value="입금">입금</option>
|
||||
<option value="준비">준비</option>
|
||||
<option value="배송">배송</option>
|
||||
<option value="완료">완료</option>
|
||||
<option value="취소">취소</option>
|
||||
<option value="반품">반품</option>
|
||||
<option value="품절">품절</option>
|
||||
<option value="">전체</option>
|
||||
</select>
|
||||
<label for="fr_date" class="sound_only">기간 시작일</label>
|
||||
<input type="text" name="fr_date" value="<?php echo date("Ymd"); ?>" id="fr_date" required class="required frm_input" size="10" maxlength="8">
|
||||
~
|
||||
<label for="to_date" class="sound_only">기간 종료일</label>
|
||||
<input type="text" name="to_date" value="<?php echo date("Ymd"); ?>" id="to_date" required class="required frm_input" size="10" maxlength="8">
|
||||
<input type="submit" value="출력 (새창)" class="btn_submit">
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="sch_last">
|
||||
|
||||
<form name="forderprint" action="./orderprintresult.php" onsubmit="return forderprintcheck(this);" autocomplete="off" >
|
||||
<input type="hidden" name="case" value="2">
|
||||
<strong class="sch_long">주문번호구간별 출력</strong>
|
||||
|
||||
<input type="radio" name="csv" value="xls" id="xls2">
|
||||
<label for="xls2">MS엑셀 XLS 데이터</label>
|
||||
<input type="radio" name="csv" value="csv" id="csv2">
|
||||
<label for="csv2">MS엑셀 CSV 데이터</label>
|
||||
<label for="ct_status_n" class="sound_only">출력대상</label>
|
||||
<select name="ct_status" id="ct_status_n">
|
||||
<option value="주문">주문</option>
|
||||
<option value="입금">입금</option>
|
||||
<option value="준비">준비</option>
|
||||
<option value="배송">배송</option>
|
||||
<option value="완료">완료</option>
|
||||
<option value="취소">취소</option>
|
||||
<option value="반품">반품</option>
|
||||
<option value="품절">품절</option>
|
||||
<option value="">전체</option>
|
||||
</select>
|
||||
<label for="fr_od_id" class="sound_only">주문번호 구간 시작</label>
|
||||
<input type="text" name="fr_od_id" id="fr_od_id" required class="required frm_input" size="10" maxlength="20">
|
||||
~
|
||||
<label for="fr_od_id" class="sound_only">주문번호 구간 종료</label>
|
||||
<input type="text" name="to_od_id" id="to_od_id" required class="required frm_input" size="10" maxlength="20">
|
||||
<input type="submit" value="출력 (새창)" class="btn_submit">
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="btn_add01 btn_add">
|
||||
<a href="./orderlist.php" class="btn_add01 btn_add_optional">주문내역</a>
|
||||
</div>
|
||||
|
||||
<div class="local_desc01 local_desc">
|
||||
<p>기간별 혹은 주문번호구간별 주문내역을 새창으로 출력할 수 있습니다.</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#fr_date, #to_date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yymmdd", showButtonPanel: true, yearRange: "c-99:c+99", maxDate: "+0d" });
|
||||
});
|
||||
|
||||
function forderprintcheck(f)
|
||||
{
|
||||
if (f.csv[0].checked || f.csv[1].checked)
|
||||
{
|
||||
f.target = "_top";
|
||||
}
|
||||
else
|
||||
{
|
||||
var win = window.open("", "winprint", "left=10,top=10,width=670,height=800,menubar=yes,toolbar=yes,scrollbars=yes");
|
||||
f.target = "winprint";
|
||||
}
|
||||
|
||||
f.submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once (G5_ADMIN_PATH.'/admin.tail.php');
|
||||
?>
|
||||
490
adm/shop_admin/orderprintresult.php
Normal file
@ -0,0 +1,490 @@
|
||||
<?php
|
||||
$sub_menu = '500120';
|
||||
include_once('./_common.php');
|
||||
|
||||
auth_check($auth[$sub_menu], "r");
|
||||
|
||||
//print_r2($_GET); exit;
|
||||
|
||||
/*
|
||||
function multibyte_digit($source)
|
||||
{
|
||||
$search = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
|
||||
$replace = array("0","1","2","3","4","5","6","7","8","9");
|
||||
return str_replace($search, $replace, (string)$source);
|
||||
}
|
||||
*/
|
||||
|
||||
function conv_telno($t)
|
||||
{
|
||||
// 숫자만 있고 0으로 시작하는 전화번호
|
||||
if (!preg_match("/[^0-9]/", $t) && preg_match("/^0/", $t)) {
|
||||
if (preg_match("/^01/", $t)) {
|
||||
$t = preg_replace("/([0-9]{3})(.*)([0-9]{4})/", "\\1-\\2-\\3", $t);
|
||||
} else if (preg_match("/^02/", $t)) {
|
||||
$t = preg_replace("/([0-9]{2})(.*)([0-9]{4})/", "\\1-\\2-\\3", $t);
|
||||
} else {
|
||||
$t = preg_replace("/([0-9]{3})(.*)([0-9]{4})/", "\\1-\\2-\\3", $t);
|
||||
}
|
||||
}
|
||||
|
||||
return $t;
|
||||
}
|
||||
|
||||
// 1.04.01
|
||||
// MS엑셀 CSV 데이터로 다운로드 받음
|
||||
if ($csv == 'csv')
|
||||
{
|
||||
$fr_date = date_conv($fr_date);
|
||||
$to_date = date_conv($to_date);
|
||||
|
||||
|
||||
$sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type
|
||||
FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b
|
||||
where a.od_id = b.od_id ";
|
||||
if ($case == 1) // 출력기간
|
||||
$sql .= " and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
|
||||
else // 주문번호구간
|
||||
$sql .= " and a.od_id between '$fr_od_id' and '$to_od_id' ";
|
||||
if ($ct_status)
|
||||
$sql .= " and b.ct_status = '$ct_status' ";
|
||||
$sql .=" order by od_time asc, b.it_id, b.io_type, b.ct_id ";
|
||||
$result = sql_query($sql);
|
||||
$cnt = @mysql_num_rows($result);
|
||||
if (!$cnt)
|
||||
alert("출력할 내역이 없습니다.");
|
||||
|
||||
//header('Content-Type: text/x-csv');
|
||||
header("Content-charset=utf-8");
|
||||
header('Content-Type: doesn/matter');
|
||||
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
header('Content-Disposition: attachment; filename="orderlist-' . date("ymd", time()) . '.csv"');
|
||||
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||
header('Pragma: public');
|
||||
//echo "우편번호,주소,이름,전화1,전화2,상품명,수량,비고,전하실말씀\n";
|
||||
echo iconv('utf-8', 'euc-kr', "우편번호,주소,이름,전화1,전화2,상품명,수량,선택사항,배송비,상품코드,주문번호,운송장번호,전하실말씀\n");
|
||||
|
||||
$save_it_id = '';
|
||||
for ($i=0; $row=mysql_fetch_array($result); $i++)
|
||||
{
|
||||
$row = array_map('iconv_euckr', $row);
|
||||
|
||||
if($save_it_id != $row['it_id']) {
|
||||
// 합계금액 계산
|
||||
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
|
||||
SUM(ct_qty) as qty
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where it_id = '{$row['it_id']}'
|
||||
and od_id = '{$row['od_id']}' ";
|
||||
$sum = sql_fetch($sql);
|
||||
|
||||
switch($row['ct_send_cost'])
|
||||
{
|
||||
case 1:
|
||||
$ct_send_cost = '착불';
|
||||
break;
|
||||
case 2:
|
||||
$ct_send_cost = '무료';
|
||||
break;
|
||||
default:
|
||||
$ct_send_cost = '선불';
|
||||
break;
|
||||
}
|
||||
|
||||
// 조건부무료
|
||||
if($row['it_sc_type'] == 2) {
|
||||
$sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $row['od_id']);
|
||||
|
||||
if($sendcost == 0)
|
||||
$ct_send_cost = '무료';
|
||||
}
|
||||
|
||||
$save_it_id = $row['it_id'];
|
||||
|
||||
$ct_send_cost = iconv_euckr($ct_send_cost);
|
||||
}
|
||||
|
||||
echo '"'.$row['od_b_zip1'].$row['od_b_zip2'].'"'.',';
|
||||
echo '"'.print_address($row['od_b_addr1'], $row['od_b_addr2'], $row['od_b_addr3'], $row['od_b_addr_jibeon']).'"'.',';
|
||||
echo '"'.$row['od_b_name'].'"'.',';
|
||||
//echo '"'.multibyte_digit((string)$row[od_b_tel]).'"'.',';
|
||||
//echo '"'.multibyte_digit((string)$row[od_b_hp]).'"'.',';
|
||||
echo '"'.conv_telno($row['od_b_tel']) . '"'.',';
|
||||
echo '"'.conv_telno($row['od_b_hp']) . '"'.',';
|
||||
echo '"'.preg_replace("/\"/", """, $row['it_name']) . '"'.',';
|
||||
echo '"'.$row['ct_qty'].'"'.',';
|
||||
echo '"'.$row['ct_option'].'"'.',';
|
||||
echo '"'.$ct_send_cost.'"'.',';
|
||||
echo '"\''.$row['it_id'].'\'"'.',';
|
||||
echo '"\''.$row['od_id'].'\'"'.',';
|
||||
echo '"'.$row['od_invoice'].'"'.',';
|
||||
//echo '"'.preg_replace("/\"/", """, preg_replace("/\n/", "", $row[od_memo])).'"';
|
||||
echo '"'.preg_replace("/\"/", """, $row['od_memo']).'"';
|
||||
echo "\n";
|
||||
}
|
||||
if ($i == 0)
|
||||
echo '자료가 없습니다.'.PHP_EOL;
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
// MS엑셀 XLS 데이터로 다운로드 받음
|
||||
if ($csv == 'xls')
|
||||
{
|
||||
$fr_date = date_conv($fr_date);
|
||||
$to_date = date_conv($to_date);
|
||||
|
||||
$sql = " SELECT a.od_id, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_addr3, od_b_addr_jibeon, od_b_name, od_b_tel, od_b_hp, b.it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice, b.ct_option, b.ct_send_cost, b.it_sc_type
|
||||
FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b
|
||||
where a.od_id = b.od_id ";
|
||||
if ($case == 1) // 출력기간
|
||||
$sql .= " and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
|
||||
else // 주문번호구간
|
||||
$sql .= " and a.od_id between '$fr_od_id' and '$to_od_id' ";
|
||||
if ($ct_status)
|
||||
$sql .= " and b.ct_status = '$ct_status' ";
|
||||
$sql .=" order by od_time asc, b.it_id, b.io_type, b.ct_id ";
|
||||
$result = sql_query($sql);
|
||||
$cnt = @mysql_num_rows($result);
|
||||
if (!$cnt)
|
||||
alert("출력할 내역이 없습니다.");
|
||||
|
||||
/*================================================================================
|
||||
php_writeexcel http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/
|
||||
=================================================================================*/
|
||||
|
||||
include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_workbook.inc.php');
|
||||
include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_worksheet.inc.php');
|
||||
|
||||
$fname = tempnam(G5_DATA_PATH, "tmp-orderlist.xls");
|
||||
$workbook = new writeexcel_workbook($fname);
|
||||
$worksheet = $workbook->addworksheet();
|
||||
|
||||
// Put Excel data
|
||||
$data = array('우편번호', '주소', '이름', '전화1', '전화2', '상품명', '수량', '선택사항', '배송비', '상품코드', '주문번호', '운송장번호', '전하실말씀');
|
||||
$data = array_map('iconv_euckr', $data);
|
||||
|
||||
$col = 0;
|
||||
foreach($data as $cell) {
|
||||
$worksheet->write(0, $col++, $cell);
|
||||
}
|
||||
|
||||
$save_it_id = '';
|
||||
for($i=1; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
if($save_it_id != $row['it_id']) {
|
||||
// 합계금액 계산
|
||||
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
|
||||
SUM(ct_qty) as qty
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where it_id = '{$row['it_id']}'
|
||||
and od_id = '{$row['od_id']}' ";
|
||||
$sum = sql_fetch($sql);
|
||||
|
||||
switch($row['ct_send_cost'])
|
||||
{
|
||||
case 1:
|
||||
$ct_send_cost = '착불';
|
||||
break;
|
||||
case 2:
|
||||
$ct_send_cost = '무료';
|
||||
break;
|
||||
default:
|
||||
$ct_send_cost = '선불';
|
||||
break;
|
||||
}
|
||||
|
||||
// 조건부무료
|
||||
if($row['it_sc_type'] == 2) {
|
||||
$sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $row['od_id']);
|
||||
|
||||
if($sendcost == 0)
|
||||
$ct_send_cost = '무료';
|
||||
}
|
||||
|
||||
$save_it_id = $row['it_id'];
|
||||
|
||||
$ct_send_cost = iconv_euckr($ct_send_cost);
|
||||
}
|
||||
|
||||
$row = array_map('iconv_euckr', $row);
|
||||
|
||||
$worksheet->write($i, 0, $row['od_b_zip1'].$row['od_b_zip2']);
|
||||
$worksheet->write($i, 1, print_address($row['od_b_addr1'], $row['od_b_addr2'], $row['od_b_addr3'], $row['od_b_addr_jibeon']));
|
||||
$worksheet->write($i, 2, $row['od_b_name']);
|
||||
$worksheet->write($i, 3, ' '.$row['od_b_tel']);
|
||||
$worksheet->write($i, 4, ' '.$row['od_b_hp']);
|
||||
$worksheet->write($i, 5, $row['it_name']);
|
||||
$worksheet->write($i, 6, $row['ct_qty']);
|
||||
$worksheet->write($i, 7, $row['ct_option']);
|
||||
$worksheet->write($i, 8, $ct_send_cost);
|
||||
$worksheet->write($i, 9, ' '.$row['it_id']);
|
||||
$worksheet->write($i, 10, ' '.$row['od_id']);
|
||||
$worksheet->write($i, 11, $row['od_invoice']);
|
||||
$worksheet->write($i, 12, $row['od_memo']);
|
||||
}
|
||||
|
||||
$workbook->close();
|
||||
|
||||
header("Content-Type: application/x-msexcel; name=\"orderlist-".date("ymd", time()).".xls\"");
|
||||
header("Content-Disposition: inline; filename=\"orderlist-".date("ymd", time()).".xls\"");
|
||||
$fh=fopen($fname, "rb");
|
||||
fpassthru($fh);
|
||||
unlink($fname);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
function get_order($od_id)
|
||||
{
|
||||
global $g5;
|
||||
|
||||
$sql = " select * from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
|
||||
return sql_fetch($sql);
|
||||
}
|
||||
|
||||
$g5['title'] = "주문내역";
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
if ($case == 1)
|
||||
{
|
||||
$fr_date = date_conv($fr_date);
|
||||
$to_date = date_conv($to_date);
|
||||
$sql = " SELECT DISTINCT a.od_id FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b
|
||||
where a.od_id = b.od_id
|
||||
and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = " SELECT DISTINCT a.od_id FROM {$g5['g5_shop_order_table']} a, {$g5['g5_shop_cart_table']} b
|
||||
where a.od_id = b.od_id
|
||||
and a.od_id between '$fr_od_id' and '$to_od_id' ";
|
||||
}
|
||||
if ($ct_status)
|
||||
$sql .= " and b.ct_status = '$ct_status' ";
|
||||
$sql .= " order by a.od_id ";
|
||||
$result = sql_query($sql);
|
||||
if (mysql_num_rows($result) == 0)
|
||||
{
|
||||
echo "<script>alert('출력할 내역이 없습니다.'); window.close();</script>";
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="sodr_print_pop" class="new_win">
|
||||
<h1>
|
||||
<?php
|
||||
if ($case == 1)
|
||||
echo $fr_date.' 부터 '.$to_date.' 까지 '.$ct_status.' 내역';
|
||||
else
|
||||
echo $fr_od_id.' 부터 '.$to_od_id.' 까지 '.$ct_status.' 내역';
|
||||
?>
|
||||
</h1>
|
||||
|
||||
<?php
|
||||
$mod = 10;
|
||||
$tot_total_price = 0;
|
||||
$save_it_id = '';
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$sql1 = " select * from {$g5['g5_shop_order_table']} where od_id = '{$row['od_id']}' ";
|
||||
$row1 = sql_fetch($sql1);
|
||||
|
||||
// 1.03.02
|
||||
$row1['od_addr'] = '('.$row1['od_zip1'].$row1['od_zip2'].') '.print_address($row1['od_addr1'], $row1['od_addr2'], $row1['od_addr3'], $row1['od_addr_jibeon']);
|
||||
$row1['od_b_addr'] = '('.$row1['od_b_zip1'].$row1['od_b_zip2'].') '.print_address($row1['od_b_addr1'], $row1['od_b_addr2'], $row1['od_b_addr3'], $row1['od_b_addr_jibeon']);
|
||||
|
||||
$row1['od_addr'] = ($row1['od_addr']) ? $row1['od_addr'] : '입력안함';
|
||||
$row1['od_tel'] = ($row1['od_tel']) ? $row1['od_tel'] : '입력안함';
|
||||
$row1['od_hp'] = ($row1['od_hp']) ? $row1['od_hp'] : '입력안함';
|
||||
$row1['od_b_tel'] = ($row1['od_b_tel']) ? $row1['od_b_tel'] : '입력안함';
|
||||
$row1['od_b_hp'] = ($row1['od_b_hp']) ? $row1['od_b_hp'] : '입력안함';
|
||||
|
||||
// 보내는 사람과 받는 사람이 완전 일치하면 간단하게 출력
|
||||
// 보내는 사람과 받는 사람이 부분 일치하더라도 원래 내용을 모두 출력
|
||||
// 지운아빠 2013-04-18
|
||||
if ($row1['od_name'] == $row1['od_b_name'] && $row1['od_addr'] == $row1['od_b_addr'] && $row1['od_tel'] == $row1['od_b_tel'] && $row1['od_hp'] == $row1['od_b_hp'] && $row1['od_hp'] != " ") $samesamesame = 1;
|
||||
else $samesamesame = '';
|
||||
|
||||
$od_memo = ($row1['od_memo']) ? get_text(stripslashes($row1['od_memo'])) : '';
|
||||
$od_shop_memo = ($row1['od_shop_memo']) ? get_text(stripslashes($row1['od_shop_memo'])) : '';
|
||||
?>
|
||||
<!-- 반복시작 - 지운아빠 2013-04-18 -->
|
||||
<div class="sodr_print_pop_list">
|
||||
<h2>주문번호 <?php echo $row1['od_id']; ?></h2>
|
||||
<h3>보내는 사람 : <?php echo get_text($row1['od_name']); ?></h3>
|
||||
|
||||
<dl>
|
||||
<dt>주소</dt>
|
||||
<dd><?php echo get_text($row1['od_addr']); ?></dd>
|
||||
<dt>휴대폰</dt>
|
||||
<dd><?php echo get_text($row1['od_hp']); ?></dd>
|
||||
<dt>전화번호</dt>
|
||||
<dd><?php echo get_text($row1['od_tel']); ?></dd>
|
||||
</dl>
|
||||
<?php if ($samesamesame) { ?>
|
||||
<p class="sodr_print_pop_same">보내는 사람과 받는 사람이 동일합니다.</p>
|
||||
<?php } else { ?>
|
||||
<h3>받는 사람 : <?php echo get_text($row1['od_b_name']); ?></h3>
|
||||
<dl>
|
||||
<dt>주소</dt>
|
||||
<dd><?php echo get_text($row1['od_b_addr']); ?></dd>
|
||||
<dt>휴대폰</dt>
|
||||
<dd><?php echo get_text($row1['od_b_hp']); ?></dd>
|
||||
<dt>전화번호</dt>
|
||||
<dd><?php echo get_text($row1['od_b_tel']); ?></dd>
|
||||
</dl>
|
||||
<?php } ?>
|
||||
|
||||
<h3>주문 목록</h3>
|
||||
<div class="tbl_head01">
|
||||
<table>
|
||||
<caption>주문 목록</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">상품명(선택사항)</th>
|
||||
<th scope="col">판매가</th>
|
||||
<th scope="col">수량</th>
|
||||
<th scope="col">소계</th>
|
||||
<th scope="col">배송비</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$sql2 = " select *
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where od_id = '{$row['od_id']}' ";
|
||||
if ($ct_status)
|
||||
$sql2 .= " and ct_status = '$ct_status' ";
|
||||
$sql2 .= " order by it_id, io_type, ct_id ";
|
||||
|
||||
$res2 = sql_query($sql2);
|
||||
$cnt = $sub_tot_qty = $sub_tot_price = 0;
|
||||
$save_it_id = '';
|
||||
|
||||
while ($row2 = sql_fetch_array($res2))
|
||||
{
|
||||
if($row2['io_type']) {
|
||||
$it_price = $row2['io_price'];
|
||||
$row2_tot_price = $row2['io_price'] * $row2['ct_qty'];
|
||||
} else {
|
||||
$it_price = $row2['ct_price'] + $row2['io_price'];
|
||||
$row2_tot_price = ($row2['ct_price'] + $row2['io_price']) * $row2['ct_qty'];
|
||||
}
|
||||
$sub_tot_qty += $row2['ct_qty'];
|
||||
$sub_tot_price += $row2_tot_price;
|
||||
|
||||
$it_name = stripslashes($row2['it_name']);
|
||||
$price_plus = '';
|
||||
if($row2['io_price'] >= 0)
|
||||
$price_plus = '+';
|
||||
|
||||
$it_name = "$it_name ({$row2['ct_option']} ".$price_plus.display_price($row2['io_price']).")";
|
||||
|
||||
if($save_it_id != $row2['it_id']) {
|
||||
switch($row2['ct_send_cost'])
|
||||
{
|
||||
case 1:
|
||||
$ct_send_cost = '착불';
|
||||
break;
|
||||
case 2:
|
||||
$ct_send_cost = '무료';
|
||||
break;
|
||||
default:
|
||||
$ct_send_cost = '선불';
|
||||
break;
|
||||
}
|
||||
|
||||
// 합계금액 계산
|
||||
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
|
||||
SUM(ct_qty) as qty
|
||||
from {$g5['g5_shop_cart_table']}
|
||||
where it_id = '{$row2['it_id']}'
|
||||
and od_id = '{$row2['od_id']}' ";
|
||||
$sum = sql_fetch($sql);
|
||||
|
||||
// 조건부무료
|
||||
if($row2['it_sc_type'] == 2) {
|
||||
$sendcost = get_item_sendcost($row2['it_id'], $sum['price'], $sum['qty'], $row['od_id']);
|
||||
|
||||
if($sendcost == 0)
|
||||
$ct_send_cost = '무료';
|
||||
}
|
||||
|
||||
$save_it_id = $row2['it_id'];
|
||||
}
|
||||
|
||||
$fontqty1 = $fontqty2 = "";
|
||||
if ($row2['ct_qty'] >= 2)
|
||||
{
|
||||
$fontqty1 = "<strong>";
|
||||
$fontqty2 = "</strong>";
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $it_name; ?></td>
|
||||
<td class="td_num"><?php echo number_format($it_price); ?></td>
|
||||
<td class="td_cntsmall"><?php echo $fontqty1; ?><?php echo number_format($row2['ct_qty']); ?><?php echo $fontqty2; ?></td>
|
||||
<td class="td_num td_numsum"><?php echo number_format($row2_tot_price); ?></td>
|
||||
<td class="td_sendcost_by"><?php echo $ct_send_cost; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
$cnt++;
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td>배송비</td>
|
||||
<td class="td_num"><?php echo number_format($row1['od_send_cost']); ?></td>
|
||||
<td class="td_cntsmall"><?php echo $fontqty1; ?>1<?php echo $fontqty2; ?></td>
|
||||
<td class="td_num td_numsum"><?php echo number_format($row1['od_send_cost']); ?></td>
|
||||
<td class="td_sendcost_by"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>추가 배송비</td>
|
||||
<td class="td_num"><?php echo number_format($row1['od_send_cost2']); ?></td>
|
||||
<td class="td_cntsmall"><?php echo $fontqty1; ?>1<?php echo $fontqty2; ?></td>
|
||||
<td class="td_num td_numsum"><?php echo number_format($row1['od_send_cost2']); ?></td>
|
||||
<td class="td_sendcost_by"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th scope="row" colspan="2">합계</th>
|
||||
<td><?php echo number_format($sub_tot_qty + 2); ?></td>
|
||||
<td><?php echo number_format($sub_tot_price + $row1['od_send_cost'] + $row1['od_send_cost2']); ?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
$tot_tot_qty += ($sub_tot_qty + 2);
|
||||
$tot_tot_price += ($sub_tot_price + $row1['od_send_cost'] + $row1['od_send_cost2']);
|
||||
|
||||
if ($od_memo) $od_memo = "<p><strong>비고</strong> $od_memo</p>";
|
||||
if ($od_shop_memo) $od_shop_memo = "<p><strong>상점메모</strong> $od_shop_memo</p>";
|
||||
|
||||
echo "
|
||||
$od_memo
|
||||
$od_shop_memo
|
||||
";
|
||||
?>
|
||||
</div>
|
||||
<!-- 반복 끝 -->
|
||||
<?php } ?>
|
||||
|
||||
<div id="sodr_print_pop_total">
|
||||
<span>
|
||||
전체
|
||||
<strong><?php echo number_format($tot_tot_qty); ?></strong>개
|
||||
<strong><?php echo number_format($tot_tot_price); ?></strong>원
|
||||
</span>
|
||||
<출력 끝>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
44
adm/shop_admin/ordersms.inc.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
if (!defined("_ORDERSMS_")) exit;
|
||||
|
||||
$receive_number = preg_replace("/[^0-9]/", "", $od_hp); // 수신자번호 (받는사람 핸드폰번호 ... 여기서는 주문자님의 핸드폰번호임)
|
||||
$send_number = preg_replace("/[^0-9]/", "", $default['de_admin_company_tel']); // 발신자번호
|
||||
|
||||
if ($config['cf_sms_use']) {
|
||||
if ($od_sms_ipgum_check && $default['de_sms_use4'])
|
||||
{
|
||||
if ($od_bank_account && $od_receipt_price && $od_deposit_name)
|
||||
{
|
||||
$sms_contents = $default['de_sms_cont4'];
|
||||
$sms_contents = str_replace("{이름}", $od_name, $sms_contents);
|
||||
$sms_contents = str_replace("{입금액}", number_format($od_receipt_price), $sms_contents);
|
||||
$sms_contents = str_replace("{주문번호}", $od_id, $sms_contents);
|
||||
$sms_contents = str_replace("{회사명}", $default['de_admin_company_name'], $sms_contents);
|
||||
|
||||
$SMS = new SMS;
|
||||
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
|
||||
$SMS->Add($receive_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_contents)), "");
|
||||
$SMS->Send();
|
||||
}
|
||||
}
|
||||
|
||||
if ($od_sms_baesong_check && $default['de_sms_use5'])
|
||||
{
|
||||
if ($od_delivery_company && $od_invoice)
|
||||
{
|
||||
$sms_contents = $default['de_sms_cont5'];
|
||||
$sms_contents = str_replace("{이름}", $od_name, $sms_contents);
|
||||
$sms_contents = str_replace("{택배회사}", $od_delivery_company, $sms_contents);
|
||||
$sms_contents = str_replace("{운송장번호}", $od_invoice, $sms_contents);
|
||||
$sms_contents = str_replace("{주문번호}", $od_id, $sms_contents);
|
||||
$sms_contents = str_replace("{회사명}", $default['de_admin_company_name'], $sms_contents);
|
||||
|
||||
$SMS = new SMS;
|
||||
$SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
|
||||
$SMS->Add($receive_number, $send_number, $config['cf_icode_id'], iconv("utf-8", "euc-kr", stripslashes($sms_contents)), "");
|
||||
$SMS->Send();
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||