Merge branch 'master' of github.com:gnuboard/yc5
This commit is contained in:
@ -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),
|
||||
|
||||
@ -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 ='<ul class="anchor">
|
||||
<li><a href="#anc_sitfrm_cate">상품분류</a></li>
|
||||
<li><a href="#anc_sitfrm_ini">기본정보</a></li>
|
||||
@ -507,6 +513,13 @@ $(function(){
|
||||
<label for="chk_all_it_soldout">전체적용</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_stock_sms">재입고SMS 알림</label></th>
|
||||
<td colspan="2">
|
||||
<?php echo help("상품이 품절인 경우에 체크해 놓으면 상품상세보기에서 고객이 재입고SMS 알림을 신청할 수 있게 됩니다."); ?>
|
||||
<input type="checkbox" name="it_stock_sms" value="1" id="it_stock_sms" <?php echo ($it['it_stock_sms']) ? "checked" : ""; ?>> 예
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="it_stock_qty">재고수량</label></th>
|
||||
<td>
|
||||
|
||||
@ -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',
|
||||
|
||||
@ -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 = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
|
||||
<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>
|
||||
@ -160,18 +164,20 @@ $listall = '<a href="'.$_SERVER['PHP_SELF'].'" class="ov_listall">전체목록</
|
||||
<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><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"><input type="text" name="it_stock_qty[<?php echo $i; ?>]" value="<?php echo $row['it_stock_qty']; ?>" class="frm_input" size="10" autocomplete="off"></td>
|
||||
<td class="td_chk"><input type="checkbox" name="it_use[<?php echo $i; ?>]" value="1" <?php echo ($row['it_use'] ? "checked" : ""); ?>></td>
|
||||
<td class="td_chk"><input type="checkbox" name="it_soldout[<?php echo $i; ?>]" value="1" <?php echo ($row['it_soldout'] ? "checked" : ""); ?>></td>
|
||||
<td class="td_chk"><input type="checkbox" name="it_stock_sms[<?php echo $i; ?>]" value="1" <?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="8" class="empty_table"><span>자료가 없습니다.</span></td></tr>';
|
||||
echo '<tr><td colspan="10" class="empty_table"><span>자료가 없습니다.</span></td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -11,7 +11,9 @@ 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_use = '{$_POST['it_use'][$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);
|
||||
}
|
||||
|
||||
181
adm/shop_admin/itemstocksms.php
Normal file
181
adm/shop_admin/itemstocksms.php
Normal file
@ -0,0 +1,181 @@
|
||||
<?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 == "") { $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['PHP_SELF'].'" 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>
|
||||
<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><?php echo $row['ss_hp']; ?></td>
|
||||
<td><?php echo ($row['ss_send'] ? '전송완료' : '전송전'); ?></td>
|
||||
<td><?php echo (is_null_time($row['ss_send_time']) ? '' : $row['ss_send_time']); ?></td>
|
||||
<td><?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>
|
||||
|
||||
<div class="btn_confirm01 btn_confirm">
|
||||
<input type="submit" name="act_button" value="선택SMS전송" class="btn_submit" onclick="document.pressed=this.value">
|
||||
<?php if ($is_admin == 'super') { ?>
|
||||
<input type="submit" name="act_button" value="선택삭제" class="btn_submit" onclick="document.pressed=this.value">
|
||||
<?php } ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$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
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);
|
||||
?>
|
||||
@ -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']);
|
||||
|
||||
@ -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;
|
||||
@ -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, "?>");
|
||||
|
||||
@ -181,7 +181,7 @@ $total_page = ceil($total_count / $items); // 전체 페이지 계산
|
||||
echo '<div>'.$error.'</div>';
|
||||
}
|
||||
|
||||
$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=');
|
||||
?>
|
||||
|
||||
@ -269,6 +269,9 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">',
|
||||
<?php } ?>
|
||||
<a href="javascript:item_wish(document.fitem, '<?php echo $it['it_id']; ?>');" id="sit_btn_wish">위시리스트</a>
|
||||
<a href="javascript:popup_item_recommend('<?php echo $it['it_id']; ?>');" id="sit_btn_rec">추천하기</a>
|
||||
<?php if(!$is_orderable && $it['it_soldout'] && $it['it_stock_sms']) { ?>
|
||||
<a href="javascript:popup_stocksms('<?php echo $it['it_id']; ?>');">재입고SMS 알림등록</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@ -388,6 +391,14 @@ function popup_item_recommend(it_id)
|
||||
}
|
||||
}
|
||||
|
||||
// 재입고SMS 알림
|
||||
function popup_stocksms(it_id)
|
||||
{
|
||||
url = "<?php echo G5_SHOP_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)
|
||||
{
|
||||
|
||||
@ -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") {
|
||||
|
||||
73
shop/itemstocksms.php
Normal file
73
shop/itemstocksms.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$g5['title'] = '상품 재입고SMS 알림요청 등록';
|
||||
include_once(G5_PATH.'/head.sub.php');
|
||||
|
||||
// 상품정보
|
||||
$sql = " select it_id, it_name, it_soldout, it_stock_sms
|
||||
from {$g5['g5_shop_item_table']}
|
||||
where it_id = '$it_id' ";
|
||||
$it = sql_fetch($sql);
|
||||
|
||||
if(!$it['it_id'])
|
||||
alert_close('상품정보가 존재하지 않습니다.');
|
||||
|
||||
if(!$it['it_soldout'] || !$it['it_stock_sms'])
|
||||
alert_close('재입고SMS 알림을 신청할 수 없는 상품입니다.');
|
||||
?>
|
||||
|
||||
<div>
|
||||
<h2><?php echo $g5['title']; ?></h2>
|
||||
|
||||
<form name="fstocksms" method="post" action="<?php echo G5_HTTPS_SHOP_URL; ?>/itemstocksmsupdate.php" onsubmit="return fstocksms_submit(this);" autocomplete="off">
|
||||
<input type="hidden" name="it_id" value="<?php echo $it_id; ?>">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="grid_4">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">상품</th>
|
||||
<td><?php echo $it['it_name']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="ss_hp">휴대폰번호</label></th>
|
||||
<td><input type="text" name="ss_hp" value="<?php echo $member['mb_hp']; ?>" id="ss_hp" required class="required frm_input"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
개인정보처리방침안내
|
||||
<textarea readonly><?php echo get_text($config['cf_privacy']) ?></textarea>
|
||||
<label for="agree">개인정보처리방침안내의 내용에 동의합니다.</label>
|
||||
<input type="checkbox" name="agree" value="1" id="agree">
|
||||
</div>
|
||||
<div>
|
||||
<input type="submit" value="확인">
|
||||
<button type="button" onclick="window.close();">닫기</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function fstocksms_submit(f)
|
||||
{
|
||||
if(!f.agree.checked) {
|
||||
alert("개인정보처리방침안내에 동의해 주십시오.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(confirm("재입고SMS 알림 요청을 등록하시겠습니까?")) {
|
||||
return true;
|
||||
} else {
|
||||
window.close();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
include_once(G5_PATH.'/tail.sub.php');
|
||||
?>
|
||||
43
shop/itemstocksmsupdate.php
Normal file
43
shop/itemstocksmsupdate.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
// 상품정보
|
||||
$sql = " select it_id, it_name, it_soldout, it_stock_sms
|
||||
from {$g5['g5_shop_item_table']}
|
||||
where it_id = '$it_id' ";
|
||||
$it = sql_fetch($sql);
|
||||
|
||||
if(!$it['it_id'])
|
||||
alert_close('상품정보가 존재하지 않습니다.');
|
||||
|
||||
if(!$it['it_soldout'] || !$it['it_stock_sms'])
|
||||
alert_close('재입고SMS 알림을 신청할 수 없는 상품입니다.');
|
||||
|
||||
$ss_hp = hyphen_hp_number($ss_hp);
|
||||
if(!$ss_hp)
|
||||
alert('휴대폰번호를 입력해 주십시오.');
|
||||
|
||||
if(!$agree)
|
||||
alert('개인정보처리방침안내에 동의해 주십시오.');
|
||||
|
||||
// 중복등록 체크
|
||||
$sql = " select count(*) as cnt
|
||||
from {$g5['g5_shop_item_stocksms_table']}
|
||||
where it_id = '$it_id'
|
||||
and ss_hp = '$ss_hp'
|
||||
and ss_send = '0' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if($row['cnt'])
|
||||
alert_close('해당 상품에 대하여 이전에 알림 요청을 등록한 내역이 있습니다.');
|
||||
|
||||
// 정보입력
|
||||
$sql = " insert into {$g5['g5_shop_item_stocksms_table']}
|
||||
set it_id = '$it_id',
|
||||
ss_hp = '$ss_hp',
|
||||
ss_ip = '{$_SERVER['REMOTE_ADDR']}',
|
||||
ss_datetime = '".G5_TIME_YMDHIS."' ";
|
||||
sql_query($sql);
|
||||
|
||||
alert_close('재입고SMS 알림 요청 등록이 완료됐습니다.');
|
||||
?>
|
||||
@ -188,7 +188,7 @@ if ($is_admin) {
|
||||
echo '<div>'.$error.'</div>';
|
||||
}
|
||||
|
||||
$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=');
|
||||
?>
|
||||
|
||||
@ -38,8 +38,6 @@ include_once(G5_LIB_PATH.'/latest.lib.php');
|
||||
<div id="hd_sch">
|
||||
<h3>쇼핑몰 검색</h3>
|
||||
<form name="frmsearch1" action="<?php echo G5_SHOP_URL; ?>/search.php" onsubmit="return search_submit(this);">
|
||||
<input type="hidden" name="sfl" value="wr_subject||wr_content">
|
||||
<input type="hidden" name="sop" value="and">
|
||||
|
||||
<label for="sch_str" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
|
||||
<input type="text" name="q" value="<?php echo stripslashes(get_text($q)); ?>" id="sch_str" required>
|
||||
|
||||
@ -289,6 +289,9 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">',
|
||||
<?php } ?>
|
||||
<a href="javascript:item_wish(document.fitem, '<?php echo $it['it_id']; ?>');" id="sit_btn_wish">위시리스트</a>
|
||||
<a href="javascript:popup_item_recommend('<?php echo $it['it_id']; ?>');" id="sit_btn_rec">추천하기</a>
|
||||
<?php if(!$is_orderable && $it['it_soldout'] && $it['it_stock_sms']) { ?>
|
||||
<a href="javascript:popup_stocksms('<?php echo $it['it_id']; ?>');">재입고SMS 알림등록</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@ -315,6 +318,14 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">',
|
||||
popup_window(url, "itemrecommend", opt);
|
||||
}
|
||||
}
|
||||
|
||||
// 재입고SMS 알림
|
||||
function popup_stocksms(it_id)
|
||||
{
|
||||
url = "<?php echo G5_SHOP_URL; ?>/itemstocksms.php?it_id=" + it_id;
|
||||
opt = "scrollbars=yes,width=616,height=420,top=10,left=10";
|
||||
popup_window(url, "itemstocksms", opt);
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
<!-- } 상품 요약정보 및 구매 끝 -->
|
||||
|
||||
Reference in New Issue
Block a user