<?php global $gdb;?>
<div class="block-header">
  <h2>Lista <strong>tematów ogólnych </strong></h2>
</div>
<?php
$grid = new \grid( 'zaplecze_tematy_zbiorcze' );
$grid -> debug = true;
$grid -> gdb_opt = $gdb;
$grid -> order = [ 'column' => 'przetworzony', 'type' => 'ASC' ];
$grid -> columns_view = [
    [
      'name' => 'Lp.',
      'th' => [ 'class' => 'g-lp', 'style' => 'width: 75px' ],
      'td' => [ 'class' => 'g-center' ],
      'autoincrement' => true
    ], [
      'name' => 'Strona',
      'db'   => 'strona'
    ], [
      'name' => 'Kategoria',
      'db' => 'kategoria',
    ], [
      'name' => 'Kategoria ID',
      'db' => 'kategoria_id',
    ], [
      'name' => 'Temat',
      'db' => 'temat_ogolny',
    ], [
      'name' => 'Data przetworzenia',
      'db' => 'data_przetworzenia',
    ], [
      'name' => 'Przetworzony',
      'db' => 'przetworzony',
      'php' => 'echo ( (int)[przetworzony] == 1 ) ? "tak" : "nie";',
    ], [
        'name'   => 'Edytuj',
        'action' => [ 'type' => 'edit', 'url' => '/backend_sites/collective_topic_edit/id=[id]' ],
        'th'     => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
        'td'     => [ 'class' => 'g-center' ]
    ], [
        'name'   => 'Usuń',
        'action' => [ 'type' => 'delete', 'url' => '/backend_sites/collective_topic_delete/id=[id]' ],
        'th'     => [ 'class' => 'g-center', 'style' => 'width: 70px;' ],
        'td'     => [ 'class' => 'g-center' ]
    ]
];
$grid -> buttons = [
  [
    'label' => 'Dodaj temat ogólny',
    'url'   => '/backend_sites/collective_topic_edit/',
    'icon'  => 'fa-plus-circle',
    'class' => 'btn-success'
  ]
];
$grid -> hide_columns = false;
$grid -> limit = 25;
echo $grid -> draw();
?>
