当前位置: 首页>>代码示例>>PHP>>正文


PHP is_used_coupon函数代码示例

本文整理汇总了PHP中is_used_coupon函数的典型用法代码示例。如果您正苦于以下问题:PHP is_used_coupon函数的具体用法?PHP is_used_coupon怎么用?PHP is_used_coupon使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了is_used_coupon函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: floor

 ?>
 <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;
     }
     ?>
开发者ID:davis00,项目名称:youngcart,代码行数:31,代码来源:ordersendcostcoupon.php

示例2: apms_coupon_update

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;
}
开发者ID:peb317,项目名称:gbamn,代码行数:19,代码来源:apms.shop.lib.php

示例3: die

    }
    $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;
        }
开发者ID:davis00,项目名称:youngcart,代码行数:31,代码来源:orderformupdate.php

示例4: goto_url

<?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>
开发者ID:ned3y2k,项目名称:youngcart5,代码行数:31,代码来源:mypage.php


注:本文中的is_used_coupon函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。