• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getProduct函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: subContent

function subContent($code, $id, $kod, $pp_kod)
{
    if ($kod == 1) {
        ?>
      <div class="col-md-12">
        <?php 
        getProduct($id, $pp_kod);
        ?>
      </div>
      <div class="col-md-12">&nbsp;</div>
      <div class="col-md-12">
        <button class="btn btn-primary" onclick="content('<?php 
        echo $code;
        ?>
')"><i class="fa fa-arrow-left"></i> Back</button>
        <button class="btn btn-primary" onclick="subContent(2,'<?php 
        echo $pp_kod;
        ?>
')">Next <i class="fa fa-arrow-right"></i></a>
      </div>
    <?php 
    } elseif ($kod == 2) {
        $query = "SELECT pp_ref_no,pp_nama_brand,pp_nama_generic,pp_nama FROM p_product WHERE pp_kod='{$pp_kod}'";
        $result = selQuery($query);
        $row = mysqli_fetch_assoc($result);
        ?>
    <div class="col-md-12">
      <div class="row">
        <div class="alert alert-sm alert-border-left alert-primary"><b>Product Information</b></div>
        <div class="col-md-6">
        <?php 
        if ($id == 2) {
            ?>
        <b>Call No : </b>
        <p><?php 
            echo isEmpty($pp_kod);
            ?>
</p>
        <?php 
        } else {
            ?>
        <b>Reference No : </b>
        <p><?php 
            echo isEmpty($row['pp_ref_no']);
            ?>
</p>
        <?php 
        }
        ?>
        <input type="hidden" id="pp_kod" value="<?php 
        echo $pp_kod;
        ?>
" />
        </div>
        <div class="col-md-6">
        <b>Brand Name : </b>
        <p><?php 
        echo isEmpty($row["pp_nama_brand"]);
        ?>
</p>
        </div>
        <div class="col-md-6">
        <b>Generic Name : </b>
        <p><?php 
        echo isEmpty($row["pp_nama_generic"]);
        ?>
</p>
        </div>
        <div class="col-md-6">
        <b>Full product name : </b>
        <p><?php 
        echo isEmpty($row["pp_nama"]);
        ?>
</p>
        </div>
      </div>
      <div class="row">
        <div class="section-divider"></div>
      </div>
    </div>
      <?php 
        if ($id == 2 || $id == 5 || $id == 6) {
            ?>
      <div class="col-md-12">
      <?php 
            getValidList($id, $pp_kod);
            ?>
      </div>
      <?php 
        } else {
            ?>
      <div class="col-md-12">
        <?php 
            distributedList($id, $pp_kod);
            ?>
      </div>
      <?php 
        }
        ?>
      <div class="col-md-12">
//.........这里部分代码省略.........
开发者ID:syafiqazwan,项目名称:pharmaco,代码行数:101,代码来源:pkk.php


示例17: Company

        }
        $content .= '
        <h3>URL Not working</h3>
        Found an URL that doesn\'t work? Please submit it using the form below and one of our representatives will review the submission as fast as possible.<br>
        <form method="post">
        URL:<input type="text" name="url-bad" value="" /><br>
        Captcha: <input name="captcha" type="text">
        <img src="captcha.php" /><br>
        <input type="submit" name="submit" value="Submit" />
        </form>

        <h3>General Contact Form</h3>
        Our general contact form is temporarily disabled due to technical difficulties. Please come back later.';
        $title = 'Contact Page';
        break;
    case 'about':
        $content = 'Super Secure Company (SSC) LLC is a multi-million dollar company founded in 1937 which delivers extremly good products for nice people in over 137 countries. Last year SSC LLC became the largest provider of awesome goods in the world, with over 133.337.456 products sold world wide. Some our pretty amazing products: <br><br>';
        $title = 'About us';
        break;
    case '':
    default:
        $title = 'Super Secure Company LLC';
        $content = 'Super Secure Company (SSC) LLC is a multi-million dollar company founded in 1937 which delivers extremly good products for nice people in over 137 countries. Last year SSC LLC became the largest provider of awesome goods in the world, with over 133.337.456 products sold world wide. Some our pretty amazing products: <br><br>';
        foreach ($products as $prod) {
            $content .= getProduct($prod);
            //todo replace below links
            $content .= '<br><a href="mailto:[email protected]?body=' . urlencode('Nice product http://10.13.37.13/?page=product&prod=' . $prod) . '">Send Mail to a Friend</a> | <a href="http://10.13.37.13/?page=print&load_template=1&url=' . base64_encode('http://10.13.37.13/?page=product&prod=' . $prod) . '">Details</a>';
        }
        break;
}
echo showContent($title, $content);
开发者ID:YSc21,项目名称:YSc21.github.io,代码行数:31,代码来源:dctf-web300-index.php


