-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
58 lines (54 loc) · 1.82 KB
/
index.php
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
<?php
require 'init.php';
$models = Model::query(QueryCriteria::create()->param('origin','ogo')); //->param('diameter', 50, '>='));
//$models = Model::query(QueryCriteria::create(QueryCriteria::MERGE_MODE_OR)
// ->where(QueryCriteria::create()->param('diameter', 52, '>=')
// ->where(QueryCriteria::create(QueryCriteria::MERGE_MODE_OR)
// ->like('descr', '%7.1%')
// ->like('name', '%7.1%')
// ->like('name', '%SURROUND%')
// ->like('descr', '%SURROUND%')
// )
// )
// ->where(QueryCriteria::create()->isNull('diameter')->regexp('connector', '(^|[^io])usb'))
// ->sort('name')
//);
//$props = Prop::query(QueryCriteria::create()->IN('id', [3,5,6,8,9,15,16,17,18,33,36,39,58,59,66,53]));
$props = Prop::query(QueryCriteria::create());
$counter = 0;
$propsFiltered = [];
foreach ($props as $prop) {
foreach ($models as $model) {
if ($model->getPropById($prop->id)) {
$propsFiltered[$prop->id] = $prop;
break;
}
}
}
?>
<table>
<tr>
<th>#</th>
<th>Platform</th>
<th>Модель</th>
<th>Диаметер</th>
<th>Динамики</th>
<th>Коннектор</th>
<?php foreach ($propsFiltered as $prop) { ?>
<th><?= "$prop->name ($prop->id)" ?></th>
<?php } ?>
</tr>
<?php foreach ($models as $model) { ?>
<tr>
<td><?= ++$counter ?></td>
<td><?= $model->origin ?></td>
<td><a href="<?= $model->getUrl() ?>"><?= $model->name ?></a></td>
<td><?= $model->diameter ?></td>
<td><?= $model->dinamics ?></td>
<td><?= $model->connector ?></td>
<?php foreach ($propsFiltered as $prop) { ?>
<td><?= $model->getPropById($prop->id)->value ?></td>
<?php } ?>
</tr>
<?php } ?>
</table>