phân trang tìm kiếm nhân viên để gán lịch trình

This commit is contained in:
2020-10-20 10:15:03 +07:00
parent adffab016c
commit ad30699a52
6 changed files with 108 additions and 47 deletions

View File

@@ -1,41 +1,50 @@
{use class="yii\grid\GridView"}
{use class="yii\widgets\Pjax" type="block"}
<style>
.choose-staff-schedule{
cursor: pointer;
}
.choose-staff-schedule:hover{
background: #cecece;
.pagination{
margin: 0;
}
</style>
<div>
Danh sách có <b class="text-red">{count($staffs)}</b> nhân viên.
</div>
<table class="table table-bordered table-striped table-staff-schedule" style="background: #fff;">
<thead>
<tr class="info">
<th style="width: 5%;" class="text-center">
<input type='checkbox' value='0' class='checkbox-staff-schedule' id='checkall-staff-schedule'>
</th>
<th style="width: 20%;">Mã nhân viên</th>
<th>Tên nhân viên</th>
<th>Phòng ban</th>
<th>Lịch trình</th>
<th>Cửa</th>
</tr>
</thead>
<tbody>
{foreach from=$staffs item=s}
<tr>
<td class="text-center">
<input type='checkbox' value='{$s->id}' name='checkbox-staff-schedule' class='checkbox-staff-schedule'>
</td>
<td>{$s->code}</td>
<td class="choose-staff-schedule">
{$s->name}
</td>
<td>{$departmentArray[$s->department_id]|default:""}</td>
<td id="schedule-staff-results-{$s->id}">{$scheduleArray[$s->schedule_id]|default:""}</td>
<td id="schedule-door-results-{$s->id}">{$s->doors}</td>
</tr>
{/foreach}
</tbody>
</table>
{Pjax id="staff-list" enablePushState=false timeout=false enableReplaceState=false}
{GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => null,
'layout'=> \app\helpers\StaffGrid::getLayout(),
'tableOptions' => [
'class' => 'table table-striped table-bordered table-hover',
'style' => 'background:#fff;min-width:700px;'
],
'rowOptions' => \app\helpers\CommonGrid::rows("staff", true),
'columns' => [
[
'class' => 'yii\grid\SerialColumn',
'contentOptions' => ['class' => 'text-center'],
'headerOptions' => ['class' => 'text-center', 'style' => 'width:3%']
],
[
'header' => "<input type='checkbox' value='0' class='checkbox-staff-schedule' id='checkall-staff-schedule'>",
'format' => 'raw',
'contentOptions' => ['class' => 'text-center'],
'headerOptions' => ['class' => 'text-center', 'style' => 'width:3%'],
'value' => \app\helpers\CommonGrid::checkbox("staff-schedule", false)
],
'code',
'name',
'card_number',
[
'attribute' => 'department_id',
'value' => \app\helpers\StaffGrid::department($departmentArray)
],
[
'attribute' => 'schedule',
'value' => \app\helpers\StaffGrid::schedule($scheduleArray)
],
[
'attribute' => 'doors',
'format' => 'raw',
'headerOptions' => ['style' => 'width:15%'],
'value' => \app\helpers\StaffGrid::doors($doorsArray)
]
]
])}
{/Pjax}