示例18: AddToCartAndUpdateTotals

function AddToCartAndUpdateTotals()
{
    global $woocommerce;
    $product_id = $_POST["product_id"];
    $woocommerce->cart->add_to_cart($product_id, $_POST["quantity"]);
    $return["product_name"] = getProduct($product_id)->get_title();
    $return["total_incart"] = $woocommerce->cart->get_cart_total();
    $return["total_items"] = $woocommerce->cart->get_cart_contents_count();
    $return["cart_menu"] = updateCartSubmenu();
    echo json_encode($return);
}
开发者ID:srwonka,项目名称:git-paneladopet,代码行数:11,代码来源:paneladopet-functions.php


示例19: getProduct

            $product['id'] = $id;
            $product['description'] = $description;
            $product['production'] = $production;
            $product['expiration'] = $expiration;
            $product['price'] = $price;
            $product['amount'] = $amount;
            return $product;
            // echo "<tr>\n<td>$description</td>\n<td>".date("d/m/Y",strtotime($production))."</td>\n<td>".$date->format('d/m/Y')."</td>\n<td>R$ $price</td>\n<td>$amount</td>\n<td><a class=\"link_ajax\" href=\"edit?id=$id\">Editar</a></td>\n</tr>";
        }
        $stmt->close();
        $conn->close();
    } else {
        echo "Falha na conexão: " . $conn->error;
    }
}
$product = getProduct($_SESSION['id'], $_GET['id']);
?>
<div class="col-md-4 col-md-offset-4">
    <a class="btn btn-primary link_ajax" href="products.php">Voltar</a>
    <h1>Editar produto</h1>
    <form id="formAjax" action="../../controllers/editProduct.php" method="post">
        <input type="hidden" name="prod_id" value="<?php 
echo $product['id'];
?>
">
        <div class="form-group" id="">
            <label for="InputDesc">Descrição do Produto</label>
            <input type="text" class="form-control" id="InputDesc" maxlength="255" name="description" value="<?php 
echo $product['description'];
?>
">
开发者ID:Hernior,项目名称:20152,代码行数:31,代码来源:product_edit.php


示例20: getProduct

<?php

require_once 'config.php';
require_once 'sample-data/category.php';
require_once 'product_model.php';
$productEntityID = $_GET['entity_id'];
$product = getProduct($productEntityID);
$categories = mainCategory($DB);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Web Shop App</title>
</head>
<body>
<div class="product-listing">
    <?php 
if ($categories) {
    ?>
        <div class="category-menu">
            <ul>
                <?php 
    foreach ($categories as $category) {
        ?>
                    <li> <!-- echo entity id da ga upiše u url -->
                        <a href="category_page.php?entity_id=<?php 
        echo $category['entity_id'];
        ?>
"><?php 
        echo $category['name'];
开发者ID:Substractive,项目名称:Webshop,代码行数:31,代码来源:product_page.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getProductBaseCurrency函数代码示例发布时间:2022-05-15
下一篇:
PHP getPriv函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap