_form.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\ActiveForm;
  4. use yii\helpers\ArrayHelper;
  5. use app\models\User;
  6. use app\models\Auctions;
  7. use app\models\Bidding;
  8. /* @var $this yii\web\View */
  9. /* @var $model app\models\Bills */
  10. /* @var $form yii\widgets\ActiveForm */
  11. ?>
  12. <div class="bills-form">
  13. <?php $form = ActiveForm::begin(); ?>
  14. <?= $form->field($model, 'user_id')->dropDownList(
  15. ArrayHelper::map(User::find()->all(), 'id', 'username'),
  16. ['prompt' => 'Выберите пользователя']
  17. ) ?>
  18. <?= $form->field($model, 'type')->dropDownList([
  19. 'guarantee' => 'Guarantee',
  20. 'registration' => 'Registration',
  21. ], ['prompt' => 'Тип рахунку']) ?>
  22. <?= $form->field($model, 'payed')->dropDownList([
  23. '0' => 'Нові',
  24. '1' => 'Сплачено',
  25. '2' => 'Не сплачено',
  26. ], ['prompt' => '']) ?>
  27. <?= $form->field($model, 'auction_id')->dropDownList(
  28. ArrayHelper::map(Auctions::find()->all(), 'id', 'name'),
  29. ['prompt' => 'Выберите аукцион']
  30. ) ?>
  31. <?= $form->field($model, 'bid_id')->dropDownList(
  32. ArrayHelper::map(Bidding::find()->all(), 'id', 'id'),
  33. ['prompt' => 'Выберите ставку']
  34. ) ?>
  35. <div class="form-group">
  36. <?= Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-success']) ?>
  37. </div>
  38. <?php ActiveForm::end(); ?>
  39. </div>