Пример #1
0
        <?php 
echo Html::a('บันทึกข้อมูลใหม่', ['create'], ['class' => 'btn btn-success']);
?>
        <?php 
echo Html::a('สรุปสต็อค', ['index'], ['class' => 'btn btn-warning']);
?>
    </p>
    <?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'],
Пример #2
0
?>

    <p>
        <?php 
echo Html::a('บันทึกข้อมูลใหม่', ['create'], ['class' => 'btn btn-success']);
?>
    </p>
    <?php 
$columns = [['class' => 'kartik\\grid\\SerialColumn', 'order' => DynaGrid::ORDER_FIX_LEFT], 'eqmID', ['attribute' => 'brand', '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')], 'name', ['attribute' => 'location', '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' => 'addToSystem', '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], ['class' => 'kartik\\grid\\CheckboxColumn', '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>']], 'options' => ['id' => 'dynagrid-1']]);
?>

</div>
<?php 
/*
use yii\helpers\Html;
use yii\grid\GridView;