403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/b2bsite.hellogtx.com/public/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2bsite.hellogtx.com/public/js/byo(10_03_2023).js
$('body').click(function () {
    $(".msg").fadeOut(3000);
});
$('.msg').hide().html('');
function validDate() {
    // alert("test");
    var startDateName = $('#startDate').val();
    if (startDateName == '') {
        $('.msg').show().html('Please select start date first');
        $('#startDate').focus();
        return false;
    }
//   alert($("ul.destination-rows-container").children().length);
    if ($("ul.destination-rows-container").children().length > 5) {

        $('.msg').show().html('Limit Exceed ');
        $('#selectDestinationCovered').val('');
        return false;
    }
}

$("#byo_enquiry").on('submit', function (e) {

    var data = $("#byo_enquiry").serialize();
    console.log(data);

    if ($('.byo_enquiry input[name="startDate"]').val() == '') {
        $('.msg').show().html('Please select start date');
        $('.byo_enquiry input[name="startDate"]').focus();
        return false;
//    } else if ($('.byo_enquiry input[name="startCity"]').val() == '') {
//        $('.msg').show().html('Please enter start city');
//        $('.byo_enquiry input[name="startCity"]').focus();
//        return false;
//    } else if ($('.byo_enquiry input[name="endCity"]').val() == '') {
//        $('.msg').show().html('Please enter end city');
//        $('.byo_enquiry input[name="endCity"]').focus();
//        return false;
    } else if ($("ul.destination-rows-container").children().length < 1) {
        $('.msg').show().html('Please add destinations ');
        $('#selectDestinationCovered').focus();
        return false;
    } else {

        $.ajax({url: SITEURL + 'byo/index/save-search-result-data', type: 'POST', data: data, dataType: 'json', beforeSend: function () {

            }, success: function (result) {
//                  console.log(result);
                var TPSysIden = btoa(result.TPSysId);
                var form = '';
                form += '<input type="hidden" name="TPSysId" value="' + result.TPSysId + '">';
                var BYOType = $('#BYOType').val();
                if(BYOType == 2){
                    $('<form action="' + SITEURL + 'byo/index/itinerary-desc-details/id/' + TPSysIden + '" method="POST">' + form + '</form>').appendTo($(document.body)).submit();
                }else{
                    $('<form action="' + SITEURL + 'byo/index/search-results/id/' + TPSysIden + '" method="POST">' + form + '</form>').appendTo($(document.body)).submit();
                }
                

            }
        })
    }
});

// $('.datepicker_byo').datepicker({
//     dateFormat: 'dd/mm/yy',
//     minDate: 0
// });

    // $("#startDate").datepicker({
    //     dateFormat: 'dd/mm/yy',
    //     autoclose: true,
    //     todayBtn: true,
    //     minDate:0,
       
    // });
$("#selectStartCity").autocomplete({
    
    source: function (request, response) {
        var query = $("#selectStartCity").val();
        var countryId = '';
        $.getJSON("byo/index/get-transport-start-citydata", {query: query, countryId: countryId,type:1},
        response);
    },
    minLength: 2,
    autoFocus: true,
    select: function (event, ui) {
        var CityId = ui.item.CityId;
        var CityName = ui.item.CityName;
        $("#selectStartCity_hidden").val(CityId);
        $('#selectEndCity').focus();
        autoSuggestTransportRoute();
    }
});

$("#selectEndCity").autocomplete({
    source: function (request, response) {
        var query = $("#selectEndCity").val();
        var countryId = '';
//        $.getJSON("byo/index/get-citydata", {query: query, countryId: countryId},
        $.getJSON("byo/index/get-transport-start-citydata", {query: query, countryId: countryId,type:2},
        response);
    },
    minLength: 2,
    autoFocus: true,
    select: function (event, ui) {
        var CityId = ui.item.CityId;
        var CityName = ui.item.CityName;
        $("#selectEndCity_hidden").val(CityId);
        $('#selectDestinationCovered').focus();
        autoSuggestTransportRoute();
    }
});



$("#selectDestinationCovered").autocomplete({
    source: function (request, response) {
        var query = $("#selectDestinationCovered").val();
        var BYOType = $("#BYOType").val();
        var countryId = '';
        var url = 'byo/index/get-city-hoteldata';
        if(BYOType == 2){
            url = 'byo/index/get-transport-start-citydata';
        }
        $.getJSON(url, {query: query, countryId: countryId,BYOType:BYOType},
        response);
    },
    minLength: 2,
    autoFocus: true,
    select: function (event, ui) {
        var CityId = ui.item.CityId;
        var CityName = ui.item.CityName;
        $("#hidden_selected_des_cityid").val(CityId);
        $("#hidden_selected_city_name").val(CityName);

        $('.addmoredes').click();
        $(this).val("");
        return false;
    }
});







