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


PHP products_minierp::priceMargindIsGood方法代码示例

本文整理汇总了PHP中products_minierp::priceMargindIsGood方法的典型用法代码示例。如果您正苦于以下问题:PHP products_minierp::priceMargindIsGood方法的具体用法?PHP products_minierp::priceMargindIsGood怎么用?PHP products_minierp::priceMargindIsGood使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在products_minierp的用法示例。


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

示例1: array

 $res = array();
 $res = $class_ps->retrieveDataForDisplay($sp_id, $pids[0]);
 //echo "<pre>";var_dump($res);die();
 $res = $res[0];
 $products_image = webImageWithDetailLink($res['products_image'], IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, 'Product ' . $pids[0], 'img-border');
 $products_price_old = displayCurrency('', $res['products_price_old']);
 $products_price = displayCurrency('', $res['products_price']);
 $discount = number_format($res['products_discount'], 2);
 $products_created = date('d-M-Y', strtotime($res['products_date_added']));
 $returned_rate = number_format($res['returned_rate'], 2);
 $total_sales = number_format($res['total_sales'], 2);
 $vc_now = number_format($res['vc_now'], 2);
 $total_vc = number_format($res['total_vc'], 2);
 $vc_percent = number_format($res['vc_percent'], 2);
 $margin = $res['margin'];
 $margin = '<span class="' . ($class_pm->priceMargindIsGood($res['products_price'], $margin) ? 'green' : 'red') . '">' . number_format($margin, 1) . '%</span>';
 $sales_monthly = number_format($res['sales_monthly'], 1);
 $sales_weekly = number_format($res['sales_weekly'], 1);
 $products_complexity = productComplexityName($res['complexity']);
 $products_stars = $class_pm->getDisplayStars('', $res['stars']);
 $t = array();
 $t['no'] = '<div>' . $n . '</div>';
 $t['image'] = '<div>' . $products_image . '</div>';
 $t['info'] = '<div><a href="?open=product-detail&products_id=' . $res['products_id'] . '" target="_blank">';
 $t['info'] .= $res['products_id'] . ' / ' . $res['products_model'] . '</a><br/>' . $res['products_name'] . '<br/>' . $products_stars . '<br/><br/>&raquo;&nbsp;';
 $hh_stock = $res['hh_stock'] > 0 ? $res['hh_stock'] : '0';
 $t['info'] .= '<strong class="' . ($res['hh_stock'] > 0 ? 'green' : '') . '">Depot HH Stock = ' . $hh_stock . '</strong>';
 $t['info'] .= '<br/>&raquo;&nbsp;Complexity = ' . $products_complexity . '</div>';
 $t['created'] = '<div>' . $products_created . '</div>';
 $t['priceold'] = '<div>' . $products_price_old . '</div>';
 $t['price'] = '<div>' . $products_price . '</div>';
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:products-show.php

