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


PHP Products::getProductsString方法代码示例

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


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

示例1: Products

<?php

require_once '../common/config/config.inc.php';
require_once SOURCE_ROOT . 'classes/class.sort.php';
require_once SOURCE_ROOT . 'classes/class.product.php';
$objProducts = new Products();
$fileName = "reports/product_report.xls";
if (isset($_REQUEST['frmSearchPressed']) && $_REQUEST['frmSearchPressed'] == 'Yes') {
    $varSearchWher .= $objProducts->getProductsString($_REQUEST);
}
$varLimit = '';
$arrClm = array('pkCategoryID', 'CategoryName', 'pkProductID', 'fkCategoryID', 'ProductName', 'ProductCost', 'ProductQuantity', 'ProductDescription', 'ProductSpecifications', 'ProductActualCost', 'ProductIsFeatured', 'ProductIsSpecailOffer', 'ProductStatus', 'ProductDateAdded', 'ProductCode');
$arrProductsList = $objProducts->getProductsList($_REQUEST, $arrClm, $varSearchWher, $varLimit);
$sep = "\t";
$arr_headers = array('Category Name', 'Product Code', 'Product Name', 'Product Cost', 'Product Set of Quantity', 'Product Description', 'Product Specifications', 'Product Total Cost', 'Featured Product', 'Special offer', 'Product Status', 'Product Date Added');
foreach ($arr_headers as $header) {
    $str .= $header . $sep;
}
$str .= "\r\n";
if (is_array($arrProductsList)) {
    foreach ($arrProductsList as $varKey => $varValue) {
        $varName = $varValue['CategoryName'];
        $str .= $varName . $sep;
        $str .= $varValue['ProductCode'] . $sep;
        $str .= $varValue['ProductName'] . $sep;
        $str .= $varValue['ProductCost'] . $sep;
        $str .= $varValue['ProductQuantity'] . $sep;
        $str .= str_replace("\r\n", '', $varValue['ProductDescription']) . $sep;
        $str .= str_replace("\r\n", '', $varValue['ProductSpecifications']) . $sep;
        $str .= $varValue['ProductActualCost'] . $sep;
        $str .= $varValue['ProductIsFeatured'] . $sep;
开发者ID:saurabhs4,项目名称:demoshop,代码行数:31,代码来源:product_report.php

示例2: Products

<?php

require_once '../common/config/config.inc.php';
require_once SOURCE_ROOT . 'classes/class.product.php';
require_once SOURCE_ROOT . 'classes/class.paging.php';
require_once SOURCE_ROOT . 'classes/class.sort.php';
$_SESSION['sessProductRedirectURL'] = '';
if ($_SERVER['QUERY_STRING'] != '') {
    $_SESSION['sessProductRedirectURL'] = $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'];
} else {
    $_SESSION['sessProductRedirectURL'] = $_SERVER['PHP_SELF'];
}
$objProducts = new Products();
$objPaging = new Paging();
$varSearchWhr = '';
$varSearchWher .= $objProducts->getProductsString($_GET);
$varSearchWhere = $varSearchWhr . '' . $varSearchWher;
if ($_GET['CategoryID'] != '') {
    $varSearchWhere = $varSearchWhere . ' AND fkCategoryID = \'' . $_GET['CategoryID'] . '\'';
}
//code for paging
$varPageStart = $objPaging->getPageStartLimit($_GET['page'], ADMIN_PAGE_RECORD_SIZE);
$varLimit = $varPageStart . ',' . ADMIN_PAGE_RECORD_SIZE;
$varTableName = TABLE_PRODUCTS . " JOIN " . TABLE_CATEGORIES . " ON pkCategoryID = fkCategoryID ";
$varProductsClm = 'pkProductID';
$NumberofRows = $objDatabase->getNumRows($varTableName, $varProductsClm, $varSearchWhere);
$varNumberPages = $objPaging->calculateNumberofPages($NumberofRows, ADMIN_PAGE_RECORD_SIZE);
//end for paging
$arrClm = array('pkCategoryID', 'CategoryName', 'pkProductID', 'fkCategoryID', 'ProductName', 'ProductCost', 'ProductStatus', 'ProductIsFeatured', 'ProductDateAdded', 'ProductIsSpecailOffer', 'ProductCode');
$arrProductsList = $objProducts->getProductsList($_REQUEST, $arrClm, $varSearchWhere, $varLimit);
$varProductRows = $objDatabase->getNumRows($varTableName, $varProductsClm, $varWhere = '');
开发者ID:saurabhs4,项目名称:demoshop,代码行数:31,代码来源:product_list_uil.php


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