-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathdetail.php
126 lines (114 loc) · 3.35 KB
/
detail.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?php
$id = $_GET['id'];
include_once "ambildata_id.php";
$obj = json_decode($data);
$titles="";
$ids="";
$kat="";
$web="";
$hp="";
$alamat="";
$kota="";
$prov="";
$lat="";
$long="";
foreach($obj->results as $item){
$titles.=$item->nama_perusahaan;
$ids.=$item->id_perusahaan;
$kat.=$item->kategori;
$web.=$item->website;
$hp.=$item->no_hp;
$alamat.=$item->alamat;
$kota.=$item->kota;
$prov.=$item->provinsi;
$lat.=$item->latitude;
$long.=$item->longitude;
}
$title = "Detail dan Lokasi : ".$titles;
include_once "header.php"; ?>
<script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=AIzaSyAbXF62gVyhJOVkRiTHcVp_BkjPYDQfH5w"></script>
<script>
function initialize() {
var myLatlng = new google.maps.LatLng(<?php echo $lat ?>,<?php echo $long ?>);
var mapOptions = {
zoom: 10,
center: myLatlng
};
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var contentString = '<div id="content">'+
'<div id="siteNotice">'+
'</div>'+
'<h1 id="firstHeading" class="firstHeading"><?php echo $titles ?></h1>'+
'<div id="bodyContent">'+
'<p><?php echo $alamat ?></p>'+
'</div>'+
'</div>';
var infowindow = new google.maps.InfoWindow({
content: contentString
});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Maps Info',
icon:'img/marker.png'
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<div class="row">
<div class="col-md-5">
<div class="panel panel-info panel-dashboard">
<div class="panel-heading centered">
<h2 class="panel-title"><strong> - Lokasi - </strong></h4>
</div>
<div class="panel-body">
<div id="map-canvas" style="width:100%;height:380px;"></div>
</div>
</div>
</div>
<div class="col-md-7">
<div class="panel panel-info panel-dashboard">
<div class="panel-heading centered">
<h2 class="panel-title"><strong> - Detail - </strong></h4>
</div>
<div class="panel-body">
<table class="table">
<tr>
<th>Item</th>
<th>Detail</th>
</tr>
<tr>
<td>Nama Perusahaan</td>
<td><h4><?php echo $titles ?></h4></td>
</tr>
<tr>
<td>Kota</td>
<td><h4><?php echo $kota ?></h4></td>
</tr>
<tr>
<td>Provinsi</td>
<td><h4><?php echo $prov ?></h4></td>
</tr>
<tr>
<td>Alamat</td>
<td><h4><?php echo $alamat ?></h4></td>
</tr>
<tr>
<td>No HP</td>
<td><h4><?php echo $hp ?></h4></td>
</tr>
<tr>
<td>Website</td>
<td><h4><a href="http://<?php echo $web ?>"><?php echo $web ?></a></h4></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include_once "footer.php"; ?>