예제 #1
0
?>
<div class="levels-record-index">

    <h1 class="page-header"><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <p>
        <?php 
echo Html::a(Yii::t('app', 'Create Level'), ['create'], ['class' => 'btn btn-success']);
?>
    </p>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'rowOptions' => function ($model, $key, $index, $grid) {
    return ['class' => $model->Deleted ? 'danger' : ($model->StartLevel ? 'success' : '')];
}, 'columns' => ['ID', ['attribute' => 'Name', 'format' => 'html', 'value' => function ($model, $key, $index, $column) {
    return $model->StartLevel ? '<strong>' . $model->Name . '</strong>' : $model->Name;
}], ['attribute' => 'Discount', 'format' => 'percent', 'value' => function ($model, $key, $index) {
    return $model->Discount / 100;
}], ['attribute' => 'PersonsExpression', 'value' => function ($model) {
    return \common\models\cf\LevelsRecord::getExpressionList()[$model->PersonsExpression];
}], 'Charge:currency', 'OneCheckCharge:currency', ['class' => \common\components\BooleanFilterColumn::className(), 'attribute' => 'ReturnPawn'], ['class' => \common\components\BooleanFilterColumn::className(), 'attribute' => 'Deleted'], ['class' => \common\components\DisableActionColumn::className(), 'stateAttribute' => 'Deleted'], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
예제 #2
0
<div class="levels-record-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'StartLevel')->checkbox();
?>

    <?php 
echo $form->field($model, 'Name')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'PersonsExpression')->dropDownList(\common\models\cf\LevelsRecord::getExpressionList());
?>

    <?php 
echo $form->field($model, 'Discount')->textInput();
?>

    <?php 
echo $form->field($model, 'Charge')->textInput();
?>

    <?php 
echo $form->field($model, 'OneCheckCharge')->textInput();
?>

    <?php