Exemple #1
0
    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <p>
        <a href="<?php 
echo Url::toRoute(['operation/csv', 'pars' => $pars]);
?>
" class="btn btn-warning pull-right"><?php 
echo Yii::t('app', 'Save in CSV');
?>
</a>
        <br>
    </p>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'pars', 'format' => 'raw', 'value' => function ($data) {
    return isset($data->pars0->search) ? $data->pars0->search : '';
}, 'filter' => ArrayHelper::map(ParsSettings::find()->orderBy("id desc")->all(), 'id', 'search')], 'name', ['attribute' => 'state', 'format' => 'raw', 'value' => function ($data) {
    return ParsSettings::getState($data->state);
}, 'filter' => ParsSettings::listStates()], 'city', ['label' => Yii::t('app', 'Categories'), 'format' => 'raw', 'value' => function ($data) {
    $r = '<ul class="list-unstyled">';
    foreach ($data->categories as $cat) {
        $r .= '<li>' . $cat->name . '</li>';
    }
    $r .= '</ul>';
    return $r;
}, 'filter' => false], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Exemple #2
0
use yii\helpers\Html;
use yii\grid\GridView;
use app\models\ParsSettings;
/* @var $this yii\web\View */
/* @var $searchModel app\models\ParsSettingsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('app', 'Parsing result');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="pars-settings-index">
    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <p>
        <?php 
echo Html::a(Yii::t('app', 'Create new parsing'), ['/site/index'], ['class' => 'btn btn-success']);
?>
    </p>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'created', ['attribute' => 'status', 'format' => 'raw', 'value' => function ($data) {
    return $data->status;
}, 'filter' => ParsSettings::listStatus()], 'search', 'city', ['attribute' => 'state', 'format' => 'raw', 'value' => function ($data) {
    return ParsSettings::getState($data->state);
}, 'filter' => ParsSettings::listStates()], ['label' => Yii::t('app', 'View results'), 'format' => 'raw', 'value' => function ($data) {
    return Html::a(Yii::t('app', 'view'), ['/operation/index', 'pars' => $data->id]);
}, 'filter' => false], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}']]]);
?>

</div>
Exemple #3
0
$this->registerMetaTag(['name' => 'description', 'content' => $this->title]);
?>
<div class="site-index">
    <div class="body-content">
        <div class="row">
            <div class="col-lg-10">
                <h2>Setting up a new parsing</h2>
                <div class="page-form">
                    <?php 
$form = ActiveForm::begin();
?>
                    <?php 
echo $form->field($model, 'search')->textInput(['maxlength' => true]);
?>
                    <?php 
echo $form->field($model, 'state')->dropDownList(ParsSettings::listStates(), ['prompt' => 'All states']);
?>
                    <?php 
echo $form->field($model, 'city')->textInput(['maxlength' => true]);
?>
                    <div class="form-group">
                        <?php 
echo Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
                    </div>

                    <?php 
ActiveForm::end();
?>
                </div>
            </div>