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


PHP getProduct函数代码示例

本文整理汇总了PHP中getProduct函数的典型用法代码示例。如果您正苦于以下问题:PHP getProduct函数的具体用法?PHP getProduct怎么用?PHP getProduct使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getProduct函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateInvoiceItem

 function updateInvoiceItem($id, $quantity, $product_id, $tax_id, $description, $attr1 = "", $attr2 = "", $attr3 = "", $unit_price = "")
 {
     $attr1 = explode("-", $attr1);
     $attr1 = $attr1[2];
     //echo "Attr1: ".$attr1." ";
     $attr2 = explode("-", $attr2);
     $attr2 = $attr2[2];
     //echo "Attr2 : ".$attr2." ";
     $attr3 = explode("-", $attr3);
     $attr3 = $attr3[2];
     //echo "Attr3 : ".$attr3;
     //echo "<br /><br />";
     $product = getProduct($product_id);
     $unit_price == "" ? $product_unit_price = $product['unit_price'] : ($product_unit_price = $unit_price);
     $tax = getTaxRate($tax_id);
     $total_invoice_item_tax = $product_unit_price * $tax['tax_percentage'] / 100;
     //:100?
     $tax_amount = $total_invoice_item_tax * $quantity;
     $total_invoice_item = $total_invoice_item_tax + $product_unit_price;
     $total = $total_invoice_item * $quantity;
     $gross_total = $product_unit_price * $quantity;
     if ($db_server == 'mysql' && !_invoice_items_check_fk(null, $product_id, $tax_id, 'update')) {
         return null;
     }
     $sql = "UPDATE " . TB_PREFIX . "invoice_items \r\n\t\tSET quantity =  :quantity,\r\n\t\tproduct_id = :product_id,\r\n\t\tunit_price = :unit_price,\r\n\t\ttax_id = :tax_id,\r\n\t\ttax = :tax,\r\n\t\ttax_amount = :tax_amount,\r\n\t\tgross_total = :gross_total,\r\n\t\tdescription = :description,\r\n\t\ttotal = :total,\t\t\t\r\n\t\tattribute_1 = :attr1,\t\t\t\r\n\t\tattribute_2 = :attr2,\t\t\t\r\n\t\tattribute_3 = :attr3\t\t\t\r\n\t\tWHERE id = :id";
     //echo $sql;
     return dbQuery($sql, ':quantity', $quantity, ':product_id', $product_id, ':unit_price', $product_unit_price, ':tax_id', $tax_id, ':tax', $tax[tax_percentage], ':tax_amount', $tax_amount, ':gross_total', $gross_total, ':description', $description, ':total', $total, ':id', $id, ':attr1', $attr1, ':attr2', $attr2, ':attr3', $attr3);
 }
开发者ID:alachaum,项目名称:simpleinvoices,代码行数:28,代码来源:sql_queries.php

示例2: genCartMenuHtml

    public static function genCartMenuHtml($cartProds)
    {
        $retStr = "";
        foreach ($cartProds as $cartProd) {
            $prod = getProduct($cartProd[prodNo]);
            $retStr .= '
					<li>
						<label>' . $prod[prodName] . '</label>
						<span>' . $cartProd[actualPrice] . '</span>
					</li>';
        }
        return $retStr;
    }
开发者ID:ahmanxdd,项目名称:WebProject,代码行数:13,代码来源:ShoppingCart.php

示例3: addOrderToSession

