<div class="col-xs-12">
    <input type="text" class="form-control modal-filter" id="receivers-filter" placeholder="Filtruj"/>
    <div class="row" id="addresses-list">
        <?php if (empty($addresses)): ?>
            <h2 style="margin-bottom: 40px;">Brak pracowników</h2>
        <?php else: ?>
            <div class="col-xs-12 checkboxes-right blue-text">
                <div class="row">
                    <div class="col-sm-6">
                        <label class="pull-left hover-pointer" for="AllAdrress">
                            Wszystkie
                        </label>
                    </div>
                    <div class="col-sm-1">Numer</div>
                    <div class="col-sm-2">Komórka</div>
                    <div class="col-sm-2">Stanowisko</div>
                    <div class="col-sm-1">
                        <input type="checkbox" class="pull-right" id="AllAdrress" />
                    </div>
                </div>
            </div>
            <?php if (isset($addresses['bNazwisko'])) { $address = $addresses; $addresses = []; $addresses[] = $address; } ?>
            <?php foreach ($addresses as $key => $address): ?>
                <div class="col-xs-12 checkboxes-right row_daj_adresy">
                    <div class="row">
                        <div class="col-sm-6">
                            <label class="pull-left hover-pointer" for="<?php echo $address['bGid']; ?>">
                                <?php
                                echo $address['bNazwaWyswietlana'];
                                //echo $address['bNazwa']. (!empty($address['bEmail']) ? ('('.$address['bEmail'].')') : '');
                                ?>
                            </label>
                        </div>
                        <div class="col-sm-1">
                            <?php echo (isset($address['bNrewid']) && !empty($address['bNrewid'])) ? $address['bNrewid'] : ''; ?>
                        </div>
                        <div class="col-sm-2">
                            <?php echo (isset($address['bKomorka']) && !empty($address['bKomorka'])) ? $address['bKomorka'] : ''; ?>
                        </div>
                        <div class="col-sm-2">
                            <?php echo (isset($address['bStanowisko']) && !empty($address['bStanowisko'])) ? $address['bStanowisko'] : ''; ?>
                        </div>
                        <div class="col-sm-1 text-right">
                            <input type="checkbox" class="pull-right" id="<?php echo $address['bGid']; ?>" data-imie="<?php echo $address['bImie']; ?>" data-nazwisko="<?php echo $address['bNazwisko']; ?>" data-name="<?php echo $address['bNazwa']; ?>" data-email="<?php echo $address['bEmail']; ?>" data-display-name="<?php echo $address['bNazwaWyswietlana']; ?>"/>
                        </div>
                    </div>
                </div>
            <?php endforeach; ?>
        <?php endif; ?>
    </div>
</div>
<div class="loader-holder loader-overlapping" id="receivers-list-loader">
    <div class="loader"></div>
</div>

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