$('.addmoredes').click(function () {

    var count = 1;
    count = parseInt($('#count_inputs').val());
    var destName = $("#hidden_selected_city_name").val();
    var startDateName = $('#startDate').val();
    var desId = $('#hidden_selected_des_cityid').val();

//console.log(desId);return false;

    var someFormattedDate = '';
    someFormattedDate = getDates(count);

    if (count > 1) {
        startDateName = $('.check_out_' + (parseInt(count) - 1)).val();
//   startDateName = $('#check_out_'+(parseInt(count) - 1)).val(); 
    }

    var defaultNights = 2;

    $('.destination-rows-container').append('<li class="inserted-destination-row' + count + '"> <div class="col-md-2 col-xs-4 desti-head ">' + destName + '</div><input type="hidden" id="destName' + count + '" class="destName' + count + '" name="destName[]" value="' + destName + '"/><input type="hidden" id="destIds' + count + '" class="destIds' + count + '" name="destIds[]" value="' + desId + '"/>' +
            '<div class="col-md-5  col-xs-8 no-padding">' +
            ' <div class="check-count-box">' +
            ' <div class="col-md-6 col-xs-6">' +
            '<span class="small-drag">Check in date</span><br>' +
            '<h3><span id="check_inDate_' + count + '" class="check_inDate_' + count + '">' + startDateName + '</span></h3><input type="hidden" id="check_in_' + count + '" class="check_in_' + count + '" name="check_in[]" value="' + startDateName + '"/>' +
            '</div>' +
            '<div class="col-md-6 col-xs-6"><span class="small-drag">Check out date</span>' +
            '<h3><span id="check_outDate_' + count + '" class="check_outDate_' + count + '">' + someFormattedDate + '</span></h3><input type="hidden" id="check_out_' + count + '" class="check_out_' + count + '" name="check_out[]" value="' + someFormattedDate + '"/>' +
            '</div>' +
            '</div>' +
            '</div>' +
            '<div class="col-md-5  col-xs-12 no-padding">' +
            '<div class="col-md-8  col-xs-9 mobile-padd-tab padding_alignmbbyo count-box-night-row">' +
            '<label class="count-box-night  ">Nights</label>  ' +
            '<div id="merge_new_nights' + count + '" class="form-control input-sm center merge-bottom-input  merge_new_nights' + count + '" name="second">' + defaultNights + '</div>' +
            '<div class=" count-box btnplus-width" role="group" aria-label="plus-minus"> <input type="hidden"  id="default_nights' + count + '" class="default_nights' + count + '" name="nights[]" value="' + defaultNights + '"/>' +
            '<button type="button" onclick="plusFunc(this);" data_index="' + count + '" id="plus-button_' + count + '" class="btn btn-sm btn-success plus-button_' + count + ' merge-top-right-button col-md-12 btnplus-width22"><span class="glyphicon glyphicon-plus"></span></button>' +
            '<button type="button" onclick="minusFunc(this);" data_index="' + count + '" id="minus-button_' + count + '" class="btn btn-sm btn-danger minus-button_' + count + ' merge-top-left-button col-md-12 btnplus-width22"><span class="glyphicon glyphicon-minus"></span></button>' +
            '</div>' +
            '</div>     ' +
            '<div class="col-md-4  col-xs-3 desti-link no-padding"> <a href="javascript://" class = "sortable sortable2"><i class="fa fa-arrows"></i></a> <a href="javascript://" class="removeit3" onclick="removeIt(' + count + ')"><i class="fa fa-times"></i></a></div> ' +
            '</div>' +
            '<div class="clear"></div>' +
            '</li>');





    $('#count_inputs').val(parseInt(count) + 1);

});
function plusFunc(n) {
    var count = $(n).attr("data_index");
//    $('.plus-button_'+count).click(function() {
    var default_nights = $('.merge_new_nights' + count).html();

    if (default_nights < 10) {
        default_nights++;

        $('.merge_new_nights' + count).html(default_nights);
        $('.default_nights' + count).val(default_nights);

        for (var i = count; i <= 6; i++) {
            var addDate = getDatesAdd(i);


            $('.check_outDate_' + i).html(addDate);
            $('.check_out_' + i).val(addDate);

            $('.check_inDate_' + (parseInt(i) + 1)).html($('.check_outDate_' + i).html());
            $('.check_in_' + (parseInt(i) + 1)).val($('.check_out_' + i).val());


        }
    }
    //});
}
function minusFunc(n) {
    var count = $(n).attr("data_index");
    //$('.minus-button_'+count).click(function() {
    var default_nights = $('.merge_new_nights' + count).html();
    if (default_nights > 1) {
        default_nights--;
        $('.merge_new_nights' + count).html(default_nights);
        $('.default_nights' + count).val(default_nights);
        for (var i = count; i <= 6; i++) {
            var subDate = getDatesSub(i);


            $('.check_outDate_' + i).html(subDate);
            $('.check_out_' + i).val(subDate);

            $('.check_inDate_' + (parseInt(i) + 1)).html($('.check_outDate_' + i).html());
            $('.check_in_' + (parseInt(i) + 1)).val($('.check_out_' + i).val());


        }
    }



    //});
}
function getDates(count) {

//  console.log(startDateName);
    if (count == 1) {
        var check_out = $('#startDate').val();
    } else {
//          var check_in = $('#check_in_'+(parseInt(count) - 1)).val();
//    var check_out = $('#check_out_'+(parseInt(count) - 1)).val();

        var check_in = $('.check_in_' + (parseInt(count) - 1)).val();
        var check_out = $('.check_out_' + (parseInt(count) - 1)).val();
    }
//   console.log(check_out);
    var check_out1 = check_out.split('/');
    var mDay = check_out1[0];
    var mMonth = check_out1[1];
    var mYear = check_out1[2];
    var check_out = mMonth + '/' + mDay + '/' + mYear;

    var newdate = new Date(check_out);
//console.log(check_out);

    newdate.setDate(newdate.getDate() + 2);

    var dd = ("0" + newdate.getDate()).slice(-2);
    var mm = ("0" + (newdate.getMonth() + 1)).slice(-2);
    var y = newdate.getFullYear();

    var someFormattedDate = dd + '/' + mm + '/' + y;
    return someFormattedDate;
//   console.log(someFormattedDate);



}

