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


PHP Product::insert方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     $vendorId = null;
     $contactName = "Trevor Rigler";
     $vendorEmail = "trier@cnm.edu";
     $vendorName = "TruFork";
     $vendorPhoneNumber = "5053594687";
     $vendor = new Vendor($vendorId, $contactName, $vendorEmail, $vendorName, $vendorPhoneNumber);
     $vendor->insert($this->getPDO());
     $productId = null;
     $vendorId = $vendor->getVendorId();
     $description = "A glorius bead to use";
     $leadTime = 10;
     $sku = "TGT354";
     $title = "Bead-Green-Blue-Circular";
     $this->product = new Product($productId, $vendorId, $description, $leadTime, $sku, $title);
     $this->product->insert($this->getPDO());
     $locationId = null;
     $description = "Back Stock";
     $storageCode = 7;
     $this->location = new Location($locationId, $storageCode, $description);
     $this->location->insert($this->getPDO());
     $unitId = null;
     $unitCode = "pk";
     $quantity = 10.5;
     $this->unitOfMeasure = new UnitOfMeasure($unitId, $unitCode, $quantity);
     $this->unitOfMeasure->insert($this->getPDO());
 }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:29,代码来源:product-location-test.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     $vendorId = null;
     $name = "TruFork";
     $contactName = "Trevor Rigler";
     $email = "trier@cnm.edu";
     $phoneNumber = "5053594687";
     $vendor = new Vendor($vendorId, $name, $contactName, $email, $phoneNumber);
     $vendor->insert($this->getPDO());
     $productId = null;
     $vendorId = $vendor->getVendorId();
     $description = "A glorius bracelet for any occasion to use";
     $leadTime = 15;
     $sku = "457847";
     $title = "Bracelet-Green-Blue";
     $this->finishedProduct = new Product($productId, $vendorId, $description, $leadTime, $sku, $title);
     $this->finishedProduct->insert($this->getPDO());
     $productId = null;
     $vendorId = $vendor->getVendorId();
     $description = "A glorius bead to use";
     $leadTime = 10;
     $sku = "354";
     $title = "Bead-Green-Blue-Circular";
     $this->rawMaterial = new Product($productId, $vendorId, $description, $leadTime, $sku, $title);
     $this->rawMaterial->insert($this->getPDO());
 }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:27,代码来源:finished-product-test.php

示例3: setUp

 /**
  * Set up to create vendor, product, unitOfMeasure objects
  *
  **/
 public function setUp()
 {
     parent::setUp();
     $this->guzzle = new \GuzzleHttp\Client(['cookies' => true]);
     $vendorId = null;
     $contactName = "Trevor Rigler";
     $vendorEmail = "trier@cnm.edu";
     $vendorName = "TruFork";
     $vendorPhoneNumber = "5053594687";
     $vendor = new Vendor($vendorId, $contactName, $vendorEmail, $vendorName, $vendorPhoneNumber);
     $vendor->insert($this->getPDO());
     $productId = null;
     $vendorId = $vendor->getVendorId();
     $description = "A glorius bead to use";
     $leadTime = 10;
     $sku = "TGT354";
     $title = "Bead-Green-Blue-Circular";
     $this->product = new Product($productId, $vendorId, $description, $leadTime, $sku, $title);
     $this->product->insert($this->getPDO());
     $unitId = null;
     $quantity = 3.5;
     $unitCode = "ea";
     $this->unitOfMeasure = new UnitOfMeasure($unitId, $unitCode, $quantity);
     $this->unitOfMeasure->insert($this->getPDO());
 }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:29,代码来源:location-api-test.php

