本文整理汇总了PHP中Product::displayImage方法的典型用法代码示例。如果您正苦于以下问题:PHP Product::displayImage方法的具体用法?PHP Product::displayImage怎么用?PHP Product::displayImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Product
的用法示例。
在下文中一共展示了Product::displayImage方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: drawPLthumb
function drawPLthumb($products_linking_id, $products_id, $hide = false, $show_remove = false)
{
$obj_product = new Product($products_id);
$hidden = $hide === true ? 'style="display:none;"' : '';
$l = '<div id="pl-' . $products_linking_id . '" class="pro-thumb" ' . $hidden . '>';
$l .= '<div>' . $obj_product->displayImage(IMAGE_SIZE_THUMBNAIL_2, IMAGE_SIZE_THUMBNAIL_2) . '</div>';
$l .= '<div>' . $obj_product->displayIDAndCode() . '</div>';
if ($show_remove) {
$l .= '<div title="Click to remove this product" class="red">(x) remove</div>';
}
$l .= '</div>';
return $l;
}
示例2: getDisplay
function getDisplay($pid, $spid, $amvd_provision_rate, $row_class = 'o')
{
global $class_jc;
$result = '';
$obj_product = new Product($pid);
$have_amvd_catalog = $obj_product->isAddedToSalesPartner($spid);
$is_active = $obj_product->isActiveInSalesPartner($spid);
$products_image = $obj_product->displayImage(IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1);
$info = '<div style="margin-bottom:20px;">' . $obj_product->displayIDAndCode() . '</div>';
$info .= '<div class="w150" style="margin:0 auto;">' . $obj_product->displayRecentSoldTable() . '</div>';
$navids = array('0' => 'Please select a navigation...');
$navids_opts = retrieveNavIDs($spid, 'bn');
foreach ($navids_opts as $n_id => $n_name) {
//if doesn't work in dev environment, it could be caused by umlauts
//in the navigation name. Can be fixed by adding htmlspecialchars or
//but we don't need it for live (sahat- 16.09.2014)
$navids[$n_id] = $n_name;
}
$navid = $have_amvd_catalog ? $obj_product->getSalesPartnerMainNavigationID($spid) : null;
$navigation = '<select class="navigation input">' . loadComboListFromArray($navids, null, $navid, false) . '</select>';
$result .= '<tr id="' . $pid . '" class="' . $row_class . '">';
$result .= '<td class="img">' . $products_image . '</td>';
$result .= '<td class="name">' . $info . '</td>';
$result .= '<td class="pb">' . $navigation . '</td>';
$btn_update_text = $is_active ? 'Update' : 'Activate';
$btn_add = '<input type="button" style="width:90px;" class="add button blue" value="Add" title="Add this product to AM.VD Catalogue"/>';
$btn_update = '<input type="button" style="width:90px;" class="update button blue" value="' . $btn_update_text . '" title="Update and activate this product on AM.VD Catalogue"/>';
$btn_ignore = '<input type="button" style="width:90px;" class="ignore button" value="Ignore" title="Ignore from list"/>';
$btn_deactivate = '<input type="button" style="width:90px;" class="deactivate button blue" value="Deactivate" title="Deactivate or remove from AM.VD catalog"/>';
$i_hidden = '<input type="hidden" name="jcid" value="' . $obj_product->getSalesPartnerCatalogID($spid) . '"/>';
if ($have_amvd_catalog) {
$btn = $i_hidden . $btn_update . '<br/>' . $btn_deactivate;
} else {
$btn = $btn_add . '<br/>' . $btn_ignore;
}
$result .= '<td class="act">' . $btn;
$result .= '<input type="hidden" class="pid" value="' . $pid . '"/>';
$result .= '</td>';
$result .= '</tr>';
return $result;
}
示例3: loadProductRow
function loadProductRow($pid, $spid, $pos, $curgroup_id)
{
global $class_jc, $header;
use_class('Product');
$product = new Product($pid);
$sp_catalog = $class_jc->retrieveCatalog($spid, "jc.products_id = '{$pid}'");
$cols = array();
foreach ($header as $hk => $hv) {
$value = '';
switch ($hk) {
case 'img':
$value .= $product->displayImage(IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1);
break;
case 'name':
$value .= '<strong>' . $product->brand_name . '</strong>';
$value .= '<br /><a href="?open=product-detail&products_id=' . $product->id . '" target="_blank">' . $product->id . ' / ' . $product->code . '</a>';
break;
case 'imgup':
$img_reupload = $sp_catalog[0]['image_uploaded'] == '0' ? 'checked="checked" ' : '';
$tooltip = $sp_catalog[0]['image_uploaded'] == '0' ? "Uncheck to exclude this product image when generate catalog" : "Check to include this product image when generate catalog";
$value = '<input type="checkbox" name="imguploaded" value="0" title="' . $tooltip . '" ' . $img_reupload . '/>';
break;
case 'prcup':
$price_reupload = $sp_catalog[0]['price_uploaded'] == '0' ? 'checked="checked" ' : '';
$tooltip = $sp_catalog[0]['price_uploaded'] == '0' ? "Uncheck to exclude this product data when generate catalog" : "Check to include this product data when generate catalog";
$value = '<input type="checkbox" name="priceuploaded" value="0" title="' . $tooltip . '" ' . $price_reupload . '/>';
break;
}
if ($value == '') {
$value = ' ';
}
$cols[$hk] = $value;
}
$productrow = '<tr id="temp-' . $pid . '">';
foreach ($cols as $ck => $cv) {
$productrow .= '<td class="' . $ck . '">' . $cv . '</td>';
}
$productrow .= '</tr>';
return $productrow;
}
示例4: array
$query .= " LIMIT {$maxproducts}";
$query .= "))";
$query .= "AS dt";
$query .= " GROUP BY products_id";
$query .= " ORDER BY order_date_max DESC";
$query .= " LIMIT {$maxproducts}";
$r = tep_db_query($query);
$products = array();
while ($row = tep_db_fetch_array($r)) {
$products[$row['products_id']] = $row;
}
if (count($products) > 0) {
$ajaxResult['products_id'] = implode(',', array_reverse(array_keys($products)));
foreach ($products as $pid => $row) {
$obj_product = new Product($pid);
$product_image = $obj_product->displayImage(IMAGE_SIZE_THUMBNAIL_2, IMAGE_SIZE_THUMBNAIL_2, '', false, '', Product::IMAGE_LINKTO_PRODUCT_DETAIL);
$ajaxResult['img-' . $pid] = '<div id="rb-pid-' . $pid . '" style="float:left;margin:0 5px 20px 4px;">' . $product_image . '</div>';
}
} else {
$ajaxResult['products_id'] = 'none';
}
echo ajaxReturn($ajaxResult);
exit;
}
/*
if($_POST['me_action']=='TODOSUSERCOUNTER') {
use_class('minierp_users');
$class_mu = new minierp_users();
$userlist = $class_mu->retrieveList('status="1"','username ASC');
$todos_counter = $class_td->userTodosCounter($userlist);
$result = array();
示例5: webImage
$content .= '<li><a href="#prodet-tab3b"><span>EAN & More Length/Size</span></a></li>';
$content .= '<li><a href="#prodet-tab2"><span>Elements Used</span></a></li>';
if ($pc === false) {
$content .= '<li><a href="#prodet-tab2b"><span>Manual PI</span></a></li>';
}
$content .= '<li><a href="#prodet-tab3"><span>Sales Partner Catalog</span></a></li>';
$content .= '<li><a href="#prodet-tab4"><span>Forecasting</span></a></li>';
$content .= '<li><a href="#prodet-tab5"><span>Finalize for Tradebyte</span></a></li>';
$content .= '</ul>';
//TAB "Main"
$content .= '<div id="prodet-tab1" class="pro-detail">';
//LEFT PANEL
$content .= '<div id="left-panel" style="float:left;margin-top:10px;border:1px solid #efefef;padding:10px;background:#fff;">';
$content .= '<div class="tac">' . ($products_brand != '' ? webImage($products_brand['brand_image'], IMAGE_SIZE_THUMBNAIL_2, '', $products_brand['brand_name']) : '<span class="red">Brand not yet set</span>') . '</div>';
//$content .= webImageWithDetailLinkStars($products['products_image'], IMAGE_SIZE_THUMBNAIL_3, 0, "Main Image of Product $products_id", 'img-border', '', IMAGE_SIZE_BIG_1, 0, $products['stars'], 3, '', '', '', $product);
$content .= $obj_product->displayImage(IMAGE_SIZE_THUMBNAIL_3, IMAGE_SIZE_THUMBNAIL_3_PORTRAIT);
$content .= '<div class="tac" style="margin-top:10px;padding-left:20px;">» ';
if ($products['products_status'] == '1') {
$content .= '<a href="' . JNGWEBADDRESS . 'product_info.php?products_id=' . $products_id . '" target="_blank">View in J&G Website</a>';
} else {
$content .= '<span class="notice">Inactive in J&G Website</span>';
}
$content .= ' «';
foreach ($products_sp_link as $jng_sp_id => $spl) {
$link_text = 'Search in ' . $products_sp[$jng_sp_id]['package_prefix'] . ' Website';
$content .= '<br />» ';
$content .= $spl == '' ? '<span class="notice pointer" title="Required data for search is missing" onclick="alert($(this).attr(\'title\'));">' . $link_text . '</span>' : '<a href="' . $spl . '" target="_blank">' . $link_text . '</a>';
$content .= ' « ';
}
$content .= '</div>';
$content .= '<div class="tac" style="margin-top:20px;">';
示例6: renderRow
public function renderRow($order_type, $orders_items_id, $template_row = self::ROW_TEMPLATE_DEFAULT, $is_order_first_row = false)
{
use_class('Product');
$order_item_data = $this->retrieveOrdersItemsDetail($order_type, $orders_items_id);
$row_data = array();
//SET GENERAL VARS VALUES
$products_id = $order_item_data['products_id'];
$articles_id = $order_item_data['products_articles_id'];
$obj_product = new Product($products_id);
$product_image = $obj_product->displayImage(80, 80);
$product_image_thumbid = "{$products_id}-{$articles_id}";
$article_no_link = '?open=product-detail&products_id=' . $products_id;
switch ($this->filters_status) {
case '1':
$is_sp = $order_type == self::ORDER_TYPE_SP;
$is_prepayment = strtoupper($order_item_data['payment_method']) == strtoupper(PAYMENT_METHOD_BANK_TRANSFER) || strtoupper($order_item_data['payment_method']) == strtoupper(PAYMENT_METHOD_PREPAYMENT);
$is_unpaid_prepayment = $is_prepayment && !conditionPrepaymentIsPaid($order_item_data, $is_sp);
break;
}
if ($order_type == self::ORDER_TYPE_SP) {
use_class('products_minierp');
$class_pm = new products_minierp();
//self::ROW_DATA_LEADTIME_OR_DATE
$order_date = $order_item_data['order_date'];
//self::ROW_DATA_CYCLETIME DATA
$previous_status_date = $this->filters_status == 4 ? $order_item_data['status_date_prod'] : $order_item_data['status_date'];
//self::ROW_DATA_CUSTOMER_OR_ORDER_NO DATA
$order_id = $order_item_data['order_id'];
$orders_number = $order_item_data['order_id'];
$order_no_link = '?open=customer-care-order-detail&source=SP&id=' . $order_item_data['jng_sp_orders_id'] . '&hidemenu=true';
$customer_name = $order_item_data['customer_name'];
$cust_link = '?open=sp-customer&id=' . $order_item_data['jng_sp_customers_id'] . '&hidemenu=true';
$cust_name = '<a href="' . $cust_link . '" class="view_webpage" >' . $customer_name . '</a>';
//self::ROW_DATA_ORDER_ID DATA
$source_name = $order_item_data['package_prefix'];
$barcode_id = strtoupper(self::ORDER_TYPE_SP) . '-' . $order_item_data['jng_sp_orders_items_id'];
$barcode_id_link = '?open=sp-order-history&oi_id=' . $order_item_data['jng_sp_orders_items_id'] . '&hidemenu=true';
$crown_link = '?open=sp-customers-special-detail&id=' . $order_item_data['jng_sp_customers_id'] . '&hidemenu=true';
//self::ROW_DATA_ARTICLE_NO DATA
$product_image_thumbid .= "-{$order_item_data['jng_sp_id']}";
$article_no = $order_item_data['article_number'];
//self::ROW_DATA_PRICE DATA
$products_price = $order_item_data['price'];
//self::ROW_DATA_QUANTITY DATA
$order_quantity = $order_item_data['order_quantity'];
//self::ROW_DATA_MARGIN DATA
$mat_exp = $order_item_data['material_expenses'] > 0 ? $order_item_data['material_expenses'] : $order_item_data['current_mat_exp'];
$product_margin = number_format($class_pm->calculateMargin($order_item_data['price'], $mat_exp), 1) . '%';
$product_margin = '<span class="' . ($class_pm->priceMargindIsGood($order_item_data['price'], $product_margin) ? 'green' : 'red') . '">' . $product_margin . '</span>';
//self::ROW_DATA_ACTION DATA
//Tab Unpaid Prepayment
if ($this->filters_status == 1 && $this->filters_sub_status == '0') {
if ($order_item_data['jng_sp_id'] == '8') {
$action = '<span class="green">Waiting Payment Status</span>';
} else {
if ($order_item_data['last_sent_date'] == '') {
$action = '<span class="green">Reminder Not Sent</span>';
} else {
$overtime = strtotime($order_item_data['last_sent_date']) < strtotime('-' . PAYMENT_METHOD_BANK_TRANSFER_OVERDUE);
if ($order_item_data['sent_count'] > 1) {
$action = '<span class="red">Cancel Notification Sent</span>';
} else {
$action = '<span class="blue">Reminder Sent</span>';
}
}
}
}
} elseif ($order_type == self::ORDER_TYPE_JG) {
//self::ROW_DATA_LEADTIME_OR_DATE
$order_date = $order_item_data['date_purchased'];
//self::ROW_DATA_CYCLETIME DATA
$previous_status_date = $this->filters_status == 4 ? $order_item_data['status_date_prod'] : $order_item_data['status_date'];
//self::ROW_DATA_CUSTOMER_OR_ORDER_NO DATA
$order_id = $order_item_data['orders_no'];
$orders_number = $order_item_data['orders_no'];
$order_no_link = '?open=customer-care-order-detail&source=JG&id=' . $order_item_data['orders_id'] . '&hidemenu=true';
$customer_name = $order_item_data['customers_name'];
$cust_link = '?open=customer&id=' . $order_item_data['customers_id'] . '&hidemenu=true';
$cust_name = '<a href="' . $cust_link . '" class="view_webpage" >' . $customer_name . '</a>';
//self::ROW_DATA_ORDER_ID DATA
$source_name = 'J&G';
$barcode_id = strtoupper(self::ORDER_TYPE_JG) . '-' . $order_item_data['orders_products_id'];
$barcode_id_link = '?open=sp-order-history&opid=' . $order_item_data['orders_products_id'] . '&hidemenu=true';
$crown_link = '?open=customers-special-detail&id=' . $order_item_data['customers_id'] . '&hidemenu=true';
//self::ROW_DATA_ARTICLE_NO DATA
$article_no = $order_item_data['products_model'] . ($order_item_data['products_length'] > 0 ? '_' . textLength($order_item_data['products_length'], false) : '');
//self::ROW_DATA_PRICE DATA
$products_price = $order_item_data['final_price'];
//self::ROW_DATA_QUANTITY DATA
$order_quantity = $order_item_data['products_quantity'];
//self::ROW_DATA_MARGIN DATA
$product_margin = '';
//self::ROW_DATA_ACTION DATA
//Tab Unpaid Prepayment
if ($this->filters_status == 1 && $this->filters_sub_status == '0') {
if ($order_item_data['last_sent_date'] == '') {
$action = '<span class="green">Reminder Not Sent</span>';
} else {
$overtime = strtotime($order_item_data['last_sent_date']) < strtotime('-' . PAYMENT_METHOD_BANK_TRANSFER_OVERDUE);
if ($order_item_data['sent_count'] > 1) {
//.........这里部分代码省略.........
示例7: while
$r = tep_db_query($q);
while ($row = tep_db_fetch_array($r)) {
$grab_article = false;
$pid = $row['products_id'];
$aid = $row['products_articles_id'];
$is_best_product = $row['status'] == '1';
$stock = $row['stock'] - $row['booking_active'];
$stock_and_orders = $stock + $row['ordered'];
if ($stock < 0) {
$stock = 0;
}
if (!isset($p) || !is_object($p) || $p->id != $pid) {
$p = new Product($pid);
$is_in_ltf_col = $p->isLevellingProduct();
}
$image_html = $p->displayImage(IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1);
$dioh = $p->getDIOH($aid, $stock);
$dioh2 = $p->getDIOH($aid, $stock + $row['ordered']);
$dioh_text = $p->displayDIOH($aid, $stock);
$dioh2_text = $p->displayDIOH($aid, $stock_and_orders);
$target = $p->getDIOHstockTarget($aid);
$target_levelling = $p->getLevellingTarget($aid);
$target_after_levelling = $p->getDIOHstockTargetAfterLevelling($aid);
$missing = $target - $stock_and_orders;
if ($missing < 0) {
$missing = 0;
}
$missing_no_refill = $target - $stock;
if ($missing_no_refill < 0) {
$missing_no_refill = 0;
}
示例8: drawProductPriceTable
function drawProductPriceTable(Product $product, $message = '')
{
global $class_sp;
//$supported_sp = array('2', '5', '7', '8');
//$sp_filer = 'jng_sp_id IN ('.implode(',', $supported_sp).') AND ';
$show_jng = !SERVER_IS_LOCAL;
$sp_b2c = $class_sp->retrieveList('use_amvd_logistic = 0');
$sp_b2b = $class_sp->retrieveList('use_amvd_logistic = 1');
$total_sp_b2c = count($sp_b2c);
if ($show_jng) {
$total_sp_b2c += 1;
}
$total_sp_b2b = count($sp_b2b);
$result = '<div id="price-pid-' . $product->id . '" class="product" ' . 'style="clear:left;float:left;margin-bottom:20px;">' . '<div class="draw-table">' . '<table border="0" cellpadding="0" cellspacing="0">' . '<tr>' . '<th rowspan="2">Product</th>' . '<th colspan="2">Info</th>' . '<th colspan="' . $total_sp_b2c . '">B2C</th>';
foreach ($sp_b2b as $sp) {
if ($product->isAddedToSalesPartner($sp['jng_sp_id'])) {
$btn_addto_catalog = '';
} else {
$btn_addto_catalog = '<div style="float:right;"><input ' . 'type="button" class="addtocat" value="add" /></div>';
}
$result .= '<th colspan="2">B2B - ' . $sp['package_prefix'] . '</th>';
/*
$result .= '<th colspan="2"><div>B2B - ' .
$sp['package_prefix'].'</div>' . $btn_addto_catalog . '</th>';
*/
}
$result .= $b2b . '</tr>' . '<tr>' . '<th>Name</th>' . '<th class="bold">DEFAULT</th>';
if ($show_jng) {
$result .= '<th>JG.DE</th>';
}
foreach ($sp_b2c as $sp) {
$result .= '<th>' . $sp['package_prefix'] . '</th>';
}
foreach ($sp_b2b as $sp) {
$result .= '<th>No Discount</th>';
$result .= '<th>Discount</th>';
}
$jng_id = '0';
$cogs = $product->getProductCOGSValue();
$price_uvp = $product->getPriceUVP();
$price_uvp_text = displayCurrency(CURRENCY_DEFAULT, $price_uvp, false, 2);
$price_default = $product->getPriceDefault();
$price_default_text = displayCurrency(CURRENCY_DEFAULT, $price_default, false, 2);
$price_jng = $product->getPriceSelling($jng_id);
$price_options = array('Show Discount', 'Hide Discount');
//, 'No Discount');
$price_options_combo = '<select name="price_option" style="display:none;">' . '%s</select><span class="notice price_option_none" style="display:none;">' . 'No Discount</span>';
$price_option_jng = loadComboListFromArray($price_options, null, $product->isPriceSellingUsingDiscount($jng_id) ? 0 : 1, false);
$sp_type_default = '<input type="hidden" name="sp_type" value="DEF" />';
$sp_type_b2c = '<input type="hidden" name="sp_type" value="B2C" />';
$sp_type_b2b_nodisc = '<input type="hidden" name="sp_type" value="B2B-ND" />';
$sp_type_b2b_disc = '<input type="hidden" name="sp_type" value="B2B-D" />';
$sp_id_jng = '<input type="hidden" name="sp_id" value="0" />';
if (SERVER_IS_LOCAL) {
$class_add = ' readonly';
$editable = ' readonly="readonly"';
} else {
$class_add = '';
$editable = '';
}
$result .= '</tr>' . '<tr class="o">' . '<td class="w200 tac"><div>' . $product->displayImage(IMAGE_SIZE_THUMBNAIL_2, IMAGE_SIZE_THUMBNAIL_2_PORTRAIT) . '</div>' . '<div>' . $product->displayIDAndCode() . '</div>' . '</td>' . '<td class="w150">' . '<div class="cr cr-status">Status</div>' . '<div class="cr cr-uvp">UVP</div>' . '<div class="cr cr-sp">Selling Price</div>' . '<div class="cr cr-factor">Factor</div>' . '<div class="cr cr-disc">Discount</div>' . '<div class="cr cr-option">Price Option</div>' . '<div class="cr cr-preview">Price Preview</div>' . '<div class="cr cr-cogs">COGS</div>' . '<div class="cr cr-profit">Profit</div>' . '<div class="cr cr-margin">Margin</div>' . '<div class="cr cr-premium">Premium</div>' . '</td>' . '<td class="w100 tac">' . '<input type="hidden" name="cogs" value="' . $cogs . '" />' . '<div class="cr cr-status notice">-</div>' . '<div class="cr cr-uvp"><input type="text" name="price-uvp-default" class="w080 tac' . $class_add . '" value="' . $price_uvp . '"' . $editable . ' /></div>' . '<div class="cr cr-sp"><input type="text" name="price-default" class="w080 tac' . $class_add . '" value="' . $price_default . '"' . $editable . ' />' . $sp_type_default . '</div>' . '<div class="cr cr-factor notice">-</div>' . '<div class="cr cr-disc"> </div>' . '<div class="cr cr-option notice">-</div>' . '<div class="cr cr-preview"> </div>' . '<div class="cr cr-cogs">' . $cogs . '</div>' . '<div class="cr cr-profit"> </div>' . '<div class="cr cr-margin"> </div>' . '<div class="cr cr-premium"> </div>' . '</td>';
if ($show_jng) {
//COLUMN J&G
$result .= '<td class="w100 tac">' . '<div class="cr cr-status">' . $product->displayActiveStatusIcon($jng_id) . '</div>' . '<div class="cr cr-uvp"><input type="text" name="price-uvp" class="w080 tac b2c readonly" value="' . $price_uvp . '" readonly="readonly" />' . $sp_type_b2c . $sp_id_jng . '</div>' . '<div class="cr cr-sp"><input type="text" name="price-selling" class="w080 tac b2c" value="' . $price_jng . '" />' . $sp_type_b2c . $sp_id_jng . '</div>' . '<div class="cr cr-factor notice">-</div>' . '<div class="cr cr-disc"> </div>' . '<div class="cr cr-option">' . sprintf($price_options_combo, $price_option_jng) . $sp_id_jng . '</div>' . '<div class="cr cr-preview"> </div>' . '<div class="cr cr-cogs notice">' . $cogs . '</div>' . '<div class="cr cr-profit"> </div>' . '<div class="cr cr-margin"> </div>' . '<div class="cr cr-premium"> </div>' . '</td>';
}
//COLUMN PER SP (B2C)
foreach ($sp_b2c as $sp) {
$result .= '<td class="w100 tac">';
$result .= '<div class="cr cr-status">' . $product->displayActiveStatusIcon($sp['jng_sp_id']) . '</div>';
if ($product->isAddedToSalesPartner($sp['jng_sp_id'])) {
$sp_id = '<input type="hidden" name="sp_id" value="' . $sp['jng_sp_id'] . '" />';
$price_selling_old = $product->getPriceSellingOld($sp['jng_sp_id']);
$price_selling = $product->getPriceSelling($sp['jng_sp_id']);
$price_option_sp = loadComboListFromArray($price_options, null, $product->isPriceSellingUsingDiscount($sp['jng_sp_id']) ? 0 : 1, false);
if (SERVER_IS_LOCAL) {
$price_uvp_sp = $price_selling_old > 0 ? $price_selling_old : $price_selling;
$sp_uvp_class = '';
$sp_uvp_dis = '';
} else {
$price_uvp_sp = $price_uvp;
$sp_uvp_class = ' readonly';
$sp_uvp_dis = ' readonly="readonly"';
}
$result .= '<div class="cr cr-uvp">' . '<input type="text" name="price-uvp" class="w080 tac b2c' . $sp_uvp_class . '"' . ' value="' . $price_uvp_sp . '" ' . $sp_uvp_dis . ' />' . $sp_id . '</div>';
$result .= '<div class="cr cr-sp"><input type="text" name="price-selling" class="w080 tac b2c" value="' . $price_selling . '" />' . $sp_type_b2c . $sp_id . '</div>' . '<div class="cr cr-factor notice">-</div>' . '<div class="cr cr-disc"> </div>' . '<div class="cr cr-option">' . sprintf($price_options_combo, $price_option_sp) . $sp_id . '</div>' . '<div class="cr cr-preview"> </div>' . '<div class="cr cr-cogs notice">' . $cogs . '</div>' . '<div class="cr cr-profit"> </div>' . '<div class="cr cr-margin"> </div>' . '<div class="cr cr-premium"> </div>';
} else {
// $result .= '<span class="red">Not<br />added<br />yet to' .
// '<br />catalog</span><br /><br /><input type="button" ' .
// 'value="Add Now" title="Click here to add product now '.
// 'to this Sales Partner Catalog" />';
$result .= '<div class="cr cr-uvp notice">-</div>' . '<div class="cr cr-sp notice">-</div>' . '<div class="cr cr-factor notice">-</div>' . '<div class="cr cr-disc notice">-</div>' . '<div class="cr cr-option notice">-</div>' . '<div class="cr cr-preview notice">Not Added to Catalog</div>' . '<div class="cr cr-cogs notice">-</div>' . '<div class="cr cr-profit notice">-</div>' . '<div class="cr cr-margin notice">-</div>' . '<div class="cr cr-premium notice">-</div>';
}
$result .= '</td>';
}
//2 COLUMNS PER SP (B2B)
foreach ($sp_b2b as $sp) {
$status = $product->displayActiveStatusIcon($sp['jng_sp_id']);
$status_nodisc = ' ';
$status_disc = ' ';
$sp_id = '<input type="hidden" name="sp_id" value="' . $sp['jng_sp_id'] . '" />';
//.........这里部分代码省略.........
示例9: postProcess
//.........这里部分代码省略.........
$result['total_sales_l90d'] = displayCurrency(DEFAULT_CURRENCY, $total_sales_l90d);
$result['total_sold_l30d'] = $total_sold_l30d;
$result['total_sold_l60d'] = $total_sold_l60d;
$result['total_sold_l90d'] = $total_sold_l90d;
$result['products_ids'] = implode(',', $products_ids);
} elseif ($post_vars['me_action'] == 'DISPLAY') {
use_class('products_minierp');
use_class('minierp_users');
use_class('Product');
$class_pm = new products_minierp();
$class_mu = new minierp_users();
$jng_sp_id = $post_vars['jng_sp_id'];
$type = $post_vars['type'];
$products_id = $post_vars['products_id'];
$is_killed = $post_vars['is_killed'];
$is_sp_not_yet_added = $post_vars['is_sp_not_yet_added'];
$added_post_vars = array('is_killed' => $is_killed, 'is_sp_not_yet_added' => $is_sp_not_yet_added);
$display_type = $post_vars['display_type'];
$row_number = $post_vars['row_number'];
$showing_id = $post_vars['showing_id'];
$obj_product = new Product($products_id);
$display_res = $this->retrieveDataForDisplay($jng_sp_id, $products_id, $added_post_vars, $display_type);
$res = $display_res[0];
$img_size = $display_type == 'thumbnail' ? IMAGE_SIZE_THUMBNAIL_2 : IMAGE_SIZE_THUMBNAIL_1;
//SHOW PURE IMAGE FOR SP THAT USED IT AS MAIN IMAGE
if (in_array($jng_sp_id, $this->sp_use_pure_image)) {
$obj_product->setDisplayImage(Product::IMAGE_TYPE_ZALANDO);
} else {
if (in_array($jng_sp_id, $this->sp_use_clear_image)) {
$obj_product->setDisplayImage(Product::IMAGE_TYPE_AMAZON);
}
}
//$products_image = webImageWithDetailLinkStars($image_used, $img_size, $img_size, 'Product '.$products_id, 'img-border', 'View Larger Image', IMAGE_SIZE_BIG_1, '', $res['stars'], 3, '', '', $res['products_brand_id']);
$products_image = $obj_product->displayImage($img_size, $img_size);
$position_padding = $display_type == 'thumbnail' ? '2px 0 0 15px;' : '';
$products_image = webImageAddPosition($row_number, $products_image, $position_padding);
$products_complexity = productComplexityName($res['complexity']);
$products_stars = drawStars($res['stars']);
$products_is_watched = $class_mu->isOnWatchlist($session_userinfo['id'], $products_id);
$resultsdt = array();
if ($display_type == 'table' || $type == 'displaytooltip') {
if ($type == 'thumbnail_tooltip') {
//HTML Version result
$sales_partner_id = $jng_sp_id == 'allsp' ? '0' : $jng_sp_id;
//TODO: seperate B2C and B2b calculation, or even better is if
// we can calculate it by the object directly
$price = $obj_product->getPriceSelling($sales_partner_id);
$net_price = Product::calculateNetPrice($price, VAT);
$cogs = $obj_product->getProductCOGSValue();
$profit = Product::calculateProfit($net_price, $cogs);
$margin = Product::calculateMargin($profit, $net_price);
$jng_nodata = '<span class="notice">N/A for J&G</span>';
$infos = array();
$infos[] = $obj_product->displayIDAndCode();
$infos[] = $res['products_name'];
if ($res['hh_stock'] > 0) {
$infos[] = '<strong class="green">Depot Stock = ' . $res['hh_stock'] . '</strong>';
} else {
$infos[] = '<strong>Depot Stock = 0</strong>';
}
$infos[] = 'Complexity = ' . $products_complexity;
if ($res['sample_created'] == '1') {
$infos[] = '<span class="green">Sample order created</span>';
} else {
$infos[] = '<span class="notice">No sample order created</span>';
}
示例10: Product
$imgwidth = '';
$imgheight = '';
}
if (strlen($product_entry) == 13) {
$obj_product = Product::loadObjectFromEAN($product_entry);
} else {
$obj_product = Product::loadObjectFromProductCode($product_entry);
if ($obj_product === false) {
$obj_product = new Product($product_entry);
}
}
$result = '';
if ($obj_product === false) {
$result .= '<h3 class="red">Product <strong>' . $product_entry . '</strong> not found!</h3>';
} else {
$result .= '<div style="float:left;">' . $obj_product->displayImage(IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1_PORTRAIT) . '</div><div style="margin-left:120px;">';
$attributes = ProductAttribute::getOldStylesFunction()->getProductStyles($obj_product->id);
$total_images = 0;
foreach ($attributes[ProductAttribute::GROUP_ID_PACKAGING] as $attribute_id => $attribute_name) {
$obj_pa = new ProductAttribute($attribute_id);
foreach ($obj_pa->getAttachmentsAsObject()->getFilesAsArray() as $img_index => $img_file) {
$total_images++;
$result .= '<div style="margin-bottom:10px;">' . $obj_pa->getAttachmentsAsObject()->displayImageFile($img_index, $imgwidth, $imgheight) . '</div>';
}
}
if ($total_images == 0) {
$result .= ERROR_MESSAGE_NOIMAGE;
}
$result .= '</div>';
}
echo utf8_encode($result);
示例11: elseif
echo "REM-{$pid}";
exit;
} elseif ($_POST['me_action'] == 'LOADPRODUCT') {
$pid = tep_db_prepare_input($_POST['pid']);
$pos = tep_db_prepare_input($_POST['pos']) + 1;
$obj_product = new Product($pid);
$product = $class_pm->retrieveDetail($pid, 'p,pd,pl,sp');
$product_sp = $class_jc->retrieveDetail(null, $jng_sp_id, $pid);
$added = is_array($product_sp) && isset($product_sp['active_status']);
$stock = $class_pm->stockRetrieve(WAREHOUSE_ID_PRODUCTS_HAMBURG, $pid);
$cols = array();
foreach ($header as $hk => $hv) {
$value = '';
switch ($hk) {
case 'img':
$value .= webImageAddPosition($pos, $obj_product->displayImage(IMAGE_SIZE_THUMBNAIL_2, IMAGE_SIZE_THUMBNAIL_2_PORTRAIT));
break;
case 'nm w300':
$value .= $product['p']['products_brand_name'];
$value .= '<br />' . $obj_product->displayIDAndCode();
$value .= '<br />' . $product['pd']['2']['products_name'];
$value .= '<br /><br /><a href="?open=products-price&pids=' . $pid . '&hidemenu=true&hidecopyurl=true"';
$value .= ' class="bold view_webpage">» Click here to manage price details!</a>';
break;
case 'ps w150':
$value .= $obj_product->displayRecentSoldTable();
$value .= '<br /><br />';
$value .= $obj_product->displayYearlySoldTable();
break;
case 'st w100':
$value .= strval($stock);
示例12: strtoupper
return $return;
}
if (isset($_POST['me_action']) && $_POST['me_action'] == 'PROCESS') {
$spid = strtoupper(tep_db_prepare_input($_POST['spid']));
$products_id = tep_db_prepare_input($_POST['pid']);
$week_start = str_ireplace('week', '-', tep_db_prepare_input($_POST['start_week']));
$week_end = str_ireplace('week', '-', tep_db_prepare_input($_POST['end_week']));
$p = $class_pm->retrieveDetail($products_id, 'p');
$not_available_text = '<span class="notice">N/A</span>';
$result = '<div id="box-' . $products_id . '" class="float-left ui-corner-all" style="margin:10px 10px 0 0; padding:10px; border:solid 1px #ccc;">';
if ($p['p'] !== false) {
//Get Product Info
$product = new Product($products_id);
$product_info = "{$product->id}/{$product->code}";
$result .= ' <div class="tac">';
$result .= $product->displayImage(IMAGE_SIZE_THUMBNAIL_2, IMAGE_SIZE_THUMBNAIL_2);
$link_product = '<a href="?open=product-detail&hidemenu=true&products_id=' . $products_id . '" class="view_webpage"> ' . $product_info . '</a>';
$result .= ' <br/>' . $link_product;
if ($product->isAddedToSalesPartner($spid) || $spid == 'ALL') {
$cogs = $product->getProductCOGSValue();
//Get price selling
if ($spid == 'ALL') {
$price_selling = $product->getPriceDefault();
} else {
$price_selling = $product->getPriceSelling($spid);
}
//Get total sold
$total_sold = $not_available_text;
if ($spid > 0 || $spid == 'ALL') {
$total_sold = $class_jc->getTotalSold($products_id, $spid);
}