init Area full CRUD
This commit is contained in:
@@ -12,26 +12,32 @@
|
||||
</style>
|
||||
<div class="form-group" id="name">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Tên phòng ban <i class="text-red">*</i></div>
|
||||
<div class="input-group-addon">Tên khu vực <i class="text-red">*</i></div>
|
||||
<input type="text" class="form-control" value="{$model->name|default:""}" name="Name">
|
||||
</div>
|
||||
<span class="help-block hidden"></span>
|
||||
</div>
|
||||
<div class="form-group" id="code">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Mã phòng ban <i class="text-red">*</i></div>
|
||||
<div class="input-group-addon">Mã khu vực <i class="text-red">*</i></div>
|
||||
<input type="number" class="form-control" value="{$model->code|default:""}" name="Code" {if $model->code==1}disabled=""{/if}>
|
||||
</div>
|
||||
<span class="help-block hidden"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Trực thuộc <i class="text-red">*</i></div>
|
||||
<div class="input-group-addon">Khu vực cha <i class="text-red">*</i></div>
|
||||
<select class="form-control" name="Pid" id="Pid" {if $model->code==1}disabled=""{/if}>
|
||||
{html_options options=$departmentArray selected=$model->pid|default:1}
|
||||
{html_options options=$areaArray selected=$model->pid|default:1}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Chú thích</div>
|
||||
<textarea class="form-control" name="Description">{$model->description}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<button class="btn btn-primary" onclick="save(this);" data-href="{$url}">
|
||||
<i class="fa fa-floppy-o"></i> Lưu
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<label class="action-button" onclick="common.form(this, '');" data-href="{Url::to(['tree'])}">
|
||||
<i class="fa fa-sitemap fa-1-5x"></i> Cây thư mục
|
||||
</label>
|
||||
<label class="action-button" onclick="common.form(this, 'department');" data-href="{Url::to(['create'])}">
|
||||
<label class="action-button" onclick="common.form(this, 'area');" data-href="{Url::to(['create'])}">
|
||||
<i class="fa fa-plus-square fa-1-5x"></i> Thêm
|
||||
</label>
|
||||
<label class="action-button" onclick="_form(this);" data-href="{Url::to(['update'])}">
|
||||
@@ -30,12 +30,12 @@
|
||||
{GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'layout'=> \app\helpers\AreaGrid::getLayout(),
|
||||
'layout'=> \app\helpers\CommonGrid::getLayout(),
|
||||
'tableOptions' => [
|
||||
'class' => 'table table-striped table-bordered table-hover',
|
||||
'style' => 'background:#fff;min-width:700px;'
|
||||
],
|
||||
'rowOptions' => \app\helpers\AreaGrid::rows("area"),
|
||||
'rowOptions' => \app\helpers\CommonGrid::rows("area"),
|
||||
'columns' => [
|
||||
[
|
||||
'class' => 'yii\grid\SerialColumn',
|
||||
@@ -47,19 +47,23 @@
|
||||
'format' => 'raw',
|
||||
'contentOptions' => ['class' => 'text-center'],
|
||||
'headerOptions' => ['class' => 'text-center', 'style' => 'width:3%'],
|
||||
'value' => \app\helpers\AreaGrid::checkbox("area")
|
||||
'value' => \app\helpers\CommonGrid::checkbox("area")
|
||||
],
|
||||
'code',
|
||||
'pid',
|
||||
[
|
||||
'attribute' => 'pid',
|
||||
'filter' => $areaArray,
|
||||
'value' => \app\helpers\CommonGrid::pid($areaArray)
|
||||
],
|
||||
'name',
|
||||
'description:ntext',
|
||||
[
|
||||
'attribute' => 'created_at',
|
||||
'value' => \app\helpers\AreaGrid::createdAt()
|
||||
'value' => \app\helpers\CommonGrid::createdAt()
|
||||
],
|
||||
[
|
||||
'attribute' => 'modified_at',
|
||||
'value' => \app\helpers\AreaGrid::modifiedAt()
|
||||
'value' => \app\helpers\CommonGrid::modifiedAt()
|
||||
]
|
||||
]
|
||||
])}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<table style="width: 100%;" class="table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Người dùng</th>
|
||||
<th>Thời gian</th>
|
||||
<th>Hành động</th>
|
||||
<th>Chi tiết</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{$count=1}
|
||||
{foreach from=$logs item=l}
|
||||
<tr>
|
||||
<td>{$count++}</td>
|
||||
<td>{$userArray[$l->user_id]|default:""}</td>
|
||||
<td>{$l->time|date_format:"%H:%M:%S %d/%m/%Y"}</td>
|
||||
<td>{$l->action}</td>
|
||||
<td>{$l->description}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -1,7 +0,0 @@
|
||||
<div style="cursor: pointer;">
|
||||
<i class="fa fa-minus-square-o" onclick="common.tree(this);" data="1" data-stt="true"></i>
|
||||
<b class="tree tree-drop" data="0">{$root->code}-{$root->name}</b>
|
||||
<div id="sub-tree-1" style="padding-left: 20px;">
|
||||
{\app\widgets\Department::widget(["pid"=>1])}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user