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/b2bzend/application/views/scripts/customer/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/b2bzend/application/views/scripts/customer/packagesearch-form(sdnfjsdhf).phtml
<?php
$packageThemeList = $this->packageThemeList;
$foodPreferenceList = $this->foodPreferenceList;
$packageInclusionList = $this->packageInclusionList;
$cityListArray = $this->cityListArray;
$leadID = $this->leadID;
if (isset($leadID) && $leadID != "") {
    $leadID = $leadID;
} else {
    $leadID = 0;
}
$sessionPackageQueryData = new Zend_Session_Namespace('sessionPackageQueryData');
$leadDetail = $this->leadDetail;
//echo "<pre>";print_r($leadDetail);exit;
//echo $leadDetail['StartDate']->format('d/m/Y');exit;
//echo "<pre>";print_r($leadDetail);
$searchResult = $sessionPackageQueryData->searchData;
$PackTypeMaskArr = str_split(@$leadDetail['PackTypeMask']);
$FoodTypeMaskArr = str_split(@$leadDetail['CuisineMask']);
$priceRangeArr = Zend_Controller_Action_HelperBroker::getStaticHelper('PackageSearch')->getPriceRange();
//echo "<pre>";print_r($leadDetail['EnqSupplierSysId']);echo "</pre>";
$roominfojson = json_decode($leadDetail['RoomInfoJson'], true);
//echo $roominfojson;
$adultPax = 0;
$childPax = 0;
$infantPax = 0;
//echo "<pre>";print_r($roominfojson);echo "</pre>";die;
if (is_array($roominfojson) && count($roominfojson) > 0) {
    foreach ($roominfojson as $res) {
        $adultPax += $res['Adult'];
        $childPax += $res['Child'];
        $infantPax += @$res['Infant'];
    }
}
$travellers = $adultPax + $childPax + $infantPax;

$InclMaskArr = str_split(@$leadDetail['InclMask']);
$DestinationPlaces = explode(',', $leadDetail['DestinationPlacesSysId']);
$DestinationPlacesSysId = explode(',', $leadDetail['DestinationPlaces']);
for ($j = 0; $j < count($DestinationPlacesSysId); $j++) {
    $going_to_destination[] = trim($DestinationPlacesSysId[$j]);
}

if (is_array($cityListArray) && count($cityListArray) > 0) {
    foreach ($cityListArray as $cityData) {
        $cityData['CityId'] . '__' . $cityData['Title'];
        if (in_array($cityData['Title'], $going_to_destination)) {
            $selected = 'selected';
        }
    }
}
$customerId = $this->customerId;
$getpricerange = $leadDetail['MinPrice'] . '__' . $leadDetail['MaxPrice'];
if (isset($leadDetail['isFromSearchResult'])) {
    $isFromSearchResult = $leadDetail['isFromSearchResult'];
} else if ($customerId > 0) {
    $isFromSearchResult = 0;
} else {
    $isFromSearchResult = 1;
}

$inclusionselected = array();
for ($i = 0; $i < count($packageInclusionList); $i++) {
    if (@$InclMaskArr[$i + 1] == 1) {
        $inclusionselected[] = $i;
    }
}
$themeselected = array();
for ($i = 0; $i < count($packageThemeList); $i++) {
    if (@$PackTypeMaskArr[$i + 1] == 1) {
        $themeselected[] = $i;
    }
}
$foodselected = array();
for ($i = 0; $i < count($foodPreferenceList); $i++) {
    if (@$FoodTypeMaskArr[$i + 1] == 1) {
        $foodselected[] = $i;
    }
}
$qidLink = isset($leadDetail['TPSysId']) ? "/qid/" . $leadDetail['TPSysId'] : '';
$sidLink = !empty($leadDetail['EnqSupplierSysId']) ? "/sid/" . $leadDetail['EnqSupplierSysId'] : '';
//echo "<pre>";print_r($leadDetail);echo "</pre>";
$secureCode = Zend_Controller_Action_HelperBroker::getStaticHelper('SecureCode')->secureCode(trim($leadDetail['TPSysId']), 1);
//echo "<pre>";print_r($leadDetail);echo "</pre>";
?>

<style>
    .redtxt {
        color: red;
    }

    .form-control.selectize-control {
        height: 0;
    }
