use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel common\models\UserSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('user', 'List users');
?>
<div class="user-index">
    <br>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'email', 'format' => 'raw', 'value' => function ($data) {
    return Html::a($data->email, Url::to(['update', 'id' => $data->id]));
}], ['class' => \dosamigos\grid\EditableColumn::className(), 'filter' => User::statuses(), 'attribute' => 'status', 'url' => ['ajaxUpdate'], 'type' => 'select', 'display' => "colors", 'editableOptions' => function ($model) {
    return ['source' => User::statuses(), 'value' => $model->status];
}], ['class' => \dosamigos\grid\EditableColumn::className(), 'filter' => User::roles(), 'attribute' => 'role', 'url' => ['ajaxUpdate'], 'value' => function ($data) {
    return User::getRole($data->role);
}, 'type' => 'select', 'display' => "function(value,sourceData,response){console.log(sourceData);}", 'editableOptions' => ['source' => Yii::$app->user->identity->getEditableRoles(), 'sourceCache' => false]], ['attribute' => 'created_at', 'filter' => false, 'format' => 'datetime'], ['attribute' => 'updated_at', 'filter' => false, 'format' => 'datetime'], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
<script>
    function colors(value, sourceData) {
        var selected = $.grep(sourceData, function (o) {
                return value == o.value;
            }),
            colors = <?php 
echo json_encode(User::$status_colors);
?>
;
        $(this).html(selected[0].text).css("color", colors[value]);
Example #2
0
    ?>
                <p style="color: red;">У товара нет цен.</p>
            <?php 
}
?>
            <?php 
echo $this->render('price/_form', ['model' => $priceModel, 'productModel' => $model]);
?>
        </div>

        <div class="tab-pane" id="product-stores">
            <?php 
if ($StockDataProvider->getCount()) {
    ?>
                <?php 
    echo GridView::widget(['dataProvider' => $StockDataProvider, 'filterModel' => $StockSearch, 'columns' => [['attribute' => 'id', 'filter' => false, 'options' => ['style' => 'width: 25px;']], ['attribute' => 'name', 'filter' => false, 'options' => ['style' => 'width: 100px;']], ['class' => EditableColumn::className(), 'attribute' => $model->id, 'label' => 'Количество', 'value' => function ($data) use($model) {
        return $data->getProductAmount($model->id);
    }, 'url' => ['stock/edit-field'], 'type' => 'text', 'editableOptions' => ['mode' => 'inline'], 'filter' => false, 'contentOptions' => ['style' => 'width: 27px;']], ['class' => 'yii\\grid\\ActionColumn', 'controller' => 'price', 'template' => '', 'buttonOptions' => ['class' => 'btn btn-default'], 'options' => ['style' => 'width: 30px;']]]]);
    ?>
            <?php 
}
?>
        </div>

        <div class="tab-pane" id="product-filters">
            <?php 
if ($filterPanel = \app\modules\filter\widgets\Choice::widget(['model' => $model])) {
    ?>
                <?php 
    echo $filterPanel;
    ?>
Example #3
0
    <?php 
if (in_array($model->type, ['select', 'checkbox', 'radio'])) {
    ?>

        <hr />

        <h2>Варианты</h2>

        <div class="variants">
            <div class="row">
                <div class="col-lg-6">
                    <?php 
    echo $this->render('_form_variant', ['model' => $variantModel]);
    ?>
                </div>
                <div class="col-lg-6">
                    <?php 
    echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => \dosamigos\grid\EditableColumn::className(), 'attribute' => 'value', 'filter' => false, 'url' => ['edit-variant'], 'editableOptions' => ['mode' => 'inline']], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}', 'buttons' => ['delete' => function ($url, $model) {
        return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['/field/field-variant/delete', 'id' => $model->id], ['title' => 'Удалить', 'data-method' => 'POST', 'data-pjax' => '1']);
    }], 'buttonOptions' => ['class' => 'btn btn-default'], 'options' => ['style' => 'width: 90px;']]]]);
    ?>
                </div>
            </div>
        </div>
    
    <?php 
}
?>
</div>
Example #4
0
?>

    <hr />

    <h2>Варианты</h2>

    <div class="variants">
        <div class="row">
            <div class="col-lg-6">
                <?php 
echo $this->render('_form_variant', ['model' => $variantModel]);
?>
            </div>
            <div class="col-lg-6">
                <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => \dosamigos\grid\EditableColumn::className(), 'attribute' => 'value', 'filter' => false, 'url' => ['edit-variant'], 'editableOptions' => ['mode' => 'inline']], ['attribute' => 'image', 'filter' => false, 'content' => function ($model) {
    $form = '<div class="modal-dialog"><div class="modal-content"><div class="modal-body">' . $this->render('_form_variant', ['model' => $model]) . '</div></div></div>';
    if ($model->hasImage()) {
        $anchor = Html::img($model->getImage()->getUrl('x50'), ['width' => '50']);
    } else {
        $anchor = 'Загрузить картинку';
    }
    $link = Html::a($anchor, "#variantForm{$model->id}", ['data-toggle' => 'modal', 'data-target' => "#variantForm{$model->id}"]);
    $window = Html::tag('div', $form, ['class' => 'modal fade', 'id' => "variantForm{$model->id}", 'role' => 'dialog']);
    return $link . $window;
}], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}', 'buttons' => ['delete' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['/filter/filter-variant/delete', 'id' => $model->id], ['title' => 'Удалить', 'data-method' => 'POST', 'data-pjax' => '1']);
}], 'buttonOptions' => ['class' => 'btn btn-default'], 'options' => ['style' => 'width: 90px;']]]]);
?>
            </div>
        </div>
