index.php
2.67 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
<div class="inner"><?= $this->flash->output(); ?></div>
<a class="btn btn-primary" href="<?= $this->url->get([ 'for' => 'add_fields', "type"=>$type]) ?>">Добавить</a>
<table class="table table-hover" data-url="/sort_user">
<thead>
<tr>
<th>#</th>
<th><p>Название</p></th>
<th>Вес</th>
<th class="table-buttons"></th>
</tr>
</thead>
<tbody id="result">
<?php foreach ($data as $item):?>
<tr class="main_row_block <?=$item['children'] ? "parent" : "" ?>" data-id="<?= $item['id']?>">
<td><?=$item['id']; ?></td>
<td><?= $item['name'] ?></td>
<td><?= $item['weight']?></td>
<td>
<a href="<?= $this->url->get([ 'for' => 'delete_fields', "type"=>$type, "id"=>$item['id']]) ?>" class="action-img delete_icon" title="Удалить" onclick="return confirm('Вы действительно хотите удалить пункт?')"></a>
<a href="<?= $this->url->get([ 'for' => 'update_fields', "type"=>$type, "id"=>$item['id'] ]) ?>" class="action-img edit-icon" title="Редактировать"></a>
</td>
</tr>
<?php if($item['children']): ?>
<tr class="subrow_block_<?= $item['id']?>">
<td colspan="3">
<table class="table table-hover">
<tbody>
<?php foreach($item['children'] as $row): ?>
<tr class="subrow" data-parentId="">
<td><?=$row['id']; ?></td>
<td><?= $row['name'] ?></td>
<td><?= $row['weight']?></td>
<td class="table-buttons">
<a href="<?= $this->url->get([ 'for' => 'delete_fields', "type"=>$type, "id"=>$row['id']]) ?>" class="action-img delete_icon" title="Удалить" onclick="return confirm('Вы действительно хотите удалить пункт?')"></a>
<a href="<?= $this->url->get([ 'for' => 'update_fields', "type"=>$type, "id"=>$row['id'] ]) ?>" class="action-img edit-icon" title="Редактировать"></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</td>
</tr>
<?php endif;?>
<?php endforeach; ?>
</tbody>
</table>
<a class="btn btn-primary" href="<?= $this->url->get([ 'for' => 'add_fields', "type"=>$type]) ?>">Добавить</a>