<?php Pjax::begin(['id' => 'brand-form','enablePushState' => false, 'timeout' => false])?> <?php $form = ActiveForm::begin([ 'id' => 'create-brand', //'action' => Url::to(['brand/create']), 'options' => [ 'data-pjax' => 1, ], 'enableClientValidation' => false ]); ?> <?= $form->field($model, 'name')->textInput() ?> <?= $form->field($model, 'cat_id')->dropDownList(Auction::dropDownList('auction\models\Categories', 'id', 'name')) ?> <?= $form->field($model, 'brand_id')->dropDownList(Auction::dropDownList('auction\models\Brands', 'id', 'name')) ?> <?= $form->field($model, 'company')->hiddenInput(['value' => Auction::company()])->label(false) ?> <div class="form-group"> <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => ($model->isNewRecord) ? 'btn btn-success' : 'btn btn-primary']) ?> </div> <?php ActiveForm::end(); ?> <?php Pjax::end();?> </div>
public function BrandList(){ if($this->_brandList == null){ $this->_brandList = Auction::dropDownList('auction\models\Brands' , 'id' ,'name'); } return $this->_brandList; }
<div class="login-panel panel panel-info" style="margin-top: 20px"> <div class="panel-heading"> <h3 class="panel-title">Add Preferences</h3> </div> <div class="panel-body"> <?php Pjax::begin(['id' => 'create-preferences', 'enablePushState' => false]) ?> <?php $form = ActiveForm::begin([ 'id' => 'update-preferences', 'action' => \yii\helpers\Url::to(['add-preference']), 'fieldClass' => 'auction\widgets\ActiveField', 'successCssClass' => false, 'options'=> ['role' => 'form' , 'data-pjax' => true]]); ?> <fieldset> <div class="form-group input-group"> <?= Html::dropDownList('category','',Auction::dropDownList('auction\models\Categories','id','name'),[]) ?> <?= Html::dropDownList('brand','',Auction::dropDownList('auction\models\Brands','id','name'),[]) ?> <span class="input-group-btn"> <button class="btn btn-default" type="submit"> <i class="fa fa-plus"></i> </button> </span> </div> <?php if($model->dealerPreferences) :?> <?php foreach($model->dealerPreferences as $param):?> <div class="form-group input-group"> <?= Html::activeTextInput($param->category0, 'name',['class' => 'form-control' ,'disabled' => 'disabled']) ?> <?= Html::activeTextInput($param->brand0, 'name',['class' => 'form-control' ,'disabled' => 'disabled']) ?> <span class="input-group-btn"> <?= Html::button('<i class="fa fa-minus"></i>',['class' => 'btn btn-default delete-button' ,'id' => $param->primaryKey])?>
<?= $form->field($model, 'amount')->textInput() ?> <?= $form->field($model, 'status')->dropDownList(DatabaseHelper::Status()) ?> <?= $form->field($model, 'priority')->textInput() ?> <?= $form->field($model, 'security')->textInput() ?> <?= $form->field($model, 'is_percent')->textInput() ?> <?= $form->field($model, 'max_bid')->textInput() ?> <?= $form->field($model, 'cooling_prd')->textInput() ?> <?= $form->field($model, 'last_min_extd')->textInput() ?> <?= $form->field($model, 'max_extd')->textInput() ?> <?= $form->field($model, 'category')->dropDownList(\auction\components\Auction::dropDownList('auction\models\Categories' , 'id' ,'name')) ?> <?= $form->field($model, 'brand')->dropDownList(\auction\components\Auction::dropDownList('auction\models\Brands' ,'id' , 'name')) ?> <div class="form-group"> <?= Html::submitButton('Create' , ['class' => 'btn btn-success']) ?> </div> <?php ActiveForm::end(); ?> </div>
]); ?> <fieldset> <?= Html::hiddenInput('id', $model->id);?> <?= $form->field($model, 'name')->textInput() ?> <?php if($model->auction === null): ?> <?= $form->field($model, 'auction')->dropDownList(ArrayHelper::map(Auctions::find()->all(),'id','name'),['class' => 'form-control']) ?> <?php else:?> <?= $form->field($model , 'auction')->hiddenInput() ?> <?php endif;?> <?= $form->field($model, 'condition')->textInput() ?> <?= $form->field($model, 'lot_size')->textInput() ?> <?= $form->field($model, 'is_quantity')->textInput() ?> <?= $form->field($model->lotPreferences, 'brand')->dropDownList(Auction::dropDownList('auction\models\Brands' , 'id', 'name')) ?> <?= $form->field($model->lotPreferences, 'category')->dropDownList(Auction::dropDownList('auction\models\Categories' , 'id', 'name')) ?> <?= Html::submitButton(($model->isNewRecord) ? 'Create a new lot' : 'Update Lot',['class' => 'btn btn-lg btn-info btn-block'])?> </fieldset> <?php ActiveForm::end(); ?> <?php Pjax::end();?>