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


PHP Warehouse::getWarehouseNameById方法代码示例

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


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

示例1: renderCSV

 /**
  * Exports CSV
  */
 public function renderCSV()
 {
     if (!$this->_list) {
         return;
     }
     // header
     if (Tools::getValue('id_warehouse') != -1) {
         $filename = $this->l('stock_mvt') . '_' . Warehouse::getWarehouseNameById((int) Tools::getValue('id_warehouse')) . '.csv';
     } else {
         $filename = $this->l('stock_mvt') . '.csv';
     }
     header('Content-type: text/csv');
     header('Cache-Control: no-store, no-cache');
     header('Content-disposition: attachment; filename="' . $filename);
     // puts keys
     $keys = array('id_order', 'id_supply_order', 'emloyee_firstname', 'employee_lastname', 'physical_quantity', 'date_add', 'sign', 'price_te', 'product_name', 'label', 'product_reference', 'product_ean13', 'product_upc');
     echo sprintf("%s\n", implode(';', $keys));
     // puts rows
     foreach ($this->_list as $row) {
         $row_csv = array($row['id_order'], $row['id_supply_order'], $row['employee_firstname'], $row['employee_lastname'], $row['physical_quantity'], $row['date_add'], $row['sign'], $row['price_te'], $row['product_name'], $row['reason'], $row['product_reference'], $row['product_ean13'], $row['product_upc']);
         // puts one row
         echo sprintf("%s\n", implode(';', array_map(array('CSVCore', 'wrap'), $row_csv)));
     }
 }
开发者ID:jicheng17,项目名称:vipinsg,代码行数:27,代码来源:AdminStockMvtController.php

