@extends('layouts.cartMaster') @include('booking.nonRef') @section('getStarted') // faisait planter la page détail quand il y avait un saut de ligne dans special request // Je ne sais pas trop a quoi servait ce block de code, les cases a cochées spécial request // ne proviennent pas de $comp->specialrequests ... @if($comp->specialrequests != null && 1==2) 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(Auth::user()->int_ext && $comp->haveFeeInLess48h() && $comp->status == "QT" && $comp->connector != "reservit") $("#warning-btn").trigger('click'); @endif @if($err !== null) $('html, body').animate({ scrollTop: $("#editFormPrice").offset().top - 110 }); @endif $( ".paxselector" ).each(function( index ) { @if($comp->type == "HOT") changepax('row'+index); @else changepaxAddon('row'+index); @endif }); @if($comp->type == "HOT") 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(in_array(Account::getAccount()->code, $comp->accShowCountryHot) || $comp->connector == "rezotel") $("input[name='paxid[]']").each(function() { populateCountries('new_country_'+$(this).val()); }); @endif @endif }); mailCtrl = createMailFormCtrl('mailDiv', 0, {{ $comp->id }}, {{ Auth::id() }}, "{{ $comp->type }}", "{{ str_replace('"' ,'' ,$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 }}","{{ $n->email }}","{{ $n->country }}"]); @endforeach function changepaxAddon(ctrl , id , occId) { var textValue = $("#"+id+" option:selected").text(); var x = parseInt($('#'+ctrl).find('.paxselector').val()); 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]); $('#'+ctrl).find('[name="courriel[]"]').val(nlist[x][7]); $('#'+ctrl).find('[name="country[]"]').val(nlist[x][8]); var textArray = []; var valueArray = []; $('.occ'+occId+'').each(function(i, obj) { textArray.push($("#"+$(this).attr('id')+" option:selected").text()); valueArray.push($("#"+$(this).attr('id')+" option:selected").val()); }); $('.occ'+occId+'').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) { $("#"+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'); } } }); } }); } var previousText = ""; var previousValue = ""; 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]); $('#'+ctrl).find('[name="courriel[]"]').val(nlist[x][7]); } 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 closeYesNoForm() { $(".mfp-close").trigger('click'); } function checkForm(book, nonRef) { book = book || 0; nonRef = nonRef || 0; if(book == 1) { if($('#readConditions').length) { if(!$('#readConditions').is(':checked')) { alert(LangGet.readConditions); return false; } } if(nonRef) { $("#alert-booking-nonref").trigger("click"); 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; 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/hotels_v3.js?'.filemtime('js/hotels_v3.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; } .component { padding-left: 15px; padding-top: 10px; padding-right: 10px; } .ebb { color:red; } @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