本文整理匯總了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');