示例4: setUp

 public function setUp()
 {
     parent::setUp();
     $vendorId = null;
     $contactName = "Trevor Rigler";
     $vendorEmail = "trier@cnm.edu";
     $vendorName = "TruFork";
     $vendorPhoneNumber = "5053594687";
     $vendor = new Vendor($vendorId, $contactName, $vendorEmail, $vendorName, $vendorPhoneNumber);
     $vendor->insert($this->getPDO());
     $productId = null;
     $vendorId = $vendor->getVendorId();
     $description = "A glorius bead to use";
     $leadTime = 10;
     $sku = "TGT354";
     $title = "Bead-Green-Blue-Circular";
     $this->product = new Product($productId, $vendorId, $description, $leadTime, $sku, $title);
     $this->product->insert($this->getPDO());
     $alertId = null;
     $alertCode = "WM";
     $alertFrequency = "D2";
     $alertOperator = "L";
     $alertPoint = 100.514;
     $this->alertLevel = new AlertLevel($alertId, $alertCode, $alertFrequency, $alertPoint, $alertOperator);
     $this->alertLevel->insert($this->getPDO());
 }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:26,代码来源:product-alert-test.php

示例5: setUp

 public function setUp()
 {
     parent::setUp();
     $this->guzzle = new \GuzzleHttp\Client(['cookies' => true]);
     $this->VALID_movementDate = DateTime::createFromFormat("Y-m-d H:i:s", "2015-09-26 08:45:25");
     $this->INVALID_movementDate = DateTime::createFromFormat("Y-m-d H:i:s", "2015-14-26 06:25:25");
     $userId = null;
     $firstName = "Jim";
     $lastName = "Jim";
     $root = 1;
     $attention = "Urgent: ";
     $addressLineOne = "123 House St.";
     $addressLineTwo = "P.O Box. 9965";
     $city = "Tattoine";
     $state = "AK";
     $zipCode = "52467";
     $email = "jim@naboomail.nb";
     $phoneNumber = "5052253231";
     $salt = bin2hex(openssl_random_pseudo_bytes(32));
     $hash = hash_pbkdf2("sha512", "password1234", $salt, 262144, 128);
     $this->user = new User($userId, $lastName, $firstName, $root, $attention, $addressLineOne, $addressLineTwo, $city, $state, $zipCode, $email, $phoneNumber, $salt, $hash);
     $this->user->insert($this->getPDO());
     $vendorId = null;
     $contactName = "Trevor Rigler";
     $vendorEmail = "trier@cnm.edu";
     $vendorName = "TruFork";
     $vendorPhoneNumber = "5053594687";
     $vendor = new Vendor($vendorId, $contactName, $vendorEmail, $vendorName, $vendorPhoneNumber);
     $vendor->insert($this->getPDO());
     $productId = null;
     $vendorId = $vendor->getVendorId();
     $description = "A glorius bead to use";
     $leadTime = 10;
     $sku = "TGT354";
     $title = "Bead-Green-Blue-Circular";
     $this->product = new Product($productId, $vendorId, $description, $leadTime, $sku, $title);
     $this->product->insert($this->getPDO());
     $locationId = null;
     $description = "Back Stock";
     $storageCode = 13;
     $this->fromLocation = new Location($locationId, $storageCode, $description);
     $this->fromLocation->insert($this->getPDO());
     $locationId = null;
     $description = "Front Stock";
     $storageCode = 12;
     $this->toLocation = new Location($locationId, $storageCode, $description);
     $this->toLocation->insert($this->getPDO());
     $unitId = null;
     $unitCode = "pk";
     $quantity = 10.5;
     $this->unitOfMeasure = new UnitOfMeasure($unitId, $unitCode, $quantity);
     $this->unitOfMeasure->insert($this->getPDO());
 }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:53,代码来源:movement-api-test.php

示例6: setUp

 public function setUp()
 {
     parent::setUp();
     $vendorId = null;
     $contactName = "Trevor Rigler";
     $vendorEmail = "trier@cnm.edu";
     $vendorName = "TruFork";
     $vendorPhoneNumber = "5053594687";
     $vendor = new Vendor($vendorId, $contactName, $vendorEmail, $vendorName, $vendorPhoneNumber);
     $vendor->insert($this->getPDO());
     $productId = null;
     $vendorId = $vendor->getVendorId();
     $description = "A glorius bead to use";
     $leadTime = 10;
     $sku = "TGT354";
     $title = "Bead-Green-Blue-Circular";
     $this->product = new Product($productId, $vendorId, $description, $leadTime, $sku, $title);
     $this->product->insert($this->getPDO());
 }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:19,代码来源:alert-level-test.php

示例7: UploadImg

