<?=$this->extend("layout/index");?>
<?=$this->section('content');?>

<div class="content-wrapper" style="min-height: 357.039px;">
    <section class="content">
        <div class="card card-info card-outline">
            <div class="card-header">
                <h3 class="card-title text-bold"><?=lang("Administration.group_title")?></h3>
            </div>
            <div class="card-body">
                <?php
                    
                    if(!empty(session()->getFlashdata('message'))){
                        echo session()->getFlashdata('message');
                    }
                                    
                    use CodeIgniter\View\Table;
                    use Modules\Administration\Libraries\Groupe;

                    $table = new Table();

                    $template = [
                        'table_open' => '<table class="table table-bordered" id="myList">',
                    ];                    
                    $table->setTemplate($template);
                    $table->setHeading("#",lang("Administration.group_perm"), lang("Administration.group_descr"));                 
                    if ($groupes) {
                        foreach (Groupe::tableRows($groupes) as $data) {
                            $table->addRow($data);
                        }
                    }
                    echo $table->generate();
                ?>
            </div>
        </div>
    </section>
</div>


<?=$this->endSection();?>