<div class="filter-button-line">
    <?php if(count((array)$settings["saved_filters"]) == 0): ?>
        <div>
            <span> Nebyly nalezeny žádné uložené filtry.</span>
        </div>
    <?php else: ?>
        <?php foreach ($settings["saved_filters"] as $key => $value): ?>
            <a class="btn btn-lg <?php if($settings["current_filter"] == $key) echo "btn-dark"; else echo "btn-default"; ?>"href="javascript:void(0)" data-href="<?=base_url("package/list/eshop_id/" . $this->uri["eshop_id"]."/set_filter/".$key)?>"><?=$value["name"]?></a>
        <?php endforeach; ?>
    <?php endif; ?>
    <hr>
</div>
<form method="post" id="package-filter-form">
    <div class="filter-show-more">
        <a class="show-more" href="javascript:void(0)" onclick="show_filter()">Zobrazit filtr <i class="fa fa-caret-down" aria-hidden="true"></i></a>
        <a class="show-less show-hidden" href="javascript:void(0)" onclick="hide_filter()">Skrýt filtr <i class="fa fa-caret-up" aria-hidden="true"></i></a>
    </div>

    <div class="filter-main filter-hidden">
        <hr>
        <div class="filter-item-table col-md-10">
       
            <table class="table">
                <thead>
                    <tr>
                        <th>Stavy objednávek</th>
                        <th>Doprava</th>
                    </tr>
                </thead>
                <tbody>
                <tr>
                    <td><?=form_multiselect('order_status_id[]',$eshop_translate["statuses"],(isset($package_filter))?$package_filter["order_status_id"]:[], 'class="form-control select2-notags" aria-describedby="label-status-from"')?></td>
                    <td><?=form_multiselect('shipping_guid[]',$eshop_translate["shippings_dropdown"],(isset($package_filter))?$package_filter["shipping_guid"]:[], 'class="form-control select2-notags" aria-describedby="label-status-from"')?></td>
                </tr>
                </tbody>
            </table>
            <table class="table">
                <thead>
                <tr>
                    <th>Platba</th>
                    <th>Zaplaceno</th>

                </tr>
                </thead>
                <tbody>
                <tr>
                    <td><?=form_multiselect('billing_guid[]',$eshop_translate["payments_dropdown"],(isset($package_filter))?$package_filter["billing_guid"]:[], 'class="form-control select2-notags" aria-describedby="label-status-from"')?></td>
                    <td><?=form_multiselect('order_paid[]',["1" => "Zaplaceno","0" => "Nezaplaceno","none" => "Nevyplněno"],(isset($package_filter))?$package_filter["order_paid"]:[], 'class="form-control select2-notags" aria-describedby="label-status-from"')?></td>

                </tr>
                </tbody>
            </table>
            
        </div>
        <input type="hidden" name="package-filter-form" value="1">
        <div class="col-md-2 package-filter-button">
            <button type="button"  onclick="set_filter();" class="btn btn-lg btn-success">FILTROVAT</button>
            <?=anchor('package/list/eshop_id/'.$this->uri['eshop_id']."/unset_filters/1",'Zrušit filtry' , 'class="btn btn-xs btn-danger"')?>
            <hr>
            <?php if(isset($settings["current_filter"])): ?>
                <input type="text" name="filter_save[filter_name]" placeholder="Název filtru" class="form-control" maxlength="20" value="<?=$settings["saved_filters"][$settings["current_filter"]]["name"]?>">
                <input type="hidden" name="filter_save[filter_id]" value="<?=$settings["current_filter"]?>">
                <button type="button" onclick="set_filter(true)" class="btn btn-info btn-xs" name="save_filter" value="1">Upravit filtr</button>
                <button type="button" onclick="set_filter(true, '<?=$settings["current_filter"]?>')" class="btn btn-danger btn-xs" name="delete_filter" value="1">Odstranit filtr</button>
            <?php else: ?>   
                <input type="text" name="filter_save[filter_name]" placeholder="Název filtru" class="form-control" maxlength="20">
                <button type="button" onclick="set_filter(true)" class="btn btn-info btn-xs" name="save_filter" value="1">Uložit filtr</button>
            <?php endif; ?>
            

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