include "models/function.php";
if (isset($_POST["go"])) {
    $objImg = new UploadImg();
    $name_img = $objImg->upload($_FILES, $_POST["photo_now"]);
    $objAttr = new AttrValue();
    $data_attr = $objAttr->conbine($_POST["attr"], $_POST["val"]);
    if (isset($_POST["related"]) and $_POST["related"]) {
        $related = array_slice($_POST["related"], 0, 4);
        $data_related = serialize($related);
    } else {
        $data_related = "";
    }
    require_once "classes/Product.php";
    $obj = new Product();
    if ($_POST["go"] == "save") {
        $fff = $obj->insert($obj->insertSql(), trimStr($_POST["section"]), trimStr($_POST["name"]), trimStr($_POST["nomer"]), trimStr($_POST["brand"]), trimStr($_POST["viscous"]), trimStr($_POST["type"]), trimStr($_POST["volume"]), trimStr($_POST["kol"]), trimStr($_POST["price"]), trimStr($_POST["text"]), $data_related, $data_attr, trimStr($_POST["title"]), trimStr($_POST["description"]), trimStr($_POST["keywords"]), $name_img, trimStr($_POST["img_title"]), trimStr($_POST["img_alt"]));
        header("Location: production.php?id=" . $_POST["section"]);
    } else {
        $obj->update($obj->updateSql(), trimStr($_POST["section"]), trimStr($_POST["name"]), trimStr($_POST["nomer"]), trimStr($_POST["brand"]), trimStr($_POST["viscous"]), trimStr($_POST["type"]), trimStr($_POST["volume"]), trimStr($_POST["kol"]), trimStr($_POST["price"]), trimStr($_POST["text"]), $data_related, $data_attr, trimStr($_POST["title"]), trimStr($_POST["description"]), trimStr($_POST["keywords"]), $name_img, trimStr($_POST["img_title"]), trimStr($_POST["img_alt"]), $_POST['go']);
        header("Location: production.php?id=" . $_POST["section"]);
    }
}
if (isset($_GET["delete"])) {
    $delete = new Delete();
    $delete->del($_GET["title"], $_GET["delete"]);
    header("Location: production.php?id=" . $_GET["delete"]);
}
require_once "classes/Catalog.php";
$section = new Catalog();
require_once "classes/Product.php";
$objEdit = new Product();
开发者ID:Torredo,项目名称:autozip,代码行数:31,代码来源:add_product.php

示例8: testDeleteValidProduct

 /**
  * test deleting a valid Product
  **/
 public function testDeleteValidProduct()
 {
     // create a new Product
     $newProduct = new Product(null, $this->vendor->getVendorId(), $this->VALID_description, $this->VALID_leadTime, $this->VALID_sku, $this->VALID_title);
     $newProduct->insert($this->getPDO());
     // grab the data from guzzle and enforce the status' match our expectations
     $this->guzzle->get('https://bootcamp-coders.cnm.edu/~invtext/backend/php/api/product/' . $newProduct->getProductId());
     $response = $this->guzzle->get('https://bootcamp-coders.cnm.edu/~invtext/backend/php/api/product/' . $newProduct->getProductId(), ['headers' => ['X-XSRF-TOKEN' => $this->getXsrfToken()]]);
     $this->assertSame($response->getStatusCode(), 200);
     $body = $response->getBody();
     $product = json_decode($body);
     $this->assertSame(200, $product->status);
 }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:16,代码来源:product-api-test.php

示例9: setUp

 public function setUp()
 {
     parent::setUp();
     $vendorId = null;
     $contactName = "Trevor Rigler";
     $vendorEmail = "trier@cnm.edu";
     $vendorName = "TruFork";
     $vendorPhoneNumber = "5053594687";
     $vendor = new Vendor($vendorId, $contactName, $vendorEmail, $vendorName, $vendorPhoneNumber);
     $vendor->insert($this->getPDO());
     $productId = null;
     $vendorId = $vendor->getVendorId();
     $description = "A glorius bead to use";
     $leadTime = 10;
     $sku = "TGT354";
     $title = "Bead-Green-Blue-Circular";
     $this->product = new Product($productId, $vendorId, $description, $leadTime, $sku, $title);
     $this->product->insert($this->getPDO());
     $alertId = null;
     $alertCode = "33";
     $alertFrequency = "11";
     $alertLevel = "100.01";
     $alertOperator = "1";
     $this->alertLevel = new AlertLevel($alertId, $alertCode, $alertFrequency, $alertLevel, $alertOperator);
     $this->alertLevel->insert($this->getPDO());
     $productEnabled = true;
     $this->productAlert = new ProductAlert($this->alertLevel->getAlertId(), $this->product->getProductId(), $productEnabled);
     $this->productAlert->insert($this->getPDO());
     $this->VALID_notificationDateTime = DateTime::createFromFormat("Y-m-d H:i:s", "1985-06-28 04:26:03");
 }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:30,代码来源:notification-test.php

