84 lines
2.2 KiB
PHP
84 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace app\helpers;
|
|
|
|
use Yii;
|
|
use yii\helpers\Html;
|
|
use yii\helpers\Url;
|
|
|
|
class CaptureLogsGrid {
|
|
|
|
static $path = "";
|
|
|
|
public static function path() {
|
|
return self::$path;
|
|
}
|
|
|
|
public static function engineNameFunc() {
|
|
return function ($data) {
|
|
return $data->app->app_name;
|
|
};
|
|
}
|
|
|
|
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>";
|
|
}
|
|
|
|
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() {
|
|
return function($model) {
|
|
return Html::img("/data/uploads/face/" . $model->image, [
|
|
"class" => "img-thumbnail",
|
|
"style" => "width: 150px;height:150px;"
|
|
]);
|
|
};
|
|
}
|
|
|
|
public static function status($statusArray) {
|
|
return function($model) use ($statusArray) {
|
|
return $statusArray[$model->status];
|
|
};
|
|
}
|
|
|
|
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;
|
|
return date("d/m/Y", $staff->birthday);
|
|
};
|
|
}
|
|
|
|
public static function registrationImage() {
|
|
return function($model) {
|
|
$staff = $model->listManagement;
|
|
$images = json_decode($staff->image, true);
|
|
return Html::img("/data/uploads/face/" . $images[0]['url'], [
|
|
"class" => "img-thumbnail",
|
|
"style" => "width: 150px;height:150px;"
|
|
]);
|
|
};
|
|
}
|
|
|
|
}
|