function updateCheckInClass() {
    $("input[class^='check_in_']").each(function (i) {
        $(this).removeAttr('class').addClass('check_in_' + (parseInt(i) + 1));
    });
}
function updateCheckOutClass() {
    $("input[class^='check_out_']").each(function (i) {
        $(this).removeAttr('class').addClass('check_out_' + (parseInt(i) + 1));
    });
}
function updateCheckInSpanClass() {
    $("span[class^='check_inDate_']").each(function (i) {
        $(this).removeAttr('class').addClass('check_inDate_' + (parseInt(i) + 1));
    });
}
function updateCheckOutSpanClass() {
    $("span[class^='check_outDate_']").each(function (i) {
        $(this).removeAttr('class').addClass('check_outDate_' + (parseInt(i) + 1));
    });
}
function updateNightDivClass() {
    $("div[id^='merge_new_nights']").each(function (i) {
        $(this).removeAttr('class').addClass('form-control input-sm center merge-bottom-input col-md-8  col-xs-5 merge_new_nights' + (parseInt(i) + 1));
    });
}
function updateNightInputClass() {
    $("input[id^='default_nights']").each(function (i) {
        $(this).removeAttr('class').addClass('default_nights' + (parseInt(i) + 1));
    });
}
function updatePlusDivClass() {
    $("button[id^='plus-button_']").each(function (i) {
        $(this).removeAttr('data_index').attr('data_index', (parseInt(i) + 1));
    });
}
function updateMinusDivClass() {
    $("button[id^='minus-button_']").each(function (i) {
        $(this).removeAttr('data_index').attr('data_index', (parseInt(i) + 1));
    });
}

