-
Notifications
You must be signed in to change notification settings - Fork 4
/
data.php
60 lines (56 loc) · 2.1 KB
/
data.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
<?php
$title = "Daftar SMA Negeri";
include_once "header.php";
include_once "koneksi.php"; ?>
<div class="row">
<div class="col-md-12">
<div class="panel panel-info panel-dashboard">
<div class="panel-heading centered">
<h2 class="panel-title"><strong> - <?php echo $title ?> - </strong></h2>
</div>
<div class="panel-body">
<table class="table table-bordered table-striped table-admin">
<thead>
<tr>
<th width="10%">No.</th>
<th width="30%">Nama Sekolah</th>
<th width="10%">NPSN</th>
<th width="13%">Alamat</th>
<th width="20%">Website</th>
<th width="27%">Aksi</th>
</tr>
</thead>
<tbody>
<?php
$data = file_get_contents('http://localhost:8080/sistem-geo/ambildata.php');
$no=1;
if(json_decode($data,true)){
$obj = json_decode($data);
foreach($obj->results as $item){
?>
<tr>
<td><?php echo $no; ?></td>
<td><?php echo $item->nama_sekolah; ?></td>
<td><?php echo $item->kategori; ?></td>
<td><?php echo $item->kota; ?></td>
<td><?php echo $item->website; ?></td>
<td class="ctr">
<div class="btn-group">
<a target="_blank" href="detail.php?id=<?php echo $item->id_sekolah; ?>" rel="tooltip" data-original-title="Lihat File" data-placement="top" class="btn btn-primary">
<i class="fa fa-map-marker"> </i> Detail dan Lokasi</a>
</div>
</td>
</tr>
<?php $no++; }}
else{
echo "data tidak ada.";
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include_once "footer.php" ?>