本文整理汇总了PHP中Branch::prepareId方法的典型用法代码示例。如果您正苦于以下问题:PHP Branch::prepareId方法的具体用法?PHP Branch::prepareId怎么用?PHP Branch::prepareId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Branch
的用法示例。
在下文中一共展示了Branch::prepareId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printf
<div id="main" class="span-24 last">
<h2>Administration</h2><h3>Stock</h3>
<br />
<form action = "admin-stock.php" method = "get">
<label for="inv_item">Choose Inventory Item: </label>
<span id="inv_item">
<input id="autocompleteItem" name="item"></input>
</span>
<input id="submitBTN" type="submit" value="Submit" />
</form>
<?php
if (isset($_GET['item'])) {
try {
$inv_stocks = Inv_stock::findByItem($_GET['item']);
$item = new Inv_item($_GET['item']);
printf("<br /><h3>%s - %s</h3><table><thead><tr><th>Branch</th><th>Quantity</th><th width=\"100\">Update</th></tr></thead><tbody>", $item->prepareId(), $item->prepareDescription());
foreach ($inv_stocks as $inv_stock) {
$branch = new Branch($inv_stock->getBranchId());
printf("<tr><td>%s</td><td><input type=\"text\" value=\"%s\" /> %s</td><td><input class=\"updateBTN\" id=\"%s\" type=\"button\" value=\"Update\"/></td></tr>", $branch->prepareName() . " [" . $branch->prepareId() . "]", $inv_stock->getQuantity(), $item->prepareUnitOfMeasure(), $inv_stock->getId());
}
echo "</tbody></table>";
} catch (fExpectedException $e) {
echo $e->printMessage();
}
}
?>
</div>
</div>
<div id="messageBox" style="display: none;">Loading</div>
<?php
$tmpl->place('footer');
示例2: printf
}
printf("<table><thead><tr><th>Item ID</th><th>Description</th><th>Quantity</th></tr></thead><tbody>");
foreach ($inv_stocks as $inv_stock) {
$inv_item = new Inv_item($inv_stock->getItemId());
printf("<tr><td>%s</td><td>%s</td><td>%s</td></tr>", $inv_item->prepareId(), $inv_item->prepareDescription(), $inv_stock->prepareQuantity() . " " . $inv_item->prepareUnitOfMeasure());
}
echo "</tbody></table>";
} catch (fExpectedException $e) {
echo $e->printMessage() . $inv_stock->getItemId();
}
} else {
if (isset($_GET['item'])) {
try {
$inv_stocks = Inv_stock::findByItem($_GET['item']);
$item = new Inv_item($_GET['item']);
printf("<br /><h3>%s - %s</h3><table><thead><tr><th>Branch</th><th>Quantity</th></tr></thead><tbody>", $item->prepareId(), $item->prepareDescription());
foreach ($inv_stocks as $inv_stock) {
$branch = new Branch($inv_stock->getBranchId());
printf("<tr><td>%s</td><td>%s</td></tr>", $branch->prepareName() . " [" . $branch->prepareId() . "]", $inv_stock->prepareQuantity() . " " . $item->prepareUnitOfMeasure());
}
echo "</tbody></table>";
} catch (fExpectedException $e) {
echo $e->printMessage();
}
}
}
?>
</div>
</div>
<?php
$tmpl->place('footer');