Exemplo n.º 1
0
 ?>
 <div class="tbl_head02 tbl_wrap">
     <table>
     <caption>쿠폰 선택</caption>
     <thead>
     <tr>
         <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 (is_used_coupon($member['mb_id'], $row['cp_id'])) {
         continue;
     }
     $dc = 0;
     if ($row['cp_type']) {
         $dc = floor($send_cost * ($row['cp_price'] / 100) / $row['cp_trunc']) * $row['cp_trunc'];
     } else {
         $dc = $row['cp_price'];
     }
     if ($row['cp_maximum'] && $dc > $row['cp_maximum']) {
         $dc = $row['cp_maximum'];
     }
     if ($dc > $send_cost) {
         $dc = $send_cost;
     }
     ?>
Exemplo n.º 2
0
function apms_coupon_update($mb_id)
{
    global $g5;
    if (!$mb_id) {
        return;
    }
    $sql = " select cp_id from {$g5['g5_shop_coupon_table']} where mb_id IN ('{$mb_id}', '전체회원') and cp_start <= '" . G5_TIME_YMD . "' and cp_end >= '" . G5_TIME_YMD . "'";
    $result = sql_query($sql);
    $k = 0;
    for ($i = 0; $row = sql_fetch_array($result); $i++) {
        if (is_used_coupon($mb_id, $row['cp_id'])) {
            continue;
        }
        $k++;
    }
    // 보유 쿠폰 업데이트
    sql_query(" update {$g5['member_table']} set as_coupon = '{$k}' where mb_id = '{$mb_id}' ", false);
    return;
}
Exemplo n.º 3
0
    }
    $tot_cp_price = $tot_it_cp_price + $tot_od_cp_price;
}
if ((int) ($row['od_price'] - $tot_cp_price) !== $i_price) {
    die("Error.");
}
// 배송비가 상이함
$send_cost = get_sendcost($tmp_cart_id);
$tot_sc_cp_price = 0;
if ($is_member && $send_cost > 0) {
    // 배송쿠폰
    if ($_POST['sc_cp_id']) {
        $sql = " select cp_id, cp_type, cp_price, cp_trunc, cp_minimum, cp_maximum\n                    from {$g5['g5_shop_coupon_table']}\n                    where cp_id = '{$_POST['sc_cp_id']}'\n                      and mb_id IN ( '{$member['mb_id']}', '전체회원' )\n                      and cp_start <= '" . G5_TIME_YMD . "'\n                      and cp_end >= '" . G5_TIME_YMD . "'\n                      and cp_method = '3' ";
        $cp = sql_fetch($sql);
        // 사용한 쿠폰인지
        $cp_used = is_used_coupon($member['mb_id'], $cp['cp_id']);
        $dc = 0;
        if (!$cp_used && $cp['cp_id'] && $cp['cp_minimum'] <= $tot_od_price) {
            if ($cp['cp_type']) {
                $dc = floor($send_cost * ($cp['cp_price'] / 100) / $cp['cp_trunc']) * $cp['cp_trunc'];
            } else {
                $dc = $cp['cp_price'];
            }
            if ($cp['cp_maximum'] && $dc > $cp['cp_maximum']) {
                $dc = $cp['cp_maximum'];
            }
            if ($dc > $send_cost) {
                $dc = $send_cost;
            }
            $tot_sc_cp_price = $dc;
        }
Exemplo n.º 4
0
<?php

include_once './_common.php';
if (!$is_member) {
    goto_url(G5_BBS_URL . "/login.php?url=" . urlencode(G5_SHOP_URL . "/mypage.php"));
}
$g5['title'] = '마이페이지';
include_once G5_MSHOP_PATH . '/_head.php';
// 쿠폰
$cp_count = 0;
$sql = " select cp_id\n            from {$g5['g5_shop_coupon_table']}\n            where mb_id IN ( '{$member['mb_id']}', '전체회원' )\n              and cp_start <= '" . G5_TIME_YMD . "'\n              and cp_end >= '" . G5_TIME_YMD . "' ";
$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">

    <section id="smb_my_ov">
        <h2>회원정보 개요</h2>
        <ul>
            <li  class="my_cou">보유쿠폰<a href="<?php 
echo G5_SHOP_URL;
?>
/coupon.php" target="_blank" class="win_coupon"><?php 
echo number_format($cp_count);
?>
</a></li>