ok

Mini Shell

Direktori : /home2/selectio/public_html/y1jobportal.in/admin/
Upload File :
Current File : /home2/selectio/public_html/y1jobportal.in/admin/location.php

<?php include('header.php');
        $sql="SELECT * FROM `employee` where status = 1";
        $statement = $pdo->prepare($sql);
        $statement->execute();
		$result = $statement->fetchAll(PDO::FETCH_ASSOC);

?>
<script src="https://maps.googleapis.com/maps/api/js?callback=initMap&key=AIzaSyDQ2gj-x1-uJU_lwCQQGlIZUKscFWeOTQg" defer></script>
<style>
    #mapCanvas{
    width: 100%;
    height: 400px;
}
</style>
<div class="page-wrapper">
    <pre></pre>
    <div id="mapCanvas"></div>
</div>

<script>
function initMap() {
    var map;
    var bounds = new google.maps.LatLngBounds();
    var mapOptions = {
        mapTypeId: 'roadmap'
    };
                    
    map = new google.maps.Map(document.getElementById("mapCanvas"), mapOptions);
    map.setTilt(50);
        
    var markers = [
      <?php 
          foreach($result as $e){
              echo "['".$e['first_name']." ".$e['last_name']."', ".$e['latitude'].", ".$e['longitude']."],";
          }
      ?>
      /*  ['test Museum, kY', 40.671349546127146, -73.96375730105808],
        ['Central Library, Brooklyn, NY', 40.67254944015601, -73.9682162170653],
        ['Prospect Park Zoo, NY', 40.66427511834109, -73.96512605857858],
        ['Barclays Center, Brooklyn, NY', 40.68268267107631, -73.97546296241961],*/
    ];
                        
    var infoWindowContent = [
        ['<div class="info_content">' +
        '<h2>Brooklyn Museum</h2>' +
        '<h3>200 Eastern Pkwy, Brooklyn, NY 11238</h3>' +
        '<p>The Brooklyn Museum is an art museum located in the New York City borough of Brooklyn.</p>' + 
        '</div>'],
        ['<div class="info_content">' +
        '<h2>Central Library</h2>' +
        '<h3>10 Grand Army Plaza, Brooklyn, NY 11238</h3>' +
        '<p>The Central Library is the main branch of the Brooklyn Public Library, located at Flatbush Avenue.</p>' +
        '</div>']
    ];
        
    var infoWindow = new google.maps.InfoWindow(), marker, i;
    
    for( i = 0; i < markers.length; i++ ) {
        var position = new google.maps.LatLng(markers[i][1], markers[i][2]);
        bounds.extend(position);
        marker = new google.maps.Marker({
            position: position,
            map: map,
            title: markers[i][0]
        });
        
        // Add info window to marker    
        google.maps.event.addListener(marker, 'click', (function(marker, i) {
            return function() {
                infoWindow.setContent(infoWindowContent[i][0]);
                infoWindow.open(map, marker);
            }
        })(marker, i));

        // Center the map to fit all markers on the screen
        map.fitBounds(bounds);
    }

    // Set zoom level
    var boundsListener = google.maps.event.addListener((map), 'bounds_changed', function(event) {
        this.setZoom(15);
        google.maps.event.removeListener(boundsListener);
    });
}

window.initMap = initMap;
</script>

<?php include('footer.php'); ?>

Zerion Mini Shell 1.0