Ejemplo n.º 1
0
}
?>

<?php 
//get the coupon amount and code
$uri = $_SERVER['REQUEST_URI'];
$coupon_url = explode('=', $uri);
if (is_numeric($coupon_url[1])) {
    $coupon_id = $coupon_url[1];
    $gifttype = '';
} else {
    $coupon_url = explode('&', $coupon_url[1]);
    $coupon_id = $coupon_url[0];
    $gifttype = 'gift';
}
$coupon_info = get_coupon_code($coupon_id);
if (mysql_num_rows($coupon_info) > 0) {
    while ($row = mysql_fetch_array($coupon_info)) {
        $coupon_code = $row["coupon_id"];
        $total_payable_amount = $row["coupon_value"];
        if (ctype_digit($total_payable_amount)) {
            $total_payable_amount = $total_payable_amount;
        } else {
            $total_payable_amount = number_format($total_payable_amount, 2, ',', '');
            $total_payable_amount = explode(',', $total_payable_amount);
            $total_payable_amount = $total_payable_amount[0] . '.' . $total_payable_amount[1];
        }
        $couponname = html_entity_decode($row["coupon_name"], ENT_QUOTES);
        $coupondesc = html_entity_decode($row["coupon_description"], ENT_QUOTES);
    }
}
                $mod = $i % 2;
                ++$i;
                ?>
<li><a href="javascript:vod(0);"><img src="<?php 
                echo get_cover(get_icon($vo["couponid"]), 'path');
                ?>
"  width="170" height="170"/></a></p>
				<p><a href="javascript:vod(0);"><span class="red"><?php 
                echo get_coupon_name($vo["couponid"]);
                ?>
</span></a>[<?php 
                echo $vo["info"];
                ?>
]</p> 
				<p>优惠券代码:<?php 
                echo get_coupon_code($vo["couponid"]);
                ?>
</a></p> 
                 <p>价值:<span class="red"><?php 
                echo get_coupon_price($vo["couponid"]);
                ?>
元</span>
                 </p><?php 
            }
        }
    } else {
        echo "";
    }
    ?>
	</ul><?php 
}