function addOrderToSession($productid, $ingredients)
{
    $product = getProduct($productid);
    if ($product == null) {
        return;
    }
    if ($product['price'] == 0 && (count($ingredients) == 0 || @trim($ingredients[0]) == '')) {
        global $lang;
        echo $lang->get('without_ingredients_not_addable');
        return;
    }
    // Check if the same product is already in the cart
    $allreadythere = -1;
    if (isset($_SESSION['catering'])) {
        for ($i = 0; $i < count($_SESSION['catering']['order']['products']); $i++) {
            // Check if the product is the same
            if ($_SESSION['catering']['order']['products'][$i]['productid'] == $productid) {
                // If it has ingredients
                if (count($ingredients) > 0 && $ingredients[0] != "") {
                    // Compare the number of ingredients
                    if (count($_SESSION['catering']['order']['products'][$i]['ingredients']) == count($ingredients)) {
                        $allreadythere = $i;
                        foreach ($ingredients as $ingredient) {
                            if (!in_array($ingredient, $_SESSION['catering']['order']['products'][$i]['ingredients'])) {
                                $allreadythere = -1;
                            }
                        }
                        if ($allreadythere != -1) {
                            break 1;
                        }
                    }
                } else {
                    $allreadythere = $i;
                }
            }
        }
    }
    if ($allreadythere != -1) {
        updateOrderQuantityInSession($allreadythere, $_SESSION['catering']['order']['products'][$allreadythere]['quantity'] + 1);
    } else {
        $newproduct = array();
        $newproduct['productid'] = $productid;
        if (count($ingredients) != 0 && $ingredients[0] != "") {
            $newproduct['ingredients'] = $ingredients;
        }
        $newproduct['quantity'] = 1;
        $_SESSION['catering']['order']['products'][] = $newproduct;
    }
}
开发者ID:tech-nik89,项目名称:lpm4,代码行数:49,代码来源:catering.function.php

示例4: establishConnection

<?php

require_once './Popo/Produkt.php';
require_once './Popo/Kommentar.php';
require_once './dbconnection.php';
//$produktid = $_GET['produktID'];
$conn = establishConnection();
$produkt = getProduct($_GET['produktID']);
if (isset($_POST['menge'])) {
    $produkt->setMenge($_POST['menge']);
    if (!isset($_SESSION['bestellung'])) {
        $_SESSION['bestellung'] = array($produkt);
    } else {
        $_SESSION['bestellung'][] = $produkt;
    }
    echo "<script type='text/javascript'> alert('Der Warenkorb wurde erfolgreich befüllt! \\nUm ihre Produkte anzuzeigen, sehen sie im Warenkorb nach') </script>";
}
if (isset($_POST['kommentar'])) {
    insertKommentar($_GET['produktID'], $_POST['kommentar']);
}
$kommis = getKommentare($_GET['produktID']);
?>

<div class="container">
    <h1>Detailansicht</h1>
    <table class="table table-bordered">
        <tbody>
        <tr>
            <td><h3> Name </h3></td>
            <td> <?php 
echo $produkt->getName();
开发者ID:Devel0p3r,项目名称:FeRoSch,代码行数:31,代码来源:productdetail.php

示例5: getCategory

function getCategory($id, $privilege)
{
    // the ID of the category that has been selected as a part of the q argument, make sure that one is seleted in the dropdown that is returned
    //if privilege is = COMM, return one thing, if not, return the other
    //the id is the value of the select/option
    //get the product for each iteration for the selected category
    //Return an array of products
    //These products can then be passed to the processMethod
    //which then selects the appropriate support method to
    //display the products
    $db = connect(0, 0, 0);
    $result_cat = $db->query('select category_id, name, description from CATEGORY where category_id = ' . $id);
    $row = $result_cat->fetch_assoc();
    $a = array('selector' => '#category', 'content' => array('category_id' => $row['category_id'], 'name' => $row['name'], 'description' => $row['description']));
    if ($privilege == 'COMM') {
        //echo "</p>Making it ehre</a>" ;
        if ($id == 0) {
            $result_products = $db->query('select * from PRODUCT');
        } else {
            $result_products = $db->query('select product_id from PRODUCT where category_id = ' . $id);
        }
        $num_results = $result_products->num_rows;
        $b = array();
        for ($i = 0; $i < $num_results; $i++) {
            //echo "<p>Getting a product</p>";
            $row = $result_products->fetch_assoc();
            $j = $row['product_id'];
            $b[$i] = getProduct(intval($j), 'SYSTEM');
            $a['content']['product'][] = $b[$i]->toAssocArray();
            //echo "<p>Fetched products : ".$i."</p>";
        }
        echo json_encode($a);
    } elseif ($privilege == 'ADMIN') {
    } else {
        echo "RETRIEVAL_ERROR";
    }
}
开发者ID:croberson2014,项目名称:Umbrella,代码行数:37,代码来源:product_functions.php