Example #5
0
$this->params['breadcrumbs'][] = $this->title;
$columns = [['class' => 'yii\\grid\\SerialColumn'], ['class' => ToggleColumn::className(), 'attribute' => 'active', 'filter' => ['1' => 'Y', '0' => 'N', '' => 'All'], 'headerOptions' => ['style' => 'width:20px'], 'contentOptions' => ['class' => 'text-center']], ['attribute' => 'gender', 'class' => EditableColumn::className(), 'url' => 'editable', 'contentOptions' => ['class' => 'text-center', 'nowrap' => true], 'headerOptions' => ['class' => 'text-center', 'style' => 'width:20px'], 'type' => 'select', 'filter' => ['M' => 'M', 'F' => 'F', '' => 'All'], 'editableOptions' => ['showbuttons' => false, 'mode' => 'inline', 'source' => '[{"M": "M"}, {"F": "F"}]', 'value' => function ($model) {
    return $model->gender;
}]], ['attribute' => 'fname', 'contentOptions' => ['nowrap' => true], 'class' => EditableColumn::className(), 'url' => 'editable', 'editableOptions' => ['mode' => 'inline']], ['attribute' => 'lname', 'contentOptions' => ['nowrap' => true], 'class' => EditableColumn::className(), 'url' => 'editable', 'editableOptions' => ['mode' => 'inline']], ['value' => 'division.name', 'header' => 'Div', 'attribute' => 'division_id', 'headerOptions' => ['class' => 'text-center', 'style' => 'width:20px'], 'contentOptions' => ['class' => 'text-center'], 'filter' => Division::getMap() + ['' => 'All'], 'class' => EditableColumn::className(), 'url' => 'editable', 'type' => 'select', 'editableOptions' => ['showbuttons' => false, 'value' => function ($model) {
    return $model->division_id;
}, 'source' => Json::encode(Division::getMap()), 'mode' => 'inline']], ['value' => 'handAnchor.name', 'attribute' => 'handAnchorId', 'header' => 'Anchor', 'headerOptions' => ['class' => 'text-center'], 'contentOptions' => ['nowrap' => true], 'class' => EditableColumn::className(), 'url' => 'editable', 'type' => 'select', 'editableOptions' => ['showbuttons' => false, 'mode' => 'inline', 'value' => function ($model) {
    return $model->affiliation->hand_anchor_id;
}, 'source' => function ($model) {
    return Url::to(['/student/available-classes', 'id' => $model->id, 'type' => 'hand']);
}]], ['value' => 'dobAndAge', 'attribute' => 'dob', 'header' => 'DoB & Age', 'contentOptions' => ['nowrap' => true, 'style' => 'width:100px'], 'class' => EditableColumn::className(), 'url' => 'editable', 'type' => 'combodate', 'editableOptions' => ['value' => function ($model) {
    return $model->dob;
}, 'format' => 'YYYY-MM-DD', 'viewformat' => 'M/D', 'template' => 'M / D / YYYY']], ['attribute' => 'belt_size', 'headerOptions' => ['style' => 'width:20px'], 'contentOptions' => ['class' => 'text-center'], 'class' => EditableColumn::className(), 'filter' => Student::getGiSizeMap() + ['' => 'All'], 'url' => 'editable', 'type' => 'select', 'editableOptions' => ['mode' => 'inline', 'showbuttons' => false, 'value' => function ($model) {
    return $model->belt_size;
}, 'source' => Json::encode(Student::getGiSizeMap())]], ['attribute' => 'bestPhoneNumber', 'contentOptions' => ['nowrap' => true], 'class' => EditableColumn::className(), 'url' => 'editable', 'editableOptions' => ['mode' => 'inline']], ['attribute' => 'sparAuth', 'value' => 'sparAuthJson', 'contentOptions' => ['class' => 'text-center'], 'headerOptions' => ['style' => 'width:20px'], 'class' => EditableColumn::className(), 'url' => 'editable', 'type' => 'checklist', 'editableOptions' => ['value' => function ($model) {
    return $model->sparAuthJson;
}, 'display' => new JsExpression("function(value, sourceData)\n         {  \n            var icon = 'remove';\n            //console.log(value, sourceData);\n            if(value instanceof Array && value[0] !== '')\n            {\n               \$.each(value, function(i, v)\n               {\n                  if (v.toLowerCase() === 'a')\n                  {\n                     icon = 'ok';\n                     return false;\n                  }\n                  else\n                  {\n                     icon = 'tasks';\n                  }\n               });\n            }\n            \$(this).html('<span class=\"glyphicon glyphicon-' + icon + '\"></span>');\n        }"), 'mode' => 'pop', 'source' => Json::encode(Student::getSparAuthList())]], ['attribute' => 'rank.name', 'contentOptions' => ['nowrap' => true]], ['attribute' => 'grappleAuth', 'value' => 'grappleAuthJson', 'contentOptions' => ['class' => 'text-center'], 'headerOptions' => ['style' => 'width:20px'], 'class' => EditableColumn::className(), 'url' => 'editable', 'type' => 'checklist', 'editableOptions' => ['value' => function ($model) {
    return $model->grappleAuthJson;
}, 'display' => new JsExpression("function(value, sourceData)\n            {\n               var icon = 'remove';\n               //console.log(value, sourceData);\n               if(value instanceof Array && value[0] !== '')\n               {\n                  \$.each(value, function(i, v)\n                  {\n                     if (v.toLowerCase() === 'a')\n                     {\n                        icon = 'ok';\n                        return false;\n                     }\n                     else\n                     {\n                     console.log(v);\n                        icon = 'tasks';\n                     }\n                  });\n               }\n               \$(this).html('<span class=\"glyphicon glyphicon-' + icon + '\"></span>');\n            }"), 'mode' => 'pop', 'source' => Json::encode(Student::getGrappleAuthList())]], ['class' => 'yii\\grid\\ActionColumn', 'contentOptions' => ['nowrap' => true], 'template' => '{view} {update}' . (Yii::$app->user->can('deleteStudent') ? ' {delete}' : '')]];
?>
<div class="student-index">

   <h1><?php 
