<?php $columns = [['class' => 'kartik\\grid\\SerialColumn', 'order' => DynaGrid::ORDER_FIX_LEFT], 'name', ['attribute' => 'brand', 'headerOptions' => ['style' => 'text-align:center'], 'value' => function ($data) { if (isset($data->brand_role->brand_desc)) { return $data->brand_role->brand_desc; } else { return 'ไม่ทราบข้อมูล'; // } }, 'filter' => \yii\helpers\ArrayHelper::map(app\models\Combrand::find()->all(), 'id', 'brand_desc')], ['attribute' => 'location', 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'center', 'value' => function ($data) { if (isset($data->locate_role->section_desc)) { return $data->locate_role->section_desc; } else { return 'ไม่ทราบข้อมูล'; // } }, 'filter' => \yii\helpers\ArrayHelper::map(app\models\Section::find()->all(), 'id', 'section_desc')], ['attribute' => 'amount', 'format' => 'raw', 'width' => '120px', 'label' => 'จำนวนคงเหลือ', 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'center'], ['attribute' => 'addToSystem', 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'center', 'filterType' => GridView::FILTER_DATE, 'format' => 'raw', 'width' => '170px', 'filterWidgetOptions' => ['pluginOptions' => ['format' => 'yyyy-mm-dd']]], ['class' => 'kartik\\grid\\BooleanColumn', 'attribute' => 'status', 'vAlign' => 'middle'], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => false, 'order' => DynaGrid::ORDER_FIX_RIGHT]]; echo DynaGrid::widget(['columns' => $columns, 'storage' => DynaGrid::TYPE_COOKIE, 'theme' => 'panel-info', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'panel' => ['heading' => '<h3 class="panel-title">รายการพัสดุคอมพิวเตอร์</h3>', 'before' => '{dynagrid}']], 'options' => ['id' => 'dynagrid-1']]); ?> <?php /* = GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], //'id', 'eqmID', 'name', 'eqmType', 'status', 'addToSystem',
/* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = 'บันทึกข้อมูลการปฏิบัติงานคอมพิวเตอร์'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="comactivities-index"> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <p> <?php echo Html::a('บันทึกข้อมูลใหม่', ['create'], ['class' => 'btn btn-success']); ?> </p> <?php $columns = ['id', ['attribute' => 'section_id', 'width' => '220px', 'value' => function ($data) { if (isset($data->section_role->section_desc)) { return $data->section_role->section_desc; } else { return 'ไม่ทราบข้อมูล'; // } }, 'filter' => \yii\helpers\ArrayHelper::map(app\models\Section::find()->all(), 'id', 'section_desc')], ['attribute' => 'equipment_id', 'width' => '160px', 'filter' => \app\models\Comactivities::itemsAlias('equipment'), 'value' => function ($model) { return $model->EquipmentName; }], 'act_detail:ntext', ['attribute' => 'datetime', 'filterType' => GridView::FILTER_DATE, 'format' => 'raw', 'width' => '220px', 'format' => 'html', 'filterWidgetOptions' => ['pluginOptions' => ['format' => 'yyyy-mm-dd', 'language' => 'th']]], ['class' => 'kartik\\grid\\BooleanColumn', 'attribute' => 'result', 'vAlign' => 'middle'], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => false, 'order' => DynaGrid::ORDER_FIX_RIGHT], ['class' => 'kartik\\grid\\CheckboxColumn', 'order' => DynaGrid::ORDER_FIX_RIGHT]]; echo DynaGrid::widget(['columns' => $columns, 'storage' => DynaGrid::TYPE_SESSION, 'theme' => 'panel-info', 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">รายการปฏิบัติงานคอมพิวเตอร์</h3>', 'before' => '{dynagrid}', 'defaultPageSize' => 20]], 'options' => ['id' => 'dynagrid-1']]); ?> </div>
echo Comkarupan::find()->where(['status' => 6])->count(); ?> รายการ</span> </p> <?php $columns = [['attribute' => 'id', 'width' => '30px', 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'center'], ['attribute' => 'krp_code', 'width' => '160px', 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'center', 'pageSummary' => 'Page Total'], ['attribute' => 'name', 'headerOptions' => ['style' => 'text-align:center']], ['attribute' => 'ctype', 'filter' => \app\models\Comkarupan::itemsAlias('ctype'), 'value' => function ($model) { return $model->ctypeName; }, 'width' => '150px', 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'center'], ['attribute' => 'depart', 'value' => function ($data) { if (isset($data->depart_role->name)) { return $data->depart_role->name; } else { return 'ไม่ทราบข้อมูล'; // } }, 'hAlign' => 'center', 'width' => '200px', 'headerOptions' => ['style' => 'text-align:center'], 'filter' => \yii\helpers\ArrayHelper::map(app\models\Section::find()->all(), 'id', 'name')], ['attribute' => 'income', 'filter' => \app\models\Comkarupan::itemsAlias('income'), 'value' => function ($model) { return $model->incomeName; }, 'width' => '120px', 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'center'], ['attribute' => 'date', 'filterType' => GridView::FILTER_DATE, 'format' => 'raw', 'width' => '170px', 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'center'], ['attribute' => 'status', 'filter' => \app\models\Comkarupan::itemsAlias('status'), 'value' => function ($model) { return $model->statusName; }, 'width' => '150px', 'headerOptions' => ['style' => 'text-align:center'], 'hAlign' => 'center'], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => false, 'vAlign' => 'middle', 'template' => '{view} {update} {delete}', 'buttons' => ['view' => function ($url, $model, $key) { return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['view', 'id' => $model->id, 'cid' => $model->ctype], ['title' => 'ดูรายละเอียด', 'data-toggle' => 'tooltip']); }, 'update' => function ($url, $model, $key) { return Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['update', 'id' => $model->id, 'cid' => $model->ctype], ['title' => 'แก้ไขรายละเอียด', 'data-toggle' => 'tooltip']); }, 'delete' => function ($url, $model, $key) { return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['delete', 'id' => $model->id], ['title' => 'ลบรายการ', 'data-toggle' => 'tooltip', 'data-method' => 'post', 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?')]); }]]]; echo DynaGrid::widget(['columns' => $columns, 'storage' => DynaGrid::TYPE_SESSION, 'theme' => 'panel-info', 'enableMultiSort' => false, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'showPageSummary' => true, 'pjax' => true, 'hover' => true, 'panel' => ['heading' => '<h3 class="panel-title">รายการครุภัณฑ์</h3>', 'before' => '{dynagrid}', 'defaultPageSize' => 20]], 'options' => ['id' => 'dynagrid-1'], 'showSort' => true]); ?> </div>