<style>
#infowindow-content .title {
  font-weight: bold;
}

#infowindow-content {
  display: none;
}

#map #infowindow-content {
  display: inline;
}

.pac-card {
  background-color: #fff;
  border: 0;
  border-radius: 2px;
  box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.3);
  margin: 10px;
  padding: 0 0.5em;
  font: 400 18px Roboto, Arial, sans-serif;
  overflow: hidden;
  font-family: Roboto;
  padding: 0;
}

#pac-container {
  padding-bottom: 12px;
  margin-right: 12px;
}

.pac-controls {
  display: inline-block;
  padding: 5px 11px;
}

.pac-controls label {
  font-family: Roboto;
  font-size: 13px;
  font-weight: 300;
}

#pac-input {
  background-color: #fff;
  font-family: Roboto;
  font-size: 15px;
  font-weight: 300;
/*  margin-left: 12px;*/
  padding: 0 11px 0 13px;
  text-overflow: ellipsis;
/*  width: 400px;*/
}

#pac-input:focus {
  border-color: #4d90fe;
}

#title {
  color: #fff;
  background-color: #4d90fe;
  font-size: 25px;
  font-weight: 500;
  padding: 6px 12px;
}

    
</style>
<?php
$get_weak = [];
if (isset($cabfare_details['week_days']) && $cabfare_details['week_days'] != '') {
    $get_weak = explode(',', $cabfare_details['week_days']);
}
?>

<section class="content">
    <div class="row">
        <div class="col-sm-12">
            <div class="tabbable">
                <div class="tab-content no-border padding-24">
                    <div class="tab-pane fade in active" id="faq-tab-1">
                        <div class="space-8"></div>
                        <div class="panel-group accordion-style1 accordion-style2" id="faq-list-1">
                            <div class="panel panel-default">
                                <div class="panel-headingnew">General Information</div>
                                <div class="left_panel col-sm-12 padding_margin0 pull-left bg-white" id="add_detail">
                                    <ul class="nav nav-tabs nav-tabs1 tab_ul col-sm-2 paddig-right0 margin-top15px">
                                        <?php echo $this->partial('menu.phtml'); ?>
                                    </ul>

                                   <div class="tab-content tab_editprofile col-sm-10 padding-left0 marginbott10px margintop10px">

           <div id="term-policies" class="tab-pane fade tab_editprofile1 active in">
     
     <div class="col-sm-col-sm-offset-1 margin-10auto0 paddingRL10px">
        
          <div class="row">
    
    	<div class="col-sm-12" id="tabstrip-left-5" role="tabpanel" aria-expanded="true">
            
                            <fieldset class="">
                            <legend>General Information</legend>
                                    <?php
                                    $form = $this->form;
                                    $form->prepare();
                                    $form->setAttribute('action', $this->url('sightseeing', ['action' => 'general-information']));
                                    $form->setAttribute('method', 'post');
                                    $form->setAttribute('id', 'add-sightseeing-form');
                                    echo $this->form()->openTag($form);
                                    ?>

                                                              
                                                         
                                            <div class="form-group clearfix margintopbottom20">


                                                                    <div class="form-group clearfix margintopbottom20">

                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" > <?php echo $this->translate($this->formLabel($form->get('city_search'))); ?></label>
                                                                        <div class="col-sm-3 col-sm-4-new">
                                                                            <?php echo $this->FormElement($form->get('city_search')); ?>
                                                                    <?php echo $this->FormElement($form->get('city_search_id')); ?>
                                                                            <?php echo $this->formElementErrors($form->get('city_search'), ['class' => 'error']); ?>
                                                                        </div>

                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" ><?php echo $this->translate($this->formLabel($form->get('sightseeing_name'))); ?></label>
                                                                        <div class="col-sm-3 col-sm-4-new">

                                                                            <?php echo $this->FormElement($form->get('sightseeing_name')); ?>
                                                                            <?php echo $this->formElementErrors($form->get('sightseeing_name'), ['class' => 'error']); ?>
                                                                        </div>

                                                                    </div>

<div class="form-group clearfix margintopbottom20">
    
    <label class="col-sm-3 control-label labelalign col-sm-3-new" ><?php echo $this->translate($this->formLabel($form->get('address'))); ?></label>
        <div class="col-sm-9 col-xs-9">
            <?php echo $this->FormElement($form->get('address')); ?>
            <?php echo $this->formElementErrors($form->get('address'), ['class' => 'error']); ?>
            <br>
           
        </div>