function getDatesAddDrag(liCount) {

//  console.log(startDateName);
    for (var i = 1; liCount > i; i++) {
        if (i > 1) {
            var check_out = $('.check_out_' + (parseInt(i) - 1)).val();
        } else {
            var check_out = $('#startDate').val();
        }
        var li1 = $('.merge_new_nights' + parseInt(i)).html();
        // var li2 = $('.merge_new_nights2').html();
        var check_out1 = check_out.split('/');
        var mDay = check_out1[0];
        var mMonth = check_out1[1];
        var mYear = check_out1[2];
        var check_outNew = mMonth + '/' + mDay + '/' + mYear;
        var newdate = new Date(check_outNew);
        newdate.setDate(newdate.getDate() + parseInt(li1));
        var dd = ("0" + newdate.getDate()).slice(-2);
        var mm = ("0" + (newdate.getMonth() + 1)).slice(-2);
        var y = newdate.getFullYear();
        var addDate = dd + '/' + mm + '/' + y;
        $('.check_outDate_' + i).html(addDate);
        $('.check_out_' + i).val(addDate);
        if (i > 1) {

            //alert("+++++1");
            $('.check_inDate_' + (parseInt(i))).html($('.check_outDate_' + (parseInt(i) - 1)).html());
            $('.check_in_' + (parseInt(i))).val($('.check_out_' + (parseInt(i) - 1)).val());
        } else {
            //alert("ek");
            $('.check_inDate_' + (parseInt(i))).html(check_out);
            $('.check_in_' + (parseInt(i))).val(check_out);
        }

//    return someFormattedDate;
//   console.log(someFormattedDate);

    }

}

function getDatesAdd(count) {

//  console.log(startDateName);
    var check_in = $('.check_in_' + (parseInt(count))).val();
    var check_out = $('.check_out_' + (parseInt(count))).val();

    var check_out1 = check_out.split('/');
    var mDay = check_out1[0];
    var mMonth = check_out1[1];
    var mYear = check_out1[2];
    var check_out = mMonth + '/' + mDay + '/' + mYear;

    var newdate = new Date(check_out);


    newdate.setDate(newdate.getDate() + 1);

    var dd = ("0" + newdate.getDate()).slice(-2);
    var mm = ("0" + (newdate.getMonth() + 1)).slice(-2);
    var y = newdate.getFullYear();

    var someFormattedDate = dd + '/' + mm + '/' + y;
    return someFormattedDate;
    console.log(someFormattedDate);



}

function getDatesSub(count) {

//  console.log(startDateName);
    var check_in = $('.check_in_' + (parseInt(count))).val();
    var check_out = $('.check_out_' + (parseInt(count))).val();

    var check_out1 = check_out.split('/');
    var mDay = check_out1[0];
    var mMonth = check_out1[1];
    var mYear = check_out1[2];
    var check_out = mMonth + '/' + mDay + '/' + mYear;

    var newdate = new Date(check_out);

    newdate.setDate(newdate.getDate() - 1);

    var dd = ("0" + newdate.getDate()).slice(-2);
    var mm = ("0" + (newdate.getMonth() + 1)).slice(-2);
    var y = newdate.getFullYear();

    var someFormattedDate = dd + '/' + mm + '/' + y;
    return someFormattedDate;
    console.log(someFormattedDate);



}



function removeIt(countno) {

    var count = $('#count_inputs').val();
    if (count == 1) {
        return false;
    }
    $('.destination-rows-container').find('.inserted-destination-row' + countno).remove();
    updateCheckInClass();
    updateCheckOutClass();
    updateCheckInSpanClass();
    updateCheckOutSpanClass();
    updateNightDivClass();
    updateNightInputClass();
    updatePlusDivClass();
    updateMinusDivClass();
    getDatesAddDrag(count);
    $('#count_inputs').val(parseInt(count) - 1);
}



function getRemoveDatesAdd(count, countno) {
    //  console.log(startDateName);
    var check_in = $('.check_in_' + (parseInt(count))).val();
    var check_out = $('.check_out_' + (parseInt(count))).val();

    var check_out1 = check_out.split('/');
    var mDay = check_out1[0];
    var mMonth = check_out1[1];
    var mYear = check_out1[2];
    var check_out = mMonth + '/' + mDay + '/' + mYear;

    var newdate = new Date(check_out);


    newdate.setDate(newdate.getDate() + (parseInt(countno) - 2));

    var dd = ("0" + newdate.getDate()).slice(-2);
    var mm = ("0" + (newdate.getMonth() + 1)).slice(-2);
    var y = newdate.getFullYear();

    var someFormattedDate = dd + '/' + mm + '/' + y;
    return someFormattedDate;
    console.log(someFormattedDate);
}


var mCount_travel = $('#mCount_travelPlanDesData').val();

