@extends('layouts.cartMaster') @section('getStarted') @if($comp->specialrequests != null) var sr = "{{ $comp->specialrequests }}"; var arr = sr.split("|"); if(arr.length > 0) { var nbr = 0; $('[name="specialRequests"]').each(function(i, obj) { if(i.toString() == arr[nbr]) { $(obj).prop('checked', true); nbr += 1; } }); } @endif $( document ).ready(function() { @if($comp->isTripStack() && $comp->status == "QT") $("#warning-btn").trigger('click'); @endif @if($err !== null && $err != "priceChanged") $('html, body').animate({ scrollTop: $("#editFormPrice").offset().top - 110 }); @endif $( ".paxselector" ).each(function( index ) { changepax('row'+index); }); var textArray = []; var valueArray = []; $('.paxselector').each(function(i, obj) { textArray.push($("#"+$(this).attr('id')+" option:selected").text()); valueArray.push($("#"+$(this).attr('id')+" option:selected").val()); }); $('.paxselector').each(function(i, obj) { var theId = $(this).attr('id'); $("#"+theId+" option").each(function() { var valide = false; for(var i = 0; i < textArray.length; i++) { if(valueArray[i] == $(this).val()) { if($(this).val() != 0 ) { valide = true; } } } if(valide) { $("#"+theId+" option[value="+$(this).val()+"]").attr('disabled','disabled'); } }); }); @if(Account::getAccount()->code == 'JAL') $("input[name='paxid[]']").each(function() { populateCountries('new_passport_country_'+$(this).val()); }); @endif }); /* $("#hotelbtn").click(function(){ x=$("form").serializeArray(); submitHotel(x); }); */ $("#hotelbtn").click(function(){ @if($comp->connector == 'webrates') var cnt = 0; var txt = ''//$('[name="remark_for_hotel"]').val(); $('[name="specialRequests"]').each(function(i, obj) { if($(obj).is(':checked')) { if(cnt >0) txt += '|'; txt += $(obj).val(); cnt += 1; } }); if(cnt > 4) { alert('{{ Lang::get('booking.maxChoiceRequest') }}'); } else { $('[name="remark_for_hotel"]').val(txt); x=$("form").serializeArray(); submitHotel(x); } @else x=$("form").serializeArray(); submitHotel(x); @endif }); mailCtrl = createMailFormCtrl('mailDiv', 0, {{ $comp->id }}, {{ Auth::id() }}, 'FLT', '{{ $comp->title }}', @if($comp->paxOk()) '{{ $comp->occupanciespaxs[0]->name->firstname.' '.$comp->occupanciespaxs[0]->name->lastname }}' @else '' @endif, @if($comp->paxOk()) '{{ $comp->occupanciespaxs[0]->name->email }}' @else '' @endif, "{{ URL::to('/bookings/pdf/sendpdf') }}"); mailCtrl.setUp(); @stop @section('myscript') var nlist = []; nlist.push(['0','','','','','','']); @foreach($comp->booking->names as $n) nlist.push(["{{ $n->id }}","{{ $n->title }}","{{ $n->firstname }}","{{ $n->lastname }}","{{ $y }}","{{ $m }}","{{ $d }}"]); @endforeach var previousText = ""; var previousValue = ""; var gtComp = {{$comp->grand_total}}; @if($comp->currency_code) var currency_roe = {{$comp->currency_roe}}; @else var currency_roe = 1; @endif function changepax(ctrl , id ) { var textValue = $("#"+id+" option:selected").text(); var optValue = $("#"+id+" option:selected").val(); if(!Number.isInteger(parseInt(optValue))) { $("#"+optValue).show(); } var x = parseInt($('#'+ctrl).find('.paxselector').val()); if(Number.isInteger(x)) { if(x >= nlist.length) x = 0; $('#'+ctrl).find('[name="nameid[]"]').val(nlist[x][0]); $('#'+ctrl).find('[name="title[]"]').val(nlist[x][1]); $('#'+ctrl).find('[name="firstname[]"]').val(nlist[x][2]); $('#'+ctrl).find('[name="surname[]"]').val(nlist[x][3]); $('#'+ctrl).find('[name="dob_yyyy[]"]').val(nlist[x][4]); $('#'+ctrl).find('[name="dob_mm[]"]').val(nlist[x][5]); $('#'+ctrl).find('[name="dob_dd[]"]').val(nlist[x][6]); $('#'+ctrl).find('[name="age[]"]').val(nlist[x][4]+"-"+nlist[x][5]+"-"+nlist[x][6]); } else { $('#'+ctrl).find('[name="nameid[]"]').val(null); } var textArray = []; var valueArray = []; $('.paxselector').each(function(i, obj) { textArray.push($("#"+$(this).attr('id')+" option:selected").text()); valueArray.push($("#"+$(this).attr('id')+" option:selected").val()); }); $('.paxselector').each(function(i, obj) { if($(this).attr('id') != id) { var theId = $(this).attr('id'); $("#"+theId+" option").each(function() { if($(this).text() == textValue) { if($(this).val() != 0) { if ($(this).val().indexOf("create_") == -1) $("#"+theId+" option[value="+$(this).val()+"]").attr('disabled','disabled'); } } else { var valide = true; for(var i = 0; i < textArray.length; i++) { if($(this).text() == textArray[i]) { valide = false; } } if(valide) { $("#"+theId+" option[value="+$(this).val()+"]").removeAttr('disabled'); } } }); } }); $("#"+id+" option").each(function() { var valide = false; for(var i = 0; i < textArray.length; i++) { if(Number.isInteger(parseInt(optValue)) && !Number.isInteger(parseInt($(this).val()))) { $("#"+$(this).val()).hide(); } if($(this).text() == textArray[i]) { valide = true; } } if(!valide) { $("#"+id+" option[value="+$(this).val() +"]").removeAttr('disabled'); } }); previousText = textValue; previousValue = $("#"+id+" option:selected").val(); } function updateCommission() { var comm = parseFloat($("#update_commission").val()); $("#totalWithComm").html( (parseFloat((gtComp * currency_roe)) + comm).toFixed(2)); } function checkForm(book) { book = book || 0; if(book == 1) { if($('#readConditions').length) { if(!$('#readConditions').is(':checked')) { alert(LangGet.readConditions); return false; } } $("#bookNow").val(1); } var cnt = 0; var txt = ''; $('[name="specialRequests"]').each(function(i, obj) { if($(obj).is(':checked')) { if(cnt > 0) txt += '|'; txt += i; cnt += 1; } }); if(cnt > 4) { alert('{{ Lang::get('booking.maxChoiceRequest') }}'); } else { var nbr = 0; $('[name="remark_for_hotel"]').val(txt); if(book == 1) { var opts = { lines: 13, // The number of lines to draw length: 20, // The length of each line width: 10, // The line thickness radius: 30, // The radius of the inner circle corners: 0.9, // Corner roundness (0..1) rotate: 0, // The rotation offset direction: 1, // 1: clockwise, -1: counterclockwise color: '#fff', // #rgb or #rrggbb or array of colors speed: 1, // Rounds per second trail: 58, // Afterglow percentage shadow: false, // Whether to render a shadow hwaccel: false, // Whether to use hardware acceleration className: 'spinner', // The CSS class to assign to the spinner zIndex: 2e9, // The z-index (defaults to 2000000000) top: '50%', // Top position relative to parent left: '50%' // Left position relative to parent }; var target = document.getElementById('spin'); var spinner = new Spinner(opts).spin(target); $('#spinMessage').html(''); $.magnificPopup.open({ items: { src: '#spinnerModal' }, type: 'inline', modal: true }); } $("#editForm").submit(); } } var mailCtrl; function showMail() { mailCtrl.showEmailForm(); } @stop @section('linkscript') {{ HTML::script('js/vols_v5.js?'.filemtime('js/vols_v5.js')) }} {{ HTML::script('js/ctrlMailForm.js?'.filemtime('js/ctrlMailForm.js')) }} @stop @section('pageStyle') .special_requests .field { display: inline-block; float: left; width: 200px; } .image img { height: 50px; width: 150px; } .mail-popup { position: relative; background: #FFF; padding: 10px; width: auto; width: 400px; height:240px; margin: 20px auto; border-style:solid; border-width:2px; border-color: #048a7e; } @stop @section('pageContent') {{--*/ $nbr = 0 /*--}} {{--*/ $paxOk = 'yes' /*--}} @foreach ($comp->occupancies as $detail) @foreach ($detail->occupanciespaxs as $pax) @if($pax->name_id == 0) {{--*/ $paxOk = 'no' /*--}} @endif @endforeach @endforeach