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


PHP product::getSearchProducts方法代码示例

本文整理汇总了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)) {
开发者ID:roshanbhgt,项目名称:erp,代码行数:31,代码来源:autosuggest.php

示例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'));
}
开发者ID:roshanbhgt,项目名称:erp,代码行数:31,代码来源:inventory.php


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