echo Html::encode($this->title);
?>
</h1>

   <?php 
//echo $this->render('_search', ['model' => $searchModel]);
?>

   <p>
Example #6
0
        <?php 
    $variantModel = new FieldValueVariant();
    $searchModel = new FieldValueVariantSearch();
    $params = Yii::$app->request->queryParams;
    if (empty($params['FieldValueVariantSearch'])) {
        $params = ['FieldValueVariantSearch' => ['field_id' => $model->id]];
    }
    $dataProvider = $searchModel->search($params);
    ?>
        <div class="pistol88-variants">
            <h3><?php 
    echo Yii::t('order', 'Variants');
    ?>
</h3>
            <?php 
    echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => \dosamigos\grid\EditableColumn::className(), 'attribute' => 'value', 'url' => ['/order/field-value-variant/editable'], 'filter' => false, 'editableOptions' => ['mode' => 'inline']], ['class' => 'yii\\grid\\ActionColumn', 'controller' => '/order/field-value-variant', 'template' => '{delete}', 'buttonOptions' => ['class' => 'btn btn-default'], 'options' => ['style' => 'width: 75px;']]]]);
    ?>
            
            <h3><?php 
    echo Yii::t('order', 'New variant');
    ?>
</h3>
            <?php 
    $form = ActiveForm::begin(['action' => ['/order/field-value-variant/create'], 'id' => 'forum_post', 'method' => 'post']);
    ?>
                <?php 
    echo $form->field($variantModel, 'field_id')->hiddenInput(['value' => $model->id])->label(false);
    ?>
            
                <?php 
    echo $form->field($variantModel, 'value')->textInput();
/* @var $searchModel app\models\UsersSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Translations');
?>
<div class="user-index">
    <div class="mrg-10">
    <span><?php 
echo Yii::t('messages', 'Translation language:');
?>
&nbsp;</span>
    <?php 
echo \lajax\languagepicker\widgets\LanguagePicker::widget(['skin' => \lajax\languagepicker\widgets\LanguagePicker::SKIN_DROPDOWN, 'size' => \lajax\languagepicker\widgets\LanguagePicker::SIZE_SMALL, 'link' => function ($language) {
    return Url::to(['', 'language' => $language]);
}, 'active' => $translationForm->language]);
?>
    </div>
    <?php 
echo $this->render('translation-form', ['model' => $translationForm]);
?>
    <?php 
echo GridView::widget(['dataProvider' => $data_provider, 'filterModel' => $search_model, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['class' => \dosamigos\grid\EditableColumn::className(), 'format' => 'raw', 'attribute' => 'category', 'url' => ['ajax-update', 'language' => $translationForm->language]], ['class' => \dosamigos\grid\EditableColumn::className(), 'attribute' => 'message', 'format' => 'raw', 'url' => ['ajax-update', 'language' => $translationForm->language]], ['class' => \dosamigos\grid\EditableColumn::className(), 'attribute' => 'messageTranslation', 'format' => 'raw', 'url' => ['ajax-update', 'language' => $translationForm->language]], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}', 'buttons' => ['delete' => function ($url, $model, $key) use($translationForm) {
    $url = Url::to(['translation/delete', 'id' => $model->id, 'language' => $translationForm->language]);
    return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, ['title' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0']);
}]]]]);
?>

</div>