本文整理汇总了PHP中product::getProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP product::getProduct方法的具体用法?PHP product::getProduct怎么用?PHP product::getProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类product
的用法示例。
在下文中一共展示了product::getProduct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: product
<?php
$model = $_REQUEST['model'];
$action = $_REQUEST['action'];
include_once MODELS_ADMIN . "/" . $model . "_model.php";
switch (strtoupper($action)) {
case 'ADD':
if (isset($_REQUEST['btn_submit']) && $_REQUEST['btn_submit'] == 'save') {
$objProduct = new product();
$objProduct->setProduct($_REQUEST);
$objComm->redirect('index.php?model=' . $model);
}
break;
case 'VIEW':
case 'EDIT':
if (isset($_REQUEST['btn_submit']) && $_REQUEST['btn_submit'] == 'Update') {
$objProduct = new product();
$objProduct->setProduct($_REQUEST);
$objComm->redirect('index.php?model=' . $model . '&action=edit&id=' . $_REQUEST['pk_id']);
} else {
$objProduct = new product();
$datum = $objProduct->getProduct($_REQUEST['id']);
}
break;
default:
$objProduct = new product();
$data = $objProduct->getAllproduct();
break;
}
示例2: product
<?php
// Includng configuration file
include 'config/config.php';
//Check user is already login or not
checkAuthentication();
$product = new product();
$category = new category();
$smarty->assign('categories', $category->getCategories());
if (isset($_GET['action']) && $_GET['action'] == 'new') {
$smarty->assign('content', $smarty->fetch('additem.tpl'));
} elseif (isset($_GET['action']) && $_GET['action'] == 'edit') {
$id = $_GET['id'];
$producted = $product->getProduct($id);
$smarty->assign('product', $producted);
$smarty->assign('content', $smarty->fetch('edititem.tpl'));
} elseif (isset($_POST['action']) && $_POST['action'] == 'add') {
$file = $_FILES;
$data = $_POST['data']['Item'];
$data['image'] = $file['name'];
if ($product->checkProduct($data)) {
$_SESSION['message'] = 'Product with catalog no already exist. Please search with product sku and update details.';
header('Location: ' . FRONTEND . 'inventory.php');
exit;
} else {
if ($product->addProduct($data)) {
header('Location: ' . FRONTEND . 'inventory.php');
exit;
}
}
} elseif (isset($_POST['action']) && $_POST['action'] == 'update') {