예제 #1
0
    'options' => [
      'class' => 'alert-info',
    ],
]); ?>
    Вы можете автоматически наполнить базу адресов на вашем сайте, при помоще сервиса http://kladr-api.ru/.
    Для начала обновления посетите раздел настроек.
<? \yii\bootstrap\Alert::end(); ?>


<?php 
echo \skeeks\cms\modules\admin\widgets\GridView::widget(["pjaxOptions" => ["id" => "sx-stat"], "dataProvider" => new \yii\data\ArrayDataProvider(['allModels' => [['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_COUNTRY, 'name' => 'Страна', 'count' => \skeeks\cms\kladr\models\KladrLocation::find()->where(['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_COUNTRY])->count()], ['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_REGION, 'name' => 'Регион', 'count' => \skeeks\cms\kladr\models\KladrLocation::find()->where(['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_REGION])->count()], ['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_DISTRICT, 'name' => 'Район', 'count' => \skeeks\cms\kladr\models\KladrLocation::find()->where(['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_DISTRICT])->count()], ['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_CITY, 'name' => 'Город', 'count' => \skeeks\cms\kladr\models\KladrLocation::find()->where(['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_CITY])->count()], ['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_VILLAGE, 'name' => 'Поселок', 'count' => \skeeks\cms\kladr\models\KladrLocation::find()->where(['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_VILLAGE])->count()], ['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_VILLAGE_SMALL, 'name' => 'Деревня', 'count' => \skeeks\cms\kladr\models\KladrLocation::find()->where(['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_VILLAGE_SMALL])->count()], ['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_STREET, 'name' => 'Улица', 'count' => \skeeks\cms\kladr\models\KladrLocation::find()->where(['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_STREET])->count()], ['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_BUILDING, 'name' => 'Строение', 'count' => \skeeks\cms\kladr\models\KladrLocation::find()->where(['type' => \skeeks\cms\kladr\models\KladrLocation::TYPE_BUILDING])->count()]]]), 'columns' => [['attribute' => 'name', 'label' => 'Тип местоположения'], ['attribute' => 'count', 'label' => 'Количество'], ['format' => 'raw', 'label' => '', 'attribute' => 'count', 'class' => \yii\grid\DataColumn::className(), 'value' => function ($data) {
    $name = \yii\helpers\ArrayHelper::getValue($data, 'name');
    $type = \yii\helpers\ArrayHelper::getValue($data, 'type');
    if ($type == \skeeks\cms\kladr\models\KladrLocation::TYPE_COUNTRY) {
        return "";
    }
    return \yii\helpers\Html::a('Запустить импорт', '#', ['class' => 'btn-primary btn btn-xs', 'onclick' => new \yii\web\JsExpression(<<<JS
                    sx.KladrImport.execute('{$type}', '{$name}');
JS
)]);
}]]]);
?>


<div class="sx-progress-global" id="sx-progress-global" style="display: none;">
    <span style="vertical-align:middle;"><h3>Общий процесс (Выполнено <span class="sx-executing-ptc">0</span>%)</h3></span>
    <span style="vertical-align:middle;"><span class="sx-executing-task-name"></span></span>
    <div>
        <div class="progress progress-striped active">
            <div class="progress-bar progress-bar-success"></div>
        </div>
예제 #2
0
파일: index.php 프로젝트: Liv1020/cms
JS
)]);
?>

        <p><?php 
echo \Yii::t('app', "To create backups of the database used by the utility {mysqldump}, and this tool will only work if the utility is installed on your server.", ['mysqldump' => 'mysqldump']);
?>
</p>
        <hr />
        <?php 
