本文整理汇总了PHP中getProducts函数的典型用法代码示例。如果您正苦于以下问题:PHP getProducts函数的具体用法?PHP getProducts怎么用?PHP getProducts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getProducts函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getProducts
function getProducts($u, $cat)
{
global $o;
$d = new simple_html_dom();
$d->load(scraperwiki::scrape($u));
//echo "Loaded URL: " . $u . "\n";
$items = $d->find('li.grid-item');
if (count($items) > 0) {
foreach ($items as $p) {
$prod = $p->find('p.product-name > a', 0);
$prodname = trim($prod->innertext);
$prodURL = $prod->href;
if (!is_null($p->find('p.minimal-price', 0))) {
$prodtype = 1;
} else {
$prodtype = 0;
}
fputcsv($o, array($prodname, $prodtype, $cat, $prodURL));
echo $prodname . "\n";
}
if (!is_null($d->find('p.next', 0))) {
getProducts($d->find('p.next', 0)->href, $cat);
}
}
}
开发者ID:jbm160,项目名称:brs,代码行数:25,代码来源:productlist.php
示例2: settlement
function settlement()
{
global $gPrices;
$products = getProducts();
$deals = getDeals();
$mysqli = getMysqli();
$mysqli->autocommit(false);
// 开始事务
// 插入操作
foreach ($deals as $value) {
$productId = $value['productId'];
//$deal->getProductId();
$product = $products[$productId];
$contract = $product->getContract();
// 合同名
$breakeven = $product->getBreakeven();
// 产品盈亏金额
$weight = $product->getWeight();
// 产品重量
$price = $product->getPrice();
// 产品价格
$orderId = $value['orderId'];
// 交易编号
$wid = $value['wid'];
// 微信号 $deal->getWid();
$deposit = $value['rmoney'];
// 保证金 $deal->getDeposit();
$buy = $value['buyprice'];
// 进仓价 $deal->getBuy();
$sell = $value['sellprice'];
// 平仓价 $deal->getSell();
$amount = $value['sl'];
// 数量 $deal->getAmount();
$type = $value['type'];
// 买卖类型 1:跌,2:涨 $deal->getType();
$profit = $value['zhuanqu'];
// 收益 $deal->getProfit();
$time = $value['addtime'];
// 买入时间 $deal->getDate();
if ($sell == 0) {
$sell = $gPrices[$contract];
// 按产品名取报价,设为平仓价
if ($type == 1) {
// 买跌:(进仓价-平仓价或11点的价格)* 手数 * 盈亏金额
$profit = ($buy - $sell) * $amount * $breakeven;
} else {
// 买涨:(平仓价或11点的价格-进仓价)* 手数 * 盈亏金额
$profit = ($sell - $buy) * $amount * $breakeven;
}
}
$sql = "INSERT INTO settlement (orderId, wid, deposit, buyprice, sellprice, profit, type, amount, addtime, pId, pBreakeven, pWeight, pPrice, pContract) \r\n\t\t\tVALUES('{$orderId}', '{$wid}', '{$deposit}', '{$buy}', '{$sell}', '{$profit}', '{$type}', '{$amount}', '{$time}', '{$productId}', '{$breakeven}', '{$weight}', '{$price}', '{$contract}')";
$mysqli->query($sql);
}
if (!$mysqli->errno) {
$mysqli->commit();
} else {
$mysqli->rollback();
}
mysqli_close($mysqli);
}
开发者ID:q546530715,项目名称:fenzhi-git,代码行数:60,代码来源:game-settlement-backup.php
示例3: controller_products_index
function controller_products_index()
{
$id = @$_GET["id"];
switch (@$_GET["action"]) {
case "delete":
$strSQL = "DELETE FROM products WHERE id={$id}";
mysqli_query(connect(), $strSQL);
header("Location:http://localhost/companies/index.php?page=products");
close_bd();
break;
case "edit":
setcookie("editProduct", 1, time() + 3600 * 24 * 30 * 12, "/");
header("Location:http://localhost/companies/index.php?page=products&id={$id}");
break;
case "insert":
setcookie("insertProduct", 1, time() + 3600 * 24 * 30 * 12, "/");
break;
}
$data = getProducts();
////////////////////////
if ($_COOKIE["otherCompanyID"] == 0) {
view_products($data);
} else {
view_my_products($data);
}
}
开发者ID:PushGit,项目名称:companies,代码行数:26,代码来源:controller.php
示例4: init
public function init()
{
parent::init();
if (Module::isEnabled('aimultidimensions')) {
if (Tools::getIsset('add') && $this->context->cart->id) {
require_once _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'aimultidimensions' . DIRECTORY_SEPARATOR . 'aimultidimensions.php';
require_once _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'aimultidimensions' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'config.php';
require_once _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR . 'aimultidimensions' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'functions' . $GLOBALS['aimd_config_suffix'] . '.php';
$add = 1;
$idProduct = (int) Tools::getValue('id_product', NULL);
if (checkLink($idProduct)) {
$idProductAttribute = (int) Tools::getValue('id_product_attribute', Tools::getValue('ipa'));
$customizationId = (int) Tools::getValue('id_customization', 0);
$qty = (int) abs(Tools::getValue('qty', 1));
if ($add && $qty >= 0 && getProducts($idProduct)) {
$quantity = (int) Db::getInstance()->getValue('SELECT quantity FROM ' . _DB_PREFIX_ . 'cart_product WHERE id_cart = ' . $this->context->cart->id . ' AND id_product = ' . $idProduct . ' AND ' . 'id_product_attribute = ' . $idProductAttribute);
if (Tools::getValue('op', 'up') == 'up') {
$quantity += (int) $qty;
} else {
$quantity -= (int) $qty;
}
$cookie = $this->context->cookie;
$cart = $this->context->cart;
include_once 'modules/aimultidimensions/includes/cart.php';
Product::flushPriceCache();
}
}
}
}
}
开发者ID:EliosIT,项目名称:PS_AchatFilet,代码行数:30,代码来源:CartController.php
示例5: compareView
function compareView()
{
echo '<table id="compareTable">';
getHeaders();
getProducts();
echo '</table>';
}
开发者ID:bwgraves,项目名称:tfpcs,代码行数:7,代码来源:viewFunctions.php
示例6: getProducts
function getProducts(&$categories)
{
foreach ($categories as &$cat) {
$cat['products'] = ocshop::products($cat['id'], false);
foreach ($cat['products'] as &$product) {
$product['active'] = $product['product_id'] == ocshop::$pid;
}
getProducts($cat['children']);
}
}
开发者ID:sd-studio,项目名称:pi,代码行数:10,代码来源:mtzpro.php
示例7: writeProductCatalogAsJSON
function writeProductCatalogAsJSON()
{
$json = Zend_Json::encode(getProducts());
$dest = JSONExportPath;
logger("writing: " . $dest);
logger("json:" . $json);
$fp = fopen($dest, "w");
fwrite($fp, $json);
fclose($fp);
}
开发者ID:vberzsin,项目名称:shop,代码行数:10,代码来源:mygassi-jsonexport.php
示例8: productsLoaded
function productsLoaded()
{
$redo = filter_input(INPUT_POST, "instr");
if (isset($_SESSION['p_init'])) {
if ($_SESSION['p_init'] === false || !isset($GLOBALS['cat_array'])) {
getProducts();
return;
}
} elseif ($redo === "redo" || !isset($GLOBALS['csv_loc'])) {
getProducts();
return;
} else {
parseProducts();
}
echo "Import Complete";
}
开发者ID:ColdAnkles,项目名称:DC_Test,代码行数:16,代码来源:CommonFunctions.php
示例9: getProducts
function getProducts($u)
{
global $baseurl, $o, $local;
$path = "";
$d = new simple_html_dom();
$d->load(scraperwiki::scrape($u));
//echo "Loaded URL: " . $u . "\n";
$S2Prod = $d->find('span[class=S2Product]');
if (count($S2Prod) > 0) {
foreach ($S2Prod as $p) {
$sku = trim($p->find('div[class=S2ProductSku]', 0)->innertext, "# ");
$prodname = trim($p->find('div[class=S2ProductName]', 0)->first_child()->innertext);
$prodthumb = $p->find('img[class=S2ProductImg]', 0)->src;
$prodURL = $p->find('div[class=S2ProductName]', 0)->first_child()->href;
fputcsv($o, array($sku, $prodname, $prodthumb, $prodURL));
echo $prodname . "\n";
}
if ($d->find('div[class=S2itemsPPText]', 0)->last_child()->style == "display: inline") {
$newURL = $baseurl . $d->find('div[class=S2itemsPPText]', 0)->last_child()->href;
getProducts($newURL);
}
}
}
开发者ID:jbm160,项目名称:wc_cat,代码行数:23,代码来源:productlist.php
示例10: getProducts
function getProducts($url, $path)
{
global $p, $c, $baseurl;
$c->load(scraperwiki::scrape($baseurl . $url));
echo "Looking for products in " . $path . "\n";
$prods = $c->find('div.product2014item');
if (count($prods) == 0) {
echo "No products found at " . $url . "\n";
} else {
foreach ($prods as $prod) {
if (strpos($prod->class, "product2014cattab") === FALSE) {
if (!is_null($prod->find('a', 0))) {
$prodname = $prod->find('a.product_link > div', 0)->innertext;
$produrl = $prod->find('a', 0)->href;
fputcsv($p, array($prodname, $path, $produrl));
echo "Saved product: " . $prodname . "\n";
}
}
}
if (!is_null($c->find('div.pagnbtn', 0))) {
getProducts($c->find('div.pagnbtn > a', 0)->href, $path);
}
}
}
开发者ID:jbm160,项目名称:drfs,代码行数:24,代码来源:scraper.php
示例11: function
/**
*
* @AJAX Action - Returns JSON encoded string of all ACodes in a certain category
*
**/
$app->get('/products/:catID', function ($catID) use($app) {
$ACodes = getACodesByCategory($catID);
echo json_encode($ACodes);
});
/**
*
* @AJAX Action - Returns JSON encoded string of all products under a certain ACode
*
**/
$app->get('/products/:catID/:ACode', function ($catID, $ACode) use($app) {
$products = getProducts($ACode);
echo json_encode($products);
});
$app->post('/upload/', function () use($app) {
$fileName = $_FILES["file1"]["name"];
// The file name
$fileTmpLoc = $_FILES["file1"]["tmp_name"];
// File in the PHP tmp folder
$fileType = $_FILES["file1"]["type"];
// The type of file it is
$fileSize = $_FILES["file1"]["size"];
// File size in bytes
$fileErrorMsg = $_FILES["file1"]["error"];
// 0 for false... and 1 for true
if (!$fileTmpLoc) {
// if file not chosen
开发者ID:philipwalter,项目名称:OnlineOrdersApp,代码行数:31,代码来源:weborders.controller.php
示例12: main
public function main()
{
$category_title = 'Каталог';
$category_id = Catalog::getIdByPath($_REQUEST['category_path']);
// парсим id каталога
if ($category_id != 0) {
$this->data['category'] = getCategory($category_id);
} else {
$this->data['category'] = false;
}
if (isset($this->data['category']['parent']) and $this->data['category']['parent']) {
$this->data['category_parent'] = getCategory($this->data['category']['parent']);
}
$this->data['category-no-image'] = 'http://placehold.it/150x100';
// картинка-заглушка
$this->data['categories'] = getCategories($category_id);
// берем все подразделы с текущим родителем
// TODO: 1 для корня отображаем все корневые каталоги и, если есть, товары
// TODO: 2 а можно слева корневые каталоги, а на страничке топ товаров
$this->data['products'] = getProducts($category_id);
// берем все товары с текущим родителем
$this->render('templates/catalog-main.phtml', $category_title);
}
开发者ID:b1oki,项目名称:AnotherShopCMS,代码行数:23,代码来源:views.php
示例13: json_decode
$mData = json_decode($_GET["data"]);
$opt = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC);
switch ($mData->module) {
case 'inward':
# code...
inwardOperations($mData->operation, $mData);
break;
case 'outward':
# code...
outwardOperations($mData->operation, $mData);
break;
case 'inventorySearch':
getInventory($mData->searchBy, $mData->searchKeyword);
break;
case 'getProducts':
getProducts();
break;
case 'getProductsForOutward':
getProductsForOutward();
break;
case 'getProductsForInward':
getProductsForInward();
break;
case 'getSuppliers':
getSuppliers();
break;
case 'getCriticalStock':
$result = InventoryUtils::getCriticalStock();
echo getReturnStatus("Successful", $result);
break;
case 'getHistory':
开发者ID:incizon,项目名称:HicreteWebApp,代码行数:31,代码来源:InventoryIndex.php
示例14: switch
<?php
if (isset($_REQUEST['action'])) {
$user_longitude = $_REQUEST['user_longitude'];
$user_latitude = $_REQUEST['user_latitude'];
$destination_longitude = $_REQUEST['destination_longitude'];
$destination_latitude = $_REQUEST['destination_latitude'];
$product_id = $_REQUEST['product_id'];
$search_term = $_REQUEST['query'];
$venue_id = $_REQUEST['venue_id'];
$radius = $_REQUEST['radius'];
$max_price = $_REQUEST['max_price'];
switch ($_REQUEST['action']) {
case 'get_products':
if ($user_longitude && $user_latitude) {
getProducts($user_longitude, $user_latitude);
}
break;
case 'get_prices':
// echo 'start_long' . $user_longitude .'<br/>';
// echo 'start_lat' . $user_latitude .'<br/>';
// echo 'dest_long' . $destination_longitude . '<br/>';
// echo 'dest_lat' . $destination_latitude . '<br/>';
$price_to_venue = getPrices($user_longitude, $user_latitude, $destination_longitude, $destination_latitude);
print_r(json_encode($price_to_venue));
break;
case 'get_times':
getTimes($user_longitude, $user_latitude, $product_id);
break;
case 'search_foursquare':
if ($venue_id) {
开发者ID:morisco,项目名称:uber-classic,代码行数:31,代码来源:get_data.php
示例15: getProducts
$page=1;//Default page
$limit=20;//Records per page
$start=0;//starts displaying records from 0
if(isset($_GET['page']) && $_GET['page']!=''){
$page=$_GET['page'];
}
$start=($page-1)*$limit;
if($_GET['limite']){
$limit = $_GET['limite'];
}
$Products = getProducts($_REQUEST['sort'],$start,$limit);
$rows= count(ProductsCount());
$super_category = getSuperCat();
$active_category = getCategoryActive();
$categoryLoad = CategoryLoad($_GET['superc_id']);
$subcategoryLoad = SubCategoryLoad($_GET['superc_id'],$_GET['cat_id']);
//print_r($subcategoryLoad);
if ($_GET['delete_id']) {
$delete_id = $_GET['delete_id'];
$sql = "DELETE FROM sohorepro_products WHERE id = " . $delete_id . " ";
$sql_result = mysql_query($sql);
if ($sql_result) {
$result = "success";
} else {
开发者ID:njassim,项目名称:SOHO_REPRO,代码行数:27,代码来源:products_Sep_19.php
示例16: getProducts
<a href="index.php?controller=product&action=new">
Thêm sản phẩm mới
</a>
<table class="my-table">
<tr><th>STT</th><th>Minh họa</th><th>Tên</th><th>Giá</th>
<th>Lượt xem</th>
<th>Người tạo</th>
<th>Xem </th>
<th>Chỉnh sửa</th>
<th>Xóa</th>
</tr>
<?php
$products = getProducts();
while ($p = mysql_fetch_array($products)) {
echo "<tr><td>{$p['id']}</td>";
echo "<td><img src='{$p['img']}' width=50 height = 50 /></td>";
echo "<td class ='align-left'>{$p['name']}</td>";
echo "<td>{$p['price']}</td>";
echo "<td>{$p['view']}</td>";
$u = getUserById($p['user_id']);
echo "<td>{$u['fullname']}</td>";
echo "<td><a href='index.php?controller=product" . "&action=view&id={$p['id']}'>Xem</a></td>";
echo "<td><a href='index.php?controller=product" . "&action=edit&id={$p['id']}'>Sửa</a></td>";
echo "<td><a href='index.php?controller=product" . "&action=delete&id={$p['id']}'>Xóa</a></td></tr>";
}
?>
</table>
<?php
开发者ID:ndm93bn,项目名称:webbanhang,代码行数:30,代码来源:index.php
示例17: session_start
<?php
require_once 'functions.php';
session_start();
checkSession();
$action = isset($_GET['action']) != null ? $_GET['action'] : "home";
switch ($action) {
case "home":
$pageTitle = "AlgimStore - Home Page";
require_once 'header.php';
// Home needs list of items
$keyword = isset($_GET['keyword']) != null ? $_GET['keyword'] : "";
$brand = isset($_GET['brand']) != null && $_GET['brand'] != -1 ? $_GET['brand'] : null;
$make = isset($_GET['make']) != null && $_GET['make'] != -1 ? $_GET['make'] : null;
//$keyword="",$brand=null,$make=null
$items = getProducts($keyword, $brand, $make);
require_once 'home.php';
require_once 'footer.php';
break;
case "login":
$pageTitle = "AlgimStore - Login";
if (isset($_POST['Email'])) {
$mysqli = new mysqli("localhost", "root", "killian", "store");
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
$query = mysqli_query($mysqli, "SELECT ID FROM User WHERE Email='" . $_POST['Email'] . "' AND Password='" . $_POST['Password'] . "' ");
if (mysqli_num_rows($query) > 0) {
$_SESSION["user"] = mysqli_fetch_assoc($query)['ID'];
$query = mysqli_query($mysqli, "SELECT ID FROM Sessions WHERE UserID=" . $_SESSION["user"]);
$_SESSION["sessionID"] = mysqli_fetch_assoc($query)['ID'];
开发者ID:RedDragonJ,项目名称:My-Projects,代码行数:31,代码来源:index.php
示例18: getProducts
<section class="site_body">
<?php
$products = getProducts($data_product);
$token_needed = "";
if ($products) {
foreach ($products as $product) {
$auctiontime = strtotime($product['dateend']) - time();
$token_needed = $product["bids"];
include 'models/token_function.php';
?>
<script>
var poll<?php
echo $product['product_id'];
?>
= function () {
$.ajax({
type: 'POST',
url: "controller/timer.php",
data : {
id : <?php
echo $product['product_id'];
?>
}
}).done(function (data) {
$("#bid_timer_<?php
echo $product['product_id'];
?>
").text(data);
setTimeout(poll<?php
echo $product['product_id'];
?>
开发者ID:nvcDeb,项目名称:CoinCod,代码行数:31,代码来源:product_list.php
示例19: _getProductsTabHtml
/**
* \brief Get the informations of the linked products tab
* \retval string : HTML to display
*/
private function _getProductsTabHtml()
{
global $cookie;
// Get the linked products
$products = getProducts();
if (count($products)) {
$return = '<div style="padding-top:2px;">' . '<div style="float: left; font-weight: bold; text-align: center; width: 25%;">' . $this->l('Product') . '</div>' . '<div style="float: left; font-weight: bold; text-align: center; width: 10%;">' . $this->l('Type') . '</div>' . '<div style="float: left; font-weight: bold; text-align: center; width: 20%;">' . $this->l('Attributes used') . '</div>' . '<div style="float: left; font-weight: bold; text-align: center; width: 15%;">' . $this->l('Global surface reduction') . '</div>' . '<div style="float: left; font-weight: bold; text-align: center; width: 12%;">' . $this->l('Minimum charged surface') . '</div>' . '<div style="float: left; font-weight: bold; text-align: center; width: 8%;">' . $this->l('Delivery') . '</div>' . '<div style="float: left; font-weight: bold; text-align: center; width: 10%;">' . $this->l('Delete link') . '</div>';
// For each product
$active = '';
$active_name = '';
foreach ($products as $product) {
if ($active != $product['id_product']) {
if ($active != '') {
$return .= '<div style="float: left; margin-top: 5px; width: 100%;">' . '<div style="float: left; text-align: left; width: 25%;"><img title="' . $this->l('Edit') . '" class="product_update" id="product_update_' . $active . '" style="cursor: pointer;" ' . 'src="../modules/aimultidimensions/img/edit.png" alt="' . $this->l('Edit') . '" /> ' . $active_name . '</div>' . '<div style="float: left; text-align: center; width: 10%;">' . $GLOBALS['config_format'][$product['aimd_format']]['format'] . '</div>' . '<div style="float: left; text-align: center; width: 20%;">' . implode(', ', $product_attributes) . ' ' . $grid . '</div>';
// Global surface reduction
$gsr = Db::getInstance()->ExecuteS('SELECT aimd_gsr FROM ' . _DB_PREFIX_ . 'product WHERE id_product = ' . $active);
if (intval($gsr[0]['aimd_gsr'])) {
$return .= '<div style="float: left; text-align: center; width: 15%;">' . $this->l('Yes') . '</div>';
} else {
$return .= '<div style="float: left; text-align: center; width: 15%;">' . $this->l('No') . '</div>';
}
// Minimum charged surface
$minimum_surface = Db::getInstance()->getValue('SELECT aimd_msc FROM ' . _DB_PREFIX_ . 'product WHERE id_product = ' . $active);
$return .= '<div style="float: left; text-align: center; width: 12%;">' . $minimum_surface . '</div>';
// Get delivery datas
$delivery = (int) Db::getInstance()->getValue('SELECT ad_delivery FROM ' . _DB_PREFIX_ . 'aimultidimensions_delivery WHERE ad_product = ' . $active);
$return .= '<div style="float: left; text-align: center; width: 8%;">' . $delivery . ' ' . $this->l('Day(s)') . '</div>';
$return .= '<div style="float: left; text-align: center; width: 10%;">' . '<input type="checkbox" name="aimd_delete[' . $active . ']" value="1" />' . '</div>' . '</div>';
}
// Next product
$product_attributes = array();
$active = $product['id_product'];
$active_name = $product['name'];
// Get grid
$grid = $this->_getGrid($active);
}
$product_attributes[] = $product['group_name'];
}
// Last product
$return .= '<div style="float: left; margin-top: 5px; width: 100%;">' . '<div style="float: left; text-align: left; width: 25%;"><img title="' . $this->l('Edit') . '" class="product_update" id="product_update_' . $active . '" style="cursor: pointer;" ' . 'src="../modules/aimultidimensions/img/edit.png" alt="' . $this->l('Edit') . '" /> ' . $active_name . '</div>' . '<div style="float: left; text-align: center; width: 10%;">' . $GLOBALS['config_format'][$product['aimd_format']]['format'] . '</div>' . '<div style="float: left; text-align: center; width: 20%;">' . implode(', ', $product_attributes) . ' ' . $grid . '</div>';
// Global surface reduction
$gsr = Db::getInstance()->ExecuteS('SELECT aimd_gsr FROM ' . _DB_PREFIX_ . 'product WHERE id_product = ' . $active);
if (intval($gsr[0]['aimd_gsr'])) {
$return .= '<div style="float: left; text-align: center; width: 15%;">' . $this->l('Yes') . '</div>';
} else {
$return .= '<div style="float: left; text-align: center; width: 15%;">' . $this->l('No') . '</div>';
}
// Minimum charged surface
$minimum_surface = Db::getInstance()->getValue('SELECT aimd_msc FROM ' . _DB_PREFIX_ . 'product WHERE id_product = ' . $active);
$return .= '<div style="float: left; text-align: center; width: 12%;">' . $minimum_surface . '</div>';
// Get delivery datas
$delivery = (int) Db::getInstance()->getValue('SELECT ad_delivery FROM ' . _DB_PREFIX_ . 'aimultidimensions_delivery WHERE ad_product = ' . $active);
$return .= '<div style="float: left; text-align: center; width: 8%;">' . $delivery . ' ' . $this->l('Day(s)') . '</div>';
$return .= '<div style="float: left; text-align: center; width: 10%;">' . '<input type="checkbox" name="aimd_delete[' . $active . ']" value="1" />' . '</div>' . '</div>' . '</div>';
// Script to update products
$return .= '<script type="text/javascript">' . '$(document).ready( function() {' . '$(\'img.product_update\').click( function() {' . 'var id = $(this).attr(\'id\').replace(\'product_update_\', \'\');' . '$(\'input#update_product_id\').val(id);' . '$(\'form#aimd_form\').submit();' . '});' . '});' . '</script>';
// Delete button
$return .= '<div class="clear"> </div>' . '<p style="text-align: center;"><input class="button" type="submit" name="submitDeleteProduct" value="' . $this->l('Delete the selected links') . '" /></p>';
} else {
$return = '<div style="margin-top: 20px; text-align: center; width: 100%;">' . $this->l('No links defined') . '</div>';
}
return $return;
}
开发者ID:EliosIT,项目名称:PS_AchatFilet,代码行数:67,代码来源:aimultidimensions.php
示例20: printProducts
function printProducts()
{
setlocale(LC_MONETARY, 'id-ID');
$products = getProducts();
$result = '<table class="table table-hover">
<tr>
<th>No.</th>
<th> </th>
<th>Nama Produk</th>
<th>Kategori</th>
<th>Harga Satuan</th>
<th>Stok Tersedia</th>
<th colspan="2"> </th>
</tr>';
$itemindex = 1;
if (count($products) > 0) {
foreach ($products as $product) {
$result .= '<tr>';
$result .= '<td>' . $itemindex . '</td>';
$result .= '<td><img src="../../' . $product->imageurl . '" style="max-width: 100px;"/></td>';
$result .= '<td>' . $product->title . '</td>';
$result .= '<td>' . $product->category . '</td>';
$result .= '<td>' . str_replace('+', '', money_format('%i', $product->price)) . '</td>';
$result .= '<td>' . $product->stock . '</td>';
$result .= "<td><button onclick=\"detailProduct(" . $product->id . ")\" class=\"btn\">Ubah/Detail</btn></td>";
$result .= "<td><button onclick=\"removeProduct(" . $product->id . ",'" . $product->title . "')\" class=\"btn btn-danger removeprod\">X</btn></td>";
$result .= '</tr>';
$itemindex++;
}
} else {
$result .= '<tr><td colspan="5"><p class="alert alert-warning">Tidak ada data produk</p></td></tr>';
}
$result .= '</table>';
return $result;
}
开发者ID:theodorusyoga,项目名称:Cupumanik,代码行数:35,代码来源:functions.php
注:本文中的getProducts函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论