示例6: while

																	<?php 
    while ($row = mysql_fetch_array($result_prj)) {
        ?>
                                                                    <tr <?php 
        if ($sno % 2 == 1) {
            ?>
 bgcolor="#F5F2F1" <?php 
        }
        ?>
>
                                                                        <td align="center" class="tableText"><?php 
        echo $sno;
        ?>
</td>
                                                                        <td align="center" class="tableText"><?php 
        echo getProduct('ProductName', 'rec_id', getCount("ProductId", "rec_id", $row["CountId"]));
        ?>
</td>
                                                                        <td align="center" class="tableText"><?php 
        echo getCount("Count", "rec_id", $row["CountId"]);
        ?>
</td>
                                                                        <td align="center" class="tableText"><?php 
        echo $row['StockInKgs'];
        ?>
&nbsp;Kg</td>
                                                                        <td align="center" class="tableText"><?php 
        echo $row['StockInBale'];
        ?>
&nbsp;Bale</td>
                                                                        <td align="center" class="tableText"><?php 
开发者ID:ViShNuPrAtap,项目名称:lss,代码行数:31,代码来源:add_stock.php

示例7: isMinqteSupQte

function isMinqteSupQte($ref)
{
    $produit = getProduct($ref);
    if ($produit['qte_min'] >= $produit['qte']) {
        return true;
    } else {
        return false;
    }
}
开发者ID:ridaovic,项目名称:auto3bservices,代码行数:9,代码来源:functions.php

示例8: getBuyer

?>
</td>
                                                                    <td align="center"><?php 
echo getBuyer('BuyerName', 'rec_id', getDispatchNumber("BuyerId", "rec_id", $row['DispatchNumberId']));
?>
</td>
                                                                    <td align="center"><?php 
echo $row['Port'];
?>
</td>
                                                                    <td align="center"><?php 
echo getCountry(getBuyer('CountryId', 'rec_id', $row['BuyerId']));
?>
</td>
                                                                    <td align="center"><?php 
echo getProduct("ProductName", "rec_id", $row['ProductId']);
?>
</td>
                                                                    <td align="center"><?php 
echo $row['Quantity'];
?>
</td>
                                                                    <td align="center"><?php 
echo $row['Price'];
?>
</td>
                                                                   	<?
																	$sql_doc = "select * from ".$mysql_adm_table_prefix."document_master where DocumentFor='Export'";
																	$result_doc = mysql_query($sql_doc) or die("Error in Query :".$sql_doc."<br>".mysql_error().":".mysql_errno());
																	
																	if(mysql_num_rows($result_doc)>0)
开发者ID:shailendra999,项目名称:hr_admin,代码行数:31,代码来源:export_doc_report.php

示例9: getProduct

																$prdid = $_POST["txt_product"];
                                                            ?>
                                                            
                                                            
                                                            <table align="center" width="100%" border="0" class="border">
                                                                <tr>
                                                                	<td colspan="10" class="gredBg">
                                                                    	REPORT SUMMARY AS ON <?php 
echo $Date;
?>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                	<td width="22%" rowspan="3"  class="gredBg">
																		<?php 
echo getProduct("ProductName", "rec_id", $prdid);
?>
																	</td>
                                                                  <td width="8%" rowspan="3" class="gredBg">
																		Lot Number																  </td>
                                                                  <td colspan="2" class="gredBg">
                                                               	  Op. Stock                                                                    </td>
                                                                    <td colspan="2" class="gredBg">
                                                               	  Received                                                                    </td>
                                                                    <td colspan="2" class="gredBg">
                                                               	  Issued/Mixing                                                                    </td>
                                                                    <td colspan="2" class="gredBg">
                                                                    	Closing Stock                                                                    </td>
                                                              </tr>
                                                                <tr>
                                                                	<td width="9%" class="gredBg">
开发者ID:shailendra999,项目名称:hr_admin,代码行数:31,代码来源:daily_summary_stock_report.php

示例10: define

<?php

require_once __DIR__ . '/vendor/autoload.php';
use Src\Controller\AtlasController;
define('CALLED_FROM_FUNCTIONS', true);
// Routing Rules
if (!isset($_GET['action'])) {
    echo json_encode(['error' => 'Action is missing in request parameter!']);
    return;
}
switch ($_GET['action']) {
    case 'listAll':
        ListAll();
        break;
    case 'detail':
        getProduct();
        break;
    default:
        ListAll();
}
function ListAll()
{
    $atlasController = new AtlasController();
    $atlasController->index();
}
function getProduct()
{
    $productId = $_GET['product-id'];
    $atlasController = new AtlasController();
    $atlasController->detail($productId);
}
开发者ID:rajanrx,项目名称:destination-nsw,代码行数:31,代码来源:functions.php

示例11: while

    require '../scraperwiki-php/scraperwiki.php';
    require '../scraperwiki-php/scraperwiki/simple_html_dom.php';
} else {
    require 'scraperwiki.php';
    require 'scraperwiki/simple_html_dom.php';
}
//
// // Read in a page
echo "Opening prodlist.csv for reading...\n";
if (($f = fopen("./prodlist.csv", "r")) !== FALSE) {
    while (($data = fgetcsv($f)) !== FALSE) {
        echo "Retrieving " . $data[0] . "\n";
        $produrl = $data[3];
        $prodtype = $data[1];
        $prodcat = $data[2];
        if (!getProduct($produrl, $prodtype, $prodcat)) {
            fputcsv($e, $data);
        }
    }
    fclose($f);
}
fclose($o);
fclose($r);
fclose($i);
fclose($e);
// parse the categories and save to database
/** database columns:
sku
_store
_attribute_set
_type
开发者ID:jbm160,项目名称:brs,代码行数:31,代码来源:getprod.php

示例12: getActiveCustomers

$invoiceItems = $invoiceobj->getInvoiceItems($master_invoice_id);
//var_dump($invoiceItems);
$customers = getActiveCustomers();
$preference = getPreference($invoice['preference_id']);
$billers = getActiveBillers();
//$taxes = getActiveTaxes(); <--- look into this
$defaults = getSystemDefaults();
$taxes = getTaxes();
$preferences = getActivePreferences();
$products = getActiveProducts();
for ($i = 1; $i <= 4; $i++) {
    $customFields[$i] = show_custom_field("invoice_cf{$i}", $invoice["custom_field{$i}"], "write", '', "details_screen", '', '', '');
}
foreach ($invoiceItems as $key => $value) {
    //get list of attributes
    $prod = getProduct($value['product_id']);
    $json_att = json_decode($prod['attribute']);
    if ($json_att !== null) {
        $html = "<tr id='json_html" . $key . "'><td></td><td colspan='5'><table><tr>";
        foreach ($json_att as $k => $v) {
            if ($v == 'true') {
                $attr_name_sql = sprintf('select 
                    a.name as name, a.enabled as enabled,  t.name type 
                    from 
                        si_products_attributes as a, 
                        si_products_attribute_type as t 
                   where 
                        a.type_id = t.id
                        AND a.id = %d', $k);
                $attr_name = dbQuery($attr_name_sql);
                $attr_name = $attr_name->fetch();
开发者ID:dadigo,项目名称:simpleinvoices,代码行数:31,代码来源:details.php

示例13: checkLogin

<?php

//stop the direct browsing to this file - let index.php handle which files get displayed
checkLogin();
#get the invoice id
$product_id = $_GET['id'];
$product = getProduct($product_id);
#get custom field labels
$customFieldLabel = getCustomFieldLabels();
$pageActive = "products";
$smarty->assign('pageActive', $pageActive);
$smarty->assign('product', $product);
$smarty->assign('customFieldLabel', $customFieldLabel);
$sql = "select * from " . TB_PREFIX . "products_attributes";
$sth = dbQuery($sql);
$attributes = $sth->fetchAll();
$smarty->assign("attributes", $attributes);
$sql_matrix = "select * from " . TB_PREFIX . "products_matrix where product_id = {$product_id} order by id";
$sth_matrix = dbQuery($sql_matrix);
$matrix = $sth_matrix->fetchAll();
$smarty->assign("matrix", $matrix);
$sql_matrix1 = "select * from " . TB_PREFIX . "products_matrix where product_id = {$product_id} and product_attribute_number = 1 ";
$sth_matrix1 = dbQuery($sql_matrix1);
$matrix1 = $sth_matrix1->fetch();
$smarty->assign("matrix1", $matrix1);
$sql_matrix2 = "select * from " . TB_PREFIX . "products_matrix where product_id = {$product_id} and product_attribute_number = 2 ";
$sth_matrix2 = dbQuery($sql_matrix2);
$matrix2 = $sth_matrix2->fetch();
$smarty->assign("matrix2", $matrix2);
$sql_matrix3 = "select * from " . TB_PREFIX . "products_matrix where product_id = {$product_id} and product_attribute_number = 3 ";
$sth_matrix3 = dbQuery($sql_matrix3);
开发者ID:alachaum,项目名称:simpleinvoices,代码行数:31,代码来源:details.php

示例14: foreach

$condlimit = $opi_limit != false && $opi_limit != NULL;
if (is_true_array($products)) {
    foreach ($products as $key => $p) {
        ?>

    <?php 
        if (is_array($p) && $p['id']) {
            ?>
        <?php 
            $pArray = $p;
            ?>
        <?php 
            $variants = array();
            ?>
        <?php 
            $p = getProduct($p['id']);
            ?>
        <?php 
            $p->firstVariant = getVariant($pArray['id'], $pArray['variant_id']);
            ?>
        <?php 
            $variants[] = $p->firstVariant;
            ?>
    <?php 
        } else {
            ?>
        <?php 
            $variants = $p->getProductVariants();
            ?>
    <?php 
        }
开发者ID:NavaINT1876,项目名称:skidka,代码行数:31,代码来源:2bec35d6245dd1be9736aa4c40a3f38e.php

示例15: array

$data = array("sku", "review_title", "rating", "reviewer", "reviewer_loc", "review_date", "review_detail");
fputcsv($r, $data);
if ($local) {
    require '../scraperwiki-php/scraperwiki.php';
    require '../scraperwiki-php/scraperwiki/simple_html_dom.php';
} else {
    require 'scraperwiki.php';
    require 'scraperwiki/simple_html_dom.php';
}
//
// // Read in a page
echo "Opening prodlist.csv for reading...\n";
if (($f = fopen("./uniqprod.csv", "r")) !== FALSE) {
    while (($data = fgetcsv($f)) !== FALSE) {
        $produrl = $baseurl . $data[3];
        if (!getProduct($produrl)) {
            fputcsv($e, array($data[0], $data[1], $data[2], $data[3]));
        }
    }
    fclose($f);
}
fclose($o);
fclose($r);
fclose($i);
fclose($e);
// parse the categories and save to database
/** database columns:
sku
_store
_attribute_set
_type
开发者ID:jbm160,项目名称:wc_cat,代码行数:31,代码来源:getprod.php


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