diff --git a/controllers/ControlLogsController.php b/controllers/ControlLogsController.php index bb530417..c209ae30 100644 --- a/controllers/ControlLogsController.php +++ b/controllers/ControlLogsController.php @@ -31,7 +31,7 @@ class ControlLogsController extends Controller { ]; } - public function actionIndex($from = "", $to = "", $name = "", $type = "all", $gender = "all") { + public function actionIndex($from = "", $to = "", $name = "", $type = "all", $gender = "all", $id = "") { $f = date_format(date_create_from_format('H:i d/m/Y', "00:00 " . date("d/m/Y")), 'U'); $t = date_format(date_create_from_format('H:i d/m/Y', "23:59 " . date("d/m/Y")), 'U'); if ($from !== "" && $to !== "") { @@ -44,6 +44,8 @@ class ControlLogsController extends Controller { $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $dataProvider->query->andWhere(["<>", "capture_logs.staff_id", 0]); $dataProvider->query->andWhere(["BETWEEN", "capture_logs.time", $f, $t]); + if ($id !== "") + $dataProvider->query->andWhere(["LIKE", "list_management.code", $id]); if ($name !== "") $dataProvider->query->andWhere(["LIKE", "list_management.name", $name]); if ($type !== "all") diff --git a/controllers/ListManagementController.php b/controllers/ListManagementController.php index f90aef18..e4e04d37 100644 --- a/controllers/ListManagementController.php +++ b/controllers/ListManagementController.php @@ -31,7 +31,7 @@ class ListManagementController extends Controller { ]; } - public function actionIndex($from = "", $to = "", $name = "", $type = "all", $gender = "all") { + public function actionIndex($from = "", $to = "", $name = "", $type = "all", $gender = "all", $id = "") { $f = date_format(date_create_from_format('H:i d/m/Y', "00:00 " . date("d/m/Y")), 'U'); $t = date_format(date_create_from_format('H:i d/m/Y', "23:59 " . date("d/m/Y")), 'U'); $this->view->title = "List management"; @@ -42,6 +42,8 @@ class ListManagementController extends Controller { $t = date_format(date_create_from_format('H:i d/m/Y', $to), 'U'); $dataProvider->query->andWhere(["BETWEEN", "time", $f, $t]); } + if ($id !== "") + $dataProvider->query->andWhere(["LIKE", "code", $id]); if ($name !== "") $dataProvider->query->andWhere(["LIKE", "name", $name]); if ($type !== "all") diff --git a/helpers/ListManagementGrid.php b/helpers/ListManagementGrid.php index 508f9bb3..bfb7d232 100644 --- a/helpers/ListManagementGrid.php +++ b/helpers/ListManagementGrid.php @@ -68,6 +68,12 @@ class ListManagementGrid { }; } + public static function gender($genderArray) { + return function($model) use ($genderArray) { + return $genderArray[$model->gender]; + }; + } + public static function rows() { return function($model, $index, $widget, $grid) { return [ diff --git a/models/CaptureLogs.php b/models/CaptureLogs.php index cd53141d..b36da7cf 100644 --- a/models/CaptureLogs.php +++ b/models/CaptureLogs.php @@ -41,14 +41,14 @@ class CaptureLogs extends \yii\db\ActiveRecord { public function attributeLabels() { return [ 'id' => 'ID', - 'time' => 'Time', - 'image' => 'Live Image', + 'time' => 'Thời gian', + 'image' => 'Hình ảnh', 'status' => 'Status', 'remark' => 'Remark', 'staff_name' => "Name", - 'staff_image' => "Registration Image", - 'confidence' => 'Confidence', - 'sync_status' => 'Sync Status' + 'staff_image' => "Hình ảnh đăng kí", + 'confidence' => 'Độ tin cậy', + 'sync_status' => 'Trạng thái đồng bộ' ]; } diff --git a/models/ListManagement.php b/models/ListManagement.php index 5e3fb1a2..696c507c 100644 --- a/models/ListManagement.php +++ b/models/ListManagement.php @@ -45,14 +45,14 @@ class ListManagement extends \yii\db\ActiveRecord { return [ 'id' => 'ID', 'code' => 'ID', - 'type' => 'Type', - 'name' => 'Name', - 'image' => 'Registration Image', - 'gender' => 'Gender', - 'birthday' => 'Birthday', - 'telephone' => 'Telephone', - 'address' => 'Department', - 'time' => 'Registration time', + 'type' => 'Loại', + 'name' => 'Tên', + 'image' => 'Hình ảnh đăng kí', + 'gender' => 'Giới tính', + 'birthday' => 'Ngày sinh', + 'telephone' => 'Điện thoại', + 'address' => 'Đơn vị', + 'time' => 'Thời gian đăng kí', 'last_modified' => 'Last Modified' ]; } @@ -85,8 +85,8 @@ class ListManagement extends \yii\db\ActiveRecord { "bl" => "Blacklist" ]; public static $genderArray = [ - "Male" => "Male", - "Female" => "Female" + "Male" => "Nam", + "Female" => "Nữ" ]; public static function nameArray() { diff --git a/views/control-logs/index.tpl b/views/control-logs/index.tpl index bcbc0a02..04756ed4 100644 --- a/views/control-logs/index.tpl +++ b/views/control-logs/index.tpl @@ -89,20 +89,24 @@