-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinvestment2.index.php
186 lines (158 loc) · 5.26 KB
/
investment2.index.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<?php
$CD = $_GET['CD'];
$State = $_GET['State'];
//Specify city as the entry point
if ($_GET['City']!='' and $_GET['State']!='') {
$conn = get_db_conn();
$query = 'SELECT CD FROM USCities WHERE City="'.$_GET['City'].'" AND State="'.$_GET['State'].'" LIMIT 1';
$res = @mysql_fetch_assoc(@mysql_query($query, $conn));
$State = $_GET['State'];
$CD = $res['CD'];
} elseif ($_GET['Zipcode']!='') {
$conn = get_db_conn();
$query = 'SELECT CD,State FROM USCities WHERE Zipcode='.intval($_GET['Zipcode']);
$res = @mysql_fetch_assoc(@mysql_query($query, $conn));
$CD = $res['CD'];
$State = $res['State'];
}
?>
<div class="grid_4 spaced-small" >
<div class="ucd-pod ui-corner-all" id="map-inputs" style="height:500px; width: 200px; position: fixed;">
<form>
<h1 class="close-above ">Grants Awarded</h1>
<p class="close-above">Use this map to discover information on Grants that are awarded in your state and congressional district.</p>
<!--
<fieldset>
<p>Select Agency:</p>
<p><input type="radio" name="NIH-NSF" value="NIH" checked /> NIH Total Awards<br/>
<input type="radio" name="NIH-NSF" value="NSF" /> NSF Total Awards</p>
</fieldset>
-->
<fieldset>
<p id="polyselect">United States</p>
</fieldset>
<fieldset>
<div id="topTbl">
<h3><a href="#">Attributes</a></h3>
<div style="padding: 5px">
<fieldset class="dropdown">
<label for="agency"></label>
<select id="agency">
<option value="">NIH/NSF funded</option>
<option value="NIH">NIH funded</option>
<option value="NSF">NSF funded</option>
</select>
</fieldset>
<fieldset>
<p> Year(s): <span class="slider" id="yrRg">2001-2009</span></p>
<div class="slider">
<div class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all" id="yearSlider">
<div class="ui-slider-range ui-widget-header"></div>
<a style="left: 0%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a>
<div class="ui-slider-range ui-widget-header" ></div>
</div>
</div>
</fieldset>
<fieldset>
<p> Amount: <span class="slider" id="amtRg">0.00-130.00</span>m</p>
<div class="slider">
<div class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all" id="amtSlider">
<div class="ui-slider-range ui-widget-header"></div>
<a style="left: 0%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a>
<div class="ui-slider-range ui-widget-header" ></div>
</div>
</div>
</fieldset>
</div>
<h3><a href="#">Top Research Institutions</a></h3>
<div id="sectOrg" class="list"></div>
<h3><a href="#">Top Topics</a></h3>
<div id="sectLabel" class="list"></div>
</div>
</fieldset>
</form>
</div>
</div>
<div class="grid_12 omega spaced-small">
<div style="border:1px solid #ccc;height:500px; margin-bottom:10px;">
<!-- RL ADD START -->
<div id="map"></div>
<!-- RL ADD END -->
</div>
<div style="height:700px" class="dataTables_wrapper" id="example_wrapper"></div>
</div>
<!-- RL EDIT START -->
<script src="js/map_framework_f.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
/* INIT STUFF -- MAY NOT BE ALL NECESSARY NOW */
google.load('maps', '3', { other_params: 'sensor=false' });
google.load("jqueryui", "1.8.4");
var G = google.maps;
var styles = [];
var markerClusterer = null;
var map = null;
var info = null;
var init = true;
var dataB = null;
var prevLine = null;
var kml = null;
var mousey = null;
var ctrl = false;
$(document).ready(function() {
<? require_once("js/map.js"); ?>
//set initial table
$.data($("#map")[0], "params", { table:"grant" });
$.data($("#map")[0], "latlng", null);
$("#yearSlider").slider({
range: true,
values: [2001, 2009],
min: 2001, max: 2009,
slide: function(event, ui) { slideChg("#yrRg", "year", ui, false); },
stop: function(event, ui) { slideChg("#yrRg", "year", ui, true); }
/*
values: [2009],
min: 2000, max: 2009,
slide: function(event, ui) { slideChg("#yrRg", "year", ui); }
*/
});
$("#amtSlider").slider({
range: true,
values: [0, 62],
min: 0, max: 62,
slide: function(event, ui) {
$("#amtRg").html(amtRg(ui));
},
stop: function(event, ui) {
$("#amtRg").html(amtRg(ui));
hoverStats = null;
var attrb = new Object();
attrb["amt"] = $("#amtRg").html();
setVal(attrb);
}
/*
values: [2009],
min: 2000, max: 2009,
slide: function(event, ui) { slideChg("#yrRg", "year", ui); }
*/
});
initializeGeo("#map", false);
<? if ($CD=="") { ?>
setVal({});
<? } else { ?>
setVal({CD:"<?=$CD?>", State:"<?=$State?>"});
<? } ?>
});
function amtRg(ui) {
rg = [];
for(i=0; i<2; i++)
if (ui.values[i] <= 20)
rg.push(((ui.values[i]*50000)/1000000).toFixed(2));
else if (ui.values[i] <= 38)
rg.push((((ui.values[i]-20)*500000+1000000)/1000000).toFixed(2));
else
rg.push((((ui.values[i]-38)*5000000+10000000)/1000000).toFixed(2));
return rg.join("-");
}
</script>
<script src="js/keydragzoom_packed.js" type="text/javascript"></script>
<!-- RL EDIT END -->