Merge branch 'master' of github.com:gnuboard/yc5

This commit is contained in:
whitedot
2014-03-12 14:20:10 +09:00
19 changed files with 103 additions and 59 deletions

View File

@ -85,7 +85,6 @@ function imageview(id, w, h)
<nav id="gnb">
<h2>관리자 주메뉴</h2>
<script>$('#gnb').addClass('gnb_js');</script>
<?php
$gnb_str = "<ul id=\"gnb_1dul\">";
foreach($amenu as $key=>$value) {

View File

@ -94,6 +94,12 @@ if(!sql_query(" select it_stock_sms from {$g5['g5_shop_item_table']} limit 1 ",
ADD `it_stock_sms` tinyint(4) NOT NULL DEFAULT '0' AFTER `it_stock_qty` ", true);
}
// 추가옵션 포인트 설정 필드 추가
if(!sql_query(" select it_supply_point from {$g5['g5_shop_item_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['g5_shop_item_table']}`
ADD `it_supply_point` int(11) NOT NULL DEFAULT '0' AFTER `it_point_type` ", true);
}
$pg_anchor ='<ul class="anchor">
<li><a href="#anc_sitfrm_cate">상품분류</a></li>
<li><a href="#anc_sitfrm_ini">기본정보</a></li>
@ -483,15 +489,16 @@ $(function(){
<tr>
<th scope="row"><label for="it_point_type">포인트 유형</label></th>
<td>
<?php echo help("포인트 유형을 설정할 수 있습니다. 비율로 설정했을 경우 판매가격의 %비율로 포인트가 지급됩니다."); ?>
<?php echo help("포인트 유형을 설정할 수 있습니다. 비율로 설정했을 경우 설정 기준금액의 %비율로 포인트가 지급됩니다."); ?>
<select name="it_point_type" id="it_point_type">
<option value="0"<?php echo get_selected('0', $it['it_point_type']); ?>>금액</option>
<option value="1"<?php echo get_selected('1', $it['it_point_type']); ?>>비율</option>
<option value="0"<?php echo get_selected('0', $it['it_point_type']); ?>>설정금액</option>
<option value="1"<?php echo get_selected('1', $it['it_point_type']); ?>>판매가기준 설정비율</option>
<option value="2"<?php echo get_selected('2', $it['it_point_type']); ?>>구매가기준 설정비율</option>
</select>
<script>
$(function() {
$("#it_point_type").change(function() {
if($(this).val() == "1")
if(parseInt($(this).val()) > 0)
$("#it_point_unit").text("%");
else
$("#it_point_unit").text("점");
@ -509,7 +516,7 @@ $(function(){
<tr>
<th scope="row"><label for="it_point">포인트</label></th>
<td>
<?php echo help("주문완료후 환경설정에서 설정한 주문완료 설정일 후 회원에게 부여하는 포인트입니다.\n또, 포인트부여를 '아니오'로 설정한 경우 신용카드, 계좌이체로 주문하는 회원께는 부여하지 않습니다.\n게시판의 포인트 기능과는 별개로 동작합니다."); ?>
<?php echo help("주문완료후 환경설정에서 설정한 주문완료 설정일 후 회원에게 부여하는 포인트입니다.\n또, 포인트부여를 '아니오'로 설정한 경우 신용카드, 계좌이체로 주문하는 회원께는 부여하지 않습니다."); ?>
<input type="text" name="it_point" value="<?php echo $it['it_point']; ?>" id="it_point" class="frm_input" size="8"> <span id="it_point_unit"><?php if($it['it_point_type']) echo '%'; else echo '점'; ?></span>
</td>
<td class="td_grpset">
@ -519,6 +526,19 @@ $(function(){
<label for="chk_all_it_point">전체적용</label>
</td>
</tr>
<tr>
<th scope="row"><label for="it_supply_point">추가옵션상품 포인트</label></th>
<td>
<?php echo help("상품의 추가옵션상품 구매에 일괄적으로 지급하는 포인트입니다. 0으로 설정하시면 구매포인트를 지급하지 않습니다.\n주문완료후 환경설정에서 설정한 주문완료 설정일 후 회원에게 부여하는 포인트입니다.\n또, 포인트부여를 '아니오'로 설정한 경우 신용카드, 계좌이체로 주문하는 회원께는 부여하지 않습니다."); ?>
<input type="text" name="it_supply_point" value="<?php echo $it['it_supply_point']; ?>" id="it_supply_point" class="frm_input" size="8"> 점
</td>
<td class="td_grpset">
<input type="checkbox" name="chk_ca_it_supply_point" value="1" id="chk_ca_it_supply_point">
<label for="chk_ca_it_supply_point">분류적용</label>
<input type="checkbox" name="chk_all_it_supply_point" value="1" id="chk_all_it_supply_point">
<label for="chk_all_it_supply_point">전체적용</label>
</td>
</tr>
<tr>
<th scope="row"><label for="it_soldout">상품품절</label></th>
<td>

View File

@ -287,6 +287,7 @@ $sql_common = " ca_id = '$ca_id',
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',
@ -473,6 +474,7 @@ if(is_checked('chk_ca_it_price')) $ca_fields .= " , it_price = '$i
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' ";
@ -521,6 +523,7 @@ if(is_checked('chk_all_it_price')) $all_fields .= " , 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' ";

View File

@ -225,13 +225,14 @@ if (isset($_REQUEST['sfl'])) {
if (isset($_REQUEST['stx'])) { // search text (검색어)
$stx = trim($_REQUEST['stx']);
if ($stx)
$qstr .= '&amp;stx=' . urlencode($stx);
$qstr .= '&amp;stx=' . urlencode(cut_str($stx, 20, ''));
} else {
$stx = '';
}
if (isset($_REQUEST['sst'])) {
$sst = trim($_REQUEST['sst']);
$sst = preg_replace("/[\<\>\'\"\%\=\(\)\s]/", "", $sst);
if ($sst)
$qstr .= '&amp;sst=' . urlencode($sst); // search sort (검색 정렬 필드)
} else {

View File

@ -153,6 +153,10 @@ define('G5_SMTP', '127.0.0.1');
기타 상수
********************/
// SQL 에러를 표시할 것인지 지정
// 에러를 표시하지 않으려면 FALSE 로 변경
define('G5_DISPLAY_SQL_ERROR', TRUE);
// escape string 처리 함수 지정
// POST 등에서 한글이 깨질 경우 addslashes 로 변경
define('G5_ESCAPE_FUNCTION', 'mysql_real_escape_string');

View File

@ -46,33 +46,26 @@ h3 {margin:0 20px}
#tnb span {position:absolute;bottom:10px;left:0;width:100%;text-align:center}
/* gnb js off */
#gnb {z-index:12;min-width:999px;background:#383a3f}
#gnb {position:relative;z-index:12;min-width:999px;background:#383a3f}
#gnb h2 {margin:0;padding:0;font-size:0;line-height:0;overflow:hidden}
#gnb_1dul {margin:0 20px;padding:0;zoom:1}
#gnb_1dul {position:relative;margin:0 20px;padding:0;zoom:1}
#gnb_1dul:after {display:block;visibility:hidden;clear:both;content:""}
.gnb_1dli {z-index:13;clear:both;zoom:1}
.gnb_1dli {z-index:13;position:relative;float:left;margin:0 0 0 -1px;border:1px solid #333;border-top:0;border-bottom:0;zoom:1}
.gnb_1dli:after {display:block;visibility:hidden;clear:both;content:""}
.gnb_1dli a {display:block;float:left;width:120px;height:34px;color:#fff;font-weight:bold;text-decoration:none;line-height:2.8em}
.gnb_1dli a {display:block;width:120px;height:34px;color:#fff;font-weight:bold;text-align:center;text-decoration:none;line-height:2.8em}
.gnb_1dli a:focus, .gnb_1dli a:hover {text-decoration:none}
.gnb_2dul {float:left;width:auto}
.gnb_1dli_air a {background:#fff;color:#000}
.gnb_1dli_on a {background:#282828;color:#fff}
.gnb_2dul {display:none;position:absolute;top:34px;width:181px;border:1px solid #999;border-top:0;background:#fff}
.gnb_2dli {float:left}
.gnb_2dli a {color:#e0e0e0;font-weight:normal}
/* gnb js on */
.gnb_js {}
.gnb_js #gnb_1dul {zoom:1}
.gnb_js .gnb_1dli {clear:none;position:relative;float:left;margin:0 0 0 -1px;border:1px solid #333;border-top:0;border-bottom:0}
.gnb_js .gnb_1dli a {text-align:center}
.gnb_js .gnb_1dli_air a {float:none;background:#fff;color:#000}
.gnb_js .gnb_1dli_on a {float:none;background:#282828;color:#fff}
.gnb_js .gnb_2dul {display:none;position:absolute;top:34px;width:181px;border:1px solid #999;border-top:0;background:#fff}
.gnb_js .gnb_2dli a {display:inline-block;float:none;padding:8px 10px;width:161px;height:auto;background:#fff;color:#000;text-align:left;line-height:1em}
.gnb_js .gnb_2dli a:focus, .gnb_js .gnb_2dli a:hover {background:#484848;color:#fff}
.gnb_2dli a {display:inline-block;float:none;padding:8px 10px;width:161px;height:auto;background:#fff;color:#000;font-weight:normal;text-align:left;line-height:1em}
.gnb_2dli a:focus, .gnb_js .gnb_2dli a:hover {background:#484848;color:#fff}
.gnb_1dli_over .gnb_2dul {display:block;left:-1px}
.gnb_1dli_over2 .gnb_2dul {display:block;right:-1px}
.gnb_js .gnb_grp_style {background:#f7f7f7 !important}
.gnb_js .gnb_grp_style:focus, .gnb_js .gnb_grp_style:hover {background:#484848 !important}
.gnb_js .gnb_grp_div {border-top:1px solid #eee}
.gnb_grp_style {background:#f7f7f7 !important}
.gnb_grp_style:focus, .gnb_js .gnb_grp_style:hover {background:#484848 !important}
.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}

View File

@ -384,6 +384,7 @@ CREATE TABLE IF NOT EXISTS `g5_shop_item` (
`it_price` int(11) NOT NULL DEFAULT '0',
`it_point` int(11) NOT NULL DEFAULT '0',
`it_point_type` tinyint(4) NOT NULL DEFAULT '0',
`it_supply_point` int(11) NOT NULL DEFAULT '0',
`it_notax` tinyint(4) NOT NULL DEFAULT '0',
`it_sell_email` varchar(255) NOT NULL DEFAULT '',
`it_use` tinyint(4) NOT NULL DEFAULT '0',

View File

@ -1433,7 +1433,7 @@ function sql_select_db($db, $connect)
// mysql_query 와 mysql_error 를 한꺼번에 처리
function sql_query($sql, $error=TRUE)
function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR)
{
if ($error)
$result = @mysql_query($sql) or die("<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : {$_SERVER['PHP_SELF']}");
@ -1444,7 +1444,7 @@ function sql_query($sql, $error=TRUE)
// 쿼리를 실행한 후 결과값에서 한행을 얻는다.
function sql_fetch($sql, $error=TRUE)
function sql_fetch($sql, $error=G5_DISPLAY_SQL_ERROR)
{
$result = sql_query($sql, $error);
//$row = @sql_fetch_array($result) or die("<p>$sql<p>" . mysql_errno() . " : " . mysql_error() . "<p>error file : $_SERVER['PHP_SELF']");

View File

@ -1645,12 +1645,28 @@ function get_order_info($od_id)
// 상품포인트
function get_item_point($it)
function get_item_point($it, $io_id='', $trunc=10)
{
global $g5;
$it_point = 0;
if($it['it_point_type']) {
$it_point = floor(($it['it_price'] * ($it['it_point'] / 100) / 10)) * 10;
if($it['it_point_type'] > 0) {
$it_price = $it['it_price'];
if($it['it_point_type'] == 2 && $io_id) {
$sql = " select io_id, io_price
from {$g5['g5_shop_item_option_table']}
where io_id = '$io_id'
and io_type = '0'
and io_use = '1' ";
$opt = sql_fetch($sql);
if($opt['io_id'])
$it_price += $opt['io_price'];
}
$it_point = floor(($it_price * ($it['it_point'] / 100) / $trunc)) * $trunc;
} else {
$it_point = $it['it_point'];
}

View File

@ -19,7 +19,7 @@ if ($default['de_card_test']) {
if ($default['de_escrow_use'] == 1) {
// 에스크로결제 테스트
$default['de_kcp_mid'] = "T0007";
$default['de_kcp_site_key'] = '2.mDT7R4lUIfHlHq4byhYjf__';
$default['de_kcp_site_key'] = '4Ho4YsuOZlLXUZUdOxM1Q7X__';
}
else {
// 일반결제 테스트

View File

@ -45,7 +45,6 @@ include_once(G5_MSHOP_PATH.'/_head.php');
if ($row['it_tel_inq']) $out_cd = 'tel_inq';
$image = get_it_image($row['it_id'], 50, 50);
$it_point = get_item_point($row);
?>
<tr>

View File

@ -138,9 +138,13 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_MSHOP_SKIN_URL.'/style.css">',
<th scope="row"><label for="disp_point">포인트</label></th>
<td>
<?php
$it_point = get_item_point($it);
echo number_format($it_point);
?> 점
if($it['it_point_type'] == 2) {
echo '구매금액(추가옵션 제외)의 '.$it['it_point'].'%';
} else {
$it_point = get_item_point($it);
echo number_format($it_point).'점';
}
?>
</td>
</tr>
<?php } ?>

View File

@ -141,11 +141,6 @@ else // 장바구니에 담기
$lst_count++;
}
// 포인트
$point = 0;
if($config['cf_use_point'])
$point = get_item_point($it);
//--------------------------------------------------------
// 재고 검사
//--------------------------------------------------------
@ -240,6 +235,19 @@ else // 장바구니에 담기
continue;
}
// 포인트
$point = 0;
if($config['cf_use_point']) {
if($io_type == 0) {
$point = get_item_point($it, $io_id);
} else {
$point = $it['it_supply_point'];
}
if($point < 0)
$point = 0;
}
// 배송비결제
if($it['it_sc_type'] == 1)
$ct_send_cost = 2; // 무료

View File

@ -99,14 +99,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
$catename2 = $row2['ca_name'];
}
// 배송비 상한가 미만이면 배송비 적용
$delivery = 0;
if ($row['it_price'] < $cost_limit) {
$delivery = $send_cost;
}
$pdate = date("Ymd", strtotime($row['it_time']));
$point = get_item_point($row);
// 상품이미지
$img_url = get_it_imageurl($row['it_id']);
@ -121,6 +114,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
$buy_url = G5_SHOP_URL.'/itembuy.php?it_id='.$row['it_id'];
$it_price = $row['it_price'];
$delivery = get_item_sendcost2($row['it_id'], $it_price, 1);
$point = get_item_point($row);
if($delivery) {
$deliv = 1;
@ -167,6 +161,7 @@ HEREDOC;
$buy_url = G5_SHOP_URL.'/itembuy.php?it_id='.$row['it_id'].'&amp;opt='.$row2['io_id'];
$it_price = $row['it_price'] + $row2['io_price'];
$delivery = get_item_sendcost2($row['it_id'], $it_price, 1);
$point = get_item_point($row, $row2['io_id']);
if($delivery) {
$deliv = $delivery;

View File

@ -76,9 +76,6 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
// 상품이미지
$img_url = get_it_imageurl($row['it_id']);
// 포인트
$it_point = get_item_point($row);
// 상품별옵션
$sql = " select * from {$g5['g5_shop_item_option_table']} where it_id = '{$row['it_id']}' and io_type = '0' and io_use = '1' order by io_no asc ";
$result2 = sql_query($sql);
@ -89,6 +86,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
$buy_url = G5_SHOP_URL.'/itembuy.php?it_id='.$row['it_id'];
$it_price = $row['it_price'];
$delivery = get_item_sendcost2($row['it_id'], $it_price, 1);
$it_point = get_item_point($row);
echo <<< HEREDOC
{$lt}begin{$gt}
@ -134,6 +132,7 @@ HEREDOC;
$buy_url = G5_SHOP_URL.'/itembuy.php?it_id='.$row['it_id'].'&amp;opt='.$row2['io_id'];
$it_price = $row['it_price'] + $row2['io_price'];
$delivery = get_item_sendcost2($row['it_id'], $it_price, 1);
$it_point = get_item_point($row, $row2['io_id']);
echo <<< HEREDOC
{$lt}begin{$gt}

View File

@ -77,9 +77,6 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
// 상품이미지
$img_url = get_it_imageurl($row['it_id']);
// 포인트
$it_point = get_item_point($row);
// 상품별옵션
$sql = " select * from {$g5['g5_shop_item_option_table']} where it_id = '{$row['it_id']}' and io_type = '0' and io_use = '1' order by io_no asc ";
$result2 = sql_query($sql);
@ -90,6 +87,7 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
$buy_url = G5_SHOP_URL.'/itembuy.php?it_id='.$row['it_id'];
$it_price = $row['it_price'];
$delivery = get_item_sendcost2($row['it_id'], $it_price, 1);
$it_point = get_item_point($row);
echo <<< HEREDOC
{$lt}begin{$gt}
@ -135,6 +133,7 @@ HEREDOC;
$buy_url = G5_SHOP_URL.'/itembuy.php?it_id='.$row['it_id'].'&amp;opt='.$row2['io_id'];
$it_price = $row['it_price'] + $row2['io_price'];
$delivery = get_item_sendcost2($row['it_id'], $it_price, 1);
$it_point = get_item_point($row, $row2['io_id']);
echo <<< HEREDOC
{$lt}begin{$gt}

View File

@ -7,7 +7,7 @@ if ($default['de_card_test']) {
if ($default['de_escrow_use'] == 1) {
// 에스크로결제 테스트
$default['de_kcp_mid'] = "T0007";
$default['de_kcp_site_key'] = '2.mDT7R4lUIfHlHq4byhYjf__';
$default['de_kcp_site_key'] = '4Ho4YsuOZlLXUZUdOxM1Q7X__';
}
else {
// 일반결제 테스트

View File

@ -50,7 +50,6 @@ include_once('./_head.php');
if ($row['it_tel_inq']) $out_cd = 'tel_inq';
$image = get_it_image($row['it_id'], 70, 70);
$it_point = get_item_point($row);
?>
<tr>

View File

@ -150,9 +150,13 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">',
<th scope="row">포인트</th>
<td>
<?php
$it_point = get_item_point($it);
echo number_format($it_point);
?> 점
if($it['it_point_type'] == 2) {
echo '구매금액(추가옵션 제외)의 '.$it['it_point'].'%';
} else {
$it_point = get_item_point($it);
echo number_format($it_point).'점';
}
?>
</td>
</tr>
<?php } ?>