마일리지 관련 코드 및 파일 삭제

This commit is contained in:
chicpro
2013-07-24 14:19:33 +09:00
parent 6740874212
commit e72088a8bf
21 changed files with 100 additions and 803 deletions

View File

@ -15,7 +15,6 @@ $menu['menu400'] = array (
array('400620', '상품재고관리', G4_ADMIN_URL.'/shop_admin/itemstocklist.php', 'scf_item_stock'),
array('400610', '상품유형관리', G4_ADMIN_URL.'/shop_admin/itemtypelist.php', 'scf_item_type'),
array('400500', '상품옵션재고관리', G4_ADMIN_URL.'/shop_admin/optionstocklist.php', 'scf_item_option'),
array('400490', '마일리지관리', G4_ADMIN_URL.'/shop_admin/mileagelist.php', 'scf_mileage'),
array('400650', '쿠폰관리', G4_ADMIN_URL.'/shop_admin/couponlist.php', 'scf_coupon'),
array('400500', '배송일괄처리', G4_ADMIN_URL.'/shop_admin/deliverylist.php', 'scf_deli', 1),
array('400740', '배송업체관리', G4_ADMIN_URL.'/shop_admin/deliverycodelist.php', 'scf_deli_co', 1),

View File

@ -444,13 +444,6 @@ $pg_anchor = '<ul class="anchor">
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="de_mileage_use">마일리지 사용</label></th>
<td>
<?php echo help("마일리지는 주문완료에 의해 적립되는 포인트입니다.\n마일리지 사용으로 설정하시면 기존 포인트 대신 마일리지가 주문 결제에 사용됩니다."); ?>
<input type="checkbox" name="de_mileage_use" value="1" id="de_mileage_use" <?php echo $default['de_mileage_use']?' checked':''; ?>> 사용
</td>
</tr>
<tr>
<th scope="row"><label for="cf_use_point">포인트 사용</label></th>
<td>

View File

@ -98,7 +98,6 @@ $sql = " update {$g4['shop_default_table']}
de_card_point = '$de_card_point',
de_card_pg = '$de_card_pg',
de_card_max_amount = '$de_card_max_amount',
de_mileage_use = '$de_mileage_use',
de_point_settle = '$de_point_settle',
de_level_sell = '$de_level_sell',
de_send_cost_case = '$de_send_cost_case',

View File

@ -1,231 +0,0 @@
<?php
$sub_menu = "400490";
include_once('./_common.php');
auth_check($auth[$sub_menu], 'r');
$token = get_token();
$sql_common = " from {$g4['shop_mileage_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 = "ml_id";
$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 == '') $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select *
{$sql_common}
{$sql_search}
{$sql_order}
limit {$from_record}, {$rows} ";
$result = sql_query($sql);
$listall = '';
if ($sfl || $stx) // 검색렬일 때만 처음 버튼을 보여줌
$listall = '<a href="'.$_SERVER['PHP_SELF'].'">전체목록</a>';
$mb = array();
if ($sfl == 'mb_id' && $stx)
$mb = get_member($stx);
$g4['title'] = '마일리지관리';
include_once (G4_ADMIN_PATH.'/admin.head.php');
$colspan = 8;
?>
<form name="fsearch" id="fsearch" method="get">
<fieldset>
<legend>마일리지 내역 검색</legend>
<span>
<?php echo $listall ?>
전체 <?php echo number_format($total_count) ?> 건
<?php
if (isset($mb['mb_id']) && $mb['mb_id']) {
echo '&nbsp;(' . $mb['mb_id'] .' 님 마일리지 합계 : ' . number_format($mb['mb_mileage']) . '점)';
} else {
$row2 = sql_fetch(" select sum(ml_point) as sum_mileage from {$g4['shop_mileage_table']} ");
echo '&nbsp;(전체 합계 '.number_format($row2['sum_mileage']).'점)';
}
?>
</span>
<select name="sfl" title="검색대상">
<option value="mb_id"<?php echo get_selected($_GET['sfl'], "mb_id"); ?>>회원아이디</option>
<option value="sp_content"<?php echo get_selected($_GET['sfl'], "ml_content"); ?>>내용</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="검색">
</fieldset>
</form>
<section class="cbox">
<h2>마일리지 내역</h2>
<ul class="sort_odr">
<li><?php echo subject_sort_link('mb_id') ?>회원아이디<span class="sound_only"> 순 정렬</span></a></li>
<li><?php echo subject_sort_link('ml_datetime') ?>일시<span class="sound_only"> 순 정렬</span></a></li>
<li><?php echo subject_sort_link('ml_content') ?>내용<span class="sound_only"> 순 정렬</span></a></li>
<li><?php echo subject_sort_link('ml_point') ?>마일리지<span class="sound_only"> 순 정렬</span></a></li>
</ul>
<form name="fpointlist" id="fpointlist" method="post" action="./mileagelist_delete.php" onsubmit="return fmileagelist_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; ?>">
<table class="tbl_pt_list">
<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">마일리지 내용</th>
<th scope="col">마일리지</th>
<th scope="col">마일리지합</th>
</tr>
</thead>
<tbody>
<?php
for ($i=0; $row=sql_fetch_array($result); $i++) {
if ($i==0 || ($row2['mb_id'] != $row['mb_id'])) {
$sql2 = " select mb_id, mb_name, mb_nick, mb_email, mb_homepage, mb_mileage from {$g4['member_table']} where mb_id = '{$row['mb_id']}' ";
$row2 = sql_fetch($sql2);
}
$mb_nick = get_sideview($row['mb_id'], $row2['mb_nick'], $row2['mb_email'], $row2['mb_homepage']);
$link1 = '<a href="./orderform.php?od_id='.$row['od_id'].'">';
$link2 = '</a>';
?>
<tr>
<td class="td_chk">
<input type="hidden" name="mb_id[<?php echo $i ?>]" value="<?php echo $row['mb_id'] ?>" id="mb_id_<?php echo $i ?>">
<input type="hidden" name="ml_id[<?php echo $i ?>]" value="<?php echo $row['ml_id'] ?>" id="ml_id_<?php echo $i ?>">
<label for="chk_<?php echo $i; ?>" class="sound_only">내역</label>
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
</td>
<td class="td_mbid"><a href="?sfl=mb_id&amp;stx=<?php echo $row['mb_id'] ?>"><?php echo $row['mb_id'] ?></a></td>
<td class="td_mbname"><?php echo $row2['mb_name'] ?></td>
<td class="td_name sv_use"><div><?php echo $mb_nick ?></div></td>
<td class="td_time"><?php echo $row['ml_datetime'] ?></td>
<td class="td_pt_log"><?php echo $link1 ?><?php echo $row['ml_content'] ?><?php echo $link2 ?></td>
<td class="td_num td_pt"><?php echo number_format($row['ml_point']) ?></td>
<td class="td_bignum td_pt"><?php echo number_format($row2['mb_mileage']) ?></td>
</tr>
<?php
}
if ($i == 0)
echo '<tr><td colspan="'.$colspan.'" class="empty_table">자료가 없습니다.</td></tr>';
?>
</tbody>
</table>
<div class="btn_list">
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
</div>
</form>
</section>
<?php echo get_paging(G4_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&amp;page="); ?>
<section id="point_mng" class="cbox">
<h2>개별회원 마일리지 증감 설정</h2>
<form name="fmileagelist2" method="post" id="fmileagelist2" action="./mileageupdate.php" autocomplete="off">
<input type="hidden" name="sfl" value="<?php echo $sfl; ?>">
<input type="hidden" name="stx" value="<?php echo $stx; ?>">
<input type="hidden" name="sst" value="<?php echo $sst; ?>">
<input type="hidden" name="sod" value="<?php echo $sod; ?>">
<input type="hidden" name="page" value="<?php echo $page; ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<table class="frm_tbl">
<colgroup>
<col class="grid_3">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="mb_id">회원아이디<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="mb_id" value="<?php echo $mb_id ?>" id="mb_id" class="required frm_input" required></td>
</tr>
<tr>
<th scope="row"><label for="ml_content">마일리지 내용<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="ml_content" id="ml_content" required class="required frm_input" size="80"></td>
</tr>
<tr>
<th scope="row"><label for="ml_point">마일리지<strong class="sound_only">필수</strong></label></th>
<td><input type="text" name="ml_point" id="ml_point" required class="required frm_input"></td>
</tr>
</tbody>
</table>
<div class="btn_confirm">
<input type="submit" value="확인" class="btn_submit">
</div>
</form>
</section>
<script>
function fmileagelist_submit(f)
{
if (!is_checked("chk[]")) {
alert(document.pressed+" 하실 항목을 하나 이상 선택하세요.");
return false;
}
if(document.pressed == "선택삭제") {
if(!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
return false;
}
}
return true;
}
</script>
<?php
include_once (G4_ADMIN_PATH.'/admin.tail.php');
?>

View File

@ -1,32 +0,0 @@
<?php
$sub_menu = "400490";
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 {$g4['shop_mileage_table']} where ml_id = '{$_POST['ml_id'][$k]}' ";
sql_query($sql);
$sql = " select sum(ml_point) as sum_ml_point from {$g4['shop_mileage_table']} where mb_id = '{$_POST['mb_id'][$k]}' ";
$row = sql_fetch($sql);
$sum_mileage = $row['sum_ml_point'];
$sql= " update {$g4['member_table']} set mb_mileage = '{$sum_mileage}' where mb_id = '{$_POST['mb_id'][$k]}' ";
sql_query($sql);
}
goto_url('./mileagelist.php?'.$qstr);
?>

