#292 cp_used 필드와 관련된 코드 수정
This commit is contained in:
@ -81,7 +81,6 @@ $colspan = 8;
|
||||
<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('cp_end') ?>사용기한<span class="sound_only"> 순 정렬</span></a></li>
|
||||
<li><?php echo subject_sort_link('cp_used') ?>사용<span class="sound_only"> 순 정렬</span></a></li>
|
||||
</ul>
|
||||
|
||||
<form name="fcouponlist" id="fcouponlist" method="post" action="./couponlist_delete.php" onsubmit="return fcouponlist_submit(this);">
|
||||
|
||||
@ -8,13 +8,18 @@ $g4['title'] = '마이페이지';
|
||||
include_once(G4_MSHOP_PATH.'/_head.php');
|
||||
|
||||
// 쿠폰
|
||||
$sql = " select count(*) as cnt
|
||||
$cp_count = 0;
|
||||
$sql = " select cp_id
|
||||
from {$g4['shop_coupon_table']}
|
||||
where mb_id = '{$member['mb_id']}'
|
||||
and cp_used = '0'
|
||||
and cp_start <= '".G4_TIME_YMD."'
|
||||
and cp_end >= '".G4_TIME_YMD."' ";
|
||||
$cp = sql_fetch($sql);
|
||||
$res = sql_query($sql);
|
||||
|
||||
for($k=0; $cp=sql_fetch_array($res); $k++) {
|
||||
if(!is_used_coupon($member['mb_id'], $cp['cp_id']))
|
||||
$cp_count++;
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="smb_my">
|
||||
@ -26,7 +31,7 @@ $cp = sql_fetch($sql);
|
||||
<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>
|
||||
<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>
|
||||
<dd><a href="<?php echo G4_SHOP_URL; ?>/coupon.php" target="_blank" class="win_coupon"><?php echo number_format($cp_count); ?></a></dd>
|
||||
<dt>연락처</dt>
|
||||
<dd><?php echo ($member['mb_tel'] ? $member['mb_tel'] : '미등록'); ?></dd>
|
||||
<dt>E-Mail</dt>
|
||||
|
||||
@ -151,10 +151,9 @@ if($is_member) {
|
||||
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
|
||||
from {$g4['shop_coupon_table']}
|
||||
where cp_id = '{$_POST['od_cp_id']}'
|
||||
and mb_id = '{$member['mb_id']}'
|
||||
and mb_id IN ( '{$member['mb_id']}', '전체회원' )
|
||||
and cp_start <= '".G4_TIME_YMD."'
|
||||
and cp_end >= '".G4_TIME_YMD."'
|
||||
and cp_used = '0'
|
||||
and cp_method = '2' ";
|
||||
$cp = sql_fetch($sql);
|
||||
|
||||
@ -197,10 +196,9 @@ if($is_member && $send_cost > 0) {
|
||||
$sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum
|
||||
from {$g4['shop_coupon_table']}
|
||||
where cp_id = '{$_POST['sc_cp_id']}'
|
||||
and mb_id = '{$member['mb_id']}'
|
||||
and mb_id IN ( '{$member['mb_id']}', '전체회원' )
|
||||
and cp_start <= '".G4_TIME_YMD."'
|
||||
and cp_end >= '".G4_TIME_YMD."'
|
||||
and cp_used = '0'
|
||||
and cp_method = '3' ";
|
||||
$cp = sql_fetch($sql);
|
||||
|
||||
|
||||
@ -10,15 +10,10 @@ include_once(G4_PATH.'/head.sub.php');
|
||||
$sql = " select cp_id, cp_subject, cp_method, cp_target, cp_start, cp_end, cp_type, cp_price
|
||||
from {$g4['shop_coupon_table']}
|
||||
where mb_id = '{$member['mb_id']}'
|
||||
and cp_used = '0'
|
||||
and cp_start <= '".G4_TIME_YMD."'
|
||||
and cp_end >= '".G4_TIME_YMD."'
|
||||
order by cp_no ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
$count = @mysql_num_rows($result);
|
||||
if(!$count)
|
||||
alert_close('보유하신 쿠폰이 없습니다.');
|
||||
?>
|
||||
|
||||
<!-- 쿠폰 내역 시작 { -->
|
||||
@ -36,7 +31,11 @@ if(!$count)
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$cp_count = 0;
|
||||
for($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
if(is_used_coupon($member['mb_id'], $row['cp_id']))
|
||||
continue;
|
||||
|
||||
if($row['cp_method'] == 1) {
|
||||
$sql = " select ca_name from {$g4['shop_category_table']} where ca_id = '{$row['cp_target']}' ";
|
||||
$ca = sql_fetch($sql);
|
||||
@ -55,6 +54,8 @@ if(!$count)
|
||||
$cp_price = $row['cp_price'].'%';
|
||||
else
|
||||
$cp_price = number_format($row['cp_price']).'원';
|
||||
|
||||
$cp_count++;
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $row['cp_subject']; ?></td>
|
||||
@ -64,6 +65,9 @@ if(!$count)
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
if(!$cp_count)
|
||||
echo '<tr><td colspan="4" class="empty_table">사용할 수 있는 쿠폰이 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@ -12,17 +12,19 @@ if (!$is_member)
|
||||
$g4['title'] = $member['mb_name'].'님 마이페이지';
|
||||
include_once('./_head.php');
|
||||
|
||||
//$str = $g4[title];
|
||||
//include("./navigation2.inc.php");
|
||||
|
||||
// 쿠폰
|
||||
$sql = " select count(*) as cnt
|
||||
$cp_count = 0;
|
||||
$sql = " select cp_id
|
||||
from {$g4['shop_coupon_table']}
|
||||
where mb_id = '{$member['mb_id']}'
|
||||
and cp_used = '0'
|
||||
and cp_start <= '".G4_TIME_YMD."'
|
||||
and cp_end >= '".G4_TIME_YMD."' ";
|
||||
$cp = sql_fetch($sql);
|
||||
$res = sql_query($sql);
|
||||
|
||||
for($k=0; $cp=sql_fetch_array($res); $k++) {
|
||||
if(!is_used_coupon($member['mb_id'], $cp['cp_id']))
|
||||
$cp_count++;
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- 마이페이지 시작 { -->
|
||||
@ -45,7 +47,7 @@ $cp = sql_fetch($sql);
|
||||
<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>
|
||||
<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>
|
||||
<dd><a href="<?php echo G4_SHOP_URL; ?>/coupon.php" target="_blank" class="win_coupon"><?php echo number_format($cp_count); ?></a></dd>
|
||||
<dt>연락처</dt>
|
||||
<dd><?php echo ($member['mb_tel'] ? $member['mb_tel'] : '미등록'); ?></dd>
|
||||
<dt>E-Mail</dt>
|
||||
|
||||
Reference in New Issue
Block a user