if ($dbBackupDir->isExist()) {
    ?>
            <?php 
    echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['allModels' => $dbBackupDir->findFiles()]), 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\sx\File $model) {
        return $model->getBaseName();
    }], ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\sx\File $model) {
        return $model->size()->formatedSize();
    }]]]);
    ?>

            <?php 
    echo \mihaildev\elfinder\ElFinder::widget(['language' => \Yii::$app->admin->languageCode, 'controller' => 'cms/elfinder-full', 'callbackFunction' => new \yii\web\JsExpression('function(file, id){}'), 'frameOptions' => ['style' => 'width: 100%; height: 800px;']]);
    ?>
        <?php 
} else {
    ?>
            <p><?php 
    echo \Yii::t('app', 'Directory with files of backups database is not found.');
    ?>
</p>
        <?php 
예제 #3
0
?>
        </div>
        <div class="col-md-3">
            <?php 
echo $form->field($search, 'to')->widget(\kartik\datecontrol\DateControl::classname(), ['type' => \kartik\datecontrol\DateControl::FORMAT_DATETIME]);
?>
        </div>

        <div class="col-md-3">
            <div class="form-group field-adminreportproductsearch-to">
                <label class="control-label" for="adminreportproductsearch-to" style="width: 100%;">&nbsp;</label>
                <button class="btn btn-default" type="submit"><?php 
echo \Yii::t('skeeks/shop/app', 'Apply');
?>
</button>
            </div>
        </div>
    </div>





<? \yii\bootstrap\ActiveForm::end(); ?>

<?php 
echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $search, 'columns' => $search->getColumns()]);
?>

</div>
<? \skeeks\cms\modules\admin\widgets\Pjax::end(); ?>
예제 #4
0
<?php 
if ($message) {
    ?>
    <?php 
    \yii\bootstrap\Alert::begin(['options' => ['class' => 'alert-info']]);
    ?>
        <?php 
    echo $message;
    ?>
    <?php 
    \yii\bootstrap\Alert::end();
    ?>

<?php 
}
if ($models) {
    ?>
    <?php 
    echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['allModels' => $models, 'pagination' => ['defaultPageSize' => 200]]), 'columns' => [['class' => \yii\grid\DataColumn::className(), 'value' => function (CmsExtension $model) use($self) {
        return $self->render('_image-column', ['model' => $model]);
    }, 'format' => 'raw'], ['class' => \yii\grid\DataColumn::className(), 'value' => function (CmsExtension $model) use($self) {
        return $model->version;
    }, 'format' => 'raw', 'attribute' => 'version'], ['class' => \yii\grid\DataColumn::className(), 'value' => function (CmsExtension $model) use($self) {
        if ($model->canDelete()) {
            return \yii\helpers\Html::a('<i class="glyphicon glyphicon-remove"></i> ' . \Yii::t('app', 'Delete'), $model->controllUrl, ['class' => 'btn btn-danger btn-xs', 'data-pjax' => '0']);
        } else {
            return " — ";
        }
    }, 'format' => 'raw', 'label' => \Yii::t('app', 'Possible actions')]]]);
}
예제 #5
0
파일: install.php 프로젝트: Liv1020/cms
    echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['allModels' => [$packageModel], 'pagination' => ['defaultPageSize' => 1]]), 'layout' => "{items}", 'columns' => [['class' => \yii\grid\DataColumn::className(), 'value' => function (PackageModel $model) use($self) {
        return $self->render('_package-column', ['model' => $model]);
    }, 'format' => 'raw'], ['class' => \yii\grid\DataColumn::className(), 'value' => function (PackageModel $model) {
        if ($model->isInstalled()) {
            return $model->createCmsExtension()->version;
        } else {
            return ' — ';
        }
    }, 'label' => \Yii::t('app', 'Version'), 'format' => 'raw'], ['class' => \yii\grid\DataColumn::className(), 'value' => function (PackageModel $model) use($attrDisabled) {
        if ($model->isInstalled()) {
            $extension = $model->createCmsExtension();
            $code = $model->packagistCode;
            if ($extension->canDelete()) {
                if (!$attrDisabled) {
                    $class = ' btn-danger';
                }
                $sd = \Yii::t('app', 'Start deleting');
                return <<<HTML
                                <a data-pjax="0"  class="btn btn-default {$class}" target="" title="" onclick="sx.Installer.remove('{$code}'); return false;" {$attrDisabled}>
                                    <i class="glyphicon glyphicon-remove"></i> {$sd}
                                </a>
HTML;
            }
        } else {
            if (!$attrDisabled) {
                $class = ' btn-success';
            }
            $code = $model->packagistCode;
            $si = \Yii::t('app', 'Start installing');
            $tit = \Yii::t('app', 'This will start the installation process, the latest stable version.');
            return <<<HTML
                                <a data-pjax="0"  class="btn btn-default btn-success" target="" title="{$tit}" onclick="sx.Installer.install('{$code}:*'); return false;" {$attrDisabled}>
                                    <i class="glyphicon glyphicon-download-alt"></i> {$si}
                                </a>
HTML;
        }
    }, 'label' => \Yii::t('app', 'Actions'), 'format' => 'raw']]]);
