Menampilkan maker dari database

4.I Menampilkan Informasi

4.1.1 Menampilkan Informasi

1.Buatlah database:db_klaten

2.Buatla tabel:lokasi

Dengan strukture seperti seperti bawah :

3.Isikan Data

4.Buatlah koneksi.php

[sourcecode language=”php“]

<?php

mysql_connect(“localhost”,”root”,”1234″);

mysql_select_db(“db_klaten”);

?>

[/sourcecode]

5.Buatlah file:index.php

[sourcecode language=”php“]

<?

// program by Didik nugroho

// for GIS STMIK Sinar Nusantara

// hasil riset mandiri

session_start();

include(‘koneksi.php’);

?>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;

<head>

<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />

<title>SISTEM INFROMASI wisata</title>

<style type=”text/css”>

#halaman { width:980px; margin:0 auto; }

#header { height:100px; padding:10px;

background-color: #9FB5BD;

}

#kiri { padding:10px;background-color:#CCCCCC;float:left;width:250px; margin-top:10px; }

#tengah { height:500px; padding:10px;background-color:#CCCCCC;margin:10px 0px 0 290px; }

#footer { clear:both; height:50px;padding:10px; background-color:#CCCCCC; margin-top:10px;}

#nav {

margin: 0;

padding: 0;

list-style-type: none;

background-color: #663300;

width: 180px;

float: left;

}

#nav li {

margin: 0;

padding: 0;

float:left;

width:100%;

}

#nav a {

display: block; /* untuk memperbesar area klik karena tag a defaultnya inline

*/

color: #FFF;

text-decoration: none;

padding: 0 15px;

line-height: 2;

border-bottom:1px solid #FFF;

}

#nav a:hover {

background: #330000;

}

</style>

</head>

<body>

</div>

</body>

</html>

6.Buatlah file :awal.php

<?

//didhamel dhening :Didik Nugroho

// hasil riset mandiri

// SIG :stmik Sinar Nusantara

// file ini sebagai awal.php

//

include “koneksi.php” ;

?>

http://maps.google.com/maps/api/js?sensor=false&language=id

(function() {

window.onload = function(){

var latLng = new google.maps.LatLng(-7.593279, 110.641836);

var options = {

zoom: 15,

center: latLng,

mapTypeId: google.maps.MapTypeId.ROADMAP

};

var map = new google.maps.Map(document.getElementById(‘tengah’), options);

}

})();

<br />

7.Buatlah file :satu.php

<?

//dhidamel dening :didik nugroho

// hasil riset mandiri

//SIG :stmik Sinar Nusantara

// file ini sebagai awal.php

session_start();

$u=$_SESSION[‘id_nomer’];

?>

http://maps.google.com/maps/api/js?sensor=false&language=id

(function() {

window.onload = function(){

var latLng = new google.maps.LatLng(,);

var options = {

zoom: 18,

center: latLng,

mapTypeId: google.maps.MapTypeId.SATELLITE

};

var map = new google.maps.Map(document.getElementById(‘tengah’), options);

var marker=new google.maps.Marker({

position:latLng,

});

marker.setMap(map);

var infowindow = new google.maps.InfoWindow({

content:””

});

google.maps.event.addListener(marker,’click’,function(){

infowindow.open(map,marker);

});

}

})();

<br />

8.Buatlah file :all.php

<?

//didhamel dhening :Didik Nugroho

//hasil riset mandiri

// SIG :stmik Sinar Nusantara

// file ini sebagai awal.php

//include “koneksi.php” ;

?>

http://maps.google.com/maps/api/js?sensor=false&language=id

(function() {

window.onload = function(){

var latLng = new google.maps.LatLng(-7.60465, 110.64417);

var options = {

zoom: 15,

center: latLng,

mapTypeId: google.maps.MapTypeId.ROADMAP

};

//cetak peta

var map = new google.maps.Map(document.getElementById(‘tengah’), options);

var marker, i;

marker = new google.maps.Marker({position: new google.maps.LatLng(,), map: map, title: ” });

} // window.load

})();//function

<br />

[/sourcecode]

sumber

http://www.4shared.com/file/_dLNj6lkce/Bab_4_Maker__dengan_Database.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: