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


PHP OperationData::add方法代码示例

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


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

示例1: Upload

    if ($_POST["inventary_min"] != "") {
        $inventary_min = $_POST["inventary_min"];
    }
    $product->category_id = $category_id;
    $product->inventary_min = $inventary_min;
    $product->user_id = Session::getUID();
    if (isset($_FILES["image"])) {
        $image = new Upload($_FILES["image"]);
        if ($image->uploaded) {
            $image->Process("storage/products/");
            if ($image->processed) {
                $product->image = $image->file_dst_name;
                $product->add_with_image();
            }
        } else {
            $product = $product->add();
        }
    } else {
        $product = $product->add();
    }
    if ($_POST["q"] != "" || $_POST["q"] != "0") {
        $op = new OperationData();
        $op->product_id = $product[1];
        $op->operation_type_id = OperationTypeData::getByName("entrada")->id;
        $op->q = $_POST["q"];
        $op->sell_id = "NULL";
        $op->is_oficial = 1;
        $op->add();
    }
    print "<script>window.location='index.php?view=products';</script>";
}
开发者ID:leanet,项目名称:inventio-lite,代码行数:31,代码来源:widget-default.php

示例2: foreach

if ($go && isset($_SESSION["cart"])) {
    $cart = $_SESSION["cart"];
    if (count($cart) > 0) {
        /*			$sell = new SellData();
        			$sell->user_id = $_SESSION["user_id"];
        			$sell->total = $_POST["total"];
        			$sell->discount = $_POST["discount"];
        			$s = $sell->add();
        */
        foreach ($cart as $c) {
            $op = new OperationData();
            $op->item_id = $c["item_id"];
            $op->client_id = $_POST["client_id"];
            $op->start_at = $_POST["start_at"];
            $op->finish_at = $_POST["finish_at"];
            $op->user_id = $_SESSION["user_id"];
            $add = $op->add();
            $item = ItemData::getById($c["item_id"]);
            $item->unavaiable();
            unset($_SESSION["cart"]);
            setcookie("selled", "selled");
        }
        ////////////////////
    }
}
if ($go) {
    print "<script>window.location='index.php?view=rents';</script>";
} else {
    print "<script>alert('Rango de fecha invalido!');</script>";
    print "<script>window.location='index.php?view=rent';</script>";
}
开发者ID:mriveros,项目名称:library-php,代码行数:31,代码来源:action-default.php

示例3: OperationData

<?php

// print_r($_POST);
$operation = new OperationData();
$operation->product_id = $_POST["product_id"];
$operation->operation_type_id = 1;
$operation->is_oficial = 1;
$operation->q = $_POST["q"];
$operation->sell_id = $_POST["sell_id"];
$operation->add();
header("Location: index.php?view=onesell&id={$_POST['sell_id']}");
// header("Location: index.php?view=categories");
开发者ID:evilnapsis,项目名称:cazueliyas,代码行数:12,代码来源:widget-default.php


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