View File

@ -1,24 +0,0 @@
<?php
$sub_menu = "400490";
include_once('./_common.php');
auth_check($auth[$sub_menu], 'w');
check_token();
$mb_id = $_POST['mb_id'];
$ml_point = $_POST['ml_point'];
$ml_content = $_POST['ml_content'];
$mb = get_member($mb_id);
if (!$mb['mb_id'])
alert('존재하는 회원아이디가 아닙니다.', './mileagelist.php?'.$qstr);
if (($ml_point < 0) && ($ml_point * (-1) > $mb['mb_mileage']))
alert('포인트를 깎는 경우 현재 마일리지보다 작으면 안됩니다.', './mileagelist.php?'.$qstr);
insert_mileage($mb_id, $ml_point, $ml_content, '', '');
goto_url('./mileagelist.php?'.$qstr);
?>

View File

@ -141,11 +141,7 @@ for ($i=0; $i<$cnt; $i++)
{
$point_use = 0;
//insert_point($mb_id, (-1) * ($ct[ct_point] * $ct[ct_qty]), "주문번호 $od_id ($ct_id) 취소");
if(!$default['de_mileage_use'])
delete_point($mb_id, "@delivery", $mb_id, "$od_id,$uq_id,$ct_id");
// 마일리지 삭제
delete_mileage($mb_id, $od_id, $ct_id);
delete_point($mb_id, "@delivery", $mb_id, "$od_id,$uq_id,$ct_id");
}
// 히스토리에 남김

View File

