server test version

This commit is contained in:
2025-01-03 02:11:09 +03:00
parent 093b04c2c9
commit 74efe9e01e
101 changed files with 2871 additions and 117 deletions

View File

@ -32,6 +32,16 @@ $form->field(class: \itguild\forms\inputs\TextInput::class, name: "email", param
->setLabel("Email")
->render();
if (!empty($model->user_photo)){
echo "<div><img src='$model->user_photo' width='200px'></div>";
}
$form->field(class: \itguild\forms\inputs\File::class, name: "user_photo", params: [
'class' => "form-control",
'value' => $model->user_photo ?? ''
])
->setLabel("Фото профиля")
->render();
$entityRelations = new \kernel\EntityRelation();
if (!isset($model)) {
$model = new User();

View File

@ -17,13 +17,15 @@ use kernel\widgets\IconBtn\IconBtnDeleteWidget;
use kernel\widgets\IconBtn\IconBtnEditWidget;
use kernel\widgets\IconBtn\IconBtnViewWidget;
$get = (new \kernel\Request())->get();
$table = new ListEloquentTable(new EloquentDataProvider(User::class, [
'currentPage' => $page_number,
'perPage' => 3,
'params' => ["class" => "table table-bordered", "border" => "2"],
'baseUrl' => "/admin/user",
'filters' => ['email'],
]));
'searchPrefix' => "",
'searchParams' => $get,]));
$entityRelation = new \kernel\EntityRelation();
$additionals = $entityRelation->getEntityRelationsBySlug("user");
@ -37,9 +39,13 @@ foreach ($additionals as $additional) {
$table->columns([
'username' => [
"filter" => [
'class' => \Itguild\Tables\Filter\InputTextFilter::class
'class' => \kernel\filters\BootstrapTextFilter::class,
'value' => $get['username'] ?? null,
]
],
'user_photo' => function ($data) {
return $data ? "<img src='$data' width='150px'>" : "";
},
'created_at' => function ($data) {
if (!$data){
return null;

View File

@ -35,6 +35,9 @@ foreach ($additionals as $key => $additional) {
}
$table->rows([
'user_photo' => function ($data) {
return $data ? "<img src='$data' width='300px'>" : "";
},
'created_at' => function ($data) {
if (!$data){
return null;