示例2: renderCSV

 /**
  * Exports CSV
  */
 public function renderCSV()
 {
     if (count($this->_list) <= 0) {
         return;
     }
     // sets warehouse id and warehouse name
     $id_warehouse = (int) Tools::getValue('id_warehouse');
     $warehouse_name = Warehouse::getWarehouseNameById($id_warehouse);
     // if quantities requested
     if (Tools::isSubmit('csv_quantities')) {
         // filename
         $filename = $this->l('stock_instant_state_quantities') . '_' . $warehouse_name . '.csv';
         // header
         header('Content-type: text/csv');
         header('Cache-Control: no-store, no-cache must-revalidate');
         header('Content-disposition: attachment; filename="' . $filename);
         // puts keys
         $keys = array('id_product', 'id_product_attribute', 'reference', 'ean13', 'upc', 'name', 'physical_quantity', 'usable_quantity', 'real_quantity');
         echo sprintf("%s\n", implode(';', $keys));
         // puts rows
         foreach ($this->_list as $row) {
             $row_csv = array($row['id_product'], $row['id_product_attribute'], $row['reference'], $row['ean13'], $row['upc'], $row['name'], $row['physical_quantity'], $row['usable_quantity'], $row['real_quantity']);
             // puts one row
             echo sprintf("%s\n", implode(';', array_map(array('CSVCore', 'wrap'), $row_csv)));
         }
     } elseif (Tools::isSubmit('csv_prices')) {
         // sets filename
         $filename = $this->l('stock_instant_state_prices') . '_' . $warehouse_name . '.csv';
         // header
         header('Content-type: text/csv');
         header('Cache-Control: no-store, no-cache must-revalidate');
         header('Content-disposition: attachment; filename="' . $filename);
         // puts keys
         $keys = array('id_product', 'id_product_attribute', 'reference', 'ean13', 'upc', 'name', 'price_te', 'physical_quantity', 'usable_quantity');
         echo sprintf("%s\n", implode(';', $keys));
         foreach ($this->_list as $row) {
             $id_product = (int) $row['id_product'];
             $id_product_attribute = (int) $row['id_product_attribute'];
             // gets prices
             $query = new DbQuery();
             $query->select('s.price_te, SUM(s.physical_quantity) as physical_quantity, SUM(s.usable_quantity) as usable_quantity');
             $query->from('stock', 's');
             $query->leftJoin('warehouse', 'w', 'w.id_warehouse = s.id_warehouse');
             $query->where('s.id_product = ' . $id_product . ' AND s.id_product_attribute = ' . $id_product_attribute);
             $query->where('s.id_warehouse = ' . $id_warehouse);
             $query->groupBy('s.price_te');
             $datas = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
             // puts data
             foreach ($datas as $data) {
                 $row_csv = array($row['id_product'], $row['id_product_attribute'], $row['reference'], $row['ean13'], $row['upc'], $row['name'], $data['price_te'], $data['physical_quantity'], $data['usable_quantity']);
                 // puts one row
                 echo sprintf("%s\n", implode(';', array_map(array('CSVCore', 'wrap'), $row_csv)));
             }
         }
     }
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:59,代码来源:AdminStockInstantStateController.php

示例3: getCustomList

    public function getCustomList()
    {
        // if we get warehouse id from GET (case first diplay)
        if (Tools::isSubmit('warehouseA') && Tools::isSubmit('warehouseB')) {
            // Get warehouse value selected or not
            $this->context->cookie->warehouseA = Tools::getValue('warehouseA');
            $this->context->cookie->warehouseB = Tools::getValue('warehouseB');
            // if we have a good warehourse id, display
            if ($this->context->cookie->warehouseA != -1 && $this->context->cookie->warehouseA != '' && ($this->context->cookie->warehouseB != -1 && $this->context->cookie->warehouseB != '')) {
                $this->show_toolbar = false;
                $id_warehouseA = Tools::isSubmit('warehouseA') ? Tools::getValue('warehouseA') : $this->context->cookie->warehouseA;
                $id_warehouseB = Tools::isSubmit('warehouseB') ? Tools::getValue('warehouseB') : $this->context->cookie->warehouseB;
                // Add additional columns
                $AColumns = array('qte_transfer' => array('title' => $this->l('Transfer'), 'align' => 'center', 'search' => false, 'orderby' => false, 'callback' => 'renderQteTransferColumn'), 'quantity_after' => array('title' => $this->l('After transfer'), 'align' => 'center', 'search' => false, 'orderby' => false, 'class' => 'quantity_after text-center'), 'direction' => array('title' => $this->l(''), 'align' => 'center', 'search' => false, 'orderby' => false, 'class' => 'direction text-center', 'callback' => 'renderDirectionColumn'), 'physical_quantity2' => array('title' => $this->l('Physical quantity'), 'align' => 'center', 'search' => false, 'orderby' => true, 'class' => 'physical_quantity2 text-center'), 'usable_quantity2' => array('title' => $this->l('Usable quantity'), 'align' => 'center', 'search' => false, 'orderby' => true, 'class' => 'usable_quantity2 text-center'), 'new_stock' => array('title' => $this->l('New stock'), 'align' => 'center', 'search' => false, 'orderby' => false, 'class' => 'new_stock text-center'));
                // column displayed
                $this->fields_list = array_merge($this->baseColumns, $AColumns);
                $this->context->smarty->assign(array('warehouse_name' => $this->l('Source warehouse') . ' : ' . Warehouse::getWarehouseNameById($id_warehouseA), 'warehouse2_name' => $this->l('Destination warehouse') . ' : ' . Warehouse::getWarehouseNameById($id_warehouseB), 'warehouse_id' => 'stockA', 'warehouse_real_id' => $id_warehouseA, 'warehouse2_id' => 'stockB', 'warehouse2_real_id' => $id_warehouseB, 'ps_version_sup_1550' => version_compare(_PS_VERSION_, '1.5.5.0', '>=')));
                $this->table = 'stock';
                $this->className = 'Stock';
                $this->list_no_link = true;
                $this->table = 'stock';
                $this->className = 'Stock';
                $this->identifier = 'id_stock';
                $this->_orderBy = 'name';
                $this->_select = '
                                            "-->" as direction,
                                            IFNULL(CONCAT(pl.name, \' : \', GROUP_CONCAT(DISTINCT agl.`name`, \' - \', al.name SEPARATOR \', \')),pl.name) as name,
                                            a.ean13 as EAN,
                                            w.id_currency,
                                            if (a.id_product_attribute = 0, a.id_product, CONCAT(a.id_product, ";", a.id_product_attribute)) as ids,
                                            0 as qte_transfer,
                                            a.physical_quantity as quantity_after,
                                            s2.physical_quantity as physical_quantity2,
                                            s2.usable_quantity as usable_quantity2,
                                            s2.physical_quantity as new_stock,
                                            a.id_stock as id_stock_s1,
                                            s2.id_stock as id_stock_s2';
                $this->_join .= ' LEFT JOIN `' . _DB_PREFIX_ . 'product_lang` pl ON (
                                        a.id_product = pl.id_product
                                        AND pl.id_lang = ' . (int) $this->context->language->id . ')';
                $this->_join .= ' LEFT JOIN `' . _DB_PREFIX_ . 'product_attribute_combination` pac ON (pac.id_product_attribute = a.id_product_attribute)';
                $this->_join .= ' LEFT JOIN `' . _DB_PREFIX_ . 'attribute` atr ON (atr.id_attribute = pac.id_attribute)';
                $this->_join .= ' LEFT JOIN `' . _DB_PREFIX_ . 'attribute_lang` al ON (
					al.id_attribute = pac.id_attribute
					AND al.id_lang = ' . (int) $this->context->language->id . ')';
                $this->_join .= ' LEFT JOIN `' . _DB_PREFIX_ . 'attribute_group_lang` agl ON (
					agl.id_attribute_group = atr.id_attribute_group
					AND agl.id_lang = ' . (int) $this->context->language->id . ')';
                $this->_join .= 'LEFT JOIN `' . _DB_PREFIX_ . 'warehouse` w ON (w.id_warehouse = a.id_warehouse)';
                $this->_join .= 'INNER JOIN ' . _DB_PREFIX_ . 'product p ON a.id_product = p.id_product ';
                $this->_join .= 'LEFT JOIN ' . _DB_PREFIX_ . 'product_attribute pa ON (a.id_product = pa.id_product AND a.id_product_attribute = pa.id_product_attribute)';
                $this->_join .= 'LEFT JOIN ' . _DB_PREFIX_ . 'manufacturer m ON m.id_manufacturer = p.id_manufacturer ';
                $this->_join .= 'LEFT JOIN ' . _DB_PREFIX_ . 'stock s2 ON (a.id_product = s2.id_product AND a.id_product_attribute = s2.id_product_attribute AND s2.id_warehouse = \'' . $id_warehouseB . '\')';
                $this->_group = "GROUP BY a.id_product, a.id_product_attribute";
                $this->_where .= "AND w.id_warehouse = " . $id_warehouseA;
                // FILTERS
                // Brand filter
                if (($id_manufacturer = $this->getCurrentValue('id_manufacturer')) != false) {
                    $this->_where .= ' AND m.id_manufacturer = ' . $id_manufacturer;
                }
                // Category filter
                if (($id_category = $this->getCurrentValue('id_category')) != false) {
                    $this->_where .= ' AND a.id_product IN (
											SELECT cp.id_product
											FROM ' . _DB_PREFIX_ . 'category_product cp
											WHERE cp.id_category = ' . $id_category . '
							)';
                }
                // Provider filter
                if (($id_supplier = $this->getCurrentValue('id_supplier')) != false) {
                    $this->_where .= ' AND a.id_product IN (
											SELECT ps.id_product
											FROM ' . _DB_PREFIX_ . 'product_supplier ps
											WHERE ps.id_supplier = ' . $id_supplier . '
							)';
                }
                $nameOrEan = pSQL($this->getCurrentValue('name_or_ean', ''));
                if ($nameOrEan != false && $nameOrEan != '') {
                    $this->_where .= ' AND (a.ean13 LIKE \'%' . $nameOrEan . '%\' OR pl.name LIKE \'%' . $nameOrEan . '%\' OR al.name  LIKE \'%' . $nameOrEan . '%\')';
                }
                $list = $this->renderList();
                return $list;
            } else {
                // empty cookie display form :  correction if selection warehouse + change controller
                $cookie = new Cookie('psAdmin');
                $cookie->warehouseA = '';
                $cookie->warehouseB = '';
            }
        }
    }