@ -48,16 +48,9 @@ if (!isset($order_not_point)) {
// 회원이면서 포인트가 0보다 크다면
if ($tmp_row['mb_id'] && $row['ct_point'] > 0)
{
if(!$default['de_mileage_use']) {
$po_point = $row['ct_point'] * $row['ct_qty'];
$po_content = "$cart_title3 {$tmp_row['od_id']} ({$row['ct_id']}) $cart_title4";
insert_point($tmp_row['mb_id'], $po_point, $po_content, "@delivery", $tmp_row['mb_id'], "{$tmp_row['od_id']},{$row['uq_id']},{$row['ct_id']}");
}
// 주문완료 마일리지 적립
$ml_point = $row['ct_point'] * $row['ct_qty'];
$ml_content = "$cart_title3 {$tmp_row['od_id']} ({$row['ct_id']}) $cart_title4";
insert_mileage($tmp_row['mb_id'], $ml_point, $ml_content, $tmp_row['od_id'], $row['ct_id']);
$po_point = $row['ct_point'] * $row['ct_qty'];
$po_content = "$cart_title3 {$tmp_row['od_id']} ({$row['ct_id']}) $cart_title4";
insert_point($tmp_row['mb_id'], $po_point, $po_content, "@delivery", $tmp_row['mb_id'], "{$tmp_row['od_id']},{$row['uq_id']},{$row['ct_id']}");
}
sql_query("update {$g4['shop_cart_table']} set ct_point_use = '1' where ct_id = '{$row['ct_id']}' ");

View File

@ -202,35 +202,14 @@ if(!$result) {
ADD `de_guest_cart_use` TINYINT(4) NOT NULL DEFAULT '0' AFTER `de_cart_keep_term` ", false);
}
// 마일리지관련 필드 추가
// 포인트타입 필드 추가
$sql = " select it_point_type from {$g4['shop_item_table']} limit 1 ";
$result = sql_query($sql, false);
if(!$result) {
sql_query(" CREATE TABLE IF NOT EXISTS `{$g4['shop_mileage_table']}` (
`ml_id` INT(11) NOT NULL AUTO_INCREMENT,
`mb_id` VARCHAR(255) NOT NULL DEFAULT '',
`od_id` BIGINT(20) unsigned NOT NULL,
`ct_id` INT(11) NOT NULL DEFAULT '0',
`ml_content` VARCHAR(255) NOT NULL DEFAULT '',
`ml_point` INT(11) NOT NULL DEFAULT '0',
`ml_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`ml_id`),
KEY `mb_id` (`mb_id`)
) ", false);
sql_query(" ALTER TABLE `{$g4['member_table']}`
ADD `mb_mileage` INT(11) NOT NULL DEFAULT '0' AFTER `mb_point` ", false);
sql_query(" ALTER TABLE `{$g4['shop_item_table']}`
ADD `it_point_type` TINYINT(4) NOT NULL DEFAULT '0' AFTER `it_point` ", false);
}
// 마일리지 사용설정 필드추가
$sql = " select de_mileage_use from {$g4['shop_default_table']} ";
$result = sql_query($sql, false);
if(!$result) {
sql_query(" ALTER TABLE `{$g4['shop_default_table']}`
ADD `de_mileage_use` TINYINT(4) NOT NULL DEFAULT '0' AFTER `de_point_settle` ", false);
}
// 쿠폰테이블
$sql = " DESCRIBE `{$g4['shop_coupon_table']}` ";
$result = sql_query($sql, false);

View File

@ -263,7 +263,6 @@ if($shop_install) {
de_card_use = '0',
de_card_max_amount = '1000',
de_point_settle = '10000',
de_mileage_use = '1',
de_cart_keep_term = '15',
de_point_per = '5',
de_card_point = '0',
@ -382,10 +381,6 @@ if($shop_install) {
$sql = preg_replace($source, $target, $sql);
@mysql_query($sql);
}
// mb_mileage 필드추가
@mysql_query(" ALTER TABLE `{$table_prefix}member`
ADD `mb_mileage` INT(11) NOT NULL DEFAULT '0' AFTER `mb_point` ");
}
?>
@ -493,7 +488,6 @@ if($shop_install) {
fwrite($f, "\$g4['shop_onlinecalc_table'] = SHOP_TABLE_PREFIX.'onlinecalc'; // 온라인견적 테이블\n");
fwrite($f, "\$g4['shop_order_table'] = SHOP_TABLE_PREFIX.'order'; // 주문서 테이블\n");
fwrite($f, "\$g4['shop_wish_table'] = SHOP_TABLE_PREFIX.'wish'; // 보관함(위시리스트) 테이블\n");
fwrite($f, "\$g4['shop_mileage_table'] = SHOP_TABLE_PREFIX.'mileage'; // 마일리지 테이블\n");
fwrite($f, "\$g4['shop_coupon_table'] = SHOP_TABLE_PREFIX.'coupon'; // 쿠폰정보 테이블\n");
fwrite($f, "\$g4['shop_sendcost_table'] = SHOP_TABLE_PREFIX.'sendcost'; // 추가배송비 테이블\n");
fwrite($f, "\$g4['shop_request_table'] = SHOP_TABLE_PREFIX.'request'; // 주문 취소, 교환, 반품 요청테이블\n");

View File

@ -248,7 +248,6 @@ CREATE TABLE IF NOT EXISTS `shop_default` (
`de_card_pg` varchar(255) NOT NULL DEFAULT '',
`de_card_max_amount` int(11) NOT NULL DEFAULT '0',
`de_point_settle` int(11) NOT NULL DEFAULT '0',
`de_mileage_use` tinyint(4) NOT NULL DEFAULT '0',
`de_level_sell` int(11) NOT NULL DEFAULT '0',
`de_send_cost_case` varchar(255) NOT NULL DEFAULT '',
`de_send_cost_limit` varchar(255) NOT NULL DEFAULT '',
@ -640,25 +639,6 @@ CREATE TABLE IF NOT EXISTS `shop_order` (
-- --------------------------------------------------------
--
-- Table structure for table `shop_mileage`
--
DROP TABLE IF EXISTS `shop_mileage`;
CREATE TABLE IF NOT EXISTS `shop_mileage` (
`ml_id` INT(11) NOT NULL AUTO_INCREMENT,
`mb_id` VARCHAR(255) NOT NULL DEFAULT '',
`od_id` BIGINT(20) unsigned NOT NULL,
`ct_id` INT(11) NOT NULL DEFAULT '0',
`ml_content` VARCHAR(255) NOT NULL DEFAULT '',
`ml_point` INT(11) NOT NULL DEFAULT '0',
`ml_datetime` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`ml_id`),
KEY `mb_id` (`mb_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `shop_request`
--

View File

@ -36,7 +36,7 @@ class item_view
$this->link = $link;
if ($href)
$this->href = $href;
else
else
$this->href = G4_SHOP_URL."/item.php?it_id=".$this->it['it_id'];
}
@ -51,28 +51,28 @@ class item_view
function it_img($imgw, $imgh=0) {
$img = get_it_thumbnail($this->it['it_img'.$this->idx], $imgw, $imgh);
// 상품이미지의 경우 링크값이 none 이 아닌 경우 무조건 링크를 건다.
if ($this->link != "none")
if ($this->link != "none")
$img = $this->get_href($img);
$this->buffer[] = "<li class=\"it_img\">$img</li>";
}
function it_name($length) {
$it_name = utf8_strcut($this->it['it_name'], $length);
if ($this->link == "all" || $this->link == "it_name")
if ($this->link == "all" || $this->link == "it_name")
$it_name = $this->get_href($it_name);
$this->buffer[] = "<li class=\"it_name\">{$it_name}</li>";
}
function it_cust_price($prefix="시중가 : ", $suffix="") {
$it_cust_price = $prefix.number_format($this->it['it_cust_price']).$suffix;
if ($this->link == "all")
if ($this->link == "all")
$it_cust_price = $this->get_href($it_cust_price);
$this->buffer[] = "<li class=\"it_cust_price\">{$it_cust_price}</li>";
}
function it_price($prefix="판매가 : ", $suffix="") {
$it_price = $prefix.number_format($this->it['it_price']).$suffix;
if ($this->link == "all")
if ($this->link == "all")
$it_price = $this->get_href($it_price);
$this->buffer[] = "<li class=\"it_price\">{$it_price}</li>";
}
@ -80,21 +80,21 @@ class item_view
function it_point($prefix="포인트 : ") {
$suffix = ($this->it['it_point_type'] == 1) ? "%" : "";
$it_point = $prefix.number_format($this->it['it_point']).$suffix;
if ($this->link == "all")
if ($this->link == "all")
$it_point = $this->get_href($it_point);
$this->buffer[] = "<li class=\"it_point\">{$it_point}</li>";
}
function it_etc($etc="") {
$this->index++;
if ($this->link == "all")
if ($this->link == "all")
$$etc = $this->get_href($etc);
$this->buffer[] = "<li class=\"it_etc{$this->index}\">{$etc}</li>";
}
function run() {
$id = "it".$this->it['it_id'];
return !empty($this->buffer) ? "<ul".($id?" id=\"$id\"":"")." class=\"item_view\">\n".implode("\n", $this->buffer)."\n</ul>\n" : "";
return !empty($this->buffer) ? "<ul".($id?" id=\"$id\"":"")." class=\"item_view\">\n".implode("\n", $this->buffer)."\n</ul>\n" : "";
}
}
@ -1198,75 +1198,6 @@ function delete_item_thumbnail($dir, $file)
}
}
// 마일리지 부여
function insert_mileage($mb_id, $point, $content='', $od_id, $ct_id)
{
global $g4;
// 포인트가 없다면 업데이트 할 필요 없음
if ($point == 0) { return 0; }
// 회원아이디가 없다면 업데이트 할 필요 없음
if ($mb_id == '') { return 0; }
$mb = sql_fetch(" select mb_id from {$g4['member_table']} where mb_id = '$mb_id' ");
if (!$mb['mb_id']) { return 0; }
// 이미 등록된 내역이라면 건너뜀
if($od_id && $ct_id) {
$sql = " select count(*) as cnt from {$g4['shop_mileage_table']}
where mb_id = '$mb_id'
and od_id = '$od_id'
and ct_id = '$ct_id' ";
$row = sql_fetch($sql);
if ($row['cnt'])
return -1;
}
// 마일리지 건별 생성
$sql = " insert into {$g4['shop_mileage_table']}
set mb_id = '$mb_id',
od_id = '$od_id',
ct_id = '$ct_id',
ml_content = '".addslashes($content)."',
ml_point = '$point',
ml_datetime = '".G4_TIME_YMDHIS."' ";
sql_query($sql);
// 마일리지 내역의 합을 구하고
$sql = " select sum(ml_point) as sum_mileage from {$g4['shop_mileage_table']} where mb_id = '$mb_id' ";
$row = sql_fetch($sql);
$sum_mileage = $row['sum_mileage'];
// 마일리지 UPDATE
$sql = " update {$g4['member_table']} set mb_mileage = '$sum_mileage' where mb_id = '$mb_id' ";
sql_query($sql);
return 1;
}
// 마일리지 삭제
function delete_mileage($mb_id, $od_id, $ct_id)
{
global $g4;
$sql = " delete from {$g4['shop_mileage_table']}
where mb_id = '$mb_id'
and od_id = '$od_id'
and ct_id = '$ct_id' ";
sql_query($sql);
// 마일리지 내역의 합을 구하고
$sql = " select sum(ml_point) as sum_mileage from {$g4['shop_mileage_table']} where mb_id = '$mb_id' ";
$row = sql_fetch($sql);
$sum_mileage = $row['sum_mileage'];
// 마일리지 UPDATE
$sql = " update {$g4['member_table']} set mb_mileage = '$sum_mileage' where mb_id = '$mb_id' ";
sql_query($sql);
return 1;
}
// 쿠폰번호 생성함수
function get_coupon_id()
{

View File

@ -23,13 +23,8 @@ $cp = sql_fetch($sql);
<h2>회원정보 개요</h2>
<dl>
<?php if($default['de_mileage_use']) { ?>
<dt>마일리지</dt>
<dd><a href="<?php echo G4_SHOP_URL; ?>/mileage.php" target="_blank" class="win_point"><?php echo number_format($member['mb_mileage']); ?>점</a></dd>
<?php } else { ?>
<dt>보유포인트</dt>
<dd><a href="<?php echo G4_BBS_URL; ?>/point.php" target="_blank" class="win_point"><?php echo number_format($member['mb_point']); ?>점</a></dd>
<?php } ?>
<dt>보유쿠폰</dt>
<dd><a href="<?php echo G4_SHOP_URL; ?>/coupon.php" target="_blank" class="win_coupon"><?php echo number_format($cp['cnt']); ?></a></dd>
<dt>연락처</dt>

View File

@ -242,7 +242,7 @@ ob_start();
<?php $tot_amount = $tot_sell_amount + $send_cost; // 총계 = 주문상품금액합계 + 배송비 ?>
<strong id="ct_tot_amount"><?php echo number_format($tot_amount); ?> 원</strong>
</dd>
<dt class="sod_bsk_point"><?php echo $default['de_mileage_use'] ? '마일리지' : '포인트'; ?></dt>
<dt class="sod_bsk_point">포인트</dt>
<dd class="sod_bsk_point"><strong><?php echo number_format($tot_point); ?> 점</strong></dd>
</dl>
@ -621,43 +621,22 @@ ob_end_clean();
}
$temp_point = 0;
if($default['de_mileage_use']) {
// 마일리지 사용
if ($is_member)
// 회원이면서 포인트사용이면
if ($is_member && $config['cf_use_point'])
{
// 포인트 결제 사용 포인트보다 회원의 포인트가 크다면
if ($member['mb_point'] >= $default['de_point_settle'])
{
// 포인트 결제 사용 포인트보다 회원의 마일리지가 크다면
if ($member['mb_mileage'] >= $default['de_point_settle'])
{
$temp_point = $tot_amount * ($default['de_point_per'] / 100); // 포인트 결제 % 적용
$temp_point = (int)((int)($temp_point / 100) * 100); // 100점 단위
$temp_point = $tot_amount * ($default['de_point_per'] / 100); // 포인트 결제 % 적용
$temp_point = (int)((int)($temp_point / 100) * 100); // 100점 단위
$member_mileage = (int)((int)($member['mb_mileage'] / 100) * 100); // 100점 단위
if ($temp_point > $member_mileage)
$temp_point = $member_mileage;
$member_point = (int)((int)($member['mb_point'] / 100) * 100); // 100점 단위
if ($temp_point > $member_point)
$temp_point = $member_point;
echo '<div><input type="hidden" name="max_temp_point" value="<?php echo $temp_point; ?>">결제포인트 : <input type="text" id="od_temp_point" name="od_temp_point" value="0" size="10">점 (100점 단위로 입력하세요.)</div>';
echo '<div>회원님의 보유포인트('.display_point($member['mb_mileage']).')중 <strong id="use_max_point">'.display_point($temp_point).'</strong>(주문금액 '.$default['de_point_per'].'%) 내에서 결제가 가능합니다.</div>';
$multi_settle++;
}
}
} else {
// 회원이면서 포인트사용이면
if ($is_member && $config['cf_use_point'])
{
// 포인트 결제 사용 포인트보다 회원의 포인트가 크다면
if ($member['mb_point'] >= $default['de_point_settle'])
{
$temp_point = $tot_amount * ($default['de_point_per'] / 100); // 포인트 결제 % 적용
$temp_point = (int)((int)($temp_point / 100) * 100); // 100점 단위
$member_point = (int)((int)($member['mb_point'] / 100) * 100); // 100점 단위
if ($temp_point > $member_point)
$temp_point = $member_point;
echo '<div><input type="hidden" name="max_temp_point" value="<?php echo $temp_point; ?>">결제포인트 : <input type="text" id="od_temp_point" name="od_temp_point" value="0" size="10">점 (100점 단위로 입력하세요.)</div>';
echo '<div>회원님의 보유포인트('.display_point($member['mb_point']).')중 <strong id="use_max_point">'.display_point($temp_point).'</strong>(주문금액 '.$default['de_point_per'].'%) 내에서 결제가 가능합니다.</div>';
$multi_settle++;
}
echo '<div><input type="hidden" name="max_temp_point" value="<?php echo $temp_point; ?>">결제포인트 : <input type="text" id="od_temp_point" name="od_temp_point" value="0" size="10">점 (100점 단위로 입력하세요.)</div>';
echo '<div>회원님의 보유포인트('.display_point($member['mb_point']).')중 <strong id="use_max_point">'.display_point($temp_point).'</strong>(주문금액 '.$default['de_point_per'].'%) 내에서 결제가 가능합니다.</div>';
$multi_settle++;
}
}
?>
@ -1069,18 +1048,11 @@ function calculate_order_amount()
function calculate_temp_point()
{
<?php
if($default['de_mileage_use']) {
$point = (int)$member_mileage;
} else {
$point = (int)$member_point;
}
?>
var sell_amount = parseInt($("input[name=od_amount]").val());
var send_cost = parseInt($("input[name=od_send_cost]").val());
var point_per = <?php echo $default['de_point_per']; ?>;
var temp_point = parseInt((sell_amount + send_cost) * (point_per / 100) / 100) * 100;
var point = <?php echo $point; ?>
var point = <?php echo $member_point; ?>
if(temp_point > point)
temp_point = point;
@ -1181,30 +1153,20 @@ function kcp_approval()
{
temp_point = parseInt(pf.od_temp_point.value);
<?php
if($default['de_mileage_use']) {
$mb_point = $member['mb_mileage'];
$p_msg = '마일리지';
} else {
$mb_point = $member['mb_point'];
$p_msg = '포인트';
}
?>
if (temp_point < 0) {
alert("<?php echo $p_msg; ?>를 0 이상 입력하세요.");
alert("포인트를 0 이상 입력하세요.");
pf.od_temp_point.select();
return false;
}
if (temp_point > tot_amount) {
alert("주문금액 보다 많이 <?php echo $p_msg; ?>결제할 수 없습니다.");
alert("주문금액 보다 많이 포인트결제할 수 없습니다.");
pf.od_temp_point.select();
return false;
}
if (temp_point > <?php echo (int)$mb_point; ?>) {
alert("회원님의 <?php echo $p_msg; ?>보다 많이 결제할 수 없습니다.");
if (temp_point > <?php echo (int)$member['mb_point']; ?>) {
alert("회원님의 포인트보다 많이 결제할 수 없습니다.");
pf.od_temp_point.select();
return false;
}
@ -1216,7 +1178,7 @@ function kcp_approval()
}
if (parseInt(parseInt(temp_point / 100) * 100) != temp_point) {
alert("<?php echo $p_msg; ?>를 100점 단위로 입력하세요.");
alert("포인트를 100점 단위로 입력하세요.");
pf.od_temp_point.select();
return false;
}
@ -1341,30 +1303,20 @@ function forderform_check(f)
{
temp_point = parseInt(f.od_temp_point.value);
<?php
if($default['de_mileage_use']) {
$mb_point = $member['mb_mileage'];
$p_msg = '마일리지';
} else {
$mb_point = $member['mb_point'];
$p_msg = '포인트';
}
?>
if (temp_point < 0) {
alert("<?php echo $p_msg; ?>를 0 이상 입력하세요.");
alert("포인트를 0 이상 입력하세요.");
f.od_temp_point.select();
return false;
}
if (temp_point > tot_amount) {
alert("주문금액 보다 많이 <?php echo $p_msg; ?>결제할 수 없습니다.");
alert("주문금액 보다 많이 포인트결제할 수 없습니다.");
f.od_temp_point.select();
return false;
}
if (temp_point > <?php echo (int)$mb_point; ?>) {
alert("회원님의 <?php echo $p_msg; ?>보다 많이 결제할 수 없습니다.");
if (temp_point > <?php echo (int)$member['mb_point']; ?>) {
alert("회원님의 포인트보다 많이 결제할 수 없습니다.");
f.od_temp_point.select();
return false;
}
@ -1376,7 +1328,7 @@ function forderform_check(f)
}
if (parseInt(parseInt(temp_point / 100) * 100) != temp_point) {
alert("<?php echo $p_msg; ?>를 100점 단위로 입력하세요.");
alert("포인트를 100점 단위로 입력하세요.");
f.od_temp_point.select();
return false;
}

View File

@ -273,52 +273,27 @@ if($send_cost2 !== $i_send_cost2)
$tot_amount = $tot_sell_amount + $send_cost;
// 회원이면서 포인트사용이면
$temp_point = 0;
if($default['de_mileage_use']) {
if ($is_member)
if ($is_member && $config['cf_use_point'])
{
// 포인트 결제 사용 포인트보다 회원의 포인트가 크다면
if ($member['mb_point'] >= $default['de_point_settle'])
{
// 포인트 결제 사용 포인트보다 회원의 마일리지가 크다면
if ($member['mb_mileage'] >= $default['de_point_settle'])
{
$temp_point = $tot_amount * ($default['de_point_per'] / 100); // 포인트 결제 % 적용
$temp_point = (int)((int)($temp_point / 100) * 100); // 100점 단위
$temp_point = $tot_amount * ($default['de_point_per'] / 100); // 포인트 결제 % 적용
$temp_point = (int)((int)($temp_point / 100) * 100); // 100점 단위
$member_mileage = (int)((int)($member['mb_mileage'] / 100) * 100); // 100점 단위
if ($temp_point > $member_mileage)
$temp_point = $member_mileage;
}
$member_point = (int)((int)($member['mb_point'] / 100) * 100); // 100점 단위
if ($temp_point > $member_point)
$temp_point = $member_point;
}
}
if (($i_temp_point > (int)$temp_point || $i_temp_point < 0))
die("Error....");
if (($i_temp_point > (int)$temp_point || $i_temp_point < 0) && $config['cf_use_point'])
die("Error....");
if ($od_temp_point)
{
if ($member['mb_mileage'] < $od_temp_point)
alert('회원님의 마일리지가 부족하여 마일리지로 결제 할 수 없습니다.');
}
} else {
if ($is_member && $config['cf_use_point'])
{
// 포인트 결제 사용 포인트보다 회원의 포인트가 크다면
if ($member['mb_point'] >= $default['de_point_settle'])
{
$temp_point = $tot_amount * ($default['de_point_per'] / 100); // 포인트 결제 % 적용
$temp_point = (int)((int)($temp_point / 100) * 100); // 100점 단위
$member_point = (int)((int)($member['mb_point'] / 100) * 100); // 100점 단위
if ($temp_point > $member_point)
$temp_point = $member_point;
}
}
if (($i_temp_point > (int)$temp_point || $i_temp_point < 0) && $config['cf_use_point'])
die("Error....");
if ($od_temp_point)
{
if ($member['mb_point'] < $od_temp_point)
alert('회원님의 포인트가 부족하여 포인트로 결제 할 수 없습니다.');
}
if ($od_temp_point)
{
if ($member['mb_point'] < $od_temp_point)
alert('회원님의 포인트가 부족하여 포인트로 결제 할 수 없습니다.');
}
$i_amount = $i_amount + $i_send_cost + $i_send_cost2 - $i_temp_point;
@ -506,11 +481,8 @@ if(!$result) {
}
// 회원이면서 포인트를 사용했다면 포인트 테이블에 사용을 추가
if ($is_member && $od_receipt_point) {
if(!$default['de_mileage_use'])
insert_point($member['mb_id'], (-1) * $od_receipt_point, "주문번호 $od_id 결제");
insert_mileage($member['mb_id'], (-1) * $od_receipt_point, "주문번호 $od_id 결제", $od_id);
}
if ($is_member && $od_receipt_point)
insert_point($member['mb_id'], (-1) * $od_receipt_point, "주문번호 $od_id 결제");
// PG 결제내역기록
include_once(G4_MSHOP_PATH.'/kcp/pp_ax_hub_result.php');

View File

@ -1,113 +0,0 @@
<?php
include_once('./_common.php');
if ($is_guest)
alert_close('회원만 조회하실 수 있습니다.');
$g4['title'] = $member['mb_nick'].' 님의 마일리지 내역';
include_once(G4_PATH.'/head.sub.php');
$list = array();
$sql_common = " from {$g4['shop_mileage_table']} where mb_id = '".mysql_escape_string($member['mb_id'])."' ";
$sql_order = " order by ml_id desc ";
$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 ml_point
{$sql_common}
{$sql_order}
limit {$from_record}, {$rows} ";
$result = sql_query($sql);
$sum_point1 = $sum_point2 = 0;
for($i=0; $row=sql_fetch_array($result); $i++) {
if($row['ml_point'] >= 0) {
$sum_point1 += $row['ml_point'];
} else {
$sum_point2 += $row['ml_point'];
}
}
?>
<!-- 마일리지 내역 시작 { -->
<div id="point" class="new_win">
<h1 id="new_win_title"><?php echo $g4['title'] ?></h1>
<table class="basic_tbl">
<thead>
<tr>
<th scope="col">일시</th>
<th scope="col">내용</th>
<th scope="col">지급마일리지</th>
<th scope="col">사용마일리지</th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="row" colspan="2">소계</th>
<td><?php echo number_format($sum_point1) ?></td>
<td><?php echo number_format($sum_point2) ?></td>
</tr>
<tr>
<th scope="row" colspan="2">보유마일리지</th>
<td colspan="2"><?php echo number_format($member['mb_mileage']) ?></td>
</tr>
</tfoot>
<tbody>
<?php
$sum_point1 = $sum_point2 = 0;
$sql = " select *
{$sql_common}
{$sql_order}
limit {$from_record}, {$rows} ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$point1 = $point2 = 0;
if ($row['ml_point'] > 0) {
$point1 = '+' .number_format($row['ml_point']);
$sum_point1 += $row['ml_point'];
} else {
$point2 = number_format($row['ml_point']);
$sum_point2 += $row['ml_point'];
}
?>
<tr>
<td class="td_datetime"><?php echo $row['ml_datetime'] ?></td>
<td><?php echo $row['ml_content'] ?></td>
<td class="td_bignum"><?php echo $point1 ?></td>
<td class="td_bignum"><?php echo $point2 ?></td>
</tr>
<?php
}
if ($i == 0)
echo '<tr><td colspan="5" class="empty_table">자료가 없습니다.</td></tr>';
else {
if ($sum_point1 > 0)
$sum_point1 = "+" . number_format($sum_point1);
$sum_point2 = number_format($sum_point2);
}
?>
</tbody>
</table>
<?php echo get_paging(G4_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr.'&amp;page='); ?>
<div class="btn_win"><a href="javascript:;" onclick="window.close();">창닫기</a></div>
</div>
<!-- } 마일리지 내역 끝 -->
<?php
include_once(G4_PATH.'/tail.sub.php');
?>

View File

@ -42,13 +42,8 @@ $cp = sql_fetch($sql);
</div>
<dl>
<?php if($default['de_mileage_use']) { ?>
<dt>마일리지</dt>
<dd><a href="<?php echo G4_SHOP_URL; ?>/mileage.php" target="_blank" class="win_point"><?php echo number_format($member['mb_mileage']); ?>점</a></dd>
<?php } else { ?>
<dt>보유포인트</dt>
<dd><a href="<?php echo G4_BBS_URL; ?>/point.php" target="_blank" class="win_point"><?php echo number_format($member['mb_point']); ?>점</a></dd>
<?php } ?>
<dt>보유쿠폰</dt>
<dd><a href="<?php echo G4_SHOP_URL; ?>/coupon.php" target="_blank" class="win_coupon"><?php echo number_format($cp['cnt']); ?></a></dd>
<dt>연락처</dt>

View File

@ -329,7 +329,7 @@ function get_intall_file()
<?php $tot_amount = $tot_sell_amount + $send_cost; // 총계 = 주문상품금액합계 + 배송비 ?>
<strong id="ct_tot_amount"><?php echo number_format($tot_amount); ?> 원</strong>
</dd>
<dt class="sod_bsk_point"><?php echo $default['de_mileage_use'] ? '마일리지' : '포인트'; ?></dt>
<dt class="sod_bsk_point">포인트</dt>
<dd class="sod_bsk_point"><strong><?php echo number_format($tot_point); ?> 점</strong></dd>
</dl>
<!-- } 주문상품 합계 끝 -->
@ -827,49 +827,25 @@ function get_intall_file()
}
$temp_point = 0;
if($default['de_mileage_use']) {
// 마일리지 사용
if ($is_member)
// 회원이면서 포인트사용이면
if ($is_member && $config['cf_use_point'])
{
// 포인트 결제 사용 포인트보다 회원의 포인트가 크다면
if ($member['mb_point'] >= $default['de_point_settle'])
{
// 포인트 결제 사용 포인트보다 회원의 마일리지가 크다면
if ($member['mb_mileage'] >= $default['de_point_settle'])
{
$temp_point = $tot_amount * ($default['de_point_per'] / 100); // 포인트 결제 % 적용
$temp_point = (int)((int)($temp_point / 100) * 100); // 100점 단위
$temp_point = $tot_amount * ($default['de_point_per'] / 100); // 포인트 결제 % 적용
$temp_point = (int)((int)($temp_point / 100) * 100); // 100점 단위
$member_mileage = (int)((int)($member['mb_mileage'] / 100) * 100); // 100점 단위
if ($temp_point > $member_mileage)
$temp_point = $member_mileage;
?>
<p>보유마일리지(<?php echo display_point($member['mb_mileage']); ?>)중 <strong id="use_max_point">최대 <?php echo display_point($temp_point); ?></strong>까지 사용 가능 (주문금액 <?php echo $default['de_point_per']; ?>%)</p>
<input type="hidden" name="max_temp_point" value="<?php echo $temp_point; ?>">
<label for="od_temp_point">사용 포인트</label>
<input type="text" name="od_temp_point" value="0" id="od_temp_point" class="frm_input" size="10">점 (100점 단위로 입력하세요.)
<?php
$multi_settle++;
}
}
} else {
// 회원이면서 포인트사용이면
if ($is_member && $config['cf_use_point'])
{
// 포인트 결제 사용 포인트보다 회원의 포인트가 크다면
if ($member['mb_point'] >= $default['de_point_settle'])
{
$temp_point = $tot_amount * ($default['de_point_per'] / 100); // 포인트 결제 % 적용
$temp_point = (int)((int)($temp_point / 100) * 100); // 100점 단위
$member_point = (int)((int)($member['mb_point'] / 100) * 100); // 100점 단위
if ($temp_point > $member_point)
$temp_point = $member_point;
?>
<p>보유포인트(<?php echo display_point($member['mb_point']); ?>)중 <strong id="use_max_point">최대 <?php echo display_point($temp_point); ?></strong>까지 사용 가능 (주문금액 <?php echo $default['de_point_per']; ?>%)</p>
<input type="hidden" name="max_temp_point" value="<?php echo $temp_point; ?>">
<label for="od_temp_point">사용 포인트</label>
<input type="text" name="od_temp_point" value="0" id="od_temp_point" class="frm_input" size="10">점 (100점 단위로 입력하세요.)
<?php
$multi_settle++;
}
$member_point = (int)((int)($member['mb_point'] / 100) * 100); // 100점 단위
if ($temp_point > $member_point)
$temp_point = $member_point;
?>
<p>보유포인트(<?php echo display_point($member['mb_point']); ?>)중 <strong id="use_max_point">최대 <?php echo display_point($temp_point); ?></strong>까지 사용 가능 (주문금액 <?php echo $default['de_point_per']; ?>%)</p>
<input type="hidden" name="max_temp_point" value="<?php echo $temp_point; ?>">
<label for="od_temp_point">사용 포인트</label>
<input type="text" name="od_temp_point" value="0" id="od_temp_point" class="frm_input" size="10">점 (100점 단위로 입력하세요.)
<?php
$multi_settle++;
}
}
@ -1289,18 +1265,11 @@ function calculate_order_amount()
function calculate_temp_point()
{
<?php
if($default['de_mileage_use']) {
$point = (int)$member_mileage;
} else {
$point = (int)$member_point;
}
?>
var sell_amount = parseInt($("input[name=od_amount]").val());
var send_cost = parseInt($("input[name=od_send_cost]").val());
var point_per = <?php echo $default['de_point_per']; ?>;
var temp_point = parseInt((sell_amount + send_cost) * (point_per / 100) / 100) * 100;
var point = <?php echo $point; ?>
var point = <?php echo (int)$member_point; ?>;
if(temp_point > point)
temp_point = point;
@ -1449,30 +1418,20 @@ function forderform_check(f)
{
temp_point = parseInt(f.od_temp_point.value);
<?php
if($default['de_mileage_use']) {
$mb_point = $member['mb_mileage'];
$p_msg = '마일리지';
} else {
$mb_point = $member['mb_point'];
$p_msg = '포인트';
}
?>
if (temp_point < 0) {
alert("<?php echo $p_msg; ?>를 0 이상 입력하세요.");
alert("포인트를 0 이상 입력하세요.");
f.od_temp_point.select();
return false;
}
if (temp_point > tot_amount) {
alert("주문금액 보다 많이 <?php echo $p_msg; ?>결제할 수 없습니다.");
alert("주문금액 보다 많이 포인트결제할 수 없습니다.");
f.od_temp_point.select();
return false;
}
if (temp_point > <?php echo (int)$mb_point; ?>) {
alert("회원님의 <?php echo $p_msg; ?>보다 많이 결제할 수 없습니다.");
if (temp_point > <?php echo (int)$member['mb_point']; ?>) {
alert("회원님의 포인트보다 많이 결제할 수 없습니다.");
f.od_temp_point.select();
return false;
}
@ -1484,7 +1443,7 @@ function forderform_check(f)
}
if (parseInt(parseInt(temp_point / 100) * 100) != temp_point) {
alert("<?php echo $p_msg; ?>를 100점 단위로 입력하세요.");
alert("포인트를 100점 단위로 입력하세요.");
f.od_temp_point.select();
return false;
}

View File

@ -267,52 +267,27 @@ if($send_cost2 !== $i_send_cost2)
$tot_amount = $tot_od_amount + ($send_cost - $tot_sc_cp_amount);
// 회원이면서 포인트사용이면
$temp_point = 0;
if($default['de_mileage_use']) {
if ($is_member)
if ($is_member && $config['cf_use_point'])
{
// 포인트 결제 사용 포인트보다 회원의 포인트가 크다면
if ($member['mb_point'] >= $default['de_point_settle'])
{
// 포인트 결제 사용 포인트보다 회원의 마일리지가 크다면
if ($member['mb_mileage'] >= $default['de_point_settle'])
{
$temp_point = $tot_amount * ($default['de_point_per'] / 100); // 포인트 결제 % 적용
$temp_point = (int)((int)($temp_point / 100) * 100); // 100점 단위
$temp_point = $tot_amount * ($default['de_point_per'] / 100); // 포인트 결제 % 적용
$temp_point = (int)((int)($temp_point / 100) * 100); // 100점 단위
$member_mileage = (int)((int)($member['mb_mileage'] / 100) * 100); // 100점 단위
if ($temp_point > $member_mileage)
$temp_point = $member_mileage;
}
$member_point = (int)((int)($member['mb_point'] / 100) * 100); // 100점 단위
if ($temp_point > $member_point)
$temp_point = $member_point;
}
}
if (($i_temp_point > (int)$temp_point || $i_temp_point < 0))
die("Error....");
if (($i_temp_point > (int)$temp_point || $i_temp_point < 0) && $config['cf_use_point'])
die("Error....");
if ($od_temp_point)
{
if ($member['mb_mileage'] < $od_temp_point)
alert('회원님의 마일리지가 부족하여 마일리지로 결제 할 수 없습니다.');
}
} else {
if ($is_member && $config['cf_use_point'])
{
// 포인트 결제 사용 포인트보다 회원의 포인트가 크다면
if ($member['mb_point'] >= $default['de_point_settle'])
{
$temp_point = $tot_amount * ($default['de_point_per'] / 100); // 포인트 결제 % 적용
$temp_point = (int)((int)($temp_point / 100) * 100); // 100점 단위
$member_point = (int)((int)($member['mb_point'] / 100) * 100); // 100점 단위
if ($temp_point > $member_point)
$temp_point = $member_point;
}
}
if (($i_temp_point > (int)$temp_point || $i_temp_point < 0) && $config['cf_use_point'])
die("Error....");
if ($od_temp_point)
{
if ($member['mb_point'] < $od_temp_point)
alert('회원님의 포인트가 부족하여 포인트로 결제 할 수 없습니다.');
}
if ($od_temp_point)
{
if ($member['mb_point'] < $od_temp_point)
alert('회원님의 포인트가 부족하여 포인트로 결제 할 수 없습니다.');
}
$i_amount = $i_amount + $i_send_cost + $i_send_cost2 - $i_temp_point;
@ -499,11 +474,8 @@ if(!$result) {
}
// 회원이면서 포인트를 사용했다면 테이블에 사용을 추가
if ($is_member && $od_receipt_point) {
if(!$default['de_mileage_use'])
insert_point($member['mb_id'], (-1) * $od_receipt_point, "주문번호 $od_id 결제");
insert_mileage($member['mb_id'], (-1) * $od_receipt_point, "주문번호 $od_id 결제", $od_id);
}
if ($is_member && $od_receipt_point)
insert_point($member['mb_id'], (-1) * $od_receipt_point, "주문번호 $od_id 결제");
// PG 결제내역기록
include_once(G4_SHOP_PATH.'/kcp/pp_ax_hub_result.php');

View File

@ -65,11 +65,8 @@ $cancel_memo = addslashes($cancel_memo);
sql_query(" update {$g4['shop_order_table']} set od_send_cost = '0', od_send_cost2 = '0', od_temp_point = '0', od_receipt_amount = '0', od_receipt_point = '0', od_shop_memo = concat(od_shop_memo,\"\\n주문자 본인 직접 취소 - ".G4_TIME_YMDHIS." (취소이유 : {$cancel_memo})\") where uq_id = '$uq_id' ");
// 주문취소 회원의 포인트를 되돌려 줌
if ($od['od_receipt_point'] > 0) {
if(!$default['de_mileage_use'])
insert_point($member['mb_id'], $od['od_receipt_point'], "주문번호 $od_id 본인 취소");
insert_mileage($member['mb_id'], $od['od_receipt_point'], "주문번호 $od_id 본인 취소", $od_id);
}
if ($od['od_receipt_point'] > 0)
insert_point($member['mb_id'], $od['od_receipt_point'], "주문번호 $od_id 본인 취소");
goto_url(G4_SHOP_URL."/orderinquiryview.php?od_id=$od_id&amp;uq_id=$uq_id");
?>

View File

@ -18,21 +18,12 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<strong><?php echo $memo_not_read; ?></strong>
</a>
</li>
<?php if($default['de_mileage_use']) { ?>
<li>
<a href="<?php echo G4_SHOP_URL; ?>/mileage.php" target="_blank" id="ol_after_pt" class="win_point">
마일리지
<strong><?php echo number_format($member['mb_mileage']); ?></strong>
</a>
</li>
<?php } else { ?>
<li>
<a href="<?php echo G4_BBS_URL; ?>/point.php" target="_blank" id="ol_after_pt" class="win_point">
포인트
<strong><?php echo $point; ?></strong>
</a>
</li>
<?php } ?>
<li>
<a href="<?php echo G4_BBS_URL ?>/scrap.php" target="_blank" id="ol_after_scrap" class="win_scrap">스크랩</a>
</li>