示例2: while

     $q .= " LEFT JOIN jng_sp_catalog {$alias}";
     $q .= "     ON {$alias}.jng_sp_id={$jng_sp_id} AND {$alias}.products_id=p.products_id";
 }
 $q .= " WHERE p.products_id = {$pid}";
 $r = tep_db_query($q);
 $no_old_price = '<span style="color:#ababab;">No Old Price</span>';
 while ($row = tep_db_fetch_array($r)) {
     $price_old = round($product['p']['products_price_old'], 2);
     $price = round($product['p']['products_price'], 2);
     $net_price = product::calculateNetPrice($price, VAT);
     $mat_expense = $product['p']['material_expenses'];
     $cogs = product::calculateCOGS($mat_expense, $product['p']['complexity']);
     $profit = product::calculateProfit($net_price, $cogs);
     $profit_old = product::calculateProfit($net_price, $mat_expense);
     $margin = product::calculateMargin($profit, $net_price);
     $margin_is_good = $class_pm->priceMargindIsGood($price, $margin);
     $margin_old = product::calculateMargin($profit_old, $net_price);
     $margin_old_is_good = $class_pm->priceMargindIsGood($price, $margin_old);
     $premium = $class_pm->calcPremiumPrice($price, $cogs);
     $premium_old = $class_pm->calcPremiumPrice($price, $mat_expense);
     $purchase_price = product::calculatePurchasePrice($cogs);
     $purchase_price_old = product::calculatePurchasePrice($mat_expense);
     $is_active = $row['products_status'] == '1';
     $status_price = $row['jng_status_price'];
     $jng_icon_eye = $is_active ? getIconEyePricesBasedOnRules($status_price, 'jg') : array();
     $jng = '<img src="/images/icon-tick' . ($is_active ? '' : '-dis') . '.png" class="activation" />';
     $jng .= '<br /><br />';
     if ($row['jng_price_old'] > 0) {
         $jng_price_old = '<span class="price-old">' . displayCurrency('EUR', $row['jng_price_old']) . '</span>';
         $jng .= $jng_price_old . $jng_icon_eye['price_old'];
     } else {
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:31,代码来源:sp-prices-manage-display.php

示例3: 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&amp;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&amp;source=SP&amp;id=' . $order_item_data['jng_sp_orders_id'] . '&amp;hidemenu=true';
         $customer_name = $order_item_data['customer_name'];
         $cust_link = '?open=sp-customer&amp;id=' . $order_item_data['jng_sp_customers_id'] . '&amp;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&amp;oi_id=' . $order_item_data['jng_sp_orders_items_id'] . '&amp;hidemenu=true';
         $crown_link = '?open=sp-customers-special-detail&amp;id=' . $order_item_data['jng_sp_customers_id'] . '&amp;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&amp;source=JG&amp;id=' . $order_item_data['orders_id'] . '&amp;hidemenu=true';
         $customer_name = $order_item_data['customers_name'];
         $cust_link = '?open=customer&amp;id=' . $order_item_data['customers_id'] . '&amp;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&amp;opid=' . $order_item_data['orders_products_id'] . '&amp;hidemenu=true';
         $crown_link = '?open=customers-special-detail&amp;id=' . $order_item_data['customers_id'] . '&amp;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) {
//.........这里部分代码省略.........
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:101,代码来源:OrderManagement.php

示例4: manageOrderList


//.........这里部分代码省略.........
             }
             $cust .= ' <sup>' . $row['customers_order_count'] . '</sup>';
             $jng_sp_orders_items_id = 'SP-' . $row['jng_sp_orders_items_id'];
             $jng_sp_orders_items_id = '<a href="?open=sp-order-history&amp;oi_id=' . $row['jng_sp_orders_items_id'] . '&amp;hidemenu=true" class="view_webpage">' . $jng_sp_orders_items_id . '</a>';
             $order_no = $row['order_id'];
             if ($order_no == '') {
                 $order_no = 'J&amp;G ID: ' . $row['jng_sp_orders_id'];
             }
             $order_no = '<a href="?open=customer-care-order-detail&amp;source=SP&amp;id=' . $row['jng_sp_orders_id'] . '&amp;hidemenu=true" class="view_webpage">' . $order_no . '</a>';
             if ($row['order_item_total'] > 1) {
                 $jng_sp_orders_items_id .= ' <sup>' . $row['order_item_count'] . '/' . $row['order_item_total'] . '</sup>';
             }
             if ($row['cod_costs'] > 0) {
                 $order_no = '<img src="images/list-cod.gif" title="COD Method" /> ' . $order_no;
             }
             $o['c'] = $cust . '<br /><small>order no:</small> ' . $order_no;
             $o['o'] = $jng_sp_orders_items_id;
             //$diamond_icon = ($obj_product->brand_id == 14) ? drawDiamondIcon('Diamond Product', ' ') : '';
             $diamond_icon = $obj_product->isUsingDiamond() ? drawDiamondIcon('Diamond Product', ' ') : '';
             $gold_icon = drawGoldIcon($obj_product->metal_stamp_code, $obj_product->metal_stamp_info, '', ' ');
             $article = '<div><a href="?open=product-detail&amp;products_id=' . $products_id . '" target="_blank" title="View Product Detail">' . $row['article_number'] . '</a></div>';
             $icons = $gold_icon . $diamond_icon;
             $pimg = webImageSource($row['products_image'], '500');
             if ($pimg != '') {
                 $thumb = '<div class="thumb" thumbid="' . "{$products_id}-{$articles_id}-{$jng_sp_id}" . '"><a href="' . $pimg . '" class="view_image" title="Click to view larger image">' . webImage($row['products_image'], '80', '80', '', 'img-border img-padding') . '</a></div>';
                 $article = $thumb . $article;
             }
             $o['a'] = drawTableArticleInfoWithIcons($article, $icons);
             $o['p'] = $row['price'];
             $qty = intval($row['order_quantity']);
             $o['q'] = $qty;
             $mat_exp = $row['material_expenses'] > 0 ? $row['material_expenses'] : $row['current_mat_exp'];
             $margin = number_format($class_pm->calculateMargin($row['price'], $mat_exp), 1) . '%';
             $o['m'] = '<span class="' . ($class_pm->priceMargindIsGood($row['price'], $margin) ? 'green' : 'red') . '">' . $margin . '</span>';
             //                $el_link = '<a href="?open=elements-stock&amp;products_id='.$products_id.'&amp;hidemenu=true" class="view_webpage"></a>'; //PREVIOUS
             $el_link = '<a href="?open=products-elements-stock&amp;products_id=' . $products_id . '&amp;paid=' . $row['products_articles_id'] . '&amp;qty=' . $qty . '&amp;status=' . $row['stock_status'] . '&amp;hidemenu=true" class="view_webpage"></a>';
             $pr_link = '<a href="javascript:void();" onclick="alert(\'Please use Finish Good Stock\');"></a>';
             $dp_link = '<a href="javascript:void();" onclick="alert(\'Please use Depot Stock\');"></a>';
             switch ($row['stock_status']) {
                 case '0':
                     $stock_status = '<strong class="red">!</strong>';
                     if ($status == '8') {
                         //$do_status = statusNameShort($row['depot_orders_status']);
                         $do_status = $row['depot_orders_status'] == '4' && isset($row['depot_orders_prod_status']) && $row['depot_orders_prod_status'] != '' ? statusNameProduction($row['depot_orders_prod_status'], false, true) : statusNameShort($row['depot_orders_status']);
                         if (!is_array($do_status)) {
                             //$stock_status = '<span class="red">'.$do_status.'</span>';
                             $stock_status = '<a href="?open=depot-order&amp;id=' . $row['depot_orders_id'] . '&amp;hidemenu=true" title="MMO product, current status is ' . $do_status . '" class="red view_webpage">' . $do_status . '</a>';
                         }
                     }
                     break;
                 case 'R':
                     $show_btn_inprod = true;
                     $stock_status = $el_link . '<abbr title="Element Stock OK, Ready for Production" class="green">OK</abbr>';
                     break;
                 case 'S':
                     $show_btn_insrcn = true;
                     $stock_status = $el_link . '<abbr title="Element Stock Need Sourcing" class="red">NS</abbr>';
                     break;
                 case 'P':
                     $show_btn_inprod = true;
                     $stock_status = $pr_link . '<abbr title="Use Finished Goods Stock" class="green">FG</abbr>';
                     break;
                 case 'D':
                     if (is_null($row['depot_orders_id'])) {
                         $stock_status = $dp_link . '<abbr title="Use Depot Stock" class="green">DS</abbr>';
                     } else {
开发者ID:blasiuscosa,项目名称:manobo-2008,代码行数:67,代码来源:jng_sp_orders.php


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