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


PHP product::add_product方法代码示例

本文整理汇总了PHP中product::add_product方法的典型用法代码示例。如果您正苦于以下问题:PHP product::add_product方法的具体用法?PHP product::add_product怎么用?PHP product::add_product使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在product的用法示例。


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

示例1: product

<?php

if (isset($_REQUEST['pcode'])) {
    include "../classes/product.php";
    $obj = new product();
    $pcode = $_REQUEST['pcode'];
    $name = $_REQUEST['name'];
    $sp = $_REQUEST['sprice'];
    $cp = $_REQUEST['cprice'];
    $stock = $_REQUEST['quantity'];
    $obj->add_product($pcode, $name, $sp, $cp, $stock);
}
//echo "http://cs.ashesi.edu.gh/~csashesi/class2016/obed-nsiah/mobileweb/pos/desktop/addstock.html";
//header(Location: ../desktop/addstock.html);
?>
		
开发者ID:kobina-nsiah,项目名称:pos,代码行数:15,代码来源:addproduct.php

示例2: elseif

if (isset($_POST['submit']) && $_POST['submit'] == tr('Add New Product')) {
    // Perform checks
    if ($_POST['amount'] == '') {
        $template->add_message("You did not specify a product amount.", 'error');
    } elseif (!is_numeric($_POST['amount'])) {
        $template->add_message("Invalid product amount specified.", 'error');
    } elseif ($_POST['amount'] < 0) {
        $template->add_message("Invalid product amount specified.", 'error');
    }
    if ($_POST['product_name'] == '') {
        $template->add_message("You did not specify a product name", 'error');
    }
    // Add product, if needed
    if ($template->has_errors != 1) {
        $client = new product();
        $client->add_product($_POST['amount'], $_POST['currency'], $_POST['product_name'], $_POST['description']);
        $template->add_message("Successfully created new product, {$_POST['product_name']}.");
    }
    // Delete checked products
} elseif (isset($_POST['submit']) && $_POST['submit'] == tr('Delete Checked Products')) {
    // Get IDs
    $ids = get_chk('product_id');
    // Disable
    foreach ($ids as $id) {
        if (!$id > 0) {
            continue;
        }
        DB::query("UPDATE products SET is_enabled = 0 WHERE id = %d", $id);
    }
    // User message
    $template->add_message("Successfully deleted checked products.");
开发者ID:nachatate,项目名称:synala,代码行数:31,代码来源:products.php

示例3: add_product

function add_product()
{
    $name = $_GET['name'];
    $barcode = $_GET['barcode'];
    $price = $_GET['price'];
    include_once 'product.php';
    $obj = new product();
    if (!$obj->connect()) {
        $json = '{"status":2, "products":{}, "Failed to connect to the database."}';
        echo $json;
        exit;
    }
    if ($obj->add_product($name, $barcode, $price)) {
        $json = '{"status":0, "products":{}, "message":"Product added."}';
        echo $json;
    } else {
        $json = '{"status":1, "products":{}, "message":"Product was not added."}';
        echo $json;
    }
}
开发者ID:sheamuspy,项目名称:vendite-owner,代码行数:20,代码来源:owner_function.php


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