本文整理汇总了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;
示例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 = '');