本文整理汇总了PHP中global_common::FormatPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP global_common::FormatPrice方法的具体用法?PHP global_common::FormatPrice怎么用?PHP global_common::FormatPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类global_common
的用法示例。
在下文中一共展示了global_common::FormatPrice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildPathProduct
public function buildPathProduct($connection, $productID, $type)
{
$objRetailer = new Model_Retailer($connection);
$inPrices = $objRetailer->getRetailerByProduct($productID);
//'<a href="#" class="link">Chi tiết sản phẩm</a> =>
//<a href="#" class="link">Hàng mới từ 12.000.000đ</a> |
//<span>Hàng mới cũ 10.000.000đ</span> | <a href="#" class="link">Hàng refurbished từ 12.000.000đ</a> ';
$path = '<a href="' . global_common::buildProductLink($productID) . '" class="link">Chi tiết sản phẩm</a> =>';
$priceNew = 0;
$priceUsed = 0;
$priceRefur = 0;
foreach ($inPrices as $item) {
if ($item[global_mapping::ProductStatusID] == global_common::STATUS_PRODUCT_NEW) {
$priceNew = global_common::FormatPrice($item[global_mapping::Price]);
}
if ($item[global_mapping::ProductStatusID] == global_common::STATUS_PRODUCT_USED) {
$priceUsed = global_common::FormatPrice($item[global_mapping::Price]);
}
if ($item[global_mapping::ProductStatusID] == global_common::STATUS_PRODUCT_Refurbished) {
$priceRefur = global_common::FormatPrice($item[global_mapping::Price]);
}
}
if ($type == global_common::STATUS_PRODUCT_NEW) {
$path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_NEW) . '" class="link active">Hàng mới từ ' . $priceNew . '</a> | ';
} else {
$path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_NEW) . '" class="link">Hàng mới từ ' . $priceNew . '</a> | ';
}
if ($type == global_common::STATUS_PRODUCT_USED) {
$path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_USED) . '" class="link active">Hàng cũ từ ' . $priceUsed . '</a> | ';
} else {
$path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_USED) . '" class="link">Hàng cũ từ ' . $priceUsed . '</a> | ';
}
if ($type == global_common::STATUS_PRODUCT_Refurbished) {
$path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_Refurbished) . '" class="link active">Hàng Refurbished từ ' . $priceRefur . '</a>';
} else {
$path .= '<a href="' . global_common::buildPriceLink($productID, global_common::STATUS_PRODUCT_Refurbished) . '" class="link">Hàng Refurbished từ ' . $priceRefur . '</a>';
}
return $path;
}
示例2: foreach
echo 'Ngày bán';
echo '</th>';
echo '<th>';
echo 'Ngày cập nhật';
echo '</th>';
echo '<th>';
echo 'Action';
echo '</th>';
echo '</thead>';
foreach ($allRetailers as $item) {
echo '<tr>';
echo '<td>';
echo $item[global_mapping::ProductName];
echo '</td>';
echo '<td style="padding:0;width:200px">';
echo global_common::FormatPrice($item[global_mapping::Price]);
echo '</td>';
echo '<td>';
echo $item[global_mapping::CreatedBy][global_mapping::UserName];
echo '</td>';
echo '<td>';
echo global_common::formatDateTimeVN($item[global_mapping::CreatedDate]);
echo '</td>';
echo '<td>';
echo global_common::formatDateTimeVN($item[global_mapping::ModifiedDate]);
echo '</td>';
echo '<td style="padding:0;width:180px">';
echo '<a href="' . global_common::buildRetailerLink($item[global_mapping::RetailerID], true) . '" target="_blank" class="btn btn-mini"> View</a> ';
if ($item[global_mapping::StatusID] == global_common::STATUS_INACTIVE) {
echo '<a href="javascript:retailer.activateRetailer(\'' . $item[global_mapping::RetailerID] . '\',' . global_common::STATUS_ACTIVE . ', retailer.AdminPage)" class="btn btn-mini">Bán lại</a>';
} else {
示例3: foreach
<table class="table table-bordered table-hover article-profile">
<thead>
<tr>
<th class="span4">Tên sản phẩm</th>
<th class="span2">Giá bán</th>
<th style="width:120px">Tình trạng</th>
<th style="width:100px">Cập nhật</th>
<th style="width:120px"></th>
</tr>
</thead>
<tbody>
<?php
foreach ($allRetailers as $item) {
echo ' <tr>';
echo ' <td><a href="' . global_common::buildProductLink($item[global_mapping::ProductID]) . '" >' . $item[global_mapping::ProductName] . '</a></td>';
echo ' <td class="">' . global_common::FormatPrice($item[global_mapping::Price]) . '</td>';
echo ' <td class="">' . $item[global_mapping::ProductStatus] . ' ' . $item[global_mapping::StatusDetail] . '</td>';
echo ' <td >' . global_common::formatDateTimeVN($item[global_mapping::ModifiedDate]) . '</td>';
echo ' <td class="article-control">';
echo ' <a href="post_price.php?pid=' . $item[global_mapping::ProductID] . '&rid=' . $item[global_mapping::RetailerID] . '" class="btn btn-mini">Sửa</a>';
//echo ' <a href="javascript:article.refreshArticle(\''.$item[global_mapping::ArticleID].'\')" class="btn btn-mini">Làm mới</a>';
echo ' <a href="javascript:retailer.deleteRetailer(\'' . $item[global_mapping::ProductName] . '\',\'' . $item[global_mapping::RetailerID] . '\')" class="btn btn-mini">Xóa</a>';
if ($item[global_mapping::StatusID] == global_common::STATUS_INACTIVE) {
echo ' <a href="javascript:retailer.activateRetailer(\'' . $item[global_mapping::RetailerID] . '\',' . global_common::STATUS_INACTIVE . ')" class="btn btn-mini">Bán lại</a>';
} else {
echo ' <a href="javascript:retailer.activateRetailer(\'' . $item[global_mapping::RetailerID] . '\',' . global_common::STATUS_ACTIVE . ')" class="btn btn-mini">Dừng bán</a>';
}
echo ' </td>';
echo ' </tr>';
}
?>