本文整理汇总了PHP中AZLib::getPrice方法的典型用法代码示例。如果您正苦于以下问题:PHP AZLib::getPrice方法的具体用法?PHP AZLib::getPrice怎么用?PHP AZLib::getPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AZLib
的用法示例。
在下文中一共展示了AZLib::getPrice方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: draw
function draw()
{
global $display;
$item_ids = '';
$item_news = array();
$configs = @CGlobal::$configs['ItemNew']['conf_val'];
if ($configs) {
$configs = unserialize(stripslashes($configs));
$title_new = $configs['title'];
$item_ids = $configs['item_ids'];
} else {
$title_new = "SẢN PHẨM MỚI";
$item_ids = '';
}
if ($item_ids) {
$re = DB::query("SELECT * FROM item WHERE id IN({$item_ids}) AND status = 1 ORDER BY find_in_set(id,'{$item_ids}')");
if ($re) {
while ($product = mysql_fetch_assoc($re)) {
if ($product['img_url']) {
$product['image'] = AZLib::getImageThumb($product['img_url'], 160, 150, 0, $product['img_server']);
} else {
$product['image'] = "";
//"style/images/no-images-35x35.gif";
}
if (isset(CGlobal::$allCategories[$product['category_id']])) {
$product['url'] = WEB_DIR . CGlobal::$allCategories[$product['category_id']]['nice_name'] . "/p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html";
} else {
$product['url'] = WEB_DIR . "p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html";
}
$product['name'] = stripslashes($product['name']);
if ($product['list_brief'] == '') {
$product['list_brief'] = $product['brief'];
}
$product['list_brief'] = AZLib::remove_4_js(AZLib::plainText(AZLib::parseBBCode(html_entity_decode($product['list_brief'], ENT_QUOTES, "UTF-8"))));
$product['list_brief'] = preg_replace("/\\[([\\s]*[0-9]{1,2}[\\s]*)\\]/eis", " ", $product['list_brief']);
$product['list_brief'] = str_replace(array("'", "\""), array("", " "), $product['list_brief']);
$product['list_brief'] = AZLib::word_limit($product['list_brief'], 50, '');
$product['list_brief'] = '<b>' . str_replace(array("'", "\""), array("", " "), $product['name']) . '</b><br />' . $product['list_brief'];
$product['price_num'] = $product['price'];
$product['price'] = AZLib::getPrice($product['price'], $product['currency_id']);
$item_news[$product['id']] = $product;
}
}
}
if (User::is_admin()) {
$display->add("is_admin", 1);
$display->add("msg", $this->showFormErrorMessages(1));
$display->add('begin_form', $this->beginForm(true, 'post', false, false, 1));
$display->add('end_form', $this->endForm(true));
}
$display->add('title_new', $title_new);
$display->add('item_ids', $item_ids);
$display->add('item_news', $item_news);
$display->output("ItemNew");
}
示例2: draw
function draw()
{
if (Item::$item && isset(Item::$item['display']) && Item::$item['display']) {
global $display;
$re = DB::query("SELECT relate_id FROM item_relate WHERE item_id = " . Item::$item['id']);
$relate_ids = '';
$relate_arrs = array();
if ($re) {
while ($relate = mysql_fetch_assoc($re)) {
$relate_ids .= ($relate_ids != '' ? "," : "") . $relate['relate_id'];
}
}
if ($relate_ids) {
$re = DB::query("SELECT * FROM item WHERE id IN({$relate_ids}) AND status = 1 ORDER BY item_order");
$relate_ids = '';
if ($re) {
while ($product = mysql_fetch_assoc($re)) {
$relate_ids .= ($relate_ids != '' ? ',' : '') . $product['id'];
if ($product['img_url']) {
$product['image'] = AZLib::getImageThumb($product['img_url'], 180, 0, 0, $product['img_server']);
} else {
$product['image'] = "";
//"style/images/no-images-35x35.gif";
}
if (isset(CGlobal::$allCategories[$product['category_id']])) {
$product['url'] = WEB_DIR . CGlobal::$allCategories[$product['category_id']]['nice_name'] . "/p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html";
} else {
$product['url'] = WEB_DIR . "p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html";
}
$product['name'] = stripslashes($product['name']);
$product['price'] = AZLib::getPrice($product['price'], $product['currency_id']);
$relate_arrs[] = $product;
}
}
}
$display->add('relate_ids', $relate_ids);
$display->add('relate_arrs', $relate_arrs);
$display->add('item_detail', Item::$item);
$display->add("share_url", urlencode("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']));
$display->add('WEB_NAME', WEB_NAME);
if (User::have_permit(ADMIN_ITEM)) {
$display->add('is_admin', 1);
$display->add('begin_form', $this->beginForm(false, 'post', false, false, 1));
$display->add('end_form', $this->endForm(true));
}
$display->output("ItemRelate");
}
}
示例3: draw
function draw()
{
global $display;
$item_cat_ids = '';
$offer_cats = array();
$item_cats = array();
$item_cat_offer = array();
$configs = @CGlobal::$configs['ItemOffer']['conf_val'];
if ($configs) {
$configs = unserialize(stripslashes($configs));
} else {
$configs = array('title' => "SẢN PHẨM KHUYẾN MẠI", 'item_cat_offer' => array());
}
foreach (CGlobal::$subCategories as $top_id => $sub_cats) {
if (isset(CGlobal::$allCategories[$top_id]) && CGlobal::$allCategories[$top_id]['parent_id'] == 0) {
$topcat = CGlobal::$allCategories[$top_id];
if ($topcat['status'] == "HOME") {
$item_ids = isset($configs['item_cat_offer'][$top_id]) ? $configs['item_cat_offer'][$top_id] : '';
if ($item_ids) {
$item_cat_ids .= ($item_cat_ids != '' ? ',' : '') . $item_ids;
}
$arr = array('id' => $top_id, 'name' => "<a href='" . WEB_DIR . "c{$topcat['id']}/{$topcat['ebname']}'>{$topcat['name']}</a>", 'item_ids' => $item_ids, 'sub' => array(), 'sub_display' => 0);
foreach ($sub_cats as $sid => $subcat) {
$item_ids = isset($configs['item_cat_offer'][$sid]) ? $configs['item_cat_offer'][$sid] : '';
if ($item_ids) {
$arr['sub_display'] = 1;
$item_cat_ids .= ($item_cat_ids != '' ? ',' : '') . $item_ids;
}
$arr['sub'][$sid] = array('id' => $sid, 'name' => "<a href='" . WEB_DIR . "c{$subcat['id']}/{$topcat['ebname']}-{$subcat['ebname']}'>{$subcat['name']}</a>", 'item_ids' => $item_ids);
}
$item_cat_offer[$top_id] = $arr;
}
}
}
if ($item_cat_ids) {
$re = DB::query("SELECT * FROM item WHERE id IN({$item_cat_ids}) AND status = 1 ORDER BY find_in_set(id,'{$item_cat_ids}')");
if ($re) {
while ($product = mysql_fetch_assoc($re)) {
if ($product['img_url']) {
$product['image'] = AZLib::getImageThumb($product['img_url'], 235, 150, 0, $product['img_server']);
} else {
$product['image'] = "";
//"style/images/no-images-35x35.gif";
}
if (isset(CGlobal::$allCategories[$product['category_id']])) {
$product['url'] = WEB_DIR . CGlobal::$allCategories[$product['category_id']]['nice_name'] . "/p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html";
} else {
$product['url'] = WEB_DIR . "p{$product['id']}/" . AZLib::safe_title($product['name']) . ".html";
}
$product['name'] = stripslashes($product['name']);
$product['price_num'] = $product['price'];
$product['price'] = AZLib::getPrice($product['price'], $product['currency_id']);
if ($product['price_out']) {
if ($product['price_num'] < $product['price_out']) {
$product['sale_off'] = floor(100 * ($product['price_out'] - $product['price_num']) / $product['price_out']);
}
$product['price_out'] = AZLib::getPrice($product['price_out'], $product['currency_id']);
}
//level_1_catid
//$topcat_id =
if (isset($configs['item_cat_offer'][$product['level_1_catid']]) && in_array($product['id'], explode(',', $configs['item_cat_offer'][$product['level_1_catid']]))) {
$offer_cats[$product['level_1_catid']] = CGlobal::$allCategories[$product['level_1_catid']];
$item_cats[$product['level_1_catid']][$product['id']] = $product;
}
if (isset($configs['item_cat_offer'][$product['category_id']]) && in_array($product['id'], explode(',', $configs['item_cat_offer'][$product['category_id']]))) {
$offer_cats[$product['category_id']] = CGlobal::$allCategories[$product['category_id']];
$item_cats[$product['category_id']][$product['id']] = $product;
}
}
}
}
if (User::is_admin()) {
$display->add("is_admin", 1);
$display->add("msg", $this->showFormErrorMessages(1));
$display->add('begin_form', $this->beginForm(true, 'post', false, false, 1));
$display->add('end_form', $this->endForm(true));
}
$display->add('title_offer', $configs['title']);
$display->add('item_cat_offer', $item_cat_offer);
$display->add('item_cats', $item_cats);
$display->add('offer_cats', $offer_cats);
################################################################################################################
#ADV config
$config = @CGlobal::$configs['AdvItemOffer']['conf_val'];
$status = 0;
$url_detail = '';
$type_display = 1;
if ($config != '') {
$config_arr = explode("\n", $config);
$status = (int) $config_arr[0];
$url_detail = $config_arr[1];
$type_display = (int) $config_arr[2];
}
if ($status) {
//Bật
if ($type_display == 1) {
$display->add('adv_banner', DATA_PATH . 'adv/AdvItemOffer.gif');
} else {
$display->add('adv_banner', DATA_PATH . 'adv/AdvItemOffer.swf');
}
//.........这里部分代码省略.........