本文整理汇总了PHP中OperationData::getAllProductsBySellId方法的典型用法代码示例。如果您正苦于以下问题:PHP OperationData::getAllProductsBySellId方法的具体用法?PHP OperationData::getAllProductsBySellId怎么用?PHP OperationData::getAllProductsBySellId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OperationData
的用法示例。
在下文中一共展示了OperationData::getAllProductsBySellId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<div class="btn-group pull-right">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-download"></i> Descargar <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="report/onere-word.php?id=<?php
echo $_GET["id"];
?>
">Word 2007 (.docx)</a></li>
</ul>
</div>
<h1>Resumen de Reabastecimiento</h1>
<?php
if (isset($_GET["id"]) && $_GET["id"] != "") {
$sell = SellData::getById($_GET["id"]);
$operations = OperationData::getAllProductsBySellId($_GET["id"]);
$total = 0;
if (isset($_COOKIE["selled"])) {
foreach ($operations as $operation) {
// print_r($operation);
$qx = OperationData::getQYesF($operation->product_id);
// print "qx=$qx";
$p = $operation->getProduct();
if ($qx == 0) {
echo "<p class='alert alert-danger'>El producto <b style='text-transform:uppercase;'> {$p->name}</b> no tiene existencias en inventario.</p>";
} else {
if ($qx <= $p->inventary_min / 2) {
echo "<p class='alert alert-danger'>El producto <b style='text-transform:uppercase;'> {$p->name}</b> tiene muy pocas existencias en inventario.</p>";
} else {
if ($qx <= $p->inventary_min) {
echo "<p class='alert alert-warning'>El producto <b style='text-transform:uppercase;'> {$p->name}</b> tiene pocas existencias en inventario.</p>";
示例2: array
$section1 = $word->AddSection();
$section1->addText("HISTORIAL DE CAJA", array("size" => 22, "bold" => true, "align" => "right"));
$boxes = BoxData::getAll();
$products = SellData::getSellsUnBoxed();
$styleTable = array('borderSize' => 6, 'borderColor' => '888888', 'cellMargin' => 40);
$styleFirstRow = array('borderBottomColor' => '0000FF', 'bgColor' => 'AAAAAA');
$table1 = $section1->addTable("table1");
$table1->addRow();
$table1->addCell()->addText("Total");
$table1->addCell()->addText("Fecha");
$total_total = 0;
foreach ($boxes as $box) {
$sells = SellData::getByBoxId($box->id);
$total = 0;
foreach ($sells as $sell) {
$operations = OperationData::getAllProductsBySellId($sell->id);
foreach ($operations as $operation) {
$product = $operation->getProduct();
$total += $operation->q * $product->price_out;
}
}
$total_total += $total;
$table1->addRow();
$table1->addCell(5000)->addText("\$ " . number_format($total, 2, ".", ","));
$table1->addCell(2500)->addText($box->created_at);
}
$section1->addText("");
$section1->addText("Total: \$" . number_format($total_total, 2, ".", ","), array("size" => 22));
$word->addTableStyle('table1', $styleTable, $styleFirstRow);
/// datos bancarios
$filename = "boxhistory-" . time() . ".docx";