update sửa tên cửa

This commit is contained in:
2020-10-30 10:47:16 +07:00
parent cd943030c6
commit 28f23530d0
6 changed files with 116 additions and 17 deletions

31
views/device/doors.tpl Normal file
View File

@@ -0,0 +1,31 @@
<table class="table table-bordered table-striped">
<thead>
<tr class="info">
<th style="width: 13%;">Mã cửa</th>
<th>Tên cửa</th>
<th style="width: 10%;">Sửa</th>
<th style="width: 15%;">Mở cửa</th>
</tr>
</thead>
<tbody>
{foreach from=$doors item=d}
<tr>
<td class="text-center">{$d->code}</td>
<td>
<span id="name-text-{$d->id}">{$d->name}</span>
<input type="text" value="{$d->name}" class="hidden" id="name-input-{$d->id}" onblur="editDoorName(this);" data-href="{yii\helpers\Url::to(["edit-door-name","id"=>$d->id])}">
</td>
<td class="text-center">
<button class="btn btn-success" data-stt="false" data="{$d->id}" onclick="openFormEditDoorName(this);" id="btn-edit-{$d->id}">
<i class="fa fa-edit"></i>
</button>
</td>
<td class="text-center">
<button class="btn btn-primary" onclick="openDoor(this);" data-href="{yii\helpers\Url::to(['open-door', 'id' => $model->id, 'door' => $d->code])}">
Mở
</button>
</td>
</tr>
{/foreach}
</tbody>
</table>

View File

@@ -100,8 +100,10 @@
],
'version',
[
'attribute' => 'door',
'format' => 'raw',
'headerOptions' => ['style' => 'width:10%'],
'headerOptions' => ['style' => 'width:10%'],
'contentOptions' => ['class' => 'text-center'],
'value' => \app\helpers\DeviceGrid::openDoor()
]
],