{% if success is defined %}
    <div class="ui large success message center aligned">
        <i class="close icon"></i>
        <div  class="ui header center aligned">{{ success }}</div>
    </div>
{% endif %}
{% if error is defined %}
    <div class="ui large error message center aligned">
        <i class="close icon"></i>
        <div  class="ui header center aligned">{{ error }}</div>
    </div>
{% endif %}
{% if filters.renderTable == 1 %}
<form class="ui form" method="post" action="print.php?action=generatePrint" target="_blank">
    <button style="margin-bottom: 10px" class="ui primary button" type="submit">Generuj wydruk</button>

    <table class="ui celled table" id="dataTable" >
        <thead>
            <tr>
                <th>Numer zamówienia</th>
                <th>Klient</th>
                <th>Data dodania</th>
                <th>Objętość - <span id="sumVolume">0</span></th>
                <th style="text-align: center; padding-left: 20px;"><div class="ui checkbox">
                        <input type="checkbox" class="changeCh" name="checkAll" id="checkAll" value="1">
                        <label></label>
                    </div></th>
            </tr>
        </thead>
        <tbody>
        {% for order in orders %}
            <tr>
                <td>{{ order.dok_NrPelny }}</td>
                <td>{{ order.kh_Symbol }}</td>
                <td>{{ order.kh_DataDodania | date('Y-m-d') }}</td>
                <td data-id="{{ order.dok_Id }}" class="tdVolume">{{ order.objetosc}}</td>
                <td style="text-align: center;">
                    <div class="ui checkbox">
                        <input id="ch-{{ order.dok_Id }}" class="ordersCh changeCh" type="checkbox" name="orders[]" value="{{ order.dok_Id }}">
                        <label></label>
                    </div>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    <input type="hidden" name="magazine" value="{{ filters.magazine }}"/>
    <input type="hidden" name="client" value="{{ filters.client }}"/>
    <input type="hidden" name="renderTable" value="{{ filters.renderTable }}"/>
    <button style="margin-top: 10px" class="ui primary button" type="submit">Generuj wydruk</button>
</form>
{% endif %}
