Compare commits
1 Commits
LitePro_2.
...
dev_DTD
| Author | SHA1 | Date | |
|---|---|---|---|
| cc12e79986 |
@@ -1,23 +0,0 @@
|
|||||||
<?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,11 +2,7 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'adminEmail' => 'admin@example.com',
|
'adminEmail' => 'admin@example.com',
|
||||||
"type" => "BiFace", // BiFace, BiTable
|
"maxLogs" => 100000,
|
||||||
"maxLogs" => 50000,
|
|
||||||
"maxPicture" => 9999,
|
"maxPicture" => 9999,
|
||||||
"version" => "1.0.7",
|
"version" => "1.0.7"
|
||||||
"autoSyncLog" => false,
|
|
||||||
"timeoutRequestServer" => 4,
|
|
||||||
"test" => 6
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ use yii\helpers\FileHelper;
|
|||||||
use app\models\CaptureLogs;
|
use app\models\CaptureLogs;
|
||||||
use app\models\ListManagement;
|
use app\models\ListManagement;
|
||||||
use app\models\common;
|
use app\models\common;
|
||||||
use app\models\Schedule;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CardController implements the CRUD actions for Card model.
|
* CardController implements the CRUD actions for Card model.
|
||||||
@@ -58,7 +57,6 @@ class ApiController extends Controller {
|
|||||||
|
|
||||||
public function actionGetLogs() {
|
public function actionGetLogs() {
|
||||||
if (Yii::$app->request->post()) {
|
if (Yii::$app->request->post()) {
|
||||||
Yii::$app->response->format = "json";
|
|
||||||
$post = Yii::$app->request->bodyParams;
|
$post = Yii::$app->request->bodyParams;
|
||||||
$time = date_format(date_create_from_format('Y-m-d H:i:s', $post['time']), 'U');
|
$time = date_format(date_create_from_format('Y-m-d H:i:s', $post['time']), 'U');
|
||||||
$key = common::generateRandomString();
|
$key = common::generateRandomString();
|
||||||
@@ -71,14 +69,9 @@ class ApiController extends Controller {
|
|||||||
$totalsLogs = CaptureLogs::find()->count();
|
$totalsLogs = CaptureLogs::find()->count();
|
||||||
if ($totalsLogs >= \Yii::$app->params['maxLogs']) {
|
if ($totalsLogs >= \Yii::$app->params['maxLogs']) {
|
||||||
$lastLogs = CaptureLogs::find()->orderBy(["id" => SORT_ASC])->limit(1)->one();
|
$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->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();
|
$model = new CaptureLogs();
|
||||||
$logs = $model->create([
|
$logs = $model->create([
|
||||||
@@ -91,10 +84,7 @@ class ApiController extends Controller {
|
|||||||
$ip = "https://dev-dc.beetai.com";
|
$ip = "https://dev-dc.beetai.com";
|
||||||
if ($server_ip)
|
if ($server_ip)
|
||||||
$ip = $server_ip->data;
|
$ip = $server_ip->data;
|
||||||
$parseUrl = parse_url($ip);
|
if ($this->is_connected() && $logs) {
|
||||||
$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']);
|
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
||||||
$id_camera = 0;
|
$id_camera = 0;
|
||||||
if ($device_id)
|
if ($device_id)
|
||||||
@@ -113,25 +103,22 @@ class ApiController extends Controller {
|
|||||||
$data[] = "123"; //person_id
|
$data[] = "123"; //person_id
|
||||||
$data[] = "+7"; //timezone
|
$data[] = "+7"; //timezone
|
||||||
$text = implode("|", $data);
|
$text = implode("|", $data);
|
||||||
$res = json_decode(@file_get_contents($ip . "/api/box/face_recognition_auth_v2?token=" . $tk, false, stream_context_create([
|
$res = json_decode(file_get_contents($ip . "/api/box/face_recognition_auth_v2?token=" . $tk, false, stream_context_create([
|
||||||
'http' => [
|
'http' => [
|
||||||
'timeout' => Yii::$app->params['timeoutRequestServer'],
|
|
||||||
'header' => "Content-Type: application/json",
|
'header' => "Content-Type: application/json",
|
||||||
'method' => "POST",
|
'method' => "POST",
|
||||||
'content' => json_encode([
|
'content' => json_encode([
|
||||||
'image' => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName)),
|
'image' => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName)),
|
||||||
'data' => common::rsaEncode($text),
|
'data' => common::rsaEncode($text)
|
||||||
'confidence' => isset($post["confidence"]["percent1"]) ? $post["confidence"]["percent1"] : 0
|
|
||||||
])
|
])
|
||||||
]
|
]
|
||||||
])), true);
|
])), true);
|
||||||
if ($res && $res['status'] == 10000) {
|
if ($res['status'] == 10000) {
|
||||||
$logsInfo->sync_status = 1;
|
$logsInfo->sync_status = 1;
|
||||||
$logsInfo->save();
|
$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"];
|
return ["status" => "success"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -162,7 +149,6 @@ class ApiController extends Controller {
|
|||||||
}
|
}
|
||||||
$allFeatures[] = [
|
$allFeatures[] = [
|
||||||
"id" => $value->id,
|
"id" => $value->id,
|
||||||
"object_id" => $value->staff_id,
|
|
||||||
"name" => $this->convert_vi_to_en($value->name),
|
"name" => $this->convert_vi_to_en($value->name),
|
||||||
"feature1" => $feature1,
|
"feature1" => $feature1,
|
||||||
"feature2" => $feature2
|
"feature2" => $feature2
|
||||||
@@ -283,18 +269,18 @@ class ApiController extends Controller {
|
|||||||
$updating->data = "false";
|
$updating->data = "false";
|
||||||
$updating->save();
|
$updating->save();
|
||||||
$txt = "\n" . date("H:i:s d/m/Y") . " " . "success";
|
$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];
|
return ["status" => false];
|
||||||
} else {
|
} else {
|
||||||
$txt = "\n" . date("H:i:s d/m/Y") . " " . "updating";
|
$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];
|
return ["status" => false];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($currentCache['n_128'] == $currentCache['n_512']) {
|
if ($currentCache['n_128'] == $currentCache['n_512']) {
|
||||||
$txt = "\n" . date("H:i:s d/m/Y") . " " . "success";
|
$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];
|
return ["status" => false];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,7 +322,7 @@ class ApiController extends Controller {
|
|||||||
$finish = $this->getCurrentTime();
|
$finish = $this->getCurrentTime();
|
||||||
$processTime["updateDB"] = round(($finish - $start), 4);
|
$processTime["updateDB"] = round(($finish - $start), 4);
|
||||||
$txt = "\n" . json_encode($processTime);
|
$txt = "\n" . json_encode($processTime);
|
||||||
// file_put_contents(date('Ymd') . ".txt", $txt, FILE_APPEND);
|
file_put_contents(date('Ymd') . ".txt", $txt, FILE_APPEND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -348,27 +334,23 @@ class ApiController extends Controller {
|
|||||||
|
|
||||||
public function actionSync() {
|
public function actionSync() {
|
||||||
Yii::$app->response->format = "json";
|
Yii::$app->response->format = "json";
|
||||||
|
if ($this->is_connected()) {
|
||||||
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||||
$ip = "https://dev-dc.beetai.com";
|
$ip = "https://dev-dc.beetai.com";
|
||||||
if ($server_ip)
|
if ($server_ip)
|
||||||
$ip = $server_ip->data;
|
$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']);
|
$device_id = \app\models\SyncUrl::findOne(['key_config' => 'device_id']);
|
||||||
$id_camera = 0;
|
$id_camera = 0;
|
||||||
if ($device_id)
|
if ($device_id)
|
||||||
$id_camera = intval($device_id->data);
|
$id_camera = intval($device_id->data);
|
||||||
$ls = CaptureLogs::find()->andWhere(['sync_status' => null])->all();
|
$ls = CaptureLogs::find()->andWhere(['sync_status' => null])->all();
|
||||||
|
|
||||||
$tk = "";
|
$tk = "";
|
||||||
$token = \app\models\SyncUrl::findOne(['key_config' => 'token']);
|
$token = \app\models\SyncUrl::findOne(['key_config' => 'token']);
|
||||||
if ($token)
|
if ($token)
|
||||||
$tk = $token->data;
|
$tk = $token->data;
|
||||||
foreach ($ls as $key => $value) {
|
foreach ($ls as $key => $value) {
|
||||||
if (file_exists("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value->image)) {
|
|
||||||
$staffInfo = ListManagement::findOne($value->staff_id);
|
$staffInfo = ListManagement::findOne($value->staff_id);
|
||||||
$confidence = json_decode($value->confidence, true);
|
|
||||||
$data = [];
|
$data = [];
|
||||||
$data[] = strval($id_camera); //camera_id
|
$data[] = strval($id_camera); //camera_id
|
||||||
$data[] = date("Y-m-d H:i:s", $value->time); //frametime
|
$data[] = date("Y-m-d H:i:s", $value->time); //frametime
|
||||||
@@ -377,42 +359,33 @@ class ApiController extends Controller {
|
|||||||
$data[] = "123"; //person_id
|
$data[] = "123"; //person_id
|
||||||
$data[] = "+7"; //timezone
|
$data[] = "+7"; //timezone
|
||||||
$text = implode("|", $data);
|
$text = implode("|", $data);
|
||||||
$res = json_decode(@file_get_contents($ip . "/api/box/face_recognition_auth_v2?token=" . $tk, false, stream_context_create([
|
$res = json_decode(file_get_contents($ip . "/api/box/face_recognition_auth_v2?token=" . $tk, false, stream_context_create([
|
||||||
'http' => [
|
'http' => [
|
||||||
'timeout' => Yii::$app->params['timeoutRequestServer'],
|
|
||||||
'header' => "Content-Type: application/json",
|
'header' => "Content-Type: application/json",
|
||||||
'method' => "POST",
|
'method' => "POST",
|
||||||
'content' => json_encode([
|
'content' => json_encode([
|
||||||
'image' => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value->image)),
|
'image' => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value->image)),
|
||||||
'data' => common::rsaEncode($text),
|
'data' => common::rsaEncode($text)
|
||||||
'confidence' => isset($confidence['percent1']) ? floatval($confidence['percent1']) : 0
|
|
||||||
])
|
])
|
||||||
]
|
]
|
||||||
])), true);
|
])), true);
|
||||||
if ($res && $res['status'] == 10000) {
|
if ($res['status'] == 10000) {
|
||||||
$value->sync_status = 1;
|
$value->sync_status = 1;
|
||||||
$value->save();
|
$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];
|
return ["status" => true];
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_connected($host, $port) {
|
function is_connected($ip = "google.com") {
|
||||||
$connected = @fsockopen($host, $port);
|
$connected = @fsockopen($ip, 80);
|
||||||
//website, port (try 80 or 443)
|
//website, port (try 80 or 443)
|
||||||
if ($connected) {
|
if ($connected) {
|
||||||
$is_conn = true; //action when connected
|
$is_conn = true; //action when connected
|
||||||
fclose($connected);
|
fclose($connected);
|
||||||
// file_put_contents("log_connect_server.txt", "\n" . date("H:i:s d/m/Y") . " connected " . $host . ":" . $port, FILE_APPEND);
|
|
||||||
} else {
|
} else {
|
||||||
$is_conn = false; //action in connection failure
|
$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;
|
return $is_conn;
|
||||||
}
|
}
|
||||||
@@ -507,18 +480,29 @@ class ApiController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function actionTest() {
|
public function actionTest() {
|
||||||
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
// $key = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCXB8c44cboYsGG6IzISqxf8W7q3AN0mGmekDYpBWpz9udif+jwK6h7NuOZvFDeB/32TVrtvaGDmExCeBerpcoOvGh4eUXyke2lSLzrg7pc/wD0KproEGoAAFDB0Pr5bZhg6ELp3Sk++0MPyxH6u1pgtHDxEnMwXV8cxw/rSCM+wIDAQAB';
|
||||||
$ip = "https://dev-dc.beetai.com";
|
// $rsa = new \phpseclib3\Crypt\RSA;
|
||||||
if ($server_ip)
|
// $rsa->loadKey($key);
|
||||||
$ip = $server_ip->data;
|
// $rsa->setPublicKey($key);
|
||||||
$parseUrl = parse_url($ip);
|
//
|
||||||
$host = $parseUrl['host'];
|
// echo $rsa->getPublicKey();
|
||||||
$port = isset($parseUrl['port']) ? $parseUrl['port'] : 80;
|
// exit();
|
||||||
$this->is_connected($host, $port);
|
$test = "10|2021-07-27 19:16:25|211155|1|2021-07-27 19:16:25";
|
||||||
|
$encode = common::rsaEncode($test);
|
||||||
|
$res = json_decode(file_get_contents("http://192.168.0.9:6004/api/box/face_recognition_auth_v2", false, stream_context_create([
|
||||||
|
'http' => [
|
||||||
|
'header' => "Content-Type: application/json",
|
||||||
|
'method' => "POST",
|
||||||
|
'content' => json_encode([
|
||||||
|
'image' => 'abc',
|
||||||
|
'data' => $encode
|
||||||
|
])
|
||||||
|
]
|
||||||
|
])), true);
|
||||||
|
return var_dump($res);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionReGenFeature() {
|
public function actionReGenFeature() {
|
||||||
\app\models\SyncUrl::deleteAll(['key_config' => 'log_process_status']);
|
|
||||||
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
|
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
|
||||||
if (!$updating) {
|
if (!$updating) {
|
||||||
$model = new \app\models\SyncUrl();
|
$model = new \app\models\SyncUrl();
|
||||||
@@ -543,27 +527,7 @@ class ApiController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function actionCheckLogs() {
|
public function actionCheckLogs() {
|
||||||
set_time_limit(5000);
|
|
||||||
Yii::$app->response->format = "json";
|
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']);
|
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||||
$ip = "https://dev-dc.beetai.com";
|
$ip = "https://dev-dc.beetai.com";
|
||||||
if ($server_ip)
|
if ($server_ip)
|
||||||
@@ -583,83 +547,53 @@ class ApiController extends Controller {
|
|||||||
])
|
])
|
||||||
]
|
]
|
||||||
])), true);
|
])), true);
|
||||||
if (Yii::$app->params['autoSyncLog'])
|
|
||||||
file_put_contents("logs.txt", "START CHECK LOGS\n", FILE_APPEND);
|
|
||||||
if ($datas['status'] == 10000) {
|
if ($datas['status'] == 10000) {
|
||||||
$logs = $datas['data'];
|
$logs = $datas['data'];
|
||||||
$infomation = [];
|
$infomation = [];
|
||||||
$fault_information = [];
|
|
||||||
$count = 0;
|
|
||||||
foreach ($logs as $key => $value) {
|
foreach ($logs as $key => $value) {
|
||||||
$count++;
|
|
||||||
$start = $this->getCurrentTime();
|
|
||||||
$result = true;
|
|
||||||
if ($value['action'] == "insert_image")
|
if ($value['action'] == "insert_image")
|
||||||
$result = $this->insertImage($value['images'][0], $value['id'], $value['files_name'][0]);
|
$this->insertImage($value['images'][0], $value['id'], $value['files_name'][0]);
|
||||||
|
|
||||||
if ($value['action'] == "remove_image")
|
if ($value['action'] == "remove_image")
|
||||||
$result = $this->removeImage($value['id'], $value['files_name'][0]);
|
$this->removeImage($value['id'], $value['files_name'][0]);
|
||||||
|
|
||||||
if ($value['action'] == "insert_info")
|
if ($value['action'] == "insert_info")
|
||||||
$result = $this->insertInfo($value);
|
$this->insertInfo($value);
|
||||||
|
|
||||||
if ($value['action'] == "remove_info")
|
if ($value['action'] == "remove_info")
|
||||||
$result = $this->removeInfo($value);
|
$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") {
|
if ($value['action'] == "reset_all") {
|
||||||
\Yii::$app->db->createCommand()->truncateTable('capture_logs')->execute();
|
\Yii::$app->db->createCommand()->truncateTable('capture_logs')->execute();
|
||||||
\Yii::$app->db->createCommand()->truncateTable('list_management')->execute();
|
\Yii::$app->db->createCommand()->truncateTable('list_management')->execute();
|
||||||
array_map('unlink', glob("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/*.*"));
|
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', 'insert_door_open', 'remove_door_open'])) {
|
if (in_array($value['action'], ['insert_image', 'remove_image', 'insert_info', 'remove_info', 'reset_all'])) {
|
||||||
if ($result)
|
|
||||||
$infomation[] = [
|
$infomation[] = [
|
||||||
"obj_Log" => $value['obj_Log'],
|
"obj_Log" => $value['obj_Log'],
|
||||||
"action" => $value['action'],
|
"action" => $value['action'],
|
||||||
"idCamera" => $id_camera
|
"idCamera" => $id_camera
|
||||||
];
|
];
|
||||||
else
|
|
||||||
$fault_information[] = [
|
|
||||||
"obj_Log" => $value['obj_Log'],
|
|
||||||
"action" => $value['action'],
|
|
||||||
"idCamera" => $id_camera
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count($infomation) > 0 || count($fault_information) > 0) {
|
if (count($infomation) > 0)
|
||||||
file_get_contents($ip . "/api/model/set_log_model", false, stream_context_create([
|
file_get_contents($ip . "/api/model/set_log_model", false, stream_context_create([
|
||||||
'http' => [
|
'http' => [
|
||||||
'header' => "Content-Type: application/json",
|
'header' => "Content-Type: application/json",
|
||||||
'method' => "POST",
|
'method' => "POST",
|
||||||
'content' => json_encode([
|
'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());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$logProcessStatus->data = json_encode(["status" => false, "time" => time()]);
|
|
||||||
$logProcessStatus->save();
|
|
||||||
return ["data" => "check logs"];
|
return ["data" => "check logs"];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function insertImage($image, $staff_id, $files_name) {
|
public function insertImage($image, $staff_id, $files_name) {
|
||||||
$model = ListManagement::findOne(['staff_id' => $staff_id]);
|
$model = ListManagement::findOne(['staff_id' => $staff_id]);
|
||||||
if (!$model)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
$RootFolder = Yii::getAlias('@webroot') . "/data/uploads";
|
$RootFolder = Yii::getAlias('@webroot') . "/data/uploads";
|
||||||
$targetPath = $RootFolder . "/face";
|
$targetPath = $RootFolder . "/face";
|
||||||
@@ -693,11 +627,8 @@ class ApiController extends Controller {
|
|||||||
],
|
],
|
||||||
"type" => "128"
|
"type" => "128"
|
||||||
]);
|
]);
|
||||||
if (!$features['status']) {
|
if (!$features['status'])
|
||||||
if (Yii::$app->params['autoSyncLog'])
|
|
||||||
file_put_contents("logs.txt", "[ERROR] extract feature " . json_encode($features) . "\n", FILE_APPEND);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
$features = json_decode($features['data'], true);
|
$features = json_decode($features['data'], true);
|
||||||
$ft[] = [
|
$ft[] = [
|
||||||
"serverKey" => $files_name,
|
"serverKey" => $files_name,
|
||||||
@@ -708,34 +639,24 @@ class ApiController extends Controller {
|
|||||||
];
|
];
|
||||||
$model->image = json_encode($ft);
|
$model->image = json_encode($ft);
|
||||||
$model->last_modified = time();
|
$model->last_modified = time();
|
||||||
return $model->save();
|
$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) {
|
public function removeImage($staff_id, $files_name) {
|
||||||
$model = ListManagement::findOne(['staff_id' => $staff_id]);
|
$model = ListManagement::findOne(['staff_id' => $staff_id]);
|
||||||
if (!$model)
|
|
||||||
return false;
|
|
||||||
$images = json_decode($model->image, true);
|
$images = json_decode($model->image, true);
|
||||||
$ft = [];
|
$ft = [];
|
||||||
foreach ($images as $key => $value) {
|
foreach ($images as $key => $value) {
|
||||||
if (isset($value['serverKey']) && $value['serverKey'] !== $files_name)
|
if ($value['serverKey'] !== $files_name)
|
||||||
$ft[] = $value;
|
$ft[] = $value;
|
||||||
else
|
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->image = json_encode($ft);
|
||||||
$model->last_modified = time();
|
$model->last_modified = time();
|
||||||
return $model->save();
|
$model->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function insertInfo($data) {
|
public function insertInfo($data) {
|
||||||
@@ -762,7 +683,6 @@ class ApiController extends Controller {
|
|||||||
'abbreviated_name' => $data['abbreviated_name'],
|
'abbreviated_name' => $data['abbreviated_name'],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function removeInfo($data) {
|
public function removeInfo($data) {
|
||||||
@@ -770,11 +690,11 @@ class ApiController extends Controller {
|
|||||||
if ($model) {
|
if ($model) {
|
||||||
$images = json_decode($model->image, true);
|
$images = json_decode($model->image, true);
|
||||||
foreach ($images as $k => $v) {
|
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();
|
$model->delete();
|
||||||
}
|
}
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function resizeImg($img, $fileTarget) {
|
public function resizeImg($img, $fileTarget) {
|
||||||
@@ -794,108 +714,4 @@ class ApiController extends Controller {
|
|||||||
return false;
|
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
|
|
||||||
]
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function actionCheckTimeEngine() {
|
|
||||||
Yii::$app->response->format = "json";
|
|
||||||
$config_engine = ["start_at" => "00:00", "end_at" => "23:59"];
|
|
||||||
$engine_time_config = \app\models\SyncUrl::findOne(['key_config' => 'engine_time_config']);
|
|
||||||
if ($engine_time_config)
|
|
||||||
$config_engine = json_decode($engine_time_config->data, true);
|
|
||||||
|
|
||||||
$start_at = date_format(date_create_from_format('H:i:s d/m/Y', $config_engine['start_at'] . ":00 " . date("d/m/Y")), 'U');
|
|
||||||
$end_at = date_format(date_create_from_format('H:i:s d/m/Y', $config_engine['end_at'] . ":59 " . date("d/m/Y")), 'U');
|
|
||||||
$now = time();
|
|
||||||
if ($now < $start_at || $now > $end_at)
|
|
||||||
return ["status" => false];
|
|
||||||
|
|
||||||
return ["status" => true];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,39 +117,4 @@ class CaptureLogsController extends Controller {
|
|||||||
throw new NotFoundHttpException(Yii::t("app", "KHONG_TIM_THAY_THONG_TIN"));
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,10 +159,6 @@ class ConfigController extends Controller {
|
|||||||
|
|
||||||
public function actionIndex() {
|
public function actionIndex() {
|
||||||
$this->view->title = Yii::t("app", "CAU_HINH_MAY_CHU");
|
$this->view->title = Yii::t("app", "CAU_HINH_MAY_CHU");
|
||||||
if (Yii::$app->params['type'] != "BiFace")
|
|
||||||
return $this->redirect(['cau-hinh-ip']);
|
|
||||||
if (Yii::$app->user->identity->username != "admin")
|
|
||||||
return $this->redirect(['cau-hinh-nhan-dien']);
|
|
||||||
$options = [
|
$options = [
|
||||||
'http' => [
|
'http' => [
|
||||||
'header' => "Content-Type: application/json",
|
'header' => "Content-Type: application/json",
|
||||||
@@ -178,8 +174,7 @@ class ConfigController extends Controller {
|
|||||||
}
|
}
|
||||||
return $this->render('index', [
|
return $this->render('index', [
|
||||||
"servermqtt" => $servermqtt === "" ? $ip . ":1883" : $servermqtt,
|
"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"])
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,8 +259,6 @@ class ConfigController extends Controller {
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$this->view->title = Yii::t("app", "CAU_HINH_NHAN_DIEN");
|
$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([
|
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
||||||
'http' => [
|
'http' => [
|
||||||
'header' => "Content-Type: application/json",
|
'header' => "Content-Type: application/json",
|
||||||
@@ -297,8 +290,7 @@ class ConfigController extends Controller {
|
|||||||
$config_json = json_decode($checkConfig['data'], true);
|
$config_json = json_decode($checkConfig['data'], true);
|
||||||
|
|
||||||
return $this->render('config', [
|
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"])
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -315,7 +307,6 @@ class ConfigController extends Controller {
|
|||||||
} catch (\Exception $exc) {
|
} catch (\Exception $exc) {
|
||||||
|
|
||||||
}
|
}
|
||||||
\app\models\SyncUrl::deleteAll(['key_config' => 'log_process_status']);
|
|
||||||
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||||
$ip = "https://dev-dc.beetai.com";
|
$ip = "https://dev-dc.beetai.com";
|
||||||
if ($server_ip)
|
if ($server_ip)
|
||||||
@@ -423,7 +414,6 @@ class ConfigController extends Controller {
|
|||||||
if (!$checkConfig['status']) {
|
if (!$checkConfig['status']) {
|
||||||
return ['status' => false, 'text' => ''];
|
return ['status' => false, 'text' => ''];
|
||||||
} else {
|
} else {
|
||||||
@file_get_contents("http://localhost:4004/SetupMedia");
|
|
||||||
return ['status' => true, 'url' => Url::to(['cau-hinh-thiet-bi'])];
|
return ['status' => true, 'url' => Url::to(['cau-hinh-thiet-bi'])];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -431,10 +421,6 @@ class ConfigController extends Controller {
|
|||||||
|
|
||||||
public function actionCauHinhThietBi() {
|
public function actionCauHinhThietBi() {
|
||||||
$this->view->title = Yii::t("app", "CAU_HINH_THIET_BI");
|
$this->view->title = Yii::t("app", "CAU_HINH_THIET_BI");
|
||||||
if (Yii::$app->params['type'] != "BiFace")
|
|
||||||
return $this->redirect(['cau-hinh-ip']);
|
|
||||||
if (Yii::$app->user->identity->username != "admin")
|
|
||||||
return $this->redirect(['cau-hinh-nhan-dien']);
|
|
||||||
|
|
||||||
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create([
|
||||||
'http' => [
|
'http' => [
|
||||||
@@ -465,8 +451,7 @@ class ConfigController extends Controller {
|
|||||||
}
|
}
|
||||||
return $this->render('device', [
|
return $this->render('device', [
|
||||||
"server_api" => \app\models\SyncUrl::findOne(['key_config' => 'server_api']),
|
"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"])
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,264 +485,4 @@ 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
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getConfigJson() {
|
|
||||||
$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);
|
|
||||||
if (count($engineConfig['data']['engines']) == 0)
|
|
||||||
return $this->redirect(['/config']);
|
|
||||||
|
|
||||||
$checkConfig = json_decode(file_get_contents("http://localhost:4004/ReadConfig", false, stream_context_create([
|
|
||||||
'http' => [
|
|
||||||
'header' => "Content-Type: application/json",
|
|
||||||
'method' => "POST",
|
|
||||||
'content' => json_encode([
|
|
||||||
'path' => $engineConfig['data']['engines'][0]['path']
|
|
||||||
])
|
|
||||||
]
|
|
||||||
])), true);
|
|
||||||
|
|
||||||
if (!$checkConfig['status'])
|
|
||||||
return $this->redirect(['/config']);
|
|
||||||
|
|
||||||
$config_json = $this->config_json;
|
|
||||||
if ($checkConfig['status'])
|
|
||||||
$config_json = json_decode($checkConfig['data'], true);
|
|
||||||
return $config_json;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function actionDieuKhienThietBi() {
|
|
||||||
$this->view->title = Yii::t("app", "DIEU_KHIEN_THIET_BI");
|
|
||||||
$config_json = $this->getConfigJson();
|
|
||||||
|
|
||||||
$config_engine = ["start_at" => "00:00", "end_at" => "23:59"];
|
|
||||||
$engine_time_config = \app\models\SyncUrl::findOne(['key_config' => 'engine_time_config']);
|
|
||||||
if ($engine_time_config)
|
|
||||||
$config_engine = json_decode($engine_time_config->data, true);
|
|
||||||
return $this->render('dieu-khien-thiet-bi', [
|
|
||||||
"background" => $config_json['background'],
|
|
||||||
"config_engine" => $config_engine,
|
|
||||||
"config_light" => isset($config_json['open_door']['light']) ? $config_json['open_door']['light'] : false,
|
|
||||||
"engineStatus" => json_decode(@file_get_contents("http://localhost:4004/EngineStatus"), true),
|
|
||||||
"menu" => $this->renderPartial("menu", ["tab" => "device_controller"])
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function actionControlEngine($status) {
|
|
||||||
if (Yii::$app->request->isAjax) {
|
|
||||||
$options = [
|
|
||||||
'http' => [
|
|
||||||
'header' => "Content-Type: application/json",
|
|
||||||
'method' => "POST",
|
|
||||||
'content' => json_encode(["action" => $status]),
|
|
||||||
]
|
|
||||||
];
|
|
||||||
json_decode(@file_get_contents("http://localhost:4004/ControlEngine", false, stream_context_create($options)), true);
|
|
||||||
return $status;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function actionSaveTimeLightConfig() {
|
|
||||||
if (Yii::$app->request->post()) {
|
|
||||||
$post = Yii::$app->request->post();
|
|
||||||
$config_json = $this->getConfigJson();
|
|
||||||
$config_json['open_door']['light'] = [
|
|
||||||
"enable" => $post['enable'],
|
|
||||||
"start_at" => $post['start_at'],
|
|
||||||
"end_at" => $post['end_at']
|
|
||||||
];
|
|
||||||
$options = [
|
|
||||||
'http' => [
|
|
||||||
'header' => "Content-Type: application/json",
|
|
||||||
'method' => "POST"
|
|
||||||
]
|
|
||||||
];
|
|
||||||
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create($options)), true);
|
|
||||||
|
|
||||||
if (!$tempConfig['status'])
|
|
||||||
return false;
|
|
||||||
|
|
||||||
$engineConfig = json_decode($tempConfig['data'], true);
|
|
||||||
$engineConfig['data']['engines'][0]['isConfig'] = "1";
|
|
||||||
|
|
||||||
file_get_contents("http://localhost:4004/SaveEngineConfig", false, stream_context_create([
|
|
||||||
'http' => [
|
|
||||||
'header' => "Content-Type: application/json",
|
|
||||||
'method' => "POST",
|
|
||||||
'content' => json_encode([
|
|
||||||
'path' => $engineConfig['data']['engines'][0]['path'],
|
|
||||||
'config' => $engineConfig,
|
|
||||||
'configEngine' => json_encode($config_json, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)
|
|
||||||
])
|
|
||||||
]
|
|
||||||
]));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function actionSaveTimeEngineConfig() {
|
|
||||||
if (Yii::$app->request->post()) {
|
|
||||||
$post = Yii::$app->request->post();
|
|
||||||
$engine_time_config = \app\models\SyncUrl::findOne(['key_config' => 'engine_time_config']);
|
|
||||||
$config_engine = ["start_at" => $post['start_at'], "end_at" => $post['end_at']];
|
|
||||||
if ($engine_time_config) {
|
|
||||||
$engine_time_config->data = json_encode($config_engine);
|
|
||||||
$engine_time_config->save();
|
|
||||||
} else {
|
|
||||||
$model = new \app\models\SyncUrl();
|
|
||||||
$model->create([
|
|
||||||
'key_config' => 'engine_time_config',
|
|
||||||
'data' => json_encode($config_engine)
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function actionBackground() {
|
|
||||||
if (Yii::$app->request->post()) {
|
|
||||||
$model = new \app\models\UploadForm();
|
|
||||||
$path = "bg";
|
|
||||||
$url = $model->UploadGlobal("image", ["PNG", "JPG", "JPEG", "GIF"], $path);
|
|
||||||
|
|
||||||
$config_json = $this->getConfigJson();
|
|
||||||
$config_json['background'] = "/uploads" . $url;
|
|
||||||
$options = [
|
|
||||||
'http' => [
|
|
||||||
'header' => "Content-Type: application/json",
|
|
||||||
'method' => "POST"
|
|
||||||
]
|
|
||||||
];
|
|
||||||
$tempConfig = json_decode(file_get_contents("http://localhost:4004/ReadEngineConfig", false, stream_context_create($options)), true);
|
|
||||||
|
|
||||||
if (!$tempConfig['status'])
|
|
||||||
return false;
|
|
||||||
|
|
||||||
$engineConfig = json_decode($tempConfig['data'], true);
|
|
||||||
$engineConfig['data']['engines'][0]['isConfig'] = "1";
|
|
||||||
|
|
||||||
file_get_contents("http://localhost:4004/SaveEngineConfig", false, stream_context_create([
|
|
||||||
'http' => [
|
|
||||||
'header' => "Content-Type: application/json",
|
|
||||||
'method' => "POST",
|
|
||||||
'content' => json_encode([
|
|
||||||
'path' => $engineConfig['data']['engines'][0]['path'],
|
|
||||||
'config' => $engineConfig,
|
|
||||||
'configEngine' => json_encode($config_json, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)
|
|
||||||
])
|
|
||||||
]
|
|
||||||
]));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function actionSound() {
|
|
||||||
if (Yii::$app->request->post()) {
|
|
||||||
$model = new \app\models\UploadForm();
|
|
||||||
$path = "audio";
|
|
||||||
$model->UploadSound("sound", ["WAV"], $path);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ class ControlLogsController extends Controller {
|
|||||||
common::updateFeature([
|
common::updateFeature([
|
||||||
"cmd" => "update",
|
"cmd" => "update",
|
||||||
"id" => $listManagement->id,
|
"id" => $listManagement->id,
|
||||||
"object_id" => $listManagement->staff_id,
|
|
||||||
"name" => common::convert_vi_to_en($listManagement->name),
|
"name" => common::convert_vi_to_en($listManagement->name),
|
||||||
"features" => $listManagement->allFeatures
|
"features" => $listManagement->allFeatures
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -76,10 +76,6 @@ class ListManagementController extends Controller {
|
|||||||
]);
|
]);
|
||||||
$updating = \app\models\SyncUrl::findOne(['key_config' => 'updating']);
|
$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', [
|
return $this->render('index', [
|
||||||
'searchModel' => $searchModel,
|
'searchModel' => $searchModel,
|
||||||
'dataProvider' => $dataProvider,
|
'dataProvider' => $dataProvider,
|
||||||
@@ -98,7 +94,7 @@ class ListManagementController extends Controller {
|
|||||||
Yii::$app->response->format = "json";
|
Yii::$app->response->format = "json";
|
||||||
if (Yii::$app->request->post()) {
|
if (Yii::$app->request->post()) {
|
||||||
$data = Yii::$app->request->post();
|
$data = Yii::$app->request->post();
|
||||||
$check = ListManagement::findOne(['id' => $data['code']]);
|
$check = ListManagement::findOne(['code' => $data['code']]);
|
||||||
if ($check)
|
if ($check)
|
||||||
return ["status" => false];
|
return ["status" => false];
|
||||||
$features = common::requestToEngine("/get-feature", [
|
$features = common::requestToEngine("/get-feature", [
|
||||||
@@ -127,7 +123,7 @@ class ListManagementController extends Controller {
|
|||||||
Yii::$app->response->format = "json";
|
Yii::$app->response->format = "json";
|
||||||
if (Yii::$app->request->post()) {
|
if (Yii::$app->request->post()) {
|
||||||
$data = Yii::$app->request->post();
|
$data = Yii::$app->request->post();
|
||||||
$listManagement = ListManagement::findOne(['id' => $data['code']]);
|
$listManagement = ListManagement::findOne(['code' => $data['code']]);
|
||||||
$url = CaptureLogs::findOne($data['id'])->image;
|
$url = CaptureLogs::findOne($data['id'])->image;
|
||||||
if ($listManagement) {
|
if ($listManagement) {
|
||||||
$images = json_decode($listManagement->image, true);
|
$images = json_decode($listManagement->image, true);
|
||||||
@@ -175,7 +171,6 @@ class ListManagementController extends Controller {
|
|||||||
common::updateFeature([
|
common::updateFeature([
|
||||||
"cmd" => "update",
|
"cmd" => "update",
|
||||||
"id" => $listManagement->id,
|
"id" => $listManagement->id,
|
||||||
"object_id" => $listManagement->staff_id,
|
|
||||||
"name" => common::convert_vi_to_en($listManagement->name),
|
"name" => common::convert_vi_to_en($listManagement->name),
|
||||||
"features" => $listManagement->allFeatures
|
"features" => $listManagement->allFeatures
|
||||||
]);
|
]);
|
||||||
@@ -283,7 +278,6 @@ class ListManagementController extends Controller {
|
|||||||
common::updateFeature([
|
common::updateFeature([
|
||||||
"cmd" => "update",
|
"cmd" => "update",
|
||||||
"id" => $model->id,
|
"id" => $model->id,
|
||||||
"object_id" => $model->staff_id,
|
|
||||||
"name" => common::convert_vi_to_en($model->name),
|
"name" => common::convert_vi_to_en($model->name),
|
||||||
"features" => $model->allFeatures
|
"features" => $model->allFeatures
|
||||||
]);
|
]);
|
||||||
@@ -297,12 +291,11 @@ class ListManagementController extends Controller {
|
|||||||
$model = $this->findModel($data['id']);
|
$model = $this->findModel($data['id']);
|
||||||
$images = json_decode($model->image, true);
|
$images = json_decode($model->image, true);
|
||||||
foreach ($images as $k => $v) {
|
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([
|
common::updateFeature([
|
||||||
"cmd" => "delete",
|
"cmd" => "delete",
|
||||||
"id" => $model->id,
|
"id" => $model->id,
|
||||||
"object_id" => $model->staff_id,
|
|
||||||
"name" => common::convert_vi_to_en($model->name),
|
"name" => common::convert_vi_to_en($model->name),
|
||||||
"features" => []
|
"features" => []
|
||||||
]);
|
]);
|
||||||
@@ -329,7 +322,6 @@ class ListManagementController extends Controller {
|
|||||||
common::updateFeature([
|
common::updateFeature([
|
||||||
"cmd" => "update",
|
"cmd" => "update",
|
||||||
"id" => $model->id,
|
"id" => $model->id,
|
||||||
"object_id" => $model->staff_id,
|
|
||||||
"name" => common::convert_vi_to_en($model->name),
|
"name" => common::convert_vi_to_en($model->name),
|
||||||
"features" => $model->allFeatures
|
"features" => $model->allFeatures
|
||||||
]);
|
]);
|
||||||
@@ -360,7 +352,6 @@ class ListManagementController extends Controller {
|
|||||||
common::updateFeature([
|
common::updateFeature([
|
||||||
"cmd" => "delete",
|
"cmd" => "delete",
|
||||||
"id" => $staff->id,
|
"id" => $staff->id,
|
||||||
"object_id" => $staff->staff_id,
|
|
||||||
"name" => common::convert_vi_to_en($staff->name),
|
"name" => common::convert_vi_to_en($staff->name),
|
||||||
"features" => []
|
"features" => []
|
||||||
]);
|
]);
|
||||||
@@ -454,15 +445,13 @@ class ListManagementController extends Controller {
|
|||||||
foreach ($datas['data'] as $key => $value) {
|
foreach ($datas['data'] as $key => $value) {
|
||||||
$filters[$value['id']] = $value['code'] . " - " . $value['name'] . " - " . $value['department'];
|
$filters[$value['id']] = $value['code'] . " - " . $value['name'] . " - " . $value['department'];
|
||||||
}
|
}
|
||||||
$deviceDatas = ListManagement::getAllID();
|
|
||||||
Yii::$app->response->format = "json";
|
Yii::$app->response->format = "json";
|
||||||
return [
|
return [
|
||||||
"title" => "<i class='fa fa-download'></i> " . Yii::t("app", "DONG_BO_TU_MAY_CHU"),
|
"title" => "<i class='fa fa-download'></i> " . Yii::t("app", "DONG_BO_TU_MAY_CHU"),
|
||||||
"form" => $this->renderPartial("list-server", [
|
"form" => $this->renderPartial("list-server", [
|
||||||
"datas" => $datas['data'],
|
"datas" => $datas['data'],
|
||||||
"filters" => $filters,
|
"filters" => $filters,
|
||||||
"personImage" => $deviceDatas["imgCountArr"],
|
"allID" => ListManagement::getAllID()
|
||||||
"allID" => $deviceDatas["idArr"]
|
|
||||||
])
|
])
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -566,14 +555,13 @@ class ListManagementController extends Controller {
|
|||||||
$model->image = json_encode($ft);
|
$model->image = json_encode($ft);
|
||||||
$model->last_modified = time();
|
$model->last_modified = time();
|
||||||
$model->save();
|
$model->save();
|
||||||
if ($totals <= 10)
|
// if ($totals <= 10)
|
||||||
common::updateFeature([
|
// common::updateFeature([
|
||||||
"cmd" => "update",
|
// "cmd" => "update",
|
||||||
"id" => $model->id,
|
// "id" => $model->id,
|
||||||
"object_id" => $model->staff_id,
|
// "name" => common::convert_vi_to_en($model->name),
|
||||||
"name" => common::convert_vi_to_en($model->name),
|
// "features" => $model->allFeatures
|
||||||
"features" => $model->allFeatures
|
// ]);
|
||||||
]);
|
|
||||||
} else {
|
} else {
|
||||||
if (isset($data['images'])) {
|
if (isset($data['images'])) {
|
||||||
$extractFeature = $this->extractFeature($data['images'], $data['files_name'], $data['id']);
|
$extractFeature = $this->extractFeature($data['images'], $data['files_name'], $data['id']);
|
||||||
@@ -599,14 +587,13 @@ class ListManagementController extends Controller {
|
|||||||
]);
|
]);
|
||||||
$finish = $this->getCurrentTime();
|
$finish = $this->getCurrentTime();
|
||||||
$processTime["insertDB"] = round(($finish - $start), 4);
|
$processTime["insertDB"] = round(($finish - $start), 4);
|
||||||
if ($totals <= 10)
|
// if ($totals <= 10)
|
||||||
common::updateFeature([
|
// common::updateFeature([
|
||||||
"cmd" => "create",
|
// "cmd" => "create",
|
||||||
"id" => $model->id,
|
// "id" => $model->id,
|
||||||
"object_id" => $model->staff_id,
|
// "name" => common::convert_vi_to_en($model->name),
|
||||||
"name" => common::convert_vi_to_en($model->name),
|
// "features" => $model->allFeatures
|
||||||
"features" => $model->allFeatures
|
// ]);
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
$totalFinish = $this->getCurrentTime();
|
$totalFinish = $this->getCurrentTime();
|
||||||
$processTime["total"] = round(($totalFinish - $totalStart), 4);
|
$processTime["total"] = round(($totalFinish - $totalStart), 4);
|
||||||
@@ -660,7 +647,6 @@ class ListManagementController extends Controller {
|
|||||||
common::updateFeature([
|
common::updateFeature([
|
||||||
"cmd" => "update",
|
"cmd" => "update",
|
||||||
"id" => $model->id,
|
"id" => $model->id,
|
||||||
"object_id" => $model->staff_id,
|
|
||||||
"name" => common::convert_vi_to_en($model->name),
|
"name" => common::convert_vi_to_en($model->name),
|
||||||
"features" => $model->allFeatures
|
"features" => $model->allFeatures
|
||||||
]);
|
]);
|
||||||
@@ -681,7 +667,6 @@ class ListManagementController extends Controller {
|
|||||||
common::updateFeature([
|
common::updateFeature([
|
||||||
"cmd" => "create",
|
"cmd" => "create",
|
||||||
"id" => $model->id,
|
"id" => $model->id,
|
||||||
"object_id" => $model->staff_id,
|
|
||||||
"name" => common::convert_vi_to_en($model->name),
|
"name" => common::convert_vi_to_en($model->name),
|
||||||
"features" => $model->allFeatures
|
"features" => $model->allFeatures
|
||||||
]);
|
]);
|
||||||
@@ -702,7 +687,7 @@ class ListManagementController extends Controller {
|
|||||||
public function actionChooseStaff() {
|
public function actionChooseStaff() {
|
||||||
if (Yii::$app->request->post()) {
|
if (Yii::$app->request->post()) {
|
||||||
$post = Yii::$app->request->post();
|
$post = Yii::$app->request->post();
|
||||||
$staff = ListManagement::findOne(['id' => $post['code']]);
|
$staff = ListManagement::findOne(['code' => $post['code']]);
|
||||||
Yii::$app->response->format = "json";
|
Yii::$app->response->format = "json";
|
||||||
return [
|
return [
|
||||||
"name" => $staff->name,
|
"name" => $staff->name,
|
||||||
@@ -821,110 +806,4 @@ 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");
|
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
|
|
||||||
])
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,24 +20,6 @@ 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() {
|
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>";
|
return "{items}<div class='row'><div class='col-md-4'>{summary}</div><div class='col-md-8 text-right'>{pager}</div></div>";
|
||||||
}
|
}
|
||||||
@@ -104,25 +86,4 @@ 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);'>";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,14 +8,12 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
"CAU_HINH" => "Configuration",
|
"CAU_HINH" => "Configuration",
|
||||||
"CAU_HINH_THIET_BI" => "Device Config",
|
"CAU_HINH_THIET_BI" => "Device Configuration",
|
||||||
"CAU_HINH_MAY_CHU" => "Server Config",
|
"CAU_HINH_MAY_CHU" => "Server Configuration",
|
||||||
"CAU_HINH_NHAN_DIEN" => "Recognition Config",
|
"CAU_HINH_NHAN_DIEN" => "Recognition Configuration",
|
||||||
"CAU_HINH_IP" => "IP Config",
|
"DEVICE_CONFIG" => "",
|
||||||
"DEVICE_CONFIG" => " ",
|
"SERVER_CONFIG" => "",
|
||||||
"SERVER_CONFIG" => " ",
|
"ENGINE_CONFIG" => "",
|
||||||
"ENGINE_CONFIG" => " ",
|
|
||||||
"IP_CONFIG" => " ",
|
|
||||||
"SERVER_MQTT" => "server_mqtt",
|
"SERVER_MQTT" => "server_mqtt",
|
||||||
"URL" => "url",
|
"URL" => "url",
|
||||||
"LUU_LAI" => "Save",
|
"LUU_LAI" => "Save",
|
||||||
@@ -59,7 +57,7 @@ return [
|
|||||||
"TIM_KIEM_DU_LIEU" => "Search the data",
|
"TIM_KIEM_DU_LIEU" => "Search the data",
|
||||||
"TAT_CA" => "All",
|
"TAT_CA" => "All",
|
||||||
"TIM_KIEM" => "Search",
|
"TIM_KIEM" => "Search",
|
||||||
"XOA_NHIEU_DU_LIEU" => "Choose multiple data",
|
"XOA_NHIEU_DU_LIEU" => "Delete multiple data",
|
||||||
"CHON_TOAN_BO_TRANG" => "Select all data",
|
"CHON_TOAN_BO_TRANG" => "Select all data",
|
||||||
"BO_CHON" => "Unselect",
|
"BO_CHON" => "Unselect",
|
||||||
"XAC_NHAN_XOA" => "Deletion Confirm",
|
"XAC_NHAN_XOA" => "Deletion Confirm",
|
||||||
@@ -138,43 +136,5 @@ return [
|
|||||||
"MAT_KHAU" => "Password",
|
"MAT_KHAU" => "Password",
|
||||||
"RESET_THIET_BI_LOI" => "Error connecting to the server. Please check your internet connection and try again.",
|
"RESET_THIET_BI_LOI" => "Error connecting to the server. Please check your internet connection and try again.",
|
||||||
"THU_LAI" => "Try again",
|
"THU_LAI" => "Try again",
|
||||||
"TEN_DANG_NHAP_HOAC_MAT_KHAU_KHONG_DUNG" => "Incorrect username or password.",
|
"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?",
|
|
||||||
"DIEU_KHIEN_THIET_BI" => "Device controller",
|
|
||||||
"DEVICE_CONTROLLER" => " ",
|
|
||||||
"DIEU_KHIEN_CHUONG_TRINH_NHAN_DIEN" => "Control recognition program",
|
|
||||||
"ON" => "On",
|
|
||||||
"OFF" => "Off",
|
|
||||||
"THOI_GIAN_HOAT_DONG_CUA_THIET_BI" => "Device operating time",
|
|
||||||
"THOI_GIAN_BAT_DEN" => "Time to turn on the light",
|
|
||||||
"BACKGROUND" => "Background",
|
|
||||||
"BACKGROUND_DESCRIPTION" => "Maximum size 3.5MB (recommended resolution 1280x640px)",
|
|
||||||
"AM_THANH" => "Sound",
|
|
||||||
"THOI_GIAN_KHONG_DUOC_DE_TRONG" => "Time cannot be left blank",
|
|
||||||
"THONG_TIN_DA_DUOC_LUU_LAI" => "The information has been saved",
|
|
||||||
"CHON_AM_THANH" => "Select sound"
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,11 +11,9 @@ return [
|
|||||||
"CAU_HINH_THIET_BI" => "デバイス構成",
|
"CAU_HINH_THIET_BI" => "デバイス構成",
|
||||||
"CAU_HINH_MAY_CHU" => " サーバ構成",
|
"CAU_HINH_MAY_CHU" => " サーバ構成",
|
||||||
"CAU_HINH_NHAN_DIEN" => "認識構成",
|
"CAU_HINH_NHAN_DIEN" => "認識構成",
|
||||||
"CAU_HINH_IP" => "IP 構成",
|
|
||||||
"DEVICE_CONFIG" => "Device config",
|
"DEVICE_CONFIG" => "Device config",
|
||||||
"SERVER_CONFIG" => "Server config",
|
"SERVER_CONFIG" => "Server config",
|
||||||
"ENGINE_CONFIG" => "Engine config",
|
"ENGINE_CONFIG" => "Engine config",
|
||||||
"IP_CONFIG" => "IP config",
|
|
||||||
"SERVER_MQTT" => "server_mqtt",
|
"SERVER_MQTT" => "server_mqtt",
|
||||||
"URL" => "url",
|
"URL" => "url",
|
||||||
"LUU_LAI" => "保存する",
|
"LUU_LAI" => "保存する",
|
||||||
@@ -59,7 +57,7 @@ return [
|
|||||||
"TIM_KIEM_DU_LIEU" => "データ検索",
|
"TIM_KIEM_DU_LIEU" => "データ検索",
|
||||||
"TAT_CA" => "全部",
|
"TAT_CA" => "全部",
|
||||||
"TIM_KIEM" => "検索",
|
"TIM_KIEM" => "検索",
|
||||||
"XOA_NHIEU_DU_LIEU" => "複数のデータを選択",
|
"XOA_NHIEU_DU_LIEU" => "大量のデータを削除する",
|
||||||
"CHON_TOAN_BO_TRANG" => "ページ全体を選択",
|
"CHON_TOAN_BO_TRANG" => "ページ全体を選択",
|
||||||
"BO_CHON" => "取り消し",
|
"BO_CHON" => "取り消し",
|
||||||
"XAC_NHAN_XOA" => "削除の確認",
|
"XAC_NHAN_XOA" => "削除の確認",
|
||||||
@@ -138,43 +136,5 @@ return [
|
|||||||
"MAT_KHAU" => "パスワード",
|
"MAT_KHAU" => "パスワード",
|
||||||
"RESET_THIET_BI_LOI" => "サーバーへの接続中にエラーが発生しました。インターネット接続を確認して、もう一度お試しください",
|
"RESET_THIET_BI_LOI" => "サーバーへの接続中にエラーが発生しました。インターネット接続を確認して、もう一度お試しください",
|
||||||
"THU_LAI" => "再試行",
|
"THU_LAI" => "再試行",
|
||||||
"TEN_DANG_NHAP_HOAC_MAT_KHAU_KHONG_DUNG" => "ユーザーネームまたはパスワードが違います",
|
"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" => "再起動してもよろしいですか?",
|
|
||||||
"DIEU_KHIEN_THIET_BI" => "コントローラ",
|
|
||||||
"DEVICE_CONTROLLER" => "Device controller",
|
|
||||||
"DIEU_KHIEN_CHUONG_TRINH_NHAN_DIEN" => "制御認識プログラム",
|
|
||||||
"ON" => "On",
|
|
||||||
"OFF" => "Off",
|
|
||||||
"THOI_GIAN_HOAT_DONG_CUA_THIET_BI" => "デバイスの動作時間",
|
|
||||||
"THOI_GIAN_BAT_DEN" => "ライトをつける時間です",
|
|
||||||
"BACKGROUND" => "背景",
|
|
||||||
"BACKGROUND_DESCRIPTION" => "最大サイズ 3.5MB (推奨解像度 1280x640px)",
|
|
||||||
"AM_THANH" => "音",
|
|
||||||
"THOI_GIAN_KHONG_DUOC_DE_TRONG" => "時間を空白のままにすることはできません",
|
|
||||||
"THONG_TIN_DA_DUOC_LUU_LAI" => "情報が保存されました",
|
|
||||||
"CHON_AM_THANH" => "サウンドを選択する"
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -11,11 +11,9 @@ return [
|
|||||||
"CAU_HINH_THIET_BI" => "Cấu hình thiết bị",
|
"CAU_HINH_THIET_BI" => "Cấu hình thiết bị",
|
||||||
"CAU_HINH_MAY_CHU" => "Cấu hình máy chủ",
|
"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_NHAN_DIEN" => "Cấu hình nhận diện",
|
||||||
"CAU_HINH_IP" => "Cấu hình IP",
|
|
||||||
"DEVICE_CONFIG" => "Device config",
|
"DEVICE_CONFIG" => "Device config",
|
||||||
"SERVER_CONFIG" => "Server config",
|
"SERVER_CONFIG" => "Server config",
|
||||||
"ENGINE_CONFIG" => "Engine config",
|
"ENGINE_CONFIG" => "Engine config",
|
||||||
"IP_CONFIG" => "IP config",
|
|
||||||
"SERVER_MQTT" => "server_mqtt",
|
"SERVER_MQTT" => "server_mqtt",
|
||||||
"URL" => "url",
|
"URL" => "url",
|
||||||
"LUU_LAI" => "Lưu lại",
|
"LUU_LAI" => "Lưu lại",
|
||||||
@@ -59,7 +57,7 @@ return [
|
|||||||
"TIM_KIEM_DU_LIEU" => "Tìm kiếm dữ liệu",
|
"TIM_KIEM_DU_LIEU" => "Tìm kiếm dữ liệu",
|
||||||
"TAT_CA" => "Tất cả",
|
"TAT_CA" => "Tất cả",
|
||||||
"TIM_KIEM" => "Tìm kiếm",
|
"TIM_KIEM" => "Tìm kiếm",
|
||||||
"XOA_NHIEU_DU_LIEU" => "Chọn nhiều dữ liệu",
|
"XOA_NHIEU_DU_LIEU" => "Xóa nhiều dữ liệu",
|
||||||
"CHON_TOAN_BO_TRANG" => "Chọn toàn bộ trang",
|
"CHON_TOAN_BO_TRANG" => "Chọn toàn bộ trang",
|
||||||
"BO_CHON" => "Bỏ chọn",
|
"BO_CHON" => "Bỏ chọn",
|
||||||
"XAC_NHAN_XOA" => "Xác nhận xóa",
|
"XAC_NHAN_XOA" => "Xác nhận xóa",
|
||||||
@@ -138,43 +136,5 @@ return [
|
|||||||
"MAT_KHAU" => "Mật khẩu",
|
"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.",
|
"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",
|
"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.",
|
"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?",
|
|
||||||
"DIEU_KHIEN_THIET_BI" => "Điều khiển thiết bị",
|
|
||||||
"DEVICE_CONTROLLER" => "Device controller",
|
|
||||||
"DIEU_KHIEN_CHUONG_TRINH_NHAN_DIEN" => "Điều khiển chương trình nhận diện",
|
|
||||||
"ON" => "Bật",
|
|
||||||
"OFF" => "Tắt",
|
|
||||||
"THOI_GIAN_HOAT_DONG_CUA_THIET_BI" => "Thời gian hoạt động của thiết bị",
|
|
||||||
"THOI_GIAN_BAT_DEN" => "Thời gian bật đèn",
|
|
||||||
"BACKGROUND" => "Hình nền",
|
|
||||||
"BACKGROUND_DESCRIPTION" => "Kích thước tối đa 3.5MB (độ phân giải khuyến nghị 1280x640px)",
|
|
||||||
"AM_THANH" => "Âm thanh",
|
|
||||||
"THOI_GIAN_KHONG_DUOC_DE_TRONG" => "Thời gian không được để trống",
|
|
||||||
"THONG_TIN_DA_DUOC_LUU_LAI" => "Thông tin đã được lưu lại",
|
|
||||||
"CHON_AM_THANH" => "Chọn âm thanh"
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class ListManagement extends \yii\db\ActiveRecord {
|
|||||||
'id' => Yii::t("app", "ID"),
|
'id' => Yii::t("app", "ID"),
|
||||||
'code' => Yii::t("app", "ID"),
|
'code' => Yii::t("app", "ID"),
|
||||||
'type' => Yii::t("app", "LOAI"),
|
'type' => Yii::t("app", "LOAI"),
|
||||||
'name' => Yii::t("app", "TEN_HIEN_THI"),
|
'name' => Yii::t("app", "TEN"),
|
||||||
'image' => Yii::t("app", "HINH_ANH_DANG_KI"),
|
'image' => Yii::t("app", "HINH_ANH_DANG_KI"),
|
||||||
'gender' => Yii::t("app", "GIOI_TINH"),
|
'gender' => Yii::t("app", "GIOI_TINH"),
|
||||||
'birthday' => Yii::t("app", "NGAY_SINH"),
|
'birthday' => Yii::t("app", "NGAY_SINH"),
|
||||||
@@ -56,7 +56,7 @@ class ListManagement extends \yii\db\ActiveRecord {
|
|||||||
'address' => Yii::t("app", "DON_VI"),
|
'address' => Yii::t("app", "DON_VI"),
|
||||||
'time' => Yii::t("app", "THOI_GIAN_DANG_KI"),
|
'time' => Yii::t("app", "THOI_GIAN_DANG_KI"),
|
||||||
'last_modified' => 'Last Modified',
|
'last_modified' => 'Last Modified',
|
||||||
'abbreviated_name' => Yii::t("app", "TEN"),
|
'abbreviated_name' => Yii::t("app", "TEN_HIEN_THI"),
|
||||||
'staff_id' => Yii::t("app", "ID"),
|
'staff_id' => Yii::t("app", "ID"),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -110,25 +110,19 @@ class ListManagement extends \yii\db\ActiveRecord {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function getAllID() {
|
public static function getAllID() {
|
||||||
$idArr = [];
|
$res = [];
|
||||||
$imgCountArr = [];
|
|
||||||
$ls = self::find()->all();
|
$ls = self::find()->all();
|
||||||
foreach ($ls as $key => $value) {
|
foreach ($ls as $key => $value) {
|
||||||
$idArr[] = $value->staff_id;
|
$res[] = $value->staff_id;
|
||||||
$images = json_decode($value->image, true);
|
|
||||||
$imgCountArr[$value->staff_id] = count($images);
|
|
||||||
}
|
}
|
||||||
return [
|
return $res;
|
||||||
"idArr" => $idArr,
|
|
||||||
"imgCountArr" => $imgCountArr
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function staffArray() {
|
public static function staffArray() {
|
||||||
$res = [];
|
$res = [];
|
||||||
$ls = self::find()->all();
|
$ls = self::find()->all();
|
||||||
foreach ($ls as $key => $value) {
|
foreach ($ls as $key => $value) {
|
||||||
$res[$value->id] = $value->code . " - " . $value->name;
|
$res[$value->code] = $value->code . " - " . $value->name;
|
||||||
}
|
}
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
@@ -179,8 +173,4 @@ class ListManagement extends \yii\db\ActiveRecord {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSchedule() {
|
|
||||||
return Schedule::find()->andWhere(['staff_id' => $this->id])->all();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
<?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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -131,33 +131,6 @@ class UploadForm extends Model {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UploadSound($file, $fileTypes, $path) {
|
|
||||||
$root = \Yii::getAlias('@app') . '/web/data';
|
|
||||||
$LocalPath = "/" . $path;
|
|
||||||
$RootFolder = $root . $LocalPath;
|
|
||||||
$destfile = "welcome_en.wav";
|
|
||||||
if (!empty($_FILES)) {
|
|
||||||
$tempFile = $_FILES[$file]['tmp_name'];
|
|
||||||
$targetPath = $RootFolder;
|
|
||||||
if (!file_exists($targetPath)) {
|
|
||||||
@mkdir($targetPath, 0777, true);
|
|
||||||
}
|
|
||||||
$targetFile = $targetPath . '/' . $destfile;
|
|
||||||
$targetFileLocal = $LocalPath . '/' . $destfile;
|
|
||||||
$fileParts = pathinfo($_FILES[$file]['name']);
|
|
||||||
if (in_array(strtoupper($fileParts['extension']), $fileTypes)) {
|
|
||||||
move_uploaded_file($tempFile, $targetFile);
|
|
||||||
if (file_exists($targetFile)) {
|
|
||||||
return $targetFileLocal;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Move file
|
//Move file
|
||||||
public function MoveFile($file, $folder) {
|
public function MoveFile($file, $folder) {
|
||||||
$currentStorage = Storage::findOne(['stt' => 1])->folder;
|
$currentStorage = Storage::findOne(['stt' => 1])->folder;
|
||||||
|
|||||||
0
runtime/temp.txt
Executable file → Normal file
0
runtime/temp.txt
Executable file → Normal file
@@ -36,40 +36,31 @@ use yii\widgets\ActiveForm;
|
|||||||
<!-- Collect the nav links, forms, and other content for toggling -->
|
<!-- Collect the nav links, forms, and other content for toggling -->
|
||||||
<div class="collapse navbar-collapse pull-left" id="navbar-collapse">
|
<div class="collapse navbar-collapse pull-left" id="navbar-collapse">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="<?php if (Yii::$app->controller->id == "config" && Yii::$app->controller->action->id != "system-info") echo "active"; ?>">
|
<li class="<?php if (Yii::$app->controller->id == "config") echo "active"; ?>">
|
||||||
<a href="<?php echo yii\helpers\Url::to(['/config/cau-hinh-thiet-bi']); ?>">
|
<a href="<?php echo yii\helpers\Url::to(['/config/cau-hinh-thiet-bi']); ?>">
|
||||||
<i class="fa fa-cogs"></i> <?php echo Yii::t("app", "CAU_HINH"); ?>
|
<i class="fa fa-cogs"></i> <?php echo Yii::t("app", "CAU_HINH"); ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php if (Yii::$app->params['type'] === "BiFace") { ?>
|
|
||||||
<?php if (Yii::$app->user->identity->username == "admin") { ?>
|
|
||||||
<li>
|
<li>
|
||||||
<a href="<?php echo yii\helpers\Url::to(['/config/reset']); ?>" onclick="common.resetForm(this);return false;">
|
<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"); ?>
|
<i class="fa fa-refresh"></i> <?php echo Yii::t("app", "RESET_THIET_BI"); ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
|
||||||
<li class="<?php if (Yii::$app->controller->id == "list-management") echo "active"; ?>">
|
<li class="<?php if (Yii::$app->controller->id == "list-management") echo "active"; ?>">
|
||||||
<a href="<?php echo yii\helpers\Url::to(['/list-management']); ?>">
|
<a href="<?php echo yii\helpers\Url::to(['/list-management']); ?>">
|
||||||
<i class="fa fa-list"></i> <?php echo Yii::t("app", "QUAN_LY_MAU"); ?>
|
<i class="fa fa-list"></i> <?php echo Yii::t("app", "QUAN_LY_MAU"); ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="dropdown <?php if (in_array(Yii::$app->controller->id, ['capture-logs', 'control-logs'])) echo "active"; ?>">
|
<li class="<?php if (Yii::$app->controller->id == "capture-logs") echo "active"; ?>">
|
||||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
|
<a href="<?php echo yii\helpers\Url::to(['/capture-logs']); ?>">
|
||||||
<i class="fa fa-list-alt"></i> <?php echo Yii::t("app", "LICH_SU_HE_THONG"); ?>
|
<i class="fa fa-camera"></i> <?php echo Yii::t("app", "LICH_SU_HE_THONG"); ?>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu" role="menu">
|
</li>
|
||||||
<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 class="<?php if (Yii::$app->controller->id == "control-logs") echo "active"; ?>">
|
||||||
<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>
|
<a href="<?php echo yii\helpers\Url::to(['/control-logs']); ?>">
|
||||||
<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>
|
<i class="fa fa-database"></i> <?php echo Yii::t("app", "DANH_SACH_NHAN_DIEN"); ?>
|
||||||
</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>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-custom-menu">
|
<div class="navbar-custom-menu">
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
{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}
|
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
<div class="col-md-4 text-center">
|
<div class="col-md-4 text-center">
|
||||||
<img src="" class="img-thumbnail" id="FaceImage" style="width: 150px;height: 150px;">
|
<img src="" class="img-thumbnail" id="FaceImage" style="width: 150px;height: 150px;">
|
||||||
<div class='feature-img'>
|
<div class='feature-img'>
|
||||||
<img src="/images/user2-160x160.jpg" class="img-thumbnail" id="closest-img" style="width: 100px;height:100px;">
|
<img src="" class="img-thumbnail" id="closest-img" style="width: 100px;height:100px;">
|
||||||
<br>
|
<br>
|
||||||
<i id="closest-name"></i>
|
<i id="closest-name"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -142,8 +142,32 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<br>
|
<br>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-8">
|
||||||
{$menu}
|
<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'])}';">
|
||||||
|
{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-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'])}';">
|
||||||
|
{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-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'])}';">
|
||||||
|
{Yii::t("app", "CAU_HINH_NHAN_DIEN")}
|
||||||
|
</div>
|
||||||
|
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "ENGINE_CONFIG")}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@@ -16,8 +16,32 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<br>
|
<br>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-8">
|
||||||
{$menu}
|
<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'])}';">
|
||||||
|
{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-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'])}';">
|
||||||
|
{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-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'])}';">
|
||||||
|
{Yii::t("app", "CAU_HINH_NHAN_DIEN")}
|
||||||
|
</div>
|
||||||
|
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "ENGINE_CONFIG")}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@@ -1,114 +0,0 @@
|
|||||||
{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{
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.table-striped > tbody > tr:nth-of-type(odd) {
|
|
||||||
background-color: #d1d1d1;
|
|
||||||
}
|
|
||||||
.form-group{
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<div class="container-fluid">
|
|
||||||
<br>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
{$menu}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-4 col-md-push-1">
|
|
||||||
<table class="table table-bordered table-striped" style="background: #fff;">
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<th style="width: 50%;">{Yii::t("app","DIEU_KHIEN_CHUONG_TRINH_NHAN_DIEN")}</th>
|
|
||||||
<td>
|
|
||||||
<div class="btn-group">
|
|
||||||
<button class="btn-control-engine btn btn-{if $engineStatus.status}success{else}default{/if}" onclick="controlEngine(this);" data-href="{Url::to(['control-engine', 'status'=>"on"])}">
|
|
||||||
{Yii::t("app","ON")}
|
|
||||||
</button>
|
|
||||||
<button class="btn-control-engine btn btn-{if $engineStatus.status}default{else}danger{/if}" onclick="controlEngine(this);" data-href="{Url::to(['control-engine', 'status'=>"off"])}">
|
|
||||||
{Yii::t("app","OFF")}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>{Yii::t("app","THOI_GIAN_HOAT_DONG_CUA_THIET_BI")}</th>
|
|
||||||
<td>
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-addon">{Yii::t("app","FROM")}</div>
|
|
||||||
<input type="text" class="form-control" name="EngineBegin" id="EngineBegin" value="{$config_engine.start_at|default:""}">
|
|
||||||
<div class="input-group-addon">{Yii::t("app","TO")}</div>
|
|
||||||
<input type="text" class="form-control" name="EngineEnd" id="EngineEnd" value="{$config_engine.end_at|default:""}">
|
|
||||||
<div class="input-group-btn">
|
|
||||||
<button id='btn-save-light' class="btn btn-primary" onclick="saveTimeEngineConfig(this);" data-href="{Url::to(['save-time-engine-config'])}">
|
|
||||||
<i class="fa fa-floppy-o"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>{Yii::t("app","THOI_GIAN_BAT_DEN")}</th>
|
|
||||||
<td>
|
|
||||||
<div class="btn-group">
|
|
||||||
<button class="btn-control-light btn btn-{if $config_light.enable==="1"}success{else}default{/if}" onclick="controlSetupLight(this, true);">
|
|
||||||
{Yii::t("app","ON")}
|
|
||||||
</button>
|
|
||||||
<button class="btn-control-light btn btn-{if $config_light.enable==="1"}default{else}danger{/if}" onclick="controlSetupLight(this, false);">
|
|
||||||
{Yii::t("app","OFF")}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div id="time-light-config" class="form-group {if $config_light.enable==="0"}hidden{/if}">
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-addon">{Yii::t("app","FROM")}</div>
|
|
||||||
<input type="text" class="form-control" name="LightBegin" id="LightBegin" value="{$config_light.start_at|default:""}">
|
|
||||||
<div class="input-group-addon">{Yii::t("app","TO")}</div>
|
|
||||||
<input type="text" class="form-control" name="LightEnd" id="LightEnd" value="{$config_light.end_at|default:""}">
|
|
||||||
<div class="input-group-btn">
|
|
||||||
<button id='btn-save-light' class="btn btn-primary" onclick="saveTimeLightConfig(this);" data-href="{Url::to(['save-time-light-config'])}" data-enable='{$config_light.enable}'>
|
|
||||||
<i class="fa fa-floppy-o"></i>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>{Yii::t("app","BACKGROUND")}</th>
|
|
||||||
<td>
|
|
||||||
<input type="file" name="image" id="image">
|
|
||||||
<input type="hidden" name="url_upload_background" value="{Url::to(['background'])}">
|
|
||||||
<div>
|
|
||||||
{if $background!=""}
|
|
||||||
<img src="/data{$background}" width="100%" class="img-thumbnail">
|
|
||||||
{/if}
|
|
||||||
<i class="text-red"><span class="fa fa-info-circle"></span> {Yii::t("app","BACKGROUND_DESCRIPTION")}</i>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>{Yii::t("app","AM_THANH")}</th>
|
|
||||||
<td>
|
|
||||||
<input type="file" name="sound" id="sound">
|
|
||||||
<input type="hidden" name="url_upload_sound" value="{Url::to(['sound'])}">
|
|
||||||
<div>
|
|
||||||
<a href="/data/audio/welcome_en.wav">welcome_en.wav</a>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/block}
|
|
||||||
@@ -16,8 +16,32 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<br>
|
<br>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-8">
|
||||||
{$menu}
|
<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'])}';">
|
||||||
|
{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-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'])}';">
|
||||||
|
{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-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'])}';">
|
||||||
|
{Yii::t("app", "CAU_HINH_NHAN_DIEN")}
|
||||||
|
</div>
|
||||||
|
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "ENGINE_CONFIG")}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@@ -1,68 +0,0 @@
|
|||||||
{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-12">
|
|
||||||
{$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}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
{use class="yii\helpers\Url"}
|
|
||||||
{if Yii::$app->params["type"]==="BiFace"}
|
|
||||||
{$username=Yii::$app->user->identity->username}
|
|
||||||
<div class="mt-element-step">
|
|
||||||
<div class="row step-thin">
|
|
||||||
{if $username=='admin'}
|
|
||||||
<div class="col-md-2 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-2 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>
|
|
||||||
{/if}
|
|
||||||
<div class="col-md-2 bg-grey mt-step-col {if $tab=="engine_config"}active{/if}">
|
|
||||||
<div class="mt-step-number bg-white font-grey">{if $username=='admin'}3{else}1{/if}</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-2 bg-grey mt-step-col {if $tab=="ip_config"}active{/if}">
|
|
||||||
<div class="mt-step-number bg-white font-grey">{if $username=='admin'}4{else}2{/if}</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 class="col-md-2 bg-grey mt-step-col {if $tab=="device_controller"}active{/if}">
|
|
||||||
<div class="mt-step-number bg-white font-grey">{if $username=='admin'}5{else}3{/if}</div>
|
|
||||||
<div class="mt-step-title uppercase font-grey-cascade" style="cursor: pointer;" onclick="window.location = '{Url::to(['/config/dieu-khien-thiet-bi'])}';">
|
|
||||||
{Yii::t("app", "DIEU_KHIEN_THIET_BI")}
|
|
||||||
</div>
|
|
||||||
<div class="mt-step-content font-grey-cascade">{Yii::t("app", "DEVICE_CONTROLLER")}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
{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>
|
|
||||||
{/block}
|
|
||||||
@@ -30,13 +30,6 @@
|
|||||||
<input type="hidden" name="DA_THEM_HINH_ANH_MAU" value="{Yii::t("app", "DA_THEM_HINH_ANH_MAU")}">
|
<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="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="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")}">
|
|
||||||
<input type="hidden" name="THOI_GIAN_KHONG_DUOC_DE_TRONG" value="{Yii::t("app", "THOI_GIAN_KHONG_DUOC_DE_TRONG")}">
|
|
||||||
<input type="hidden" name="THONG_TIN_DA_DUOC_LUU_LAI" value="{Yii::t("app", "THONG_TIN_DA_DUOC_LUU_LAI")}">
|
|
||||||
<input type="hidden" name="CHON_AM_THANH" value="{Yii::t("app", "CHON_AM_THANH")}">
|
|
||||||
|
|
||||||
<div id="blocking" class="fade modal" role="dialog" tabindex="-1">
|
<div id="blocking" class="fade modal" role="dialog" tabindex="-1">
|
||||||
<div class="modal-dialog" style="top: 50%;margin-top: -45px;">
|
<div class="modal-dialog" style="top: 50%;margin-top: -45px;">
|
||||||
@@ -51,19 +44,6 @@
|
|||||||
</div>
|
</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>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="uploadBlock" class="fade modal" role="dialog" tabindex="-1">
|
<div id="uploadBlock" class="fade modal" role="dialog" tabindex="-1">
|
||||||
<div class="modal-dialog" style="top: 50%;margin-top: -45px;">
|
<div class="modal-dialog" style="top: 50%;margin-top: -45px;">
|
||||||
<div class="modal-content" style="background-color: transparent;box-shadow: none;">
|
<div class="modal-content" style="background-color: transparent;box-shadow: none;">
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
.row{
|
.row{
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
{*input{
|
input{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}*}
|
}
|
||||||
.table-striped > tbody > tr:nth-of-type(odd){
|
.table-striped > tbody > tr:nth-of-type(odd){
|
||||||
background-color: rgb(210, 210, 210);
|
background-color: rgb(210, 210, 210);
|
||||||
}
|
}
|
||||||
@@ -21,21 +21,13 @@
|
|||||||
.feature-img:hover .btn{
|
.feature-img:hover .btn{
|
||||||
visibility: visible !important;
|
visibility: visible !important;
|
||||||
}
|
}
|
||||||
.btn-schedule{
|
|
||||||
visibility: hidden;
|
|
||||||
}
|
|
||||||
.schedule-item:hover .btn-schedule{
|
|
||||||
visibility: visible !important;
|
|
||||||
}
|
|
||||||
.table > tbody > tr.delete-choose > td{
|
.table > tbody > tr.delete-choose > td{
|
||||||
background-color: #F7D3D2;
|
background-color: red;
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
#filters-face .select2-container {
|
.select2-container {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
.pagination {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
#form-add-staff .select2-container--default .select2-selection--single, .select2-selection .select2-selection--single{
|
#form-add-staff .select2-container--default .select2-selection--single, .select2-selection .select2-selection--single{
|
||||||
border-color: green;
|
border-color: green;
|
||||||
}
|
}
|
||||||
@@ -51,10 +43,10 @@
|
|||||||
<input type="hidden" value="{Url::to(["/list-management/update-feature"])}" name="update_feature_url">
|
<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">
|
<input type="hidden" value="{Url::to(["/api/get-total-feature"])}" name="get_total_feature_url">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-10" id="list-face" style="max-height: 850px;overflow-y: auto;">
|
<div class="col-md-10" style="max-height: 850px;overflow-y: auto;">
|
||||||
{GridView::widget([
|
{GridView::widget([
|
||||||
'dataProvider' => $dataProvider,
|
'dataProvider' => $dataProvider,
|
||||||
'layout'=> \app\helpers\ListManagementGrid::layout(20),
|
'layout'=> \app\helpers\ListManagementGrid::getLayout(),
|
||||||
'tableOptions' => [
|
'tableOptions' => [
|
||||||
'class' => 'table table-striped table-bordered',
|
'class' => 'table table-striped table-bordered',
|
||||||
'style' => 'background:#fff;min-width:700px;'
|
'style' => 'background:#fff;min-width:700px;'
|
||||||
@@ -66,12 +58,6 @@
|
|||||||
'contentOptions' => ['class' => 'text-center'],
|
'contentOptions' => ['class' => 'text-center'],
|
||||||
'headerOptions' => ['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',
|
'attribute' => 'type',
|
||||||
'contentOptions' => ['class' => 'text-center'],
|
'contentOptions' => ['class' => 'text-center'],
|
||||||
@@ -98,10 +84,10 @@
|
|||||||
'value' => \app\helpers\ListManagementGrid::image()
|
'value' => \app\helpers\ListManagementGrid::image()
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => Yii::t("app", "LICH_TRINH"),
|
'attribute' => 'time',
|
||||||
|
'contentOptions' => ['class' => 'text-center'],
|
||||||
'headerOptions' => ['class' => 'text-center'],
|
'headerOptions' => ['class' => 'text-center'],
|
||||||
'format' => "raw",
|
'value' => \app\helpers\ListManagementGrid::time()
|
||||||
'value' => \app\helpers\ListManagementGrid::schedule()
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'attribute' => 'telephone',
|
'attribute' => 'telephone',
|
||||||
@@ -172,7 +158,6 @@
|
|||||||
<br>
|
<br>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<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-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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="row" id="filters-face">
|
<div class="row">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@@ -15,35 +15,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
<div style="max-height: 750px;overflow-y: auto;">
|
<div style="max-height: 750px;overflow-y: auto;">
|
||||||
<table class="table table-bordered table-striped">
|
<table class="table table-bordered table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{Yii::t("app", "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", "TEN")}</th>
|
||||||
|
<th>{Yii::t("app", "TEN_HIEN_THI")}</th>
|
||||||
<th>{Yii::t("app", "DON_VI")}</th>
|
<th>{Yii::t("app", "DON_VI")}</th>
|
||||||
<th>{Yii::t("app", "HINH_ANH_DANG_KI")}</th>
|
<th>{Yii::t("app", "HINH_ANH_DANG_KI")}</th>
|
||||||
<th>{Yii::t("app", "COMPANY_ID")}</th>
|
<th>{Yii::t("app", "COMPANY_ID")}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="sync-lists">
|
<tbody id="sync-lists">
|
||||||
{$totalDevice=0}
|
|
||||||
{$totalCloud=0}
|
|
||||||
{foreach from=$datas item=arr}
|
{foreach from=$datas item=arr}
|
||||||
{$totalImg=0}
|
<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)}">
|
||||||
{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>
|
<td>
|
||||||
<div id="full-data-{trim($arr.id)}" class="hidden">{json_encode($arr)}</div>
|
<div id="full-data-{trim($arr.id)}" class="hidden">{json_encode($arr)}</div>
|
||||||
{$arr.code}
|
{$arr.code}
|
||||||
@@ -51,11 +38,7 @@
|
|||||||
<i class="fa fa-check-circle text-green"></i>
|
<i class="fa fa-check-circle text-green"></i>
|
||||||
{/if}
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>{$arr.name}</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.abbreviated_name}</td>
|
||||||
<td>{$arr.department}</td>
|
<td>{$arr.department}</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -73,8 +56,6 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<b class="text-green" id="totalDevice">[{$totalDevice}]</b>
|
|
||||||
<b class="text-red" id="totalCloud">[{$totalCloud}]</b>
|
|
||||||
<br>
|
<br>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="row" id="filters-face">
|
<div class="row">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
@@ -21,8 +21,8 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{Yii::t("app", "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", "TEN")}<</th>
|
||||||
|
<th>{Yii::t("app", "TEN_HIEN_THI")}</th>
|
||||||
<th>{Yii::t("app", "GIOI_TINH")}</th>
|
<th>{Yii::t("app", "GIOI_TINH")}</th>
|
||||||
<th>{Yii::t("app", "HINH_ANH_DANG_KI")}</th>
|
<th>{Yii::t("app", "HINH_ANH_DANG_KI")}</th>
|
||||||
<th>{Yii::t("app", "NGAY_SINH")}</th>
|
<th>{Yii::t("app", "NGAY_SINH")}</th>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="row" id="filters-face">
|
<div class="row">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
|
|||||||
@@ -1,71 +0,0 @@
|
|||||||
<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>
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
<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>
|
|
||||||
0
web/assets/temp.txt
Executable file → Normal file
0
web/assets/temp.txt
Executable file → Normal file
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
// comment out the following two lines when deployed to production
|
// comment out the following two lines when deployed to production
|
||||||
defined('YII_DEBUG') or define('YII_DEBUG', true);
|
//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/autoload.php';
|
||||||
require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';
|
require __DIR__ . '/../vendor/yiisoft/yii2/Yii.php';
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function _form(e) {
|
|||||||
$("input[name='CaptureLogsID']").val($(e).attr("data-id"));
|
$("input[name='CaptureLogsID']").val($(e).attr("data-id"));
|
||||||
$("#FaceImage").attr("src", $(e).attr("data-img"));
|
$("#FaceImage").attr("src", $(e).attr("data-img"));
|
||||||
var confidence = JSON.parse($(e).attr("data-confidence"));
|
var confidence = JSON.parse($(e).attr("data-confidence"));
|
||||||
$("#closest-img").attr("src", confidence.img != "" ? confidence.img : "/images/user2-160x160.jpg");
|
$("#closest-img").attr("src", confidence.img);
|
||||||
$("#closest-name").html(confidence.name + " [" + confidence.score + "]");
|
$("#closest-name").html(confidence.name + " [" + confidence.score + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ $(document).on('focusin', function (e) {
|
|||||||
/**
|
/**
|
||||||
* Các hàm sử dụng chung
|
* Các hàm sử dụng chung
|
||||||
*/
|
*/
|
||||||
$('select').select2();
|
|
||||||
var common = {};
|
var common = {};
|
||||||
common.csrf = $('meta[name="csrf-token"]').attr("content");
|
common.csrf = $('meta[name="csrf-token"]').attr("content");
|
||||||
common.csrfParam = $('meta[name="csrf-param"]').attr("content");
|
common.csrfParam = $('meta[name="csrf-param"]').attr("content");
|
||||||
@@ -361,26 +360,7 @@ common.changeLanguage = function (e) {
|
|||||||
error: function (jqXHR, textStatus, errorThrown) {
|
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();
|
|
||||||
};
|
|
||||||
/**
|
/**
|
||||||
* =========================
|
* =========================
|
||||||
*/
|
*/
|
||||||
|
|||||||
227
web/js/config.js
227
web/js/config.js
@@ -1,10 +1,5 @@
|
|||||||
$(function () {
|
$(function () {
|
||||||
common.dateTimePickerHour("LightBegin");
|
|
||||||
common.dateTimePickerHour("LightEnd");
|
|
||||||
common.dateTimePickerHour("EngineBegin");
|
|
||||||
common.dateTimePickerHour("EngineEnd");
|
|
||||||
btnBackground($("input[name='url_upload_background']").val(), "", '.png,.jpg,.jpeg,.gif', 3.5);
|
|
||||||
btnSound($("input[name='url_upload_sound']").val(), "", '.wav', 3.5);
|
|
||||||
});
|
});
|
||||||
function saveStep1(e) {
|
function saveStep1(e) {
|
||||||
var servermqtt = $("input[name='servermqtt']").val();
|
var servermqtt = $("input[name='servermqtt']").val();
|
||||||
@@ -121,223 +116,3 @@ function SaveConfigDevice(e) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function controlEngine(e) {
|
|
||||||
common.modalBlock(true);
|
|
||||||
$.ajax({
|
|
||||||
url: $(e).attr("data-href"),
|
|
||||||
type: 'POST',
|
|
||||||
success: function (data) {
|
|
||||||
common.modalBlock(false);
|
|
||||||
$(".btn-control-engine").removeClass("btn-success").removeClass("btn-danger").addClass("btn-default");
|
|
||||||
$(e).removeClass("btn-default").addClass(data == "on" ? "btn-success" : "btn-danger");
|
|
||||||
},
|
|
||||||
error: function (jqXHR, textStatus, errorThrown) {
|
|
||||||
common.modalBlock(false);
|
|
||||||
common.ajaxError();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function controlSetupLight(e, status) {
|
|
||||||
if (status)
|
|
||||||
$("#time-light-config").removeClass("hidden");
|
|
||||||
else
|
|
||||||
$("#time-light-config").addClass("hidden");
|
|
||||||
$("#btn-save-light").attr("data-enable", status ? "1" : "0");
|
|
||||||
$(".btn-control-light").removeClass("btn-success").removeClass("btn-danger").addClass("btn-default");
|
|
||||||
$(e).removeClass("btn-default").addClass(status ? "btn-success" : "btn-danger");
|
|
||||||
if (!status)
|
|
||||||
$("#btn-save-light").trigger("click");
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveTimeLightConfig(e) {
|
|
||||||
var enable = $(e).attr("data-enable");
|
|
||||||
var start_at = $("input[name='LightBegin']").val();
|
|
||||||
var end_at = $("input[name='LightEnd']").val();
|
|
||||||
if (enable === "1" && (start_at == "" || end_at == "")) {
|
|
||||||
alert($("input[name='THOI_GIAN_KHONG_DUOC_DE_TRONG']").val());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
common.modalBlock(true);
|
|
||||||
$.ajax({
|
|
||||||
url: $(e).attr("data-href"),
|
|
||||||
type: 'POST',
|
|
||||||
data: {
|
|
||||||
enable: enable,
|
|
||||||
start_at: start_at,
|
|
||||||
end_at: end_at
|
|
||||||
},
|
|
||||||
success: function (data) {
|
|
||||||
common.modalBlock(false);
|
|
||||||
if (data)
|
|
||||||
notification.success($("input[name='THONG_TIN_DA_DUOC_LUU_LAI']").val(), 2000);
|
|
||||||
else
|
|
||||||
notification.danger($("input[name='CO_LOI_XAY_RA_HAY_THU_LAI']").val(), 2000);
|
|
||||||
},
|
|
||||||
error: function (jqXHR, textStatus, errorThrown) {
|
|
||||||
common.modalBlock(false);
|
|
||||||
common.ajaxError();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveTimeEngineConfig(e) {
|
|
||||||
var start_at = $("input[name='EngineBegin']").val();
|
|
||||||
var end_at = $("input[name='EngineEnd']").val();
|
|
||||||
if (start_at == "" || end_at == "") {
|
|
||||||
alert($("input[name='THOI_GIAN_KHONG_DUOC_DE_TRONG']").val());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
common.modalBlock(true);
|
|
||||||
$.ajax({
|
|
||||||
url: $(e).attr("data-href"),
|
|
||||||
type: 'POST',
|
|
||||||
data: {
|
|
||||||
start_at: start_at,
|
|
||||||
end_at: end_at
|
|
||||||
},
|
|
||||||
success: function (data) {
|
|
||||||
common.modalBlock(false);
|
|
||||||
if (data)
|
|
||||||
notification.success($("input[name='THONG_TIN_DA_DUOC_LUU_LAI']").val(), 2000);
|
|
||||||
else
|
|
||||||
notification.danger($("input[name='CO_LOI_XAY_RA_HAY_THU_LAI']").val(), 2000);
|
|
||||||
},
|
|
||||||
error: function (jqXHR, textStatus, errorThrown) {
|
|
||||||
common.modalBlock(false);
|
|
||||||
common.ajaxError();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function btnBackground(mUrl, className, extension, fileSize) {
|
|
||||||
var fData = {
|
|
||||||
UploadFile: true,
|
|
||||||
Name: className
|
|
||||||
};
|
|
||||||
fData[common.csrfParam] = common.csrf;
|
|
||||||
new afuButton({
|
|
||||||
uploadURI: mUrl,
|
|
||||||
formData: fData,
|
|
||||||
wrap: {
|
|
||||||
tagName: 'div',
|
|
||||||
classes: ''
|
|
||||||
},
|
|
||||||
fileExtension: extension,
|
|
||||||
fileSizeLimit: fileSize,
|
|
||||||
classes: 'btn btn-default btn-xs file-paperclip-' + className,
|
|
||||||
fakeInputContent: '<span class=\'fa fa-picture-o\'></span> ' + $("input[name='CHON_HINH_ANH']").val(),
|
|
||||||
onUploaded: function (data) {
|
|
||||||
common.uploadBlock(false);
|
|
||||||
window.location.reload(true);
|
|
||||||
}
|
|
||||||
}).addInstance('image' + className);
|
|
||||||
$(".file-paperclip-" + className).closest("div").attr("style", "display:inline-block;");
|
|
||||||
}
|
|
||||||
|
|
||||||
function btnSound(mUrl, className, extension, fileSize) {
|
|
||||||
var fData = {
|
|
||||||
UploadFile: true,
|
|
||||||
Name: className
|
|
||||||
};
|
|
||||||
fData[common.csrfParam] = common.csrf;
|
|
||||||
new afuButton({
|
|
||||||
uploadURI: mUrl,
|
|
||||||
formData: fData,
|
|
||||||
wrap: {
|
|
||||||
tagName: 'div',
|
|
||||||
classes: ''
|
|
||||||
},
|
|
||||||
fileExtension: extension,
|
|
||||||
fileSizeLimit: fileSize,
|
|
||||||
classes: 'btn btn-default btn-xs file-paperclip-' + className,
|
|
||||||
fakeInputContent: '<span class=\'fa fa-file\'></span> ' + $("input[name='CHON_AM_THANH']").val(),
|
|
||||||
onUploaded: function (data) {
|
|
||||||
common.uploadBlock(false);
|
|
||||||
notification.success($("input[name='THONG_TIN_DA_DUOC_LUU_LAI']").val(), 2000);
|
|
||||||
}
|
|
||||||
}).addInstance('sound' + className);
|
|
||||||
$(".file-paperclip-" + className).closest("div").attr("style", "display:inline-block;");
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
$(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,5 +1,4 @@
|
|||||||
var x = 0, y = 0;
|
var x = 0, y = 0;
|
||||||
var multiChoose = false;
|
|
||||||
$(function () {
|
$(function () {
|
||||||
common.dateTimePickerByClass("datepicker", "HH:mm DD/MM/YYYY");
|
common.dateTimePickerByClass("datepicker", "HH:mm DD/MM/YYYY");
|
||||||
common.dateTimePickerDay("birthday");
|
common.dateTimePickerDay("birthday");
|
||||||
@@ -10,13 +9,9 @@ $(function () {
|
|||||||
$("input[name='BatchDelete']").change(function () {
|
$("input[name='BatchDelete']").change(function () {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
$("#delete-btn-group").removeClass("hidden");
|
$("#delete-btn-group").removeClass("hidden");
|
||||||
multiChoose = true;
|
|
||||||
$(".checkbox-column").removeClass("hidden");
|
|
||||||
} else {
|
} else {
|
||||||
$("tr").removeClass("delete-choose");
|
$("tr").removeClass("delete-choose");
|
||||||
$("#delete-btn-group").addClass("hidden");
|
$("#delete-btn-group").addClass("hidden");
|
||||||
multiChoose = false;
|
|
||||||
$(".checkbox-column").addClass("hidden");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
btnImage();
|
btnImage();
|
||||||
@@ -186,22 +181,10 @@ function _deleteFeature(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkAll(status) {
|
function checkAll(status) {
|
||||||
if (status) {
|
if (status)
|
||||||
$("#list-face").find("tr").addClass("delete-choose");
|
$("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
|
else
|
||||||
$(e).closest("tr").addClass("delete-choose");
|
$("tr").removeClass("delete-choose");
|
||||||
}
|
}
|
||||||
|
|
||||||
function batchDelete(e) {
|
function batchDelete(e) {
|
||||||
@@ -378,8 +361,6 @@ function checkAllSync(stt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkAllNotInList() {
|
function checkAllNotInList() {
|
||||||
$(".filters").addClass("hidden");
|
|
||||||
$(".not-in-list").removeClass("hidden");
|
|
||||||
$("#sync-lists").find("tr").removeClass("success").attr("data-stt", "false");
|
$("#sync-lists").find("tr").removeClass("success").attr("data-stt", "false");
|
||||||
$(".not-in-list").addClass("success").attr("data-stt", "true");
|
$(".not-in-list").addClass("success").attr("data-stt", "true");
|
||||||
$("#totals-choose").html($(".not-in-list").length);
|
$("#totals-choose").html($(".not-in-list").length);
|
||||||
@@ -450,8 +431,6 @@ function _syncFromServerForm(e) {
|
|||||||
$("#filter-from-server").select2({
|
$("#filter-from-server").select2({
|
||||||
placeholder: $("input[name='TIM_KIEM_THEO_ID_HOAC_TEN']").val()
|
placeholder: $("input[name='TIM_KIEM_THEO_ID_HOAC_TEN']").val()
|
||||||
});
|
});
|
||||||
if ($("#totalDevice").html() === $("#totalCloud").html())
|
|
||||||
$("#btnCheckLossImage").addClass("hidden");
|
|
||||||
},
|
},
|
||||||
error: function (jqXHR, textStatus, errorThrown) {
|
error: function (jqXHR, textStatus, errorThrown) {
|
||||||
common.modalBlock(false);
|
common.modalBlock(false);
|
||||||
@@ -671,181 +650,3 @@ function reGenFeature(e) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
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,10 +17,8 @@ class ConfigTree extends Widget {
|
|||||||
|
|
||||||
public function run() {
|
public function run() {
|
||||||
|
|
||||||
// $public_root = ['engine', 'recognition', 'open_door', 'screen', 'lang', 'camera'];
|
$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', 'camera|rgb', 'camera|ir', 'camera|rgb|url', 'camera|ir|url'];
|
$public_cfg = ['engine|cam_id', 'engine|server_authen', 'recognition|server_recog', 'open_door|enable', 'open_door|port_name', 'screen|banner', 'lang'];
|
||||||
$public_root = ['open_door', 'screen', 'lang', 'play_sound', 'background', 'filter', 'ads'];
|
|
||||||
$public_cfg = ['open_door|door_1', 'open_door|door_2', 'open_door|light', 'open_door|light|enable', 'open_door|light|start_at', 'open_door|light|end_at', 'filter|enable', 'filter|show_name', 'filter|urls', 'screen|banner', 'lang', 'ads|enable', 'ads|get_rules', 'ads|check_new_every', 'ads|ads_type', 'ads|show_video_after', 'ads|audio'];
|
|
||||||
|
|
||||||
return $this->render("config-tree", [
|
return $this->render("config-tree", [
|
||||||
"configLists" => $this->configLists,
|
"configLists" => $this->configLists,
|
||||||
|
|||||||
Reference in New Issue
Block a user