示例10: Product

        if ($sub_cato == $yy) {
            $Nsub_cato = $srow['id_sub'];
            // var_dump("$Ncato");
            break;
        }
    }
    $prod = new Product();
    // $allimg=$sub_cato."/".$IMG;
    $prod->id_cato = $Ncato;
    $prod->id_sub = $Nsub_cato;
    $prod->type_prod = $sub_cato;
    $prod->descrp = $descp;
    $prod->image = $IMG;
    $prod->quantity = $quant;
    $prod->unit_price = $pric;
    $prod->id_product = 'NULL';
    $prod->insert();
    print_r($prod);
    echo $Ncato;
    echo $Nsub_cato;
    if ($Ncato == 0 || $Nsub_cato == 0) {
        header("location:insert_products.php");
    }
    // echo "<a href='profile.php'>aaa<a/>";
    echo "<meta http-equiv='Refresh' content='0;url=profile.php' />";
} else {
    header("location:insert_products.php");
}
?>

开发者ID:osamasabry,项目名称:php,代码行数:29,代码来源:inst_prods.php

示例11: inserProduct

 function inserProduct($name, $description, $price, $img)
 {
     $p = new Product();
     return $p->insert($name, $description, $price, $img);
 }
开发者ID:parameshvec,项目名称:shopcart-mongodb-php,代码行数:5,代码来源:Controlador.php

示例12: implode

                 if (isset($_POST['color'])) {
                     $color_arr = $_POST['color'];
                     $product->color = implode(",", $color_arr);
                     /*$arr = preg_split("/[,]+/", color);*/
                 } else {
                     $product->color = 'not-avilable';
                 }
                 if (isset($_POST['quantity'])) {
                     $product->quantity = $_POST['quantity'];
                 } else {
                     $product->quantity = '0';
                 }
                 $d = mktime(11, 14, 54, 8, 12, 2014);
                 $product->add_date = date("Y-m-d h:i:sa", $d);
                 $product->status = '1';
                 echo $product->insert();
                 $product_id = $product->insert();
                 echo $product_id;
                 if ($product_id) {
                     $_SESSION['Psuccess'] = "Product add has success";
                     header('location:../controle.php#tabs-4');
                 }
             } else {
                 $_SESSION['Pname'] = "Please enter valid name ";
                 header('location:../controle.php#tabs-4');
             }
         }
         echo "error";
     }
     echo "error";
 }
开发者ID:ElsayedAhmed,项目名称:php-proj,代码行数:31,代码来源:check_product_add.php

