<?php $form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'method' => 'post', 'id' => $model->formName(), 'enableClientValidation' => true]); ?> <div class="row"> <div class="col-sm-6"> </div> <div class="col-sm-6"> <?php echo $form->field($model, 'KD_DISTRIBUTOR')->widget(Select2::classname(), ['data' => $drop, 'options' => ['placeholder' => 'Pilih Perusahaan ...'], 'pluginOptions' => ['allowClear' => true]]); ?> <?php echo $form->field($model, 'CORP_ID')->widget(Select2::classname(), ['data' => $dropunit, 'options' => ['placeholder' => 'Pilih Perusahaan ...'], 'pluginOptions' => ['allowClear' => true]]); ?> </div> </div> <?php /* if not equal to isNewRecord then dropdown status */ if (!$model->isNewRecord) { echo $form->field($model, 'STATUS')->dropDownList(['' => ' -- Silahkan Pilih --', '0' => 'Tidak Aktif', '1' => 'Aktif']); } ?> <div class="form-group"> <?php
?> <?php echo $form->field($model, 'number'); ?> <?php echo $form->field($model, 'name'); ?> <?php echo $form->field($model, 'abbreviation'); ?> <?php echo $form->field($model, 'country_id')->widget(Select2::classname(), ['data' => RgnCountry::asOption(), 'pluginOptions' => ['placeholder' => 'Select or type Country', 'multiple' => FALSE, 'allowClear' => TRUE, 'tags' => TRUE, 'maximumInputLength' => 255]]); ?> <div class="form-group"> <?php echo Html::submitButton('Search', ['class' => 'btn btn-primary']); echo Html::resetButton('Reset', ['class' => 'btn btn-default']); ?> </div> <?php ActiveForm::end(); ?> </div>
use yii\helpers\Html; use kartik\widgets\ActiveForm; use kartik\builder\Form; /** * @var yii\web\View $this * @var yii\widgets\ActiveForm $form * @var \common\models\Osempresas $model */ $this->title = Yii::t('app', 'Seleccione Empresa'); //$this->params['breadcrumbs'][] = $this->title; ?> <div class="container"> <div class="row"> <div class="col-md-4 col-md-offset-4"> <div class="login-panel panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Selecciones Empresa</h3> </div> <div class="panel-body"> <?php $form = ActiveForm::begin(); echo $form->field($model, 'state_1')->widget(Select2::classname(), ['data' => array_merge(["" => ""], $data), 'options' => ['placeholder' => 'Select a state ...'], 'pluginOptions' => ['allowClear' => true]]); echo ' ' . Html::submitButton(Yii::t('app', 'Aceptar'), ['class' => 'btn btn-lg btn-primary btn-block', 'name' => 'login-button']); ActiveForm::end(); ?> </div> </div> </div> </div> </div>
<!--<?php echo $form->field($model, 'podr', ['template' => "{label}<div class=\"col-sm-8\">{input}</div>\n{hint}\n<div class=\"col-sm-offset-4 col-lg-8\">{error}</div>", 'labelOptions' => ['class' => 'col-sm-4 control-label'], 'inputOptions' => ['class' => 'form-control input-sm']])->widget(Select2::classname(), ['data' => $podr_data, 'options' => ['placeholder' => 'Укажите подразделения ...', 'multiple' => true], 'pluginOptions' => ['allowClear' => true, 'tags' => true, 'templateResult' => new JsExpression('function(repo) { //if (repo.loading) return repo.text; _getTree(1, 0, repo); }')]]); ?> <div class="hr-line-dashed"></div>-->