public static function stage() { $alias = static::getCategory('stage'); $temp = Stage::getList(); $origin = []; foreach ($temp as $id => $value) { $origin[$value] = $id; } return array_merge($origin, $alias); }
public function getStages() { return $this->hasMany(Stage::className(), ['id' => 'stage_id'])->viaTable('sale_stage', ['sale_id' => 'id']); }
/** * @inheritdoc */ public function rules() { return [[['id', 'lang_id', 'name'], 'required'], [['id', 'lang_id'], 'integer'], [['name'], 'string', 'max' => 32], [['id', 'lang_id'], 'unique', 'targetAttribute' => ['id', 'lang_id'], 'message' => 'The combination of ID and Lang ID has already been taken.'], [['id'], 'exist', 'skipOnError' => true, 'targetClass' => Stage::className(), 'targetAttribute' => ['id' => 'id']], [['lang_id'], 'exist', 'skipOnError' => true, 'targetClass' => Lang::className(), 'targetAttribute' => ['lang_id' => 'id']]]; }
if (!empty($i->url)) { echo Html::a(' <i class="glyphicon glyphicon-camera"></i> ', $i->url, ['target' => '_blank']); } echo Html::activeHiddenInput($i, '[' . $i->id . ']url', ['id' => false, 'class' => 'photo']); } ?> </div> <div class="col-md-1"> <?php echo $form->field($sale, 'covered', ['template' => '{input}'])->textInput(['data-toggle' => 'tooltip', 'title' => $sale->getAttributeLabel('covered')]); ?> </div> <div class="col-md-1"> <?php echo $form->field($sale, 'bedroom', ['template' => '{input}'])->textInput(['data-toggle' => 'tooltip', 'title' => $sale->getAttributeLabel('bedroom')]); ?> </div> <div class="col-md-2"> <?php echo $form->field($sale, 'stage_ids', ['template' => '{input}'])->checkboxList(Stage::getList(), ['data-toggle' => 'tooltip', 'title' => $sale->getAttributeLabel('stage_ids')]); ?> </div> </div> <?php ActiveForm::end(); ?> </div> </div>
<?php echo $form->field($model, 'sold')->dropDownList($model->soldList); ?> <?php echo $form->field($model, 'title')->dropDownList(Sale::getYesList(), ['prompt' => '']); ?> </div> <div class="col-md-4"> <?php echo $form->field($model, 'price')->widget(MaskedInput::className(), ['clientOptions' => ['alias' => 'decimal', 'groupSeparator' => '.', 'autoGroup' => true, 'rightAlign' => false], 'options' => ['maxlength' => 11, 'class' => 'form-control']]); ?> <?php echo $form->field($model, 'vat')->dropDownList(Sale::getVatList(), ['prompt' => '']); ?> <?php echo $form->field($model, 'stage_ids')->dropDownList(Stage::getList(), ['class' => 'form-control selectpicker', 'multiple' => 'multiple'])->label(Yii::t('app', 'Stage')); ?> <?php echo $form->field($model, 'commission')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'status')->dropDownList(Sale::getStatusList()); ?> <?php echo $form->field($model, 'top')->checkbox(['value' => 1]); ?> </div> </div> </div> </div>