</style>
<div style="padding-top:20px !important;" id="onWay-tab">
    <?php if (!empty($leadDetail)) { ?>
        <div class="form-group form-group1 no-margin col-md-6" id="showqueryType">
            <label>Query Type :&nbsp;</label>
            <?php if (@$leadDetail['PKqueryType'] == 0) { ?>
                <label class="radio inlinebl">
                    <input class="icheck-black queryType Normal" type="radio" name="queryType" <?php if (@$leadDetail['PKqueryType'] == 0) { ?>checked<?php } ?> id="Normal" value="0"> FIT(Normal)
                </label>
            <?php }
            if (@$leadDetail['PKqueryType'] == 1) { ?>
                <label class="radio inlinebl">
                    <input class="icheck-black queryType Group" type="radio" name="queryType" <?php if (@$leadDetail['PKqueryType'] == 1) { ?>checked<?php } ?> id="Group" value="1"> GIT(Group)
                </label>
            <?php } ?>
        </div>
    <?php } else { ?>
        <div class="form-group form-group1 no-margin col-md-6" id="showqueryType">
            <label>Query Type :&nbsp;</label>
            <label class="radio inlinebl">
                <input class="icheck-black queryType Normal" type="radio" name="queryType" <?php if (@$leadDetail['PKqueryType'] == 0) { ?>checked<?php } ?> id="Normal" value="0"> FIT(Normal)
            </label>
            <label class="radio inlinebl">
                <input class="icheck-black queryType Group" type="radio" name="queryType" <?php if (@$leadDetail['PKqueryType'] == 1) { ?>checked<?php } ?> id="Group" value="1"> GIT(Group)
            </label>
        </div>
    <?php } ?>
    <!--<form name="PackageSearchForm" id="PackageSearchForm" method="POST" action="/packagesearch/search-result">-->
    <div class="col-md-12">
        <div class="alert alert-danger" style="display: none;color:#69162b;">
            <span id="errorMessage">No packages found, please try some other criteria. You can also <a href="<?php echo $this->baseUrl('packagesearch/buildquickpackage' . $qidLink . '/code/' . $secureCode); ?>" target="_blank" style="text-decoration: underline;">CLICK HERE </a> to create quick package or <a href="<?php echo $this->baseUrl('packagesearch/enquirysupplierpackage'); ?>" target="_blank" style="text-decoration: underline;cursor:pointer;" class="sendEnquiryToSupplierButton">CLICK HERE </a> to send ENQUIRY to SUPPLIERS.</span>
            <span id="errorMessage2"> </span>
            <!--            <span id="errorMessage">No package found, Try some other criteria or <a onclick="BulidPkg();" style="text-decoration: underline;">Click Here </a>  to Build Your Own Package </span>
            <span id="errorMessage2" style="display:none;">No package found, Try some other criteria or <a onclick="BulidPkg();" style="text-decoration: underline;cursor:pointer;">Click Here </a>  to Build Your Own Package </span>-->
        </div>
        <div class="alert" style="display: none; color: #a94442;background-color: #f2dede;border-color: #ebccd1;">
            <span><a href="<?php echo $this->baseUrl('packagesearch/enquirysupplierpackage'); ?>" target="_blank" style="text-decoration: underline;cursor:pointer;" class="sendEnquiryToSupplierButton">CLICK HERE </a> to send ENQUIRY to SUPPLIERS.</span>
        </div>
    </div>

    <form name="PackageSearchForm" id="PackageSearchForm" method="POST">
        <input type="hidden" name="LeadSysId" value="<?php echo isset($leadDetail['LeadSysId']) ? (int) $leadDetail['LeadSysId'] : 0; ?>">
        <input type="hidden" name="modify_TPSysId" id="modify_TPSysId" value="<?php echo isset($leadDetail['TPSysId']) ? $leadDetail['TPSysId'] : ''; ?>">
        <input type="hidden" name="isFromSearchResult" id="isFromSearchResult" value="<?php echo $isFromSearchResult; ?>">
        <input type="hidden" name="modify_goingfrom" value="<?php echo @$leadDetail['SourcePlaces']; ?>" id="modify_goingfrom" />
        <input type="hidden" name="modify_goingto" value="<?php echo @$leadDetail['DestinationPlaces']; ?>" id="modify_goingto" />
        <input type="hidden" name="modify_pricerange" value="<?php echo @$getpricerange; ?>" id="modify_pricerange" />
        <input type="hidden" name="modify_inclusions" value="<?php echo implode(',', $inclusionselected); ?>" id="modify_inclusions" />
        <input type="hidden" name="modify_theme" value="<?php echo implode(',', $themeselected); ?>" id="modify_theme" />
        <input type="hidden" name="modify_food" value="<?php echo implode(',', $foodselected); ?>" id="modify_food" />
        <input type="hidden" name="modify_hotelpreference" value="<?php echo @$leadDetail['HotelPreference']; ?>" id="modify_hotelpreference" />
        <input type="hidden" name="modify_specificdate" value="<?php echo (isset($leadDetail['StartDate']) && ($leadDetail['StartDate']->format('d/m/Y') != '01/01/1900')) ? $leadDetail['StartDate']->format('d/m/Y') : ''; ?>" id="modify_specificdate" />
        <input type="hidden" name="modify_totaltravelers" value="<?php echo $travellers > 0 ? $travellers : 2; ?>" id="modify_totaltravelers" />
        <input type="hidden" name="IsFromModified" id="IsFromModified" value="<?php
                                                                                if (isset($this->IsFromModified)) {
                                                                                    echo $this->IsFromModified;
                                                                                }
                                                                                ?>">
        <input type="hidden" name="TPSysId" id="TPSysId" value="<?php echo (isset($leadDetail['TPSysId']) && !empty($leadDetail['TPSysId'])) ? trim($leadDetail['TPSysId']) : ''; ?>">
        <input type="hidden" name="encodeTPSysId" id="encodeTPSysId" value="<?php echo (isset($leadDetail['TPSysId']) && !empty($leadDetail['TPSysId'])) ? base64_encode(trim($leadDetail['TPSysId'])) : ''; ?>">
        <input type="hidden" name="itenaryID" id="itenaryID" value="0">
        <input type="hidden" name="MinPax" id="MinPax" value="0">
        <input type="hidden" name="is_source" id="is_source" value="CRM">
        <input type="hidden" name="customerID" id="customerID" value="<?php echo $customerId; ?>">
        <input type="hidden" name="search_customerId" id="search_customerId" value="<?php echo base64_encode($customerId); ?>">
        <input type="hidden" name="EnqSupplierSysId" value="<?php echo (isset($leadDetail['EnqSupplierSysId']) && $leadDetail['EnqSupplierSysId'] != '') ? trim($leadDetail['EnqSupplierSysId']) : ''; ?>" />


        <div class="cl">&nbsp;</div>
        <!--        <div class="col-md-3">
                    <div class="form-group">
                        <label><strong>Going to </strong></label>
                        <span class="redtxt">*</span>
                        <input autocomplete="off" name="search_going" id="search_going" class="form-control" type="text" placeholder="Destination City" value="<?php echo (isset($leadDetail['DestinationPlaces']) && !empty($leadDetail['DestinationPlaces'])) ? trim($leadDetail['DestinationPlaces']) : ''; ?>" onkeyup="get_city_autosuggest_country_package('search_going','search_going_to','','ContSysId');" >
                        <input type="hidden" id="search_going_to" name="search_going_to" value="<?php echo (isset($leadDetail['DestinationPlacesSysId']) && !empty($leadDetail['DestinationPlacesSysId']) && $leadDetail['DestinationPlacesSysId'] != 0) ? trim($leadDetail['DestinationPlacesSysId']) . '__' . trim($leadDetail['DestinationPlaces']) : ''; ?>"/>      
                        <input type="hidden" id="ContSysId" name="ContSysId" value="<?php echo (isset($leadDetail['ContSysId']) && !empty($leadDetail['ContSysId'])) ? trim($leadDetail['ContSysId']) : ''; ?>"/>      
                    </div>
                </div>-->

        <?php
        $cityArray = array();
        if (isset($leadDetail['search_going_to']) && ($leadDetail['search_going_to'] != '')) {
            $CityIds = explode(',', $leadDetail['search_going_to_id']);
            $Cities = explode(',', $leadDetail['search_going_to_city']);
            foreach ($CityIds as $key => $value) {
                $cityArray[] = array('CityId' => trim($value), 'Title' => trim($Cities[$key]));
            }
        } else {
            if (isset($leadDetail['CityIds']) && $leadDetail['CityIds'] != "") {
                $CityIds = explode(',', $leadDetail['CityIds']);
                $Cities = explode(',', $leadDetail['DestinationPlaces']);
                foreach ($CityIds as $key => $value) {
                    $cityArray[] = array('CityId' => trim($value), 'Title' => trim($Cities[$key]));
                }
            }
        }
        $cityArrayData = '';
        if (!empty($cityArray) ) {
            //$cityArrayData=implode(',',$cityArray);
            $cityArrayData = json_encode($cityArray);
        } else {
            $cityArrayData = json_encode($cityArray);
        }
        //                                        echo "<pre>";print_r($cityArrayData);  
        ?>
        <div class="col-md-3">
            <div class="form-group">
                <label><strong>Going to </strong></label>
                <span class="redtxt">*</span>
                <input autocomplete="off" name="search_going" id="search_going" class="form-control whbg otherlocationcity selectized" data-selectize-values='<?php echo $cityArrayData; ?>' type="text" placeholder="Destination City" value="" onkeyup="other_loc_city_multiautosuggest('search_going');">
                <input type="hidden" id="search_going_to" name="search_going_to" value="" />
                <input type="hidden" id="search_going_to_city" name="search_going_to_city" value="" />
                <input type="hidden" id="search_going_to_id" name="search_going_to_id" value="" />
                <input type="hidden" id="ContSysId" name="ContSysId" value="<?php echo (isset($leadDetail['ContSysId']) && !empty($leadDetail['ContSysId'])) ? trim($leadDetail['ContSysId']) : ''; ?>" />
            </div>
        </div>




        <div class="col-md-3">

            <div class="form-group">
                <label><strong>Going From</strong></label>
                <input autocomplete="off" name="search_going_f" id="search_going_f" class="form-control" type="text" placeholder="From City" value="<?php echo (isset($leadDetail['SourcePlaces']) && !empty($leadDetail['SourcePlaces'])) ? trim($leadDetail['SourcePlaces']) : ''; ?>" onkeyup="get_city_autosuggest('search_going_f', 'search_going_from', '');">
                <input type="hidden" id="search_going_from" name="search_going_from" value="<?php echo (isset($leadDetail['SourcePlaceSysId']) && !empty($leadDetail['SourcePlaceSysId'])) ? trim($leadDetail['SourcePlaceSysId']) . '__' . trim($leadDetail['SourcePlaces']) : ''; ?>" />
            </div>
        </div>



        <div class="col-md-3">
            <div class="form-group no-margin">
                <label><strong>Specific Date</strong></label>
                <span class="redtxt">*</span>
                <div class="input-group ls-group-input">
                    <input autocomplete="off" class="form-control" placeholder="dd/mm/yy" type="text" name="search_specific_date" value="<?php echo (isset($leadDetail['StartDate']) && ($leadDetail['StartDate']->format('d/m/Y') != '01/01/1900')) ? $leadDetail['StartDate']->format('d/m/Y') : ''; ?>" id="search_specific_date" />
                    <span class="input-group-addon" onclick="runDatePicker('search_specific_date');"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="col-md-3">
            <div class="form-group no-margin">
                <label><strong>No Of Days</strong></label>
                <div class="cl"></div>
                <div class="col-md-6 no-padding ">
                    <div class="">
                        <input autocomplete="off" name="noofdaysfrom" maxlength="2" id="noofdaysfrom" class="form-control" onkeyup="return kp_numeric(event);" type="text" placeholder="From" value="<?php echo (int) $leadDetail['DaysCountFrom'] > 0 ? (int) $leadDetail['DaysCountFrom'] : ''; ?>">
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="no-margin">
                        <input autocomplete="off" name="noofdaysto" maxlength="2" id="noofdaysto" class="form-control" onkeyup="return kp_numeric(event);" type="text" placeholder="To" value="<?php echo $leadDetail['DaysCountTo'] > 0 ? $leadDetail['DaysCountTo'] : ''; ?>">
                    </div>
                </div>
            </div>


        </div>
        <div class="cl" style="clear:both;"></div>
        <div class="col-md-3">
            <div class="form-group">
                <label><strong>Travelers</strong></label>
                <?php echo $this->partial('package/travelers_form.phtml', array('flexiPackageList' => $this->leadDetail, 'searchPage' => true)); ?>
                <input type="hidden" name="roominfojson" id="roominfojson" value="">

            </div>
        </div>
        <div class="col-md-3">
            <div class="form-group">
                <label><strong>Price Range</strong></label>

                <select id="search_price_range" name="search_price_range" class="demo-default select-country" placeholder="Select">
                    <?php
                    foreach ($priceRangeArr as $key => $value) {
                        $selected = ($value[key] == $getpricerange) ? 'selected' : '';
                        echo "<option value='$value[key]' $selected>$value[value]</option>";
                    }
                    ?>
                </select>
            </div>
        </div>
        <div class="col-md-3">
            <div class="form-group">
                <label><strong>Inclusions</strong></label>
                <select id="search_inclusions" name="search_inclusions[]" multiple class="demo-default select-theme">

                    <?php echo '<option value="">Select Inclusions</option>';
                    for ($i = 0; $i < count($packageInclusionList); $i++) {
                    ?>
                        <option value="<?php echo $i ?>" <?php if (@$InclMaskArr[$i + 1] == 1) { ?> selected="selected" <?php } else {
                                                                                                                    }
                                                                                                                        ?>><?php echo $packageInclusionList[$i]['Title'] ?></option>
                    <?php } ?>
                </select>

            </div>
        </div>
        <div class="col-md-3">
            <div class="form-group">
                <label><strong>Theme</strong></label>
                <select id="search_theme" name="search_theme[]" multiple class="demo-default select-theme">
                    <?php echo '<option value="">Select Theme</option>';
                    for ($i = 0; $i < count($packageThemeList); $i++) {
                    ?>
                        <option value="<?php echo $i; ?>" <?php if (@$PackTypeMaskArr[$i + 1] == 1) { ?> selected="selected" <?php } else {
                                                                                                                            }
                                                                                                                                ?>><?php echo $packageThemeList[$i]['Title'] ?></option>
                    <?php } ?>
                </select>
            </div>
        </div>

        <div class="col-md-4" style="display:none;">
            <div class="form-group">
                <label><strong>Multiple Destination</strong></label>

                <input autocomplete="off" name="multicities" id="multicities" class="form-control" type="text" placeholder="City Name" value="<?php echo isset($leadDetail['Cities']) ? $leadDetail['Cities'] : ''; ?>">
                <input type="hidden" id="search_multi_from" name="search_multi_from" value="<?php //echo @$searchResult['search_going_to'];   
                                                                                            ?>" />

            </div>
        </div>

        <div class="col-md-3">
            <div class="col-md-12 pull-left">
                <div class="form-group">
                    <?php
                    $hotelpreferenceExplode = array();
                    $hotelpreference = $leadDetail['HotelPreference'];
                    if (isset($hotelpreference) && !empty($hotelpreference)) {
                        $hotelpreferenceExplode = explode(',', $hotelpreference);
                    }
                    ?>
                    <label><strong>Hotel Preference : </strong></label>
                    <div class="cl"></div>
                    <label>1 <input type="checkbox" class="icheck-black" name="hotelpreference[]" value="1" <?php
                                                                                                            if (in_array(1, $hotelpreferenceExplode)) {
                                                                                                                echo "checked";
                                                                                                            }
                                                                                                            ?> /></label> &nbsp;
                    <label>2 <input type="checkbox" class="icheck-black" name="hotelpreference[]" value="2" <?php
                                                                                                            if (in_array(2, $hotelpreferenceExplode)) {
                                                                                                                echo "checked";
                                                                                                            }
                                                                                                            ?> /></label> &nbsp;
                    <label>3 <input type="checkbox" class="icheck-black" name="hotelpreference[]" value="3" <?php
                                                                                                            if (in_array(3, $hotelpreferenceExplode)) {
                                                                                                                echo "checked";
                                                                                                            }
                                                                                                            ?> /></label> &nbsp;
                    <label>4 <input type="checkbox" class="icheck-black" name="hotelpreference[]" value="4" <?php
                                                                                                            if (in_array(4, $hotelpreferenceExplode)) {
                                                                                                                echo "checked";
                                                                                                            }
                                                                                                            ?> /></label> &nbsp;
                    <label>5 <input type="checkbox" class="icheck-black" name="hotelpreference[]" value="5" <?php
                                                                                                            if (in_array(5, $hotelpreferenceExplode)) {
                                                                                                                echo "checked";
                                                                                                            }
                                                                                                            ?> /></label>
                </div>
            </div>
        </div>
        <div class="col-md-3">
            <div class="form-group">
                <label><strong>Food Preference</strong></label>
                <select id="search_food" name="search_food[]" multiple class="demo-default select-theme">
                    <?php echo '<option value="">Select Food Preference</option>';
                    for ($i = 0; $i < count($foodPreferenceList); $i++) {
                    ?>
                        <option value="<?php echo $i; ?>" <?php if (@$FoodTypeMaskArr[$i + 1] == 1) { ?> selected="selected" <?php } else {
                                                                                                                            }
                                                                                                                                ?>><?php echo $foodPreferenceList[$i]['Title'] ?></option>
                    <?php } ?>
                </select>
            </div>
        </div>
        <div class="col-md-3">
            <div class="form-group">
                <label><strong>Lead Source</strong></label>
                <select id="lead_source" name="lead_source" class="demo-default select-country">
                    <option value="">Change Source</option>
                    <?php
                    if (count($this->getleadSource)) {
                        foreach ($this->getleadSource as $sourcekey => $sourcevalue) {
                            $selected = (($leadDetail['lead_source'] == $sourcevalue['LeadSourceSysId']) || ($sourcevalue['LeadSourceSysId'] == $this->lead_source)) ? 'selected' : '';
                    ?>
                            <option value="<?php echo $sourcevalue['LeadSourceSysId'] ?>" <?php echo $selected; ?>><?php echo $sourcevalue['Title'] ?></option>
                    <?php }
                    }
                    ?>
                </select>
            </div>
        </div>
        <div class="col-md-3">
            <div class="form-group">
                <label><strong>Add Remark</strong></label>
                <textarea autocomplete="off" name="leadRemark" id="leadRemark" class="form-control" type="text" placeholder="Add Remark" value=""><?php echo trim(stripslashes($leadDetail['leadRemark'])); ?></textarea>

            </div>
        </div>
        <div class="col-md-12">
            <img class="loaderimg" style="display:none;" id="loaderimg" src="<?php echo $this->baseUrl('public/assets/images/loader.gif'); ?>" />
            <?php
            $displaySaveButton = '';
            $displayOtherButton = 'none';
            if ($this->IsFromModified == true) {
                $displaySaveButton = 'none';
                $displayOtherButton = '';
            }
            if ($customerId == '') {
                $displaySaveButton = 'none';
                $displayOtherButton = '';
            }
            //if ($leadID != "" || @$leadDetail['TPSysId'] != '') {
            ?>



            <!--                <label><input type="checkbox" id="createNewQuery" <?php if (@$leadDetail['StatusType'] > 1) { ?> readonly="true" checked="checked" onclick="return false;" <?php } ?> name="createNewQuery" value="<?php echo $leadID; ?>" /> <strong>Create a New Query : </strong>
                    <input type="hidden"  name="NewQueryLeadHiddenId" id ="NewQueryLeadHiddenId" value="<?php echo $leadID ? $leadID : $leadDetail['TPSysId']; ?>" />
                </label>-->



            <?php
            //  }
            if (isset($leadDetail['search_specific_date'])) {
                $suppdate = $leadDetail['search_specific_date'];
            } else {

                $suppdate = '';
            }

            $leadIDExist = $leadID ? base64_encode($leadID) : base64_encode($leadDetail['TPSysId']);
            ?>




            <!--<a onclick="SavePkgLead();" id="pkgSaveButton" class="btn btn btn-warning btn-sm ladda-button saveButton" style="display:<?php // echo $displaySaveButton; 
                                                                                                                                            ?>;">Save &amp; Continue</a>-->


            <input type="hidden" name="encodedHiddenId" id="encodedHiddenId" value="<?php echo $leadID ? base64_encode($leadID) : base64_encode($leadDetail['TPSysId']); ?>" />
            <input type="hidden" name="additionalRequirement" id="additionalRequirementPkg" value="<?php echo isset($leadDetail['additionalRequirement']) ? $leadDetail['additionalRequirement'] : ''; ?>" />
            <?php if ($this->IsFromModified == false) { ?>

            <?php } ?>
            <div class="row">
                <div class=" <?php if ($this->IsFromModified == true) { ?> col-md-3 <?php } else { ?> col-md-12 <?php } ?> col-xs-12 changemodifyclass">
                    <?php
                    if ($leadID != "" || @$leadDetail['TPSysId'] != '') {
                    ?>



                        <label><input type="checkbox" id="createNewQuery" <?php if (@$leadDetail['StatusType'] > 1) { ?> readonly="true" checked="checked" onclick="return false;" <?php } ?> name="createNewQuery" value="<?php echo $leadID; ?>" /> <strong>Create New Query</strong>
                            <input type="hidden" name="NewQueryLeadHiddenId" id="NewQueryLeadHiddenId" value="<?php echo $leadID ? $leadID : $leadDetail['TPSysId']; ?>" />
                        </label>



                    <?php
                    }
                    if ($this->IsFromModified == true) { ?>
                        <a onclick="SavePkgQuery();" class="btn btn btn-default btn-sm ladda-button">Modify &amp; Save</a>
                    <?php } else { ?>
                        <a onclick="SavePkgLead();" id="pkgSaveButton" class="btn btn btn-sm ladda-button pull-right btn-warning btn-sm saveButton" style="display:<?php echo $displaySaveButton; ?>;">Save &amp; Continue</a>
                    <?php } ?>
                </div>
                <div class="col-md-3 col-xs-12">
                    <a href="<?php echo $this->baseUrl('package'); ?>" target="_blank" class="btn btn btn-default btn-sm ladda-button buildYourOwnButton" style="display:<?php echo $displayOtherButton; ?>;">Build Master</a>
                    <a href="<?php echo $this->baseUrl('packagesearch/enquirysupplierpackage/tpid/' . $leadIDExist); ?>" target="_blank" class="btn btn btn-default btn-sm ladda-button buildYourOwnButton sendEnquiryToSupplierButton" style="display:<?php echo $displayOtherButton; ?>;">Contact Suppliers</a>

                </div>
                <div class="col-md-3 col-xs-12">
                    <a href="<?php echo $this->baseUrl('packagesearch/buildquickpackage' . $qidLink . '/code/' . $secureCode); ?>" id="testActionQuickPackage" target="_blank" class="btn btn btn-default btn-sm ladda-button" style="display:<?php echo $displayOtherButton; ?>;">Create Quick Package</a>
                    <a target="_blank" class="btn btn btn-default btn-sm ladda-button builddynamicquickpackagebutton" id="testActionQuickProPackage" href="<?php echo $this->baseUrl('build-your-own/index/index' . $qidLink . '/code/' . $secureCode) ?>" style="display:<?php echo $displayOtherButton; ?>;">Build Pro Package</a>
                    <span id="buildquickpackagebutton"></span>

                </div>
                <div class="col-md-3 col-xs-12">
                    <a href="<?php echo $this->baseUrl('packagesearch/quick-package-listing' . $qidLink . '/code/' . $secureCode); ?>" id="testActionQuickPackageListing" target="_blank" class="btn btn btn-default btn-sm ladda-button fixsearchQuickPackagebun" style="display:<?php echo $displayOtherButton; ?>;">Search Quick Packages</a>
                    <span id="buildquickpackagebutton1"></span>
                    <a onclick="formSubmit();" id="pkgSearchButton" class="btn btn btn-warning btn-sm ladda-button searchpackageButton" style="display:<?php echo $displayOtherButton; ?>;">Search Master/Network</a>
                </div>



            </div>
        </div>
        <div class="col-md-12" align="right">
            <div class="clear"></div>
        </div>
    </form>
    <div class="clear"></div>
    <div class="clear"></div>

