Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- #--Helper para formatação de datas por extenso
- $dateHelper = $this->helper('Ysa\Core\Helper\Data');
- #--Informações do locationContent
- $zone_code = $this->getZoneCodeParam();
- //$locContent = $this->getLocationContent($zone_code);
- $rootXml = $this->getBookingRules();
- $initial = $rootXml->RentacarBookingRulesResponse->BookingRulesRS->Results->RentacarResult->RentacarResultsBookingRules;
- //Caracteristicas dos carros
- $acrissItem = $initial->RentacarOptions->RentacarOption['AcrissCode'];
- $acriss = $this->getAcriss($acrissItem);
- //Descricao do plano
- $carContract = $_POST["plano"];
- $contractItems = $this->getCarContractDescription($carContract);
- #--Imagem da locadora
- $imagemLocadora = "images/".$initial->Supplier['Code'].".webp";
- #--Imagem do carro
- $imagemCarro = $_POST["imgCar"];
- $rentacarLocation = $this->getRentacarLocationByCode($_POST['arrival_address']);
- echo "<pre>";
- if(count($rentacarLocation["items"]) > 0){
- var_dump($rentacarLocation["items"][0]);
- echo "<hr>";
- echo "Id: ". $rentacarLocation["items"][0]["id"]."<br>";
- echo "Name: ". $rentacarLocation["items"][0]["name"]."<br>";
- echo "Code: ". $rentacarLocation["items"][0]["code"]."<br>";
- echo "Group: ". $rentacarLocation["items"][0]["group"]."<br>";
- echo "Location type: ". $rentacarLocation["items"][0]["locattion_type"]."<br>";
- echo "Zone code: ". $rentacarLocation["items"][0]["zone_code"]."<br>";
- echo "Zone name: ". $rentacarLocation["items"][0]["zone_name"]."<br>";
- echo "Address: ". $rentacarLocation["items"][0]["address"]."<br>";
- echo "Latitude: ". $rentacarLocation["items"][0]["latitude"]."<br>";
- echo "Longitude: ". $rentacarLocation["items"][0]["longitude"]."<br>";
- echo "Suplier code: ". $rentacarLocation["items"][0]["supplier_code"]."<br>";
- echo "Phone numbers: ". $rentacarLocation["items"][0]["phone_numbers"]."<br>";
- echo "Operation times: ". $rentacarLocation["items"][0]["operation_times"]."<br>";
- }
- die();
- #--Preco nett calculado
- $nett = $initial->RentacarOptions->RentacarOption->PriceInformation->Prices->Price->TotalFixAmounts['Nett'];
- $price = $this->getFinalPrice($nett);
- #--Parametros que foram escolhidos pelo locador
- $params = $this->getRequest()->getParam('parametros');
- $arrival_date = $this->getRequest()->getParam('arrival_date');
- $devolution_date = $this->getRequest()->getParam('devolution_date');
- $arrival_hour = $this->getRequest()->getParam('arrival_hour');
- $devolution_hour = $this->getRequest()->getParam('devolution_hour');
- $arrival_address = $this->getRequest()->getParam('start');
- $devolution_address = $this->getRequest()->getParam('end');
- ?>
- <div class="container size14" xmlns="http://www.w3.org/1999/html">
- <h2>Dados do motorista</h2>
- <div class="row border rounded p-2">
- <div class="col"><i class="icofont-google-map"></i> <?php echo $initial->RentacarLocationDetails->RentacarLocationDetail->Name ?></div>
- <div class="col"><i class="icofont-calendar"></i> <?php echo $dateHelper->dataPorExtenso($arrival_date);?> - <?php echo $dateHelper->dataPorExtenso($devolution_date);?> - <?php echo $block->getDaysQty() ?> Dia(s)</div>
- </div>
- </div>
- <div class="container" xmlns="http://www.w3.org/1999/html">
- <!-- carro item -->
- <div class="row mt-3 border mb-4 rounded size12">
- <div class="col-12 bg-info text-white size14 py-1 mb-2"><i class="icofont-car-alt-1 icofont-md"></i>
- <span class="bold"><?php echo $acriss['type']. " " . $acriss['class'] ?> - </span>
- <span class="bold"><?php echo $initial->RentacarInfo->Name ?></span> (ou semelhante)
- </div>
- <div class="col-2 col-md-2 col-lg-1">
- <div class="d-flex h-100">
- <img src="<?php echo $block->getViewFileUrl("$imagemLocadora") ;?>" class="img-fluid justify-content-center align-self-center" width="64" height="32" alt="<?php echo $initial->Supplier['Code']?>">
- </div>
- </div>
- <div class="col-8 col-md-4 col-lg-2 text-center text-md-left">
- <img src="<?php echo $imagemCarro ?>" class="img-fluid" alt="Carro">
- </div>
- <div class="col-md-4 col-lg-3 mb-2">
- <div><i class="icofont-wind icofont-lg"></i> <?php echo $acriss['air']?></div>
- <div><i class="icofont-automation icofont-lg"></i> <?php echo $acriss['transmission']?></div>
- <div><i class="icofont-users-social icofont-lg"></i> <?php echo $acriss['passageiros'] ?> Passageiros <i class="icofont-travelling icofont-lg"></i> <?php echo $acriss['bagagens'] ?> Bagagens</div>
- </div>
- <!-- descrição dos Planos -->
- <div class="col-12 col-lg-4 mb-2 size12">
- <div class="bold"><i class="icofont-law-document"></i> Plano <?php echo $carContract.":"?></div>
- <?php foreach ($contractItems as $contractItem) : ?>
- <div class="size11">
- <i class="icofont-checked text-success"></i> <?php echo $contractItem ;?>
- </div>
- <?php endforeach; ?>
- </div>
- <!-- descrição dos Planos fim -->
- </div>
- <!-- carro item fim-->
- </div>
- <form class="w-100" method="POST" target="_blank" enctype="multipart/form-data" action="<?php echo $this->getUrl('api/api/bookingfinal') ;?>" name="plateform">
- <div class="container">
- <div class="row">
- <div class="col-12 col-md-6">
- <div class="col-12 p-2 text-white bg-primary rounded bold text-center mb-2">DADOS DO MOTORISTA</div>
- <div class="form-row">
- <div class="form-group col-6">
- <label class="size12">Nome:</label>
- <input type="text" name="first_name_driver" required placeholder="Nome" class="form-control">
- </div>
- <div class="form-group col-6">
- <label class="size12">Sobrenome:</label>
- <input type="text" name="last_name_driver" required placeholder="Sobrenome" class="form-control">
- </div>
- </div>
- <div class="form-row my-2">
- <div class="form-group col-12 col-md-6">
- <label class="size12">Telefone:</label>
- <input type="text" name="telefone" class="form-control" placeholder="Telefone com DDD">
- </div>
- <div class="form-group col-12 col-md-6">
- <label class="size12">Data de nascimento do motorista:</label>
- <input type="text" name="dob" class="form-control size14" id="nascimentoMotorista" placeholder="dd/mm/aaaa" autocomplete="off" required style="height: 32px">
- <input type="hidden" id="nascimentoMotoristaHidden" name="nascimentoMotorista" required autocomplete="off">
- </div>
- </div>
- <div class="form-row my-2">
- <div class="form-group col-12 col-md-6">
- <label class="size12">Documento de identificação:</label>
- <select name="tipoDocMotorista">
- <optgroup label="Escolha o documento">
- <option value="CPF">CPF</option>
- <option value="Passaporte">Passaporte</option>
- <option value="Identidade">Identidade</option>
- </optgroup>
- </select>
- </div>
- <div class="form-group col-6">
- <label class="size12">Número do Documento</label>
- <input type="text" name="docMotorista" class="form-control" placeholder="Digite o número do documento" required >
- </div>
- </div>
- <div class="form-row my-2">
- <div class="form-group col-12 col-md-6">
- <label class="size12">Email:</label>
- <input type="email" name="email" class="form-control" placeholder="Email do motorista" required >
- </div>
- <div class="form-group col-12 col-md-6">
- <label class="size12">País:</label>
- <input type="text" name="pais" class="form-control size14" id="nascimentoMotorista" placeholder="País" autocomplete="off" required >
- </div>
- </div>
- <div class="form-row my-2">
- <div class="form-group col-12">
- <label class="size12">Cidade:</label>
- <input type="text" name="city" class="form-control" placeholder="Cidade" required >
- </div>
- <div class="form-group col-12 col-md-6">
- <label class="size12">Cep:</label>
- <input type="text" name="cep" class="form-control mt-lg-1" placeholder="00000-000" required >
- </div>
- <div class="form-group col-6 col-md-6 mt-lg-5">
- <input type="hidden" name="planCode" value="<?php echo $initial->RentacarOptions->RentacarOption->BookingCode[0] ?>">
- <button type="submit" class="btn btn-block btn-success size16">
- RESERVAR
- </button>
- </div>
- </div>
- </div>
- <div class="col-12 col-md-6">
- <!-- Valores -->
- <div class="text-center">
- Preço por dia:<br>
- <span class="salmao size12">R$ </span>
- <span class="salmao size18 bold"><?php echo $block->setPricePerDay($nett);?></span>
- </div>
- <div class="text-center size11">
- <span>Preço por <?php echo $block->getDaysQty();?> dia(s)</span>
- <span class="azul">R$ </span>
- <span class="bold azul"><?php echo $price;?></span>
- </div>
- <!-- Valores fim-->
- </div>
- </div>
- <hr>
- </div>
- </form>
- <div class="container mt-3">
- <!-- Local de entrega e retirada-->
- <div class="row size12">
- <div class="col-12 col-lg-6 my-1 pl-md-0">
- <div class="border rounded p-2">
- <div class="size12 text-capitalize"><i class="icofont-map icofont-lg"></i><b>Local da Retirada:</b> <?php echo $initial->RentacarLocationDetails->RentacarLocationDetail->Address ?></div>
- <div><i class="icofont-calendar icofont-lg"></i> <b>Data:</b> <?=$dateHelper->dataPorExtenso($arrival_date)?> - <?=$arrival_hour?></div>
- </div>
- </div>
- <div class="col-12 col-lg-6 my-1 pr-md-0">
- <div class="border rounded p-2">
- <div><i class="icofont-map icofont-lg"></i> <b>Local da Entrega:</b> <span class=" text-primary">Escritório Dollar de Orlando</span></div>
- <div><i class="icofont-calendar icofont-lg"></i> <b>Data:</b> <?=$dateHelper->dataPorExtenso($devolution_date)?> - <?=$devolution_hour?></div>
- </div>
- </div>
- </div>
- <!-- Local de entrega e retirada Fim-->
- </div>
- <script type="text/javascript">
- //muda a imagem do carro.
- require(['jquery'], function($) {
- $(".product-image-photo").attr('src', '<?php echo $imagemCarro ;?>');
- });
- // $("#datepicker").datepicker({
- // dateFormat: 'dd.mm.yy',
- // changeMonth: true,
- // changeYear: true,
- // yearRange: 'c-99:c-18'
- // });
- </script>
- <!--datepicker retirada / devolucao-->
- <script type="text/javascript">
- require(['jquery', 'jquery-ui', 'mage/mage'], function ($){
- $(document).ready(function(){
- $.datepicker.setDefaults($.datepicker.regional['pt-BR']);
- $.datepicker.setDefaults({
- altFormat: "yy-mm-dd",
- monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
- monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
- dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sabado'],
- dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
- dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
- dateFormat: 'dd/mm/yy',
- });
- //nascimento Motorista
- $("#nascimentoMotorista").datepicker({
- altField: "#nascimentoMotoristaHidden",
- isRTL: false,
- showMonthAfterYear: false,
- minDate: new Date(1900,1-1,1),
- maxDate: '-18Y',
- defaultDate: new Date(2000,1-1,1),
- changeYear:true,
- yearRange: "-100:-18"
- });
- });
- });
- </script>
- <!--datepicker retirada / devolucao fim-->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement