Server_AccessControl/views/logs/index.tpl
2020-10-27 17:34:09 +07:00

122 lines
5.3 KiB
Smarty

{extends file=$smarty.current_dir|cat:'/../extends.tpl'}
{use class="yii\helpers\Url"}
{use class="yii\grid\GridView"}
{use class="yii\widgets\Pjax" type="block"}
{use class="app\assets\LogsAsset"}
{LogsAsset::register($this)|void}
{block name='content'}
<style>
.form-group{
margin-bottom: 0;
}
</style>
<div class="logs-index">
<div class="row" style="font-size: 15px;">
<div class="col-md-6">
<label class="action-button" onclick="_export(this);" data-href="{Url::to(['export'])}">
<i class="fa fa-download fa-1-5x"></i> Xuất
</label>
</div>
<div class="col-md-6" style="padding-top: 5px;">
<div class="row">
<div class="form-group col-md-4 col-md-push-2">
<div class="input-group">
<div class="input-group-addon">Từ</div>
<input type='text' value="{$f|date_format:"%H:%M:%S %d/%m/%Y"}" class="form-control time-picker" name='FromTime' readonly="">
</div>
</div>
<div class="form-group col-md-4 col-md-push-2">
<div class="input-group">
<div class="input-group-addon">Đến</div>
<input type='text' value="{$t|date_format:"%H:%M:%S %d/%m/%Y"}" class="form-control time-picker" name='ToTime' readonly="">
</div>
</div>
<div class="col-md-2 col-md-push-2">
<button class="btn btn-primary btn-block" onclick="search(this);" data-href='{Url::to(['index'])}'>
<i class="fa fa-bar-chart"></i> Thống kê
</button>
</div>
</div>
</div>
</div>
{Pjax id="department-list"}
{GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'layout'=> \app\helpers\CommonGrid::getLayout(),
'tableOptions' => [
'class' => 'table table-striped table-bordered table-hover',
'style' => 'background:#fff;min-width:700px;'
],
'rowOptions' => \app\helpers\LogsGrid::rowsColor(),
'columns' => [
[
'class' => 'yii\grid\SerialColumn',
'contentOptions' => ['class' => 'text-center'],
'headerOptions' => ['class' => 'text-center', 'style' => 'width:3%']
],
[
'attribute' => 'time',
'format' => 'raw',
'headerOptions' => ['style' => 'width:10%'],
'value' => \app\helpers\LogsGrid::time()
],
[
'attribute' => 'staff_code',
'format' => 'raw',
'contentOptions' => ['class' => 'text-center'],
'headerOptions' => ['style' => 'width:5%'],
'value' => \app\helpers\LogsGrid::code()
],
[
'attribute' => 'staff_name',
'format' => 'raw',
'value' => \app\helpers\LogsGrid::name()
],
[
'attribute' => 'staff_department',
'filter' => $departmentArray,
'format' => 'raw',
'value' => \app\helpers\LogsGrid::department($departmentArray)
],
'card_number',
[
'attribute' => 'device_id',
'format' => 'raw',
'filter' => $deviceArray,
'headerOptions' => ['style' => 'width:10%'],
'value' => \app\helpers\LogsGrid::device($deviceArray)
],
[
'attribute' => 'door_id',
'format' => 'raw',
'filter' => $deviceArray,
'headerOptions' => ['style' => 'width:10%'],
'value' => \app\helpers\LogsGrid::door($deviceArray)
],
[
'attribute' => 'in_out_state',
'format' => 'raw',
'filter' => $stateArray,
'headerOptions' => ['style' => 'width:8%'],
'contentOptions' => ['class' => 'text-center'],
'value' => \app\helpers\LogsGrid::state($stateArray)
],
[
'attribute' => 'event_type',
'format' => 'raw',
'filter' => $eventTypeArray,
'value' => \app\helpers\LogsGrid::eventType($eventTypeArray)
]
],
'pager' => [
'firstPageLabel' => "<i class='fa fa-backward'></i>",
'lastPageLabel' => "<i class='fa fa-forward'></i>",
'nextPageLabel' => "<i class='fa fa-chevron-right'></i>",
'prevPageLabel' => "<i class='fa fa-chevron-left'></i>",
'maxButtonCount' => 5
]
])}
{/Pjax}
</div>
{/block}