예제 #6
0
파일: _form.php 프로젝트: BMOTech/cms-shop
            </div>
        </div>


<?php 
echo $form->fieldSetEnd();
?>



<?php 
echo $form->fieldSet(\skeeks\cms\shop\Module::t('app', 'History of changes'));
?>

        <?php 
echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['models' => $model->shopOrderChanges]), 'columns' => [['class' => \skeeks\cms\grid\UpdatedAtColumn::className()], ['class' => \yii\grid\DataColumn::className(), 'label' => \skeeks\cms\shop\Module::t('app', 'User'), 'format' => 'raw', 'value' => function (\skeeks\cms\shop\models\ShopOrderChange $shopOrderChange) {
    return (new \skeeks\cms\shop\widgets\AdminBuyerUserWidget(['user' => $shopOrderChange->createdBy]))->run();
}], ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'type', 'label' => \skeeks\cms\shop\Module::t('app', 'Transaction'), 'format' => 'raw', 'value' => function (\skeeks\cms\shop\models\ShopOrderChange $shopOrderChange) {
    return \skeeks\cms\shop\models\ShopOrderChange::types()[$shopOrderChange->type];
}], ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'type', 'label' => \skeeks\cms\shop\Module::t('app', 'Description'), 'format' => 'raw', 'value' => function (\skeeks\cms\shop\models\ShopOrderChange $shopOrderChange) {
    return $shopOrderChange->description;
}]]]);
?>

<?php 
echo $form->fieldSetEnd();
?>

<?php 
echo $form->buttonsCreateOrUpdate($model);
ActiveForm::end();
예제 #7
0
파일: index.php 프로젝트: Liv1020/cms
$form = ActiveForm::begin();
?>

<?php 
echo $form->fieldSet(\Yii::t('app', 'Project configuration'));
?>
    <?php 
echo $this->render('table', ['values' => [\Yii::$app->cms->moduleCms()->getName() => \Yii::$app->cms->moduleCms()->descriptor->version, \Yii::t('app', '{yii} Version', ['yii' => 'Yii']) => $application['yii'], \Yii::t('app', 'Project name') => $application['name'] . " (<a href='" . \skeeks\cms\helpers\UrlHelper::construct('cms/admin-settings')->enableAdmin()->toString() . "'>" . \Yii::t('app', 'edit') . "</a>)", \Yii::t('app', 'Environment ({yii_env})', ['yii_env' => 'YII_ENV']) => $application['env'], \Yii::t('app', 'Development mode ({yii_debug})', ['yii_debug' => 'YII_DEBUG']) => $application['debug'] ? \Yii::t('app', 'Yes') : \Yii::t('app', 'No'), \Yii::t('app', 'Mode autogeneration paths to modules {cms} ({e_m_c})', ['e_m_c' => 'ENABLE_MODULES_CONF', 'cms' => 'CMS']) => ENABLE_MODULES_CONF ? \Yii::t('app', 'Yes') : \Yii::t('app', 'No'), \Yii::t('app', 'Automatically generated file paths modules {cms} ({agmf})', ['cms' => 'cms', 'agmf' => 'AUTO_GENERATED_MODULES_FILE']) => $autoModulesFile, \Yii::t('app', 'A folder with file paths to the modules') => (is_readable(dirname(AUTO_GENERATED_MODULES_FILE)) ? \Yii::t('app', 'Yes') : \Yii::t('app', "Is not writable")) . " <a class='btn btn-xs btn-default' title='" . dirname(AUTO_GENERATED_MODULES_FILE) . "'>i</a>", \Yii::t('app', "Checks environment variables") . ' (GETENV_POSSIBLE_NAMES)' => GETENV_POSSIBLE_NAMES, \Yii::t('app', "Checks environment variables") . ' (APP_ENV_GLOBAL_FILE)' => $autoEnvFile . " <a class='btn btn-xs btn-default' title='" . APP_ENV_GLOBAL_FILE . "'>i</a>"]]);
echo $form->fieldSetEnd();
?>

