info-table.php
1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
use yii\helpers\Html;
use frontend\modules\map\models\Item;
use frontend\modules\map\models\ItemLang;
/**
* @param $attribute
* @param $model
*/
function trTableShowModel($attribute, $model)
{
if (isset($model[$attribute]) && !empty($model[$attribute])):
$labels = (new ItemLang())->getAttributeLabel($attribute) ?? (new Item())->getAttributeLabel($attribute);
?>
<tr>
<td>
<?= $labels ?>
</td>
<td>
<?= $model[$attribute] ?>
</td>
</tr>
<?php
endif;
}
/**
*
* @author FilamentV <vortex.filament@gmail.com>
* @copyright (c), Thread
*
* @var $model \frontend\modules\map\models\Item
*/
?>
<table>
<thead></thead>
<tfoot></tfoot>
<tbody>
<?php
trTableShowModel('investment', $model);
trTableShowModel('address', $model['lang']);
trTableShowModel('initiator', $model['lang']);
trTableShowModel('project_implementation_period', $model['lang']);
trTableShowModel('web_site_investor', $model);
trTableShowModel('web_site', $model);
trTableShowModel('financing_sources', $model['lang']);
trTableShowModel('financing_debt', $model['lang']);
trTableShowModel('licenses', $model['lang']);
trTableShowModel('licenses_other', $model['lang']);
trTableShowModel('project_documentation', $model['lang']);
trTableShowModel('electric_power', $model);
trTableShowModel('heat_capacity', $model);
if ($archive) {
?>
<tr>
<td>
<?= Yii::t('front', 'Additional files') ?>
</td>
<td>
<?= Html::a(Yii::t('front', 'Download'), $archive) ?>
</td>
</tr>
<?php
} ?>
</tbody>
</table>