fix một số bug nhỏ
This commit is contained in:
parent
758b8d29c3
commit
02418afb11
|
@ -89,6 +89,7 @@ class AreaController extends Controller {
|
|||
$oldCode = $model->code;
|
||||
$model->name = $data["Name"];
|
||||
$model->code = $data["Code"];
|
||||
if ($model->pid != 0)
|
||||
$model->pid = $data["Pid"];
|
||||
$model->description = $data["Description"];
|
||||
$model->modified_at = time();
|
||||
|
|
|
@ -89,7 +89,7 @@ class DepartmentController extends Controller {
|
|||
$oldCode = $model->code;
|
||||
$model->name = $data["Name"];
|
||||
$model->code = $data["Code"];
|
||||
if ($model->pid != 1) {
|
||||
if ($model->pid != 0) {
|
||||
$model->pid = $data["Pid"] !== "" ? $data["Pid"] : 0;
|
||||
}
|
||||
$model->modified_at = time();
|
||||
|
|
|
@ -247,9 +247,9 @@ class DeviceController extends Controller {
|
|||
if (Yii::$app->request->post()) {
|
||||
$data = Yii::$app->request->post();
|
||||
$OldIpAddress = $model->ip_address;
|
||||
if ($OldIpAddress !== $data["Ip"]) {
|
||||
// if ($OldIpAddress !== $data["Ip"]) {
|
||||
$check = Device::findOne(['ip_address' => $data['Ip']]);
|
||||
if ($check)
|
||||
if ($check && $check->id != $id)
|
||||
return ["status" => false, "type" => "ip"];
|
||||
|
||||
$res = common::requestToCardService("/ModifyIPAddress", [
|
||||
|
@ -266,7 +266,7 @@ class DeviceController extends Controller {
|
|||
$model->save();
|
||||
return ["status" => true];
|
||||
}
|
||||
}
|
||||
// }
|
||||
return ["status" => true];
|
||||
} else {
|
||||
return [
|
||||
|
@ -282,9 +282,10 @@ class DeviceController extends Controller {
|
|||
public function actionSearch() {
|
||||
if (Yii::$app->request->post()) {
|
||||
Yii::$app->response->format = "json";
|
||||
$data = Yii::$app->request->post();
|
||||
$NetMask = "255.255.255.255";
|
||||
if (Yii::$app->request->post("SubnetMask") != "") {
|
||||
$NetMask = Yii::$app->request->post("SubnetMask");
|
||||
if ($data["SubnetMask"] != "" && $data["Checked"] !== "0") {
|
||||
$NetMask = $data["SubnetMask"];
|
||||
}
|
||||
$datas = json_decode(common::requestToCardService("/SearchDevice", ["NetMask" => $NetMask]), true);
|
||||
return [
|
||||
|
@ -445,6 +446,11 @@ class DeviceController extends Controller {
|
|||
"AuthorizeTimezoneId" => $value["schedule_id"],
|
||||
"AuthorizeDoorId" => $v->code
|
||||
];
|
||||
$UserAuthorizeInfosDelete[] = [
|
||||
"Pin" => "",
|
||||
"AuthorizeTimezoneId" => "",
|
||||
"AuthorizeDoorId" => ""
|
||||
];
|
||||
}
|
||||
if ($value["door_access_old"] != null) {
|
||||
if (in_array($v->id, $doorsOld) && !in_array($v->id, $doors)) {
|
||||
|
|
|
@ -54,12 +54,15 @@ class StaffSearch extends Staff {
|
|||
return $dataProvider;
|
||||
}
|
||||
|
||||
if ($this->department_id) {
|
||||
$m = new Department();
|
||||
$departmentChild = $m->departmentChilds($this->department_id);
|
||||
$query->andFilterWhere(["IN", "department_id", $departmentChild]);
|
||||
}
|
||||
// grid filtering conditions
|
||||
$query->andFilterWhere([
|
||||
'id' => $this->id,
|
||||
'code' => $this->code,
|
||||
'card_number' => $this->card_number,
|
||||
'department_id' => $this->department_id,
|
||||
'birthday' => $this->birthday,
|
||||
'date_in' => $this->date_in,
|
||||
'created_at' => $this->created_at,
|
||||
|
@ -70,6 +73,7 @@ class StaffSearch extends Staff {
|
|||
->andFilterWhere(['like', 'gender', $this->gender])
|
||||
->andFilterWhere(['like', 'email', $this->email])
|
||||
->andFilterWhere(['like', 'phone', $this->phone])
|
||||
->andFilterWhere(['like', 'code', $this->code])
|
||||
->andFilterWhere(['like', 'address', $this->address]);
|
||||
|
||||
return $dataProvider;
|
||||
|
|
|
@ -65,6 +65,13 @@
|
|||
'attribute' => 'modified_at',
|
||||
'value' => \app\helpers\CommonGrid::modifiedAt()
|
||||
]
|
||||
],
|
||||
'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}
|
||||
|
|
|
@ -46,6 +46,13 @@
|
|||
'contentOptions' => \app\helpers\StaffGrid::doorsHeader(),
|
||||
'value' => \app\helpers\StaffGrid::doors($doorsArray)
|
||||
]
|
||||
],
|
||||
'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}
|
|
@ -58,6 +58,13 @@
|
|||
'attribute' => 'card_register_time',
|
||||
'value' => \app\helpers\StaffGrid::cardRegisterTime()
|
||||
]
|
||||
],
|
||||
'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}
|
||||
|
|
|
@ -71,6 +71,13 @@
|
|||
'attribute' => 'modified_at',
|
||||
'value' => \app\helpers\CommonGrid::modifiedAt()
|
||||
]
|
||||
],
|
||||
'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}
|
||||
|
|
|
@ -104,6 +104,13 @@
|
|||
'headerOptions' => ['style' => 'width:10%'],
|
||||
'value' => \app\helpers\DeviceGrid::openDoor()
|
||||
]
|
||||
],
|
||||
'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}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
</div>
|
||||
<div class="row" style="padding: 0 10px;">
|
||||
<div class="col-md-6">
|
||||
<input type='checkbox' value='0' class='checkbox-use-subnetmask' checked="">
|
||||
<input type='checkbox' value='0' class='checkbox-use-subnetmask' name="checkbox-use-subnetmask" checked="">
|
||||
Sử dụng Subnet Mask
|
||||
<input type='text' value="255.255.255.255" name='SubnetMask'>
|
||||
</div>
|
||||
|
|
|
@ -108,6 +108,13 @@
|
|||
'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}
|
||||
|
|
|
@ -72,6 +72,13 @@
|
|||
'contentOptions' => ['class' => 'text-center'],
|
||||
'value' => \app\helpers\StaffGrid::manDay($staffLogs)
|
||||
]
|
||||
],
|
||||
'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}
|
||||
|
|
|
@ -50,6 +50,13 @@
|
|||
'attribute' => 'modified_at',
|
||||
'value' => \app\helpers\CommonGrid::modifiedAt()
|
||||
]
|
||||
],
|
||||
'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}
|
||||
|
|
|
@ -77,6 +77,13 @@
|
|||
'value' => \app\helpers\StaffGrid::dateIn()
|
||||
],
|
||||
'address'
|
||||
],
|
||||
'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}
|
||||
|
|
|
@ -13,7 +13,8 @@ function _search(e) {
|
|||
url: $(e).attr('data-href'),
|
||||
type: 'POST',
|
||||
data: {
|
||||
SubnetMask: $("input[name='SubnetMask']").val()
|
||||
SubnetMask: $("input[name='SubnetMask']").val(),
|
||||
Checked: $("input[name='checkbox-use-subnetmask']:checked").length
|
||||
},
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
|
|
|
@ -21,3 +21,8 @@
|
|||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="text-right">
|
||||
<button class="btn btn-default" data-dismiss="modal">
|
||||
<span class="fa fa-remove"></span> Đóng
|
||||
</button>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user