<div class="row">
    <div class="col-xs-12">
        <div class="box box-danger mb0">
            <div class="row">
                <div class="col-xs-12">
                    <div class="pull-right">
                        <a class="btn btn-danger btn-flat hidden-messages-toggle">
                            <span style="margin-right: 10px;">Tylko ten rok</span>
                            <label class="switch switch-current-year">
                                <input type="checkbox" name="CurrentYear" id="CurrentYear" <?php if(isset($_GET['tylko-ten-rok'])) echo 'checked="checked"'; ?> />
                            </label>
                        </a>
                    </div>
                </div>
            </div>
            <div class="box-body table-responsive table-fixed-height">
                <table id="NieobecnosciTable" class="table hover-rows custom-table FullTable" data-start-sort="1" data-start-sort-direction="desc" data-start-height="50vh" data-start-filter="1">
                    <thead>
                    <tr class="text-uppercase">
                        <th>Nieobecność</th>
                        <th>Od</th>
                        <th>Do</th>
                        <th>Miesiąc</th>
                        <th class="w50px">Dni płatnych</th>
                        <th class="w50px">Dni zatrudnienia</th>
                        <th class="w50px">Godzin płatnych</th>
                        <th class="w50px">Godzin zatrudnienia</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php foreach ($absents['bNieobecnosci']['bNieobecnosc'] as $k => $absent): ?>
                        <tr
                            <?php if (!empty($absent['bInformacjeDodatkowe'])): ?>
                                class="more-info-append" data-append-to="#more-info-container"
                                data-more-info="<?php echo $absent['bInformacjeDodatkowe']; ?>"
                            <?php endif; ?>
                        >
                            <td class="info-addon"><?php echo $absent['bNieobecnoscOpisKodu']; ?></td>
                            <td><span class="span-date"><?php echo $absent['bDataOd']; ?></span></td>
                            <td><span class="span-date"><?php echo $absent['bDataDo']; ?></span></td>
                            <td><span class="span-date"><?php echo date('Y-m', strtotime($absent['bOkres'])); ?></span></td>
                            <td><?php echo $absent['bDniPlatnych']; ?></td>
                            <td><?php echo $absent['bDniZatrudnienia']; ?></td>
                            <td><?php echo $absent['bGodzinPlatnych']; ?></td>
                            <td><?php echo $absent['bGodzinZatrudnienia']; ?></td>
                        </tr>
                    <?php endforeach; ?>
                    </tbody>
                    <?php
                    /*
                    <tfoot>
                    <tr>
                        <th></th>
                        <th></th>
                        <th></th>
                        <th></th>
                        <th></th>
                        <th></th>
                        <th></th>
                        <th></th>
                    </tr>
                    </tfoot>
                     */
                    ?>
                </table>
            </div>
        </div>
    </div>
</div>
<div class="row more-info-container">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h2 class="box-title">Informacje dodatkowe</h2>
            </div>
            <div class="box-body" id="more-info-container">

            </div>
        </div>
    </div>
</div>

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

        initiateDataTable();
    })
</script>

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