<div data-action="daj_profil" data-active="1"></div>
<div class="row">
    <div class="col-xs-12">
        <div class="box box-primary">
            <div class="box-body table-responsive <?php /*table-fixed-height table-fixed-height-30*/?>">
                <table id="PracownicyTable" class="table hover-rows custom-table" data-start-sort="1" data-start-sort-direction="asc" data-start-height="30vh">
                    <thead>
                    <tr class="text-uppercase">
                        <th width="1%">Numer</th>
                        <th>Nazwisko i imię</th>
                        <th>Pesel</th>
                        <th>Komórka</th>
                        <th>Stanowisko</th>
                        <th>Pion</th>
                        <th>Data przyjęcia</th>
                        <th>Data zwolnienia</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php foreach($employees['bPracownicy']['bPracownik'] as $k => $employee) : ?>
                        <tr class="clickable-row" data-key="<?php echo $employee['bGid']; ?>,<?php echo $employee['bNumerEwidencyjny']; ?>">
                            <td class="info-addon"><?php echo $employee['bNumerEwidencyjny']; ?></td>
                            <td><?php echo $employee['bNazwiskoImie']; ?></td>
                            <td><?php echo $this->App->notEmpty($employee['bPesel']); ?></td>
                            <td><?php echo !empty($employee['bKomorka']) ? $employee['bKomorka'] : ''; ?></td>
                            <td><?php echo !empty($employee['bStanowisko']) ? $employee['bStanowisko'] : ''; ?></td>
                            <td><?php echo !empty($employee['bPion']) ? $employee['bPion'] : ''; ?></td>
                            <td><span class="span-date"><?php echo !empty($employee['bDataPrzyjecia']) ? $employee['bDataPrzyjecia'] : ''; ?></span></td>
                            <td><span class="span-date"><?php echo !empty($employee['bDataZwolnienia']) ? date('Y-m-d', strtotime($employee['bDataZwolnienia'])) : ''; ?></span></td>
                        </tr>
                    <?php endforeach; ?>
                    </tbody>
                </table>
            </div
        </div>
        <div data-container="table">
            <div class="no-data">
                <p>Wybierz pracownika</p>
            </div>
        </div>
        <?php echo $this->Element('table_loading'); ?>
    </div>
</div>

<script>
    $(function () {
        $('.page-name:first-of-type').html('<?php echo $pageName; ?>');
    })
</script>

<script>
    $(document).ready(function () {
        setTimeout(function () {
            $('.clickable-row').eq(0).find('td').eq(0).trigger('click');
        });
    });
</script>

<?php echo $this->element('alert_close'); ?>