</div>
                                                
                                                
                                                <div class="form-group clearfix margintopbottom20" style="margin-top:-15px;">

    <label class="col-sm-3 control-label labelalign col-sm-3-new" > <?php echo $this->translate($this->formLabel($form->get('latitude'))); ?> </label>
    <div class="col-sm-3 col-sm-4-new">
        <?php echo $this->FormElement($form->get('latitude')); ?>
        <?php echo $this->formElementErrors($form->get('latitude'), ['class' => 'error']); ?>

    </div>
    
    
    
    <div class="pac-card" id="pac-card">
                            <div style="display:none;">
                    <div id="title">Autocomplete Search</div>
                    <div id="type-selector" class="pac-controls">
             <input type="radio" name="type" id="changetype-all" checked="checked" />
                    <label for="changetype-all">All</label>

                    <input type="radio" name="type" id="changetype-establishment" />
                    <label for="changetype-establishment">establishment</label>

                    <input type="radio" name="type" id="changetype-address" />
                    <label for="changetype-address">address</label>

                    <input type="radio" name="type" id="changetype-geocode" />
                    <label for="changetype-geocode">geocode</label>

                    <input type="radio" name="type" id="changetype-cities" />
                    <label for="changetype-cities">(cities)</label>

                    <input type="radio" name="type" id="changetype-regions" />
                    <label for="changetype-regions">(regions)</label>
                    </div>
                    <br />
                    <div id="strict-bounds-selector" class="pac-controls">
                    <input type="checkbox" id="use-location-bias" value="" checked />
                    <label for="use-location-bias">Bias to map viewport</label>

                    <input type="checkbox" id="use-strict-bounds" value="" />
                    <label for="use-strict-bounds">Strict bounds</label>
                    </div>
                    </div>
                            <div id="pac-container" style="display:none">
                    <input id="pac-input" type="text" placeholder="Enter a location" />
                    </div>
                    </div>
                    <div id="map"></div>
                    <div id="infowindow-content">
                    <span id="place-name" class="title"></span><br />
                    <span id="place-address"></span>
                    </div>
   


</div>
                                                
<div class="form-group clearfix margintopbottom20" style="margin-top:-266px;">

<label class="col-sm-3 control-label labelalign col-sm-3-new" ><?php echo $this->translate($this->formLabel($form->get('longitude'))); ?></label>
<div class="col-sm-3 col-sm-4-new">
<?php echo $this->FormElement($form->get('longitude')); ?>
<?php echo $this->formElementErrors($form->get('longitude'), ['class' => 'error']); ?>
</div>           

</div>
                                                
<div class="form-group clearfix margintopbottom20">

<div class="col-sm-3">
<label class="booking-check"> <?php echo $this->translate($this->formLabel($form->get('is_unique'))); ?>
<?php echo $this->FormElement($form->get('is_unique')); ?>
<span class="checkmark"></span>
</label>

</div>


</div>
                                                


    <div class="form-group clearfix margintopbottom20">

        

         <label class="col-sm-3 control-label labelalign col-sm-3-new" ><?php echo $this->translate($this->formLabel($form->get('languages'))); ?> </label>
        <div class="col-sm-3 col-sm-4-new">
            <?php echo $this->formElement($form->get('languages')); ?>
            <?php echo $this->formElementErrors($form->get('languages'), ['class' => 'error']); ?>
        </div>

    </div>




<div class="form-group clearfix margintopbottom20">
    <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport"><?php echo $this->translate($this->formLabel($form->get('category'))); ?></label>
    <div class="col-sm-3 col-sm-4-new">
        <?php echo $this->formElement($form->get('category')); ?>
        <?php echo $this->formElementErrors($form->get('category'), ['class' => 'error']); ?>

    </div>

</div>
<div class="form-group clearfix margintopbottom20">

   <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport"><?php echo $this->translate($this->formLabel($form->get('Sightseeing_type'))); ?></label>
<div class="col-sm-3 col-sm-4-new">
<?php echo $this->formElement($form->get('Sightseeing_type')); ?>
<?php echo $this->formElementErrors($form->get('Sightseeing_type'), ['class' => 'error']); ?>

</div> 

</div>          
                                                
<div class="form-group clearfix margintopbottom20">
    <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport"><?php echo $this->translate($this->formLabel($form->get('coverage_kilometre'))); ?></label>
    <div class="col-sm-3 col-sm-4-new">
        <?php echo $this->formElement($form->get('coverage_kilometre')); ?>
        <?php echo $this->formElementErrors($form->get('coverage_kilometre'), ['class' => 'error']); ?>

    </div>
<label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport"><?php echo $this->translate($this->formLabel($form->get('coverage_hours'))); ?></label>
    <div class="col-sm-3 col-sm-4-new">
        <?php echo $this->formElement($form->get('coverage_hours')); ?>
        <?php echo $this->formElementErrors($form->get('coverage_hours'), ['class' => 'error']); ?>

    </div>
</div>
                                                                    