<?php 
echo $form->fieldSet(\Yii::t('app', 'Installed {cms} modules', ['cms' => 'CMS']));
?>
    <?php 
echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['allModels' => \Yii::$app->cms->getModules()]), 'layout' => "{items}", 'columns' => [['attribute' => 'name', 'label' => \Yii::t('app', 'Module name')], ['attribute' => 'version', 'label' => \Yii::t('app', 'Module version')]]]);
echo $form->fieldSetEnd();
?>


<?php 
echo $form->fieldSet(\Yii::t('app', 'All extensions and modules {yii}', ['yii' => 'Yii']));
?>
    <?php 
if (!empty($extensions)) {
    echo $this->render('table', ['values' => $extensions]);
}
echo $form->fieldSetEnd();
?>

예제 #8
0
파일: index.php 프로젝트: v3toys/skeeks
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 16.07.2016
 */
/* @var $this yii\web\View */
$response = \Yii::$app->v3toysApi->getStatus();
?>
<p>3.1.5 Метод getStatus - возвращает все возможные статусы заказов в V3Project</p>

<?php 
if ($response->isError) {
    ?>
    <?php 
    echo $response->error_code;
    ?>
    <?php 
    echo $response->error_message;
} else {
    ?>
    <?php 
    echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['models' => (array) $response->data]), 'columns' => ['id', 'title']]);
}
예제 #9
0
    <?php 
$onclick = new \yii\web\JsExpression(<<<JS
        new sx.classes.RelationModelsGrid({
            'createUrl': '{$createUrl}',
            'pjaxId': '{$pjaxId}',
        }); return false;
JS
);
?>

    <?php 
$add = \Yii::t('app', 'Add');
?>
    <?php 
echo \skeeks\cms\modules\admin\widgets\GridView::widget(\yii\helpers\ArrayHelper::merge($gridOptions, ['beforeTableLeft' => <<<HTML
        <a class="btn btn-default btn-sm" onclick="{$onclick}"><i class="glyphicon glyphicon-plus"></i>{$add}</a>
HTML
]));
?>

    <?php 
$this->registerJs(<<<JS
        (function(sx, \$, _)
        {
            sx.classes.RelationModelsGrid = sx.classes.Component.extend({

                _init: function()
                {
                    var self = this;
                    var window = new sx.classes.Window(this.get('createUrl'));
                    window.bind("close", function()
                    {
예제 #10
0
    public function registerAsset()
    {
        parent::registerAsset();
        $this->view->registerJs(<<<JS
        (function(sx, \$, _)
        {
            sx.classes.GridEditSettings = sx.classes.Component.extend({

                _init: function()
                {
                    var self = this;

                    this.Window = new sx.classes.Window(this.get('url'));

                    this.Window.bind('close', function(e, data)
                    {
                        self.reload();
                    });

                    this.Window.open();
                },

                reload: function()
                {
                    if (this.get('enabledPjax'))
                    {
                        var id = null;
                        var pjax = this.get('pjax');
                        if (pjax.options)
                        {
                            id = pjax.options.id;
                        }

                        if (id)
                        {
                            \$.pjax.reload('#' + id, {});
                            return this;
                        }

                    }

                    window.location.reload();
                    return this;
                },

                _onDomReady: function()
                {},

                _onWindowReady: function()
                {}
            });
        })(sx, sx.\$, sx._);
JS
);
    }
예제 #11
0
파일: index.php 프로젝트: BMOTech/cms-shop
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (—кик—)
 * @date 01.11.2015
 */
/* @var $this yii\web\View */
echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ActiveDataProvider(['query' => \skeeks\cms\shop\models\ShopOrder::find()]), 'columns' => ['id']]);
?>

예제 #12
0
파일: index.php 프로젝트: Liv1020/cms
<?php

/**
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010 SkeekS (СкикС)
 * @date 01.09.2015
 */
?>

<?php 
echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ActiveDataProvider(['query' => (new \yii\db\Query())->select(['id', 'phrase', 'count(*) as count'])->from(\skeeks\cms\models\CmsSearchPhrase::tableName())->groupBy(['phrase'])->orderBy(['count' => SORT_DESC])]), 'columns' => [['attribute' => 'phrase', 'label' => \Yii::t('app', 'Search Phrase')], ['attribute' => 'count', 'label' => \Yii::t('app', 'The number of requests')]]]);
?>
<!--

-->
예제 #13
0
파일: _form.php 프로젝트: BMOTech/cms-shop
    <?php 
echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ActiveDataProvider(['query' => \skeeks\cms\shop\models\ShopBasket::find()->where(['fuser_id' => $fuser->id])]), 'columns' => [['class' => \skeeks\cms\grid\DateTimeColumnData::className(), 'attribute' => 'created_at'], ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'name'], ['class' => \yii\grid\DataColumn::className(), 'label' => \skeeks\cms\shop\Module::t('app', 'Price'), 'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
    return \Yii::$app->money->intlFormatter()->format($shopBasket->money);
}], ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'quantity'], ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'site_id']]]);
?>

