Example #1
0
}, 'label' => 'Наименование<br>производителя', 'encodeLabel' => false, 'format' => 'html'], ['attribute' => 'country', 'value' => function ($model, $key, $index, $column) {
    return Html::a($model->country, ['#'], ['class' => 'desc-link']);
}, 'label' => 'Страна<br>производства', 'encodeLabel' => false, 'format' => 'html'], ['attribute' => 'goden_do', 'value' => function ($model, $key, $index, $column) {
    return Html::a(Yii::$app->formatter->asDate($model->goden_do), ['#'], ['class' => 'desc-link']);
}, 'label' => 'Срок<br>годности', 'encodeLabel' => false, 'format' => 'html'], ['attribute' => 'otd', 'value' => function ($model, $key, $index, $column) {
    return Html::a($model->otd, ['#'], ['class' => 'desc-link']);
}, 'label' => 'Отдел<br>склада', 'encodeLabel' => false, 'format' => 'html'], ['attribute' => 'osnls', 'value' => function ($model, $key, $index, $column) {
    return Html::a($model->osnlsName, ['#'], ['class' => 'desc-link']);
}, 'label' => 'Признак<br>основного ЛС', 'encodeLabel' => false, 'format' => 'html'], ['attribute' => 'vidpost', 'value' => function ($model, $key, $index, $column) {
    return Html::a($model->vidpost, ['#'], ['class' => 'desc-link']);
}, 'label' => 'Вид<br>поступления', 'encodeLabel' => false, 'format' => 'html', 'filter' => ['Обычная поставка' => 'Обычная поставка', 'Централизованный тендер' => 'Централизованный тендер']], ['attribute' => 'kol', 'value' => function ($model, $key, $index, $column) {
    return Html::a($model->kol . ' шт.', ['#'], ['class' => 'desc-link']);
}, 'label' => 'Количество<br>на складе', 'encodeLabel' => false, 'format' => 'html'], ['attribute' => 'cenopt', 'value' => function ($model, $key, $index, $column) {
    return Html::a(number_format($model->cenopt, 0, ',', ' ') . ' руб.', ['#'], ['class' => 'desc-link']);
}, 'label' => 'Цена<br>оптовая', 'encodeLabel' => false, 'format' => 'html']];
$actionColumn = [['class' => ActionProductsColumn::className(), 'contentOptions' => ['class' => 'action-products-column'], "header" => 'Действие']];
?>

<div class="products-index">
    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
echo $this->render('_search', ['model' => $searchModel, 'countries' => $countries]);
?>
    <?php 
if (Yii::$app->user->identity->role == 2) {
    ?>

        <?php 
Example #2
0
        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>';
    }
}, 'format' => 'html'], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}']]]);
?>
    <?php 
if (isset($order)) {
    ?>
    <p>
        <?php 
    $form = ActiveForm::begin();