_form.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\ActiveForm;
  4. use yii\helpers\ArrayHelper;
  5. use kartik\file\FileInput;
  6. use kartik\datetime\DateTimePicker;
  7. use yii\bootstrap\Modal;
  8. use yii\helpers\Url;
  9. /* @var $this yii\web\View */
  10. /* @var $model app\models\Auclots */
  11. /* @var $form yii\widgets\ActiveForm */
  12. ?>
  13. <div class="auclots-form">
  14. <?php
  15. $files = new \app\models\Files();
  16. $form = ActiveForm::begin(['options'=>['enctype'=>'multipart/form-data']]); ?>
  17. <?= $form->field($model, 'user_id')->hiddenInput(['value' => Yii::$app->user->identity->id]) ?>
  18. <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
  19. <?php $requisites = $model->allRequisites; ?>
  20. <?php if (!$requisites) { ?>
  21. <div class="alert alert-danger alert-dismissible fade in">
  22. <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  23. <?= Yii::t('app', 'noRequisites ID')?>
  24. </div>
  25. <?php } ?>
  26. <div class="row">
  27. <div class='col-md-8'><?= $form->field($model, 'requisites_id')->dropdownList($requisites) ?></div>
  28. <div class='col-md-3' id="addReq"><?= Html::button(Yii::t('app', 'Create Requisites'), ['value' => Url::to('/requisites/create-ajax'), 'class' => 'btn btn-success btn-block', 'id' => 'modalButton']) ;?>
  29. </div>
  30. </div>
  31. <?= $form->field($files, 'file')->widget(FileInput::classname(), [
  32. 'model' => $files,
  33. 'pluginOptions' => [
  34. //'allowedFileExtensions'=>['doc','docx','pdf', 'png', ],
  35. 'initialCaption'=>'*.doc *.docx *.pdf *.png *.jpg *.tiff, *.zip *rar',
  36. 'showPreview' => false,
  37. 'showCaption' => true,
  38. 'showRemove' => true,
  39. 'showUpload' => false
  40. ],
  41. 'options' => ['multiple' => false,],
  42. ])->label(Yii::t('app','ProjectDogovor ID')); ?>
  43. <?= $form->field($model, 'bidding_date')->widget(DateTimePicker::className(),[
  44. 'name' => 'bidding_date',
  45. 'type' => DateTimePicker::TYPE_COMPONENT_PREPEND,
  46. 'value' => date("dd-M-yyyy hh:ii"),
  47. //'options' => ['placeholder' => Yii::t('app','')],
  48. 'pluginOptions' => [
  49. 'autoclose'=>true,
  50. 'format' => 'yyyy-mm-dd hh:ii'
  51. ]
  52. ]) ?>
  53. <?= $form->field($model, 'auction_date')->widget(DateTimePicker::className(),[
  54. 'name' => 'auction_date',
  55. 'type' => DateTimePicker::TYPE_COMPONENT_PREPEND,
  56. 'value' => date("dd-M-yyyy hh:ii"),
  57. 'options' => ['placeholder' => Yii::t('app','CreateAukDate ID')],
  58. 'pluginOptions' => [
  59. 'autoclose'=>true,
  60. 'format' => 'yyyy-mm-dd hh:ii'
  61. ]
  62. ]) ?>
  63. <?= $form->field($model, 'payment_term')->textarea(/*['maxlength' => 800, 'rows' => 6, 'cols' => 50]*/) ?>
  64. <!-- <?= $form->field($model, 'payment_order')->textarea(['maxlength' => 800, 'rows' => 6, 'cols' => 50]) ?> !-->
  65. <?= $form->field($model, 'member_require')->textarea(/*['maxlength' => 5000, 'rows' => 50, 'cols' => 100]*/) ?>
  66. <?= $form->field($model, 'term_procedure')->textarea(/*['maxlength' => 5000, 'rows' => 50, 'cols' => 100]*/) ?>
  67. <div class="form-group">
  68. <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create ID') : Yii::t('app', 'Update ID'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
  69. </div>
  70. <?php ActiveForm::end();
  71. Modal::begin([
  72. 'header' => '<h4>' . Yii::t('app', 'Requisites') . '</h4>',
  73. 'id' => 'modal',
  74. 'size' => 'modal-md',
  75. ]);
  76. echo '<div id="modalContent"></div>';
  77. Modal::end();
  78. ?>
  79. </div>