<div class="content">
    <div class="steps">
        <ul>
            <li>
                <div class="ellipse"></div>
                <div class="number">Krok 1</div>
                <div class="name">Fracht morski</div>
            </li>
            <li>
                <div class="ellipse"></div>
                <div class="number">Krok 2</div>
                <div class="name">Opcje transportowe</div>
            </li>
            <li class="done">
                <div class="ellipse"></div>
                <div class="number">Krok 3</div>
                <div class="name">Zapytanie ofertowe</div>
            </li>
        </ul>
    </div>


    {% set loadingUnloadingNames = application.connection.loading.name ~ '-' ~ application.connection.unloading.name %}
    {% set transportCost = settings.documentary + application.customs %}

    {% if application.loading.country == 'Polska' %}
        {% set transportCost = transportCost + application.warehouse|round(0, 'floor') %}
    {% else %}
        {% set transportCost = transportCost + application.thc|round(0, 'floor') + application.isps|round(0, 'floor')  %}
    {% endif %}

    {{ form_start(form, { action: '//success-url//', attr: { 'data-step': 2 } }) }}
        {# HIDDEN #}
        {{ form_row(form.loading) }}
        {{ form_row(form.unloading) }}
        {{ form_row(form.volume) }}
        {{ form_row(form.weight) }}
        {{ form_row(form.customs) }}

        {{ form_row(form.transport) }}
        {{ form_row(form.city) }}
        {{ form_row(form.postalCode) }}

        {{ form_row(form.firstDimension) }}
        {{ form_row(form.secondDimension) }}
        {{ form_row(form.thirdDimension) }}
        {{ form_row(form.quantity) }}
        {{ form_row(form.quantityType) }}
        {# END HIDDEN #}

        <div class="checkboxes">
            <div class="form-group">
                <div class="checkbox">
                    <div class="check"><input type="checkbox" checked="checked" disabled="true"></div>
                    <label>Fracht morski<a href="javascript:" data-hint-name="fret">?</a> <span>({{ loadingUnloadingNames }}, {{ application.connectionCost|round(0, 'floor') }} USD)</span></label>
                </div>
            </div>
            <div class="form-group">
                <div class="checkbox">
                    <div class="check"><input type="checkbox" checked="checked" disabled="true"></div>
                    <label>Opcje transportowe<a href="javascript:" data-hint-name="transport-options">?</a> <span>({{ loadingUnloadingNames }}, {{ transportCost }} {% if application.connection.useeuro == true %}EUR{% else %}USD{% endif %})</span></label>
                </div>
            </div>
            <div class="form-group">
                <div class="checkbox">
                    <div class="check"><input type="checkbox" checked="checked" disabled="true"></div>
                    <label>ZAPYTANIE OFERTOWE<a href="javascript:" data-hint-name="confirmation">?</a></label>
                </div>
            </div>
        </div>

        <div class="voucher">
            <div class="form-group">
                <label>Kod rabatowy<a href="javascript:" data-hint-name="voucher">?</a></label>
                {{ form_widget(form.voucher) }}
                <button class="check-voucher button pink" type="button">Przelicz</button>
                <div class="tick"></div>
            </div>
        </div>

        <div class="summation"
             data-connection-cost="{{ application.connectionCost|round(0, 'floor') }}"
             data-transport-cost="{{ transportCost }}"
             data-exchange-rate="{{ application.exchangeRate }}"
        >
            <div class="list">
                <div class="grey">
                    <ul>
                        <li>
                            <span class="name">Fracht morski</span>
                            <span class="cost">{{ application.connectionCost|round(0, 'floor') }} USD</span>
                        </li>
                        <li class="discount">
                            <span class="name">Rabat</span>
                            <span class="cost">- <span class="amount"></span> USD</span>
                        </li>
                        <li>
                            <span class="name">Opcje transportowe</span>
                            <span class="cost">{{ transportCost }} {% if application.connection.useeuro == true %}EUR{% else %}USD{% endif %}</span>
                        </li>
                    </ul>
                </div>
                <ul class="sum">
                  {% if application.connection.useeuro == true %}
                  <li>
                      <span class="name">&nbsp;</span>
                      <span class="cost"><span class="amount">{{ transportCost|round(0, 'floor') }}</span> EUR </span>
                  </li>
                  {% endif %}
                    <li>
                        <span class="name">Suma</span>
                        <span class="cost"><span class="amount">{% if application.connection.useeuro == true %}{{ application.connectionCost|round(0, 'floor') }}{% else %}{{ application.cost|round(0, 'floor') }}{% endif %}</span> USD <span class="conversion">ok. <span class="amount">{{ (application.connectionCost * application.exchangeRate)|round(0, 'floor')+(transportCost * application.exchangeRateeuro)|round(0, 'floor') }}</span> zł</span></span>
                    </li>
                </ul>
            </div>
            <div class="info">
                Koszt podjęcia towaru z magazynu oraz transportu drogowego zostanie podany przez konsultanta
            </div>
        </div>

        <div class="personal">
            <div class="label">WYŚLIJ ZAPYTANIE OFERTOWE</div>

            <div class="form-group {% if not form.fullName.vars.valid %}error{% endif %}">
                <label>Imię i nazwisko</label>
                {{ form_widget(form.fullName) }}
            </div>
            <div class="form-group {% if not form.company.vars.valid %}error{% endif %}">
                <label>Nazwa firmy</label>
                {{ form_widget(form.company) }}
            </div>
            <div class="form-group {% if not form.phone.vars.valid %}error{% endif %}">
                <label>Nr telefonu</label>
                {{ form_widget(form.phone) }}
                <span class="info">(wpisz, jeśli chciałbyś abyśmy do Ciebie zadzwonili)</span>
            </div>
            <div class="form-group {% if not form.email.vars.valid %}error{% endif %}">
                <label>Email</label>
                {{ form_widget(form.email) }}
            </div>
            <div class="form-group rules {% if not form.rules.vars.valid %}error{% endif %}">
                <div class="checkbox">
                    <div class="check">{{ form_widget(form.rules, { required: false }) }}</div>
                    <label>Akceptuję <a href="//rules-url//" target="_blank">regulamin</a></label>
                </div>
            </div>
        </div>

        <div class="buttons form-group">
            <a href="javascript:" onclick="window.history.back();" class="back button blue"><div class="arrow-left"></div>Wstecz</a>
            <button class="send button pink submit" type="submit">
                <span class="move">Wyślij</span>
            </button>
            <div class="clear"></div>
        </div>
    {{ form_end(form) }}

    <script>
        var voucherCheckUrl = '{{ url('app.order.voucher_check') }}';
        var symfonyCalculatorThirdUrl = '{{ url('app.order.third') }}';
    </script>
</div>
