Dodanie nowej strony admina co pozwala dodawać pane kontaktowe

This commit is contained in:
Roman Pyrih
2026-01-27 15:34:07 +01:00
parent ff58ac80ef
commit 92248df9d1
11 changed files with 692 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
<?php
global $gdb;
$grid = new \grid('pp_contacts_maps');
$grid->gdb_opt = $gdb;
$grid->columns_view = [
[
'name' => 'Lp.',
'autoincrement' => true
],
[
'name' => 'Salon',
'db' => 'salon_name',
'php' => 'echo "<a href=\"/admin/contacts_maps/edit/id=[id]\">[salon_name]</a>";'
],
[
'name' => 'Miasto',
'db' => 'city'
],
[
'name' => 'Typ',
'db' => 'salon_type',
'php' => 'echo ([salon_type] === "sales" ? "SALON SPRZEDAŻY" : ([salon_type] === "partner" ? "SALON PARTNERSKI" : ""));'
],
[
'name' => 'Aktywny',
'db' => 'is_active',
'php' => 'echo ([is_active] ? "TAK" : "NIE");'
],
[
'name' => 'Usuń',
'action' => [ 'type' => 'delete', 'url' => '/admin/contacts_maps/delete/id=[id]' ]
]
];
$grid->buttons = [
[
'label' => 'Dodaj salon',
'url' => '/admin/contacts_maps/edit/',
'class' => 'btn-success'
]
];
echo $grid->draw();