fix bug + thêm mẫu người mới trên thiết bị

This commit is contained in:
dongpd 2025-09-25 21:13:56 +07:00
parent 9960469007
commit aa28d09d93
5 changed files with 79 additions and 46 deletions

View File

@ -14,9 +14,21 @@ class ConfigController extends Controller {
public function init() { public function init() {
parent::init(); parent::init();
}
public function beforeAction($action) {
if (!parent::beforeAction($action)) {
return false;
}
Yii::$app->language = Yii::$app->session->get("language") ? Yii::$app->session->get("language")["name"] : Yii::$app->language; Yii::$app->language = Yii::$app->session->get("language") ? Yii::$app->session->get("language")["name"] : Yii::$app->language;
if (Yii::$app->user->isGuest)
return $this->redirect(['/site/login']); if (Yii::$app->user->isGuest) {
$this->redirect(['/site/login']);
return false;
}
return true;
} }
/** /**
@ -759,5 +771,4 @@ class ConfigController extends Controller {
return true; return true;
} }
} }
} }

View File

@ -705,12 +705,12 @@ class ListManagementController extends Controller {
$staff = ListManagement::findOne(['id' => $post['code']]); $staff = ListManagement::findOne(['id' => $post['code']]);
Yii::$app->response->format = "json"; Yii::$app->response->format = "json";
return [ return [
"name" => $staff->name, "name" => $staff ? $staff->name : "",
"gender" => $staff->gender, "gender" => $staff ? $staff->gender : "",
"birthday" => date("d/m/Y", $staff->birthday), "birthday" => $staff ? date("d/m/Y", $staff->birthday) : "",
"telephone" => $staff->telephone, "telephone" => $staff ? $staff->telephone : "",
"department" => $staff->address, "department" => $staff ? $staff->address : "",
"abbreviated_name" => $staff->abbreviated_name "abbreviated_name" => $staff ? $staff->abbreviated_name : ""
]; ];
} }
} }
@ -926,5 +926,4 @@ class ListManagementController extends Controller {
]; ];
} }
} }
} }

View File

@ -1,7 +1,7 @@
copy.src.files=false copy.src.files=false
copy.src.on.open=false copy.src.on.open=false
copy.src.target= copy.src.target=
remote.connection=BiFace-99bab6 remote.connection=tungbt-c365ac
remote.directory=/BiFace_Server_Lite remote.directory=/BiFace_Server_Lite
remote.upload=ON_SAVE remote.upload=ON_SAVE
run.as=REMOTE run.as=REMOTE

View File

@ -49,7 +49,7 @@
'format' => "raw", 'format' => "raw",
'contentOptions' => ['class' => 'text-center'], 'contentOptions' => ['class' => 'text-center'],
'headerOptions' => ['class' => 'text-center'], 'headerOptions' => ['class' => 'text-center'],
'value' => \app\helpers\CaptureLogsGrid::image() 'value' => \app\helpers\CaptureLogsGrid::image(true)
], ],
[ [
'attribute' => 'confidence', 'attribute' => 'confidence',

View File

@ -1,7 +1,24 @@
$(function () { $(function () {
common.dateTimePickerByClass("datepicker", "HH:mm DD/MM/YYYY"); common.dateTimePickerByClass("datepicker", "HH:mm DD/MM/YYYY");
common.dateTimePickerDay("birthday"); common.dateTimePickerDay("birthday");
$("#Code").select2(); $("#Code").select2({
tags: true,
createTag: function (params) {
return {
id: params.term,
text: params.term,
newOption: true
};
},
templateResult: function (data) {
var $result = $("<span></span>");
$result.text(data.text);
if (data.newOption) {
$result.append(" <em>(Thêm mới)</em>");
}
return $result;
}
});
$("input[name='AllData']").change(function () { $("input[name='AllData']").change(function () {
if ($('input[name=AllData]').is(':checked')) { if ($('input[name=AllData]').is(':checked')) {
window.location = $("input[name='URL']").val() + "?all=true" + "&from=" + $("input[name='From']").val() + "&to=" + $("input[name='To']").val(); window.location = $("input[name='URL']").val() + "?all=true" + "&from=" + $("input[name='From']").val() + "&to=" + $("input[name='To']").val();
@ -26,6 +43,12 @@ function _form(e) {
var confidence = JSON.parse($(e).attr("data-confidence")); var confidence = JSON.parse($(e).attr("data-confidence"));
$("#closest-img").attr("src", confidence.img != "" ? confidence.img : "/images/user2-160x160.jpg"); $("#closest-img").attr("src", confidence.img != "" ? confidence.img : "/images/user2-160x160.jpg");
$("#closest-name").html(confidence.name + " [" + confidence.score + "]"); $("#closest-name").html(confidence.name + " [" + confidence.score + "]");
clearData();
}
function clearData() {
$('#Code').val("").trigger('change');
} }
function _close() { function _close() {