Compare commits
57 Commits
BiFacePro2
...
LitePro_2.
| Author | SHA1 | Date | |
|---|---|---|---|
| d8fe80034e | |||
| 7c8014ca87 | |||
| 8918a58746 | |||
| 5a3074ff4a | |||
| 8ec330d21d | |||
| 0dce5700b5 | |||
| d4cc9654d8 | |||
| a26cf27d08 | |||
| c29719d73e | |||
| e4e080266a | |||
| 82a5b0d0ad | |||
| 21cc5f2050 | |||
| ea202ccc3f | |||
| 58a5522642 | |||
| 476f01098f | |||
| 5450124be9 | |||
| 8954a2fc25 | |||
| c8e0bb7795 | |||
| d6d7dc3719 | |||
| 982db2b6c8 | |||
| 1817771d88 | |||
| 33e439de8f | |||
| ac0588b711 | |||
| 3ecfd63b68 | |||
| aba8a19d75 | |||
| 9aa5b3b03a | |||
| c22ce35c48 | |||
| 7545b93ee7 | |||
| 11ecb518ef | |||
| 4a08ad05df | |||
| 45c9a9f4f1 | |||
| 64d9ad0b88 | |||
| 8758bb3692 | |||
| 26d240b3ad | |||
| bd43865bb2 | |||
| 74d8ab31bf | |||
| 2b3e30ad0e | |||
| ce6bcfabba | |||
| 3fd18b0d95 | |||
| e26819f1fb | |||
| 7d83a98e21 | |||
| 8dc6ca8104 | |||
| 7181c32bbf | |||
| c3d93f64c6 | |||
| e4829d7f78 | |||
| 61e82f68ca | |||
| 66357b25d5 | |||
| a27bf65303 | |||
| f9f32878cd | |||
| 22f6d0c158 | |||
| f41cb233c5 | |||
| 14467d53b5 | |||
| b207d54462 | |||
| 6c4190372e | |||
| 0b50249cdf | |||
| eb88996797 | |||
| 7057e5b35c |
23
assets/FaceComparisonAsset.php
Normal file
23
assets/FaceComparisonAsset.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace app\assets;
|
||||
|
||||
use yii\web\AssetBundle;
|
||||
|
||||
class FaceComparisonAsset extends AssetBundle {
|
||||
|
||||
public $basePath = '@webroot';
|
||||
public $baseUrl = '@web';
|
||||
public $css = [
|
||||
];
|
||||
public $js = [
|
||||
'js/face-comparison.js'
|
||||
];
|
||||
public $depends = [
|
||||
'yii\web\YiiAsset',
|
||||
'app\assets\AppAsset',
|
||||
'yii\jui\JuiAsset',
|
||||
'yii\bootstrap\BootstrapAsset',
|
||||
];
|
||||
|
||||
}
|
||||
@@ -2,7 +2,11 @@
|
||||
|
||||
return [
|
||||
'adminEmail' => 'admin@example.com',
|
||||
"maxLogs" => 100000,
|
||||
"maxPicture" => 5,
|
||||
"version" => "1.0.7"
|
||||
"type" => "BiFace", // BiFace, BiTable
|
||||
"maxLogs" => 50000,
|
||||
"maxPicture" => 9999,
|
||||
"version" => "1.0.7",
|
||||
"autoSyncLog" => false,
|
||||
"timeoutRequestServer" => 4,
|
||||
"test" => 6
|
||||
];
|
||||
|
||||
@@ -9,6 +9,7 @@ use yii\helpers\FileHelper;
|
||||
use app\models\CaptureLogs;
|
||||
use app\models\ListManagement;
|
||||
use app\models\common;
|
||||
use app\models\Schedule;
|
||||
|
||||
/**
|
||||
* CardController implements the CRUD actions for Card model.
|
||||
@@ -57,6 +58,7 @@ class ApiController extends Controller {
|
||||
|
||||
public function actionGetLogs() {
|
||||
if (Yii::$app->request->post()) {
|
||||
Yii::$app->response->format = "json";
|
||||
$post = Yii::$app->request->bodyParams;
|
||||
$time = date_format(date_create_from_format('Y-m-d H:i:s', $post['time']), 'U');
|
||||
$key = common::generateRandomString();
|
||||
@@ -69,9 +71,14 @@ class ApiController extends Controller {
|
||||
$totalsLogs = CaptureLogs::find()->count();
|
||||
if ($totalsLogs >= \Yii::$app->params['maxLogs']) {
|
||||
$lastLogs = CaptureLogs::find()->orderBy(["id" => SORT_ASC])->limit(1)->one();
|
||||
unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $lastLogs->image);
|
||||
@unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $lastLogs->image);
|
||||
$lastLogs->delete();
|
||||
}
|
||||
$lastLogs = CaptureLogs::find()->andWhere(["staff_id" => $post['id']])->orderBy(["time" => SORT_DESC])->limit(1)->one();
|
||||
if ($lastLogs && ($time - $lastLogs->time) < 1) {
|
||||
file_put_contents("log_connect_server.txt", "\n[" . date("H:i:s d/m/Y") . "] duplicate face " . $post["id"], FILE_APPEND);
|
||||
return ["status" => "success"];
|
||||
}
|
||||
|
||||
$model = new CaptureLogs();
|
||||
$logs = $model->create([
|
||||
@@ -84,9 +91,12 @@ class ApiController extends Controller {
|
||||
$ip = "https://dev-dc.beetai.com";
|
||||
if ($server_ip)
|
||||
$ip = $server_ip->data;
|
||||
if ($this->is_connected() && $logs) {
|
||||
$parseUrl = parse_url($ip);
|
||||
$host = $parseUrl['host'];
|
||||
$port = isset($parseUrl['port']) ? $parseUrl['port'] : 80;
|
||||
if ($this->is_connected($host, $port) && $logs) {
|
||||
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
||||
$id_camera = 209;
|
||||
$id_camera = 0;
|
||||
if ($device_id)
|
||||
$id_camera = intval($device_id->data);
|
||||
$logsInfo = CaptureLogs::findOne($logs);
|
||||
@@ -95,27 +105,33 @@ class ApiController extends Controller {
|
||||
$token = \app\models\SyncUrl::findOne(['key_config' => 'token']);
|
||||
if ($token)
|
||||
$tk = $token->data;
|
||||
$res = json_decode(file_get_contents($ip . "/api/oem/face_recognition?token=" . $tk, false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode([
|
||||
'image' => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName)),
|
||||
'camera_id' => strval($id_camera),
|
||||
'frametime' => date("Y-m-d H:i:s", $time),
|
||||
'idCard' => $staffInfo ? strval($staffInfo->code) : "0",
|
||||
'idObject' => $staffInfo ? $staffInfo->staff_id : "",
|
||||
"person_id" => "123",
|
||||
"timezone" => "+7"
|
||||
])
|
||||
]
|
||||
$data = [];
|
||||
$data[] = strval($id_camera); //camera_id
|
||||
$data[] = date("Y-m-d H:i:s", $time); //frametime
|
||||
$data[] = $staffInfo ? strval($staffInfo->code) : "0"; //idCard
|
||||
$data[] = $staffInfo ? $staffInfo->staff_id : ""; //idObject
|
||||
$data[] = "123"; //person_id
|
||||
$data[] = "+7"; //timezone
|
||||
$text = implode("|", $data);
|
||||
$res = json_decode(@file_get_contents($ip . "/api/box/face_recognition_auth_v2?token=" . $tk, false, stream_context_create([
|
||||
'http' => [
|
||||
'timeout' => Yii::$app->params['timeoutRequestServer'],
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode([
|
||||
'image' => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName)),
|
||||
'data' => common::rsaEncode($text),
|
||||
'confidence' => isset($post["confidence"]["percent1"]) ? $post["confidence"]["percent1"] : 0
|
||||
])
|
||||
]
|
||||
])), true);
|
||||
if ($res['status'] == 10000) {
|
||||
if ($res && $res['status'] == 10000) {
|
||||
$logsInfo->sync_status = 1;
|
||||
$logsInfo->save();
|
||||
} else {
|
||||
file_put_contents("log_connect_server.txt", "\n[" . date("H:i:s d/m/Y") . "] /api/box/face_recognition_auth_v2 timeout " . $ip, FILE_APPEND);
|
||||
}
|
||||
}
|
||||
Yii::$app->response->format = "json";
|
||||
return ["status" => "success"];
|
||||
}
|
||||
}
|
||||
@@ -146,6 +162,7 @@ class ApiController extends Controller {
|
||||
}
|
||||
$allFeatures[] = [
|
||||
"id" => $value->id,
|
||||
"object_id" => $value->staff_id,
|
||||
"name" => $this->convert_vi_to_en($value->name),
|
||||
"feature1" => $feature1,
|
||||
"feature2" => $feature2
|
||||
@@ -260,24 +277,24 @@ class ApiController extends Controller {
|
||||
]);
|
||||
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
|
||||
}
|
||||
$currentCache = json_decode(file_get_contents("http://localhost:2305/current-cache"), true);
|
||||
$currentCache = json_decode(@file_get_contents("http://localhost:2305/current-cache"), true);
|
||||
if ($updating->data === "true") {
|
||||
if ($currentCache['n_128'] == $currentCache['n_512']) {
|
||||
$updating->data = "false";
|
||||
$updating->save();
|
||||
$txt = "\n" . date("H:i:s d/m/Y") . " " . "success";
|
||||
file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
||||
// file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
||||
return ["status" => false];
|
||||
} else {
|
||||
$txt = "\n" . date("H:i:s d/m/Y") . " " . "updating";
|
||||
file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
||||
// file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
||||
return ["status" => false];
|
||||
}
|
||||
}
|
||||
|
||||
if ($currentCache['n_128'] == $currentCache['n_512']) {
|
||||
$txt = "\n" . date("H:i:s d/m/Y") . " " . "success";
|
||||
file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
||||
// file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
||||
return ["status" => false];
|
||||
}
|
||||
|
||||
@@ -295,12 +312,15 @@ class ApiController extends Controller {
|
||||
foreach ($images as $k => $v) {
|
||||
if (!isset($v['features512']) || (isset($v['features512']) && count($v['features512']) == 0)) {
|
||||
$start = $this->getCurrentTime();
|
||||
$features = json_decode(common::requestToEngine("/get-feature", [
|
||||
$features = common::requestToEngine("/get-feature", [
|
||||
"image_paths" => [
|
||||
["url" => "/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $v['url'], "type" => "raw"]
|
||||
],
|
||||
"type" => "512"
|
||||
]), true);
|
||||
]);
|
||||
if (!$features['status'])
|
||||
return ["status" => false];
|
||||
$features = json_decode($features['data'], true);
|
||||
$finish = $this->getCurrentTime();
|
||||
$temp[] = round(($finish - $start), 4);
|
||||
$v['features512'] = $features['results'][0]['feature512'];
|
||||
@@ -316,11 +336,11 @@ class ApiController extends Controller {
|
||||
$finish = $this->getCurrentTime();
|
||||
$processTime["updateDB"] = round(($finish - $start), 4);
|
||||
$txt = "\n" . json_encode($processTime);
|
||||
file_put_contents(date('Ymd') . ".txt", $txt, FILE_APPEND);
|
||||
// file_put_contents(date('Ymd') . ".txt", $txt, FILE_APPEND);
|
||||
}
|
||||
}
|
||||
|
||||
file_get_contents("http://localhost:2305/update-feature");
|
||||
@file_get_contents("http://localhost:2305/update-feature");
|
||||
$updating->data = "false";
|
||||
$updating->save();
|
||||
return ["status" => true];
|
||||
@@ -328,55 +348,71 @@ class ApiController extends Controller {
|
||||
|
||||
public function actionSync() {
|
||||
Yii::$app->response->format = "json";
|
||||
if ($this->is_connected()) {
|
||||
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||
$ip = "https://dev-dc.beetai.com";
|
||||
if ($server_ip)
|
||||
$ip = $server_ip->data;
|
||||
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||
$ip = "https://dev-dc.beetai.com";
|
||||
if ($server_ip)
|
||||
$ip = $server_ip->data;
|
||||
$parseUrl = parse_url($ip);
|
||||
$host = $parseUrl['host'];
|
||||
$port = isset($parseUrl['port']) ? $parseUrl['port'] : 80;
|
||||
if ($this->is_connected($host, $port)) {
|
||||
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
||||
$id_camera = 209;
|
||||
$id_camera = 0;
|
||||
if ($device_id)
|
||||
$id_camera = intval($device_id->data);
|
||||
$ls = CaptureLogs::find()->andWhere(['sync_status' => null])->all();
|
||||
|
||||
$tk = "";
|
||||
$token = \app\models\SyncUrl::findOne(['key_config' => 'token']);
|
||||
if ($token)
|
||||
$tk = $token->data;
|
||||
foreach ($ls as $key => $value) {
|
||||
$staffInfo = ListManagement::findOne($value->staff_id);
|
||||
$res = json_decode(file_get_contents($ip . "/api/oem/face_recognition?token=" . $tk, false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode([
|
||||
'image' => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value->image)),
|
||||
'camera_id' => strval($id_camera),
|
||||
'frametime' => date("Y-m-d H:i:s", $value->time),
|
||||
'idCard' => $staffInfo ? strval($staffInfo->code) : "0",
|
||||
'idObject' => $staffInfo ? $staffInfo->staff_id : "",
|
||||
"person_id" => "123",
|
||||
"timezone" => "+7"
|
||||
])
|
||||
]
|
||||
])), true);
|
||||
if ($res['status'] == 10000) {
|
||||
$value->sync_status = 1;
|
||||
$value->save();
|
||||
if (file_exists("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value->image)) {
|
||||
$staffInfo = ListManagement::findOne($value->staff_id);
|
||||
$confidence = json_decode($value->confidence, true);
|
||||
$data = [];
|
||||
$data[] = strval($id_camera); //camera_id
|
||||
$data[] = date("Y-m-d H:i:s", $value->time); //frametime
|
||||
$data[] = $staffInfo ? strval($staffInfo->code) : "0"; //idCard
|
||||
$data[] = $staffInfo ? $staffInfo->staff_id : ""; //idObject
|
||||
$data[] = "123"; //person_id
|
||||
$data[] = "+7"; //timezone
|
||||
$text = implode("|", $data);
|
||||
$res = json_decode(@file_get_contents($ip . "/api/box/face_recognition_auth_v2?token=" . $tk, false, stream_context_create([
|
||||
'http' => [
|
||||
'timeout' => Yii::$app->params['timeoutRequestServer'],
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode([
|
||||
'image' => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value->image)),
|
||||
'data' => common::rsaEncode($text),
|
||||
'confidence' => isset($confidence['percent1']) ? floatval($confidence['percent1']) : 0
|
||||
])
|
||||
]
|
||||
])), true);
|
||||
if ($res && $res['status'] == 10000) {
|
||||
$value->sync_status = 1;
|
||||
$value->save();
|
||||
} else {
|
||||
file_put_contents("log_connect_server.txt", "\n[" . date("H:i:s d/m/Y") . "][SYNC] face_recognition_auth_v2 timeout " . $ip, FILE_APPEND);
|
||||
}
|
||||
} else {
|
||||
$value->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
return ["status" => true];
|
||||
}
|
||||
|
||||
function is_connected($ip = "google.com") {
|
||||
$connected = @fsockopen($ip, 80);
|
||||
//website, port (try 80 or 443)
|
||||
function is_connected($host, $port) {
|
||||
$connected = @fsockopen($host, $port);
|
||||
//website, port (try 80 or 443)
|
||||
if ($connected) {
|
||||
$is_conn = true; //action when connected
|
||||
fclose($connected);
|
||||
// file_put_contents("log_connect_server.txt", "\n" . date("H:i:s d/m/Y") . " connected " . $host . ":" . $port, FILE_APPEND);
|
||||
} else {
|
||||
$is_conn = false; //action in connection failure
|
||||
file_put_contents("log_connect_server.txt", "\n[" . date("H:i:s d/m/Y") . "] disconnected " . $host . ":" . $port, FILE_APPEND);
|
||||
}
|
||||
return $is_conn;
|
||||
}
|
||||
@@ -400,7 +436,7 @@ class ApiController extends Controller {
|
||||
}
|
||||
|
||||
public function actionCurrentCache() {
|
||||
return file_get_contents("http://localhost:2305/current-cache");
|
||||
return @file_get_contents("http://localhost:2305/current-cache");
|
||||
}
|
||||
|
||||
public function actionSaveToken() {
|
||||
@@ -471,15 +507,18 @@ class ApiController extends Controller {
|
||||
}
|
||||
|
||||
public function actionTest() {
|
||||
// $updating = \app\models\SyncUrl::findOne(['key_config' => 'token']);
|
||||
$updating = \app\models\SyncUrl::find()->all();
|
||||
foreach ($updating as $key => $value) {
|
||||
echo $value->key_config . " " . $value->data . "<br>";
|
||||
}
|
||||
exit();
|
||||
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||
$ip = "https://dev-dc.beetai.com";
|
||||
if ($server_ip)
|
||||
$ip = $server_ip->data;
|
||||
$parseUrl = parse_url($ip);
|
||||
$host = $parseUrl['host'];
|
||||
$port = isset($parseUrl['port']) ? $parseUrl['port'] : 80;
|
||||
$this->is_connected($host, $port);
|
||||
}
|
||||
|
||||
public function actionReGenFeature() {
|
||||
\app\models\SyncUrl::deleteAll(['key_config' => 'log_process_status']);
|
||||
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
|
||||
if (!$updating) {
|
||||
$model = new \app\models\SyncUrl();
|
||||
@@ -504,14 +543,36 @@ class ApiController extends Controller {
|
||||
}
|
||||
|
||||
public function actionCheckLogs() {
|
||||
set_time_limit(5000);
|
||||
Yii::$app->response->format = "json";
|
||||
$logProcessStatus = \app\models\SyncUrl::findOne(['key_config' => 'log_process_status']);
|
||||
if (!$logProcessStatus) {
|
||||
$model = new \app\models\SyncUrl();
|
||||
$model->create(['key_config' => 'log_process_status', 'data' => json_encode(["status" => true, "time" => time()])]);
|
||||
$logProcessStatus = \app\models\SyncUrl::findOne(['key_config' => 'log_process_status']);
|
||||
} else {
|
||||
$processStatus = json_decode($logProcessStatus->data, true);
|
||||
if ($processStatus['status']) {
|
||||
if (time() - $processStatus['time'] < 60 * 3) {
|
||||
if (Yii::$app->params['autoSyncLog'])
|
||||
file_put_contents("logs.txt", "CHECK LOGS PROCESSING\n", FILE_APPEND);
|
||||
return ["data" => "check logs processing"];
|
||||
}
|
||||
} else {
|
||||
$logProcessStatus->data = json_encode(["status" => true, "time" => time()]);
|
||||
$logProcessStatus->save();
|
||||
}
|
||||
}
|
||||
|
||||
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||
$ip = "https://dev-dc.beetai.com";
|
||||
if ($server_ip)
|
||||
$ip = $server_ip->data;
|
||||
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
||||
$id_camera = 209;
|
||||
if ($device_id)
|
||||
$id_camera = intval($device_id->data);
|
||||
if (!$device_id)
|
||||
return ["data" => "check logs fail"];
|
||||
|
||||
$id_camera = intval($device_id->data);
|
||||
|
||||
$datas = json_decode(file_get_contents($ip . "/api/model/get_log_model", false, stream_context_create([
|
||||
'http' => [
|
||||
@@ -522,54 +583,83 @@ class ApiController extends Controller {
|
||||
])
|
||||
]
|
||||
])), true);
|
||||
if (Yii::$app->params['autoSyncLog'])
|
||||
file_put_contents("logs.txt", "START CHECK LOGS\n", FILE_APPEND);
|
||||
if ($datas['status'] == 10000) {
|
||||
$logs = $datas['data'];
|
||||
$infomation = [];
|
||||
$fault_information = [];
|
||||
$count = 0;
|
||||
foreach ($logs as $key => $value) {
|
||||
$count++;
|
||||
$start = $this->getCurrentTime();
|
||||
$result = true;
|
||||
if ($value['action'] == "insert_image")
|
||||
$this->insertImage($value['images'][0], $value['id'], $value['files_name'][0]);
|
||||
$result = $this->insertImage($value['images'][0], $value['id'], $value['files_name'][0]);
|
||||
|
||||
if ($value['action'] == "remove_image")
|
||||
$this->removeImage($value['id'], $value['files_name'][0]);
|
||||
$result = $this->removeImage($value['id'], $value['files_name'][0]);
|
||||
|
||||
if ($value['action'] == "insert_info")
|
||||
$this->insertInfo($value);
|
||||
$result = $this->insertInfo($value);
|
||||
|
||||
if ($value['action'] == "remove_info")
|
||||
$this->removeInfo($value);
|
||||
$result = $this->removeInfo($value);
|
||||
|
||||
if ($value['action'] == "insert_door_open")
|
||||
$result = $this->insertSchedule($value);
|
||||
|
||||
if ($value['action'] == "remove_door_open")
|
||||
$result = $this->removeSchedule($value);
|
||||
|
||||
if ($value['action'] == "reset_all") {
|
||||
\Yii::$app->db->createCommand()->truncateTable('capture_logs')->execute();
|
||||
\Yii::$app->db->createCommand()->truncateTable('list_management')->execute();
|
||||
array_map('unlink', glob("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/*.*"));
|
||||
}
|
||||
$finish = $this->getCurrentTime();
|
||||
$processTime = round(($finish - $start), 4);
|
||||
if (Yii::$app->params['autoSyncLog'])
|
||||
file_put_contents("logs.txt", $count . "\t" . $value['action'] . "\t" . $value['files_name'][0] . "\t" . ($result ? "true" : "false") . "\t" . $processTime . "\t" . $value['name'] . "\n", FILE_APPEND);
|
||||
|
||||
if (in_array($value['action'], ['insert_image', 'remove_image', 'insert_info', 'remove_info', 'reset_all'])) {
|
||||
$infomation[] = [
|
||||
"obj_Log" => $value['obj_Log'],
|
||||
"action" => $value['action'],
|
||||
"idCamera" => $id_camera
|
||||
];
|
||||
if (in_array($value['action'], ['insert_image', 'remove_image', 'insert_info', 'remove_info', 'reset_all', 'insert_door_open', 'remove_door_open'])) {
|
||||
if ($result)
|
||||
$infomation[] = [
|
||||
"obj_Log" => $value['obj_Log'],
|
||||
"action" => $value['action'],
|
||||
"idCamera" => $id_camera
|
||||
];
|
||||
else
|
||||
$fault_information[] = [
|
||||
"obj_Log" => $value['obj_Log'],
|
||||
"action" => $value['action'],
|
||||
"idCamera" => $id_camera
|
||||
];
|
||||
}
|
||||
}
|
||||
if (count($infomation) > 0)
|
||||
if (count($infomation) > 0 || count($fault_information) > 0) {
|
||||
file_get_contents($ip . "/api/model/set_log_model", false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode([
|
||||
"infomation" => $infomation
|
||||
"infomation" => $infomation,
|
||||
"fault_information" => $fault_information
|
||||
])
|
||||
]
|
||||
]));
|
||||
file_get_contents("http://localhost:2305/update-feature?total=" . ListManagement::find()->count());
|
||||
@file_get_contents("http://localhost:2305/update-feature?total=" . ListManagement::find()->count());
|
||||
}
|
||||
}
|
||||
Yii::$app->response->format = "json";
|
||||
$logProcessStatus->data = json_encode(["status" => false, "time" => time()]);
|
||||
$logProcessStatus->save();
|
||||
return ["data" => "check logs"];
|
||||
}
|
||||
|
||||
public function insertImage($image, $staff_id, $files_name) {
|
||||
$model = ListManagement::findOne(['staff_id' => $staff_id]);
|
||||
if (!$model)
|
||||
return false;
|
||||
|
||||
$RootFolder = Yii::getAlias('@webroot') . "/data/uploads";
|
||||
$targetPath = $RootFolder . "/face";
|
||||
@@ -597,12 +687,18 @@ class ApiController extends Controller {
|
||||
if (!$this->resizeImg($img, $fileTarget)) {
|
||||
file_put_contents($fileTarget, $img);
|
||||
}
|
||||
$features = json_decode(common::requestToEngine("/get-feature", [
|
||||
$features = common::requestToEngine("/get-feature", [
|
||||
"image_paths" => [
|
||||
["url" => "/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName, "type" => "raw"]
|
||||
],
|
||||
"type" => "128"
|
||||
]), true);
|
||||
]);
|
||||
if (!$features['status']) {
|
||||
if (Yii::$app->params['autoSyncLog'])
|
||||
file_put_contents("logs.txt", "[ERROR] extract feature " . json_encode($features) . "\n", FILE_APPEND);
|
||||
return false;
|
||||
}
|
||||
$features = json_decode($features['data'], true);
|
||||
$ft[] = [
|
||||
"serverKey" => $files_name,
|
||||
"url" => $fileName,
|
||||
@@ -612,24 +708,34 @@ class ApiController extends Controller {
|
||||
];
|
||||
$model->image = json_encode($ft);
|
||||
$model->last_modified = time();
|
||||
$model->save();
|
||||
return $model->save();
|
||||
} else {
|
||||
if (Yii::$app->params['autoSyncLog'])
|
||||
file_put_contents("logs.txt", "[ERROR] image error" . $image . "\n", FILE_APPEND);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (Yii::$app->params['autoSyncLog'])
|
||||
file_put_contents("logs.txt", "[ERROR] file exists" . $files_name . "\n", FILE_APPEND);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function removeImage($staff_id, $files_name) {
|
||||
$model = ListManagement::findOne(['staff_id' => $staff_id]);
|
||||
if (!$model)
|
||||
return false;
|
||||
$images = json_decode($model->image, true);
|
||||
$ft = [];
|
||||
foreach ($images as $key => $value) {
|
||||
if ($value['serverKey'] !== $files_name)
|
||||
if (isset($value['serverKey']) && $value['serverKey'] !== $files_name)
|
||||
$ft[] = $value;
|
||||
else
|
||||
unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value['url']);
|
||||
@unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value['url']);
|
||||
}
|
||||
$model->image = json_encode($ft);
|
||||
$model->last_modified = time();
|
||||
$model->save();
|
||||
return $model->save();
|
||||
}
|
||||
|
||||
public function insertInfo($data) {
|
||||
@@ -656,6 +762,7 @@ class ApiController extends Controller {
|
||||
'abbreviated_name' => $data['abbreviated_name'],
|
||||
]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function removeInfo($data) {
|
||||
@@ -663,11 +770,11 @@ class ApiController extends Controller {
|
||||
if ($model) {
|
||||
$images = json_decode($model->image, true);
|
||||
foreach ($images as $k => $v) {
|
||||
unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $v['url']);
|
||||
@unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $v['url']);
|
||||
}
|
||||
$model->delete();
|
||||
}
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function resizeImg($img, $fileTarget) {
|
||||
@@ -687,4 +794,92 @@ class ApiController extends Controller {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function insertSchedule($data) {
|
||||
$model = new Schedule();
|
||||
$info = ListManagement::findOne(['staff_id' => $data['id']]);
|
||||
$schedule = Schedule::findOne(['staff_id' => $info->id, 'id_door_calendar' => $data['id_door_calendar']]);
|
||||
if ($schedule) {
|
||||
$schedule->from_time = $data['time_in'];
|
||||
$schedule->to_time = $data['time_out'];
|
||||
$schedule->from_date = $this->formatDateSchedule($data['day_in']);
|
||||
$schedule->to_date = $this->formatDateSchedule($data['day_out']);
|
||||
$schedule->date_of_week = $this->formatDayOfWeekSchedule($data['day_of_week']);
|
||||
return $schedule->save();
|
||||
} else {
|
||||
return $model->create([
|
||||
'staff_id' => $info->id,
|
||||
'from_time' => $data['time_in'],
|
||||
'to_time' => $data['time_out'],
|
||||
'from_date' => $this->formatDateSchedule($data['day_in']),
|
||||
'to_date' => $this->formatDateSchedule($data['day_out']),
|
||||
'date_of_week' => $this->formatDayOfWeekSchedule($data['day_of_week']),
|
||||
'id_door_calendar' => $data['id_door_calendar']
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function removeSchedule($data) {
|
||||
$info = ListManagement::findOne(['staff_id' => $data['id']]);
|
||||
if ($info) {
|
||||
$schedule = \app\models\Schedule::findOne([
|
||||
'id_door_calendar' => $data['id_door_calendar'],
|
||||
'staff_id' => $info->id
|
||||
]);
|
||||
if ($schedule)
|
||||
$schedule->delete();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function formatDateSchedule($date) {
|
||||
$temp = explode(" ", $date);
|
||||
$parse = explode("-", $temp[0]);
|
||||
return $parse[2] . "/" . $parse[1] . "/" . $parse[0];
|
||||
}
|
||||
|
||||
public function formatDayOfWeekSchedule($dayOfWeek) {
|
||||
$days = [];
|
||||
$temp = explode("|", $dayOfWeek);
|
||||
foreach ($temp as $key => $value) {
|
||||
if ($value != "")
|
||||
$days[] = intval($value) + 2;
|
||||
}
|
||||
return implode(",", $days);
|
||||
}
|
||||
|
||||
public function actionCheckOpenDoor() {
|
||||
if (Yii::$app->request->post()) {
|
||||
$post = Yii::$app->request->bodyParams;
|
||||
$info = ListManagement::findOne(["staff_id" => $post["object_id"]]);
|
||||
$timeGet = date_format(date_create_from_format('Y-m-d H:i:s', $post['timeget']), 'U');
|
||||
$openDoor = 0;
|
||||
if ($info) {
|
||||
$schedules = Schedule::find()->andWhere(["staff_id" => $info->id])->all();
|
||||
foreach ($schedules as $key => $value) {
|
||||
$fromDate = date_format(date_create_from_format('H:i:s d/m/Y', "00:00:00 " . $value->from_date), 'U');
|
||||
$toDate = date_format(date_create_from_format('H:i:s d/m/Y', "23:59:59 " . $value->to_date), 'U');
|
||||
if ($timeGet > $fromDate && $timeGet < $toDate) {
|
||||
$dateOfWeek = explode(",", $value->date_of_week);
|
||||
$weekDay = intval(date("w", $timeGet)) + 1;
|
||||
if ($weekDay == 1)
|
||||
$weekDay = 8;
|
||||
if (in_array($weekDay, $dateOfWeek)) {
|
||||
$fromTime = date_format(date_create_from_format('H:i:s d/m/Y', $value->from_time . ":00 " . date("d/m/Y", $timeGet)), 'U');
|
||||
$toTime = date_format(date_create_from_format('H:i:s d/m/Y', $value->to_time . ":59 " . date("d/m/Y", $timeGet)), 'U');
|
||||
if ($timeGet > $fromTime && $timeGet < $toTime)
|
||||
$openDoor = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Yii::$app->response->format = "json";
|
||||
return [
|
||||
"status" => 10000,
|
||||
"data" => [
|
||||
"open_door" => $openDoor
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,9 +15,13 @@ use app\models\ListManagement;
|
||||
*/
|
||||
class CaptureLogsController extends Controller {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function init() {
|
||||
parent::init();
|
||||
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']);
|
||||
}
|
||||
|
||||
public function behaviors() {
|
||||
return [
|
||||
'verbs' => [
|
||||
@@ -37,7 +41,7 @@ class CaptureLogsController extends Controller {
|
||||
$t = date_format(date_create_from_format('H:i d/m/Y', $to), 'U');
|
||||
}
|
||||
|
||||
$this->view->title = "Lịch sử hệ thống";
|
||||
$this->view->title = Yii::t("app", "LICH_SU_HE_THONG");
|
||||
$searchModel = new CaptureLogsSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
if (!$all)
|
||||
@@ -63,7 +67,9 @@ class CaptureLogsController extends Controller {
|
||||
'f' => $f,
|
||||
't' => $t,
|
||||
// 'idAuto' => $idAuto,
|
||||
"staffArray" => ListManagement::staffArray()
|
||||
"staffArray" => ListManagement::staffArray(),
|
||||
"typeArray" => ListManagement::typeArray(),
|
||||
"genderArray" => ListManagement::genderArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -108,7 +114,42 @@ class CaptureLogsController extends Controller {
|
||||
return $model;
|
||||
}
|
||||
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
throw new NotFoundHttpException(Yii::t("app", "KHONG_TIM_THAY_THONG_TIN"));
|
||||
}
|
||||
|
||||
public function actionFaceComparison() {
|
||||
if (Yii::$app->request->post()) {
|
||||
$post = Yii::$app->request->post();
|
||||
Yii::$app->response->format = "json";
|
||||
$results = json_decode(file_get_contents("http://192.168.1.43:2305/compare", false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode([
|
||||
"type" => "base64",
|
||||
"img0" => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web" . $post['face1'])),
|
||||
"img1" => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web" . $post['face2']))
|
||||
])
|
||||
]
|
||||
])), true);
|
||||
return [
|
||||
"type1" => number_format($results['type1']['percent'] * 100, 2),
|
||||
"type2" => number_format($results['type2']['percent'] * 100, 2)
|
||||
];
|
||||
} else {
|
||||
$this->view->title = Yii::t("app", "SO_SANH_MAT");
|
||||
return $this->render('face-comparison', [
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function actionUploadFace() {
|
||||
if (Yii::$app->request->post()) {
|
||||
$post = Yii::$app->request->post();
|
||||
$model = new \app\models\UploadForm();
|
||||
$url = $model->UploadGlobal("image" . $post['imageIndex'], ["PNG", "JPG", "JPEG", "GIF"], "comparison");
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ class ConfigController extends Controller {
|
||||
|
||||
public function init() {
|
||||
parent::init();
|
||||
if (Yii::$app->user->isGuest) {
|
||||
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']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,12 +157,10 @@ class ConfigController extends Controller {
|
||||
]
|
||||
];
|
||||
|
||||
/**
|
||||
* Lists all Script models.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionIndex() {
|
||||
$this->view->title = "Cấu hình máy chủ";
|
||||
$this->view->title = Yii::t("app", "CAU_HINH_MAY_CHU");
|
||||
if (Yii::$app->params['type'] != "BiFace")
|
||||
return $this->redirect(['cau-hinh-ip']);
|
||||
$options = [
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
@@ -178,7 +176,8 @@ class ConfigController extends Controller {
|
||||
}
|
||||
return $this->render('index', [
|
||||
"servermqtt" => $servermqtt === "" ? $ip . ":1883" : $servermqtt,
|
||||
"url" => isset($temp[2]) ? $temp[2] : $ip . ":5001"
|
||||
"url" => isset($temp[2]) ? $temp[2] : $ip . ":5001",
|
||||
"menu" => $this->renderPartial("menu", ["tab" => "server_config"])
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -262,7 +261,9 @@ class ConfigController extends Controller {
|
||||
]));
|
||||
return true;
|
||||
} else {
|
||||
$this->view->title = "Cấu hình nhận diện";
|
||||
$this->view->title = Yii::t("app", "CAU_HINH_NHAN_DIEN");
|
||||
if (Yii::$app->params['type'] != "BiFace")
|
||||
return $this->redirect(['cau-hinh-ip']);
|
||||
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
@@ -294,13 +295,56 @@ class ConfigController extends Controller {
|
||||
$config_json = json_decode($checkConfig['data'], true);
|
||||
|
||||
return $this->render('config', [
|
||||
"config_json" => \app\widgets\ConfigTree::widget(['configLists' => $config_json, 'isRoot' => true, 'parent_id' => 'node', 'parent_key' => ''])
|
||||
"config_json" => \app\widgets\ConfigTree::widget(['configLists' => $config_json, 'isRoot' => true, 'parent_id' => 'node', 'parent_key' => '']),
|
||||
"menu" => $this->renderPartial("menu", ["tab" => "engine_config"])
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function actionReset() {
|
||||
Yii::$app->response->format = "json";
|
||||
if (Yii::$app->request->post()) {
|
||||
if (Yii::$app->request->post("deleteDB") === "true") {
|
||||
\Yii::$app->db->createCommand()->truncateTable('capture_logs')->execute();
|
||||
\Yii::$app->db->createCommand()->truncateTable('list_management')->execute();
|
||||
array_map('unlink', glob("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/*.*"));
|
||||
try {
|
||||
file_get_contents("http://localhost:2305/update-feature");
|
||||
} catch (\Exception $exc) {
|
||||
|
||||
}
|
||||
\app\models\SyncUrl::deleteAll(['key_config' => 'log_process_status']);
|
||||
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||
$ip = "https://dev-dc.beetai.com";
|
||||
if ($server_ip)
|
||||
$ip = $server_ip->data;
|
||||
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
||||
$id_camera = 0;
|
||||
if ($device_id)
|
||||
$id_camera = intval($device_id->data);
|
||||
try {
|
||||
$res = json_decode(file_get_contents($ip . "/api/model/reset_log_model", false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode([
|
||||
"idCamera" => $id_camera,
|
||||
"isCloud" => 0
|
||||
])
|
||||
]
|
||||
])), true);
|
||||
if ($res['status'] != 10000)
|
||||
return [
|
||||
"status" => false,
|
||||
"btnText" => Yii::t("app", "THU_LAI")
|
||||
];
|
||||
} catch (Exception $ex) {
|
||||
return [
|
||||
"status" => false,
|
||||
"btnText" => Yii::t("app", "THU_LAI")
|
||||
];
|
||||
}
|
||||
}
|
||||
if (Yii::$app->request->post("resetDevice") === "true") {
|
||||
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
||||
'http' => [
|
||||
@@ -332,43 +376,14 @@ class ConfigController extends Controller {
|
||||
]
|
||||
]));
|
||||
}
|
||||
if (Yii::$app->request->post("deleteDB") === "true") {
|
||||
\Yii::$app->db->createCommand()->truncateTable('capture_logs')->execute();
|
||||
\Yii::$app->db->createCommand()->truncateTable('list_management')->execute();
|
||||
array_map('unlink', glob("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/*.*"));
|
||||
try {
|
||||
file_get_contents("http://localhost:2305/update-feature");
|
||||
} catch (\Exception $exc) {
|
||||
|
||||
}
|
||||
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||
$ip = "https://dev-dc.beetai.com";
|
||||
if ($server_ip)
|
||||
$ip = $server_ip->data;
|
||||
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
||||
$id_camera = 209;
|
||||
if ($device_id)
|
||||
$id_camera = intval($device_id->data);
|
||||
try {
|
||||
file_get_contents($ip . "/api/model/reset_log_model", false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode([
|
||||
"idCamera" => $id_camera,
|
||||
"isCloud" => 0
|
||||
])
|
||||
]
|
||||
]));
|
||||
} catch (Exception $ex) {
|
||||
|
||||
}
|
||||
}
|
||||
return Url::to(['/config']);
|
||||
} else {
|
||||
Yii::$app->response->format = "json";
|
||||
\app\models\SyncUrl::deleteAll(['IN', 'key_config', ['server_api', 'device_id']]);
|
||||
return [
|
||||
"title" => "Reset thiết bị",
|
||||
"status" => true,
|
||||
"url" => Url::to(['/config/cau-hinh-thiet-bi'])
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
"title" => Yii::t("app", "RESET_THIET_BI"),
|
||||
"form" => $this->renderPartial("reset")
|
||||
];
|
||||
}
|
||||
@@ -387,7 +402,7 @@ class ConfigController extends Controller {
|
||||
return ['status' => false, 'text' => 'error'];
|
||||
|
||||
if ($tempConfig['data'] === "")
|
||||
return ['status' => false, 'text' => 'Cấu hình ip chưa đúng!'];
|
||||
return ['status' => false, 'text' => Yii::t("app", "CAU_HINH_IP_CHUA_DUNG")];
|
||||
|
||||
$engineConfig = json_decode($tempConfig['data'], true);
|
||||
if (count($engineConfig['data']['engines']) == 0)
|
||||
@@ -406,16 +421,47 @@ class ConfigController extends Controller {
|
||||
if (!$checkConfig['status']) {
|
||||
return ['status' => false, 'text' => ''];
|
||||
} else {
|
||||
return ['status' => true, 'url' => Url::to(['cau-hinh-nhan-dien'])];
|
||||
return ['status' => true, 'url' => Url::to(['cau-hinh-thiet-bi'])];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function actionCauHinhThietBi() {
|
||||
$this->view->title = "Cấu hình thiết bị";
|
||||
$this->view->title = Yii::t("app", "CAU_HINH_THIET_BI");
|
||||
if (Yii::$app->params['type'] != "BiFace")
|
||||
return $this->redirect(['cau-hinh-ip']);
|
||||
|
||||
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST"
|
||||
]
|
||||
])), true);
|
||||
if (!$tempConfig['status'])
|
||||
return $this->redirect(['/config']);
|
||||
|
||||
$engineConfig = json_decode($tempConfig['data'], true);
|
||||
|
||||
$server_api = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||
if (!$server_api) {
|
||||
$model = new \app\models\SyncUrl();
|
||||
$model->create([
|
||||
'key_config' => 'server_api',
|
||||
'data' => $engineConfig['data']['engines'][0]['url']
|
||||
]);
|
||||
}
|
||||
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
||||
if (!$device_id) {
|
||||
$model = new \app\models\SyncUrl();
|
||||
$model->create([
|
||||
'key_config' => 'device_id',
|
||||
'data' => strval($engineConfig['data']['engines'][0]['id'])
|
||||
]);
|
||||
}
|
||||
return $this->render('device', [
|
||||
"server_api" => \app\models\SyncUrl::findOne(['key_config' => 'server_api']),
|
||||
"device_id" => \app\models\SyncUrl::findOne(['key_config' => 'device_id'])
|
||||
"device_id" => \app\models\SyncUrl::findOne(['key_config' => 'device_id']),
|
||||
"menu" => $this->renderPartial("menu", ["tab" => "device_config"])
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -449,4 +495,97 @@ class ConfigController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public $subnet = [
|
||||
"0.0.0.0" => "/0",
|
||||
"128.0.0.0" => "/1",
|
||||
"192.0.0.0" => "/2",
|
||||
"224.0.0.0" => "/3",
|
||||
"240.0.0.0" => "/4",
|
||||
"248.0.0.0" => "/5",
|
||||
"252.0.0.0" => "/6",
|
||||
"254.0.0.0" => "/7",
|
||||
"255.0.0.0" => "/8",
|
||||
"255.128.0.0" => "/9",
|
||||
"255.192.0.0" => "/10",
|
||||
"255.224.0.0" => "/11",
|
||||
"255.240.0.0" => "/12",
|
||||
"255.248.0.0" => "/13",
|
||||
"255.252.0.0" => "/14",
|
||||
"255.254.0.0" => "/15",
|
||||
"255.255.0.0" => "/16",
|
||||
"255.255.128.0" => "/17",
|
||||
"255.255.192.0" => "/18",
|
||||
"255.255.224.0" => "/19",
|
||||
"255.255.240.0" => "/20",
|
||||
"255.255.248.0" => "/21",
|
||||
"255.255.252.0" => "/22",
|
||||
"255.255.254.0" => "/23",
|
||||
"255.255.255.0" => "/24",
|
||||
"255.255.255.128" => "/25",
|
||||
"255.255.255.192" => "/26",
|
||||
"255.255.255.224" => "/27",
|
||||
"255.255.255.240" => "/28",
|
||||
"255.255.255.248" => "/29",
|
||||
"255.255.255.252" => "/30",
|
||||
"255.255.255.254" => "/31",
|
||||
"255.255.255.255" => "/32"
|
||||
];
|
||||
|
||||
public function actionCauHinhIp() {
|
||||
if (Yii::$app->request->post()) {
|
||||
Yii::$app->response->format = "json";
|
||||
$post = Yii::$app->request->post();
|
||||
if (!$post['dhcp'] && !isset($this->subnet[$post['subnet_mask']]))
|
||||
return ["status" => false];
|
||||
$post['subnet_mask'] = isset($this->subnet[$post['subnet_mask']]) ? $this->subnet[$post['subnet_mask']] : "";
|
||||
$options = [
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode($post),
|
||||
]
|
||||
];
|
||||
json_decode(@file_get_contents("http://localhost:4004/SetIP", false, stream_context_create($options)), true);
|
||||
return ["status" => true, "url" => "http://" . $post['device_ip']];
|
||||
} else {
|
||||
$this->view->title = Yii::t("app", "CAU_HINH_IP");
|
||||
$options = [
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST"
|
||||
]
|
||||
];
|
||||
$network = json_decode(@file_get_contents("http://localhost:4004/Network", false, stream_context_create($options)), true);
|
||||
return $this->render('ip', [
|
||||
"menu" => $this->renderPartial("menu", ["tab" => "ip_config"]),
|
||||
"network" => $network
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function actionSystemInfo() {
|
||||
if (Yii::$app->request->isAjax) {
|
||||
Yii::$app->response->format = "json";
|
||||
$options = [
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST"
|
||||
]
|
||||
];
|
||||
@file_get_contents("http://localhost:4004/Reboot", false, stream_context_create($options));
|
||||
return ["status" => true];
|
||||
} else {
|
||||
$this->view->title = Yii::t("app", "THONG_TIN_HE_THONG");
|
||||
$version = \app\models\SyncUrl::findOne(['key_config' => 'version']);
|
||||
$info = $version ? $version->data : "Pro 4.27.13 (Jul 19 2021 11:49)";
|
||||
$temp = explode("(", $info);
|
||||
$ver = trim($temp[0]);
|
||||
$build_time = str_replace(")", "", $temp[1]);
|
||||
return $this->render('system-info', [
|
||||
"version" => $ver,
|
||||
"build_time" => $build_time
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,9 +17,13 @@ use app\models\common;
|
||||
*/
|
||||
class ControlLogsController extends Controller {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function init() {
|
||||
parent::init();
|
||||
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']);
|
||||
}
|
||||
|
||||
public function behaviors() {
|
||||
return [
|
||||
'verbs' => [
|
||||
@@ -39,7 +43,7 @@ class ControlLogsController extends Controller {
|
||||
$t = date_format(date_create_from_format('H:i d/m/Y', $to), 'U');
|
||||
}
|
||||
|
||||
$this->view->title = "Danh sách nhận diện";
|
||||
$this->view->title = Yii::t("app", "DANH_SACH_NHAN_DIEN");
|
||||
$searchModel = new CaptureLogsSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
$dataProvider->query->andWhere(["<>", "capture_logs.staff_id", 0]);
|
||||
@@ -56,11 +60,10 @@ class ControlLogsController extends Controller {
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
'statusArray' => CaptureLogs::$statusArray,
|
||||
'f' => $f,
|
||||
't' => $t,
|
||||
'typeArray' => ListManagement::$typeArray,
|
||||
'genderArray' => ListManagement::$genderArray
|
||||
'typeArray' => ListManagement::typeArray(),
|
||||
'genderArray' => ListManagement::genderArray()
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -69,7 +72,7 @@ class ControlLogsController extends Controller {
|
||||
return $model;
|
||||
}
|
||||
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
throw new NotFoundHttpException(Yii::t("app", "KHONG_TIM_THAY_THONG_TIN"));
|
||||
}
|
||||
|
||||
public function actionUseFeature($id) {
|
||||
@@ -81,7 +84,7 @@ class ControlLogsController extends Controller {
|
||||
$url = $model->image;
|
||||
$images = json_decode($listManagement->image, true);
|
||||
if (count($images) >= \Yii::$app->params['maxPicture'])
|
||||
return ["status" => false, "text" => "Mỗi đối tượng chỉ nhận tối đa " . \Yii::$app->params['maxPicture'] . " hình ảnh mẫu"];
|
||||
return ["status" => false, "text" => Yii::t("app", "SO_ANH_MAU_TOI_DA", ["maxPicture" => \Yii::$app->params['maxPicture']])];
|
||||
$add = true;
|
||||
foreach ($images as $key => $value) {
|
||||
if (isset($value['urlOld']) && $value['urlOld'] === $url)
|
||||
@@ -97,11 +100,14 @@ class ControlLogsController extends Controller {
|
||||
if (!$this->resizeImg($img, $fileTarget))
|
||||
$fileName = $url;
|
||||
|
||||
$features = json_decode(common::requestToEngine("/get-feature", [
|
||||
$features = common::requestToEngine("/get-feature", [
|
||||
"image_paths" => [
|
||||
["url" => "/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName, "type" => "raw"]
|
||||
]
|
||||
]), true);
|
||||
]);
|
||||
if (!$features['status'])
|
||||
return ["status" => false, "text" => Yii::t("app", "ENGINE_KHONG_HOAT_DONG")];
|
||||
$features = json_decode($features['data'], true);
|
||||
$images[] = [
|
||||
"url" => $fileName,
|
||||
"urlOld" => $url,
|
||||
@@ -114,14 +120,15 @@ class ControlLogsController extends Controller {
|
||||
common::updateFeature([
|
||||
"cmd" => "update",
|
||||
"id" => $listManagement->id,
|
||||
"object_id" => $listManagement->staff_id,
|
||||
"name" => common::convert_vi_to_en($listManagement->name),
|
||||
"features" => $listManagement->allFeatures
|
||||
]);
|
||||
return ["status" => true];
|
||||
}
|
||||
return ["status" => false, "text" => "Hình ảnh này đã được chọn làm mẫu cho đối tượng này!"];
|
||||
return ["status" => false, "text" => Yii::t("app", "ANH_MAU_DA_DUOC_CHON")];
|
||||
}
|
||||
return ["status" => false, "text" => "Đối tượng không tồn tại!"];
|
||||
return ["status" => false, "text" => Yii::t("app", "DOI_TUONG_KHONG_TON_TAI")];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,13 +14,6 @@ use yii\helpers\Url;
|
||||
*/
|
||||
class DashboardController extends Controller {
|
||||
|
||||
public function init() {
|
||||
parent::init();
|
||||
if (Yii::$app->user->isGuest) {
|
||||
return $this->redirect(['/site/login']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
@@ -147,4 +140,22 @@ class DashboardController extends Controller {
|
||||
return $this->redirect(Yii::$app->request->hostInfo . "/BiFace_Server_Lite/web/du-lieu.xlsx");
|
||||
}
|
||||
|
||||
public function actionChangeLanguage($lang) {
|
||||
if (Yii::$app->request->isAjax) {
|
||||
$language = \app\models\common::allLanguage();
|
||||
foreach ($language as $key => $value) {
|
||||
if ($value['name'] === $lang)
|
||||
return Yii::$app->session->set("language", $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function actionChangeLanguageLogin($lang) {
|
||||
$language = \app\models\common::allLanguage();
|
||||
foreach ($language as $key => $value) {
|
||||
if ($value['name'] === $lang)
|
||||
return $this->redirect(['/site/login', 'lang' => $lang]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,9 +17,13 @@ use yii\helpers\FileHelper;
|
||||
*/
|
||||
class ListManagementController extends Controller {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function init() {
|
||||
parent::init();
|
||||
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']);
|
||||
}
|
||||
|
||||
public function behaviors() {
|
||||
return [
|
||||
'verbs' => [
|
||||
@@ -34,7 +38,7 @@ class ListManagementController extends Controller {
|
||||
public function actionIndex($from = "", $to = "", $name = "", $type = "all", $gender = "all", $id = "") {
|
||||
$f = date_format(date_create_from_format('H:i d/m/Y', "00:00 " . date("d/m/Y")), 'U');
|
||||
$t = date_format(date_create_from_format('H:i d/m/Y', "23:59 " . date("d/m/Y")), 'U');
|
||||
$this->view->title = "Quản lý mẫu";
|
||||
$this->view->title = Yii::t("app", "QUAN_LY_MAU");
|
||||
$searchModel = new ListManagementSearch();
|
||||
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||
if ($from !== "" && $to !== "") {
|
||||
@@ -72,13 +76,17 @@ class ListManagementController extends Controller {
|
||||
]);
|
||||
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
|
||||
}
|
||||
|
||||
$dataProvider->pagination->pageSize = 20;
|
||||
if (Yii::$app->request->get("per-page"))
|
||||
$dataProvider->pagination->pageSize = Yii::$app->request->get("per-page");
|
||||
return $this->render('index', [
|
||||
'searchModel' => $searchModel,
|
||||
'dataProvider' => $dataProvider,
|
||||
'f' => $f,
|
||||
't' => $t,
|
||||
'typeArray' => ListManagement::$typeArray,
|
||||
'genderArray' => ListManagement::$genderArray,
|
||||
'typeArray' => ListManagement::typeArray(),
|
||||
'genderArray' => ListManagement::genderArray(),
|
||||
// 'idAuto' => $idAuto,
|
||||
"staffArray" => ListManagement::staffArray(),
|
||||
"updating" => $updating
|
||||
@@ -90,14 +98,17 @@ class ListManagementController extends Controller {
|
||||
Yii::$app->response->format = "json";
|
||||
if (Yii::$app->request->post()) {
|
||||
$data = Yii::$app->request->post();
|
||||
$check = ListManagement::findOne(['code' => $data['code']]);
|
||||
$check = ListManagement::findOne(['id' => $data['code']]);
|
||||
if ($check)
|
||||
return ["status" => false];
|
||||
$features = json_decode(common::requestToEngine("/get-feature", [
|
||||
$features = common::requestToEngine("/get-feature", [
|
||||
"image_paths" => [
|
||||
["url" => "/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $data['image'], "type" => "raw"]
|
||||
]
|
||||
]), true);
|
||||
]);
|
||||
if (!$features['status'])
|
||||
return ["status" => false];
|
||||
$features = json_decode($features['data'], true);
|
||||
$data['image'] = json_encode([
|
||||
[
|
||||
"url" => $data['image'],
|
||||
@@ -116,12 +127,12 @@ class ListManagementController extends Controller {
|
||||
Yii::$app->response->format = "json";
|
||||
if (Yii::$app->request->post()) {
|
||||
$data = Yii::$app->request->post();
|
||||
$listManagement = ListManagement::findOne(['code' => $data['code']]);
|
||||
$listManagement = ListManagement::findOne(['id' => $data['code']]);
|
||||
$url = CaptureLogs::findOne($data['id'])->image;
|
||||
if ($listManagement) {
|
||||
$images = json_decode($listManagement->image, true);
|
||||
if (count($images) >= \Yii::$app->params['maxPicture'])
|
||||
return ["status" => false, "text" => "Mỗi đối tượng chỉ nhận tối đa " . \Yii::$app->params['maxPicture'] . " hình ảnh mẫu"];
|
||||
return ["status" => false, "text" => Yii::t("app", "SO_ANH_MAU_TOI_DA", ["maxPicture" => \Yii::$app->params['maxPicture']])];
|
||||
$add = true;
|
||||
foreach ($images as $key => $value) {
|
||||
if (isset($value['urlOld']) && $value['urlOld'] === $url)
|
||||
@@ -137,11 +148,14 @@ class ListManagementController extends Controller {
|
||||
if (!$this->resizeImg($img, $fileTarget))
|
||||
$fileName = $url;
|
||||
|
||||
$features = json_decode(common::requestToEngine("/get-feature", [
|
||||
$features = common::requestToEngine("/get-feature", [
|
||||
"image_paths" => [
|
||||
["url" => "/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName, "type" => "raw"]
|
||||
]
|
||||
]), true);
|
||||
]);
|
||||
if (!$features['status'])
|
||||
return ["status" => false, "text" => Yii::t("app", "ENGINE_KHONG_HOAT_DONG")];
|
||||
$features = json_decode($features['data'], true);
|
||||
$images[] = [
|
||||
"url" => $fileName,
|
||||
"urlOld" => $url,
|
||||
@@ -161,12 +175,13 @@ class ListManagementController extends Controller {
|
||||
common::updateFeature([
|
||||
"cmd" => "update",
|
||||
"id" => $listManagement->id,
|
||||
"object_id" => $listManagement->staff_id,
|
||||
"name" => common::convert_vi_to_en($listManagement->name),
|
||||
"features" => $listManagement->allFeatures
|
||||
]);
|
||||
return ["status" => true];
|
||||
}
|
||||
return ["status" => false, "text" => "Hình ảnh này đã được chọn làm mẫu cho đối tượng này!"];
|
||||
return ["status" => false, "text" => Yii::t("app", "ANH_MAU_DA_DUOC_CHON")];
|
||||
} else {
|
||||
$RootFolder = Yii::getAlias('@webroot') . "/data/uploads";
|
||||
$targetPath = $RootFolder . "/face";
|
||||
@@ -177,11 +192,14 @@ class ListManagementController extends Controller {
|
||||
if (!$this->resizeImg($img, $fileTarget))
|
||||
$fileName = $url;
|
||||
|
||||
$features = json_decode(common::requestToEngine("/get-feature", [
|
||||
$features = common::requestToEngine("/get-feature", [
|
||||
"image_paths" => [
|
||||
["url" => "/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName, "type" => "raw"]
|
||||
]
|
||||
]), true);
|
||||
]);
|
||||
if (!$features['status'])
|
||||
return ["status" => false, "text" => Yii::t("app", "ENGINE_KHONG_HOAT_DONG")];
|
||||
$features = json_decode($features['data'], true);
|
||||
$data['image'] = json_encode([
|
||||
[
|
||||
"url" => $fileName,
|
||||
@@ -235,11 +253,14 @@ class ListManagementController extends Controller {
|
||||
if (!$this->resizeImg($img, $fileTarget))
|
||||
$fileName = $data['image'];
|
||||
|
||||
$features = json_decode(common::requestToEngine("/get-feature", [
|
||||
$features = common::requestToEngine("/get-feature", [
|
||||
"image_paths" => [
|
||||
["url" => "/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName, "type" => "raw"]
|
||||
]
|
||||
]), true);
|
||||
]);
|
||||
if (!$features['status'])
|
||||
return ["status" => false, "text" => Yii::t("app", "ENGINE_KHONG_HOAT_DONG")];
|
||||
$features = json_decode($features['data'], true);
|
||||
$images = json_decode($model->image, true);
|
||||
$images[] = [
|
||||
"url" => $fileName,
|
||||
@@ -262,6 +283,7 @@ class ListManagementController extends Controller {
|
||||
common::updateFeature([
|
||||
"cmd" => "update",
|
||||
"id" => $model->id,
|
||||
"object_id" => $model->staff_id,
|
||||
"name" => common::convert_vi_to_en($model->name),
|
||||
"features" => $model->allFeatures
|
||||
]);
|
||||
@@ -275,11 +297,12 @@ class ListManagementController extends Controller {
|
||||
$model = $this->findModel($data['id']);
|
||||
$images = json_decode($model->image, true);
|
||||
foreach ($images as $k => $v) {
|
||||
unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $v['url']);
|
||||
@unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $v['url']);
|
||||
}
|
||||
common::updateFeature([
|
||||
"cmd" => "delete",
|
||||
"id" => $model->id,
|
||||
"object_id" => $model->staff_id,
|
||||
"name" => common::convert_vi_to_en($model->name),
|
||||
"features" => []
|
||||
]);
|
||||
@@ -306,6 +329,7 @@ class ListManagementController extends Controller {
|
||||
common::updateFeature([
|
||||
"cmd" => "update",
|
||||
"id" => $model->id,
|
||||
"object_id" => $model->staff_id,
|
||||
"name" => common::convert_vi_to_en($model->name),
|
||||
"features" => $model->allFeatures
|
||||
]);
|
||||
@@ -318,7 +342,7 @@ class ListManagementController extends Controller {
|
||||
return $model;
|
||||
}
|
||||
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
throw new NotFoundHttpException(Yii::t("app", "KHONG_TIM_THAY_THONG_TIN"));
|
||||
}
|
||||
|
||||
public function actionBatchDelete() {
|
||||
@@ -336,6 +360,7 @@ class ListManagementController extends Controller {
|
||||
common::updateFeature([
|
||||
"cmd" => "delete",
|
||||
"id" => $staff->id,
|
||||
"object_id" => $staff->staff_id,
|
||||
"name" => common::convert_vi_to_en($staff->name),
|
||||
"features" => []
|
||||
]);
|
||||
@@ -353,11 +378,14 @@ class ListManagementController extends Controller {
|
||||
$model = new common();
|
||||
Yii::$app->response->format = "json";
|
||||
$url = $model->UploadFile("AnhNhanVien", ["PNG", "JPG", "JPEG", "GIF"], "temp");
|
||||
$features = json_decode(common::requestToEngine("/get-feature", [
|
||||
$features = common::requestToEngine("/get-feature", [
|
||||
"image_paths" => [
|
||||
["url" => "/var/www/html/BiFace_Server_Lite/web/" . $url, "type" => "crop"]
|
||||
]
|
||||
]), true);
|
||||
]);
|
||||
if (!$features['status'])
|
||||
return ["status" => false];
|
||||
$features = json_decode($features['data'], true);
|
||||
unlink("/var/www/html/BiFace_Server_Lite/web/" . $url);
|
||||
if ($features['results'][0]['crop'] === "") {
|
||||
return ["status" => false];
|
||||
@@ -392,7 +420,7 @@ class ListManagementController extends Controller {
|
||||
"title" => $data['ip'],
|
||||
"form" => $this->renderPartial("list", [
|
||||
"results" => $results,
|
||||
"typeArray" => ListManagement::$typeArray,
|
||||
"typeArray" => ListManagement::typeArray(),
|
||||
"filters" => $filters,
|
||||
"ip" => $data['ip']
|
||||
])
|
||||
@@ -407,7 +435,7 @@ class ListManagementController extends Controller {
|
||||
if ($server_ip)
|
||||
$ip = $server_ip->data;
|
||||
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
||||
$id_camera = 209;
|
||||
$id_camera = 0;
|
||||
if ($device_id)
|
||||
$id_camera = intval($device_id->data);
|
||||
|
||||
@@ -426,13 +454,15 @@ class ListManagementController extends Controller {
|
||||
foreach ($datas['data'] as $key => $value) {
|
||||
$filters[$value['id']] = $value['code'] . " - " . $value['name'] . " - " . $value['department'];
|
||||
}
|
||||
$deviceDatas = ListManagement::getAllID();
|
||||
Yii::$app->response->format = "json";
|
||||
return [
|
||||
"title" => "<i class='fa fa-download'></i> Đồng bộ từ máy chủ",
|
||||
"title" => "<i class='fa fa-download'></i> " . Yii::t("app", "DONG_BO_TU_MAY_CHU"),
|
||||
"form" => $this->renderPartial("list-server", [
|
||||
"datas" => $datas['data'],
|
||||
"filters" => $filters,
|
||||
"allID" => ListManagement::getAllID()
|
||||
"personImage" => $deviceDatas["imgCountArr"],
|
||||
"allID" => $deviceDatas["idArr"]
|
||||
])
|
||||
];
|
||||
}
|
||||
@@ -479,12 +509,15 @@ class ListManagementController extends Controller {
|
||||
$finish = $this->getCurrentTime();
|
||||
$temp["saveIMG"] = round(($finish - $start), 4);
|
||||
$start = $this->getCurrentTime();
|
||||
$features = json_decode(common::requestToEngine("/get-feature", [
|
||||
$features = common::requestToEngine("/get-feature", [
|
||||
"image_paths" => [
|
||||
["url" => "/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName, "type" => "raw"]
|
||||
],
|
||||
"type" => "128"
|
||||
]), true);
|
||||
]);
|
||||
if (!$features['status'])
|
||||
return false;
|
||||
$features = json_decode($features['data'], true);
|
||||
$finish = $this->getCurrentTime();
|
||||
$temp["extract"] = round(($finish - $start), 4);
|
||||
$ft[] = [
|
||||
@@ -521,6 +554,8 @@ class ListManagementController extends Controller {
|
||||
if ($model) {
|
||||
if (isset($data['images'])) {
|
||||
$extractFeature = $this->extractFeature($data['images'], $data['files_name'], $data['id'], json_decode($model->image, true));
|
||||
if (!$extractFeature)
|
||||
return false;
|
||||
$processTime["extractFeature"] = $extractFeature['time'];
|
||||
$ft = $extractFeature['features'];
|
||||
}
|
||||
@@ -531,16 +566,19 @@ class ListManagementController extends Controller {
|
||||
$model->image = json_encode($ft);
|
||||
$model->last_modified = time();
|
||||
$model->save();
|
||||
// if ($totals <= 10)
|
||||
// common::updateFeature([
|
||||
// "cmd" => "update",
|
||||
// "id" => $model->id,
|
||||
// "name" => common::convert_vi_to_en($model->name),
|
||||
// "features" => $model->allFeatures
|
||||
// ]);
|
||||
if ($totals <= 10)
|
||||
common::updateFeature([
|
||||
"cmd" => "update",
|
||||
"id" => $model->id,
|
||||
"object_id" => $model->staff_id,
|
||||
"name" => common::convert_vi_to_en($model->name),
|
||||
"features" => $model->allFeatures
|
||||
]);
|
||||
} else {
|
||||
if (isset($data['images'])) {
|
||||
$extractFeature = $this->extractFeature($data['images'], $data['files_name'], $data['id']);
|
||||
if (!$extractFeature)
|
||||
return false;
|
||||
$processTime["extractFeature"] = $extractFeature['time'];
|
||||
$ft = $extractFeature['features'];
|
||||
}
|
||||
@@ -561,13 +599,14 @@ class ListManagementController extends Controller {
|
||||
]);
|
||||
$finish = $this->getCurrentTime();
|
||||
$processTime["insertDB"] = round(($finish - $start), 4);
|
||||
// if ($totals <= 10)
|
||||
// common::updateFeature([
|
||||
// "cmd" => "create",
|
||||
// "id" => $model->id,
|
||||
// "name" => common::convert_vi_to_en($model->name),
|
||||
// "features" => $model->allFeatures
|
||||
// ]);
|
||||
if ($totals <= 10)
|
||||
common::updateFeature([
|
||||
"cmd" => "create",
|
||||
"id" => $model->id,
|
||||
"object_id" => $model->staff_id,
|
||||
"name" => common::convert_vi_to_en($model->name),
|
||||
"features" => $model->allFeatures
|
||||
]);
|
||||
}
|
||||
$totalFinish = $this->getCurrentTime();
|
||||
$processTime["total"] = round(($totalFinish - $totalStart), 4);
|
||||
@@ -621,6 +660,7 @@ class ListManagementController extends Controller {
|
||||
common::updateFeature([
|
||||
"cmd" => "update",
|
||||
"id" => $model->id,
|
||||
"object_id" => $model->staff_id,
|
||||
"name" => common::convert_vi_to_en($model->name),
|
||||
"features" => $model->allFeatures
|
||||
]);
|
||||
@@ -641,6 +681,7 @@ class ListManagementController extends Controller {
|
||||
common::updateFeature([
|
||||
"cmd" => "create",
|
||||
"id" => $model->id,
|
||||
"object_id" => $model->staff_id,
|
||||
"name" => common::convert_vi_to_en($model->name),
|
||||
"features" => $model->allFeatures
|
||||
]);
|
||||
@@ -661,7 +702,7 @@ class ListManagementController extends Controller {
|
||||
public function actionChooseStaff() {
|
||||
if (Yii::$app->request->post()) {
|
||||
$post = Yii::$app->request->post();
|
||||
$staff = ListManagement::findOne(['code' => $post['code']]);
|
||||
$staff = ListManagement::findOne(['id' => $post['code']]);
|
||||
Yii::$app->response->format = "json";
|
||||
return [
|
||||
"name" => $staff->name,
|
||||
@@ -683,7 +724,7 @@ class ListManagementController extends Controller {
|
||||
$filters[$value->staff_id] = $value->code . " - " . $value->name . " - " . $value->address;
|
||||
}
|
||||
return [
|
||||
"title" => "<i class='fa fa-upload'></i> Đồng bộ lên máy chủ",
|
||||
"title" => "<i class='fa fa-upload'></i> " . Yii::t("app", "DONG_BO_LEN_MAY_CHU"),
|
||||
"form" => $this->renderPartial("list-to-server", [
|
||||
"datas" => $datas,
|
||||
"filters" => $filters
|
||||
@@ -700,7 +741,7 @@ class ListManagementController extends Controller {
|
||||
if ($server_ip)
|
||||
$ip = $server_ip->data;
|
||||
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
||||
$id_camera = 209;
|
||||
$id_camera = 0;
|
||||
if ($device_id)
|
||||
$id_camera = intval($device_id->data);
|
||||
|
||||
@@ -717,7 +758,7 @@ class ListManagementController extends Controller {
|
||||
}
|
||||
}
|
||||
if (count($images) == 0)
|
||||
return ["status" => true, "text" => "Dữ liệu không đổi"];
|
||||
return ["status" => true, "text" => Yii::t("app", "DU_LIEU_KHONG_DOI")];
|
||||
|
||||
$items = [
|
||||
"id" => $StaffInfo->staff_id,
|
||||
@@ -780,4 +821,110 @@ class ListManagementController extends Controller {
|
||||
return file_get_contents("http://minio1.beetai.com/biface-school/origin/385/454_20201126101221879048.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20201230%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20201230T081350Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=df7586a01bb128c0585edd87d1024b1ddb33483fd335e81238103fd2467b4772");
|
||||
}
|
||||
|
||||
public function actionSchedule() {
|
||||
Yii::$app->response->format = "json";
|
||||
if (Yii::$app->request->post()) {
|
||||
$post = Yii::$app->request->post();
|
||||
$model = new \app\models\Schedule();
|
||||
$datas = [];
|
||||
foreach ($post['lists'] as $key => $value) {
|
||||
$datas[] = [$value, $post['fromTime'], $post['toTime'], $post['fromDate'], $post['toDate'], implode(",", $post['dateOfWeek'])];
|
||||
}
|
||||
$model->multiCreate($datas);
|
||||
return ["status" => true];
|
||||
} else {
|
||||
return [
|
||||
"title" => Yii::t("app", "GAN_LICH_TRINH"),
|
||||
"form" => $this->renderPartial("schedule", ["type" => "create"])
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
public function actionEditSchedule($id) {
|
||||
Yii::$app->response->format = "json";
|
||||
$model = \app\models\Schedule::findOne($id);
|
||||
if (Yii::$app->request->post()) {
|
||||
$post = Yii::$app->request->post();
|
||||
$dateOfWeek = implode(",", $post['dateOfWeek']);
|
||||
if ($post['editAll'] == "true" && isset($post['lists'])) {
|
||||
foreach ($post['lists'] as $key => $value) {
|
||||
$schedule = \app\models\Schedule::findOne([
|
||||
'from_time' => $model->from_time,
|
||||
'to_time' => $model->to_time,
|
||||
'from_date' => $model->from_date,
|
||||
'to_date' => $model->to_date,
|
||||
'date_of_week' => $model->date_of_week,
|
||||
'staff_id' => $value
|
||||
]);
|
||||
if ($schedule) {
|
||||
$schedule->from_time = $post['fromTime'];
|
||||
$schedule->to_time = $post['toTime'];
|
||||
$schedule->from_date = $post['fromDate'];
|
||||
$schedule->to_date = $post['toDate'];
|
||||
$schedule->date_of_week = $dateOfWeek;
|
||||
$schedule->save();
|
||||
} else {
|
||||
$modelSchedule = new \app\models\Schedule();
|
||||
$modelSchedule->create([
|
||||
'staff_id' => $value,
|
||||
'from_time' => $post['fromTime'],
|
||||
'to_time' => $post['toTime'],
|
||||
'from_date' => $post['fromDate'],
|
||||
'to_date' => $post['toDate'],
|
||||
'date_of_week' => $dateOfWeek
|
||||
]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$model->from_time = $post['fromTime'];
|
||||
$model->to_time = $post['toTime'];
|
||||
$model->from_date = $post['fromDate'];
|
||||
$model->to_date = $post['toDate'];
|
||||
$model->date_of_week = $dateOfWeek;
|
||||
$model->save();
|
||||
}
|
||||
return ["status" => true];
|
||||
} else {
|
||||
return [
|
||||
"title" => Yii::t("app", "SUA_LICH_TRINH"),
|
||||
"form" => $this->renderPartial("schedule", [
|
||||
"type" => "edit",
|
||||
"model" => $model
|
||||
])
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
public function actionDeleteSchedule($id) {
|
||||
Yii::$app->response->format = "json";
|
||||
$model = \app\models\Schedule::findOne($id);
|
||||
if (Yii::$app->request->post()) {
|
||||
$post = Yii::$app->request->post();
|
||||
if ($post['editAll'] == "true" && isset($post['lists'])) {
|
||||
foreach ($post['lists'] as $key => $value) {
|
||||
$schedule = \app\models\Schedule::findOne([
|
||||
'from_time' => $model->from_time,
|
||||
'to_time' => $model->to_time,
|
||||
'from_date' => $model->from_date,
|
||||
'to_date' => $model->to_date,
|
||||
'date_of_week' => $model->date_of_week,
|
||||
'staff_id' => $value
|
||||
]);
|
||||
if ($schedule)
|
||||
$schedule->delete();
|
||||
}
|
||||
} else
|
||||
$model->delete();
|
||||
|
||||
return ["status" => true];
|
||||
} else {
|
||||
return [
|
||||
"title" => Yii::t("app", "XOA_LICH_TRINH"),
|
||||
"form" => $this->renderPartial("schedule-delete", [
|
||||
"model" => $model
|
||||
])
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -66,13 +66,20 @@ class SiteController extends Controller {
|
||||
*
|
||||
* @return Response|string
|
||||
*/
|
||||
public function actionLogin() {
|
||||
public function actionLogin($lang = "vi-VI") {
|
||||
if (!Yii::$app->user->isGuest) {
|
||||
return $this->goHome();
|
||||
}
|
||||
Yii::$app->language = $lang;
|
||||
|
||||
$model = new LoginForm();
|
||||
if ($model->load(Yii::$app->request->post()) && $model->login()) {
|
||||
$lang = Yii::$app->request->post('lang');
|
||||
$language = \app\models\common::allLanguage();
|
||||
foreach ($language as $key => $value) {
|
||||
if ($value['name'] === $lang)
|
||||
Yii::$app->session->set("language", $value);
|
||||
}
|
||||
return $this->redirect(["/config"]);
|
||||
}
|
||||
|
||||
@@ -88,9 +95,10 @@ class SiteController extends Controller {
|
||||
* @return Response
|
||||
*/
|
||||
public function actionLogout() {
|
||||
$lang = Yii::$app->session->get("language") ? Yii::$app->session->get("language")["name"] : Yii::$app->language;
|
||||
Yii::$app->user->logout();
|
||||
|
||||
return $this->goHome();
|
||||
return $this->redirect(['/site/login', 'lang' => $lang]); //$this->goHome();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,12 +19,12 @@ class UserController extends Controller {
|
||||
|
||||
public function init() {
|
||||
parent::init();
|
||||
if (Yii::$app->user->isGuest) {
|
||||
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->can("administrator")) {
|
||||
|
||||
if (!Yii::$app->user->can("administrator"))
|
||||
return $this->redirect(["/dashboard"]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,11 +86,6 @@ class UserController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new User model.
|
||||
* If creation is successful, the browser will be redirected to the 'view' page.
|
||||
* @return mixed
|
||||
*/
|
||||
public function actionCreate() {
|
||||
if (!Yii::$app->user->can("administrator")) {
|
||||
Yii::$app->response->format = "json";
|
||||
@@ -142,13 +137,6 @@ class UserController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates an existing User model.
|
||||
* If update is successful, the browser will be redirected to the 'view' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionUpdate($id) {
|
||||
if (!Yii::$app->user->can("administrator")) {
|
||||
Yii::$app->response->format = "json";
|
||||
@@ -196,13 +184,6 @@ class UserController extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing User model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
public function actionDelete($id) {
|
||||
if (!Yii::$app->user->can("administrator")) {
|
||||
throw new \yii\web\ForbiddenHttpException(Yii::t("app", "Bạn không có quyền truy cập!"));
|
||||
@@ -213,19 +194,12 @@ class UserController extends Controller {
|
||||
return $this->redirect(['index']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the User model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
* @param integer $id
|
||||
* @return User the loaded model
|
||||
* @throws NotFoundHttpException if the model cannot be found
|
||||
*/
|
||||
protected function findModel($id) {
|
||||
if (($model = User::findOne($id)) !== null) {
|
||||
return $model;
|
||||
}
|
||||
|
||||
throw new NotFoundHttpException('The requested page does not exist.');
|
||||
throw new NotFoundHttpException(Yii::t("app", "KHONG_TIM_THAY_THONG_TIN"));
|
||||
}
|
||||
|
||||
public function actionProfiles() {
|
||||
@@ -234,7 +208,7 @@ class UserController extends Controller {
|
||||
}
|
||||
|
||||
$model = $this->findModel(Yii::$app->user->id);
|
||||
$this->view->title = Yii::t("app", "Thông tin cá nhân");
|
||||
$this->view->title = Yii::t("app", "THONG_TIN_CA_NHAN");
|
||||
$this->view->params['breadcrumbs'][] = $this->view->title;
|
||||
|
||||
return $this->render('profiles', [
|
||||
@@ -264,7 +238,7 @@ class UserController extends Controller {
|
||||
if (Yii::$app->user->isGuest) {
|
||||
return $this->redirect(['/site/login']);
|
||||
}
|
||||
$this->view->title = Yii::t("app", "Đổi mật khẩu");
|
||||
$this->view->title = Yii::t("app", "DOI_MAT_KHAU");
|
||||
$this->view->params['breadcrumbs'][] = $this->view->title;
|
||||
|
||||
return $this->render('password', [
|
||||
|
||||
@@ -97,7 +97,7 @@ class CaptureLogsGrid {
|
||||
public static function rows() {
|
||||
return function($model, $index, $widget, $grid) {
|
||||
$confidence = json_decode($model->confidence, true);
|
||||
$person = \app\models\ListManagement::findOne($confidence['id1']);
|
||||
$person = isset($confidence['id1']) ? \app\models\ListManagement::findOne($confidence['id1']) : false;
|
||||
$images = false;
|
||||
if ($person) {
|
||||
$images = json_decode($person->image, true);
|
||||
@@ -110,7 +110,7 @@ class CaptureLogsGrid {
|
||||
"img" => "/data/uploads/face/" . $model->image,
|
||||
"confidence" => json_encode([
|
||||
"name" => $person ? $person->name : "",
|
||||
"score" => $confidence['percent1'],
|
||||
"score" => isset($confidence['percent1']) ? $confidence['percent1'] : "",
|
||||
"img" => isset($images[0]) ? "/data/uploads/face/" . $images[0]['url'] : ""
|
||||
])
|
||||
]
|
||||
|
||||
@@ -20,6 +20,24 @@ class ListManagementGrid {
|
||||
};
|
||||
}
|
||||
|
||||
public static function layout($default = 20, $hiddenText = false) {
|
||||
$pageSize = [10, 20, 50, 100];
|
||||
$options = [];
|
||||
foreach ($pageSize as $key => $value) {
|
||||
$selected = "";
|
||||
if (Yii::$app->request->get("per-page") && Yii::$app->request->get("per-page") == $value)
|
||||
$selected = "selected";
|
||||
if (!Yii::$app->request->get("per-page") && $value == $default)
|
||||
$selected = "selected";
|
||||
$options[] = "<option value='" . $value . "' {$selected}>" . $value . "</options>";
|
||||
}
|
||||
$select = "<select style='width:80px;' onchange='common.changePerPage(this);'>" . implode("", $options) . "</select>";
|
||||
$text = "";
|
||||
if (!$hiddenText)
|
||||
$text = "Hiển thị ";
|
||||
return "{items}<div class='row'><div class='col-md-6'>{summary}</div><div class='col-md-6'><div class='row'><div class='col-md-9 text-right'>{pager}</div><div class='col-md-3'>" . $text . $select . "</div></div></div></div>";
|
||||
}
|
||||
|
||||
public static function getLayout() {
|
||||
return "{items}<div class='row'><div class='col-md-4'>{summary}</div><div class='col-md-8 text-right'>{pager}</div></div>";
|
||||
}
|
||||
@@ -86,4 +104,25 @@ class ListManagementGrid {
|
||||
};
|
||||
}
|
||||
|
||||
public static function schedule() {
|
||||
return function($model) {
|
||||
$schedules = $model->schedule;
|
||||
$html = "<ul style='padding-left:10px;'>";
|
||||
foreach ($schedules as $key => $value) {
|
||||
$btnEdit = "<i class='fa fa-edit text-green' onclick='formEditSchedule(this);' data-href='" . Url::to(['/list-management/edit-schedule', 'id' => $value->id]) . "'></i>";
|
||||
$btnDelete = "<i class='fa fa-remove text-red' onclick='formDeleteSchedule(this);' data-href='" . Url::to(['/list-management/delete-schedule', 'id' => $value->id]) . "'></i>";
|
||||
$btn = "<span class='btn-schedule'>" . $btnEdit . " " . $btnDelete . "</span>";
|
||||
$html .= "<li class='schedule-item'>[" . $value->from_time . "-" . $value->to_time . "] " . $value->from_date . " - " . $value->to_date . " [" . $value->date_of_week . "] " . $btn . "</li>";
|
||||
}
|
||||
$html .= "</ul>";
|
||||
return $html;
|
||||
};
|
||||
}
|
||||
|
||||
public static function check() {
|
||||
return function($model) {
|
||||
return "<input type='checkbox' value='' name='' onclick='choose(this);'>";
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
167
messages/en/app.php
Normal file
167
messages/en/app.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
return [
|
||||
"CAU_HINH" => "Configuration",
|
||||
"CAU_HINH_THIET_BI" => "Device Configuration",
|
||||
"CAU_HINH_MAY_CHU" => "Server Configuration",
|
||||
"CAU_HINH_NHAN_DIEN" => "Recognition Configuration",
|
||||
"CAU_HINH_IP" => "IP Configuration",
|
||||
"DEVICE_CONFIG" => "",
|
||||
"SERVER_CONFIG" => "",
|
||||
"ENGINE_CONFIG" => "",
|
||||
"IP_CONFIG" => "",
|
||||
"SERVER_MQTT" => "server_mqtt",
|
||||
"URL" => "url",
|
||||
"LUU_LAI" => "Save",
|
||||
"HAY_NHAP_THONG_TIN" => "Please enter the required information",
|
||||
"BOX_CHUA_DUOC_DANG_KI_TREN_CMS" => "This box is not yet registered on CMS",
|
||||
"DA_LUU_CAU_HINH" => "Configuration saved",
|
||||
"LUU_CAU_HINH_THAT_BAI" => "Unable to save this configuration",
|
||||
"RESET_THIET_BI" => "Reset the device",
|
||||
"XOA_DU_LIEU_LUU_TRU_TRONG_THIET_BI" => "Delete the data stored in the device",
|
||||
"RESET_CAU_HINH_THIET_BI" => "Reset to default configuration",
|
||||
"DONG_Y" => "Confirm",
|
||||
"HUY_BO" => "Cancel",
|
||||
"HAY_LUA_CHON_THAO_TAC" => "Please select an operation",
|
||||
"DELETE_DB_CONFIRM" => "Please confirm to delete all the data stored in the device?",
|
||||
"RESET_DB_CONFIRM" => "Please confirm to reset the to default configuration?",
|
||||
"CAU_HINH_IP_CHUA_DUNG" => "IP Configuration is not correct",
|
||||
"SERVER_API" => "Server API",
|
||||
"DEVICE_ID" => "Device ID",
|
||||
"QUAN_LY_MAU" => "Face Sample Management",
|
||||
"LICH_SU_HE_THONG" => "System history",
|
||||
"DANH_SACH_NHAN_DIEN" => "Recognition log",
|
||||
"ONLINE" => "Online",
|
||||
"THONG_TIN_CA_NHAN" => "Personal Information",
|
||||
"DOI_MAT_KHAU" => "Change Password",
|
||||
"DANG_XUAT" => "Log out",
|
||||
"PHIEN_BAN" => "Version",
|
||||
"ID" => "ID",
|
||||
"LOAI" => "Type",
|
||||
"TEN" => "Name",
|
||||
"HINH_ANH_DANG_KI" => "Sample Images",
|
||||
"GIOI_TINH" => "Sex",
|
||||
"NGAY_SINH" => "DOB",
|
||||
"DIEN_THOAI" => "Phone Nnumber",
|
||||
"DON_VI" => "Departement",
|
||||
"THOI_GIAN_DANG_KI" => "Registration time",
|
||||
"TEN_HIEN_THI" => "Display Name",
|
||||
"WHITE_LIST" => "Whitelist",
|
||||
"BLACK_LIST" => "Blacklist",
|
||||
"MALE" => "Male",
|
||||
"FEMALE" => "Female",
|
||||
"TIM_KIEM_DU_LIEU" => "Search the data",
|
||||
"TAT_CA" => "All",
|
||||
"TIM_KIEM" => "Search",
|
||||
"XOA_NHIEU_DU_LIEU" => "Choose multiple data",
|
||||
"CHON_TOAN_BO_TRANG" => "Select all data",
|
||||
"BO_CHON" => "Unselect",
|
||||
"XAC_NHAN_XOA" => "Deletion Confirm",
|
||||
"DONG_BO_VOI_MAY_CHU" => "Data Synchronization",
|
||||
"DONG_BO_TU_MAY_CHU" => "Synchronize data from server",
|
||||
"DONG_BO_LEN_MAY_CHU" => "Synchronize data to server",
|
||||
"DONG_BO_TU_THIET_BI_KHAC" => "Synchronize data from other device",
|
||||
"NHAP_IP_THIET_BI" => "Insert device's ip",
|
||||
"SO_NGUOI_CO_ANH_TREN_TONG" => "Users with face samples/ Total",
|
||||
"DAC_TRUNG_1" => "Face Feature 1",
|
||||
"DAC_TRUNG_2" => "Face Feature 2",
|
||||
"DANG_CAP_NHAT" => "Loading ...",
|
||||
"THAO_TAC" => "Action",
|
||||
"SUA" => "Edit",
|
||||
"XOA" => "Delete",
|
||||
"DANH_SACH" => "List",
|
||||
"LUU" => "Save",
|
||||
"HUY" => "Cancel",
|
||||
"HAY_CHON_DOI_TUONG" => "Please choose objects",
|
||||
"HAY_NHAP_TEN" => "Please insert name",
|
||||
"HAY_NHAP_TEN_HIEN_THI" => "Please insert display name",
|
||||
"CAP_NHAT_DU_LIEU_THANH_CONG" => "The data is updated successfully",
|
||||
"MA_DOI_TUONG_DA_TON_TAI" => "Object code existed",
|
||||
"DELETE_CONFIRM" => "Dele confirm?",
|
||||
"HAY_CHON_DU_LIEU_DE_XOA" => "Please select data to delete",
|
||||
"DA_XOA_DU_LIEU" => "Data is deleted",
|
||||
"CHON_HINH_ANH" => "Please select an image",
|
||||
"HINH_ANH_KHONG_NHAN_DIEN_DUOC_KHUON_MAT" => "Unable to recognize faces in the image",
|
||||
"HAY_TAI_LEN_HINH_ANH" => "Please upload sample pictures",
|
||||
"HAY_NHAP_DIA_CHI_IP_DONG_BO" => "Please enter the ip address of the device you want to synchronize",
|
||||
"SAI_DINH_DANG_IP" => "IP address is not correct",
|
||||
"TIM_KIEM_THEO_ID_HOAC_TEN" => "Search by ID/Name",
|
||||
"KHONG_CO_KET_NOI_TOI_THIET_BI" => "No connection to the device",
|
||||
"KHONG_CO_DU_LIEU_DONG_BO" => "Sychonozation data is blank",
|
||||
"DONG_BO_DU_LIEU_HOAN_THANH" => "Data synchronization is completed",
|
||||
"SO_ANH_MAU_TOI_DA" => "Each person can take up to {maxPicture} sample images",
|
||||
"ANH_MAU_DA_DUOC_CHON" => "This image is selected as the sample for this person",
|
||||
"KHONG_TIM_THAY_THONG_TIN" => "No information found",
|
||||
"HUY_BO_TIM_KIEM" => "Cancel search",
|
||||
"DA_LUA_CHON_X_DOI_TUONG" => "Selected <b class='text-red' id='totals-choose'>0</b> object.",
|
||||
"DONG_BO_X_Y_DOI_TUONG" => "Synchronize <b id='progress-current' class='text-green'>0</b>/<b id='progress-totals' class='text-red'>0</b> object.",
|
||||
"CHON_TAT_CA" => "Select all",
|
||||
"BO_CHON_TAT_CA" => "Deselect all",
|
||||
"DONG_BO" => "Synchronized",
|
||||
"DONG_LAI" => "Close",
|
||||
"COMPANY_ID" => "Company ID",
|
||||
"CHON_DOI_TUONG_CHUA_TON_TAI" => "Selected object does not exist",
|
||||
"DU_LIEU_KHONG_DOI" => "Data unchanged",
|
||||
"THOI_GIAN" => "Time",
|
||||
"HINH_ANH" => "Image",
|
||||
"TRANG_THAI" => "Status",
|
||||
"REMARK" => "Remark",
|
||||
"DO_TIN_CAY" => "Reliability",
|
||||
"TRANG_THAI_DONG_BO" => "Synchronization status",
|
||||
"FROM" => "From",
|
||||
"TO" => "To",
|
||||
"HIEN_THI_TOAN_BO_DU_LIEU" => "Show all data",
|
||||
"DOI_TUONG_KHONG_TON_TAI" => "Object does not exist",
|
||||
"DA_THEM_HINH_ANH_MAU" => "Added sample images",
|
||||
"XUAT_DU_LIEU" => "Export data",
|
||||
"TEN_DANG_NHAP" => "Username",
|
||||
"HO_TEN" => "Fullname",
|
||||
"EMAIL" => "Email",
|
||||
"LOAI_NGUOI_DUNG" => "User Type",
|
||||
"THONG_TIN_DA_DUOC_LUU_LAI" => "Information saved",
|
||||
"DOI_MAT_KHAU" => "Change Password",
|
||||
"MAT_KHAU_CU" => "Old password",
|
||||
"MAT_KHAU_MOI" => "New password",
|
||||
"NHAC_LAI_MAT_KHAU_MOI" => "Retype new password",
|
||||
"DOI_MAT_KHAU_THANH_CONG" => "Change password successfully",
|
||||
"DANG_XU_LY" => "Loading ...",
|
||||
"THONG_BAO" => "Notify",
|
||||
"CO_LOI_XAY_RA_HAY_THU_LAI" => "An error occurred, check the network connection and try again",
|
||||
"ENGINE_KHONG_HOAT_DONG" => "Engine is not running",
|
||||
"DANG_NHAP" => "Login",
|
||||
"MAT_KHAU" => "Password",
|
||||
"RESET_THIET_BI_LOI" => "Error connecting to the server. Please check your internet connection and try again.",
|
||||
"THU_LAI" => "Try again",
|
||||
"TEN_DANG_NHAP_HOAC_MAT_KHAU_KHONG_DUNG" => "Incorrect username or password.",
|
||||
"DOI_TUONG_CHUA_DU_ANH_MAU" => "Object does not have enough images",
|
||||
"LICH_TRINH" => "Schedule",
|
||||
"HAY_CHON_DOI_TUONG_DE_GAN_LICH_TRINH" => "Please select the object to assign the schedule",
|
||||
"GAN_LICH_TRINH" => "Assign schedule",
|
||||
"THOI_GIAN_VAO" => "Time in",
|
||||
"THOI_GIAN_RA" => "Time out",
|
||||
"NGAY_BAT_DAU" => "Start date",
|
||||
"NGAY_KET_THUC" => "End date",
|
||||
"NGAY_TRONG_TUAN" => "Day of the week",
|
||||
"THU_HAI" => "Monday",
|
||||
"THU_BA" => "Tuesday",
|
||||
"THU_TU" => "Wednesday",
|
||||
"THU_NAM" => "Thursday",
|
||||
"THU_SAU" => "Friday",
|
||||
"THU_BAY" => "Saturday",
|
||||
"CHU_NHAT" => "Sunday",
|
||||
"SUA_LICH_TRINH" => "Edit schedule",
|
||||
"AP_DUNG_CHO_TAT_CA_DOI_TUONG_DA_CHON" => "Apply to all selected objects",
|
||||
"XOA_LICH_TRINH" => "Delete schedule",
|
||||
"BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG" => "Are you sure you want to delete this schedule?",
|
||||
"SO_SANH_MAT" => "Face comparison",
|
||||
"BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" => "Are you sure you want to change the device's IP address?",
|
||||
"THONG_TIN_HE_THONG" => "System Information",
|
||||
"REBOOT" => "Reboot",
|
||||
"BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG" => "Are you sure you want to reboot?"
|
||||
];
|
||||
167
messages/ja/app.php
Normal file
167
messages/ja/app.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
return [
|
||||
"CAU_HINH" => "構成",
|
||||
"CAU_HINH_THIET_BI" => "デバイス構成",
|
||||
"CAU_HINH_MAY_CHU" => " サーバ構成",
|
||||
"CAU_HINH_NHAN_DIEN" => "認識構成",
|
||||
"CAU_HINH_IP" => "IP 構成",
|
||||
"DEVICE_CONFIG" => "Device config",
|
||||
"SERVER_CONFIG" => "Server config",
|
||||
"ENGINE_CONFIG" => "Engine config",
|
||||
"IP_CONFIG" => "IP config",
|
||||
"SERVER_MQTT" => "server_mqtt",
|
||||
"URL" => "url",
|
||||
"LUU_LAI" => "保存する",
|
||||
"HAY_NHAP_THONG_TIN" => "情報を入力してください",
|
||||
"BOX_CHUA_DUOC_DANG_KI_TREN_CMS" => "CMSでBox に登録されていません",
|
||||
"DA_LUU_CAU_HINH" => "構成が保存されました",
|
||||
"LUU_CAU_HINH_THAT_BAI" => "構成の保存に失敗しました",
|
||||
"RESET_THIET_BI" => "デバイスをリセット",
|
||||
"XOA_DU_LIEU_LUU_TRU_TRONG_THIET_BI" => "デバイスに保存されているデータを消去します",
|
||||
"RESET_CAU_HINH_THIET_BI" => "デバイス構成をリセットする",
|
||||
"DONG_Y" => "同意",
|
||||
"HUY_BO" => "キャンセル",
|
||||
"HAY_LUA_CHON_THAO_TAC" => "アクションを選択してください",
|
||||
"DELETE_DB_CONFIRM" => "デバイスに保存されているデータをクリアしてもよろしいですか?",
|
||||
"RESET_DB_CONFIRM" => "デバイス構成をリセットしてもよろしいですか?",
|
||||
"CAU_HINH_IP_CHUA_DUNG" => "IP構成が違います",
|
||||
"SERVER_API" => "Server API",
|
||||
"DEVICE_ID" => "Device ID",
|
||||
"QUAN_LY_MAU" => "テンプレート管理",
|
||||
"LICH_SU_HE_THONG" => "システム履歴",
|
||||
"DANH_SACH_NHAN_DIEN" => "認識リスト",
|
||||
"ONLINE" => "オンライン",
|
||||
"THONG_TIN_CA_NHAN" => "個人情報",
|
||||
"DOI_MAT_KHAU" => "パスワード変更する",
|
||||
"DANG_XUAT" => "ログアウト",
|
||||
"PHIEN_BAN" => "バージョン",
|
||||
"ID" => "ID",
|
||||
"LOAI" => "タイプ",
|
||||
"TEN" => "名前",
|
||||
"HINH_ANH_DANG_KI" => "登録画像",
|
||||
"GIOI_TINH" => "性",
|
||||
"NGAY_SINH" => "生年月日",
|
||||
"DIEN_THOAI" => "電話番号",
|
||||
"DON_VI" => "部署",
|
||||
"THOI_GIAN_DANG_KI" => "登録時間",
|
||||
"TEN_HIEN_THI" => "表示名",
|
||||
"WHITE_LIST" => "Whitelist",
|
||||
"BLACK_LIST" => "Blacklist",
|
||||
"MALE" => "男",
|
||||
"FEMALE" => "女",
|
||||
"TIM_KIEM_DU_LIEU" => "データ検索",
|
||||
"TAT_CA" => "全部",
|
||||
"TIM_KIEM" => "検索",
|
||||
"XOA_NHIEU_DU_LIEU" => "複数のデータを選択",
|
||||
"CHON_TOAN_BO_TRANG" => "ページ全体を選択",
|
||||
"BO_CHON" => "取り消し",
|
||||
"XAC_NHAN_XOA" => "削除の確認",
|
||||
"DONG_BO_VOI_MAY_CHU" => "サーバーと同期する",
|
||||
"DONG_BO_TU_MAY_CHU" => "サーバーから同期する",
|
||||
"DONG_BO_LEN_MAY_CHU" => "サーバーに同期する",
|
||||
"DONG_BO_TU_THIET_BI_KHAC" => "他のデバイスから同期する",
|
||||
"NHAP_IP_THIET_BI" => "デバイスIPを入力してください",
|
||||
"SO_NGUOI_CO_ANH_TREN_TONG" => "写真を持っている人の数/合計",
|
||||
"DAC_TRUNG_1" => "特徴 1",
|
||||
"DAC_TRUNG_2" => "特徴 2",
|
||||
"DANG_CAP_NHAT" => "更新中 ...",
|
||||
"THAO_TAC" => "取り扱う",
|
||||
"SUA" => "修理する",
|
||||
"XOA" => "消す",
|
||||
"DANH_SACH" => "リスト",
|
||||
"LUU" => "保存する",
|
||||
"HUY" => "キャンセル",
|
||||
"HAY_CHON_DOI_TUONG" => "オブジェクトを選択してください",
|
||||
"HAY_NHAP_TEN" => "名前を入力してください",
|
||||
"HAY_NHAP_TEN_HIEN_THI" => "表示名を入力してください",
|
||||
"CAP_NHAT_DU_LIEU_THANH_CONG" => "データの更新に成功しました",
|
||||
"MA_DOI_TUONG_DA_TON_TAI" => "オブジェクトコードはすでに存在します",
|
||||
"DELETE_CONFIRM" => "消去してもよろしいですか?",
|
||||
"HAY_CHON_DU_LIEU_DE_XOA" => "削除するデータを選択してください",
|
||||
"DA_XOA_DU_LIEU" => "削除されたデータ",
|
||||
"CHON_HINH_ANH" => "画像を選択",
|
||||
"HINH_ANH_KHONG_NHAN_DIEN_DUOC_KHUON_MAT" => "画像が顔を認識しない",
|
||||
"HAY_TAI_LEN_HINH_ANH" => "写真をアップロードしてください",
|
||||
"HAY_NHAP_DIA_CHI_IP_DONG_BO" => "同期するデバイスのIPアドレスを入力してください",
|
||||
"SAI_DINH_DANG_IP" => "間違ったIP形式",
|
||||
"TIM_KIEM_THEO_ID_HOAC_TEN" => "ID と名前で検索",
|
||||
"KHONG_CO_KET_NOI_TOI_THIET_BI" => "デバイスに接続されていません",
|
||||
"KHONG_CO_DU_LIEU_DONG_BO" => "データ同期なし",
|
||||
"DONG_BO_DU_LIEU_HOAN_THANH" => "データ同期が完了しました",
|
||||
"SO_ANH_MAU_TOI_DA" => "各オブジェクトは、最大{maxPicture}のサンプル画像のみを受信できます",
|
||||
"ANH_MAU_DA_DUOC_CHON" => "この画像は、この主題のモデルとして選択されています",
|
||||
"KHONG_TIM_THAY_THONG_TIN" => "情報が見つかりません",
|
||||
"HUY_BO_TIM_KIEM" => "検索をキャンセルする",
|
||||
"DA_LUA_CHON_X_DOI_TUONG" => "選択された<bclass = 'text-red' id = 'totals-choose'> 0 </ b>オブジェクト.",
|
||||
"DONG_BO_X_Y_DOI_TUONG" => "Đ同期<bid = 'progress-current' class = 'text-green'> 0 </ b> / <b id = 'progress-totals' class = 'text-red'> 0 </ b>オブジェクト.",
|
||||
"CHON_TAT_CA" => "すべて選択",
|
||||
"BO_CHON_TAT_CA" => "すべての選択を解除",
|
||||
"DONG_BO" => "同期",
|
||||
"DONG_LAI" => "クローズ",
|
||||
"COMPANY_ID" => "Company ID",
|
||||
"CHON_DOI_TUONG_CHUA_TON_TAI" => "存在しないオブジェクトを選択してください",
|
||||
"DU_LIEU_KHONG_DOI" => "データは変更されていません",
|
||||
"THOI_GIAN" => "時間",
|
||||
"HINH_ANH" => "画像",
|
||||
"TRANG_THAI" => "状態",
|
||||
"REMARK" => "Remark",
|
||||
"DO_TIN_CAY" => "信頼性",
|
||||
"TRANG_THAI_DONG_BO" => "同期ステータス",
|
||||
"FROM" => "フォーム",
|
||||
"TO" => "に",
|
||||
"HIEN_THI_TOAN_BO_DU_LIEU" => "すべてのデータを表示",
|
||||
"DOI_TUONG_KHONG_TON_TAI" => "オブジェクトが存在しません",
|
||||
"DA_THEM_HINH_ANH_MAU" => "サンプル画像を追加",
|
||||
"XUAT_DU_LIEU" => "データのエクスポート",
|
||||
"TEN_DANG_NHAP" => "ユーザー名",
|
||||
"HO_TEN" => "名前",
|
||||
"EMAIL" => "メール",
|
||||
"LOAI_NGUOI_DUNG" => "ユーザータイプ",
|
||||
"THONG_TIN_DA_DUOC_LUU_LAI" => "情報が保存されました",
|
||||
"DOI_MAT_KHAU" => "パスワードを変更する",
|
||||
"MAT_KHAU_CU" => "以前のパスワード",
|
||||
"MAT_KHAU_MOI" => "新しいパスワード",
|
||||
"NHAC_LAI_MAT_KHAU_MOI" => "新しいパスワードを繰り返す",
|
||||
"DOI_MAT_KHAU_THANH_CONG" => "パスワードを正常に変更する",
|
||||
"DANG_XU_LY" => "処理中 ...",
|
||||
"THONG_BAO" => "報告",
|
||||
"CO_LOI_XAY_RA_HAY_THU_LAI" => "おそらくネットワーク接続が原因でエラーが発生しました。再試行してください",
|
||||
"ENGINE_KHONG_HOAT_DONG" => "Engine不活動",
|
||||
"DANG_NHAP" => "ログイン",
|
||||
"MAT_KHAU" => "パスワード",
|
||||
"RESET_THIET_BI_LOI" => "サーバーへの接続中にエラーが発生しました。インターネット接続を確認して、もう一度お試しください",
|
||||
"THU_LAI" => "再試行",
|
||||
"TEN_DANG_NHAP_HOAC_MAT_KHAU_KHONG_DUNG" => "ユーザーネームまたはパスワードが違います",
|
||||
"DOI_TUONG_CHUA_DU_ANH_MAU" => "オブジェクトに十分な画像がありません",
|
||||
"LICH_TRINH" => "スケジュール",
|
||||
"HAY_CHON_DOI_TUONG_DE_GAN_LICH_TRINH" => "スケジュールを割り当てるオブジェクトを選択してください",
|
||||
"GAN_LICH_TRINH" => "スケジュールを割り当てる",
|
||||
"THOI_GIAN_VAO" => "の時間",
|
||||
"THOI_GIAN_RA" => "タイムアウト",
|
||||
"NGAY_BAT_DAU" => "開始日",
|
||||
"NGAY_KET_THUC" => "終了日",
|
||||
"NGAY_TRONG_TUAN" => "曜日",
|
||||
"THU_HAI" => "月曜日",
|
||||
"THU_BA" => "火曜日",
|
||||
"THU_TU" => "水曜日",
|
||||
"THU_NAM" => "木曜日",
|
||||
"THU_SAU" => "金曜日",
|
||||
"THU_BAY" => "土曜日",
|
||||
"CHU_NHAT" => "日曜日",
|
||||
"SUA_LICH_TRINH" => "スケジュールを編集",
|
||||
"AP_DUNG_CHO_TAT_CA_DOI_TUONG_DA_CHON" => "選択したすべてのオブジェクトに適用",
|
||||
"XOA_LICH_TRINH" => "スケジュールを削除",
|
||||
"BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG" => "このスケジュールを削除してもよろしいですか?",
|
||||
"SO_SANH_MAT" => "顔比較",
|
||||
"BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" => "デバイスの IP アドレスを変更してもよろしいですか?",
|
||||
"THONG_TIN_HE_THONG" => "システムインフォメーション",
|
||||
"REBOOT" => "リブート",
|
||||
"BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG" => "再起動してもよろしいですか?"
|
||||
];
|
||||
@@ -6,4 +6,162 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
return [];
|
||||
return [
|
||||
"CAU_HINH" => "Cấu hình",
|
||||
"CAU_HINH_THIET_BI" => "Cấu hình thiết bị",
|
||||
"CAU_HINH_MAY_CHU" => "Cấu hình máy chủ",
|
||||
"CAU_HINH_NHAN_DIEN" => "Cấu hình nhận diện",
|
||||
"CAU_HINH_IP" => "Cấu hình IP",
|
||||
"DEVICE_CONFIG" => "Device config",
|
||||
"SERVER_CONFIG" => "Server config",
|
||||
"ENGINE_CONFIG" => "Engine config",
|
||||
"IP_CONFIG" => "IP config",
|
||||
"SERVER_MQTT" => "server_mqtt",
|
||||
"URL" => "url",
|
||||
"LUU_LAI" => "Lưu lại",
|
||||
"HAY_NHAP_THONG_TIN" => "Hãy nhập thông tin",
|
||||
"BOX_CHUA_DUOC_DANG_KI_TREN_CMS" => "Box chưa được đăng kí trên CMS",
|
||||
"DA_LUU_CAU_HINH" => "Đã lưu cấu hình",
|
||||
"LUU_CAU_HINH_THAT_BAI" => "Lưu cấu hình thất bại",
|
||||
"RESET_THIET_BI" => "Reset thiết bị",
|
||||
"XOA_DU_LIEU_LUU_TRU_TRONG_THIET_BI" => "Xóa dữ liệu lưu trữ trong thiết bị",
|
||||
"RESET_CAU_HINH_THIET_BI" => "Reset cấu hình thiết bị",
|
||||
"DONG_Y" => "Đồng ý",
|
||||
"HUY_BO" => "Hủy bỏ",
|
||||
"HAY_LUA_CHON_THAO_TAC" => "Hãy lựa chọn thao tác",
|
||||
"DELETE_DB_CONFIRM" => "Bạn có chắc chắn muốn xóa dữ liệu lưu trữ trong thiết bị không?",
|
||||
"RESET_DB_CONFIRM" => "Bạn có chắc chắn muốn reset cấu hình thiết bị không?",
|
||||
"CAU_HINH_IP_CHUA_DUNG" => "Cấu hình ip chưa đúng",
|
||||
"SERVER_API" => "Server API",
|
||||
"DEVICE_ID" => "Device ID",
|
||||
"QUAN_LY_MAU" => "Quản lý mẫu",
|
||||
"LICH_SU_HE_THONG" => "Lịch sử hệ thống",
|
||||
"DANH_SACH_NHAN_DIEN" => "Danh sách nhận diện",
|
||||
"ONLINE" => "Trực tuyến",
|
||||
"THONG_TIN_CA_NHAN" => "Thông tin cá nhân",
|
||||
"DOI_MAT_KHAU" => "Đổi mật khẩu",
|
||||
"DANG_XUAT" => "Đăng xuất",
|
||||
"PHIEN_BAN" => "Phiên bản",
|
||||
"ID" => "ID",
|
||||
"LOAI" => "Loại",
|
||||
"TEN" => "Tên",
|
||||
"HINH_ANH_DANG_KI" => "Hình ảnh đăng kí",
|
||||
"GIOI_TINH" => "Giới tính",
|
||||
"NGAY_SINH" => "Ngày sinh",
|
||||
"DIEN_THOAI" => "Điện thoại",
|
||||
"DON_VI" => "Đơn vị",
|
||||
"THOI_GIAN_DANG_KI" => "Thời gian đăng kí",
|
||||
"TEN_HIEN_THI" => "Tên hiển thị",
|
||||
"WHITE_LIST" => "Whitelist",
|
||||
"BLACK_LIST" => "Blacklist",
|
||||
"MALE" => "Nam",
|
||||
"FEMALE" => "Nữ",
|
||||
"TIM_KIEM_DU_LIEU" => "Tìm kiếm dữ liệu",
|
||||
"TAT_CA" => "Tất cả",
|
||||
"TIM_KIEM" => "Tìm kiếm",
|
||||
"XOA_NHIEU_DU_LIEU" => "Chọn nhiều dữ liệu",
|
||||
"CHON_TOAN_BO_TRANG" => "Chọn toàn bộ trang",
|
||||
"BO_CHON" => "Bỏ chọn",
|
||||
"XAC_NHAN_XOA" => "Xác nhận xóa",
|
||||
"DONG_BO_VOI_MAY_CHU" => "Đồng bộ với máy chủ",
|
||||
"DONG_BO_TU_MAY_CHU" => "Đồng bộ từ máy chủ",
|
||||
"DONG_BO_LEN_MAY_CHU" => "Đồng bộ lên máy chủ",
|
||||
"DONG_BO_TU_THIET_BI_KHAC" => "Đồng bộ từ thiết bị khác",
|
||||
"NHAP_IP_THIET_BI" => "Nhập ip thiết bị",
|
||||
"SO_NGUOI_CO_ANH_TREN_TONG" => "Số người có ảnh / tổng",
|
||||
"DAC_TRUNG_1" => "Đặc trưng 1",
|
||||
"DAC_TRUNG_2" => "Đặc trưng 2",
|
||||
"DANG_CAP_NHAT" => "Đang cập nhật ...",
|
||||
"THAO_TAC" => "Thao tác",
|
||||
"SUA" => "Sửa",
|
||||
"XOA" => "Xóa",
|
||||
"DANH_SACH" => "Danh sách",
|
||||
"LUU" => "Lưu",
|
||||
"HUY" => "Hủy",
|
||||
"HAY_CHON_DOI_TUONG" => "Hãy chọn đối tượng",
|
||||
"HAY_NHAP_TEN" => "Hãy nhập tên",
|
||||
"HAY_NHAP_TEN_HIEN_THI" => "Hãy nhập tên hiển thị",
|
||||
"CAP_NHAT_DU_LIEU_THANH_CONG" => "Cập nhật dữ liệu thành công",
|
||||
"MA_DOI_TUONG_DA_TON_TAI" => "Mã đối tượng đã tồn tại",
|
||||
"DELETE_CONFIRM" => "Bạn có chắc chắn muốn xóa không",
|
||||
"HAY_CHON_DU_LIEU_DE_XOA" => "Hãy chọn dữ liệu để xóa",
|
||||
"DA_XOA_DU_LIEU" => "Đã xóa dữ liệu",
|
||||
"CHON_HINH_ANH" => "Chọn hình ảnh",
|
||||
"HINH_ANH_KHONG_NHAN_DIEN_DUOC_KHUON_MAT" => "Hình ảnh không nhận diện được khuôn mặt",
|
||||
"HAY_TAI_LEN_HINH_ANH" => "Hãy tải lên hình ảnh",
|
||||
"HAY_NHAP_DIA_CHI_IP_DONG_BO" => "Hãy nhập địa chỉ ip thiết bị muốn đồng bộ",
|
||||
"SAI_DINH_DANG_IP" => "Sai định dạng ip",
|
||||
"TIM_KIEM_THEO_ID_HOAC_TEN" => "Tìm kiếm theo ID hoặc tên",
|
||||
"KHONG_CO_KET_NOI_TOI_THIET_BI" => "Không có kết nối tới thiết bị",
|
||||
"KHONG_CO_DU_LIEU_DONG_BO" => "Không có dữ liệu đồng bộ",
|
||||
"DONG_BO_DU_LIEU_HOAN_THANH" => "Đồng bộ dữ liệu hoàn thành",
|
||||
"SO_ANH_MAU_TOI_DA" => "Mỗi đối tượng chỉ nhận tối đa {maxPicture} hình ảnh mẫu",
|
||||
"ANH_MAU_DA_DUOC_CHON" => "Hình ảnh này đã được chọn làm mẫu cho đối tượng này",
|
||||
"KHONG_TIM_THAY_THONG_TIN" => "Không tìm thấy thông tin",
|
||||
"HUY_BO_TIM_KIEM" => "Hủy bỏ tìm kiếm",
|
||||
"DA_LUA_CHON_X_DOI_TUONG" => "Đã lựa chọn <b class='text-red' id='totals-choose'>0</b> đối tượng.",
|
||||
"DONG_BO_X_Y_DOI_TUONG" => "Đồng bộ <b id='progress-current' class='text-green'>0</b>/<b id='progress-totals' class='text-red'>0</b> đối tượng.",
|
||||
"CHON_TAT_CA" => "Chọn tất cả",
|
||||
"BO_CHON_TAT_CA" => "Bỏ chọn tất cả",
|
||||
"DONG_BO" => "Đồng bộ",
|
||||
"DONG_LAI" => "Đóng lại",
|
||||
"COMPANY_ID" => "Company ID",
|
||||
"CHON_DOI_TUONG_CHUA_TON_TAI" => "Chọn đối tượng chưa tồn tại",
|
||||
"DU_LIEU_KHONG_DOI" => "Dữ liệu không đổi",
|
||||
"THOI_GIAN" => "Thời gian",
|
||||
"HINH_ANH" => "Hình ảnh",
|
||||
"TRANG_THAI" => "Trạng thái",
|
||||
"REMARK" => "Remark",
|
||||
"DO_TIN_CAY" => "Độ tin cậy",
|
||||
"TRANG_THAI_DONG_BO" => "Trạng thái đồng bộ",
|
||||
"FROM" => "Từ",
|
||||
"TO" => "Đến",
|
||||
"HIEN_THI_TOAN_BO_DU_LIEU" => "Hiển thị toàn bộ dữ liệu",
|
||||
"DOI_TUONG_KHONG_TON_TAI" => "Đối tượng không tồn tại",
|
||||
"DA_THEM_HINH_ANH_MAU" => "Đã thêm hình ảnh mẫu",
|
||||
"XUAT_DU_LIEU" => "Xuất dữ liệu",
|
||||
"TEN_DANG_NHAP" => "Tên đăng nhập",
|
||||
"HO_TEN" => "Họ tên",
|
||||
"EMAIL" => "Email",
|
||||
"LOAI_NGUOI_DUNG" => "Loại người dùng",
|
||||
"THONG_TIN_DA_DUOC_LUU_LAI" => "Thông tin đã được lưu lại",
|
||||
"DOI_MAT_KHAU" => "Đổi mật khẩu",
|
||||
"MAT_KHAU_CU" => "Mật khẩu cũ",
|
||||
"MAT_KHAU_MOI" => "Mật khẩu mới",
|
||||
"NHAC_LAI_MAT_KHAU_MOI" => "Nhắc lại mật khẩu mới",
|
||||
"DOI_MAT_KHAU_THANH_CONG" => "Đổi mật khẩu thành công",
|
||||
"DANG_XU_LY" => "Đang xử lý ...",
|
||||
"THONG_BAO" => "Thông báo",
|
||||
"CO_LOI_XAY_RA_HAY_THU_LAI" => "Có lỗi xảy ra, có thể do đường truyền mạng, xin vui lòng thử lại",
|
||||
"ENGINE_KHONG_HOAT_DONG" => "Engine không hoạt động",
|
||||
"DANG_NHAP" => "Đăng nhập",
|
||||
"MAT_KHAU" => "Mật khẩu",
|
||||
"RESET_THIET_BI_LOI" => "Lỗi kết nối đến server. Hãy kiểm tra lại kết nối internet và thử lại.",
|
||||
"THU_LAI" => "Thử lại",
|
||||
"TEN_DANG_NHAP_HOAC_MAT_KHAU_KHONG_DUNG" => "Tên đăng nhập hoặc mật khẩu không đúng.",
|
||||
"DOI_TUONG_CHUA_DU_ANH_MAU" => "Đối tượng chưa đủ ảnh mẫu",
|
||||
"LICH_TRINH" => "Lịch trình",
|
||||
"HAY_CHON_DOI_TUONG_DE_GAN_LICH_TRINH" => "Hãy chọn đối tượng để gán lịch trình",
|
||||
"GAN_LICH_TRINH" => "Gán lịch trình",
|
||||
"THOI_GIAN_VAO" => "Thời gian vào",
|
||||
"THOI_GIAN_RA" => "Thời gian ra",
|
||||
"NGAY_BAT_DAU" => "Ngày bắt đầu",
|
||||
"NGAY_KET_THUC" => "Ngày kết thúc",
|
||||
"NGAY_TRONG_TUAN" => "Ngày trong tuần",
|
||||
"THU_HAI" => "Thứ hai",
|
||||
"THU_BA" => "Thứ ba",
|
||||
"THU_TU" => "Thứ tư",
|
||||
"THU_NAM" => "Thứ năm",
|
||||
"THU_SAU" => "Thứ sáu",
|
||||
"THU_BAY" => "Thứ bảy",
|
||||
"CHU_NHAT" => "Chủ nhật",
|
||||
"SUA_LICH_TRINH" => "Sửa lịch trình",
|
||||
"AP_DUNG_CHO_TAT_CA_DOI_TUONG_DA_CHON" => "Áp dụng cho tất cả đối tượng đã chọn",
|
||||
"XOA_LICH_TRINH" => "Xóa lịch trình",
|
||||
"BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG" => "Bạn có chắc chắn muốn xóa lịch trình này không?",
|
||||
"SO_SANH_MAT" => "So sánh mặt",
|
||||
"BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" => "Bạn có chắc chắn muốn thay đổi địa chỉ IP của thiết bị không?",
|
||||
"THONG_TIN_HE_THONG" => "Thông tin hệ thống",
|
||||
"REBOOT" => "Khởi động lại thiết bị",
|
||||
"BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG" => "Bạn có chắc chắn muốn khởi động lại thiết bị không?"
|
||||
];
|
||||
|
||||
@@ -40,15 +40,15 @@ class CaptureLogs extends \yii\db\ActiveRecord {
|
||||
*/
|
||||
public function attributeLabels() {
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'time' => 'Thời gian',
|
||||
'image' => 'Hình ảnh',
|
||||
'status' => 'Status',
|
||||
'remark' => 'Remark',
|
||||
'staff_name' => "Name",
|
||||
'staff_image' => "Hình ảnh đăng kí",
|
||||
'confidence' => 'Độ tin cậy',
|
||||
'sync_status' => 'Trạng thái đồng bộ'
|
||||
'id' => Yii::t("app", "ID"),
|
||||
'time' => Yii::t("app", "THOI_GIAN"),
|
||||
'image' => Yii::t("app", "HINH_ANH"),
|
||||
'status' => Yii::t("app", "TRANG_THAI"),
|
||||
'remark' => Yii::t("app", "REMARK"),
|
||||
'staff_name' => Yii::t("app", "TEN"),
|
||||
'staff_image' => Yii::t("app", "HINH_ANH_DANG_KI"),
|
||||
'confidence' => Yii::t("app", "DO_TIN_CAY"),
|
||||
'sync_status' => Yii::t("app", "TRANG_THAI_DONG_BO")
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -45,19 +45,19 @@ class ListManagement extends \yii\db\ActiveRecord {
|
||||
*/
|
||||
public function attributeLabels() {
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'code' => 'ID',
|
||||
'type' => 'Loại',
|
||||
'name' => 'Tên',
|
||||
'image' => 'Hình ảnh đăng kí',
|
||||
'gender' => 'Giới tính',
|
||||
'birthday' => 'Ngày sinh',
|
||||
'telephone' => 'Điện thoại',
|
||||
'address' => 'Đơn vị',
|
||||
'time' => 'Thời gian đăng kí',
|
||||
'id' => Yii::t("app", "ID"),
|
||||
'code' => Yii::t("app", "ID"),
|
||||
'type' => Yii::t("app", "LOAI"),
|
||||
'name' => Yii::t("app", "TEN_HIEN_THI"),
|
||||
'image' => Yii::t("app", "HINH_ANH_DANG_KI"),
|
||||
'gender' => Yii::t("app", "GIOI_TINH"),
|
||||
'birthday' => Yii::t("app", "NGAY_SINH"),
|
||||
'telephone' => Yii::t("app", "DIEN_THOAI"),
|
||||
'address' => Yii::t("app", "DON_VI"),
|
||||
'time' => Yii::t("app", "THOI_GIAN_DANG_KI"),
|
||||
'last_modified' => 'Last Modified',
|
||||
'abbreviated_name' => 'Tên hiển thị',
|
||||
'staff_id' => 'ID'
|
||||
'abbreviated_name' => Yii::t("app", "TEN"),
|
||||
'staff_id' => Yii::t("app", "ID"),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -86,14 +86,19 @@ class ListManagement extends \yii\db\ActiveRecord {
|
||||
}
|
||||
}
|
||||
|
||||
public static $typeArray = [
|
||||
"wl" => "Whitelist",
|
||||
"bl" => "Blacklist"
|
||||
];
|
||||
public static $genderArray = [
|
||||
"Male" => "Nam",
|
||||
"Female" => "Nữ"
|
||||
];
|
||||
public static function typeArray() {
|
||||
return [
|
||||
"wl" => Yii::t("app", "WHITE_LIST"),
|
||||
"bl" => Yii::t("app", "BLACK_LIST")
|
||||
];
|
||||
}
|
||||
|
||||
public static function genderArray() {
|
||||
return [
|
||||
"Male" => Yii::t("app", "MALE"),
|
||||
"Female" => Yii::t("app", "FEMALE"),
|
||||
];
|
||||
}
|
||||
|
||||
public static function nameArray() {
|
||||
$res = [""];
|
||||
@@ -105,19 +110,25 @@ class ListManagement extends \yii\db\ActiveRecord {
|
||||
}
|
||||
|
||||
public static function getAllID() {
|
||||
$res = [];
|
||||
$idArr = [];
|
||||
$imgCountArr = [];
|
||||
$ls = self::find()->all();
|
||||
foreach ($ls as $key => $value) {
|
||||
$res[] = $value->staff_id;
|
||||
$idArr[] = $value->staff_id;
|
||||
$images = json_decode($value->image, true);
|
||||
$imgCountArr[$value->staff_id] = count($images);
|
||||
}
|
||||
return $res;
|
||||
return [
|
||||
"idArr" => $idArr,
|
||||
"imgCountArr" => $imgCountArr
|
||||
];
|
||||
}
|
||||
|
||||
public static function staffArray() {
|
||||
$res = [];
|
||||
$ls = self::find()->all();
|
||||
foreach ($ls as $key => $value) {
|
||||
$res[$value->code] = $value->code . " - " . $value->name;
|
||||
$res[$value->id] = $value->code . " - " . $value->name;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
@@ -168,4 +179,8 @@ class ListManagement extends \yii\db\ActiveRecord {
|
||||
];
|
||||
}
|
||||
|
||||
public function getSchedule() {
|
||||
return Schedule::find()->andWhere(['staff_id' => $this->id])->all();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,11 +43,18 @@ class LoginForm extends Model {
|
||||
if (!$this->hasErrors()) {
|
||||
$user = $this->getUser();
|
||||
if (!$user || !$user->validatePassword($this->password)) {
|
||||
$this->addError($attribute, 'Incorrect username or password.');
|
||||
$this->addError($attribute, Yii::t("app", "TEN_DANG_NHAP_HOAC_MAT_KHAU_KHONG_DUNG"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function attributeLabels() {
|
||||
return [
|
||||
'username' => Yii::t("app", "TEN_DANG_NHAP"),
|
||||
'password' => Yii::t("app", "MAT_KHAU")
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs in a user using the provided username and password.
|
||||
* @return bool whether the user is logged in successfully
|
||||
|
||||
80
models/Schedule.php
Normal file
80
models/Schedule.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace app\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "schedule".
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $staff_id
|
||||
* @property string $from_time
|
||||
* @property string $to_time
|
||||
* @property string $from_date
|
||||
* @property string $to_date
|
||||
* @property string $date_of_week
|
||||
* @property int $id_door_calendar
|
||||
*/
|
||||
class Schedule extends \yii\db\ActiveRecord {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName() {
|
||||
return 'schedule';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules() {
|
||||
return [
|
||||
[['staff_id', 'from_time', 'to_time', 'from_date', 'to_date', 'date_of_week'], 'string'],
|
||||
[['id_door_calendar'], 'integer'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels() {
|
||||
return [
|
||||
'id' => 'ID',
|
||||
'staff_id' => 'Staff ID',
|
||||
'from_time' => 'From Time',
|
||||
'to_time' => 'To Time',
|
||||
'from_date' => 'From Date',
|
||||
'to_date' => 'To Date',
|
||||
'date_of_week' => 'Date Of Week',
|
||||
'id_door_calendar' => 'id_door_calendar'
|
||||
];
|
||||
}
|
||||
|
||||
public function multiCreate($datas) {
|
||||
$field = ['staff_id', 'from_time', 'to_time', 'from_date', 'to_date', 'date_of_week'];
|
||||
static::getDb()->createCommand()->batchInsert($this->tableName(), $field, $datas)->execute();
|
||||
return;
|
||||
}
|
||||
|
||||
public function create($data) {
|
||||
$r = $this->load([
|
||||
'staff_id' => strval($data['staff_id']),
|
||||
'from_time' => $data['from_time'],
|
||||
'to_time' => $data['to_time'],
|
||||
'from_date' => $data['from_date'],
|
||||
'to_date' => $data['to_date'],
|
||||
'date_of_week' => $data['date_of_week'],
|
||||
'id_door_calendar' => $data['id_door_calendar']
|
||||
], '');
|
||||
if ($r) {
|
||||
try {
|
||||
$this->save();
|
||||
return $this->id;
|
||||
} catch (\Exception $ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -172,22 +172,25 @@ class common extends \yii\db\ActiveRecord {
|
||||
}
|
||||
|
||||
public static function requestToEngine($path, $data) {
|
||||
return file_get_contents("http://localhost:2305" . $path, false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode($data)
|
||||
]
|
||||
$content = @file_get_contents("http://localhost:2305" . $path, false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode($data)
|
||||
]
|
||||
]));
|
||||
if ($content == false)
|
||||
return ["status" => false];
|
||||
return ["status" => true, "data" => $content];
|
||||
}
|
||||
|
||||
public static function updateFeature($datas) {
|
||||
return file_get_contents("http://localhost:2305/update-person", false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode($datas)
|
||||
]
|
||||
return @file_get_contents("http://localhost:2305/update-person", false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
'content' => json_encode($datas)
|
||||
]
|
||||
]));
|
||||
}
|
||||
|
||||
@@ -220,4 +223,19 @@ class common extends \yii\db\ActiveRecord {
|
||||
return $str;
|
||||
}
|
||||
|
||||
public static function allLanguage() {
|
||||
return [
|
||||
["icon" => "vi.png", "name" => "vi-VI", "description" => "Tiếng Việt"],
|
||||
["icon" => "en.png", "name" => "en-EN", "description" => "English"],
|
||||
["icon" => "jp.png", "name" => "ja-JA", "description" => "Japanese"]
|
||||
];
|
||||
}
|
||||
|
||||
public static function rsaEncode($text) {
|
||||
$publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCXB8c44cboYsGG6IzISqxf8W7q3AN0mGmekDYpBWpz9udif+jwK6h7NuOZvFDeB/32TVrtvaGDmExCeBerpcoOvGh4eUXyke2lSLzrg7pc/wD0KproEGoAAFDB0Pr5bZhg6ELp3Sk++0MPyxH6u1pgtHDxEnMwXV8cxw/rSCM+wIDAQAB";
|
||||
$publicKey = "-----BEGIN PUBLIC KEY-----\n" . wordwrap($publicKey, 64, "\n", true) . "\n-----END PUBLIC KEY-----";
|
||||
openssl_public_encrypt($text, $encrypted, $publicKey, OPENSSL_PKCS1_PADDING);
|
||||
return base64_encode($encrypted);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
0
runtime/temp.txt
Normal file → Executable file
0
runtime/temp.txt
Normal file → Executable file
@@ -23,7 +23,7 @@ use dmstr\widgets\Alert;
|
||||
|
||||
<footer class="main-footer">
|
||||
<div class="pull-right hidden-xs">
|
||||
<b>Version: </b>
|
||||
<b><?php echo Yii::t("app", "PHIEN_BAN"); ?>: </b>
|
||||
<?php
|
||||
$version = \app\models\SyncUrl::findOne(['key_config' => 'version']);
|
||||
echo $version ? $version->data : Yii::$app->params["version"];
|
||||
|
||||
@@ -36,35 +36,68 @@ use yii\widgets\ActiveForm;
|
||||
<!-- Collect the nav links, forms, and other content for toggling -->
|
||||
<div class="collapse navbar-collapse pull-left" id="navbar-collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="<?php if (Yii::$app->controller->id == "config") echo "active"; ?>">
|
||||
<li class="<?php if (Yii::$app->controller->id == "config" && Yii::$app->controller->action->id != "system-info") echo "active"; ?>">
|
||||
<a href="<?php echo yii\helpers\Url::to(['/config/cau-hinh-thiet-bi']); ?>">
|
||||
<i class="fa fa-cogs"></i> Cấu hình
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?php echo yii\helpers\Url::to(['/config/reset']); ?>" onclick="common.resetForm(this);return false;">
|
||||
<i class="fa fa-refresh"></i> Reset thiết bị
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if (Yii::$app->controller->id == "list-management") echo "active"; ?>">
|
||||
<a href="<?php echo yii\helpers\Url::to(['/list-management']); ?>">
|
||||
<i class="fa fa-list"></i> Quản lý mẫu
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if (Yii::$app->controller->id == "capture-logs") echo "active"; ?>">
|
||||
<a href="<?php echo yii\helpers\Url::to(['/capture-logs']); ?>">
|
||||
<i class="fa fa-camera"></i> Lịch sử hệ thống
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if (Yii::$app->controller->id == "control-logs") echo "active"; ?>">
|
||||
<a href="<?php echo yii\helpers\Url::to(['/control-logs']); ?>">
|
||||
<i class="fa fa-database"></i> Danh sách nhận diện
|
||||
<i class="fa fa-cogs"></i> <?php echo Yii::t("app", "CAU_HINH"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php if (Yii::$app->params['type'] === "BiFace") { ?>
|
||||
<li>
|
||||
<a href="<?php echo yii\helpers\Url::to(['/config/reset']); ?>" onclick="common.resetForm(this);return false;">
|
||||
<i class="fa fa-refresh"></i> <?php echo Yii::t("app", "RESET_THIET_BI"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if (Yii::$app->controller->id == "list-management") echo "active"; ?>">
|
||||
<a href="<?php echo yii\helpers\Url::to(['/list-management']); ?>">
|
||||
<i class="fa fa-list"></i> <?php echo Yii::t("app", "QUAN_LY_MAU"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown <?php if (in_array(Yii::$app->controller->id, ['capture-logs', 'control-logs'])) echo "active"; ?>">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa fa-list-alt"></i> <?php echo Yii::t("app", "LICH_SU_HE_THONG"); ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="<?php echo \yii\helpers\Url::to(['/capture-logs']); ?>"><i class="fa fa-camera"></i> <?php echo Yii::t("app", "LICH_SU_HE_THONG"); ?></a></li>
|
||||
<li><a href="<?php echo \yii\helpers\Url::to(['/control-logs']); ?>"><i class="fa fa-database"></i> <?php echo Yii::t("app", "DANH_SACH_NHAN_DIEN"); ?></a></li>
|
||||
<li><a href="<?php echo \yii\helpers\Url::to(['/capture-logs/face-comparison']); ?>"><i class="fa fa-users"></i> <?php echo Yii::t("app", "SO_SANH_MAT"); ?></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="<?php if (Yii::$app->controller->id == "config" && Yii::$app->controller->action->id == "system-info") echo "active"; ?>">
|
||||
<a href="<?php echo yii\helpers\Url::to(['/config/system-info']); ?>">
|
||||
<i class="fa fa-info-circle"></i> <?php echo Yii::t("app", "THONG_TIN_HE_THONG"); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="navbar-custom-menu">
|
||||
<?php
|
||||
$languages = app\models\common::allLanguage();
|
||||
$currentLanguage = ["icon" => "vi.png", "name" => "vi-VI", "description" => "Tiếng Việt"];
|
||||
if (Yii::$app->session->get("language"))
|
||||
$currentLanguage = Yii::$app->session->get("language");
|
||||
else
|
||||
Yii::$app->session->set("language", $currentLanguage);
|
||||
?>
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="dropdown notifications-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<img src="/images/lang/<?php echo $currentLanguage["icon"]; ?>" width="20px">
|
||||
</a>
|
||||
<ul class="dropdown-menu" style="width: 150px;">
|
||||
<li>
|
||||
<ul class="menu">
|
||||
<?php foreach ($languages as $key => $value) { ?>
|
||||
<li>
|
||||
<a href="<?php echo yii\helpers\Url::to(['/dashboard/change-language', 'lang' => $value['name']]); ?>" onclick="common.changeLanguage(this);return false;">
|
||||
<img src="/images/lang/<?php echo $value['icon']; ?>" width="20px"> <?php echo $value['description']; ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<img src="<?php
|
||||
@@ -99,17 +132,17 @@ use yii\widgets\ActiveForm;
|
||||
</div>
|
||||
<div class="pull-left info">
|
||||
<p style="color: #fff;" class="user-profiles-name"><?= Yii::$app->user->isGuest ? "" : \Yii::$app->user->identity->first_name; ?></p>
|
||||
<a href="#" style="color: #fff;"><i class="fa fa-circle text-success"></i> <?php echo Yii::t("app", "Online"); ?></a>
|
||||
<a href="#" style="color: #fff;"><i class="fa fa-circle text-success"></i> <?php echo Yii::t("app", "ONLINE"); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="user-body" style="border:none">
|
||||
<ul style="list-style: none; padding: 0">
|
||||
<li><a class="text-bold" onclick="user.formInfo(this);return false;" href="<?php echo yii\helpers\Url::to(['/user/profiles']); ?>"><i class="fa fa-user"></i> <?php echo Yii::t("app", "Thông tin cá nhân"); ?></a></li>
|
||||
<li><a class="text-bold" onclick="user.formChangePassword(this);return false;" href="<?php echo yii\helpers\Url::to(['/user/change-password']); ?>"><i class="fa fa-lock"></i> <?php echo Yii::t("app", "Đổi mật khẩu"); ?></a></li>
|
||||
<li><a class="text-bold" href="<?php echo yii\helpers\Url::to(['/user/profiles']); ?>"><i class="fa fa-user"></i> <?php echo Yii::t("app", "THONG_TIN_CA_NHAN"); ?></a></li>
|
||||
<li><a class="text-bold" href="<?php echo yii\helpers\Url::to(['/user/change-password']); ?>"><i class="fa fa-lock"></i> <?php echo Yii::t("app", "DOI_MAT_KHAU"); ?></a></li>
|
||||
<li class="separator"><hr style="margin:0;padding:0"></li>
|
||||
<li>
|
||||
<a href="<?php echo yii\helpers\Url::to(["/site/logout"]); ?>" onclick="$(this).parent().find('form').submit();return false;"><i class="fa fa-sign-out"></i> <?php echo Yii::t("app", "Đăng xuất"); ?></a>
|
||||
<a href="<?php echo yii\helpers\Url::to(["/site/logout"]); ?>" onclick="$(this).parent().find('form').submit();return false;"><i class="fa fa-sign-out"></i> <?php echo Yii::t("app", "DANG_XUAT"); ?></a>
|
||||
<?php
|
||||
ActiveForm::begin([
|
||||
'action' => yii\helpers\Url::to(["/site/logout"]),
|
||||
@@ -118,7 +151,7 @@ use yii\widgets\ActiveForm;
|
||||
]);
|
||||
?>
|
||||
<div class="pull-right">
|
||||
<button name="action" value="logout" class="btn btn-default btn-flat"><?php echo Yii::t("app", "Đăng xuất"); ?></button>
|
||||
<button name="action" value="logout" class="btn btn-default btn-flat"><?php echo Yii::t("app", "DANG_XUAT"); ?></button>
|
||||
</div>
|
||||
<?php ActiveForm::end(); ?>
|
||||
</li>
|
||||
|
||||
@@ -7,7 +7,7 @@ use yii\bootstrap\ActiveForm;
|
||||
/* @var $form yii\bootstrap\ActiveForm */
|
||||
/* @var $model \common\models\LoginForm */
|
||||
|
||||
$this->title = 'Sign In';
|
||||
$this->title = Yii::t("app", "DANG_NHAP");
|
||||
|
||||
$fieldOptions1 = [
|
||||
'options' => ['class' => 'form-group has-feedback'],
|
||||
@@ -30,7 +30,7 @@ $fieldOptions2 = [
|
||||
</div>
|
||||
<!-- /.login-logo -->
|
||||
<div class="login-box-body">
|
||||
<p class="login-box-msg"><b>ĐĂNG NHẬP</b></p>
|
||||
<p class="login-box-msg text-uppercase"><b><?php echo Yii::t("app", "DANG_NHAP"); ?></b></p>
|
||||
|
||||
<?php $form = ActiveForm::begin(['id' => 'login-form', 'enableClientValidation' => false]); ?>
|
||||
|
||||
@@ -38,32 +38,50 @@ $fieldOptions2 = [
|
||||
$form
|
||||
->field($model, 'username', $fieldOptions1)
|
||||
->label(false)
|
||||
->textInput(['placeholder' => $model->getAttributeLabel('username')])
|
||||
->textInput(['placeholder' => Yii::t("app", "TEN_DANG_NHAP")])
|
||||
?>
|
||||
|
||||
<?=
|
||||
$form
|
||||
->field($model, 'password', $fieldOptions2)
|
||||
->label(false)
|
||||
->passwordInput(['placeholder' => $model->getAttributeLabel('password')])
|
||||
->passwordInput(['placeholder' => Yii::t("app", "MAT_KHAU")])
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-7">
|
||||
<?= $form->field($model, 'rememberMe')->checkbox() ?>
|
||||
<input type="hidden" value="<?php echo Yii::$app->request->get("lang"); ?>" name="lang">
|
||||
<?php
|
||||
$languages = app\models\common::allLanguage();
|
||||
$currentLanguage = ["icon" => "vi.png", "name" => "vi-VI", "description" => "Tiếng Việt"];
|
||||
foreach ($languages as $key => $value) {
|
||||
if ($value['name'] === Yii::$app->request->get('lang'))
|
||||
$currentLanguage = $value;
|
||||
}
|
||||
?>
|
||||
<div class="btn-group" id="card-picker">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
|
||||
<img src="/images/lang/<?php echo $currentLanguage["icon"]; ?>" width="20px">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<?php foreach ($languages as $key => $value) { ?>
|
||||
<li>
|
||||
<a href="<?php echo yii\helpers\Url::to(['/dashboard/change-language-login', 'lang' => $value['name']]); ?>">
|
||||
<img src="/images/lang/<?php echo $value['icon']; ?>" width="20px"> <?php echo $value['description']; ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
<div class="col-xs-5">
|
||||
<?= Html::submitButton('Đăng nhập', ['class' => 'btn btn-primary btn-block', 'name' => 'login-button']) ?>
|
||||
<?= Html::submitButton(Yii::t("app", "DANG_NHAP"), ['class' => 'btn btn-primary btn-block', 'name' => 'login-button']) ?>
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
<a href="#">I forgot my password</a><br>
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div>
|
||||
<!-- /.login-box-body -->
|
||||
</div><!-- /.login-box -->
|
||||
</div>
|
||||
|
||||
27
views/capture-logs/face-comparison.tpl
Normal file
27
views/capture-logs/face-comparison.tpl
Normal file
@@ -0,0 +1,27 @@
|
||||
{extends file=$smarty.current_dir|cat:'/../extends.tpl'}
|
||||
{use class="yii\helpers\Url"}
|
||||
{use class="app\assets\FaceComparisonAsset"}
|
||||
{FaceComparisonAsset::register($this)|void}
|
||||
{block name='content'}<br>
|
||||
<input type="hidden" name="url_upload_face" value="{Url::to(['/capture-logs/upload-face'])}">
|
||||
<input type="hidden" name="url_face_comparison" value="{Url::to(['/capture-logs/face-comparison'])}">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-md-push-2 text-center">
|
||||
<img src="/images/user2-160x160.jpg" class="img-thumbnail" id="face1" style="width: 70%;cursor: pointer;" onclick="$('#image1').trigger('click');">
|
||||
<div class="hidden">
|
||||
<input type="file" name="image1" id="image1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 col-md-push-2 text-center">
|
||||
<div style="padding-top: 100px;">
|
||||
<b class="text-red" style="font-size: 40px;" id="percent">0.00%</b>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-md-push-2 text-center">
|
||||
<img src="/images/user2-160x160.jpg" class="img-thumbnail" id="face2" style="width: 70%;cursor: pointer;" onclick="$('#image2').trigger('click');">
|
||||
<div class="hidden">
|
||||
<input type="file" name="image2" id="image2">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -67,30 +67,30 @@
|
||||
])}
|
||||
</div>
|
||||
<div class="col-md-2" style="padding-right: 30px;">
|
||||
<h4>Tìm kiếm dữ liệu</h4>
|
||||
<h4>{Yii::t("app", "TIM_KIEM_DU_LIEU")}</h4>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Từ</label>
|
||||
<label class="control-label">{Yii::t("app", "FROM")}</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>
|
||||
<label class="control-label">{Yii::t("app", "TO")}</label>
|
||||
<input type="text" class="form-control datepicker" value="{$t|date_format:"H:i d/m/Y"}" name="To">
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<button class="btn btn-info" onclick="_search(this);" data-href="{Url::to(['/capture-logs'])}">
|
||||
<i class="fa fa-search"></i> Tìm kiếm
|
||||
<i class="fa fa-search"></i> {Yii::t("app", "TIM_KIEM")}
|
||||
</button>
|
||||
</div>
|
||||
<hr style="border-top: 1px solid #000;">
|
||||
<div>
|
||||
<input type="checkbox" name="AllData" style="width: inherit;" {if Yii::$app->request->get("all")}checked=""{/if}> Hiển thị toàn bộ dữ liệu
|
||||
<input type="checkbox" name="AllData" style="width: inherit;" {if Yii::$app->request->get("all")}checked=""{/if}> {Yii::t("app", "HIEN_THI_TOAN_BO_DU_LIEU")}
|
||||
</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">
|
||||
Quản lý mẫu
|
||||
{Yii::t("app", "QUAN_LY_MAU")}
|
||||
<i class="fa fa-remove pull-right" style="cursor: pointer;" onclick="_close();"></i>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@@ -98,23 +98,22 @@
|
||||
<div class="col-md-4 text-center">
|
||||
<img src="" class="img-thumbnail" id="FaceImage" style="width: 150px;height: 150px;">
|
||||
<div class='feature-img'>
|
||||
<img src="" class="img-thumbnail" id="closest-img" style="width: 100px;height:100px;">
|
||||
<img src="/images/user2-160x160.jpg" class="img-thumbnail" id="closest-img" style="width: 100px;height:100px;">
|
||||
<br>
|
||||
<i id="closest-name"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-right">Danh sách</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "DANH_SACH")}</div>
|
||||
<div class="col-md-8">
|
||||
<select style="width: 100%;height: 26px;" name="Type">
|
||||
<option value="wl">White list</option>
|
||||
<option value="bl">Black list</option>
|
||||
{html_options options=$typeArray}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-right">ID</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "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>
|
||||
@@ -123,40 +122,39 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-right">Tên</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "TEN")}</div>
|
||||
<div class="col-md-8">
|
||||
<input type="text" name="Name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-right">Tên hiển thị</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "TEN_HIEN_THI")}</div>
|
||||
<div class="col-md-8">
|
||||
<input type="text" name="AbbreviatedName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-right">Giới tính</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "GIOI_TINH")}</div>
|
||||
<div class="col-md-8">
|
||||
<select style="width: 100%;height: 26px;" name="Gender">
|
||||
<option value="Male">Nam</option>
|
||||
<option value="Female">Nữ</option>
|
||||
{html_options options=$genderArray}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-right">Ngày sinh</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "NGAY_SINH")}</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">Điện thoại</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "DIEN_THOAI")}</div>
|
||||
<div class="col-md-8">
|
||||
<input type="text" name="Telephone">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-right">Đơn vị</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "DON_VI")}</div>
|
||||
<div class="col-md-8">
|
||||
<input type="text" name="Address">
|
||||
</div>
|
||||
@@ -165,8 +163,8 @@
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<input type="hidden" value="" name="CaptureLogsID">
|
||||
<button onclick="_save(this);" data-href='{Url::to(["/list-management/create"])}'>Lưu</button>
|
||||
<button onclick="_close();">Hủy</button>
|
||||
<button onclick="_save(this);" data-href='{Url::to(["/list-management/create"])}'>{Yii::t("app", "LUU")}</button>
|
||||
<button onclick="_close();">{Yii::t("app", "HUY")}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -142,32 +142,8 @@
|
||||
<div class="container-fluid">
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="mt-element-step">
|
||||
<div class="row step-thin">
|
||||
<div class="col-md-4 bg-grey mt-step-col">
|
||||
<div class="mt-step-number bg-white font-grey">1</div>
|
||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-thiet-bi'])}';">
|
||||
Cấu hình thiết bị
|
||||
</div>
|
||||
<div class="mt-step-content font-grey-cascade">Device config</div>
|
||||
</div>
|
||||
<div class="col-md-4 bg-grey mt-step-col">
|
||||
<div class="mt-step-number bg-white font-grey">2</div>
|
||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config'])}';">
|
||||
Cấu hình máy chủ
|
||||
</div>
|
||||
<div class="mt-step-content font-grey-cascade">Server config</div>
|
||||
</div>
|
||||
<div class="col-md-4 bg-grey mt-step-col active">
|
||||
<div class="mt-step-number bg-white font-grey">3</div>
|
||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-nhan-dien'])}';">
|
||||
Cấu hình nhận diện
|
||||
</div>
|
||||
<div class="mt-step-content font-grey-cascade">Engine config</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
{$menu}
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
@@ -175,7 +151,7 @@
|
||||
<div class="col-md-6 col-md-push-1">
|
||||
{$config_json}
|
||||
<button style="position: fixed;left: 0;top: 170px;" class="btn btn-primary" onclick="saveStep2(this);" data-href="{Url::to(['/config/cau-hinh-nhan-dien'])}">
|
||||
<i class="fa fa-floppy-o"></i> Lưu lại
|
||||
<i class="fa fa-floppy-o"></i> {Yii::t("app", "LUU_LAI")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,32 +16,8 @@
|
||||
<div class="container-fluid">
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="mt-element-step">
|
||||
<div class="row step-thin">
|
||||
<div class="col-md-4 bg-grey mt-step-col active">
|
||||
<div class="mt-step-number bg-white font-grey">1</div>
|
||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-thiet-bi'])}';">
|
||||
Cấu hình thiết bị
|
||||
</div>
|
||||
<div class="mt-step-content font-grey-cascade">Device config</div>
|
||||
</div>
|
||||
<div class="col-md-4 bg-grey mt-step-col">
|
||||
<div class="mt-step-number bg-white font-grey">2</div>
|
||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config'])}';">
|
||||
Cấu hình máy chủ
|
||||
</div>
|
||||
<div class="mt-step-content font-grey-cascade">Server config</div>
|
||||
</div>
|
||||
<div class="col-md-4 bg-grey mt-step-col">
|
||||
<div class="mt-step-number bg-white font-grey">3</div>
|
||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-nhan-dien'])}';">
|
||||
Cấu hình nhận diện
|
||||
</div>
|
||||
<div class="mt-step-content font-grey-cascade">Engine config</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
{$menu}
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
@@ -49,19 +25,19 @@
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Server API</div>
|
||||
<div class="input-group-addon">{Yii::t("app", "SERVER_API")}</div>
|
||||
<input type="input" class="form-control" name="server_api" value="{$server_api->data|default:""}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Device ID</div>
|
||||
<div class="input-group-addon">{Yii::t("app", "DEVICE_ID")}</div>
|
||||
<input type="input" class="form-control" name="device_id" value="{$device_id->data|default:""}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<button class="btn btn-primary" onclick="SaveConfigDevice(this);" data-href="{Url::to(['save-config'])}">
|
||||
<i class="fa fa-floppy-o"></i> Lưu lại
|
||||
<i class="fa fa-floppy-o"></i> {Yii::t("app", "LUU_LAI")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,32 +16,8 @@
|
||||
<div class="container-fluid">
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="mt-element-step">
|
||||
<div class="row step-thin">
|
||||
<div class="col-md-4 bg-grey mt-step-col">
|
||||
<div class="mt-step-number bg-white font-grey">1</div>
|
||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-thiet-bi'])}';">
|
||||
Cấu hình thiết bị
|
||||
</div>
|
||||
<div class="mt-step-content font-grey-cascade">Device config</div>
|
||||
</div>
|
||||
<div class="col-md-4 bg-grey mt-step-col active">
|
||||
<div class="mt-step-number bg-white font-grey">2</div>
|
||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config'])}';">
|
||||
Cấu hình máy chủ
|
||||
</div>
|
||||
<div class="mt-step-content font-grey-cascade">Server config</div>
|
||||
</div>
|
||||
<div class="col-md-4 bg-grey mt-step-col">
|
||||
<div class="mt-step-number bg-white font-grey">3</div>
|
||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-nhan-dien'])}';">
|
||||
Cấu hình nhận diện
|
||||
</div>
|
||||
<div class="mt-step-content font-grey-cascade">Engine config</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
{$menu}
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
@@ -49,19 +25,19 @@
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">server_mqtt</div>
|
||||
<div class="input-group-addon">{Yii::t("app", "SERVER_MQTT")}</div>
|
||||
<input type="input" class="form-control" name="servermqtt" value="{$servermqtt}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">url</div>
|
||||
<div class="input-group-addon">{Yii::t("app", "URL")}</div>
|
||||
<input type="input" class="form-control" name="url" value="{$url}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<button class="btn btn-primary" onclick="saveStep1(this);" data-href="{Url::to(['/config/cau-hinh-may-chu'])}">
|
||||
<i class="fa fa-floppy-o"></i> Lưu lại
|
||||
<i class="fa fa-floppy-o"></i> {Yii::t("app", "LUU_LAI")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
68
views/config/ip.tpl
Normal file
68
views/config/ip.tpl
Normal file
@@ -0,0 +1,68 @@
|
||||
{extends file=$smarty.current_dir|cat:'/../extends.tpl'}
|
||||
{use class="yii\helpers\Url"}
|
||||
{use class="yii\grid\GridView"}
|
||||
{use class="app\assets\ConfigAsset"}
|
||||
{ConfigAsset::register($this)|void}
|
||||
{block name='content'}
|
||||
<style>
|
||||
.input-group-addon{
|
||||
width: 120px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.input-group{
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
{$menu}
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="dhcp">
|
||||
<input type='checkbox' name='dhcp' id='dhcp_check' value="" {if $network.dhcp=="yes"}checked=""{/if}> DHCP
|
||||
</div>
|
||||
<div class="form-group" id="device_ip">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{Yii::t("app", "IP Address")}</div>
|
||||
<input type="input" class="form-control" name="device_ip" value="{$network.ip_address|default:""}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="subnet_mask">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{Yii::t("app", "Subnet Mask")}</div>
|
||||
<input type="input" class="form-control" name="subnet_mask" value="{$network.subnet_mask|default:""}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="gateway">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{Yii::t("app", "Gateway")}</div>
|
||||
<input type="input" class="form-control" name="gateway" value="{$network.gateway|default:""}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="dns1">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{Yii::t("app", "DNS1")}</div>
|
||||
<input type="input" class="form-control" name="dns1" value="{$network.dns1|default:""}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="dns2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">{Yii::t("app", "DNS2")}</div>
|
||||
<input type="input" class="form-control" name="dns2" value="{$network.dns2|default:""}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<button class="btn btn-primary" onclick="changeIP(this);" data-href="{Url::to(['/config/cau-hinh-ip'])}">
|
||||
<i class="fa fa-floppy-o"></i> {Yii::t("app", "LUU_LAI")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
35
views/config/menu.tpl
Normal file
35
views/config/menu.tpl
Normal file
@@ -0,0 +1,35 @@
|
||||
{use class="yii\helpers\Url"}
|
||||
{if Yii::$app->params["type"]==="BiFace"}
|
||||
<div class="mt-element-step">
|
||||
<div class="row step-thin">
|
||||
<div class="col-md-3 bg-grey mt-step-col {if $tab=="device_config"}active{/if}">
|
||||
<div class="mt-step-number bg-white font-grey">1</div>
|
||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-thiet-bi'])}';">
|
||||
{Yii::t("app", "CAU_HINH_THIET_BI")}
|
||||
</div>
|
||||
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "DEVICE_CONFIG")}</div>
|
||||
</div>
|
||||
<div class="col-md-3 bg-grey mt-step-col {if $tab=="server_config"}active{/if}">
|
||||
<div class="mt-step-number bg-white font-grey">2</div>
|
||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config'])}';">
|
||||
{Yii::t("app", "CAU_HINH_MAY_CHU")}
|
||||
</div>
|
||||
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "SERVER_CONFIG")}</div>
|
||||
</div>
|
||||
<div class="col-md-3 bg-grey mt-step-col {if $tab=="engine_config"}active{/if}">
|
||||
<div class="mt-step-number bg-white font-grey">3</div>
|
||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-nhan-dien'])}';">
|
||||
{Yii::t("app", "CAU_HINH_NHAN_DIEN")}
|
||||
</div>
|
||||
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "ENGINE_CONFIG")}</div>
|
||||
</div>
|
||||
<div class="col-md-3 bg-grey mt-step-col {if $tab=="ip_config"}active{/if}">
|
||||
<div class="mt-step-number bg-white font-grey">4</div>
|
||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/cau-hinh-ip'])}';">
|
||||
{Yii::t("app", "CAU_HINH_IP")}
|
||||
</div>
|
||||
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "IP_CONFIG")}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -1,11 +1,14 @@
|
||||
<div class="alert alert-danger hidden" id="reset-error">
|
||||
<i class="fa fa-info-circle"></i> {Yii::t("app", "RESET_THIET_BI_LOI")}
|
||||
</div>
|
||||
<div class="text-left">
|
||||
<input type="checkbox" name="DeleteDatabase" checked="" style="width: inherit;"> Xóa dữ liệu lưu trữ trong thiết bị
|
||||
<input type="checkbox" name="DeleteDatabase" style="width: inherit;"> {Yii::t("app", "XOA_DU_LIEU_LUU_TRU_TRONG_THIET_BI")}
|
||||
<br>
|
||||
<input type="checkbox" name="ResetDevice" checked="" style="width: inherit;"> Reset cấu hình thiết bị
|
||||
<input type="checkbox" name="ResetDevice" style="width: inherit;"> {Yii::t("app", "RESET_CAU_HINH_THIET_BI")}
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<button class="btn btn-danger" onclick="common.reset(this);" data-href="{yii\helpers\Url::to(['/config/reset'])}">
|
||||
Đồng ý
|
||||
<button class="btn btn-danger" onclick="common.reset(this);" data-href="{yii\helpers\Url::to(['/config/reset'])}" id="reset-accept">
|
||||
{Yii::t("app", "DONG_Y")}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Hủy bỏ</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal" id="reset-close">{Yii::t("app", "HUY_BO")}</button>
|
||||
</div>
|
||||
58
views/config/system-info.tpl
Normal file
58
views/config/system-info.tpl
Normal file
@@ -0,0 +1,58 @@
|
||||
{extends file=$smarty.current_dir|cat:'/../extends.tpl'}
|
||||
{use class="yii\helpers\Url"}
|
||||
{use class="app\assets\ConfigAsset"}
|
||||
{ConfigAsset::register($this)|void}
|
||||
{block name='content'}
|
||||
<style>
|
||||
.input-group-addon{
|
||||
width: 120px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.input-group{
|
||||
width: 100%;
|
||||
}
|
||||
.table-striped > tbody > tr:nth-of-type(odd) {
|
||||
background-color: #d1d1d1;
|
||||
}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-md-push-1">
|
||||
<table class="table table-bordered table-striped" style="background: #fff;">
|
||||
<thead>
|
||||
<tr style="background-color: #3c8dbc;color:#fff;">
|
||||
<th colspan="2">{Yii::t("app", "THONG_TIN_HE_THONG")|upper}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>CPU</th>
|
||||
<td>ARM Mali-450 penta-core</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>MemTotal</th>
|
||||
<td>2.0 GiB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>DiskTotal</th>
|
||||
<td>16.0 GiB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Software version number</th>
|
||||
<td>{$version}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Build time</th>
|
||||
<td>{$build_time}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button class="btn btn-danger" onclick="reboot(this);" data-href="{Url::to(['system-info'])}">
|
||||
<i class="fa fa-refresh"></i> {Yii::t("app","REBOOT")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
@@ -79,40 +79,40 @@
|
||||
])}
|
||||
</div>
|
||||
<div class="col-md-2" style="padding-right: 30px;">
|
||||
<h4>Tìm kiếm dữ liệu</h4>
|
||||
<h4>{Yii::t("app", "TIM_KIEM_DU_LIEU")}</h4>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Từ</label>
|
||||
<label class="control-label">{Yii::t("app", "FROM")}</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>
|
||||
<label class="control-label">{Yii::t("app", "TO")}</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">ID</label>
|
||||
<label class="control-label">{Yii::t("app", "ID")}</label>
|
||||
<input type="text" class="form-control" value="{Yii::$app->request->get("id")}" name="IDSearch">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Tên</label>
|
||||
<label class="control-label">{Yii::t("app", "TEN")}</label>
|
||||
<input type="text" class="form-control" value="{Yii::$app->request->get("name")}" name="NameSearch">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Loại</label>
|
||||
<label class="control-label">{Yii::t("app", "LOAI")}</label>
|
||||
<select class="form-control" name="TypeSearch">
|
||||
<option value="all">Tất cả</option>
|
||||
<option value="all">{Yii::t("app", "TAT_CA")}</option>
|
||||
{html_options options=$typeArray selected=Yii::$app->request->get("type")}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Giới tính</label>
|
||||
<label class="control-label">{Yii::t("app", "GIOI_TINH")}</label>
|
||||
<select class="form-control" name="GenderSearch">
|
||||
<option value="all">Tất cả</option>
|
||||
<option value="all">{Yii::t("app", "TAT_CA")}</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(['/control-logs'])}">
|
||||
<i class="fa fa-search"></i> Tìm kiếm
|
||||
<i class="fa fa-search"></i> {Yii::t("app", "TIM_KIEM")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<div style="margin-top: 20px;">
|
||||
<div>
|
||||
<a class="btn btn-success" href='{Url::to(['/dashboard/export'])}'>
|
||||
<i class="fa fa-download"></i> Xuất dữ liệu
|
||||
<i class="fa fa-download"></i> {Yii::t("app", "Xuất dữ liệu")}
|
||||
</a>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
@@ -2,6 +2,40 @@
|
||||
{block name="content"}
|
||||
{/block}
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="HAY_NHAP_THONG_TIN" value="{Yii::t("app", "HAY_NHAP_THONG_TIN")}">
|
||||
<input type="hidden" name="BOX_CHUA_DUOC_DANG_KI_TREN_CMS" value="{Yii::t("app", "BOX_CHUA_DUOC_DANG_KI_TREN_CMS")}">
|
||||
<input type="hidden" name="DA_LUU_CAU_HINH" value="{Yii::t("app", "DA_LUU_CAU_HINH")}">
|
||||
<input type="hidden" name="LUU_CAU_HINH_THAT_BAI" value="{Yii::t("app", "LUU_CAU_HINH_THAT_BAI")}">
|
||||
<input type="hidden" name="HAY_LUA_CHON_THAO_TAC" value="{Yii::t("app", "HAY_LUA_CHON_THAO_TAC")}">
|
||||
<input type="hidden" name="DELETE_DB_CONFIRM" value="{Yii::t("app", "DELETE_DB_CONFIRM")}">
|
||||
<input type="hidden" name="RESET_DB_CONFIRM" value="{Yii::t("app", "RESET_DB_CONFIRM")}">
|
||||
<input type="hidden" name="HAY_CHON_DOI_TUONG" value="{Yii::t("app", "HAY_CHON_DOI_TUONG")}">
|
||||
<input type="hidden" name="HAY_NHAP_TEN" value="{Yii::t("app", "HAY_NHAP_TEN")}">
|
||||
<input type="hidden" name="HAY_NHAP_TEN_HIEN_THI" value="{Yii::t("app", "HAY_NHAP_TEN_HIEN_THI")}">
|
||||
<input type="hidden" name="CAP_NHAT_DU_LIEU_THANH_CONG" value="{Yii::t("app", "CAP_NHAT_DU_LIEU_THANH_CONG")}">
|
||||
<input type="hidden" name="MA_DOI_TUONG_DA_TON_TAI" value="{Yii::t("app", "MA_DOI_TUONG_DA_TON_TAI")}">
|
||||
<input type="hidden" name="DELETE_CONFIRM" value="{Yii::t("app", "DELETE_CONFIRM")}">
|
||||
<input type="hidden" name="HAY_CHON_DU_LIEU_DE_XOA" value="{Yii::t("app", "HAY_CHON_DU_LIEU_DE_XOA")}">
|
||||
<input type="hidden" name="DA_XOA_DU_LIEU" value="{Yii::t("app", "DA_XOA_DU_LIEU")}">
|
||||
<input type="hidden" name="CHON_HINH_ANH" value="{Yii::t("app", "CHON_HINH_ANH")}">
|
||||
<input type="hidden" name="HINH_ANH_KHONG_NHAN_DIEN_DUOC_KHUON_MAT" value="{Yii::t("app", "HINH_ANH_KHONG_NHAN_DIEN_DUOC_KHUON_MAT")}">
|
||||
<input type="hidden" name="HAY_TAI_LEN_HINH_ANH" value="{Yii::t("app", "HAY_TAI_LEN_HINH_ANH")}">
|
||||
<input type="hidden" name="HAY_NHAP_DIA_CHI_IP_DONG_BO" value="{Yii::t("app", "HAY_NHAP_DIA_CHI_IP_DONG_BO")}">
|
||||
<input type="hidden" name="SAI_DINH_DANG_IP" value="{Yii::t("app", "SAI_DINH_DANG_IP")}">
|
||||
<input type="hidden" name="TIM_KIEM_THEO_ID_HOAC_TEN" value="{Yii::t("app", "TIM_KIEM_THEO_ID_HOAC_TEN")}">
|
||||
<input type="hidden" name="KHONG_CO_KET_NOI_TOI_THIET_BI" value="{Yii::t("app", "KHONG_CO_KET_NOI_TOI_THIET_BI")}">
|
||||
<input type="hidden" name="KHONG_CO_DU_LIEU_DONG_BO" value="{Yii::t("app", "KHONG_CO_DU_LIEU_DONG_BO")}">
|
||||
<input type="hidden" name="DONG_BO_DU_LIEU_HOAN_THANH" value="{Yii::t("app", "DONG_BO_DU_LIEU_HOAN_THANH")}">
|
||||
<input type="hidden" name="DA_THEM_HINH_ANH_MAU" value="{Yii::t("app", "DA_THEM_HINH_ANH_MAU")}">
|
||||
<input type="hidden" name="CO_LOI_XAY_RA_HAY_THU_LAI" value="{Yii::t("app", "CO_LOI_XAY_RA_HAY_THU_LAI")}">
|
||||
<input type="hidden" name="ENGINE_KHONG_HOAT_DONG" value="{Yii::t("app", "ENGINE_KHONG_HOAT_DONG")}">
|
||||
<input type="hidden" name="HAY_CHON_DOI_TUONG_DE_GAN_LICH_TRINH" value="{Yii::t("app", "HAY_CHON_DOI_TUONG_DE_GAN_LICH_TRINH")}">
|
||||
<input type="hidden" name="BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG" value="{Yii::t("app", "BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG")}">
|
||||
<input type="hidden" name="BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG" value="{Yii::t("app", "BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG")}">
|
||||
<input type="hidden" name="BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG" value="{Yii::t("app", "BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG")}">
|
||||
|
||||
|
||||
<div id="blocking" class="fade modal" role="dialog" tabindex="-1">
|
||||
<div class="modal-dialog" style="top: 50%;margin-top: -45px;">
|
||||
<div class="modal-content" style="background-color: transparent;box-shadow: none;">
|
||||
@@ -9,7 +43,20 @@
|
||||
<div id='modelContent' class="text-center">
|
||||
<i class="fa fa-spinner fa-pulse fa-5x fa-fw" style="color: #fff;"></i>
|
||||
<br>
|
||||
<b style="color: #fff;font-size: 25px;">Đang xử lý ...</b>
|
||||
<b style="color: #fff;font-size: 25px;">{Yii::t("app", "DANG_XU_LY")}</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="reboot-blocking" class="fade modal" role="dialog" tabindex="-1">
|
||||
<div class="modal-dialog" style="top: 50%;margin-top: -45px;">
|
||||
<div class="modal-content" style="background-color: transparent;box-shadow: none;">
|
||||
<div class="modal-body">
|
||||
<div id='modelContent' class="text-center">
|
||||
<i class="fa fa-spinner fa-pulse fa-5x fa-fw" style="color: #fff;"></i>
|
||||
<br>
|
||||
<b style="color: #fff;font-size: 25px;">Đang khởi động lại thiết bị, vui lòng chờ trong vài phút và tải lại trang!</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -39,7 +86,7 @@
|
||||
...
|
||||
</div>
|
||||
<div class="modal-footer" id='myModalFooter'>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-remove"></span> Đóng lại</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-remove"></span> {Yii::t("app", "DONG_LAI")}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,14 +114,14 @@
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" id="alertModalHeader" style="background-color: #ffcc66;color: green;">
|
||||
<h4 class="modal-title" id="alertModalLabel" style="color: #fff;">
|
||||
<span class="fa fa-info-circle"></span> <b>Thông báo</b>
|
||||
<span class="fa fa-info-circle"></span> <b>{Yii::t("app", "THONG_BAO")}</b>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body c-red" id="alertModalContent" style="font-weight: bold;">
|
||||
...
|
||||
</div>
|
||||
<div class="modal-footer" id="alertModalFooter">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-remove"></span> Đồng ý</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-remove"></span> {Yii::t("app", "DONG_Y")}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
.row{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
input{
|
||||
width: 100%;
|
||||
}
|
||||
{*input{
|
||||
width: 100%;
|
||||
}*}
|
||||
.table-striped > tbody > tr:nth-of-type(odd){
|
||||
background-color: rgb(210, 210, 210);
|
||||
}
|
||||
@@ -21,13 +21,21 @@
|
||||
.feature-img:hover .btn{
|
||||
visibility: visible !important;
|
||||
}
|
||||
.table > tbody > tr.delete-choose > td{
|
||||
background-color: red;
|
||||
color: #fff;
|
||||
.btn-schedule{
|
||||
visibility: hidden;
|
||||
}
|
||||
.select2-container {
|
||||
.schedule-item:hover .btn-schedule{
|
||||
visibility: visible !important;
|
||||
}
|
||||
.table > tbody > tr.delete-choose > td{
|
||||
background-color: #F7D3D2;
|
||||
}
|
||||
#filters-face .select2-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
.pagination {
|
||||
margin: 0;
|
||||
}
|
||||
#form-add-staff .select2-container--default .select2-selection--single, .select2-selection .select2-selection--single{
|
||||
border-color: green;
|
||||
}
|
||||
@@ -43,10 +51,10 @@
|
||||
<input type="hidden" value="{Url::to(["/list-management/update-feature"])}" name="update_feature_url">
|
||||
<input type="hidden" value="{Url::to(["/api/get-total-feature"])}" name="get_total_feature_url">
|
||||
<div class="row">
|
||||
<div class="col-md-10" style="max-height: 850px;overflow-y: auto;">
|
||||
<div class="col-md-10" id="list-face" style="max-height: 850px;overflow-y: auto;">
|
||||
{GridView::widget([
|
||||
'dataProvider' => $dataProvider,
|
||||
'layout'=> \app\helpers\ListManagementGrid::getLayout(),
|
||||
'layout'=> \app\helpers\ListManagementGrid::layout(20),
|
||||
'tableOptions' => [
|
||||
'class' => 'table table-striped table-bordered',
|
||||
'style' => 'background:#fff;min-width:700px;'
|
||||
@@ -58,6 +66,12 @@
|
||||
'contentOptions' => ['class' => 'text-center'],
|
||||
'headerOptions' => ['class' => 'text-center']
|
||||
],
|
||||
[
|
||||
'contentOptions' => ['class' => 'text-center hidden checkbox-column'],
|
||||
'headerOptions' => ['style' => 'width:3%', 'class' => 'hidden checkbox-column'],
|
||||
'format' => "raw",
|
||||
'value' => \app\helpers\ListManagementGrid::check()
|
||||
],
|
||||
[
|
||||
'attribute' => 'type',
|
||||
'contentOptions' => ['class' => 'text-center'],
|
||||
@@ -84,10 +98,10 @@
|
||||
'value' => \app\helpers\ListManagementGrid::image()
|
||||
],
|
||||
[
|
||||
'attribute' => 'time',
|
||||
'contentOptions' => ['class' => 'text-center'],
|
||||
'label' => Yii::t("app", "LICH_TRINH"),
|
||||
'headerOptions' => ['class' => 'text-center'],
|
||||
'value' => \app\helpers\ListManagementGrid::time()
|
||||
'format' => "raw",
|
||||
'value' => \app\helpers\ListManagementGrid::schedule()
|
||||
],
|
||||
[
|
||||
'attribute' => 'telephone',
|
||||
@@ -110,7 +124,7 @@
|
||||
])}
|
||||
</div>
|
||||
<div class="col-md-2" style="padding-right: 30px;">
|
||||
<h4>Tìm kiếm dữ liệu</h4>
|
||||
<h4>{Yii::t("app", "TIM_KIEM_DU_LIEU")}</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">
|
||||
@@ -120,65 +134,66 @@
|
||||
<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">ID</label>
|
||||
<label class="control-label">{Yii::t("app", "ID")}</label>
|
||||
<input type="text" class="form-control" value="{Yii::$app->request->get("id")}" name="IDSearch">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Tên</label>
|
||||
<label class="control-label">{Yii::t("app", "TEN")}</label>
|
||||
<input type="text" class="form-control" value="{Yii::$app->request->get("name")}" name="NameSearch">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Loại</label>
|
||||
<label class="control-label">{Yii::t("app", "LOAI")}</label>
|
||||
<select class="form-control" name="TypeSearch">
|
||||
<option value="all">Tất cả</option>
|
||||
<option value="all">{Yii::t("app", "TAT_CA")}</option>
|
||||
{html_options options=$typeArray selected=Yii::$app->request->get("type")}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Giới tính</label>
|
||||
<label class="control-label">{Yii::t("app", "GIOI_TINH")}</label>
|
||||
<select class="form-control" name="GenderSearch">
|
||||
<option value="all">Tất cả</option>
|
||||
<option value="all">{Yii::t("app", "TAT_CA")}</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
|
||||
<i class="fa fa-search"></i> {Yii::t("app", "TIM_KIEM")}
|
||||
</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
|
||||
<input type="checkbox" name="BatchDelete" style="width: inherit;"> {Yii::t("app", "XOA_NHIEU_DU_LIEU")}
|
||||
<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>
|
||||
<button onclick="checkAll(true);">{Yii::t("app", "CHON_TOAN_BO_TRANG")}</button>
|
||||
<button onclick="checkAll(false);">{Yii::t("app", "BO_CHON")}</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>
|
||||
<button class="btn btn-danger" onclick="batchDelete(this);" data-href="{Url::to(['/list-management/batch-delete'])}">{Yii::t("app", "XAC_NHAN_XOA")}</button>
|
||||
<button class="btn btn-success" onclick="scheduleForm(this);" data-href="{Url::to(['/list-management/schedule'])}">{Yii::t("app", "LICH_TRINH")}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr style="border-top: 1px solid #000;">
|
||||
<h4>Đồng bộ với máy chủ</h4>
|
||||
<h4>{Yii::t("app", "DONG_BO_VOI_MAY_CHU")}</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ủ
|
||||
<i class="fa fa-download"></i> {Yii::t("app", "DONG_BO_TU_MAY_CHU")}
|
||||
</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ủ
|
||||
<i class="fa fa-upload"></i> {Yii::t("app", "DONG_BO_LEN_MAY_CHU")}
|
||||
</button>
|
||||
</div>
|
||||
<hr style="border-top: 1px solid #000;">
|
||||
<h4>Đồng bộ từ thiết bị khác</h4>
|
||||
<h4>{Yii::t("app", "DONG_BO_TU_THIET_BI_KHAC")}</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ị">
|
||||
<input type="text" value="" class="form-control" name="SyncIP" placeholder="{Yii::t("app", "NHAP_IP_THIET_BI")}">
|
||||
<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>
|
||||
@@ -190,22 +205,22 @@
|
||||
<hr style="border-top: 1px solid #000;">
|
||||
<table class="table table-bordered" style="background: #fff;">
|
||||
<tr>
|
||||
<td>Số người có ảnh / tổng</td>
|
||||
<td>{Yii::t("app", "SO_NGUOI_CO_ANH_TREN_TONG")}</td>
|
||||
<td class="text-right" id="totalPeople">
|
||||
{*<b class="text-red">{$statistics.totalImg}</b>/<b>{$statistics.total}</b>*}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Đặc trưng 1</td>
|
||||
<td>{Yii::t("app", "DAC_TRUNG_1")}</td>
|
||||
<td class="text-right" id="total128">
|
||||
{* <b class="text-red">{$statistics.128}</b>/<b>{$statistics.img}</b>*}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Đặc trưng 2
|
||||
{Yii::t("app", "DAC_TRUNG_2")}
|
||||
{if $updating->data==="true"}
|
||||
<label class="label label-danger" id="updating-label">Đang cập nhật ...</label>
|
||||
<label class="label label-danger" id="updating-label">{Yii::t("app", "DANG_CAP_NHAT")}</label>
|
||||
{/if}
|
||||
</td>
|
||||
<td class="text-right" id="total512">
|
||||
@@ -218,19 +233,19 @@
|
||||
<div style="width: 200px;position: absolute;" id="menu" class="hidden">
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading text-bold">
|
||||
Thao tác
|
||||
{Yii::t("app", "THAO_TAC")}
|
||||
<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"])}'>Sửa</button>
|
||||
<button onclick="_delete(this);" data-href="{Url::to(["/list-management/delete"])}">Xóa</button>
|
||||
<button onclick="_formModified(this);" data-href='{Url::to(["/list-management/form-update"])}'>{Yii::t("app", "SUA")}</button>
|
||||
<button onclick="_delete(this);" data-href="{Url::to(["/list-management/delete"])}">{Yii::t("app", "XOA")}</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">
|
||||
Quản lý mẫu
|
||||
{Yii::t("app", "QUAN_LY_MAU")}
|
||||
<i class="fa fa-remove pull-right" style="cursor: pointer;" onclick="_close();"></i>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@@ -245,7 +260,7 @@
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-right">Danh sách</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "DANH_SACH")}</div>
|
||||
<div class="col-md-8">
|
||||
<select style="width: 100%;height: 26px;" name="Type">
|
||||
{html_options options=$typeArray}
|
||||
@@ -253,7 +268,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row hidden">
|
||||
<div class="col-md-4 text-right">ID</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "ID")}</div>
|
||||
<div class="col-md-8" id="form-add-staff">
|
||||
<select name='Code' id='Code' onchange="chooseStaff(this);" data-href="{Url::to("/list-management/choose-staff")}">
|
||||
<option value=""></option>
|
||||
@@ -262,19 +277,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-right">Tên</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "TEN")}</div>
|
||||
<div class="col-md-8">
|
||||
<input type="text" name="Name">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-right">Tên hiển thị</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "TEN_HIEN_THI")}</div>
|
||||
<div class="col-md-8">
|
||||
<input type="text" name="AbbreviatedName">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-right">Giới tính</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "GIOI_TINH")}</div>
|
||||
<div class="col-md-8">
|
||||
<select style="width: 100%;height: 26px;" name="Gender">
|
||||
{html_options options=$genderArray}
|
||||
@@ -282,19 +297,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-right">Ngày sinh</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "NGAY_SINH")}</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">Điện thoại</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "DIEN_THOAI")}</div>
|
||||
<div class="col-md-8">
|
||||
<input type="text" name="Telephone">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-right">Đơn vị</div>
|
||||
<div class="col-md-4 text-right">{Yii::t("app", "DON_VI")}</div>
|
||||
<div class="col-md-8">
|
||||
<input type="text" name="Address">
|
||||
</div>
|
||||
@@ -303,8 +318,8 @@
|
||||
</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">Lưu</button>
|
||||
<button onclick="_close();">Hủy</button>
|
||||
<button onclick="_update(this);" data-href='{Url::to(["/list-management/update"])}' id="save-btn">{Yii::t("app", "LUU")}</button>
|
||||
<button onclick="_close();">{Yii::t("app", "HUY")}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,36 +1,49 @@
|
||||
<div class="row">
|
||||
<div class="row" id="filters-face">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Tìm kiếm</div>
|
||||
<div class="input-group-addon">{Yii::t("app" ,"TIM_KIEM")}</div>
|
||||
<select class="form-control" id="filter-from-server" onchange="filters(this);">
|
||||
<option value=""></option>
|
||||
{html_options options=$filters}
|
||||
</select>
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" data-toggle="tooltip" title="Hủy bỏ tìm kiếm" onclick="removeFilters();">
|
||||
<button class="btn btn-default" data-toggle="tooltip" title="{Yii::t("app", "HUY_BO_TIM_KIEM")}" onclick="removeFilters();">
|
||||
<i class="fa fa-remove"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8 text-right">
|
||||
<button class="btn btn-default btn-select" id="btnCheckLossImage" onclick="filtersLossImage(this);">
|
||||
{Yii::t("app", "DOI_TUONG_CHUA_DU_ANH_MAU")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="max-height: 750px;overflow-y: auto;">
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Tên</th>
|
||||
<th>Tên hiển thị</th>
|
||||
<th>Đơn vị</th>
|
||||
<th>Hình ảnh đăng kí</th>
|
||||
<th>Company ID</th>
|
||||
<th>{Yii::t("app", "ID")}</th>
|
||||
<th>{Yii::t("app", "TEN_HIEN_THI")}</th>
|
||||
<th>{Yii::t("app", "TEN")}</th>
|
||||
<th>{Yii::t("app", "DON_VI")}</th>
|
||||
<th>{Yii::t("app", "HINH_ANH_DANG_KI")}</th>
|
||||
<th>{Yii::t("app", "COMPANY_ID")}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="sync-lists">
|
||||
{$totalDevice=0}
|
||||
{$totalCloud=0}
|
||||
{foreach from=$datas item=arr}
|
||||
<tr id="filters-{$arr.id}" onclick="choooseToSync(this);" style="cursor: pointer;" class="filters {if !in_array($arr.id,$allID)}not-in-list{/if}" data-stt="false" data-id="{trim($arr.id)}">
|
||||
{$totalImg=0}
|
||||
{if isset($personImage[$arr.id])}
|
||||
{$totalImg=$personImage[$arr.id]}
|
||||
{/if}
|
||||
{$totalDevice=$totalDevice+$totalImg}
|
||||
{$totalCloud=$totalCloud+count($arr.images)}
|
||||
<tr id="filters-{$arr.id}" onclick="choooseToSync(this);" style="cursor: pointer;" class="filters {if $totalImg!==count($arr.images)}loss-image{/if} {if !in_array($arr.id,$allID)}not-in-list{/if}" data-stt="false" data-id="{trim($arr.id)}">
|
||||
<td>
|
||||
<div id="full-data-{trim($arr.id)}" class="hidden">{json_encode($arr)}</div>
|
||||
{$arr.code}
|
||||
@@ -38,7 +51,11 @@
|
||||
<i class="fa fa-check-circle text-green"></i>
|
||||
{/if}
|
||||
</td>
|
||||
<td>{$arr.name}</td>
|
||||
<td>
|
||||
<b class="text-green">[{$totalImg}]</b>
|
||||
<b class="text-red">[{count($arr.images)}]</b>
|
||||
{$arr.name}
|
||||
</td>
|
||||
<td>{$arr.abbreviated_name}</td>
|
||||
<td>{$arr.department}</td>
|
||||
<td>
|
||||
@@ -56,14 +73,16 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<b class="text-green" id="totalDevice">[{$totalDevice}]</b>
|
||||
<b class="text-red" id="totalCloud">[{$totalCloud}]</b>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<i class="fa fa-info-circle"></i> Đã lựa chọn <b class="text-red" id="totals-choose">0</b> đối tượng.
|
||||
<i class="fa fa-info-circle"></i> {Yii::t("app", "DA_LUA_CHON_X_DOI_TUONG")}
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="hidden" id="progress-form">
|
||||
Đồng bộ <b id="progress-current" class="text-green">0</b>/<b id="progress-totals" class="text-red">0</b> đối tượng.
|
||||
{Yii::t("app", "DONG_BO_X_Y_DOI_TUONG")}
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-primary progress-bar-striped" id='progress' role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
|
||||
0%
|
||||
@@ -73,17 +92,17 @@
|
||||
</div>
|
||||
<div class="col-md-5 text-right">
|
||||
<button class="btn btn-default btn-select" onclick="checkAllNotInList();">
|
||||
Chọn đối tượng chưa tồn tại
|
||||
{Yii::t("app", "CHON_DOI_TUONG_CHUA_TON_TAI")}
|
||||
</button>
|
||||
<button class="btn btn-default btn-select" onclick="checkAllSync(true);">
|
||||
Chọn tất cả
|
||||
{Yii::t("app", "CHON_TAT_CA")}
|
||||
</button>
|
||||
<button class="btn btn-default btn-select" onclick="checkAllSync(false);">
|
||||
Bỏ chọn tất cả
|
||||
{Yii::t("app", "BO_CHON_TAT_CA")}
|
||||
</button>
|
||||
<button class="btn btn-primary" onclick="_syncFromServer();">
|
||||
<i class="fa fa-refresh"></i> Đồng bộ
|
||||
<i class="fa fa-refresh"></i> {Yii::t("app", "DONG_BO")}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-remove"></span> Đóng lại</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-remove"></span> {Yii::t("app", "DONG_LAI")}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<div class="row">
|
||||
<div class="row" id="filters-face">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Tìm kiếm</div>
|
||||
<div class="input-group-addon">{Yii::t("app" ,"TIM_KIEM")}</div>
|
||||
<select class="form-control" id="filter-from-server" onchange="filters(this);">
|
||||
<option value=""></option>
|
||||
{html_options options=$filters}
|
||||
</select>
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" data-toggle="tooltip" title="Hủy bỏ tìm kiếm" onclick="removeFilters();">
|
||||
<button class="btn btn-default" data-toggle="tooltip" title="{Yii::t("app", "HUY_BO_TIM_KIEM")}" onclick="removeFilters();">
|
||||
<i class="fa fa-remove"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -20,14 +20,14 @@
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Tên</th>
|
||||
<th>Tên hiển thị</th>
|
||||
<th>Giới tính</th>
|
||||
<th>Hình ảnh đăng kí</th>
|
||||
<th>Ngày sinh</th>
|
||||
<th>Điện thoại</th>
|
||||
<th>Đơn vị</th>
|
||||
<th>{Yii::t("app", "ID")}<</th>
|
||||
<th>{Yii::t("app", "TEN_HIEN_THI")}</th>
|
||||
<th>{Yii::t("app", "TEN")}<</th>
|
||||
<th>{Yii::t("app", "GIOI_TINH")}</th>
|
||||
<th>{Yii::t("app", "HINH_ANH_DANG_KI")}</th>
|
||||
<th>{Yii::t("app", "NGAY_SINH")}</th>
|
||||
<th>{Yii::t("app", "DIEN_THOAI")}</th>
|
||||
<th>{Yii::t("app", "DON_VI")}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="sync-lists">
|
||||
@@ -56,11 +56,11 @@
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<i class="fa fa-info-circle"></i> Đã lựa chọn <b class="text-red" id="totals-choose">0</b> đối tượng.
|
||||
<i class="fa fa-info-circle"></i> {Yii::t("app", "DA_LUA_CHON_X_DOI_TUONG")}
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="hidden" id="progress-form">
|
||||
Đồng bộ <b id="progress-current" class="text-green">0</b>/<b id="progress-totals" class="text-red">0</b> đối tượng.
|
||||
{Yii::t("app", "DONG_BO_X_Y_DOI_TUONG")}
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-primary progress-bar-striped" id='progress' role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
|
||||
0%
|
||||
@@ -70,14 +70,14 @@
|
||||
</div>
|
||||
<div class="col-md-4 text-right">
|
||||
<button class="btn btn-default btn-select" onclick="checkAllSync(true);">
|
||||
Chọn tất cả
|
||||
{Yii::t("app", "CHON_TAT_CA")}
|
||||
</button>
|
||||
<button class="btn btn-default btn-select" onclick="checkAllSync(false);">
|
||||
Bỏ chọn tất cả
|
||||
{Yii::t("app", "BO_CHON_TAT_CA")}
|
||||
</button>
|
||||
<button class="btn btn-primary" onclick="_syncToServer();">
|
||||
<i class="fa fa-refresh"></i> Đồng bộ
|
||||
<i class="fa fa-refresh"></i> {Yii::t("app", "DONG_BO")}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-remove"></span> Đóng lại</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-remove"></span> {Yii::t("app", "DONG_LAI")}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<div class="row">
|
||||
<div class="row" id="filters-face">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">Tìm kiếm</div>
|
||||
<div class="input-group-addon">{Yii::t("app" ,"TIM_KIEM")}</div>
|
||||
<select class="form-control" id="filter-from-server" onchange="filters(this);">
|
||||
<option value=""></option>
|
||||
{html_options options=$filters}
|
||||
</select>
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" data-toggle="tooltip" title="Hủy bỏ tìm kiếm" onclick="removeFilters();">
|
||||
<button class="btn btn-default" data-toggle="tooltip" title="{Yii::t("app", "HUY_BO_TIM_KIEM")}" onclick="removeFilters();">
|
||||
<i class="fa fa-remove"></i>
|
||||
</button>
|
||||
</div>
|
||||
@@ -20,15 +20,15 @@
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Loại</th>
|
||||
<th>Tên</th>
|
||||
<th>Giới tính</th>
|
||||
<th>Hình ảnh đăng kí</th>
|
||||
<th>Thời gian đăng kí</th>
|
||||
<th>Ngày sinh</th>
|
||||
<th>Điện thoại</th>
|
||||
<th>Đơn vị</th>
|
||||
<th>{Yii::t("app", "ID")}</th>
|
||||
<th>{Yii::t("app", "LOAI")}</th>
|
||||
<th>{Yii::t("app", "TEN")}</th>
|
||||
<th>{Yii::t("app", "GIOI_TINH")}</th>
|
||||
<th>{Yii::t("app", "HINH_ANH_DANG_KI")}</th>
|
||||
<th>{Yii::t("app", "THOI_GIAN_DANG_KI")}</th>
|
||||
<th>{Yii::t("app", "NGAY_SINH")}</th>
|
||||
<th>{Yii::t("app", "DIEN_THOAI")}</th>
|
||||
<th>{Yii::t("app", "DON_VI")}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="sync-lists">
|
||||
@@ -58,11 +58,11 @@
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<i class="fa fa-info-circle"></i> Đã lựa chọn <b class="text-red" id="totals-choose">0</b> đối tượng.
|
||||
<i class="fa fa-info-circle"></i> {Yii::t("app", "DA_LUA_CHON_X_DOI_TUONG")}
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="hidden" id="progress-form">
|
||||
Đồng bộ <b id="progress-current" class="text-green">0</b>/<b id="progress-totals" class="text-red">0</b> đối tượng.
|
||||
{Yii::t("app", "DONG_BO_X_Y_DOI_TUONG")}
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-primary progress-bar-striped" id='progress' role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
|
||||
0%
|
||||
@@ -72,14 +72,14 @@
|
||||
</div>
|
||||
<div class="col-md-4 text-right">
|
||||
<button class="btn btn-default btn-select" onclick="checkAllSync(true);">
|
||||
Chọn tất cả
|
||||
{Yii::t("app", "CHON_TAT_CA")}
|
||||
</button>
|
||||
<button class="btn btn-default btn-select" onclick="checkAllSync(false);">
|
||||
Bỏ chọn tất cả
|
||||
{Yii::t("app", "BO_CHON_TAT_CA")}
|
||||
</button>
|
||||
<button class="btn btn-primary" onclick="_sync();">
|
||||
<i class="fa fa-refresh"></i> Đồng bộ
|
||||
<i class="fa fa-refresh"></i> {Yii::t("app", "DONG_BO")}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-remove"></span> Đóng lại</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-remove"></span> {Yii::t("app", "DONG_LAI")}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
71
views/list-management/schedule-delete.tpl
Normal file
71
views/list-management/schedule-delete.tpl
Normal file
@@ -0,0 +1,71 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{Yii::t("app", "THOI_GIAN_VAO")}</label>
|
||||
<input type="text" value="{$model->from_time|default:"00:00"}" class="form-control" id="fromTime" disabled="" name="FromTime">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{Yii::t("app", "THOI_GIAN_RA")}</label>
|
||||
<input type="text" value="{$model->to_time|default:"23:59"}" class="form-control" id="toTime" disabled=" name="ToTime">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{Yii::t("app", "NGAY_BAT_DAU")}</label>
|
||||
<input type="text" value="{$model->from_date|default:date("d/m/Y")}" class="form-control" disabled=" id="fromDate" name="FromDate">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{Yii::t("app", "NGAY_KET_THUC")}</label>
|
||||
<input type="text" value="{$model->to_date|default:date("d/m/Y")}" class="form-control" disabled=" id="toDate" name="ToDate">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{Yii::t("app", "NGAY_TRONG_TUAN")}</label>
|
||||
{$dateOfWeek=["1","2","3","4","5","6","7","8"]}
|
||||
{$dateOfWeek=explode(",",$model->date_of_week)}
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{if in_array("2",$dateOfWeek)}<i class="fa fa-check text-green"></i>{else}<i class="fa fa-remove text-red"></i>{/if} {Yii::t("app", "THU_HAI")}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{if in_array("3",$dateOfWeek)}<i class="fa fa-check text-green"></i>{else}<i class="fa fa-remove text-red"></i>{/if} {Yii::t("app", "THU_BA")}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{if in_array("4",$dateOfWeek)}<i class="fa fa-check text-green"></i>{else}<i class="fa fa-remove text-red"></i>{/if} {Yii::t("app", "THU_TU")}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{if in_array("5",$dateOfWeek)}<i class="fa fa-check text-green"></i>{else}<i class="fa fa-remove text-red"></i>{/if} {Yii::t("app", "THU_NAM")}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{if in_array("6",$dateOfWeek)}<i class="fa fa-check text-green"></i>{else}<i class="fa fa-remove text-red"></i>{/if} {Yii::t("app", "THU_SAU")}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{if in_array("7",$dateOfWeek)}<i class="fa fa-check text-green"></i>{else}<i class="fa fa-remove text-red"></i>{/if} {Yii::t("app", "THU_BAY")}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
{if in_array("8",$dateOfWeek)}<i class="fa fa-check text-green"></i>{else}<i class="fa fa-remove text-red"></i>{/if} {Yii::t("app", "CHU_NHAT")}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<input type='checkbox' value='1' name='editAll' checked=""> {Yii::t("app","AP_DUNG_CHO_TAT_CA_DOI_TUONG_DA_CHON")}
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
<button class="btn btn-danger" onclick="deleteSchedule(this);" data-href="{yii\helpers\Url::to(["/list-management/delete-schedule","id"=>$model->id])}">
|
||||
<i class="fa fa-remove"></i> {Yii::t("app","XOA_LICH_TRINH")}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="fa fa-remove"></span> {Yii::t("app", "DONG_LAI")}</button>
|
||||
</div>
|
||||
</div>
|
||||
80
views/list-management/schedule.tpl
Normal file
80
views/list-management/schedule.tpl
Normal file
@@ -0,0 +1,80 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{Yii::t("app", "THOI_GIAN_VAO")}</label>
|
||||
<input type="text" value="{$model->from_time|default:"00:00"}" class="form-control" id="fromTime" name="FromTime">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{Yii::t("app", "THOI_GIAN_RA")}</label>
|
||||
<input type="text" value="{$model->to_time|default:"23:59"}" class="form-control" id="toTime" name="ToTime">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{Yii::t("app", "NGAY_BAT_DAU")}</label>
|
||||
<input type="text" value="{$model->from_date|default:date("d/m/Y")}" class="form-control" id="fromDate" name="FromDate">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{Yii::t("app", "NGAY_KET_THUC")}</label>
|
||||
<input type="text" value="{$model->to_date|default:date("d/m/Y")}" class="form-control" id="toDate" name="ToDate">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label">{Yii::t("app", "NGAY_TRONG_TUAN")}</label>
|
||||
{$dateOfWeek=["1","2","3","4","5","6","7","8"]}
|
||||
{if $type=="edit"}
|
||||
{$dateOfWeek=explode(",",$model->date_of_week)}
|
||||
{/if}
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<input type='checkbox' value='2' name="checkbox-date" {if in_array("2",$dateOfWeek)}checked=""{/if}> {Yii::t("app", "THU_HAI")}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type='checkbox' value='3' name="checkbox-date" {if in_array("3",$dateOfWeek)}checked=""{/if}> {Yii::t("app", "THU_BA")}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type='checkbox' value='4' name="checkbox-date" {if in_array("4",$dateOfWeek)}checked=""{/if}> {Yii::t("app", "THU_TU")}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type='checkbox' value='5' name="checkbox-date" {if in_array("5",$dateOfWeek)}checked=""{/if}> {Yii::t("app", "THU_NAM")}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type='checkbox' value='6' name="checkbox-date" {if in_array("6",$dateOfWeek)}checked=""{/if}> {Yii::t("app", "THU_SAU")}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type='checkbox' value='7' name="checkbox-date" {if in_array("7",$dateOfWeek)}checked=""{/if}> {Yii::t("app", "THU_BAY")}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type='checkbox' value='8' name="checkbox-date" {if in_array("8",$dateOfWeek)}checked=""{/if}> {Yii::t("app", "CHU_NHAT")}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{if $type=="edit"}
|
||||
<input type='checkbox' value='1' name='editAll' checked=""> {Yii::t("app","AP_DUNG_CHO_TAT_CA_DOI_TUONG_DA_CHON")}
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
{if $type=="edit"}
|
||||
<button class="btn btn-primary" onclick="editSchedule(this);" data-href="{yii\helpers\Url::to(["/list-management/edit-schedule",'id'=>$model->id])}">
|
||||
<i class="fa fa-floppy-o"></i> {Yii::t("app","LUU_LAI")}
|
||||
</button>
|
||||
{else}
|
||||
<button class="btn btn-primary" onclick="addSchedule(this);" data-href="{yii\helpers\Url::to(["/list-management/schedule"])}">
|
||||
<i class="fa fa-floppy-o"></i> {Yii::t("app","LUU_LAI")}
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -10,26 +10,26 @@
|
||||
<input type="hidden" value="{$model->password}" name="password">
|
||||
<div class="well" style="background: #fff;">
|
||||
<div class="form-group" id="old-password">
|
||||
<label class="control-label">Mật khẩu cũ</label>
|
||||
<label class="control-label">{Yii::t("app", "MAT_KHAU_CU")}</label>
|
||||
<input type="password" class="form-control" name="OldPassword">
|
||||
<span class="help-block hidden"></span>
|
||||
</div>
|
||||
<div class="form-group" id="new-password">
|
||||
<label class="control-label">Mật khẩu mới</label>
|
||||
<label class="control-label">{Yii::t("app", "MAT_KHAU_MOI")}</label>
|
||||
<input type="password" class="form-control" name="NewPassword">
|
||||
<span class="help-block hidden"></span>
|
||||
</div>
|
||||
<div class="form-group" id="re-new-password">
|
||||
<label class="control-label">Nhắc lại mật khẩu mới</label>
|
||||
<label class="control-label">{Yii::t("app", "NHAC_LAI_MAT_KHAU_MOI")}</label>
|
||||
<input type="password" class="form-control" name="ReNewPassword">
|
||||
<span class="help-block hidden"></span>
|
||||
</div>
|
||||
<div class="alert alert-success hidden" id='success' style="padding: 5px;">
|
||||
<i class="fa fa-check"></i> Đổi mật khẩu thành công!
|
||||
<i class="fa fa-check"></i> {Yii::t("app", "DOI_MAT_KHAU_THANH_CONG")}
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<button class="btn btn-primary" onclick="user.changePassword(this);" data-href="{Url::to(['/user/change-password','id'=>$model->id])}">
|
||||
<i class="fa fa-lock"></i> Đổi mật khẩu
|
||||
<i class="fa fa-lock"></i> {Yii::t("app", "DOI_MAT_KHAU")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,37 +26,37 @@
|
||||
</div>
|
||||
<br>
|
||||
<div class="form-group" id="username">
|
||||
<label class="control-label" for="user-username">Tên đăng nhập</label>
|
||||
<label class="control-label" for="user-username">{Yii::t("app", "TEN_DANG_NHAP")}</label>
|
||||
<input type="text" class="form-control" name="Username" readonly="" value="{$model->username}">
|
||||
<span class="help-block hidden"></span>
|
||||
</div>
|
||||
<div class="form-group" id="name">
|
||||
<label class="control-label" for="user-first-name">Họ tên</label>
|
||||
<label class="control-label" for="user-first-name">{Yii::t("app", "HO_TEN")}</label>
|
||||
<input type="text" class="form-control" name="Name" value="{$model->first_name}">
|
||||
<span class="help-block hidden"></span>
|
||||
</div>
|
||||
<div class="form-group" id="phone">
|
||||
<label class="control-label" for="user-phone-number">Điện thoại</label>
|
||||
<label class="control-label" for="user-phone-number">{Yii::t("app", "DIEN_THOAI")}</label>
|
||||
<input type="text" class="form-control" name="PhoneNumber" value="{$model->phone_number}">
|
||||
<span class="help-block hidden"></span>
|
||||
</div>
|
||||
<div class="form-group" id="email">
|
||||
<label class="control-label" for="user-email">Email</label>
|
||||
<label class="control-label" for="user-email">{Yii::t("app", "EMAIL")}</label>
|
||||
<input type="text" class="form-control" name="Email" value="{$model->email}">
|
||||
<span class="help-block hidden"></span>
|
||||
</div>
|
||||
<div class="form-group" id="roles">
|
||||
<label class="control-label" for="user-role">Loại người dùng</label>
|
||||
<label class="control-label" for="user-role">{Yii::t("app", "LOAI_NGUOI_DUNG")}</label>
|
||||
<br>
|
||||
{$model->roleName}
|
||||
</div>
|
||||
<hr>
|
||||
<div class="alert alert-success hidden" id='success' style="padding: 5px;">
|
||||
<i class="fa fa-check"></i> Thông tin đã được lưu lại!
|
||||
<i class="fa fa-check"></i> {Yii::t("app", "THONG_TIN_DA_DUOC_LUU_LAI")}
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<button class="btn btn-primary" onclick="user.saveInfo(this);" data-href="{Url::to(['/user/info','id'=>$model->id])}">
|
||||
<i class="fa fa-floppy-o"></i> Lưu lại
|
||||
<i class="fa fa-floppy-o"></i> {Yii::t("app", "LUU_LAI")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
0
web/assets/temp.txt
Normal file → Executable file
0
web/assets/temp.txt
Normal file → Executable file
BIN
web/images/lang/en.png
Normal file
BIN
web/images/lang/en.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
BIN
web/images/lang/jp.png
Normal file
BIN
web/images/lang/jp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
BIN
web/images/lang/vi.png
Normal file
BIN
web/images/lang/vi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
@@ -2,7 +2,7 @@
|
||||
|
||||
// comment out the following two lines when deployed to production
|
||||
//defined('YII_DEBUG') or define('YII_DEBUG', true);
|
||||
//defined('YII_ENV') or define('YII_ENV', 'dev');
|
||||
//defined('YII_ENV') or define('YII_ENV', 'dev');
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';
|
||||
|
||||
@@ -24,7 +24,7 @@ function _form(e) {
|
||||
$("input[name='CaptureLogsID']").val($(e).attr("data-id"));
|
||||
$("#FaceImage").attr("src", $(e).attr("data-img"));
|
||||
var confidence = JSON.parse($(e).attr("data-confidence"));
|
||||
$("#closest-img").attr("src", confidence.img);
|
||||
$("#closest-img").attr("src", confidence.img != "" ? confidence.img : "/images/user2-160x160.jpg");
|
||||
$("#closest-name").html(confidence.name + " [" + confidence.score + "]");
|
||||
}
|
||||
|
||||
@@ -35,17 +35,17 @@ function _close() {
|
||||
function _save(e) {
|
||||
var code = $("select[name='Code']").val();
|
||||
if (code === "") {
|
||||
alert("Hãy chọn đối tượng!");
|
||||
alert($("input[name='HAY_CHON_DOI_TUONG']").val());
|
||||
return;
|
||||
}
|
||||
var name = $("input[name='Name']").val();
|
||||
if (name === "") {
|
||||
alert("Hãy nhập tên!");
|
||||
alert($("input[name='HAY_NHAP_TEN']").val());
|
||||
return;
|
||||
}
|
||||
var abbreviated_name = $("input[name='AbbreviatedName']").val();
|
||||
if (abbreviated_name === "") {
|
||||
alert("Hãy nhập tên hiển thị!");
|
||||
alert($("input[name='HAY_NHAP_TEN_HIEN_THI']").val());
|
||||
return;
|
||||
}
|
||||
common.modalBlock(true);
|
||||
@@ -66,7 +66,7 @@ function _save(e) {
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
if (data.status) {
|
||||
alert("Đã thêm dữ liệu thành công!");
|
||||
alert($("input[name='CAP_NHAT_DU_LIEU_THANH_CONG']").val());
|
||||
window.location.reload(true);
|
||||
} else {
|
||||
alert(data.text);
|
||||
|
||||
@@ -49,6 +49,7 @@ $(document).on('focusin', function (e) {
|
||||
/**
|
||||
* Các hàm sử dụng chung
|
||||
*/
|
||||
$('select').select2();
|
||||
var common = {};
|
||||
common.csrf = $('meta[name="csrf-token"]').attr("content");
|
||||
common.csrfParam = $('meta[name="csrf-param"]').attr("content");
|
||||
@@ -155,7 +156,7 @@ common.modalAlert = function (text, cls, link) {
|
||||
}
|
||||
};
|
||||
common.ajaxError = function () {
|
||||
common.modalAlert("Có lỗi xảy ra, có thể do đường truyền mạng, xin vui lòng thử lại!", "danger", "");
|
||||
common.modalAlert($("input[name='CO_LOI_XAY_RA_HAY_THU_LAI']").val(), "danger", "");
|
||||
};
|
||||
common.btnUpload = function (mUrl, className, extension, fileSize) {
|
||||
var fData = {
|
||||
@@ -310,14 +311,14 @@ common.reset = function (e) {
|
||||
if ($("input[name='ResetDevice']").is(':checked'))
|
||||
resetDevice = true;
|
||||
if (!deleteDB && !resetDevice) {
|
||||
alert("Hãy lựa chọn thao tác!");
|
||||
alert($("input[name='HAY_LUA_CHON_THAO_TAC']").val());
|
||||
return;
|
||||
}
|
||||
var confirmText = "";
|
||||
if (deleteDB)
|
||||
confirmText = "Bạn có chắc chắn muốn xóa dữ liệu lưu trữ trong thiết bị không?";
|
||||
confirmText = $("input[name='DELETE_DB_CONFIRM']").val();
|
||||
if (resetDevice)
|
||||
confirmText = "Bạn có chắc chắn muốn reset cấu hình thiết bị không?";
|
||||
confirmText = $("input[name='RESET_DB_CONFIRM']").val();
|
||||
if (confirm(confirmText)) {
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
@@ -328,7 +329,14 @@ common.reset = function (e) {
|
||||
resetDevice: resetDevice
|
||||
},
|
||||
success: function (data) {
|
||||
window.location = data;
|
||||
common.modalBlock(false);
|
||||
if (data.status)
|
||||
window.location = data.url;
|
||||
else {
|
||||
$("#reset-error").removeClass("hidden");
|
||||
$("#reset-close").addClass("hidden");
|
||||
$("#reset-accept").html(data.btnText);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
@@ -342,7 +350,37 @@ common.validateIp = function (Ip) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
common.changeLanguage = function (e) {
|
||||
$.ajax({
|
||||
url: $(e).attr("href"),
|
||||
type: 'POST',
|
||||
success: function (data) {
|
||||
window.location.reload(true);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
}
|
||||
});
|
||||
};
|
||||
common.changePerPage = function (e) {
|
||||
if (window.location.search !== "") {
|
||||
var perPage = common.getUrlParameter("per-page");
|
||||
if (perPage) {
|
||||
var sPageURL = decodeURIComponent(window.location.search.substring(1));
|
||||
var sURLVariables = sPageURL.split('&');
|
||||
var newUrl = [];
|
||||
for (var i = 0; i < sURLVariables.length; i++) {
|
||||
var temp = sURLVariables[i].split('=');
|
||||
if (temp[0] !== "per-page")
|
||||
newUrl.push(sURLVariables[i]);
|
||||
}
|
||||
newUrl.push("per-page=" + $(e).val());
|
||||
window.location = window.location.origin + window.location.pathname + "?" + newUrl.join("&");
|
||||
} else
|
||||
window.location = window.location + "&per-page=" + $(e).val();
|
||||
} else
|
||||
window.location = window.location + "?per-page=" + $(e).val();
|
||||
};
|
||||
/**
|
||||
* =========================
|
||||
*/
|
||||
|
||||
108
web/js/config.js
108
web/js/config.js
@@ -4,12 +4,12 @@ $(function () {
|
||||
function saveStep1(e) {
|
||||
var servermqtt = $("input[name='servermqtt']").val();
|
||||
if (servermqtt === "") {
|
||||
alert("Hãy nhập thông tin!");
|
||||
alert($("input[name='HAY_NHAP_THONG_TIN']").val());
|
||||
return;
|
||||
}
|
||||
var url = $("input[name='url']").val();
|
||||
if (url === "") {
|
||||
alert("Hãy nhập thông tin!");
|
||||
alert($("input[name='HAY_NHAP_THONG_TIN']").val());
|
||||
return;
|
||||
}
|
||||
common.modalBlock(true);
|
||||
@@ -34,7 +34,7 @@ function saveStep1(e) {
|
||||
if (data.text === "error") {
|
||||
c++;
|
||||
if (c == 5) {
|
||||
alert("Box chưa được đăng kí trên CMS!");
|
||||
alert($("input[name='BOX_CHUA_DUOC_DANG_KI_TREN_CMS']").val());
|
||||
window.location.reload(true);
|
||||
}
|
||||
} else {
|
||||
@@ -75,11 +75,10 @@ function saveStep2(e) {
|
||||
config: cfg
|
||||
},
|
||||
success: function (data) {
|
||||
if (data) {
|
||||
notification.success("Đã lưu cấu hình!", 2000);
|
||||
} else {
|
||||
notification.success("Lưu cấu hình thất bại!", 2000);
|
||||
}
|
||||
if (data)
|
||||
notification.success($("input[name='DA_LUU_CAU_HINH']").val(), 2000);
|
||||
else
|
||||
notification.success($("input[name='LUU_CAU_HINH_THAT_BAI']").val(), 2000);
|
||||
common.modalBlock(false);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
@@ -93,7 +92,7 @@ function SaveConfigDevice(e) {
|
||||
var server_api = $("input[name='server_api']").val();
|
||||
var device_id = $("input[name='device_id']").val();
|
||||
if (server_api === "" || device_id === "") {
|
||||
alert("Hãy nhập đủ thông tin");
|
||||
alert($("input[name='HAY_NHAP_THONG_TIN']").val());
|
||||
return;
|
||||
}
|
||||
common.modalBlock(true);
|
||||
@@ -105,11 +104,10 @@ function SaveConfigDevice(e) {
|
||||
device_id: device_id
|
||||
},
|
||||
success: function (data) {
|
||||
if (data) {
|
||||
notification.success("Đã lưu cấu hình!", 2000);
|
||||
} else {
|
||||
notification.success("Lưu cấu hình thất bại!", 2000);
|
||||
}
|
||||
if (data)
|
||||
notification.success($("input[name='DA_LUU_CAU_HINH']").val(), 2000);
|
||||
else
|
||||
notification.success($("input[name='LUU_CAU_HINH_THAT_BAI']").val(), 2000);
|
||||
common.modalBlock(false);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
@@ -117,4 +115,86 @@ function SaveConfigDevice(e) {
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function ValidateIPaddress(ipaddress) {
|
||||
if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function validData(inputName) {
|
||||
var ip = $("input[name='" + inputName + "']").val();
|
||||
if (ip == "" && document.getElementById('dhcp_check').checked)
|
||||
return true;
|
||||
if (!ValidateIPaddress(ip)) {
|
||||
common.error(inputName, "");
|
||||
return false;
|
||||
} else {
|
||||
common.success(inputName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function validDNS(inputName) {
|
||||
var dns = $("input[name='" + inputName + "']").val();
|
||||
if (dns == "")
|
||||
return true;
|
||||
return validData(inputName);
|
||||
}
|
||||
|
||||
function changeIP(e) {
|
||||
var valid = validData("device_ip");
|
||||
valid = validData("subnet_mask");
|
||||
valid = validData("gateway");
|
||||
valid = validDNS("dns1");
|
||||
valid = validDNS("dns2");
|
||||
if (!valid)
|
||||
return;
|
||||
if (confirm($("input[name='BAN_CO_CHAC_CHAN_MUON_DOI_IP_KHONG']").val())) {
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
type: 'POST',
|
||||
data: {
|
||||
device_ip: $("input[name='device_ip']").val(),
|
||||
subnet_mask: $("input[name='subnet_mask']").val(),
|
||||
gateway: $("input[name='gateway']").val(),
|
||||
dns1: $("input[name='dns1']").val(),
|
||||
dns2: $("input[name='dns2']").val(),
|
||||
dhcp: document.getElementById('dhcp_check').checked
|
||||
},
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
if (!data.status)
|
||||
common.error("subnet_mask", "");
|
||||
else
|
||||
window.location = data.url;
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function reboot(e) {
|
||||
if (confirm($("input[name='BAN_CO_CHAC_CHAN_MUON_REBOOT_KHONG']").val())) {
|
||||
$("#reboot-blocking").modal({
|
||||
keyboard: false,
|
||||
backdrop: false
|
||||
});
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
type: 'POST',
|
||||
success: function (data) {
|
||||
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
// $("#reboot-blocking").modal("hide");
|
||||
// common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ function _useFeature(e) {
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
if (data.status) {
|
||||
alert("Đã thêm hình ảnh mẫu!");
|
||||
alert($("input[name='DA_THEM_HINH_ANH_MAU']").val());
|
||||
} else {
|
||||
alert(data.text);
|
||||
}
|
||||
|
||||
53
web/js/face-comparison.js
Normal file
53
web/js/face-comparison.js
Normal file
@@ -0,0 +1,53 @@
|
||||
$(function () {
|
||||
btnFace("1");
|
||||
btnFace("2");
|
||||
});
|
||||
|
||||
function btnFace(imageIndex) {
|
||||
var fData = {
|
||||
UploadImage: true,
|
||||
imageIndex: imageIndex
|
||||
};
|
||||
fData[common.csrfParam] = common.csrf;
|
||||
new afuButton({
|
||||
uploadURI: $("input[name='url_upload_face']").val(),
|
||||
formData: fData,
|
||||
wrap: {
|
||||
tagName: 'div',
|
||||
classes: ''
|
||||
},
|
||||
fileExtension: '.png,.jpg,.jpeg,.gif',
|
||||
fileSizeLimit: 1,
|
||||
classes: 'btn btn-default',
|
||||
fakeInputContent: '<span class=\'fa fa-file-image-o\'></span> Chọn hình ảnh',
|
||||
onUploaded: function (data) {
|
||||
$("#face" + imageIndex).attr("src", "/data/uploads" + data);
|
||||
common.uploadBlock(false);
|
||||
compareFace();
|
||||
}
|
||||
}).addInstance('image' + imageIndex);
|
||||
}
|
||||
|
||||
function compareFace() {
|
||||
var face1 = $("#face1").attr("src");
|
||||
var face2 = $("#face2").attr("src");
|
||||
if (face1 == "/images/user2-160x160.jpg" || face2 == "/images/user2-160x160.jpg")
|
||||
return;
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $("input[name='url_face_comparison']").val(),
|
||||
type: 'POST',
|
||||
data: {
|
||||
face1: face1,
|
||||
face2: face2
|
||||
},
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
$("#percent").html(data.type1 + "%<br>[" + data.type2 + "%]");
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
var x = 0, y = 0;
|
||||
var multiChoose = false;
|
||||
$(function () {
|
||||
common.dateTimePickerByClass("datepicker", "HH:mm DD/MM/YYYY");
|
||||
common.dateTimePickerDay("birthday");
|
||||
@@ -9,15 +10,26 @@ $(function () {
|
||||
$("input[name='BatchDelete']").change(function () {
|
||||
if (this.checked) {
|
||||
$("#delete-btn-group").removeClass("hidden");
|
||||
multiChoose = true;
|
||||
$(".checkbox-column").removeClass("hidden");
|
||||
} else {
|
||||
$("tr").removeClass("delete-choose");
|
||||
$("#delete-btn-group").addClass("hidden");
|
||||
multiChoose = false;
|
||||
$(".checkbox-column").addClass("hidden");
|
||||
}
|
||||
});
|
||||
btnImage();
|
||||
$("#Code").select2();
|
||||
getTotalFeature();
|
||||
setInterval(function () {
|
||||
var current = parseInt($("#current-512").html());
|
||||
var total = parseInt($("#total-512").html());
|
||||
if (current < total)
|
||||
getTotalFeature();
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
function _search(e) {
|
||||
var location = $(e).attr("data-href"); // + "?from=" + $("input[name='From']").val() + "&to=" + $("input[name='To']").val();
|
||||
location = location + "?id=" + $("input[name='IDSearch']").val();
|
||||
@@ -87,17 +99,17 @@ function _formModified(e) {
|
||||
function _update(e) {
|
||||
var code = $("select[name='Code']").val();
|
||||
if (code === "") {
|
||||
alert("Hãy chọn đối tượng!");
|
||||
alert($("input[name='HAY_CHON_DOI_TUONG']").val());
|
||||
return;
|
||||
}
|
||||
var name = $("input[name='Name']").val();
|
||||
if (name === "") {
|
||||
alert("Hãy nhập tên!");
|
||||
alert($("input[name='HAY_NHAP_TEN']").val());
|
||||
return;
|
||||
}
|
||||
var abbreviated_name = $("input[name='AbbreviatedName']").val();
|
||||
if (abbreviated_name === "") {
|
||||
alert("Hãy nhập tên hiển thị!");
|
||||
alert($("input[name='HAY_NHAP_TEN_HIEN_THI']").val());
|
||||
return;
|
||||
}
|
||||
common.modalBlock(true);
|
||||
@@ -119,10 +131,10 @@ function _update(e) {
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
if (data) {
|
||||
alert("Cập nhật dữ liệu thành công!");
|
||||
alert($("input[name='CAP_NHAT_DU_LIEU_THANH_CONG']").val());
|
||||
window.location.reload(true);
|
||||
} else
|
||||
alert("Mã đối tượng đã tồn tại!");
|
||||
alert($("input[name='MA_DOI_TUONG_DA_TON_TAI']").val());
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
@@ -132,7 +144,7 @@ function _update(e) {
|
||||
}
|
||||
|
||||
function _delete(e) {
|
||||
if (confirm("Bạn có chắc chắn muốn xóa không?")) {
|
||||
if (confirm($("input[name='DELETE_CONFIRM']").val())) {
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
@@ -152,7 +164,7 @@ function _delete(e) {
|
||||
}
|
||||
|
||||
function _deleteFeature(e) {
|
||||
if (confirm("Bạn có chắc chắn muốn xóa ảnh này không?")) {
|
||||
if (confirm($("input[name='DELETE_CONFIRM']").val())) {
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
@@ -174,16 +186,28 @@ function _deleteFeature(e) {
|
||||
}
|
||||
|
||||
function checkAll(status) {
|
||||
if (status)
|
||||
$("tr").addClass("delete-choose");
|
||||
if (status) {
|
||||
$("#list-face").find("tr").addClass("delete-choose");
|
||||
$(".checkbox-column").find("input").prop('checked', true);
|
||||
} else {
|
||||
$("#list-face").find("tr").removeClass("delete-choose");
|
||||
$(".checkbox-column").find("input").prop('checked', false);
|
||||
}
|
||||
}
|
||||
|
||||
function choose(e) {
|
||||
if (!multiChoose)
|
||||
return false;
|
||||
if ($(e).closest("tr").hasClass("delete-choose"))
|
||||
$(e).closest("tr").removeClass("delete-choose");
|
||||
else
|
||||
$("tr").removeClass("delete-choose");
|
||||
$(e).closest("tr").addClass("delete-choose");
|
||||
}
|
||||
|
||||
function batchDelete(e) {
|
||||
var check = $(".delete-choose");
|
||||
if (check.length == 0) {
|
||||
alert("Hãy chọn dữ liệu để xóa!");
|
||||
alert($("input[name='HAY_CHON_DU_LIEU_DE_XOA']").val());
|
||||
return;
|
||||
}
|
||||
var lists = [];
|
||||
@@ -191,7 +215,7 @@ function batchDelete(e) {
|
||||
if ($(this).attr("data-id") !== "")
|
||||
lists.push($(this).attr("data-id"));
|
||||
});
|
||||
if (confirm("Bạn có chắc chắn muốn xóa không?")) {
|
||||
if (confirm($("input[name='DELETE_CONFIRM']").val())) {
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
@@ -200,7 +224,7 @@ function batchDelete(e) {
|
||||
lists: lists
|
||||
},
|
||||
success: function (data) {
|
||||
alert("Đã xóa dữ liệu!");
|
||||
alert($("input[name='DA_XOA_DU_LIEU']").val());
|
||||
window.location.reload(true);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
@@ -239,7 +263,7 @@ function btnImage() {
|
||||
fileExtension: '.png,.jpg,.jpeg,.gif',
|
||||
fileSizeLimit: 1,
|
||||
classes: 'btn btn-default btn-xs',
|
||||
fakeInputContent: '<span class=\'fa fa-file-image-o\'></span> Chọn hình ảnh',
|
||||
fakeInputContent: '<span class=\'fa fa-file-image-o\'></span> ' + $("input[name='CHON_HINH_ANH']").val(),
|
||||
onUploaded: function (data) {
|
||||
var res = JSON.parse(data);
|
||||
if (res.status) {
|
||||
@@ -247,7 +271,7 @@ function btnImage() {
|
||||
$("input[name='AnhNhanVienUrl']").val(res.url);
|
||||
common.uploadBlock(false);
|
||||
} else {
|
||||
alert("Hình ảnh không nhận diện được khuôn mặt");
|
||||
alert($("input[name='HINH_ANH_KHONG_NHAN_DIEN_DUOC_KHUON_MAT']").val());
|
||||
}
|
||||
}
|
||||
}).addInstance('AnhNhanVien');
|
||||
@@ -256,17 +280,17 @@ function btnImage() {
|
||||
function _create(e) {
|
||||
var code = $("select[name='Code']").val();
|
||||
if (code === "") {
|
||||
alert("Hãy chọn đối tượng!");
|
||||
alert($("input[name='HAY_CHON_DOI_TUONG']").val());
|
||||
return;
|
||||
}
|
||||
var name = $("input[name='Name']").val();
|
||||
if (name === "") {
|
||||
alert("Hãy nhập tên!");
|
||||
alert($("input[name='HAY_NHAP_TEN']").val());
|
||||
return;
|
||||
}
|
||||
var image = $("input[name='AnhNhanVienUrl']").val();
|
||||
if (image === "") {
|
||||
alert("Hãy tải lên hình ảnh");
|
||||
alert($("input[name='HAY_TAI_LEN_HINH_ANH']").val());
|
||||
return;
|
||||
}
|
||||
common.modalBlock(true);
|
||||
@@ -286,10 +310,10 @@ function _create(e) {
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
if (data.status) {
|
||||
alert("Cập nhật dữ liệu thành công!");
|
||||
alert($("input[name='CAP_NHAT_DU_LIEU_THANH_CONG']").val());
|
||||
window.location.reload(true);
|
||||
} else
|
||||
alert("Mã đối tượng đã tồn tại!");
|
||||
alert($("input[name='MA_DOI_TUONG_DA_TON_TAI']").val());
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
@@ -301,11 +325,11 @@ function _create(e) {
|
||||
function _syncForm(e) {
|
||||
var ip = $("input[name='SyncIP']").val();
|
||||
if (ip === "") {
|
||||
common.error("ip", "Hãy nhập địa chỉ ip thiết bị muốn đồng bộ");
|
||||
common.error("ip", $("input[name='HAY_NHAP_DIA_CHI_IP_DONG_BO']").val());
|
||||
return;
|
||||
}
|
||||
if (!common.validateIp(ip)) {
|
||||
common.error("ip", "Sai định dạng ip");
|
||||
common.error("ip", $("input[name='SAI_DINH_DANG_IP']").val());
|
||||
return;
|
||||
}
|
||||
common.success("ip");
|
||||
@@ -320,12 +344,12 @@ function _syncForm(e) {
|
||||
common.modalBlock(false);
|
||||
common.modalOpenFullScreen(data.form, data.title);
|
||||
$("#filter-from-server").select2({
|
||||
placeholder: "Tìm kiếm theo ID hoặc tên"
|
||||
placeholder: $("input[name='TIM_KIEM_THEO_ID_HOAC_TEN']").val()
|
||||
});
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
alert("Không có kết nối tới thiết bị");
|
||||
alert($("input[name='KHONG_CO_KET_NOI_TOI_THIET_BI']").val());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -354,6 +378,8 @@ function checkAllSync(stt) {
|
||||
}
|
||||
|
||||
function checkAllNotInList() {
|
||||
$(".filters").addClass("hidden");
|
||||
$(".not-in-list").removeClass("hidden");
|
||||
$("#sync-lists").find("tr").removeClass("success").attr("data-stt", "false");
|
||||
$(".not-in-list").addClass("success").attr("data-stt", "true");
|
||||
$("#totals-choose").html($(".not-in-list").length);
|
||||
@@ -367,7 +393,7 @@ function _sync() {
|
||||
lists.push($(this).attr("data-id"));
|
||||
});
|
||||
if (lists.length == 0) {
|
||||
alert("Không có dữ liệu đồng bộ!");
|
||||
alert($("input[name='KHONG_CO_DU_LIEU_DONG_BO']").val());
|
||||
return;
|
||||
}
|
||||
common.modalBlock(true);
|
||||
@@ -408,7 +434,7 @@ function syncFeatureFromDevice(id, fullData) {
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
alert("Mất kết nối tới thiết bị");
|
||||
alert($("input[name='KHONG_CO_KET_NOI_TOI_THIET_BI']").val());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -422,8 +448,10 @@ function _syncFromServerForm(e) {
|
||||
common.modalBlock(false);
|
||||
common.modalOpenFullScreen(data.form, data.title);
|
||||
$("#filter-from-server").select2({
|
||||
placeholder: "Tìm kiếm theo ID hoặc tên"
|
||||
placeholder: $("input[name='TIM_KIEM_THEO_ID_HOAC_TEN']").val()
|
||||
});
|
||||
if ($("#totalDevice").html() === $("#totalCloud").html())
|
||||
$("#btnCheckLossImage").addClass("hidden");
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
@@ -439,7 +467,7 @@ function _syncFromServer() {
|
||||
lists.push(JSON.parse($("#full-data-" + id).html()));
|
||||
});
|
||||
if (lists.length == 0) {
|
||||
alert("Không có dữ liệu đồng bộ!");
|
||||
alert($("input[name='KHONG_CO_DU_LIEU_DONG_BO']").val());
|
||||
return;
|
||||
}
|
||||
common.modalBlock(true);
|
||||
@@ -458,6 +486,11 @@ function syncFeature(id, fullData) {
|
||||
totals: totals
|
||||
},
|
||||
success: function (data) {
|
||||
if (!data) {
|
||||
common.modalBlock(false);
|
||||
common.modalAlert($("input[name='ENGINE_KHONG_HOAT_DONG']").val(), "danger", "");
|
||||
return;
|
||||
}
|
||||
console.log(data, progress);
|
||||
progress++;
|
||||
$("#progress-current").html(parseInt($("#progress-current").html()) + 1);
|
||||
@@ -526,7 +559,7 @@ function _syncToServerForm(e) {
|
||||
common.modalBlock(false);
|
||||
common.modalOpenFullScreen(data.form, data.title);
|
||||
$("#filter-from-server").select2({
|
||||
placeholder: "Tìm kiếm theo ID hoặc tên"
|
||||
placeholder: $("input[name='TIM_KIEM_THEO_ID_HOAC_TEN']").val()
|
||||
});
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
@@ -544,7 +577,7 @@ function _syncToServer() {
|
||||
lists.push($(this).attr("data-id"));
|
||||
});
|
||||
if (lists.length == 0) {
|
||||
alert("Không có dữ liệu đồng bộ!");
|
||||
alert($("input[name='KHONG_CO_DU_LIEU_DONG_BO']").val());
|
||||
return;
|
||||
}
|
||||
common.modalBlock(true);
|
||||
@@ -576,7 +609,7 @@ function syncFeatureToServer(id, fullData) {
|
||||
if (percent >= 100) {
|
||||
common.modalBlock(false);
|
||||
setTimeout(function () {
|
||||
alert("Đồng bộ dữ liệu hoàn thành");
|
||||
alert($("input[name='DONG_BO_DU_LIEU_HOAN_THANH']").val());
|
||||
window.location.reload(true);
|
||||
}, 2000)
|
||||
} else {
|
||||
@@ -618,7 +651,7 @@ function getTotalFeature() {
|
||||
console.log(data);
|
||||
$("#totalPeople").html(`<b class="text-red">` + data.statistics.totalImg + `</b>/<b>` + data.statistics.total + `</b>`);
|
||||
$("#total128").html(`<b class="text-red">` + data.statistics["128"] + `</b>/<b>` + data.statistics.img + `</b>`);
|
||||
$("#total512").html(`<b class="text-red">` + data.statistics["512"] + `</b>/<b>` + data.statistics.img + `</b>`);
|
||||
$("#total512").html(`<b class="text-red" id="current-512">` + data.statistics["512"] + `</b>/<b id="total-512">` + data.statistics.img + `</b>`);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
}
|
||||
@@ -637,4 +670,182 @@ function reGenFeature(e) {
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function filtersLossImage(e) {
|
||||
if ($(e).hasClass("btn-danger")) {
|
||||
$(e).addClass("btn-default").removeClass("btn-danger");
|
||||
$(".filters").removeClass("hidden");
|
||||
$("#sync-lists").find("tr").removeClass("success").attr("data-stt", "false");
|
||||
$("#totals-choose").html("0");
|
||||
} else {
|
||||
$(e).removeClass("btn-default").addClass("btn-danger");
|
||||
$(".filters").addClass("hidden");
|
||||
$(".loss-image").removeClass("hidden");
|
||||
$("#sync-lists").find("tr").removeClass("success").attr("data-stt", "false");
|
||||
$(".loss-image").addClass("success").attr("data-stt", "true");
|
||||
$("#totals-choose").html($(".loss-image").length);
|
||||
}
|
||||
}
|
||||
|
||||
function scheduleForm(e) {
|
||||
var check = $(".delete-choose");
|
||||
if (check.length == 0) {
|
||||
alert($("input[name='HAY_CHON_DOI_TUONG_DE_GAN_LICH_TRINH']").val());
|
||||
return;
|
||||
}
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
type: 'POST',
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
common.modalOpen(data.form, false, data.title);
|
||||
common.dateTimePickerDay("fromDate");
|
||||
common.dateTimePickerDay("toDate");
|
||||
common.dateTimePickerHour("fromTime");
|
||||
common.dateTimePickerHour("toTime");
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addSchedule(e) {
|
||||
var lists = [];
|
||||
$.each($(".delete-choose"), function () {
|
||||
if ($(this).attr("data-id") !== "")
|
||||
lists.push($(this).attr("data-id"));
|
||||
});
|
||||
if (lists.length == 0) {
|
||||
alert($("input[name='HAY_CHON_DOI_TUONG_DE_GAN_LICH_TRINH']").val());
|
||||
return;
|
||||
}
|
||||
var dateOfWeek = [];
|
||||
$.each($("input[name='checkbox-date']:checked"), function () {
|
||||
dateOfWeek.push($(this).val());
|
||||
});
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
type: 'POST',
|
||||
data: {
|
||||
fromTime: $("input[name='FromTime']").val(),
|
||||
toTime: $("input[name='ToTime']").val(),
|
||||
fromDate: $("input[name='FromDate']").val(),
|
||||
toDate: $("input[name='ToDate']").val(),
|
||||
dateOfWeek: dateOfWeek,
|
||||
lists: lists
|
||||
},
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
window.location.reload(true);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
console.log(errorThrown);
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function formEditSchedule(e) {
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
type: 'POST',
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
common.modalOpen(data.form, false, data.title);
|
||||
common.dateTimePickerDay("fromDate");
|
||||
common.dateTimePickerDay("toDate");
|
||||
common.dateTimePickerHour("fromTime");
|
||||
common.dateTimePickerHour("toTime");
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function editSchedule(e) {
|
||||
var lists = [];
|
||||
$.each($(".delete-choose"), function () {
|
||||
if ($(this).attr("data-id") !== "")
|
||||
lists.push($(this).attr("data-id"));
|
||||
});
|
||||
var dateOfWeek = [];
|
||||
$.each($("input[name='checkbox-date']:checked"), function () {
|
||||
dateOfWeek.push($(this).val());
|
||||
});
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
type: 'POST',
|
||||
data: {
|
||||
fromTime: $("input[name='FromTime']").val(),
|
||||
toTime: $("input[name='ToTime']").val(),
|
||||
fromDate: $("input[name='FromDate']").val(),
|
||||
toDate: $("input[name='ToDate']").val(),
|
||||
dateOfWeek: dateOfWeek,
|
||||
lists: lists,
|
||||
editAll: $("input[name='editAll']").is(":checked")
|
||||
},
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
window.location.reload(true);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
console.log(errorThrown);
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function formDeleteSchedule(e) {
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
type: 'POST',
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
common.modalOpen(data.form, false, data.title);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deleteSchedule(e) {
|
||||
if (confirm($("input[name='BAN_CO_CHAC_CHAN_MUON_XOA_LICH_TRINH_NAY_KHONG']").val())) {
|
||||
var lists = [];
|
||||
$.each($(".delete-choose"), function () {
|
||||
if ($(this).attr("data-id") !== "")
|
||||
lists.push($(this).attr("data-id"));
|
||||
});
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr("data-href"),
|
||||
type: 'POST',
|
||||
data: {
|
||||
editAll: $("input[name='editAll']").is(":checked"),
|
||||
lists: lists
|
||||
},
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
window.location.reload(true);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
console.log(errorThrown);
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,8 @@ class ConfigTree extends Widget {
|
||||
|
||||
public function run() {
|
||||
|
||||
$public_root = ['engine', 'recognition', 'open_door', 'screen', 'lang'];
|
||||
$public_cfg = ['engine|cam_id', 'engine|server_authen', 'recognition|server_recog', 'open_door|enable', 'open_door|port_name', 'screen|banner', 'lang'];
|
||||
$public_root = ['engine', 'recognition', 'open_door', 'screen', 'lang', 'camera'];
|
||||
$public_cfg = ['engine|cam_id', 'engine|server_authen', 'recognition|server_recog', 'open_door|enable', 'open_door|port_name', 'screen|banner', 'lang', 'camera|rgb', 'camera|ir', 'camera|rgb|url', 'camera|ir|url'];
|
||||
|
||||
return $this->render("config-tree", [
|
||||
"configLists" => $this->configLists,
|
||||
|
||||
Reference in New Issue
Block a user