<?php
global $gdb;

$grid = new \grid( 'pp_newsletter' );
$grid -> gdb_opt      = $gdb;
$grid -> order        = [ 'column' => 'email', 'type' => 'ASC' ];
$grid -> search       = [
                            [ 'name' => 'Email', 'db' => 'email', 'type' => 'text' ]
                        ];
$grid -> columns_view = [
                          [ 
                            'name' => 'Lp.',
                            'th' => [ 'class' => 'g-lp' ],
                            'td' => [ 'class' => 'g-center' ],
                            'autoincrement' => true 
                          ],
                          [
                            'name'  => 'Email',
                            'db'    => 'email',
                            'sort'  => true
                          ],
                          [
                            'name'  => 'Potwierdzony',
                            'db'    => 'status',
                            'sort'  => true,
                            'replace' => [ 'array' => [ 0 => '<span style="color: #FF0000;">nie</span>', 1 => 'tak' ] ]
                          ]
                        ];
$grid -> actions      = [ 'delete' => true ];     
echo $grid -> draw();