-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·63 lines (57 loc) · 1.84 KB
/
index.php
File metadata and controls
executable file
·63 lines (57 loc) · 1.84 KB
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
<?php
$ip = $_SERVER['REMOTE_ADDR'];
if(filter_var($ip,FILTER_VALIDATE_IP,FILTER_FLAG_IPV4)){
$json = file_get_contents('http://ipinfo.io/'.$ip.'/region');
$obj = json_decode($json);
$state = $obj;
}
else{
$state = "California";
}
include 'includes/header.php';
?>
<div class="zip-container">
<p> “I support a pathway to citizenship because I don't believe we should have a second class of citizens.” - Don Younge Texas Representative Wall Street Journal</p>
<h1>Where does your representative stand on immigration reform?</h1>
<form class="form-inline" method="GET">
<div class="form-group">
<input type="text" name="zip" class="input-lg form-control" placeholder="Enter your zip code"/>
</div>
<button type="button" class="btn btn-primary btn-lg">Submit</button>
</form>
</div>
<div class="container reps-list" >
<div class="row" id="reps-list">
</div>
</div>
<script type="text/template" id="rep-template">
<div class="thumbnail">
<div class="clip">
<img src="https://s3.amazonaws.com/push4reform/<%- bioguide_id %>.jpg" />
</div>
<div class="caption">
<div class="img-circle <%- rating.substr(0, 1).toLowerCase() %> grade"><span><%- rating %></span></div>
<h1><%- firstname + ' ' + lastname %></h1>
<h2><%- party + ' ' + title %></h2>
<h3><%- state %></h3>
<a href="member/<%- firstname + '-' + lastname%>" class="btn btn-primary btn-lg btn-block">Contact</a>
</div>
</div>
</script>
<?php
include 'includes/footer.php';
?>
<script src="js/main.js"></script>
<script>
<?php if(isset($_GET["zip"])){?>
var reps = new RepList("<?=$_GET['zip']?>", true);
<?php } else { ?>
var reps = new RepList("<?=$state?>");
<?php } ?>
var p = reps.fetch();
p.done(function(){
new window.RepListView(reps)
});
</script>
</body>
</html>