app->app_name; }; } public static function getLayout() { return "{items}
{summary}
{pager}
"; } public static function actionTemplate() { return "{update} {delete}"; } public static function time() { return function($model) { return date("H:i:s d/m/Y", $model->time); }; } public static function image($process = false) { return function($model) use ($process) { $btn = ""; if ($process) $btn = Html::button("", [ "class" => "btn btn-info btn-xs", "style" => "position:absolute;top:0;right:0;visibility: hidden;", "data" => [ "toggle" => "tooltip", "href" => Url::to(["/control-logs/use-feature", "id" => $model->id]) ], "title" => "Chuyển làm ảnh mẫu", "onclick" => "_useFeature(this);" ]); return "
" . Html::img("/data/uploads/face/" . $model->image, [ "class" => "img-thumbnail", "style" => "width: 150px;height:150px;" ]) . $btn . "
"; }; } public static function status($statusArray) { return function($model) use ($statusArray) { return $statusArray[$model->status]; }; } public static function confidence() { return function($model) { return number_format($model->confidence, 2); }; } public static function rows() { return function($model, $index, $widget, $grid) { return [ "ondblclick" => "_form(this);", "style" => "cursor: pointer;", "data" => [ "id" => $model->id, "img" => "/data/uploads/face/" . $model->image ] ]; }; } public static function birthday() { return function($model) { $staff = $model->listManagement; if ($staff) return date("d/m/Y", $staff->birthday); return ""; }; } public static function registrationImage() { return function($model) { $staff = $model->listManagement; if ($staff) { $images = json_decode($staff->image, true); if (count($images) > 0) return Html::img("/data/uploads/face/" . $images[count($images) - 1]['url'], [ "class" => "img-thumbnail", "style" => "width: 150px;height:150px;" ]); } return ""; }; } }