<button id="openFilters" style="display: none;" class="ui primary button">Pokaż filtry</button>
<div id="filters" class="ui segment">
    <button id="closeFilters" class="ui right floated primary button">Ukryj filtry</button>
    <h3 class="ui dividing header">
        Filtry
    </h3>
    <form method="post" action="chart.php">
        <div class="ui form">
        <div class="fields">
            <div class="sixteen wide field">
                <label>Magazyny</label>
                <div class="field" id="magazynyLista"><select style="width: 100%;" data-placeholder="Wybierz magazyny" name="sMagazyny[]" id="sMagazyny" multiple class="chosen">
                        <option value="0"></option>
                        {% for magazyn in magazyny %}
                            {% if magazyn.mag_Id != filters.magazynGlowny %}
                                <option  value="{{magazyn.mag_Id}}" {% if magazyn.mag_Id in filters.magazynyIds %} selected {% endif %}>{{magazyn.mag_Nazwa}}</option>
                            {% endif %}
                        {% endfor %}
                    </select>
                </div>
            </div>
        </div>

        <div class="fields">
            <div class="three wide field">
                <label>Cecha</label>
                <select class="ui fluid search dropdown" name="cecha">
                    <option value="0">Wszystkie</option>
                    {% for cecha in cechy %}
                        <option  value="{{cecha.ctw_Id}}" {% if filters.cecha == cecha.ctw_Id %}selected{% endif %}>{{cecha.ctw_Nazwa}}</option>
                    {% endfor %}
                </select>
            </div>
            <div class="three wide field">
                <label>Grupa</label>
                <select class="ui fluid search dropdown" name="grupa">
                    <option value="0">Wszystkie</option>
                    {% for grupa in grupy %}
                        <option  value="{{ grupa.grt_Id }}" {% if filters.grupa == grupa.grt_Id %}selected{% endif %}>{{ grupa.grt_Nazwa }}</option>
                    {% endfor %}
                </select>
            </div>
            <div class="two wide field">
                <label>Od</label>
                <input id="dateFrom" type="text" name="dateFrom">
            </div>
            <div class="two wide field">
                <label>Do</label>
                <input id="dateTo" type="text" name="dateTo">
            </div>
            <div class="six wide field">
                <label>Typy dokumentów</label>
                <div class="field" id="typyDokumentowLista"><select style="width: 100%;" data-placeholder="Wybierz typy dokumentów" name="sTypy[]" id="sTypy" multiple class="chosen">
                        <option value="0"></option>
                        {% for typ in dTypy %}
                            <option value="{{ typ.id }}" {% if typ.id in filters.docTypesIds %} selected {% endif %}>{{ typ.short }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>
        </div>
        <div class="fields">
            <div style="text-align: right; margin-top: 10px;" class="one wide field">
                Pole nazwa
            </div>
            <div class="two wide field">
                <select class="ui fluid search dropdown" name="nameHow">
                        <option  value="1" {% if filters.nameHow == 1 %}selected{% endif %}>zawiera</option>
                        <option  value="2" {% if filters.nameHow == 2 %}selected{% endif %}>rozpoczyna się od</option>
                </select>
            </div>
            <div class="four wide field">
                <input type="text" name="nameText" value="{{ filters.nameText }}">
            </div>

            <div style="text-align: right; margin-top: 10px;" class="one wide field">
                Pole symbol
            </div>
            <div class="two wide field">
                <select class="ui fluid search dropdown" name="symbolHow">
                    <option  value="1" {% if filters.symbolHow == 1 %}selected{% endif %}>zawiera</option>
                    <option  value="2" {% if filters.symbolHow == 2 %}selected{% endif %}>rozpoczyna się od</option>
                </select>
            </div>
            <div class="four wide field">
                <input type="text" name="symbolText" value="{{ filters.symbolText }}">
            </div>
            <div style="text-align: center; margin-top: 10px;" class="two wide field">
                {#<div class="ui checkbox">#}
                    {#<input type="checkbox" name="xlsx" value="1">#}
                    {#<label>generuj .xlsx</label>#}
                {#</div>#}
            </div>
        </div>

        </div>
        <input type="hidden" name="renderTable" value="1"/>
        <button style="margin-top: 10px" type="submit" class="ui primary button">Filtruj</button>
    </form>
</div>
