view.php 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\grid\GridView;
  4. use yii\data\ActiveDataProvider;
  5. use app\models\Auctions;
  6. /* @var $this yii\web\View */
  7. /* @var $model app\models\Auctions */
  8. $this->title = $model->lot->name;
  9. $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Auction ID'), 'url' => ['index']];
  10. $this->params['breadcrumbs'][] = $this->title;
  11. $aukname = Yii::t('app', 'AukName ID');
  12. $lot_label = Yii::t('app', 'Predmet ID');
  13. $lot_number_label = Yii::t('app', 'LotNumber ID');
  14. $org_name_label = Yii::t('app', 'OrgName ID');
  15. if ($model->type_id=="1") { $type_label = Yii::t('app', 'AuctionUp ID'); } else { $type_label = Yii::t('app', 'Concurs ID'); }
  16. $type_action = Yii::t('app', 'AuctionType ID');
  17. // $dataProvider = new ActiveDataProvider(['query' => \app\models\Trade::find()->where(['auk_id' => $model->id])->limit('5')]);
  18. ?>
  19. <!-- <script type="text/javascript">
  20. window.onfocus = function(){
  21. window.location.reload();
  22. }
  23. </script> -->
  24. <div class="container-fluid">
  25. <div class="col-sm-12">
  26. <div class="auctions-view">
  27. <div class="panel panel-primary">
  28. <div class="panel-heading"><span class="glyphicon glyphicon-tower"></span><strong> <?= Html::encode($aukname . ": #". $model->id . " " . $model->name) ?></strong></div>
  29. <div class="panel-body">
  30. <dl class="dl-horizontal">
  31. <dt><?= Html::encode($type_action) ?>:</dt><dd><?= Html::encode($type_label) ?></dd>
  32. <dt><?= Html::encode($org_name_label) ?>:</dt><dd><?= Html::encode($model->user->at_org) ?></dd>
  33. <!--ivakhnov<dt><?/*= Html::encode($lot_number_label) */?>:</dt><dd><?/*= Html::encode($model->lot_num) */?></dd>-->
  34. <dt><?= Html::encode($lot_label) ?>:</dt><dd><?= Html::encode($this->title) ?></dd>
  35. <?php
  36. // trade_log php
  37. /*
  38. GridView::widget([
  39. 'dataProvider' => $dataProvider,
  40. 'columns' => [
  41. ['class' => 'yii\grid\SerialColumn'],
  42. [
  43. 'id',
  44. 'auk_id',
  45. 'date',
  46. 'comment',
  47. 'user_id',
  48. ]
  49. ]]);*/
  50. ?>
  51. <?php
  52. if(Yii::$app->user->can('admin') || Yii::$app->user->can('org'))
  53. {
  54. if($model->status >= "2") // && $model->type_id=="1")
  55. {
  56. //$auction = Auctions::find()->with('winners')->where(['id' => 48])->one();
  57. //$winners = $auction->winners;
  58. $winners = $model->winners;
  59. }
  60. }
  61. ?>
  62. </dl>
  63. </div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. <?php
  69. if(Yii::$app->user->can('admin') || Yii::$app->user->can('member') || Yii::$app->user->can('watcher'))
  70. {
  71. //echo $this->render('../../web/ws.html',['model' => $model]);
  72. //echo Html::a(Yii::t('app','Завантажити повний лог торгiв'), ['/auctions/tradelog', 'id' => $model->id], ['class' => 'glyphicon glyphicon-circle-arrow-down row1']);
  73. }
  74. echo $this->render('../../web/ws.html',['model' => $model]);
  75. // elseif(Yii::$app->user->can('org'))
  76. // {
  77. // // echo $this->render('../../web/ws.html',['model' => $model]);
  78. // echo $this->render('../../web/ws_org.html',['model' => $model]);
  79. // }
  80. ?>