<?php 
echo $form->fieldSetEnd();
?>


<?php 
echo $form->fieldSet(\skeeks\cms\shop\Module::t('app', 'Viewed products') . " (" . \skeeks\cms\shop\models\ShopViewedProduct::find()->where(['shop_fuser_id' => $fuser->id])->count() . ")");
?>

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ActiveDataProvider(['query' => \skeeks\cms\shop\models\ShopViewedProduct::find()->where(['shop_fuser_id' => $fuser->id])]), 'columns' => [['class' => \skeeks\cms\grid\CreatedAtColumn::className(), 'label' => \skeeks\cms\shop\Module::t('app', 'Date views')], ['class' => \yii\grid\DataColumn::className(), 'label' => \skeeks\cms\shop\Module::t('app', 'Good'), 'value' => function (\skeeks\cms\shop\models\ShopViewedProduct $shopViewedProduct) {
    if ($shopViewedProduct->shopProduct) {
        return $shopViewedProduct->shopProduct->cmsContentElement->name;
    }
    return null;
}]]]);
?>

<?php 
echo $form->fieldSetEnd();
?>

<?php 
echo $form->buttonsCreateOrUpdate($model);
ActiveForm::end();
예제 #14
0
파일: index.php 프로젝트: Liv1020/cms
?>

<div class="sx-box sx-p-10 sx-bg-primary">
    <?php 
echo \yii\helpers\Html::a(\Yii::t('app', 'Delete temporary files'), $url, ['class' => 'btn btn-primary', 'onclick' => 'new sx.classes.Clear(' . $data . '); return false;']);
?>
    <hr />

    <?php 
echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['allModels' => $clearDirs]), 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'label', ['class' => \yii\grid\DataColumn::className(), 'value' => function ($data) {
    /**
     * @var $dir \skeeks\sx\Dir
     */
    $dir = $data['dir'];
    return $dir->getPath();
}], ['class' => \yii\grid\DataColumn::className(), 'value' => function ($data) {
    /**
     * @var $dir \skeeks\sx\Dir
     */
    $dir = $data['dir'];
    return $dir->getSize()->formatedShortSize();
}]]]);
?>
</div>
<?php 
$this->registerJs(<<<JS
    (function(sx, \$, _)
    {
        sx.classes.Clear = sx.classes.Component.extend({

            _init: function()
예제 #15
0
파일: index.php 프로젝트: Liv1020/cms
            <?php 
        $allCkecks = \yii\helpers\ArrayHelper::merge($allCkecks, $checks);
        ?>
            <hr />
            <h3>Модуль <?php 
        echo $module->getName();
        ?>
 (проверок: <?php 
        echo count($checks);
        ?>
)</h3>
            <?php 
        echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['allModels' => $checks]), 'layout' => "{items}", 'columns' => [['attribute' => "name", 'label' => 'Тест'], ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\base\CheckComponent $model) {
            $resultId = str_replace("\\", '-', $model->className());
            $result = \yii\helpers\Html::tag("div", "-", ['class' => 'sx-result-container', 'id' => $resultId]);
            return $result;
        }, 'format' => 'raw'], ['class' => \yii\grid\DataColumn::className(), 'value' => function (\skeeks\cms\base\CheckComponent $model) {
            $optionsJson = \yii\helpers\Json::encode(['title' => $model->name, 'content' => $model->description]);
            return \yii\helpers\Html::a("<i class='glyphicon glyphicon-question-sign'></i>", "#", ['class' => 'btn btn-default', 'onclick' => "sx.dialog({$optionsJson}); return false;"]);
        }, 'format' => 'raw']]]);
        ?>
        <?php 
    }
    ?>

    <?php 
}
?>
</div>