if (mCount_travel > 0) {
    for (var m = 1; m <= mCount_travel; m++) {

        var mCount_CitySysId = $('#mCount_CitySysId' + parseInt(m)).val();
        var mCount_destName = $('#mCount_destName' + parseInt(m)).val();
        var mCount_NoDay = $('#mCount_NoDay' + parseInt(m)).val();
        var mCount_check_inDate = $('#mCount_check_inDate_' + parseInt(m)).val();
        var mCount_check_outDate = $('#mCount_check_outDate_' + parseInt(m)).val();

        $("#hidden_selected_des_cityid").val(mCount_CitySysId);
        $("#hidden_selected_city_name").val(mCount_destName);

        $('.addmoredes').click();

        $('.default_nights' + parseInt(m)).val(mCount_NoDay);
        $('.merge_new_nights' + parseInt(m)).html(mCount_NoDay);
        $('.check_inDate_' + parseInt(m)).html(mCount_check_inDate);
        $('.check_in_' + parseInt(m)).val(mCount_check_inDate);
        $('.check_outDate_' + parseInt(m)).html(mCount_check_outDate);
        $('.check_out_' + parseInt(m)).val(mCount_check_outDate);

    }
}



function changeDateAllDestinations(that) {
    var mstartDate = $(that).val();

    $('.check_in_' + (parseInt(1))).val(mstartDate);
    $('.check_inDate_' + (parseInt(1))).html(mstartDate);
    var total_li = $("ul.destination-rows-container").children().length;
    for (var m = 1; m <= total_li; m++) {

        var nights = $('.default_nights' + m).val();
//       alert(nights);
        var dateChange = getDatesOnchangeDate(m, mstartDate, nights);

        $('.check_outDate_' + (parseInt(m))).html(dateChange);
        $('.check_inDate_' + (parseInt(m) + 1)).html(dateChange);
        $('.check_out_' + (parseInt(m))).val(dateChange);
        $('.check_in_' + (parseInt(m) + 1)).val(dateChange);

    }

    $('#selectStartCity').focus();
}

function getDatesOnchangeDate(count, mstartDate, nights) {

//  console.log(startDateName);
    if (count == 1) {
        var check_out = mstartDate;
    } else {
//          var check_in = $('#check_in_'+(parseInt(count) - 1)).val();
//    var check_out = $('#check_out_'+(parseInt(count) - 1)).val();

        var check_in = $('.check_in_' + (parseInt(count) - 1)).val();
        var check_out = $('.check_out_' + (parseInt(count) - 1)).val();
    }

//   console.log(check_out);
    var check_out1 = check_out.split('/');
    var mDay = check_out1[0];
    var mMonth = check_out1[1];
    var mYear = check_out1[2];
    var check_out = mMonth + '/' + mDay + '/' + mYear;

    var newdate = new Date(check_out);
//console.log(check_out);

    newdate.setDate(newdate.getDate() + parseInt(nights));

    var dd = ("0" + newdate.getDate()).slice(-2);
    var mm = ("0" + (newdate.getMonth() + 1)).slice(-2);
    var y = newdate.getFullYear();

    var someFormattedDate = dd + '/' + mm + '/' + y;
    return someFormattedDate;
//   console.log(someFormattedDate);



}
/*Added for Auto Suggest Transport Route Start*/

function autoSuggestTransportRoute() {
    var startCityName = $('#selectStartCity').val();
    var endCityName = $('#selectEndCity').val();
    var noofdays = $('#noofdays').val();



    if (startCityName != '' && endCityName != '') {
        var startCityId = $('#selectStartCity_hidden').val();
        var endCityId = $('#selectEndCity_hidden').val();

        $.ajax({
            url: SITEURL + 'byo/index/get-autosuggest-transport',
            type: 'POST',
            data: {startCityId: startCityId, endCityId: endCityId, noofdays:noofdays},
            beforeSend: function () {

            },
            success: function (result) {
               console.log(result);
//               alert(result);
//               if(result != ''){
//                   alert('in');
//                    $('#suggested-transport-route').html('<h4 class="no-margin">Suggested Transport Route</h4>');
//               }
               
                $('#autosuggest-transport').html(result);
                
            }
        })


    }

}