</div>

<!--<script type="text/javascript" src="<?php // echo $this->baseUrl('public/js/packagetravelerformfunctions.js');   
                                        ?>"></script>-->
<script type="text/javascript">
    var secureCode = '<?php echo $secureCode; ?>';
    $(document).ready(function() {
        other_loc_city_multiautosuggest('search_going');
    });

    function other_loc_city_multiautosuggest(inputId) {
        $("#" + inputId).selectize({
            onInitialize: function() {
                var existingOptions = JSON.parse(this.$input.attr('data-selectize-values'));
                //console.log(existingOptions);
                var self = this;
                if (Object.prototype.toString.call(existingOptions) === "[object Array]") {
                    existingOptions.forEach(function(existingOption) {
                        self.addOption(existingOption);
                        self.addItem(existingOption[self.settings.valueField]);
                    });
                } else if (typeof existingOptions === 'object') {
                    self.addOption(existingOptions);
                    self.addItem(existingOptions[self.settings.valueField]);
                }
            },
            preload: true,
            //options: [],
            openOnFocus: false,
            valueField: 'CityId',
            labelField: 'Title',
            searchField: 'Title',
            create: false,
            render: {
                option: function(item, escape) {
                    return '<div>' + escape(item.Title) + '</div>';
                }
            },
            load: function(query, callback) {
                var countryId = $("#hidden_selected_country_id").val();
                $.ajax({
                    url: '/buyhotel/autosuggest-for-package',
                    //                            url: '/general/suggest-multi-city-other',
                    type: 'post',
                    data: {
                        query: query,
                        countryId: countryId
                    },
                    dataType: 'json',
                    success: function(result) {

                        console.log(result);
                        callback(result);
                    }
                });
            },
        });
    }




    function operationalPackageForm() {
        var TPSysId = $("#encodedHiddenId").val();
        //alert(TPSysId);
        $.ajax({
            url: '/operation/update-travelplan-for-operational',
            // data: {search_going_to:search_going_to,search_price_range:search_price_range,search_inclusions:search_inclusions,search_theme:search_theme,number_of_traveler:number_of_traveler,customerID:customerID,search_specific_date:search_specific_date,TPSysId:TPSysId,itenaryID:itenaryID,roominfojson:roominfojson},
            data: {
                'TPSysId': TPSysId
            },
            method: 'POST',
            dataType: 'json',
            error: function(err) {
                //  alert(err);
            },
            beforeSend: function() {
                $(".createOperationButton").attr('disabled', true);
            },
            success: function(response) {
                if (response.status == 'success') {
                    $(".createOperationButton").removeAttr('disabled');
                    //window.location = '/operation/package-required/';  
                    window.location = '/packagesearch/enquirysupplierpackage/type/operation/tpid/' + TPSysId;
                }
            }
        });
    }
    $().ready(function() {
        $("#search_specific_date").datetimepicker({
            format: 'd/m/Y',
            timepicker: false,
            minDate: 0
        });
    });

    function formSubmit() {
        $('#search_going_to_city').val('');
        $('#search_going_to_id').val('');
        $(".otherlocationcity div[id^='mpkgId']").each(function(i) {
            var pkg = $(this).attr('pkg').split("(");
            var desId = $(this).attr('data-value');
            if (i == 0) {
                $('#search_going_to').val($(this).attr('data-value') + '__' + pkg[0]);
            }
            var search_going_to_city = $('#search_going_to_city').val();
            var search_going_to_id = $('#search_going_to_id').val();
            if (search_going_to_city == '') {
                $('#search_going_to_city').val(pkg[0]);
            } else {
                $('#search_going_to_city').val(search_going_to_city + ',' + pkg[0]);
            }
            if (search_going_to_id == '') {
                $('#search_going_to_id').val(desId);
            } else {
                $('#search_going_to_id').val(search_going_to_id + ',' + desId);
            }
        })
        var modify_goingfrom = $.trim($("#modify_goingfrom").val());
        var modify_goingto = $.trim($("#modify_goingto").val());
        var modify_pricerange = $.trim($("#modify_pricerange").val());
        var modify_inclusions = $.trim($("#modify_inclusions").val());
        var modify_theme = $.trim($("#modify_theme").val());
        var modify_food = $.trim($("#modify_food").val());
        var modify_hotelpreference = $.trim($("#modify_hotelpreference").val());
        var modify_specificdate = $.trim($("#modify_specificdate").val());
        var modify_totaltravelers = $.trim($("#modify_totaltravelers").val());

        var original_goingfrom = $.trim($("#search_going_f").val());
        var original_goingto = $.trim($("#search_going").val());
        var original_pricerange = $.trim($("#search_price_range").val());
        var original_inclusions = $.trim($("#search_inclusions").val());
        var original_theme = $.trim($("#search_theme").val());
        var original_food = $.trim($("#search_food").val());
        var original_specificdate = $.trim($("#search_specific_date").val());
        var original_totaltravelers = $.trim($("#totaltravelers").val());

        var hotelpreferenceArray = [];
        $('input[name="hotelpreference[]"]:checked').each(function() {
            hotelpreferenceArray.push(this.value);
        });
        var original_hotelpreference = hotelpreferenceArray.join(",");
        //alert(hotelpreferenceCommasArray);
        //alert(original_inclusions+"/"+original_inclusions);
        //return false;

        //check date is expired or not
        var expireDateStr = $("#search_specific_date").val();
        var expireDateArr = expireDateStr.split("/");
        expiredMonth = 0;
        if (parseInt(expireDateArr[1]) > 0) {
            expiredMonth = parseInt(expireDateArr[1]) - 1;
        }
        //alert(expireDateArr[2]+'-'+expireDateArr[1]+'-'+expireDateArr[0]);
        var expireDate = new Date(parseInt(expireDateArr[2]), expiredMonth, parseInt(expireDateArr[0]));

        var now = new Date(),
            nowYear = now.getFullYear(),
            nowMo = now.getMonth(), // for getMonth(), January is 0
            nowDay = now.getDate();
        var todayDate = new Date(nowYear, nowMo, nowDay);
        //alert(todayDate+'/'+expireDate);
        if (todayDate > expireDate) {
            alert('Travel date is expired, please select date to create new query!');
            $("#search_specific_date").focus();
            return false;
        };
        //#end


        //alert(modify_inclusions +'='+ original_inclusions);
        //return false;
        var customerId = $("#customerID").val();
        if (customerId != '' && modify_goingto != '') {
            if ((modify_goingfrom != original_goingfrom) || (modify_goingto != original_goingto) || (modify_pricerange != original_pricerange) || (modify_inclusions != original_inclusions) || (modify_theme != original_theme) || (modify_food != original_food) || (modify_hotelpreference != original_hotelpreference) || (modify_specificdate != original_specificdate) || (modify_totaltravelers != original_totaltravelers)) {

                if ($("#createNewQuery").prop('checked') == true) {
                    if (confirm('New query shall be created for the customer as you have changed the search/query criteria!')) {
                        $("#isFromSearchResult").val(0);
                        $("#TPSysId").val('');
                        $("#modify_TPSysId").val('');
                        $("#sendpropform_isFromSearchResult").val(1);
                    }
                } else {
                    //   $("#isFromSearchResult").val(0);
                    //   $("#TPSysId").val('');
                    //   $("#modify_TPSysId").val('');
                    //   $("#sendpropform_isFromSearchResult").val(1);
                }


                //alert(5);
            }
        }



        var PackageSearchFormData = $('#PackageSearchForm').serialize();
        var is_currentowner = $("#currentOwner").prop("checked");
        var currentOwnerSysId = $.trim($("#currentOwner").val());
        if (is_currentowner == true) {
            var currentOwnerSysId = '';
        }
        $.ajax({
            url: '/customer/savepackagequery',
            // data: {search_going_to:search_going_to,search_price_range:search_price_range,search_inclusions:search_inclusions,search_theme:search_theme,number_of_traveler:number_of_traveler,customerID:customerID,search_specific_date:search_specific_date,TPSysId:TPSysId,itenaryID:itenaryID,roominfojson:roominfojson},
            data: PackageSearchFormData + '&currentOwnerSysId=' + currentOwnerSysId,
            method: 'POST',
            dataType: 'json',
            error: function(err) {
                //  alert(err);
            },
            beforeSend: function() {
                //alert(555);
                $('.loaderimg').show();
            },
            success: function(response) {
                $('.loaderimg').hide();
                if (!response.success) {
                    alert(response.msg);

                    $(".alert-danger,#testActionQuickPackage,#testActionQuickPackageListing,#testActionQuickProPackage").css("display", "block");
                    $("#errorMessage").html(response.msg);
                } else {
                    $("#TPSysId").val(response.lastID);
                    $("#secureCode").val(response.code);
                    var PackageSearchFormData = $('#PackageSearchForm').serialize();
                    $.ajax({
                        url: '/packagesearch/packagesearch-result',
                        data: PackageSearchFormData,
                        method: 'POST',
                        dataType: 'json',
                        error: function(err) {
                            //  alert(err);
                        },
                        beforeSend: function() {
                            $('#loaderimg').css('display', 'inline-block');
                            $("#errorMessage2").html('');
                        },
                        success: function(response) {
                            //                    alert(response);
                            //return false;
                            if (response.status === 1) {
                                $('#searchMessage').html('');
                                $("#errorMessage2").html('');
                                $('#jsId').css('display', 'none');
                                  window.location = '/packagesearch/search-result';
                            } else {
                                $(".alert-danger").css("display", "block");
                                $("#errorMessage").html('');
                                var tpId = $("#TPSysId").val();
                                $("#errorMessage2").html('No packages found, please try some other criteria. You can also  <a href="<?php echo $this->baseUrl('packagesearch/buildquickpackage/qid/'); ?>' + tpId + '/code/' + response.code + '" target="_blank" style="text-decoration: underline;">CLICK HERE </a> to create quick package or  <a  href="<?php echo $this->baseUrl('packagesearch/enquirysupplierpackage/tpid/'); ?>' + response.lastencodeID + '" target="_blank" style="text-decoration: underline;cursor:pointer;">CLICK HERE </a> to send ENQUIRY to SUPPLIERS.');
                                $('#home').html('<div class="alert alert-danger">No result found</div>');
                                $("#TPSysId").val('');
                            }
                            $('#loaderimg').css('display', 'none');
                            //console.log(location.href+'/id/'+response.id);                
                            // var newURL = location.href + '/id/' + response.id;
                            //  window.history.pushState("object or string", "Title", newURL);                   
                            // alert(response);
                        }
                    });
                }
            }
        });
    }


    function SavePkgQuery() {
        $('#search_going_to_city').val('');
        $('#search_going_to_id').val('');
        $(".otherlocationcity div[id^='mpkgId']").each(function(i) {
            var pkg = $(this).attr('pkg').split("(");
            var desId = $(this).attr('data-value');
            if (i == 0) {
                $('#search_going_to').val($(this).attr('data-value') + '__' + pkg[0]);
            }
            var search_going_to_city = $('#search_going_to_city').val();
            var search_going_to_id = $('#search_going_to_id').val();
            if (search_going_to_city == '') {
                $('#search_going_to_city').val(pkg[0]);
            } else {
                $('#search_going_to_city').val(search_going_to_city + ',' + pkg[0]);
            }
            if (search_going_to_id == '') {
                $('#search_going_to_id').val(desId);
            } else {
                $('#search_going_to_id').val(search_going_to_id + ',' + desId);
            }
        })
        var is_visa = $("#checkRed1").prop("checked");
        var is_forex = $("#checkRed2").prop("checked");
        var is_insurance = $("#checkRed3").prop("checked");
        if (is_visa == true) {
            var visaval = '1';
        } else {
            var visaval = '0';
        }
        if (is_forex == true) {
            var forexval = '1';
        } else {
            var forexval = '0';
        }
        if (is_insurance == true) {
            var insureval = '1';
        } else {
            var insureval = '0';
        }

        var addrequirement = visaval + forexval + insureval;
        $("#additionalRequirementPkg").val(addrequirement);
        var search_going_from = $('#search_going_from').val();
        var search_going_to = $("#search_going_to").val();
        var specific_date = $("#search_specific_date").val();
        if (search_going_to == '') {
            alert('please enter going to.');
            $("#search_going").focus();
            return false;
        }
        if (specific_date == '') {
            alert('please enter specific date.');
            $("#search_specific_date").focus();
            return false;
        }
        //$('#TPSysId').val(''); 
        var PackageSearchFormData = $('#PackageSearchForm').serialize();
        var is_currentowner = $("#currentOwner").prop("checked");
        var currentOwnerSysId = $.trim($("#currentOwner").val());
        if (is_currentowner == true) {
            var currentOwnerSysId = '';
        }

        var PKqueryType = $("input[name='queryType']:checked").val();
        $.ajax({
            url: '/customer/savepackagequery',
            // data: {search_going_to:search_going_to,search_price_range:search_price_range,search_inclusions:search_inclusions,search_theme:search_theme,number_of_traveler:number_of_traveler,customerID:customerID,search_specific_date:search_specific_date,TPSysId:TPSysId,itenaryID:itenaryID,roominfojson:roominfojson},
            data: PackageSearchFormData + '&currentOwnerSysId=' + currentOwnerSysId + '&PKqueryType=' + PKqueryType,
            method: 'POST',
            dataType: 'json',
            error: function(err) {
                //  alert(err);
            },
            beforeSend: function() {
                $('#loaderimg').css('display', 'inline-block');
                $("#pkgSaveButton").attr('disabled', true);
                $("#pkgSaveButton").removeClass('btn-warning');
                $("#pkgSaveButton").removeClass('btn-danger');

            },
            success: function(response) {
                //console.log(response);
                $('#loaderimg').css('display', 'none');
                $("#pkgSaveButton").removeAttr('disabled');
                if (!response.success) {
                    alert('Some Error Occured');
                } else {
                    var msg = response.msg;
                    alert("Query Updated Successfully");
                    $(".saveButton").html('Modify & Save');
                    $("#TPSysId").val(response.lastID);
                    $('#encodedHiddenId').val(response.lastencodeID);
                    $(".sendEnquiryToSupplierButton").attr('href', '/packagesearch/enquirysupplierpackage/tpid/' + response.lastencodeID);
                    $(".buildYourOwnButton").show();
                    if (PKqueryType === '0') {
                        $(".searchpackageButton").show();
                        $(".createOperationButton").show();
                    }
                    //                else{
                    //                    $('#buildquickpackagebutton').show();
                    //                    $('#buildquickpackagebutton').html('<a class="btn btn btn-warning btn-sm ladda-button buildquickpackagebutton" href="<?php echo $this->baseUrl('packagesearch/buildquickpackage/qid/') ?>'+response.lastID+'">Build A Quick Package</a>');
                    //                }
                    $('#buildquickpackagebutton').show();
                    $('#buildquickpackagebutton1').show();
                    $('#buildquickpackagebutton').html('<a  target="_blank" class="btn btn btn-default btn-sm ladda-button buildquickpackagebutton" href="<?php echo $this->baseUrl('packagesearch/buildquickpackage/qid/') ?>' + response.lastID + '/code/' + response.code + '">Create Quick Package</a>&nbsp;<a  target="_blank" class="btn btn btn-default btn-sm ladda-button builddynamicquickpackagebutton" href="<?php echo $this->baseUrl('build-your-own/index/index/qid/') ?>' + response.lastID + '/code/' + response.code + '">Build Pro Package</a>');
                    $('#buildquickpackagebutton1').html('<a  target="_blank" class="btn btn btn-default btn-sm ladda-button buildquickpackagebutton" href="<?php echo $this->baseUrl('packagesearch/quick-package-listing/qid/') ?>' + response.lastID + '/code/' + response.code + '">Search Quick Package</a>');
                    $('#testActionQuickPackage,#testActionQuickPackageListing,#testActionQuickProPackage').hide();
                    if (PKqueryType === '1') {
                        $('.alert-danger').hide();
                        $('.forgroupdiv').show();
                    } else {
                        $('.forgroupdiv').hide();
                    }
                }
            }
        });
    }

    function SavePkgLead() {
        $('#search_going_to_city').val('');
        $('#search_going_to_id').val('');
        $(".otherlocationcity div[id^='mpkgId']").each(function(i) {
            var pkg = $(this).attr('pkg').split("(");
            var desId = $(this).attr('data-value');
            if (i == 0) {
                $('#search_going_to').val($(this).attr('data-value') + '__' + pkg[0]);
            }
            var search_going_to_city = $('#search_going_to_city').val();
            var search_going_to_id = $('#search_going_to_id').val();
            if (search_going_to_city == '') {
                $('#search_going_to_city').val(pkg[0]);
            } else {
                $('#search_going_to_city').val(search_going_to_city + ',' + pkg[0]);
            }
            if (search_going_to_id == '') {
                $('#search_going_to_id').val(desId);
            } else {
                $('#search_going_to_id').val(search_going_to_id + ',' + desId);
            }
        })
        var is_visa = $("#checkRed1").prop("checked");
        var is_forex = $("#checkRed2").prop("checked");
        var is_insurance = $("#checkRed3").prop("checked");
        if (is_visa == true) {
            var visaval = '1';
        } else {
            var visaval = '0';
        }
        if (is_forex == true) {
            var forexval = '1';
        } else {
            var forexval = '0';
        }
        if (is_insurance == true) {
            var insureval = '1';
        } else {
            var insureval = '0';
        }

        var addrequirement = visaval + forexval + insureval;
        $("#additionalRequirementPkg").val(addrequirement);
        var search_going_from = $('#search_going_from').val();
        var search_going_to = $("#search_going_to").val();
        var specific_date = $("#search_specific_date").val();
        if (search_going_to == '') {
            alert('please enter going to.');
            $("#search_going").focus();
            return false;
        }
        if (specific_date == '') {
            alert('please enter specific date.');
            $("#search_specific_date").focus();
            return false;
        }
        $('#TPSysId').val('');
        var PackageSearchFormData = $('#PackageSearchForm').serialize();
        var is_currentowner = $("#currentOwner").prop("checked");
        var currentOwnerSysId = $.trim($("#currentOwner").val());
        if (is_currentowner == true) {
            var currentOwnerSysId = '';
        }

        var PKqueryType = $("input[name='queryType']:checked").val();
        $.ajax({
            url: '/customer/savepackagelead',
            // data: {search_going_to:search_going_to,search_price_range:search_price_range,search_inclusions:search_inclusions,search_theme:search_theme,number_of_traveler:number_of_traveler,customerID:customerID,search_specific_date:search_specific_date,TPSysId:TPSysId,itenaryID:itenaryID,roominfojson:roominfojson},
            data: PackageSearchFormData + '&currentOwnerSysId=' + currentOwnerSysId + '&PKqueryType=' + PKqueryType,
            method: 'POST',
            dataType: 'json',
            error: function(err) {
                //  alert(err);
            },
            beforeSend: function() {
                $('#loaderimg').css('display', 'inline-block');
                $("#pkgSaveButton").attr('disabled', true);
                $("#pkgSaveButton").removeClass('btn-warning').addClass("btn-default");
                $("#pkgSaveButton").removeClass('btn-danger');

            },
            success: function(response) {
                //console.log(response);
                $('#loaderimg').css('display', 'none');
                $("#pkgSaveButton").removeAttr('disabled');
                if (!response.success) {
                    alert('Some Error Occured');
                } else {
                    var msg = response.msg;
                    alert(msg);
                    $(".changemodifyclass").removeClass("col-md-12").addClass("col-md-3");
                    $(".saveButton").html('Modify & Save');
                    $(".saveButton").removeAttr('onclick').attr('onclick', 'SavePkgQuery()');
                    $("#TPSysId").val(response.lastID);
                    $('#encodedHiddenId').val(response.lastencodeID);
                    $(".sendEnquiryToSupplierButton").attr('href', '/packagesearch/enquirysupplierpackage/tpid/' + response.lastencodeID);
                    $(".buildYourOwnButton").show();
                    if (PKqueryType === '0') {
                        $(".searchpackageButton").show();
                        $(".createOperationButton").show();
                    }
                    //                else{
                    //                    $('#buildquickpackagebutton').show();
                    //                    $('#buildquickpackagebutton').html('<a class="btn btn btn-warning btn-sm ladda-button buildquickpackagebutton" href="<?php echo $this->baseUrl('packagesearch/buildquickpackage/qid/') ?>'+response.lastID+'">Build A Quick Package</a>');
                    //                }
                    $('#buildquickpackagebutton').show();
                    $('#buildquickpackagebutton1').show();
                    $('#buildquickpackagebutton').html('<a  target="_blank" class="btn btn btn-default btn-sm ladda-button buildquickpackagebutton" href="<?php echo $this->baseUrl('packagesearch/buildquickpackage/qid/') ?>' + response.lastID + '/code/' + response.code + '">Build Quick Package</a>&nbsp;<a  target="_blank" class="btn btn btn-default btn-sm ladda-button builddynamicquickpackagebutton" href="<?php echo $this->baseUrl('build-your-own/index/index/qid/') ?>' + response.lastID + '/code/' + response.code + '">Build Pro Package</a>');
                    $('#buildquickpackagebutton1').html('<a  target="_blank" class="btn btn btn-default btn-sm ladda-button buildquickpackagebutton" href="<?php echo $this->baseUrl('packagesearch/quick-package-listing/qid/') ?>' + response.lastID + '/code/' + response.code + '">Search Quick Package</a>');
                    $('#testActionQuickPackage,#testActionQuickPackageListing,#testActionQuickProPackage').hide();
                    if (PKqueryType === '1') {
                        $('.alert-danger').hide();
                        $('.forgroupdiv').show();
                    } else {
                        $('.forgroupdiv').hide();
                    }
                }
            }
        });
    }


    function BulidPkg() {
        var PackageSearchFormData = $('#PackageSearchForm').serialize();
        var is_currentowner = $("#currentOwner").prop("checked");
        var currentOwnerSysId = $.trim($("#currentOwner").val());
        if (is_currentowner == true) {
            var currentOwnerSysId = '';
        }
        $.ajax({
            url: '/customer/savepackagequerybyo',
            data: PackageSearchFormData + '&currentOwnerSysId=' + currentOwnerSysId,
            method: 'POST',
            dataType: 'json',
            error: function(err) {
                //  alert(err);
            },
            beforeSend: function() {
                $('#loaderimg').css('display', 'inline-block');
            },
            success: function(response) {
                if (!response.success) {
                    //alert(response.msg);
                    $(".alert-danger").css("display", "block");
                    $("#errorMessage").html(response.msg);
                } else {
                    $.ajax({
                        url: '/package/add-customer-package/id/' + response.lastID,
                        data: PackageSearchFormData + '&currentOwnerSysId=' + currentOwnerSysId,
                        method: 'POST',
                        dataType: 'json',
                        error: function(err) {
                            //  alert(err);
                        },
                        beforeSend: function() {
                            $('#loaderimg').css('display', 'inline-block');
                        },
                    });
                    window.location = '/package/add-customer-package/id/' + response.lastID;
                }
            }
        });
    }


    function getCityListF() {
        //$('#search_going_to').val('');

        $("input[name=search_going]").autocomplete({
            source: "/register/autosuggest-city",
            minLength: 3,
            focus: function(event, ui) {
                event.preventDefault();
                $("#tags").val(ui.item.label);
            },
            select: function(event, ui) {
                event.preventDefault();
                $("input[name=search_going]").val(ui.item.label);
                $("#search_going_to").val(ui.item.value + '__' + ui.item.label).trigger('change');
                $("#dispErrMessage").html('');
                $(".alert-danger").css("display", "none");

            }
        });

    }

    /* Code For  Multiple Auto Complete */
    $(function() {
        var categories = [];

        function split(val) {
            return val.split(/,\s*/);
        }

        function extractLast(term) {
            return split(term).pop();
        }

        $("#multicities").bind("keydown", function(event) {
                if (event.keyCode === $.ui.keyCode.TAB &&
                    $(this).autocomplete("instance").menu.active) {
                    event.preventDefault();
                }
            })
            .autocomplete({
                minLength: 1,
                source: function(request, response) {
                    // delegate back to autocomplete, but extract the last term
                    $.getJSON("/register/autosuggest-city", {
                        term: extractLast(request.term)
                    }, response);
                },
                focus: function() {
                    // prevent value inserted on focus
                    return false;
                },
                select: function(event, ui) {
                    var terms = split(this.value);
                    categories.push(ui.item.value);
                    $("#search_multi_from").val(categories);
                    // remove the current input
                    terms.pop();
                    // add the selected item
                    terms.push(ui.item.label);
                    // add placeholder to get the comma-and-space at the end
                    terms.push("");

                    this.value = terms.join(", ");

                    return false;
                }
            });




    });


    // end : Code is added by Er Amit Kumar Dubey on 10 April 2017

    //     function addroom() 
    //     {
    //        var roomlp = $("#roomlp").val();
    //        var showroom = parseInt(roomlp) + 1;
    //        $("#roomlp").val(showroom);
    //        $("#rmres_" + showroom).show();
    //     }
    //	function delroom(id) {
    //		var showroom = parseInt(id)-1;
    //		$("#roomlp").val(showroom);
    //		$("#rmres_" + id).hide();
    //	}
    //    function showchildagebox(id) {
    //		$('.extrabedcl').show();
    //        var childrencount = $("#child_" + id).val();
    //        var j;
    //        for (j = 1; j <= childrencount; j++) {
    //            $("#child_" + id + "_" + j).show();
    //            $("#childclage"+ id ).show();
    //        }
    //		if(childrencount == 0){
    //			$('.extrabedcl').hide();
    //			$('.childclage').hide();
    //		}
    //		
    //    }
    function tottraveller() {
        var totaladult = '0';
        var totalchild = '0';
        var totalinfant = '0';
        var Group = $('.Group').is(":checked");
        var roomlp = $("#roomlp").val();
        if (Group === true) {
            var adult_1 = $("#adult_1").val();
            var child_1 = $("#child_1").val();
            if (adult_1 === '') {
                alert('Please enter total adults');
                $("#adult_1").focus();
                return false;
            }
            if (child_1 === '') {
                alert('Please enter total children');
                $("#child_1").focus();
                return false;
            }

        }

        var childrenbed = [];
        for (j = 1; j <= roomlp; j++) {
            totaladult = parseFloat(totaladult) + parseFloat($("#adult_" + j).val());
            totalchild = parseFloat(totalchild) + parseFloat($("#child_" + j).val());
            totalinfant = parseFloat(totalinfant) + parseFloat($("#infant_" + j).val());
            var extraBed = $('#extrabed_' + j + ':checked').val();
            childrenbed.push(extraBed);
        }
        var totaltraveller = parseInt(totaladult) + parseInt(totalchild) + parseInt(totalinfant);
        var MaxPax = parseInt(roomlp) * 4;
        if (Group === false) {
            if (totaltraveller > MaxPax) {
                alert('Only 4 pax are allowed in each room. Please modify travelers');
                return false;
            }
        }
        $("#totadlt").val(totaladult);
        $("#totchld").val(totalchild);
        $("#totinfnt").val(totalchild);
        $("#travelers").html(totaltraveller);
        $("#totaltravelers").val(totaltraveller);
        $(".roomBoxMain").hide();
        var roominfojson = '[{"totalRoom" : ' + roomlp + '},{"totalTraveler" : ' + totaltraveller + '},{"totaladult" : ' + totaladult + '},{"totalchild" : ' + totalchild + '},{"totalinfant" : ' + totalinfant + '}]'
        $("#roominfojson").val(roominfojson);
        $(".roomBoxMain").hide();
    }
</script>

Youez - 2016 - github.com/yon3zu
LinuXploit