7 use yii\widgets\DetailView;
8 use yii\helpers\ArrayHelper;
12 /* @var $this yii\web\View */
13 /* @var $searchModel app\models\ItemsSearch */
14 /* @var $dataProvider yii\data\ActiveDataProvider */
16 $this->title = Yii::t('app', 'Reports');
17 $this->params[ 'breadcrumbs' ][] = $this->title;
21 $models = $dataProvider->getModels();
23 function cell($text, $color, $wrap='')
25 return '<td ' . $wrap . ' style="padding: 2px 2px 2px 2px;"><font color="' . $color . '">' . $text . '</font></td>';
28 foreach ($models as $model)
31 if ($model->status->name == 'Списано' || $model->status->name == 'К списанию')
35 if ($model->status->name == 'Работает')
39 if ($model->status->name == 'Сломано')
43 if ($model->locations->id != $lastLocation)
45 if ($lastLocation == 0)
48 <table border="1" style="padding: 2px 2px 2px 2px;" width="100%"><tbody>
51 $lastLocation = $model->locations->id;
54 <td colspan="8" style="padding: 2px 2px 2px 2px;"><H2><?= $model->locations->regions->name ?></H2>
55 <H3><?= $model->locations->name ?></H3></td>
57 <tr bgcolor="#EFEFEF">
58 <th style= "text-align:center">Инвентарный номер</th>
59 <th style= "text-align:center">Серийный номер</th>
60 <th style= "text-align:center">Оборудование</th>
61 <th style= "text-align:center">Тип</th>
62 <th style= "text-align:center">Состояние</th>
63 <th style= "text-align:center">Сетевое имя</th>
64 <th style= "text-align:center">ОС</th>
65 <th style= "text-align:center">МАС адрес</th>
71 <?= cell($model->items->invent, $color) ?>
72 <?= cell($model->items->serial, $color) ?>
73 <?= cell($model->items->models->name, $color) ?>
74 <?= cell($model->items->models->types->name, $color) ?>
75 <?= cell($model->status->name, $color, 'nowrap') ?>
76 <?= cell($model->items->name, $color, 'nowrap') ?>
77 <?= cell($model->items->os, $color) ?>
78 <?= cell($model->items->mac, $color) ?>
82 if ($lastLocation !== 0)