function autoAddHotelCities(id) {

    $.ajax({
        url: SITEURL + 'byo/index/get-autosuggest-transport-hotel-cities',
        type: 'POST',
        data: {id: id},
        dataType: 'json',
        beforeSend: function () {

        },
        success: function (result) {
            $('.destination-rows-container').html(' ');
            $('#count_inputs').val(1);
            for (var m = 0; m < result.total; m++) {
                $("#hidden_selected_city_name").val(result.data[m].CityName);
                $("#hidden_selected_des_cityid").val(result.data[m].DestSysId);
                $("#hidden_selected_des_cityid").val(result.data[m].DestSysId);
                $('.addmoredes').click();
                $('#merge_new_nights' + (parseInt(m) + 1)).html(result.data[m].nights);
                $('#default_nights' + (parseInt(m) + 1)).val(result.data[m].nights);

            }

            var liCount = $("#count_inputs").val();
            getDatesAddDrag(liCount);

        }
    })


}
/*Added for Auto Suggest Transport Route End*/
function getSightseeingPrice(that,i,count,type){
    var gtxPkgId = $(that).val();
    var gtxPkgIdSplit = gtxPkgId.split('_');
    var TPSysId = $('#TPSysIdId').val();
    $.ajax({
        url: SITEURL + 'byo/index/get-sightseeing-detail-by-id',
        type: 'POST',
        data: {'gtxPkgId': gtxPkgIdSplit[0],'index':i,'count':count,'type':type,'TPSysId':TPSysId},
        dataType: 'html',
        beforeSend: function () {

        },
        success: function (result) {
            
        $('.transportTypeHtml'+parseInt(i)+parseInt(count)).show();
        $('.transportTypeHtml'+parseInt(i)+parseInt(count)).html(result);
        
        
        var transportType = $('#transportType'+parseInt(i)+parseInt(count)).val();
        var priceCost = $('#TotalSightPriceCost'+parseInt(transportType) + parseInt(i) + parseInt(count)).val();
        var price = $('#TotalSightPrice'+parseInt(transportType) + parseInt(i) + parseInt(count)).val();
        var Markup = $('#TotalSightMarkup'+parseInt(transportType) + parseInt(i) + parseInt(count)).val();
        var PPCost = $('#TotalSightPPCost'+parseInt(transportType) + parseInt(i) + parseInt(count)).val();
        if(isNaN(price)){
            price = 0;
        }
        if(isNaN(Markup)){
            Markup = 0;
        }
        $('.SightseeingCostHtml'+parseInt(i)+parseInt(count)).html(parseFloat(priceCost));
        $('#selectedSightseeingPrice'+parseInt(i)+parseInt(count)).val(price);
        $('#selectedSightseeingMarkup'+parseInt(i)+parseInt(count)).val(Markup);
        $('#selectedSightseeingPPCost'+parseInt(i)+parseInt(count)).val(PPCost);
        
        }
    })

//    var sightseeingPrice = $('#sightseeingPrice'+parseInt(gtxPkgId)+parseInt(count)).val();
//    $('#price'+parseInt(i)+parseInt(count)).val(sightseeingPrice);
//    $('.transportTypeHtml'+parseInt(i)+parseInt(count)).show();
}
function getShowTransportVehicle(that,i,id){
    var RouteSysId = $(that).val();
    RouteSysId = RouteSysId.split('_');
    RouteSysId = RouteSysId[0];
    var TPSysId = $('#TPSysIdId').val();
    $.ajax({
        url: SITEURL + 'byo/index/get-transport-vehicle',
        type: 'POST',
        data: {RouteSysId: RouteSysId,index:i,count:id,TPSysId:TPSysId},
        dataType: 'html',
        beforeSend: function () {

        },
        success: function (result) {
        $('.appendVehicleDataHtml'+parseInt(i)+parseInt(id)).show();    
        $('.appendVehicleData'+parseInt(i)+parseInt(id)).html(result);    
        getTransferSightseeing(RouteSysId,i,id);
        }
    })
    
    
    
    
//    $('.selectTransportDiv'+parseInt(i)+parseInt(id)).show();
//    $('.RouteVechSysId'+parseInt(i)+parseInt(RouteSysId)+parseInt(id)).show();
    
}
function getTransferSightseeing(RouteSysId,i,id){
    $.ajax({
        url: SITEURL + 'byo/index/get-transport-sightseeing',
        type: 'POST',
        data: {RouteSysId: RouteSysId,index:i,count:id},
        dataType: 'json',
        beforeSend: function () {

        },
        success: function (result) {
            var im = 0;
            $('.SightSeeingNameByDayCount_'+parseInt(i)+'_'+parseInt(id)).remove();
            for(var ii = i; ii< (parseInt(result.length)+i); ii++){
                if(result[im].length>0){
                    $('.IncludedSightseeingsDiv'+parseInt(ii)).show();
                    var len = $('.IncludedSightseeingsDivHtml'+parseInt(ii)).children().length;
                    var htm = '';
                    if(len>0 ){
                        htm = ' | ';
                    }
                    $('.IncludedSightseeingsDivHtml'+parseInt(ii)).append(htm + result[im]);
                }
                im++;
            }
        }
    })
}
function getChangedTransportRate(that,i,RouteSysId,id){
    var RouteVechSysId = $(that).val();
    RouteVechSysId = RouteVechSysId.split('_');
    RouteVechSysId = RouteVechSysId[0];
    var TransportCost = $('#TransportCost'+''+parseInt(i)+''+parseInt(RouteSysId)+''+parseInt(RouteVechSysId)+''+parseInt(id)).val();
      
    $('#SelectedTransportCost'+parseInt(i)+parseInt(id)).val(TransportCost);
    
    var routeNoofnights = $('#routeNoofnights'+parseInt(i)+parseInt(RouteSysId)+parseInt(id)).val();
   
    var startTransportDate = $('#startTransportDate' + (parseInt(i))+ (parseInt(id))).val();
    var startTransportDate1 = startTransportDate.split('/');
    var mDay = startTransportDate1[0];
    var mMonth = startTransportDate1[1];
    var mYear = startTransportDate1[2];
    var startTransportDate2 = mMonth + '/' + mDay + '/' + mYear;
    var newdate = new Date(startTransportDate2);
    newdate.setDate(newdate.getDate() + (parseInt(routeNoofnights)-1));
    var dd = ("0" + newdate.getDate()).slice(-2);
    var mm = ("0" + (newdate.getMonth() + 1)).slice(-2);
    var y = newdate.getFullYear();

    var someFormattedDate = dd + '/' + mm + '/' + y;
    $('#endTransportDate' + (parseInt(i))+ (parseInt(id))).val(someFormattedDate);
    var TransportCostPrice = JSON.parse(atob(TransportCost));
    
    
    var Capacity = parseInt(TransportCostPrice.Capacity);
    var TotalAdult = $('#TotalAdult').val();
    var TotalChild = $('#TotalChild').val();
    var TotalPax = parseInt(TotalAdult) + parseInt(TotalChild);
    var QTYP =  (TotalPax%Capacity);
    var QTY =  parseInt(TotalPax/Capacity);
    if(QTYP >0 ){
        QTY = QTY + 1;
    }
    var VehicleHtml = '';
    for(var im = 1; im<= QTY; im++){
        VehicleHtml += '<option value="'+im+'" >'+im+'</option>';
    }
    $('.VehicleQtyHtml'+parseInt(i)+parseInt(id)).html(VehicleHtml);
    $('.VehicleQtyHtml'+parseInt(i)+parseInt(id)).val(QTY);
    $('.VehicleCapacity'+parseInt(i)+parseInt(id)).val(Capacity);
    
    var TransferCostHtml = TransportCostPrice.CostShow;
    $('.TransferCostHtml'+parseInt(i)+parseInt(id)).html(parseInt(TransferCostHtml*QTY));
    
}
function getChangedTransportQty(that,i,id){
    var TransportCost = $('#SelectedTransportCost'+i+id).val();
    if(TransportCost != ''){
        var TransportCostPrice = JSON.parse(atob(TransportCost)); 
        var QTY = $(that).val();
        var TransferCostHtml = TransportCostPrice.CostShow;
        $('.TransferCostHtml'+parseInt(i)+parseInt(id)).html(parseInt(TransferCostHtml*QTY));
    }
    
}
function removeTransportDiv(i,id){
  var countTransport = $('#countTransport'+parseInt(i)).val();
     $('.removeTransportDiv'+parseInt(i)+parseInt(id)).remove();
      $('#countTransport'+parseInt(i)).val(parseInt(countTransport)-1);   
}

