Пример #1
0
echo Html::submitButton(Yii::t('button', 'Search'), ['class' => 'btn btn-info', 'name' => MasterValueUtils::SM_MODE_NAME, 'value' => MasterValueUtils::SM_MODE_INPUT]);
?>
            </div></div>
        </div>
        <div class="row"><?php 
Pjax::begin();
echo GridView::widget(['options' => ['class' => 'grid-view col-xs-12 table-responsive'], 'tableOptions' => ['class' => 'table table-bordered'], 'showFooter' => true, 'headerRowOptions' => ['class' => 'warning'], 'footerRowOptions' => ['class' => 'warning', 'style' => 'font-weight:bold'], 'dataProvider' => new ActiveDataProvider(['query' => $dataQuery, 'pagination' => ['pagesize' => 30]]), 'columns' => [['label' => Yii::t('fin.grid', 'No.'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right', 'colspan' => 3], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model, $key, $index, $column) {
    $pagination = $column->grid->dataProvider->pagination;
    return $pagination->page * $pagination->pageSize + $index + 1;
}, 'footer' => Yii::t('fin.grid', 'Total')], ['class' => DataColumn::className(), 'label' => Yii::t('fin.grid', 'ID'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['colspan' => 0], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return str_pad($model->share_id, 6, '0', STR_PAD_LEFT);
}], ['class' => DataColumn::className(), 'label' => Yii::t('fin.grid', 'Share Date'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['colspan' => 0], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model) {
    return DateTimeUtils::htmlDateFormatFromDB($model->share_date, DateTimeUtils::FM_VIEW_DATE, true);
}], ['label' => Yii::t('fin.grid', 'Share Value'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return NumberUtils::format($model->share_value);
}, 'footer' => $htmlFooterShareValue], ['label' => Yii::t('fin.grid', 'Description'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: left; max-width:280px', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return $model->description;
}], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
    $btnClass = MasterValueUtils::getColorRow($index);
Пример #2
0
}, 'format' => 'raw', 'value' => function ($model) use($phpFmShortDate) {
    return DateTimeUtils::htmlDateFormatFromDB($model->entry_date, DateTimeUtils::FM_VIEW_DATE, true);
}, 'footer' => $htmlFooterCreditBalance], ['label' => Yii::t('fin.grid', 'Debit Account'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right', 'colspan' => 2], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: left', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) use($arrFinAccount) {
    return isset($arrFinAccount[$model->account_source]) ? $arrFinAccount[$model->account_source] : '';
}, 'footer' => $htmlFooterDebit], ['class' => DataColumn::className(), 'label' => Yii::t('fin.grid', 'Debit Amount'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['colspan' => 0], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    $amount = $model->account_source == 0 ? '' : NumberUtils::format($model->entry_value);
    return $amount;
}], ['label' => Yii::t('fin.grid', 'Credit Account'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right', 'colspan' => 2], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: left', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) use($arrFinAccount) {
    return isset($arrFinAccount[$model->account_target]) ? $arrFinAccount[$model->account_target] : '';
}, 'footer' => $htmlFooterCredit], ['class' => DataColumn::className(), 'label' => Yii::t('fin.grid', 'Credit Amount'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['colspan' => 0], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    $amount = $model->account_target == 0 ? '' : NumberUtils::format($model->entry_value);
    return $amount;
}], ['attribute' => 'description', 'label' => Yii::t('fin.grid', 'Description'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: left', 'class' => MasterValueUtils::getColorRow($index)];
}, 'enableSorting' => false, 'value' => function ($model) use($arrEntryLog) {
    $arrEntryLogVal = StringUtils::unserializeArr($model->description);
    return StringUtils::showArrValueAsString($arrEntryLogVal, $arrEntryLog);
}], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
    $btnClass = MasterValueUtils::getColorRow($index);
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
Пример #3
0
?>
            </div>
            <div class="col-md-12"><div class="form-group">
                <?php 
echo Html::submitButton(Yii::t('button', 'Search'), ['class' => 'btn btn-info', 'name' => MasterValueUtils::SM_MODE_NAME, 'value' => MasterValueUtils::SM_MODE_INPUT]);
?>
            </div></div>
        </div>
        <div class="row"><?php 
Pjax::begin();
echo GridView::widget(['options' => ['class' => 'grid-view col-xs-12 table-responsive'], 'tableOptions' => ['class' => 'table table-bordered'], 'showFooter' => true, 'headerRowOptions' => ['class' => 'warning'], 'footerRowOptions' => ['class' => 'warning', 'style' => 'font-weight:bold'], 'dataProvider' => new ActiveDataProvider(['query' => $dataQuery, 'pagination' => ['pagesize' => 20]]), 'columns' => [['label' => Yii::t('fin.grid', 'No.'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right', 'colspan' => 2], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model, $key, $index, $column) {
    $pagination = $column->grid->dataProvider->pagination;
    return $pagination->page * $pagination->pageSize + $index + 1;
}, 'footer' => Yii::t('fin.grid', 'Total')], ['class' => DataColumn::className(), 'label' => Yii::t('fin.grid', 'Transaction Date'), 'headerOptions' => ['style' => 'text-align: center; width: 120px;'], 'footerOptions' => ['colspan' => 0], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model) {
    return DateTimeUtils::htmlDateFormatFromDB($model->entry_date, DateTimeUtils::FM_VIEW_DATE, true);
}], ['label' => Yii::t('fin.grid', 'Customer'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: left', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) use($arrNetCustomer) {
    return isset($arrNetCustomer[$model->customer_id]) ? $arrNetCustomer[$model->customer_id] : '';
}, 'footer' => $htmlFooterCreditBalance], ['label' => Yii::t('fin.grid', 'Credit'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return $model->credit > 0 ? NumberUtils::format($model->credit) : '';
}, 'footer' => $htmlFooterCredit], ['label' => Yii::t('fin.grid', 'Debit'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
    return $model->debit > 0 ? NumberUtils::format($model->debit) : '';