-
Notifications
You must be signed in to change notification settings - Fork 0
/
dpa-bootstrap.php
89 lines (86 loc) · 2.8 KB
/
dpa-bootstrap.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
<?php
require_once 'dpa-api.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DPA Bootstrap</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap -->
<link href="assets/css/bootstrap.css" rel="stylesheet" media="screen">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row-fluid">
<div class="span8">
<table class="table table-striped table-hover">
<caption>División Político Administrativa</caption>
<thead>
<tr>
<th>Nro</th>
<th>Región</th>
<th>Provincias</th>
<th>Comunas</th>
<th>Mapa</th>
</tr>
</thead>
<tbody>
<?php
$objDPA = new DPA();
$aData = array('limit' => 0, 'offset' => 0, 'geolocation' => TRUE, 'callback' => '');
$aRegiones = $objDPA->Regiones($aData);
foreach ($aRegiones as $r){
?>
<tr>
<td><?php echo $r->codigo ?></td>
<td><?php echo $r->nombre ?></td>
<td>
<ul>
<?php
$aData['codigo'] = $r->codigo;
$aProvincias = $objDPA->RegionProvincias($aData);
foreach ($aProvincias as $p) {
?>
<li><?php echo $p->nombre ?></li>
<?php
}
?>
</ul>
</td>
<td>
<ul>
<?php
$aComunas = $objDPA->RegionComunas($aData);
$markers = '';
foreach ($aComunas as $c) {
?>
<li><?php echo $c->nombre; ?></li>
<?php
$markers .= '|'.$c->lat.','.$c->lng;
}
?>
</ul>
</td>
<td>
<?php
$zoom = 7;
if($r->codigo == 13)
$zoom = 9;
?>
<img src="http://maps.googleapis.com/maps/api/staticmap?size=400x400&markers=size:tiny%7Ccolor:blue%7Clabel:C%7C<?php echo $markers ?>&sensor=false" class="img-polaroid visible-desktop">
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
</body>
</html>