view.php 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\DetailView;
  4. use yii\widgets\ActiveForm;
  5. use kartik\file\FileInput;
  6. use dosamigos\gallery\Gallery;
  7. /* @var $this yii\web\View */
  8. /* @var $model app\models\Publishing */
  9. $this->title = $model->name;
  10. $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Auction ID'), 'url' => ['index']];
  11. $this->params['breadcrumbs'][] = $this->title;
  12. ?>
  13. <div class="container">
  14. <div class="panel panel-primary">
  15. <div class="panel-heading"><span class="glyphicon glyphicon-stats"></span><strong>
  16. <?= Html::encode(Yii::t('app','PublishAuctionMessage ID')." ".$model->name/*.' / '.Yii::t('app','Lot ID')*/.' #'.$model->lot_num) ?></strong></div>
  17. <div class="panel-body">
  18. <div class="publishing-view">
  19. <div class="row">
  20. <div class="col-md-6">
  21. <div class="well well-sm">
  22. <h5><strong><?= Yii::t('app','PublishLotInfo ID') ?></strong></h5>
  23. <?= DetailView::widget([
  24. 'model' => $model,
  25. 'attributes' => [
  26. 'lotName',
  27. 'lotDesc',
  28. 'lotPrice',
  29. 'lotStep',
  30. 'statusName',
  31. [
  32. 'attribute' => 'lot.count',
  33. 'value' => $model->lot->count,
  34. 'visible' => $model->lot->count,
  35. ],
  36. [
  37. 'attribute' => 'lot.price_per_one',
  38. 'value' => $model->lot->count ? ($model->lot->start_price / $model->lot->count) . ' грн' : '',
  39. 'visible' => $model->lot->unitId ? true : false,
  40. ],
  41. [
  42. 'attribute' => 'lot.unitName',
  43. 'value' => $model->lot->unitId ? $model->lot->unit->name : '',
  44. 'visible' => $model->lot->unitId ? true : false,
  45. ],
  46. ],
  47. ]) ?>
  48. </div>
  49. </div>
  50. <div class="col-md-6">
  51. <div class="well well-sm">
  52. <h5><strong><?= Yii::t('app','PublishAucInfo ID') ?></strong></h5>
  53. <?= DetailView::widget([
  54. 'model' => $model,
  55. 'attributes' => [
  56. //'created_at:datetime',
  57. 'endBidding',
  58. 'date_start',
  59. ],
  60. ]) ?>
  61. </div>
  62. <div>
  63. <?php
  64. $items = [];
  65. $thumbnails = $model->lot->thumbnails;
  66. $images = $model->lot->images;
  67. foreach($images as $index => $image){
  68. $items[] = [
  69. 'src' => '/' . $thumbnails[$index]->path,
  70. 'url' => '/'.$images[$index]->path,
  71. ];
  72. }
  73. ?>
  74. <!-- <?/*='<pre>';*/?>
  75. --><?php /*print_r($items);die(); */?>
  76. <?= Gallery::widget(['items' => $items]);?>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="row">
  81. <div class="col-md-12">
  82. <div class="well well-sm">
  83. <h5><strong><?= Yii::t('app','PublishMemReq ID') ?></strong></h5>
  84. <?= DetailView::widget([
  85. 'model' => $model->lot,
  86. 'attributes' => [
  87. [
  88. 'attribute' => 'member_require',
  89. 'label' => Yii::t('app','MemberRequire ID'),
  90. ],
  91. 'term_procedure',
  92. /*[
  93. 'attribute' => 'member_docs',
  94. 'label' => '',
  95. ],*/
  96. ],
  97. ]) ?>
  98. <?= DetailView::widget([
  99. 'model' => $model->lot,
  100. 'attributes' => [
  101. [
  102. 'attribute' => 'address',
  103. 'label' => Yii::t('app','AddressTo ID'),
  104. ],
  105. 'payment_term',
  106. 'notes',
  107. //'delivery_time',
  108. //'delivery_term',
  109. ],
  110. ]) ?>
  111. <h5><strong><?= Yii::t('app','PublishFiles ID') ?></strong></h5>
  112. <?= $this->render('_alert.php') ?>
  113. <?php
  114. if(isset($model->lot->docs_id))
  115. {
  116. $docs = Html::a(Yii::t('app','Download ID'), ['/files/download','id'=> $model->lot->docs_id], ['class' => 'glyphicon glyphicon-circle-arrow-down row1']);
  117. }
  118. if(empty($docs)) { $docs = null;}
  119. $dogovor = Html::a(Yii::t('app','Download ID'), ['/files/download','id'=> $model->lot->dogovor_id], ['class' => 'glyphicon glyphicon-circle-arrow-down row1']);
  120. ?>
  121. <?= DetailView::widget([
  122. 'model' => $model->lot,
  123. 'attributes' => [
  124. [
  125. 'attribute' => 'docs_id',
  126. 'value' => $docs,
  127. 'format' => 'raw',
  128. ],
  129. [
  130. 'attribute' => 'dogovor_id',
  131. 'value' => $dogovor,
  132. 'format' => 'raw',
  133. ]
  134. ],
  135. ]) ?>
  136. <?php
  137. $protocol = $model->getProtocol();
  138. if(Yii::$app->user->can('admin'))
  139. {
  140. if(!$protocol&&$model->status==3)
  141. {
  142. echo Html::a(Yii::t('app','CreateDoc ID'), ['/publishing/doc','id'=> $model->id], ['class' => 'glyphicon glyphicon-circle-arrow-up']);
  143. $form = ActiveForm::begin([
  144. 'options'=>['enctype'=>'multipart/form-data'] // important
  145. ]);
  146. $files = new \app\models\Files();
  147. echo $form->field($files, 'file')->widget(FileInput::classname(),[
  148. 'model' => $files,
  149. 'options' => ['multiple' => false],
  150. 'pluginOptions' => ['showPreview' => false,],
  151. ])->label(Yii::t('app','DownloadProtocol ID'));
  152. ActiveForm::end();
  153. }
  154. }
  155. if($protocol)
  156. {
  157. //echo Html::a($protocol['name'],'/files/download?id='.$protocol['id'],['class'=>'btn btn-link']);
  158. echo Html::a(Yii::t('app','DownloadProtocol ID'), ['/files/download','id'=> $protocol['id']], ['class' => 'glyphicon glyphicon-circle-arrow-down']);
  159. }
  160. ?>
  161. </div>
  162. </div>
  163. </div>
  164. <div class="row"><div class="col-md-12">
  165. <!-- <button id="" type="button" class="btn btn-primary" href="javascript:/" onclick="window.close();" role="button"><span class="glyphicon glyphicon-eye-close"></span> Закрити вікно</button> -->
  166. <a id="btnPubLot" type="button" class="btn btn-primary" href="/lots/view?id=<?php echo $model->lot->id;?>" role="button"><?= Yii::t('app','GoToBid ID')?><span class="glyphicon glyphicon-chevron-right"></span></a>
  167. <a id="btnPubLot" type="button" class="btn btn-success" href="/auctions/view?id=<?php echo $model->id;?>" role="button"><?= Yii::t('app','GoToAuction ID')?><span class="glyphicon glyphicon-chevron-right"></span></a>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. </div>