示例13: testGetValidNotificationByProductId

 /**
  * test grabbing product by notification
  **/
 public function testGetValidNotificationByProductId()
 {
     // create a new product and insert to into mySQL
     $product = new Product(null, $this->vendor->getVendorId(), $this->VALID_description, $this->VALID_leadTime, $this->VALID_sku, $this->VALID_title);
     $product->insert($this->getPDO());
     // create a new product and insert to into mySQL
     $productAlert = new ProductAlert($this->alertLevel->getAlertId(), $product->getProductId(), true);
     $productAlert->insert($this->getPDO());
     // grab the data from mySQL and enforce the fields match our expectations
     $pdoNotificationArray = Product::getNotificationByProductId($this->getPDO(), $product->getProductId());
     for ($i = 0; $i < count($pdoNotificationArray); $i++) {
         if ($i === 0) {
             $this->assertSame($pdoNotificationArray[$i]->getVendorId(), $this->vendor->getVendorId());
             $this->assertSame($pdoNotificationArray[$i]->getDescription(), $this->VALID_description);
             $this->assertSame($pdoNotificationArray[$i]->getLeadTime(), $this->VALID_leadTime);
             $this->assertSame($pdoNotificationArray[$i]->getSku(), $this->VALID_sku);
             $this->assertSame($pdoNotificationArray[$i]->getTitle(), $this->VALID_title);
         } else {
             $this->assertSame($pdoNotificationArray[$i]->getNotificationId(), $this->notification->getNotificationId());
             $this->assertSame($pdoNotificationArray[$i]->getAlertId(), $this->notification->getAlertId());
             $this->assertSame($pdoNotificationArray[$i]->getEmailStatus(), $this->notification->getEmailStatus());
             $this->assertEquals($pdoNotificationArray[$i]->getNotificationDateTime(), $this->notification->getNotificationDateTime());
             $this->assertSame($pdoNotificationArray[$i]->getNotificationHandle(), $this->notification->getNotificationHandle());
             $this->assertSame($pdoNotificationArray[$i]->getNotificationContent(), $this->notification->getNotificationContent());
         }
     }
 }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:30,代码来源:product-test.php

示例14:

             }
         }
         if (!$wasError) {
             if (isset($param) && !empty($param)) {
                 // ha van kep, akkor regit toroljuk, uj elmentodik
                 if (isset($_POST['image'])) {
                     $theProduct = $product->find((int) $param);
                     @unlink(FOTO_UPLOAD_DIR . $theProduct['image']);
                     @unlink(THUMB_UPLOAD_DIR . $theProduct['image']);
                 }
                 //update
                 $product->update($_POST, (int) $param);
                 $theProduct = $product->find((int) $param);
             } else {
                 //insert
                 $product->insert($_POST);
                 Redirect::to(BASE_URL . 'products/');
             }
         } else {
             $theProduct = $_POST;
         }
     }
     //$template = 'products_edit';
     break;
 case 'delete':
     if (isset($param) && !empty($param)) {
         $p = $product->find((int) $param);
         $product->delete((int) $param);
         if ($p['image']) {
             @unlink(FOTO_UPLOAD_DIR . $p['image']);
             @unlink(THUMB_UPLOAD_DIR . $p['image']);
开发者ID:adobi,项目名称:exam,代码行数:31,代码来源:products.php

示例15: sqlInjection

require "../includes/injection.php";
require "../../includes/trackXML.php";
$cate = sqlInjection($_POST['CateID']);
$lable = sqlInjection($_POST['Lable']);
$price = sqlInjection($_POST['Price']);
$artist = sqlInjection($_POST['Artist']);
$producer = sqlInjection($_POST['Producer']);
$year = sqlInjection($_POST['pubYear']);
$disktype = sqlInjection($_POST['DiskType']);
$description = sqlInjection($_POST['Description']);
$tracklist = "";
$image = sqlInjection($_POST['proImage']);
$status = sqlInjection($_POST['ProStatus']);
$continue = $_POST['continue'];
$trck = new TrackXML();
$prod = new Product();
if (isset($_POST['trackname']) && isset($_POST['tracklength'])) {
    $tracklist = $trck->createXML($_POST['trackname'], $_POST['tracklength']);
}
//echo $lable."<br>".$cate."<br>".$price
//	."<br>".$artist."<br>".$producer."<br>".$year."<br>".$disktype."<br>".$description
//	."<br>".$tracklist."<br>".$image."<br>".$status;
$prod->insert($lable, $cate, $price, $artist, $producer, $year, $disktype, $description, $tracklist, $image, $status);
if ($continue == "OK") {
    echo "<meta http-equiv='refresh' content='0;url=../admincp.php?opt=addproduct'>";
    //header("location: ../admincp.php?opt=addproduct");
    //exit();
}
echo "<meta http-equiv='refresh' content='0;url=../admincp.php?opt=listproduct'>";
//header("location: ../admincp.php?opt=listproduct");
//exit();
开发者ID:meghv999,项目名称:cdshop-php,代码行数:31,代码来源:addProduct.php


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