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


PHP product::get_product方法代码示例

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


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

示例1: date

$date = date("Y-m-d");
$time = date("h:i:sa");
if (isset($num)) {
    $row = $objBuyer->get_buyer($num);
    if ($row == null) {
        $objBuyer->add_buyer($num, $name, 1);
    } else {
        //do discount stuff
    }
    $more = TRUE;
    $i = 0;
    $totalcost = 0;
    while ($more) {
        if (isset($_REQUEST['pcode' . $i]) && $_REQUEST['pcode' . $i] != "") {
            //get selling price of product
            $row = $objProduct->get_product($_REQUEST['pcode' . $i]);
            $sp = $row['selling_price'];
            //add to transaction products
            $objTransp->add_transaction_product($_REQUEST['pcode' . $i], $_REQUEST['quant' . $i], $date, $time, $num, "obed.nsiah");
            //reduce product quantity
            $objProduct->decrease_stock_level($_REQUEST['pcode' . $i], $_REQUEST['quant' . $i]);
            $totalcost += $_REQUEST['quant' . $i] * $sp;
        } else {
            $more = FALSE;
        }
        $i++;
    }
    $objTrans->add_transaction($date, $time, $num, "obed.nsiah", $totalcost);
    if ($totalcost > 500) {
        //send sms about 10% discount;
    }
开发者ID:kobina-nsiah,项目名称:pos,代码行数:31,代码来源:addtransaction.php

示例2: unset

    $product_id = $_GET['delete'];
    $terminallist->delete_item_list($product_id);
    return 'sucess';
}
// Terminal Add Function
if (isset($_POST['action']) && $_POST['action'] == 'add') {
    $product_qty = $_POST['latestqty'];
    $terminallist->add_item_list($product_qty);
    return 'sucess';
}
// Terminal Switch Function
if (isset($_POST['action']) && $_POST['action'] == 'switch') {
    $id = $_POST['id'];
    unset($_SESSION['terminal_list']);
    $_SESSION['terminal_list'] = $_SESSION['hold_session'][$id];
    unset($_SESSION['hold_session'][$id]);
    $_SESSION['faizan'] = 1;
    return 'sucess';
}
// Get Single Product Detail for Add Product in Warehouse Page
if (isset($_POST['action']) && $_POST['action'] == 'getproductdetail') {
    $getproduct = $_POST['getproduct'];
    header('Content-Type: application/json');
    echo json_encode($product->get_product($getproduct));
}
// Get Single Product Detail for Add Product in Inventory Page
if (isset($_POST['action']) && $_POST['action'] == 'getwarehouseproductdetail') {
    $getproduct = $_POST['getproduct'];
    header('Content-Type: application/json');
    echo json_encode($warehouse->get_products_detail($getproduct));
}
开发者ID:TheHanif,项目名称:POS-10,代码行数:31,代码来源:ajex.php

示例3: product

session_start();
if (isset($_GET['selected_pID'])) {
    if (!empty($_GET['selected_pID'])) {
        $products = new product($_GET['selected_pID']);
        $subcategory = new Subcategory($products->scID);
        $data['cID'] = $subcategory->cID;
        $data['pro'] = (array) $products;
        $data = json_encode($data);
        echo $data;
        exit;
    }
}
if (isset($_GET['selected_scID'])) {
    if (!empty($_GET['selected_scID'])) {
        $products = new product();
        $data = $products->get_product($_GET['selected_scID']);
    }
}
if (isset($_POST['edit_ok'])) {
    $isValid = True;
    if (isset($_POST['insert_pName'])) {
        if (empty($_POST['insert_pName'])) {
            $isValid = False;
            $arrErrors[] = 'insert_pName';
        } else {
            $product = new product($_POST['pID']);
            if ($_POST['insert_pName'] != $product->pName) {
                $isExist = $product->isUniqueName($_POST['insert_pName']);
                if ($isExist) {
                    $arrErrors['isUnique'] = 'this product name already exist';
                    $isValid = False;
开发者ID:SalmaNegm,项目名称:eShop,代码行数:31,代码来源:adminEditProduct_server.php

示例4: isset

			<li><a href="inventory.php">Inventory</a></li>
			<li class="active">Add Inventory Products</li>
		</ol>

		<div class="panel panel-info">
		  <div class="panel-heading">
			<h3><?php 
echo isset($_GET['id']) ? 'Update' : 'Add';
?>
 Inventory Products</h3>
		  </div>
		  <div class="panel-body">
			<!-- BEGIN DATA TABLE -->
			<?php 
$product = new product();
$all_product = $product->get_product();
$warehouse = new warehouse();
$all_product_warehouse = $warehouse->get_products();
$inventory = new inventory();
$ID = isset($_GET['id']) ? $_GET['id'] : NULL;
if (isset($_POST['add_inventory'])) {
    // Update old record
    if (isset($ID)) {
        $results = $inventory->inv_update($_POST, $ID);
    } else {
        // Insert new
        $results = $inventory->inv_insert($_POST);
    }
    if ($results) {
        echo '<div class="alert alert-success alert-block fade in alert-dismissable">
				  <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
开发者ID:TheHanif,项目名称:POS-10,代码行数:31,代码来源:add_inventory.php

示例5: product

<?php

require_once 'header.php';
?>
<section>
	<hr/>
	<div class="container">
		<div class="row">
			<div class="tableHeading">
				<p class="nomargin alignCenter">View Products</p>
			</div>
			<div class="col-md-12">	
				<?php 
$product = new product();
$results = $product->get_product();
if ($results) {
    ?>
				<table border="1" cellpadding="5" cellspacing="0" class="table table-hover tableView">
					<tr>
						<th>Product Name</th>
						<th>Product Supplier</th>
						<th>Product Cost</th>
						<th>Product Price</th>
						<th>Product GST</th>
						<th>Action</th>
					</tr>
						<?php 
    foreach ($results as $res) {
        echo '<tr>';
        echo '<td>' . $res->p_name . '</td>';
        echo '<td>' . $res->p_supplier . '</td>';
开发者ID:TheHanif,项目名称:POS-Faizan,代码行数:31,代码来源:view_product.php

示例6: get_product

function get_product()
{
    include_once 'product.php';
    $barcode = $_GET['barcode'];
    $obj = new product();
    if (!$obj->connect()) {
        $json = '{"status":2, "products":{}, "message":"Failed to connect to the database."}';
        echo $json;
        exit;
    }
    if ($obj->get_product($barcode)) {
        $row = $obj->fetch();
        $json = '{"status": 0, "products":' . json_encode($row) . ', "message": "Found product."}';
        echo $json;
    } else {
        $json = '{"status":1, "products":{}, "message":"Sorry we could not execute that."}';
        echo $json;
    }
}
开发者ID:sheamuspy,项目名称:vendite-owner,代码行数:19,代码来源:owner_function.php


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