<?php 
\skeeks\cms\assets\JsTaskManagerAsset::register($this);
예제 #16
0
파일: _form.php 프로젝트: 3737002/cms-shop
    <?php 
echo \skeeks\cms\modules\admin\widgets\BlockTitleWidget::widget(['content' => \skeeks\cms\shop\Module::t('app', 'The composition of the order')]);
?>

        <?php 
echo \skeeks\cms\modules\admin\widgets\GridView::widget(['dataProvider' => new \yii\data\ArrayDataProvider(['models' => $model->shopBaskets]), 'layout' => "{items}\n{pager}", 'columns' => [['class' => \yii\grid\SerialColumn::className()], ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'name', 'format' => 'raw', 'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
    $widget = new \skeeks\cms\modules\admin\widgets\AdminImagePreviewWidget(['image' => $shopBasket->product->cmsContentElement->image]);
    return $widget->run();
}], ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'name', 'format' => 'raw', 'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
    if ($shopBasket->product) {
        return Html::a($shopBasket->name, $shopBasket->product->cmsContentElement->url, ['target' => '_blank', 'titla' => "Смотреть на сайте", 'data-pjax' => 0]);
    } else {
        return $shopBasket->name;
    }
}], ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'quantity', 'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
    return $shopBasket->quantity . " " . $shopBasket->measure_name;
}], ['class' => \yii\grid\DataColumn::className(), 'label' => \skeeks\cms\shop\Module::t('app', 'Price'), 'attribute' => 'price', 'format' => 'raw', 'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
    if ($shopBasket->discount_value) {
        return "<span style='text-decoration: line-through;'>" . \Yii::$app->money->intlFormatter()->format($shopBasket->moneyOriginal) . "</span><br />" . Html::tag('small', $shopBasket->notes) . "<br />" . \Yii::$app->money->intlFormatter()->format($shopBasket->money) . "<br />" . Html::tag('small', \skeeks\cms\shop\Module::t('app', 'Discount') . ": " . $shopBasket->discount_value);
    } else {
        return \Yii::$app->money->intlFormatter()->format($shopBasket->money) . "<br />" . Html::tag('small', $shopBasket->notes);
    }
}], ['class' => \yii\grid\DataColumn::className(), 'label' => \skeeks\cms\shop\Module::t('app', 'Sum'), 'attribute' => 'price', 'format' => 'raw', 'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
    return \Yii::$app->money->intlFormatter()->format($shopBasket->money->multiply($shopBasket->quantity));
}]]]);
?>

        <div class="row">
            <div class="col-md-8"></div>
            <div class="col-md-4">
                    <div class="sx-result">
예제 #17
0
파일: index.php 프로젝트: Liv1020/cms
<?php

/**
 * index
 *
 * @author Semenov Alexander <*****@*****.**>
 * @link http://skeeks.com/
 * @copyright 2010-2014 SkeekS (Sx)
 * @date 30.10.2014
 * @since 1.0.0
 */
use skeeks\cms\modules\admin\widgets\GridView;
/* @var $this yii\web\View */
/* @var $searchModel \skeeks\cms\models\Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
$dataProvider->sort->defaultOrder = ['id' => 'DESC'];
?>

<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $columns]);