Your IP : 216.73.216.79


Current Path : /var/www/html/crm/views/paramlist/
Upload File :
Current File : /var/www/html/crm/views/paramlist/_form.php.20210518

<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use app\models\ParamList;
use app\models\ParamCat;

/* @var $this yii\web\View */
/* @var $model app\models\ParamList */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="param-list-form">
    <div class="kt-container  kt-container--fluid  kt-grid__item kt-grid__item--fluid">
        <div class="kt-portlet kt-portlet--mobile">
            <div class="kt-portlet__body kt-portlet__body--fit">
                <div class="kt-portlet__head">
                    <div class="kt-portlet__head-label">
                        <span class="kt-font-info"><i class="fas fa-info-circle"></i>&nbsp;&nbsp;Field with <span class="required">*</span> is required</span>
                    </div>
                </div>
                <div class="kt-portlet__body">
                    <?php $form = ActiveForm::begin(['options' => ['class' => 'kt-form kt-form--label-right']]); ?>
                    <?php $form->errorSummary($model); ?>
                    <div class="row">
                        <div class="col-4">
                            <div class='form-group-custom'>
                                <?php
                                if (Yii::$app->controller->action->id == 'create')
                                    echo $form->field($model, 'code', ['template' => "{label}<span class='required'>*</span>{input}{error}"])->textInput(['maxlength' => true]);
                                if (Yii::$app->controller->action->id == 'update')
                                    echo $form->field($model, 'code', ['template' => "{label}<span class='required'>*</span>{input}{error}"])->textInput(['maxlength' => true, 'disabled' => true]);
                                ?>
                            </div>
                        </div>
                        <div class="col-4">
                            <div class='form-group-custom'>
                                <?= $form->field($model, 'label', ['template' => "{label}<span class='required'>*</span>{input}{error}"])->textInput(['maxlength' => true]); ?>
                            </div>
                        </div>
                        <div class="col-4">
                            <div class='form-group-custom'>
                                <?php
                                $cat_uuid = Yii::$app->getRequest()->getQueryParam('cat_id');
                                $ParamCat = new ParamCat();
                                $cat_id = $ParamCat->findID($cat_uuid);
                                echo $form->field($model, 'sort', ['template' => "{label}
                                    <span class='kt-font-info' data-toggle='tooltip' data-placement='right' title='Parameter will be place below the parameter selected here'>
                                        &nbsp;&nbsp;<i class='fas fa-info-circle'></i>
                                    </span>
                                    {input}{error}"])
                                        ->dropDownList(ArrayHelper::map(Paramlist::find()->where(['cat_id' => $cat_id])->orderBy(['sort' => SORT_ASC])->all(), 'sort', 'label'), ['prompt' => '(First in order)', 'class' => 'form-control kt-selectpicker']);
                                ?>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="kt-portlet__foot">
                    <div class="kt-form__actions">
                        <?= Html::a('<i class="fas fa-arrow-left"></i>&nbsp;Back', ['/paramlist/index', 'cat_id' => Yii::$app->getRequest()->getQueryParam('cat_id')], ['class' => 'btn btn-outline-brand']) ?>&nbsp;
                        <?= Html::a('<i class="fas fa-sync"></i>&nbsp;Reset', [Yii::$app->controller->action->id, 'cat_id' => Yii::$app->getRequest()->getQueryParam('cat_id'), 'uuid' => Yii::$app->getRequest()->getQueryParam('uuid')], ['class' => 'btn btn-outline-success']); ?>&nbsp;
                        <?= Html::submitButton('<i class="fas fa-paper-plane"></i>&nbsp;Submit', ['class' => 'btn btn-info']) ?>
                    </div>
                </div>
                <?php ActiveForm::end(); ?>
            </div>
        </div>
    </div>
</div>