Exemplo n.º 1
0
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'kodpart', 'value' => function ($model, $key, $index, $column) {
    return Html::a($model->kodpart, ['#'], ['class' => 'green-link desc-link']);
}, 'format' => 'html'], ['attribute' => 'imn', 'value' => function ($model, $key, $index, $column) {
    return Html::a($model->imn, ['#'], ['class' => 'desc-link']);
}, 'format' => 'html'], ['label' => 'Форма выпуска', 'value' => function ($model, $key, $index, $column) {
    $product = app\modules\main\models\Products::findOne(['kodpart' => $model->kodpart]);
    if (isset($product)) {
        return $product->nshort3;
    } else {
        return '<span class="label label-danger">сведения не найдены</span>';
    }
}, 'format' => 'html'], ['attribute' => 'otd', 'value' => function ($model, $key, $index, $column) {
    return Html::a($model->otd, ['#'], ['class' => 'desc-link']);
}, 'format' => 'html'], ['label' => 'Ставка НДС', 'value' => function ($model, $key, $index, $column) {
    $product = app\modules\main\models\Products::findOne(['kodpart' => $model->kodpart]);
    if (isset($product)) {
        return $product->nds;
    } else {
        return 0;
    }
}, 'format' => 'text'], ['label' => 'Сумма с НДС', 'value' => function ($model, $key, $index, $column) {
    return number_format($model->wholesaleTotalPrice, 2, ' руб ', ' ') . 'коп';
}, 'format' => 'text'], ['class' => ActionProductsColumn::className(), 'buttonClass' => 'add-the-product'], ['attribute' => 'dsv', 'value' => function ($model, $key, $index, $column) {
    return Html::a($model->dsv, ['#'], ['class' => 'desc-link']);
}, 'format' => 'html'], ['class' => DataColumn::className(), 'label' => 'На складе', 'value' => function ($model, $key, $index, $column) {
    if ($model->isProduct) {
        return '<span class="label label-success"">В наличии</span>';
    } else {
        return '<span class="label label-danger">Нет</span>';
    }
Exemplo n.º 2
0
?>
</h1>
    
    <p>
        Ваш заказ на сумму: <b><?php 
echo number_format($totalPrice, 0, ',', ' ');
?>
 руб.</b><br>
        Тип договора: <b><?php 
echo $order->buggodName;
?>
</b>
    </p>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['kpr', 'imn', ['label' => 'Форма выпуска', 'value' => function ($model, $key, $index, $column) {
    $product = app\modules\main\models\Products::findOne(['kpr' => $model->kpr]);
    if (isset($product)) {
        return $product->nshort3;
    } else {
        return '<span class="label label-danger">сведения не найдены</span>';
    }
}, 'format' => 'html'], 'otd', ['label' => 'Сумма (руб.)', 'value' => function ($model, $key, $index, $column) {
    return number_format($model->wholesaleTotalPrice, 0, ',', ' ');
}, 'format' => 'text'], 'kolz', 'dsv', ['class' => DataColumn::className(), 'label' => 'На складе', 'value' => function ($model, $key, $index, $column) {
    if ($model->isProduct) {
        return '<span class="label label-success"">В наличии</span>';
    } else {
        return '<span class="label label-danger">Нет</span>';
    }
}, 'format' => 'html']]]);
?>