<div class="form-group clearfix margintopbottom20">


    <label class="col-sm-3 control-label labelalign col-sm-3-new"><?php echo $this->translate($this->formLabel($form->get('difficulty_level'))); ?></label>
    <div class="col-sm-3 col-sm-4-new">
        <?php echo $this->formElement($form->get('difficulty_level')); ?>
        <?php echo $this->formElementErrors($form->get('difficulty_level'), ['class' => 'error']); ?>
    </div>

                                                                            <label class="col-sm-3 control-label labelalign col-sm-3-new" ><?php echo $this->translate($this->formLabel($form->get('season'))); ?> </label>
    <div class="col-sm-3 col-sm-4-new">
        <?php echo $this->formElement($form->get('season')); ?>
        <?php echo $this->formElementErrors($form->get('season'), ['class' => 'error']); ?>
    </div>

</div>

                                                                    


<div class="form-group clearfix margintopbottom20">
    <label class="col-sm-3 control-label labelalign col-sm-3-new" ><?php echo $this->translate($this->formLabel($form->get('popularity'))); ?></label>
    <div class="col-sm-3 col-sm-4-new">
        <?php echo $this->formElement($form->get('popularity')); ?>
        <?php echo $this->formElementErrors($form->get('popularity'), ['class' => 'error']); ?>
    </div>

    <label class="col-sm-3 control-label labelalign col-sm-3-new"> <?php echo $this->translate($this->formLabel($form->get('things_to_carry'))); ?></label>
    <div class="col-sm-3 col-sm-4-new">
        <?php echo $this->formElement($form->get('things_to_carry')); ?>

        <?php echo $this->formElementErrors($form->get('things_to_carry'), ['class' => 'error']); ?>
    </div>

</div>



                                                                    

<div class="form-group clearfix margintopbottom20">
    <label class="col-sm-3 control-label labelalign col-sm-3-new"><?php echo $this->translate($this->formLabel($form->get('youtube_url'))); ?></label>
    <div class="col-sm-3 col-sm-4-new">
        <?php echo $this->formElement($form->get('youtube_url')); ?>
        <?php echo $this->formElementErrors($form->get('youtube_url'), ['class' => 'error']); ?>
    </div>
                                                                             <label class="col-sm-3 control-label labelalign col-sm-3-new"> <?php echo $this->translate($this->formLabel($form->get('sightseeing_cover'))); ?></label>
    <div class="col-sm-3 col-sm-4-new">
        <?php echo $this->formElement($form->get('sightseeing_cover')); ?>

        <?php echo $this->formElementErrors($form->get('sightseeing_cover'), ['class' => 'error']); ?>
    </div>

</div>
                                                
                                                
<div class="form-group clearfix margintopbottom20">
    <label class="col-sm-3 control-label labelalign col-sm-3-new"><?php echo $this->translate($this->formLabel($form->get('meeting_point'))); ?></label>
    <div class="col-sm-3 col-sm-4-new">
        <?php echo $this->formElement($form->get('meeting_point')); ?>
        <?php echo $this->formElementErrors($form->get('meeting_point'), ['class' => 'error']); ?>
    </div>
                                                                             
</div>
                                                
<div class="form-group clearfix margintopbottom20">


</div>

                                                                   

                                                                    <div class="form-group clearfix margintopbottom20">
                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new"><?php echo $this->translate($this->formLabel($form->get('about_sightseeing'))); ?></label>
                                                                        <div class="col-sm-9">
                                                                            <?php echo $this->formElement($form->get('about_sightseeing')); ?>
                                                                            <?php echo $this->formElementErrors($form->get('about_sightseeing'), ['class' => 'error']); ?>
                                                                        </div>


                                                                    </div>
                            
                            <div class="form-group clearfix margintopbottom20">
                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new"><?php echo $this->translate($this->formLabel($form->get('highlights'))); ?></label>
                                                                        <div class="col-sm-9">
                                                                            <?php echo $this->formElement($form->get('highlights')); ?>
                                                                            <?php echo $this->formElementErrors($form->get('highlights'), ['class' => 'error']); ?>
                                                                        </div>


                                                                    </div>
                                                              

</fieldset>
                        
                                            
                        </div>
                                  
          
            <div class="form-group clearfix margintopbottom20">
                                   <label class="col-sm-3 control-label labelalign col-sm-3-new" id="">  </label>
                                    <div class="col-sm-4 col-sm-4-new">
                                    	
                                      </div>
                                  
                                     <label class="col-sm-3 control-label labelalign col-sm-3-new" id="update_profiel"></label>
                                    <div class="col-sm-3 col-sm-4-new " align="right">
                                      
