コード例 #1
0
ファイル: index.php プロジェクト: ricardo91/basic
                    <div class="panel-body">

                        






    
                        <?php 
Pjax::begin();
?>
                            <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'options' => ['class' => "col-md-120"], 'tableOptions' => ['class' => 'table table-striped table-hover table-bordered table-condensed'], 'summary' => "Mostrando <strong>{begin} - {end}</strong> de <strong>{totalCount}</strong> celulares.", 'rowOptions' => function ($model) {
    if (CellPhoneCosts::getOverPlan($model->plan, $model->real_cost_time)) {
        return ['class' => 'danger'];
    }
}, 'layout' => '
                                        <div class="pull-right">
                                            {summary}
                                        </div>
                                        {items}
                                        <div class="pull-right">
                                            {pager}
                                        </div>
                                        ', 'pager' => ['maxButtonCount' => 10, 'prevPageLabel' => 'Anterior', 'nextPageLabel' => 'Siguiente', 'prevPageCssClass' => 'prev hidden-xs', 'nextPageCssClass' => 'next hidden-xs'], 'columns' => [['attribute' => 'workstations_id', 'value' => 'workstations.full_name', 'headerOptions' => ['style' => 'text-align: center']], ['attribute' => 'cell_number', 'contentOptions' => ['width' => '80', 'style' => 'text-align: center'], 'headerOptions' => ['style' => 'text-align: center']], ['attribute' => 'profit_center_id', 'value' => 'profitCenter.name', 'filter' => Arrayhelper::map(ProfitCenter::find()->all(), 'number', 'name'), 'headerOptions' => ['style' => 'text-align: center']], ['attribute' => 'plan', 'value' => function ($data) {
    return CellPhoneCosts::getPlans($data->plan);
}, 'filter' => CellPhoneCosts::getPlans(), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['width' => '150']], ['attribute' => 'real_cost_time', 'value' => function ($data) {
    return round($data->real_cost_time) . ' minutos';
}, 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['width' => '80', 'style' => 'text-align: center']], ['attribute' => 'sms_cost', 'format' => 'currency', 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['width' => '115', 'style' => 'text-align: right']], ['attribute' => 'long_distance', 'format' => 'currency', 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['width' => '120', 'style' => 'text-align: right']], ['attribute' => 'month', 'value' => function ($data) {