开发者ID:prestamodule,项目名称:erpillicopresta,代码行数:90,代码来源:AdminStockTransfer.php

示例4: getContent

 public function getContent()
 {
     // assign smarty values
     $this->smarty->assign(array('products' => $this->products, 'stockA' => Warehouse::getWarehouseNameById(Tools::getValue('stockA')), 'stockB' => Warehouse::getWarehouseNameById(Tools::getValue('stockB'))));
     return $this->smarty->fetch(_PS_MODULE_DIR_ . 'erpillicopresta/views/templates/admin/stock_transfer/transfers.tpl');
 }
开发者ID:prestamodule,项目名称:erpillicopresta,代码行数:6,代码来源:HTMLTemplateTransfer.php

示例5: renderAdvancedStockManagementColumn

 public function renderAdvancedStockManagementColumn($advanced_stock_management, $data)
 {
     $warning = '';
     if (!$this->advanced_stock_management) {
         if ($advanced_stock_management == '1') {
             $warning = '<img src="../img/admin/warning.gif" class="cluetip" title="' . $this->l('Product IS USED with advanced stock management') . '"/>';
         }
     } else {
         if ($advanced_stock_management == '0') {
             $warning = '<img src="../img/admin/warning.gif" class="cluetip" title="' . $this->l('Product IS NOT USED with advanced stock management') . '"/>';
         }
     }
     // in the case where the product has stock in warehouse without be located in this warehouse
     if ((int) Tools::getValue('id_warehouse') > 0 && (int) $data['id_warehouse_product_location'] == '0') {
         $warehouse_name = Warehouse::getWarehouseNameById(Tools::getValue('id_warehouse'));
         if (!empty($warehouse_name)) {
             $message = sprintf($this->l('Product has stock in "%s" warehouse without being registered in this warehouse !'), $warehouse_name);
             $warning .= ' &nbsp; <img src="../img/admin/warning.gif" class="cluetip" title="' . $message . '"/>';
         }
     }
     return $warning;
 }
开发者ID:prestamodule,项目名称:erpillicopresta,代码行数:22,代码来源:AdminAdvancedStock.php


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