Your IP : 216.73.216.79


Current Path : /var/www/html/kpwkm/backend/modules/moduleRepository/views/module-list/
Upload File :
Current File : /var/www/html/kpwkm/backend/modules/moduleRepository/views/module-list/index.php.20210407

<?php

use yii\helpers\Html;
use yii\grid\GridView;
use backend\modules\moduleRepository\models\ModuleVersion;

/* @var $this yii\web\View */
/* @var $searchModel backend\modules\moduleRepository\models\ModuleListSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Modules Repository');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="wrapper wrapper-content">
    <p><?= Html::a(Yii::t('app', 'Create Repository'), ['create'], ['class' => 'btn btn-primary']) ?></p>
    <div class="ibox animated fadeInRight">
        <div class="mail-box b-r-md">

            <?=
            GridView::widget([
                'dataProvider' => $dataProvider,
                'filterModel' => $searchModel,
                'tableOptions' => ['class' => 'table',],
                'summary' => '',
                'columns' => [
                    ['class' => 'yii\grid\SerialColumn'],
                    /* [
                      'attribute'=>'module_image',
                      'format'=>'raw',
                      'value' => function ($model) {
                      $img_url = Yii::getAlias('@web') . '/images/noimage.jpg';
                      if (!empty($model->module_image))
                      $img_url = Yii::getAlias('@web') . '/'.$model->module_image;
                      return '<img src="'.$img_url.'" style="height:100px;border:1px solid #ccc;border-radius:6px;">';
                      }
                      ], */
                    'module_name', [
                        'header' => 'Version',
                        'headerOptions' => ['style' => 'width:15%'],
                        'value' => function ($model) {
                            if (($modelversion = ModuleVersion::find()->where(['module_id' => $model->module_id])->orderBy(['version_id' => SORT_DESC])->one()) !== null) {
                                return $modelversion->module_version;
                            }
                        }
                    ],
                            [
                        'attribute' => 'module_developer',
                        'headerOptions' => ['style' => 'width:15%'],
                    ],
                    [
                        'attribute' => 'module_compatible',
                        'headerOptions' => ['style' => 'width:15%'],
                    ],
                    [
                        'attribute' => 'updated_at',
                        'headerOptions' => ['style' => 'width:15%'],
                        'value' => function ($model) {
                            return date("d-m-Y", strtotime($model->updated_at));
                        }
                    ],
                    [
                        'class' => 'yii\grid\ActionColumn',
                        'header' => 'Action',
                        'template' => '{update} {delete}',
                        'headerOptions' => ['style' => 'text-align:center;width:10%'],
                        'contentOptions' => ['style' => 'text-align:center;'],
                    ],
                ],
            ]);
            ?>
        </div>
    </div>
</div>