<a class="reset_btn btn btn-success btn-new-vehile" href="#">
<i class="fa fa-retweet"></i>
Reset
</a>
 <?php echo $this->FormElement($form->get('Submit')); ?></div>

                                        <?php echo $this->form()->closeTag(); ?>
                                     

                                    </div>
                                  </div>
                                </div>
                                
           </div>
           
           </div>  
           
           
            </div>

                                   

                                </div>



                            </div>



                        </div>

                    </div>
                </div>
            </div>
        </div>
        <br>

    </div>
</section>
<?php echo $this->inlineScript()->appendFile($this->basePath('/js/tinymce/tinymce.min.js')); ?>

    <script src="<?php echo $google_map_url; ?>?key=<?php echo $google_map_key; ?>&callback=initMap&libraries=places&v=weekly" async defer></script>
    
    <script type="text/javascript">

function initMap() {
//    var latitude = parseFloat(document.getElementById("latitude").value);
//    alert(latitude);
//    if(latitude=='NaN'){
//        alert(1);
//        latitude = 40.749933;
//    }
//    var longitude = parseFloat(document.getElementById("longitude").value);
//    if(longitude==""){
//        longitude = -73.98633;
//    }
//    alert(latitude);
  const map = new google.maps.Map(document.getElementById("map"), {
    center: { lat: 40.749933, lng: -73.98633 },
    //center: { lat: latitude, lng: longitude },
    zoom: 13,
    mapTypeControl: false,
  });
  const card = document.getElementById("pac-card");
  const input = document.getElementById("pac-input");
  const biasInputElement = document.getElementById("use-location-bias");
  const strictBoundsInputElement = document.getElementById("use-strict-bounds");
  const options = {
    fields: ["formatted_address", "geometry", "name"],
    strictBounds: false,
    types: ["establishment"],
  };

  map.controls[google.maps.ControlPosition.TOP_LEFT].push(card);

  const autocomplete = new google.maps.places.Autocomplete(input, options);

  // Bind the map's bounds (viewport) property to the autocomplete object,
  // so that the autocomplete requests use the current map bounds for the
  // bounds option in the request.
  autocomplete.bindTo("bounds", map);

  const infowindow = new google.maps.InfoWindow();
  const infowindowContent = document.getElementById("infowindow-content");

  infowindow.setContent(infowindowContent);

  const marker = new google.maps.Marker({
    map,
    anchorPoint: new google.maps.Point(0, -29),
  });

  autocomplete.addListener("place_changed", () => {
    infowindow.close();
    marker.setVisible(false);

    const place = autocomplete.getPlace();

    if (!place.geometry || !place.geometry.location) {
      // User entered the name of a Place that was not suggested and
      // pressed the Enter key, or the Place Details request failed.
      window.alert("No details available for input: '" + place.name + "'");
      return;
    }

    // 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);
    }

    marker.setPosition(place.geometry.location);
    marker.setVisible(true);
    infowindowContent.children["place-name"].textContent = place.name;
    infowindowContent.children["place-address"].textContent =
      place.formatted_address;
    infowindow.open(map, marker);
    
  });

  // Sets a listener on a radio button to change the filter type on Places
  // Autocomplete.
  function setupClickListener(id, types) {
    const radioButton = document.getElementById(id);

    radioButton.addEventListener("click", () => {
      autocomplete.setTypes(types);
      input.value = "";
    });
  }

  setupClickListener("changetype-all", []);
  setupClickListener("changetype-address", ["address"]);
  setupClickListener("changetype-establishment", ["establishment"]);
  setupClickListener("changetype-geocode", ["geocode"]);
  setupClickListener("changetype-cities", ["(cities)"]);
  setupClickListener("changetype-regions", ["(regions)"]);
  biasInputElement.addEventListener("change", () => {
    if (biasInputElement.checked) {
      autocomplete.bindTo("bounds", map);
    } else {
      // User wants to turn off location bias, so three things need to happen:
      // 1. Unbind from map
      // 2. Reset the bounds to whole world
      // 3. Uncheck the strict bounds checkbox UI (which also disables strict bounds)
      autocomplete.unbind("bounds");
      autocomplete.setBounds({ east: 180, west: -180, north: 90, south: -90 });
      strictBoundsInputElement.checked = biasInputElement.checked;
    }

    input.value = "";
  });
  strictBoundsInputElement.addEventListener("change", () => {
    autocomplete.setOptions({
      strictBounds: strictBoundsInputElement.checked,
    });
    if (strictBoundsInputElement.checked) {
      biasInputElement.checked = strictBoundsInputElement.checked;
      autocomplete.bindTo("bounds", map);
    }

    input.value = "";
    
  });
  
  google.maps.event.addListener(map, 'click', function(event) {
    document.getElementById('latitude').value = event.latLng.lat();
    document.getElementById('longitude').value =  event.latLng.lng();    
  });
}

window.initMap = initMap;
    
    </script>