274 lines
14 KiB
Smarty
274 lines
14 KiB
Smarty
{extends file=$smarty.current_dir|cat:'/../extends.tpl'}
|
|
{use class="yii\helpers\Url"}
|
|
{use class="yii\grid\GridView"}
|
|
{use class="app\assets\ListManagementAsset"}
|
|
{ListManagementAsset::register($this)|void}
|
|
{block name='content'}
|
|
<style>
|
|
.row{
|
|
margin-bottom: 5px;
|
|
}
|
|
input{
|
|
width: 100%;
|
|
}
|
|
.table-striped > tbody > tr:nth-of-type(odd){
|
|
background-color: rgb(210, 210, 210);
|
|
}
|
|
.feature-img{
|
|
display:inline-block;
|
|
position: relative;
|
|
}
|
|
.feature-img:hover .btn{
|
|
visibility: visible !important;
|
|
}
|
|
.table > tbody > tr.delete-choose > td{
|
|
background-color: red;
|
|
color: #fff;
|
|
}
|
|
.select2-container {
|
|
width: 100% !important;
|
|
}
|
|
.select2-container--default .select2-selection--single, .select2-selection .select2-selection--single{
|
|
border-color: green;
|
|
}
|
|
</style>
|
|
<input type="hidden" value="{Url::to(["/list-management/add"])}" name="create_url">
|
|
<input type="hidden" value="{Url::to(["/list-management/update"])}" name="update_url">
|
|
<input type="hidden" value="{Url::to(["/list-management/sync-feature"])}" name="sync_feature_url">
|
|
<input type="hidden" value="{Url::to(["/list-management/sync-feature-to-server"])}" name="sync_feature_to_server_url">
|
|
<input type="hidden" value="{Url::to(["/list-management/sync-feature-from-device"])}" name="sync_feature_from_device_url">
|
|
<input type="hidden" value="{Url::to(["/list-management/update-feature"])}" name="update_feature_url">
|
|
<div class="row">
|
|
<div class="col-md-10" style="max-height: 850px;overflow-y: auto;">
|
|
{GridView::widget([
|
|
'dataProvider' => $dataProvider,
|
|
'layout'=> \app\helpers\ListManagementGrid::getLayout(),
|
|
'tableOptions' => [
|
|
'class' => 'table table-striped table-bordered',
|
|
'style' => 'background:#fff;min-width:700px;'
|
|
],
|
|
'rowOptions' => \app\helpers\ListManagementGrid::rows(),
|
|
'columns' => [
|
|
[
|
|
'attribute' => 'code',
|
|
'contentOptions' => ['class' => 'text-center'],
|
|
'headerOptions' => ['class' => 'text-center']
|
|
],
|
|
[
|
|
'attribute' => 'type',
|
|
'contentOptions' => ['class' => 'text-center'],
|
|
'headerOptions' => ['class' => 'text-center'],
|
|
'value' => \app\helpers\ListManagementGrid::type($typeArray)
|
|
],
|
|
[
|
|
'attribute' => 'name',
|
|
'contentOptions' => ['class' => 'text-center'],
|
|
'headerOptions' => ['class' => 'text-center']
|
|
],
|
|
[
|
|
'attribute' => 'gender',
|
|
'contentOptions' => ['class' => 'text-center'],
|
|
'headerOptions' => ['class' => 'text-center']
|
|
],
|
|
[
|
|
'attribute' => 'image',
|
|
'format' => "raw",
|
|
'value' => \app\helpers\ListManagementGrid::image()
|
|
],
|
|
[
|
|
'attribute' => 'time',
|
|
'contentOptions' => ['class' => 'text-center'],
|
|
'headerOptions' => ['class' => 'text-center'],
|
|
'value' => \app\helpers\ListManagementGrid::time()
|
|
],
|
|
[
|
|
'attribute' => 'birthday',
|
|
'contentOptions' => ['class' => 'text-center'],
|
|
'headerOptions' => ['class' => 'text-center'],
|
|
'value' => \app\helpers\ListManagementGrid::birthday()
|
|
],
|
|
[
|
|
'attribute' => 'telephone',
|
|
'contentOptions' => ['class' => 'text-center'],
|
|
'headerOptions' => ['class' => 'text-center']
|
|
],
|
|
[
|
|
'attribute' => 'address',
|
|
'contentOptions' => ['class' => 'text-center'],
|
|
'headerOptions' => ['class' => 'text-center']
|
|
]
|
|
],
|
|
'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
|
|
]
|
|
])}
|
|
</div>
|
|
<div class="col-md-2" style="padding-right: 30px;">
|
|
<h4>Tìm kiếm dữ liệu</h4>
|
|
<div class="form-group">
|
|
<label class="control-label">Từ</label>
|
|
<input type="text" class="form-control datepicker" value="{$f|date_format:"H:i d/m/Y"}" name="From">
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="control-label">Đến</label>
|
|
<input type="text" class="form-control datepicker" value="{$t|date_format:"H:i d/m/Y"}" name="To">
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="control-label">Name</label>
|
|
<input type="text" class="form-control" value="{Yii::$app->request->get("name")}" name="NameSearch">
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="control-label">Type</label>
|
|
<select class="form-control" name="TypeSearch">
|
|
<option value="all">All</option>
|
|
{html_options options=$typeArray selected=Yii::$app->request->get("type")}
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="control-label">Gender</label>
|
|
<select class="form-control" name="GenderSearch">
|
|
<option value="all">All</option>
|
|
{html_options options=$genderArray selected=Yii::$app->request->get("gender")}
|
|
</select>
|
|
</div>
|
|
<div class="text-center">
|
|
<button class="btn btn-info" onclick="_search(this);" data-href="{Url::to(['/list-management'])}">
|
|
<i class="fa fa-search"></i> Tìm kiếm
|
|
</button>
|
|
</div>
|
|
<hr style="border-top: 1px solid #000;">
|
|
<div>
|
|
<input type="checkbox" name="BatchDelete" style="width: inherit;"> Xóa nhiều dữ liệu
|
|
<br>
|
|
<div class="hidden" id="delete-btn-group">
|
|
<div class="text-center">
|
|
<button onclick="checkAll(true);">Chọn toàn bộ trang</button>
|
|
<button onclick="checkAll(false);">Bỏ chọn</button>
|
|
</div>
|
|
<br>
|
|
<div class="text-center">
|
|
<button class="btn btn-danger" onclick="batchDelete(this);" data-href="{Url::to(['/list-management/batch-delete'])}">Xác nhận xóa</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr style="border-top: 1px solid #000;">
|
|
<h4>Đồng bộ với máy chủ</h4>
|
|
<div class="text-center">
|
|
{*<button class="btn btn-info" onclick="_form();">
|
|
<i class="fa fa-plus-circle"></i> Thêm mới
|
|
</button>*}
|
|
<button class="btn btn-info btn-block" onclick="_syncFromServerForm(this);" data-href="{Url::to(['/list-management/sync-from-server'])}">
|
|
<i class="fa fa-download"></i> Đồng bộ từ máy chủ
|
|
</button>
|
|
<button class="btn btn-success btn-block" onclick="_syncToServerForm(this);" data-href="{Url::to(['/list-management/sync-to-server'])}">
|
|
<i class="fa fa-upload"></i> Đồng bộ lên máy chủ
|
|
</button>
|
|
</div>
|
|
<hr style="border-top: 1px solid #000;">
|
|
<h4>Đồng bộ từ thiết bị khác</h4>
|
|
<div class="form-group" id="ip">
|
|
<div class="input-group">
|
|
<input type="text" value="" class="form-control" name="SyncIP" placeholder="Nhập ip thiết bị">
|
|
<div class="input-group-btn">
|
|
<button class="btn btn-info" onclick="_syncForm(this);" data-href="{Url::to(['form-sync'])}">
|
|
<i class="fa fa-search"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<span class="help-block hidden"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div style="width: 300px;position: absolute;" id="menu" class="hidden">
|
|
<div class="panel panel-info">
|
|
<div class="panel-heading text-bold">
|
|
Operation menu
|
|
<i class="fa fa-remove pull-right" style="cursor: pointer;" onclick="_closeMenu();"></i>
|
|
</div>
|
|
<div class="panel-body text-center">
|
|
<button onclick="_formModified(this);" data-href='{Url::to(["/list-management/form-update"])}'>Modified list</button>
|
|
<button onclick="_delete(this);" data-href="{Url::to(["/list-management/delete"])}">Delete list</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div style="width: 500px;position: absolute;right:0;top: 250px;" id='form' class="hidden">
|
|
<div class="panel panel-info">
|
|
<div class="panel-heading text-bold">
|
|
List management
|
|
<i class="fa fa-remove pull-right" style="cursor: pointer;" onclick="_close();"></i>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div class="row">
|
|
<div class="col-md-4 text-center">
|
|
<img src="" class="img-thumbnail" id="FaceImage" style="width: 150px;height: 150px;">
|
|
<div class="" id="upload-btn">
|
|
<input type="file" name="AnhNhanVien" id="AnhNhanVien">
|
|
<input type="hidden" name="AnhNhanVienUrl" value="">
|
|
<input type="hidden" name="url_upload_staff_image" value="{Url::to(['upload'])}">
|
|
</div>
|
|
</div>
|
|
<div class="col-md-8">
|
|
<div class="row">
|
|
<div class="col-md-4 text-right">Type</div>
|
|
<div class="col-md-8">
|
|
<select style="width: 100%;height: 26px;" name="Type">
|
|
{html_options options=$typeArray}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="row hidden">
|
|
<div class="col-md-4 text-right">ID</div>
|
|
<div class="col-md-8">
|
|
<select name='Code' id='Code' onchange="chooseStaff(this);" data-href="{Url::to("/list-management/choose-staff")}">
|
|
<option value=""></option>
|
|
{html_options options=$staffArray}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-4 text-right">Name</div>
|
|
<div class="col-md-8">
|
|
<input type="text" name="Name">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-4 text-right">Gender</div>
|
|
<div class="col-md-8">
|
|
<select style="width: 100%;height: 26px;" name="Gender">
|
|
{html_options options=$genderArray}
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-4 text-right">Birthday</div>
|
|
<div class="col-md-8">
|
|
<input type="text" name="Birthday" id="birthday">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-4 text-right">Telephone</div>
|
|
<div class="col-md-8">
|
|
<input type="text" name="Telephone">
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-4 text-right">Department</div>
|
|
<div class="col-md-8">
|
|
<input type="text" name="Address">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="text-center">
|
|
<input type="hidden" value="" name="ListManagementID">
|
|
<button onclick="_update(this);" data-href='{Url::to(["/list-management/update"])}' id="save-btn">Save</button>
|
|
<button onclick="_close();">Cancel</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/block} |