function display_part() { $product_list = product_list(); if (sizeof($product_list) > 4) { $nb = 8; } else { $nb = sizeof($product_list); } foreach ($product_list as $product) { echo '<div class="part_border">'; echo '<img class="part" src="' . $product['img'] . '" />'; echo '</div>'; if (--$nb === 0) { break; } } }
make_json_error($_LANG['sys']['wrong'] . $_LANG['cannot_found_goods']); } foreach ($attribute as $attribute_value) { //转换成数组 $_attribute[$attribute_value['attr_id']]['attr_values'][] = $attribute_value['attr_value']; $_attribute[$attribute_value['attr_id']]['attr_id'] = $attribute_value['attr_id']; $_attribute[$attribute_value['attr_id']]['attr_name'] = $attribute_value['attr_name']; } $attribute_count = count($_attribute); $smarty->assign('attribute_count', $attribute_count); $smarty->assign('attribute', $_attribute); $smarty->assign('attribute_count_3', $attribute_count + 3); $smarty->assign('product_sn', $goods['goods_sn'] . '_'); $smarty->assign('product_number', $_CFG['default_storage']); /* 取商品的货品 */ $product = product_list($goods_id, ''); $smarty->assign('ur_here', $_LANG['18_product_list']); $smarty->assign('action_link', array('href' => 'goods.php?act=list', 'text' => $_LANG['01_goods_list'])); $smarty->assign('product_list', $product['product']); $smarty->assign('use_storage', empty($_CFG['use_storage']) ? 0 : 1); $smarty->assign('goods_id', $goods_id); $smarty->assign('filter', $product['filter']); /* 排序标记 */ $sort_flag = sort_flag($product['filter']); $smarty->assign($sort_flag['tag'], $sort_flag['img']); make_json_result($smarty->fetch('product_info.htm'), '', array('filter' => $product['filter'], 'page_count' => $product['page_count'])); } elseif ($_REQUEST['act'] == 'product_remove') { /* 检查权限 */ check_authz_json('remove_back'); /* 是否存在商品id */ if (empty($_REQUEST['id'])) {
<div id="navbar"> <ul> <li><a href="index.php">Home</a></li> <li><a href="products.php" class="acurrent">Shop</a></li> <li><a href="#" class="lightbox about">About</a></li> <li><a href="contact.php">Contact</a></li> </ul> </div> <div id="content"> <div class="trending"> <h2>Socks</h2> <?php product_list(); ?> </div> </div> <div id="footer"> <div class="column"> <h1>Need Assistance</h1> <ul> <li><a href="#">FAQS</a></li> <li><a href="#">Shipping</a></li> <li><a href="#">Customer Service</a></li> </ul> </div>
function products($company_sfnid) { $products_list = product_list($company_sfnid); $products = array(); foreach ($products_list as $product) { $url = api_url($product["uri"]); if (is_http_url($url)) { $product = parse_hProduct(get_url($url)); } else { throw new Exception("Internal error: strange uri in product: {$url}"); } assert(is_array($product)); array_push($products, $product[0]); # Just the first product from each URL is included. } return $products; }
function product_delete() { $data = array(); // kiểm tra login checkaut(); // bắt dữ id bài viết cần chỉnh sửa $Currentproduct = empty($_GET['id']) ? null : strtolower($_GET['id']); if (!model('product')->check_true($Currentproduct, 'product_id')) { $msg = "sản phẩm không tồn tại!!"; abort($msg); } $data['products'] = model('product')->getOneBy($Currentproduct, 'product_id'); if (model('product')->delete($Currentproduct) >= 1) { $msg = "Xóa sản phẩm thành công!!!"; abort($msg); } else { $msg = "Không thể xóa sản phẩm!!!"; abort($msg); } product_list(); }
* * Define your application routes here! * $key is the route pattern and $value is it's dispatcher * You can specify dispatcher as a string, what will mean that you provided callable function name * or anonymous function. Note that for some reason, each function should accept at least 1 argument * @var array */ $routes = ['/view/{id}' => 'view_record', '/delete/{id}' => function ($id) { product_delete($id); header('Location: ' . $_SERVER['HTTP_REFERER']); }, '/' => 'home', '/list/{page}' => function ($page, $arguments = []) { $view = __DIR__ . '/views/list.php'; product_list($page, $view, $arguments); }, '/ajax-list/{page}' => function ($page, $arguments) { $view = __DIR__ . '/views/items.php'; product_list($page, $view, $arguments); }, '/add' => 'add_product', '/edit/{id}' => function ($id, $arguments = []) { if ($_SERVER['REQUEST_METHOD'] === 'GET') { $product = product_find_by_pk($id); $form_action = '/edit/' . $id; include __DIR__ . '/views/layout/header.php'; include __DIR__ . '/views/add_product_form.php'; include __DIR__ . '/views/layout/footer.php'; } else { product_update($_POST); header('Location: ' . $_SERVER['HTTP_REFERER']); } }]; /** * Show product by id provided *
function product_list() { return product_list($this->company_sfnid); }
utilisateur_cnx_discnx('ggg', CNX_STATE_LOGON); utilisateur_cnx_discnx('ggg', CNX_STATE_LOGOFF); utilisateur_cnx_discnx('ccc', CNX_STATE_LOGON); utilisateur_cnx_discnx('bbb', CNX_STATE_LOGOFF); $les_connectes = utilisateur_liste_connectes(); var_dump($les_connectes); /** * Les produits */ // parcours des produits (toutes catégories confondues) $produits = produit_parcours(); //var_dump($produits); // parcours des produits de type sport $produits = produit_parcours(2); //var_dump($produits); $produits = product_list(); var_dump($produits); ?> <!doctype html> <html> <head> <meta charset="utf-8" /> </head> <body> <?php echo "<ul>"; foreach ($produits as $produit) { echo '<li>', $produit['name'], '</li>'; }