diff --git a/adm/admin.menu500.shop_2of2.php b/adm/admin.menu500.shop_2of2.php
index d4e74b303..7e4dd3071 100644
--- a/adm/admin.menu500.shop_2of2.php
+++ b/adm/admin.menu500.shop_2of2.php
@@ -6,6 +6,7 @@ $menu['menu500'] = array (
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),
diff --git a/adm/shop_admin/itemform.php b/adm/shop_admin/itemform.php
index 6ea8ad487..281c855f2 100644
--- a/adm/shop_admin/itemform.php
+++ b/adm/shop_admin/itemform.php
@@ -88,6 +88,12 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
$script .= "ca_sell_email['{$row['ca_id']}'] = '{$row['ca_sell_email']}';\n";
}
+// 재입고알림 설정 필드 추가
+if(!sql_query(" select it_stock_sms from {$g5['g5_shop_item_table']} limit 1 ", false)) {
+ sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
+ ADD `it_stock_sms` tinyint(4) NOT NULL DEFAULT '0' AFTER `it_stock_qty` ", true);
+}
+
$pg_anchor ='
상품분류
기본정보
@@ -507,6 +513,13 @@ $(function(){
전체적용
+
+ 재입고SMS 알림
+
+
+ > 예
+
+
재고수량
diff --git a/adm/shop_admin/itemformupdate.php b/adm/shop_admin/itemformupdate.php
index 892ff19b8..cd25214af 100644
--- a/adm/shop_admin/itemformupdate.php
+++ b/adm/shop_admin/itemformupdate.php
@@ -292,6 +292,7 @@ $sql_common = " ca_id = '$ca_id',
it_use = '$it_use',
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',
diff --git a/adm/shop_admin/itemstocklist.php b/adm/shop_admin/itemstocklist.php
index 5d37432b9..a7bc1a4f4 100644
--- a/adm/shop_admin/itemstocklist.php
+++ b/adm/shop_admin/itemstocklist.php
@@ -39,7 +39,9 @@ $sql = " select it_id,
it_name,
it_use,
it_stock_qty,
- it_noti_qty
+ it_stock_sms,
+ it_noti_qty,
+ it_soldout
$sql_common
order by $sort1 $sort2
limit $from_record, $rows ";
@@ -118,6 +120,8 @@ $listall = '전체목록
가재고
재고수정
">판매
+ ">품절
+ ">재입고알림
관리
@@ -160,18 +164,20 @@ $listall = '전체목록
-
+
>
+ >
+ >
수정
자료가 없습니다. ';
+ echo '자료가 없습니다. ';
?>
diff --git a/adm/shop_admin/itemstocklistupdate.php b/adm/shop_admin/itemstocklistupdate.php
index ad8f379dc..f4580cd1a 100644
--- a/adm/shop_admin/itemstocklistupdate.php
+++ b/adm/shop_admin/itemstocklistupdate.php
@@ -11,7 +11,9 @@ for ($i=0; $idbconfig.php 파일에 $g5[\'g5_shop_item_stocksms_table\'] = G5_SHOP_TABLE_PREFIX.\'item_stocksms\'; 를 추가해 주세요.');
+
+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 == "") { $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 = '전체목록 ';
+?>
+
+
+
+ 전체 건, 미전송 건
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/adm/shop_admin/itemstocksmsupdate.php b/adm/shop_admin/itemstocksmsupdate.php
new file mode 100644
index 000000000..1368031de
--- /dev/null
+++ b/adm/shop_admin/itemstocksmsupdate.php
@@ -0,0 +1,86 @@
+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; $iAdd($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
diff --git a/adm/shop_admin/orderdeliveryupdate.php b/adm/shop_admin/orderdeliveryupdate.php
index 931788662..0a1dc0ed4 100644
--- a/adm/shop_admin/orderdeliveryupdate.php
+++ b/adm/shop_admin/orderdeliveryupdate.php
@@ -101,11 +101,13 @@ if($_FILES['excelfile']['tmp_name']) {
// 주문정보
$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'] == '준비') {
+ if($od['od_status'] != '준비') {
+ $fail_count++;
$fail_od_id[] = $od_id;
continue;
}
@@ -118,6 +120,8 @@ if($_FILES['excelfile']['tmp_name']) {
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']);
diff --git a/install/gnuboard5shop.sql b/install/gnuboard5shop.sql
index e41334bd1..8a74be270 100644
--- a/install/gnuboard5shop.sql
+++ b/install/gnuboard5shop.sql
@@ -385,6 +385,7 @@ CREATE TABLE IF NOT EXISTS `g5_shop_item` (
`it_use` tinyint(4) NOT NULL DEFAULT '0',
`it_soldout` tinyint(4) NOT NULL DEFAULT '0',
`it_stock_qty` int(11) NOT NULL DEFAULT '0',
+ `it_stock_sms` tinyint(4) NOT NULL DEFAULT '0',
`it_noti_qty` int(11) NOT NULL DEFAULT '0',
`it_sc_type` tinyint(4) NOT NULL DEFAULT '0',
`it_sc_method` tinyint(4) NOT NULL DEFAULT '0',
@@ -702,4 +703,22 @@ CREATE TABLE IF NOT EXISTS `g5_shop_wish` (
`wi_ip` varchar(25) NOT NULL DEFAULT '',
PRIMARY KEY (`wi_id`),
KEY `index1` (`mb_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `g5_shop_item_stocksms`
+--
+
+DROP TABLE IF EXISTS `g5_shop_item_stocksms`;
+CREATE TABLE IF NOT EXISTS `g5_shop_item_stocksms` (
+ `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;
\ No newline at end of file
diff --git a/install/install_db.php b/install/install_db.php
index 27bb04c3a..879e14a05 100644
--- a/install/install_db.php
+++ b/install/install_db.php
@@ -534,6 +534,7 @@ if($g5_shop_install) {
fwrite($f, "\$g5['g5_shop_sendcost_table'] = G5_SHOP_TABLE_PREFIX.'sendcost'; // 추가배송비 테이블\n");
fwrite($f, "\$g5['g5_shop_personalpay_table'] = G5_SHOP_TABLE_PREFIX.'personalpay'; // 개인결제 정보 테이블\n");
fwrite($f, "\$g5['g5_shop_order_address_table'] = G5_SHOP_TABLE_PREFIX.'order_address'; // 배송지이력 정보 테이블\n");
+ fwrite($f, "\$g5['g5_shop_item_stocksms_table'] = G5_SHOP_TABLE_PREFIX.'item_stocksms'; // 재입고SMS 알림 정보 테이블\n");
}
fwrite($f, "?>");
diff --git a/mobile/shop/search.php b/mobile/shop/search.php
index 4bb5676b2..e992d04f4 100644
--- a/mobile/shop/search.php
+++ b/mobile/shop/search.php
@@ -181,7 +181,7 @@ $total_page = ceil($total_count / $items); // 전체 페이지 계산
echo ''.$error.'
';
}
- $query_string .= 'ca_id='.$ca_id;
+ $query_string .= 'ca_id='.$ca_id.'&q='.urlencode($q);
$query_string .='&qsort='.$qsort.'&qorder='.$qorder;
echo get_paging($config['cf_mobile_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$query_string.'&page=');
?>
diff --git a/mobile/skin/shop/basic/item.form.skin.php b/mobile/skin/shop/basic/item.form.skin.php
index 8c7b60055..5e3760a50 100644
--- a/mobile/skin/shop/basic/item.form.skin.php
+++ b/mobile/skin/shop/basic/item.form.skin.php
@@ -269,6 +269,9 @@ add_stylesheet(' ',
위시리스트
추천하기
+
+ 재입고SMS 알림등록
+
@@ -388,6 +391,14 @@ function popup_item_recommend(it_id)
}
}
+// 재입고SMS 알림
+function popup_stocksms(it_id)
+{
+ url = "/itemstocksms.php?it_id=" + it_id;
+ opt = "scrollbars=yes,width=616,height=420,top=10,left=10";
+ popup_window(url, "itemstocksms", opt);
+}
+
// 바로구매, 장바구니 폼 전송
function fitem_submit(f)
{
diff --git a/shop/itemqaformupdate.php b/shop/itemqaformupdate.php
index 85249ffe1..f524ed02c 100644
--- a/shop/itemqaformupdate.php
+++ b/shop/itemqaformupdate.php
@@ -7,8 +7,8 @@ if (!$is_member) {
$iq_id = trim($_REQUEST['iq_id']);
$iq_subject = trim($_POST['iq_subject']);
-$iq_question = trim(stripslashes($_POST['iq_question']));
-$iq_answer = trim(stripslashes($_POST['iq_answer']));
+$iq_question = trim($_POST['iq_question']);
+$iq_answer = trim($_POST['iq_answer']);
$hash = trim($_REQUEST['hash']);
if ($w == "" || $w == "u") {
diff --git a/shop/itemstocksms.php b/shop/itemstocksms.php
new file mode 100644
index 000000000..e12080fee
--- /dev/null
+++ b/shop/itemstocksms.php
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/shop/itemstocksmsupdate.php b/shop/itemstocksmsupdate.php
new file mode 100644
index 000000000..695660cce
--- /dev/null
+++ b/shop/itemstocksmsupdate.php
@@ -0,0 +1,43 @@
+
\ No newline at end of file
diff --git a/shop/search.php b/shop/search.php
index 452864982..588727341 100644
--- a/shop/search.php
+++ b/shop/search.php
@@ -188,7 +188,7 @@ if ($is_admin) {
echo ''.$error.'
';
}
- $query_string .= 'ca_id='.$ca_id;
+ $query_string .= 'ca_id='.$ca_id.'&q='.urlencode($q);
$query_string .='&qsort='.$qsort.'&qorder='.$qorder;
echo get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$query_string.'&page=');
?>
diff --git a/shop/shop.head.php b/shop/shop.head.php
index 1024ff708..cc32041f1 100644
--- a/shop/shop.head.php
+++ b/shop/shop.head.php
@@ -38,8 +38,6 @@ include_once(G5_LIB_PATH.'/latest.lib.php');