當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。