function getPriceDataByTranportType(that,i,id){
    
    var transType = $(that).val();
    var priceCost = $('#TotalSightPriceCost'+parseInt(transType)+parseInt(i)+parseInt(id)).val();
    var price = $('#TotalSightPrice'+parseInt(transType)+parseInt(i)+parseInt(id)).val();
    var Markup = $('#TotalSightMarkup'+parseInt(transType)+parseInt(i)+parseInt(id)).val();
    var PPCost = $('#TotalSightPPCost'+parseInt(transType)+parseInt(i)+parseInt(id)).val();
    $('.SightseeingCostHtml'+parseInt(i)+parseInt(id)).html(parseFloat(priceCost));
    $('#selectedSightseeingPrice'+parseInt(i)+parseInt(id)).val(price);
    $('#selectedSightseeingMarkup'+parseInt(i)+parseInt(id)).val(Markup);
    $('#selectedSightseeingPPCost'+parseInt(i)+parseInt(id)).val(PPCost);
    
}

function iNeedTransportDiv(){
    var isChecked = $('#INeedTransportDiv').prop("checked");
    if(isChecked == true) {
        $('.INeedTransportDiv').show();
    }else{
        $('.INeedTransportDiv').hide();
    }
}
function getMealsAreaOptionData(that,i,count,type){
    
    var mealsCategory = $('#mealsCategory'+i+count).val();
    var mealsType = $('#mealsType'+i+count).val();
    var html = '<option value="">Options</option>';
    $('#mealsOptions'+i+count).html('<option value="">Please Wait..</option>');
    if(mealsCategory != '' && mealsType != ''){
        var startCityId = $('#StartCityId').val();
        var endCityId = $('#EndCityId').val();
        var destinationCityId = $('#destinationCityId'+parseInt(i)).val();
        var TPSysId = $('#TPSysIdId').val(); 
        var day = parseInt(i) + 1;
        $.ajax({
            url: 'byo/index/get-meal-area-data',
            type: 'post',
            data: { 'startCityId':startCityId,'endCityId':endCityId,'destinationCityId':destinationCityId,'mealsCategory':mealsCategory,'mealsType': mealsType, 'TPSysId':TPSysId, 'day':day },
            dataType: 'json',
            success: function (result) { 
                if(result.status == true){ 
                    if(result.data.length>0){
                        $.each(result.data, function( index, value ) {
                            html += '<option value="'+value.id+'~~'+value.meal_name+'">'+value.meal_name+'(Cost: '+value.cost+')'+'</option>';
                        });
                    }
                    $('#mealsOptions'+i+count).html(html);
                }else{
                    $('#mealsOptions'+i+count).html(html);
                    return false;
                }  
            }
        });
    }else{
        $('#mealsOptions'+i+count).html(html);
    }
}
function addMoreMeals(i){
    
    var day = parseInt(i) +1;
    var countMeals = $('#countMeals'+parseInt(i)).val(); 
    var html =  '<div class="col-md-11 removeMealsDiv'+parseInt(i)+parseInt(countMeals)+'"><div class="remove_box_mt">'+
                '<div class="col-md-2 mobile-padd-tab "><div class="colspan-3">'+     
                '<div class=""><div class="inputBoxIn dropBg byo_txtmt_10 putMealDetail'+parseInt(i)+''+parseInt(countMeals)+'">'+
                '<select class="form-control" name="mealsCategory['+i+'][]" id="mealsCategory'+parseInt(i)+parseInt(countMeals)+'" onchange="getMealsAreaOptionData(this, '+parseInt(i)+','+parseInt(countMeals)+',1)">'+
                '<option value="">select Meal</option><option value="2">Lunch</option><option value="3">Dinner</option></select></div></div></div></div> '+
                '<div class="col-md-2 mobile-padd-tab "><div class="colspan-3">'+     
                '<div class=""><div class="inputBoxIn dropBg byo_txtmt_10 putMealDetail'+parseInt(i)+''+parseInt(countMeals)+'">'+
                '<select class="form-control" name="mealsType['+i+'][]" id="mealsType'+parseInt(i)+parseInt(countMeals)+'" onchange="getMealsAreaOptionData(this, '+parseInt(i)+','+parseInt(countMeals)+',2)">'+
                '<option value="">select Meal</option><option value="1">Veg</option><option value="2">Non Veg</option><option value="3">AI</option></select></div></div></div></div> '+
                '<div class="col-md-4 mobile-padd-tab "><div class="colspan-3">'+     
                '<div class=""><div class="inputBoxIn dropBg byo_txtmt_10 putMealDetail'+parseInt(i)+''+parseInt(countMeals)+'">'+
                '<select class="form-control" name="mealsOptions['+i+'][]" id="mealsOptions'+parseInt(i)+parseInt(countMeals)+'" >'+
                '<option value="">Select</option></select></div></div></div></div> '+
                '<div class="col-md-1 mobile-padd-tab text_byocenter mbflt_alignbttn">'+
                '<a class="btn btn-danger byomin_btn_2__" onclick="removeMealsDivFun('+parseInt(i)+','+parseInt(countMeals)+')"><i class="fa fa-minus"></i></a>'+
                '</div><div class="clearfix"></div>'+
                '</div></div>';
    $('.addMoreMealsDiv'+parseInt(i)).append(html);
    $('#countMeals'+parseInt(i)).val(parseInt(countMeals)+1);
}
function removeMealsDivFun(i,count){
    $('.removeMealsDiv'+parseInt(i)+parseInt(count)).remove();
}

Youez - 2016 - github.com/yon3zu
LinuXploit