Beispiel #1
0
$page->beginContent('table');
?>
        <?php 
$page->beginBulkForm();
?>
            <?php 
echo PartGridView::widget(['boxed' => false, 'dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-striped table-bordered table-condensed'], 'filterModel' => $model, 'locations' => $locations, 'summaryRenderer' => function ($grid) use($local_sums, $total_sums) {
    $locals = '';
    $totals = '';
    if (is_array($total_sums)) {
        foreach ($total_sums as $cur => $sum) {
            if ($cur && $sum > 0) {
                $totals .= ' &nbsp; <b>' . Yii::$app->formatter->asCurrency($sum, $cur) . '</b>';
            }
        }
    }
    if (is_array($local_sums)) {
        foreach ($local_sums as $cur => $sum) {
            if ($cur && $sum > 0) {
                $locals .= ' &nbsp; <b>' . Yii::$app->formatter->asCurrency($sum, $cur) . '</b>';
            }
        }
    }
    return $grid->parentSummary() . '<div class="summary">' . ($totals ? Yii::t('hipanel:stock', 'TOTAL') . ':' . $totals : null) . ($locals ? '<br><span class="text-muted">' . Yii::t('hipanel', 'on screen') . ':' . $locals . '</span>' : null) . '</div>';
}, 'representation' => $representation]);
?>
        <?php 
$page->endBulkForm();
?>
    <?php 
$page->endContent();