index.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\grid\GridView;
  4. use kartik\select2\Select2;
  5. use app\models\Publishing;
  6. use yii\widgets\ListView;
  7. use yii\widgets\ActiveForm;
  8. use yii\helpers\ArrayHelper;
  9. /* @var $this yii\web\View */
  10. /* @var $searchModel app\models\PublishingSearch */
  11. /* @var $dataProvider yii\data\ActiveDataProvider */
  12. $this->title = Yii::t('app', 'Publishing ID');
  13. $this->params['breadcrumbs'][] = $this->title;
  14. $this->registerJs(<<<JS
  15. $('#index-form *').on('change', function(){
  16. $('#index-form').submit();
  17. });
  18. JS
  19. );
  20. ?>
  21. <div class="container">
  22. <section class="publications">
  23. <div class="container">
  24. <div class="row">
  25. <div class="col-12 publications-search">
  26. <?php $form = ActiveForm::begin([
  27. 'method' => 'get',
  28. 'action' => ['/publishing'],
  29. 'id' => 'index-form'
  30. ])?>
  31. <div class="input-group mb-2">
  32. <?= Html::activeInput('text', $searchModel, 'main_search',
  33. ['class' => 'form-control', 'placeholder'=>'Назва або ідентифікатор аукціону'])?>
  34. <?= Html::submitButton(Html::img('/images/icon-search.png'), ['class' => 'btn btn-primary'])?>
  35. </div>
  36. <input class="link-secondary p-0" data-toggle="collapse" data-target="#expandedSearch" type="button" value="Розширений пошук">
  37. <img src="/images/icon-plus.png" alt="">
  38. <div class="collapse <?= $searchModel->isClear() ? '' : 'show'?>" id="expandedSearch">
  39. <div class="row ">
  40. <div class="form-group col-md-6 col-lg-3 mb-0">
  41. <label for="search-filter-admin">Організатор торгів</label>
  42. <?= Html::activeInput('text', $searchModel, 'org_name',
  43. ['class' => 'form-control', 'placeholder'=>'Організатор', 'id' =>'search-filter-region'])?>
  44. </div>
  45. <div class="form-group col-md-6 col-lg-3 mb-0">
  46. <label for="search-filter-id">Категорія</label>
  47. <?=Html::activeDropDownList($searchModel, 'category',
  48. ArrayHelper::merge(['' => Yii::t('app','Choose')], ArrayHelper::map(\app\models\Category::find()->all(), 'id', 'name')),
  49. [
  50. 'class' => 'form-control',
  51. 'id' => 'search-filter-category'
  52. ]) ?>
  53. </div>
  54. <div class="form-group col-md-6 col-lg-3 mb-0">
  55. <label for="search-filter-status">Стан торгів</label>
  56. <?=Html::activeDropDownList($searchModel, 'status',
  57. [
  58. '' => Yii::t('app','Choose'),
  59. '0' => Yii::t('app','pMakeBidding ID'),
  60. '1' => Yii::t('app','pWaitAuction ID'),
  61. '2' => Yii::t('app','pMakeAuction ID'),
  62. '3' => Yii::t('app','pMakeFinal ID'),
  63. '4' => Yii::t('app','pEndTorg ID')
  64. ],
  65. [
  66. 'class' => 'form-control',
  67. 'id' => 'search-filter-status'
  68. ]) ?>
  69. </div>
  70. <div class="form-group col-md-6 col-lg-3 mb-0">
  71. <label for="search-filter-type">Тип аукціону</label>
  72. <?=Html::activeDropDownList($searchModel, 'type',
  73. [
  74. '' => Yii::t('app','Choose'),
  75. '1' => 'Аукціон на підвищення',
  76. '2' => 'Голландський аукціон'
  77. ],
  78. [
  79. 'class' => 'form-control',
  80. 'id' => 'search-filter-type'
  81. ]) ?>
  82. </div>
  83. </div>
  84. <div class="row no-gutters">
  85. <div class="col mt-3">
  86. <a class="link-secondary" href="/publishing" id="reset-btn" name="search-clear">Очистити фільтр</a>
  87. </div>
  88. </div>
  89. </div>
  90. <?php ActiveForm::end();?>
  91. </div>
  92. <!-- start items -->
  93. </div>
  94. <section class="content bordered">
  95. <?= ListView::widget([
  96. 'dataProvider'=>$dataProvider ,
  97. 'itemView' => '_forms/_auctions',
  98. 'layout' => "{items}",
  99. ]) ?>
  100. </section>
  101. <?= \yii\widgets\LinkPager::widget([
  102. 'pagination'=>$dataProvider->pagination,
  103. 'prevPageLabel' => '&larr;',
  104. 'nextPageLabel' => '&rarr;',
  105. 'options' => [
  106. 'class' => 'pagination justify-content-center',
  107. ],
  108. // Customzing CSS class for pager link
  109. 'linkOptions' => ['class' => 'page-link'],
  110. 'activePageCssClass' => 'page-item active',
  111. 'disabledPageCssClass' => 'hidden page-item',
  112. ]); ?>
  113. </div>
  114. </section>
  115. </div>