-
Notifications
You must be signed in to change notification settings - Fork 1
/
report.php
executable file
·146 lines (106 loc) · 2.85 KB
/
report.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
// BUILD REPORT
// build raw string
$raw = '';
$raw .= '<style>
#header_logo {
position:relative;
top:10px;
left:25px;
width:125px;
// height:70px;
padding-top:0px;
padding-left:0px;
}
#header_title {
position:fixed;
top:20px;
left:0;
width:100%;
height:70px;
border-bottom: 1px solid black;
text-align: center;
font-size: 30px;
line-height: 70px;
}
#map {
margin-top: 50px;
margin-bottom: 20px;
}
#map, #map img {
text-align: center;
}
#layers {
font-size: 10px;
display:inline;
}
#scale {}
.scale_item {
border-left: 1px solid black;
border-right: 1px solid black;
}
#legend {
font-size: 10px;
}
.field {
font-size: 12px;
margin: 20px;
}
#license, #license p, #license p a {
font-size: 8px
}
#footer {
border-top: 1px solid black;
margin-top:20px;
padding: 10px;
text-align: center;
font-size: 10px;
}
</style>';
// add header
// $raw .= '<div id="header">';
$raw .= '<div id="header_logo"><img src="usr/imgs/aiddata_logo.png"></div>';
$raw .= '<div id="header_title">Mapping Portal</div>';
// $raw .= '</div>';
// add map image
$raw .= '<div id="map"><img height="500px" src="'.$TEMP_DIR.'/'.$TEMP_URL.'.jpg'.'"/></div>';
// $raw .= '<div id="scale">';
// foreach ($_POST['scale'] as $scale) {
// $raw .= '<div class="scale_item" style="width:'.$scale[2].'">'.$scale[1].' '.$scale[0].'</div';
// }
// $raw .= '</div>';
// add legend if it exists
// if ( count($_POST['legend']) > 0 ) {
// $raw .= '<div id="legend"><b>Active Legend ('.$_POST['active'].'): </b>';
// $raw .= '<ul>';
// foreach ($_POST['legend'] as $legend_item) {
// $raw .= '<li style="color:'.$legend_item[1].'">'.$legend_item[0].'</li>';
// }
// $raw .= '</ul>';
// $raw .= '</div>';
// }
// add active layers
$raw .= '<div class="field"><b>Layers: </b>';
$c = 0;
foreach ($_POST['layers'] as $active_layer) {
if ($c != 0) {
$raw .= ', ';
}
$raw .= $active_layer;
$c+=1;
}
$raw .= '</div>';
// add center coordinates
$raw .= '<div class="field"><b>Map Center: </b>['.$_POST['centerlng'].', '.$_POST['centerlat'].']</div>';
// add link
$raw .= '<div class="field"><b>Map Link: </b><a href="'.$_POST['link'].'">'.$_POST['link'].'</a></div>';
// add export date
$raw .= '<div class="field"><b>Report Generated On: </b>'.date('m/d/Y').'</div>';
$license_text = '<p></p>';
$footer_text = '<p>Report generated by <a href=".">Mapping Portal</a>.</p>
<p>To learn more visit <a href="http://www.aiddata.org">aiddata.org</a></p>';
// add license info
$raw .= '<div id="license">'.$license_text.'</div>';
// add footer
$raw .= '<div id="footer">'.$footer_text.'</div>';
?>