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


PHP Items::find_by_id方法代码示例

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


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

示例1: createAddPart

 public function createAddPart()
 {
     if (isset($_POST['itemid']) && !empty($_POST['wid'])) {
         $worksheet = Worksheet::find_by_id($_POST['wid']);
         $myItem = Items::find_by_id($_POST['itemid']);
         $propart = new Prodpart();
         $propart->part_name = $myItem->item_name;
         $propart->qty = $_POST['qty'];
         $propart->works_id = $_POST['wid'];
         $propart->prod_id = $worksheet->prod_id;
         $propart->item_id = $_POST['itemid'];
         $propart->date_changed = date("Y:m:d H:i:s");
         $propart->desc = "";
         $propart->unit_cost = $_POST['price'];
         $propart->total_cost = (int) $_POST['price'] * (int) $_POST['qty'];
         if ($propart->create()) {
             return $propart;
         } else {
             return false;
         }
     }
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:22,代码来源:support_model.php

示例2: createAddPart

 public function createAddPart()
 {
     if (isset($_REQUEST['itemid']) && !empty($_REQUEST['wid'])) {
         $worksheet = Worksheet::find_by_id($_REQUEST['wid']);
         $myItem = Items::find_by_id($_REQUEST['itemid']);
         $propart = new Prodpart();
         $propart->part_name = $myItem->item_name;
         $propart->qty = $_REQUEST['qty'];
         $propart->works_id = $_REQUEST['wid'];
         $propart->prod_id = $worksheet->prod_id;
         $propart->item_id = $_REQUEST['itemid'];
         $propart->datecreated = date("Y:m:d H:i:s");
         $propart->des = "";
         $propart->unit_cost = $_REQUEST['price'];
         $propart->total_cost = (int) $_REQUEST['price'] * (int) $_REQUEST['qty'];
         $Tlog = new Transaction();
         $Tlog->com_id = $myItem->item_id;
         $Tlog->trans_type = "WORKSHEET PART SUPPLY";
         $Tlog->trans_description = "allocation of resources to worksheet";
         $Tlog->datecreated = date("Y-m-d H:i:s");
         $Tlog->user_id = $_SESSION['emp_ident'];
         if ($propart->create()) {
             $Tlog->create();
             return $propart;
         } else {
             return false;
         }
     }
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:29,代码来源:support_model.php

示例3: doAddToCart

 /**
  * cart model to maitain items array
  * in cart befor it is been posted to 
  * the purchases table
  */
 public function doAddToCart()
 {
     $basket = new Cart();
     $mcart = "";
     $basket->addItem($_POST['ppid'], $_POST['ppname'], $_POST['pcatname'], $_POST['pqty'], $_POST['pprice']);
     $myItems = $basket->getContents();
     // the basket get arrays of items in the cart
     $quantity = $_POST['pqty'];
     $subTotal = $basket->getTotal();
     // the basket gets the total of the items as subtotal
     $vat = 0.05 * $subTotal;
     // calculates the vat
     $total = $subTotal + $vat;
     $mcart .= "<table id='minicart-a' summary='Employee Pay Sheet'>\n    <thead>\n    \t<tr>\n            <th width='10%' scope='col'>ItemID</th>\n        \t<th width='35%' scope='col' >Description</th>\n            <th width='20%' scope='col'>Qty</th>\n            <th width='10%' scope='col'>Cost</th>\n            <th width='10%' scope='col'>Total</th>\n            \n        </tr>\n    </thead>\n    <tbody>";
     //print_r($item['itemName']);
     $qt = 0;
     foreach ($myItems as $item) {
         $myproduct = Items::find_by_id($item['itemId']);
         //print_r($myproduct);
         $mcart .= "<tr>\n              \n              <td>" . $item['itemName'] . "</td>\n              <td>" . $myproduct->item_description . "</td>\n              <td><span>\n                <input type='text' name='qty' id='qty" . $qt . "' value='" . $item['itemQuantity'] . "' style='width:40px; padding:2px; height:36px; text-align:center; '  />\n              </span>&nbsp;&nbsp;<span><a href='#' class='modifyqty' prodid='" . $item['itemId'] . "' prodqty='" . $item['itemQuantity'] . "'  tprice='" . $item['itemPrice'] . "' count ='" . $qt . "' ><img src='public/icons/Refresh16.png' width='18' height='18' /></a></span>&nbsp;&nbsp;<span><a href='#' class='deleteitem' prodid='" . $item['itemId'] . "'  ><img src='public/icons/Delete16.png' width='18' height='18' /></a></span></td>\n              <td>&#8358;" . number_format($item['itemPrice'], 2, '.', ',') . "</td>\n              <td>&#8358;" . number_format($item['itemTotal'], 2, '.', ',') . "</td>\n            </tr>";
         $qt++;
     }
     /**
      * foreach($myItems as $item){
      *     	$mcart .="<tr>
      *         	<td>".$item['itemQuantity']."</td>
      *             <td>".$item['itemName']."</td>
      *             <td>&#8358;".$item['itemName']."</td>
      *             <td>".number_format($item['itemPrice'],2,'.',',')."</td>
      *             <td><span class='bold'>&#8358;".number_format($item['itemTotal'],2,'.',',')."</span></td>
      *             <td><span class='bold'>x</span></td>
      *         </tr>
      *         
      *         ";
      * 	}
      */
     $mcart .= "<tr>\n        \t<td>&nbsp;</td>\n            <td>&nbsp;</td>\n            <td>&nbsp;</td>\n            <td>&nbsp;</td>\n            <td>&nbsp;</td>\n        </tr>       \n\t    <tr>\n          <td>&nbsp;</td>\n          <td colspan='3' align='right'><h3 class='black'>SubTotal:</h3></td>\n          <td colspan='3' align='right'><span class='bold'>&#8358;" . number_format($subTotal, 2, '.', ',') . "</span></td>\n        </tr>\n        <tr>\n          <td>&nbsp;</td>\n          <td colspan='3' align='right'><h3 class='black'>VAT(5%):</h3></td>\n          <td colspan='3' align='right'><span class='bold'>&#8358;" . number_format($vat, 2, '.', ',') . "</span></td>\n        </tr>\n        <tr>\n          <td>&nbsp;</td>\n          <td colspan='3' align='right'><h3><span class='black'>Total:</span></h3></td>\n          <td colspan='3' align='right'><div class='divider'></div><h3 class='bold'>&#8358;" . number_format($total, 2, '.', ',') . "</h3><div class='divider'></div><div class='divider'></div></td>\n        </tr>\n        <tr>\n        \t<td>&nbsp;</td>\n            <td colspan='3' align='right'><span style='margin:5px'><a href='#'>view cart</a></span></td>\n            <td colspan='3'><span style='margin:5px'><a href='#'>Check out</a></span></td>\n            </tr>\n    </tbody>\n</table>";
     print_r($mcart);
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:44,代码来源:stockin.php

示例4: delete

 public function delete($id)
 {
     $article = Items::find_by_id($id);
     if ($article->delete()) {
         return true;
     }
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:7,代码来源:stockitems_model.php


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