本文整理汇总了PHP中product::getSearchProducts方法的典型用法代码示例。如果您正苦于以下问题:PHP product::getSearchProducts方法的具体用法?PHP product::getSearchProducts怎么用?PHP product::getSearchProducts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类product
的用法示例。
在下文中一共展示了product::getSearchProducts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: product
<?php
// Includng configuration file
include 'config/config.php';
//Check user is already login or not
checkAuthentication();
$id = $_SESSION['adminid'];
$product = new product();
$order = new order();
$cashmemo = new cashmemo();
if (isset($_GET['action']) && $_GET['action'] == 'suggestprod') {
$keyword = $_GET['keyword'];
$elementid = $_GET['id'];
$string = '';
$autosuggpro = $product->getSearchProducts($keyword);
if (is_array($autosuggpro)) {
$string .= '<ul>';
foreach ($autosuggpro as $val) {
$string .= '<li onClick="fillname(\'' . addslashes($val['name']) . '\',\'' . $elementid . '\');fillcode(\'' . addslashes($val['sku']) . '\',\'' . $elementid . '\');fillprice(\'' . addslashes($val['price']) . '\',\'' . $elementid . '\');" >' . $val['name'] . '</li>';
}
$string .= '</ul>';
} else {
$string .= '<li>No Record found</li></ul>';
}
echo $string;
exit;
} elseif (isset($_GET['action']) && $_GET['action'] == 'suggestchalan') {
$keyword = $_GET['chalan_no'];
$string = '';
$autosuggpro = $order->getChalanOrders($keyword);
if (is_array($autosuggpro)) {
示例2: header
}
if ($product->updateProduct($data)) {
$_SESSION['message'] = 'Product has been updated successfully.';
header('Location: ' . FRONTEND . 'inventory.php');
exit;
}
} elseif (isset($_GET['action']) && $_GET['action'] == 'delete') {
$id = $_GET['id'];
if ($product->deleteProduct($id)) {
$_SESSION['message'] = 'Product has been deleted successfully.';
header('Location: ' . FRONTEND . 'inventory.php');
exit;
}
} elseif (isset($_GET['action']) && $_GET['action'] == 'search') {
$keyword = $_POST['keywords'];
$products = $product->getSearchProducts($keyword);
$smarty->assign('productcount', count($products));
$smarty->assign('products', $products);
$smarty->assign('content', $smarty->fetch('product.tpl'));
} else {
$page = 1;
if (isset($_GET['page'])) {
$page = $_GET['page'];
}
$products = $product->getProducts($page, $offset = 10);
$smarty->assign('productcount', $product->getProductsCount());
$smarty->assign('page', $page);
$smarty->assign('products', $products);
$smarty->assign('pagecount', ceil($product->getProductsCount() / 10));
$smarty->assign('content', $smarty->fetch('product.tpl'));
}