-
Notifications
You must be signed in to change notification settings - Fork 1
/
home.php
123 lines (106 loc) · 2.93 KB
/
home.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
<?php
require 'includes/header.php';
$template = new Smarty;
$browser_title = 'Virginia Businesses';
/*
* Query our API for recent businesses
*/
$api_url = API_URL . '/api/recent';
$recent_json = get_content($api_url);
$recent = json_decode($recent_json);
if (!$recent !== FALSE)
{
$page_body .= '
<article class="container">
<h2>Newest Businesses</h2>';
$i=3;
if (count($recent) > 9)
{
$recent = array_slice($recent, 0, 9);
}
foreach ($recent as $business)
{
if ( ($i % 3) == 0 )
{
$page_body .= '<div class="row">';
}
$page_body .= '
<div class="card small">
<h3><a href="/business/' . $business->EntityID . '">' . $business->Name . '</a></h3>
<p>';
if (!empty($business->City))
{
$page_body .= $business->City . ', ' . $business->State . '<br>';
}
$page_body .= date('M d, Y', strtotime($business->IncorpDate)) . '</p>
</div>';
if ( ($i % 3) == 2 )
{
$page_body .= '</div>';
}
$i++;
}
$page_body .= '</article>';
}
$page_body .= '
<article>
<table>
<caption>Download Business Data</caption>
<thead>
<tr>
<th scope="col">File</th>
<th scope="col">Size</th>
</tr>
</thead>
<tbody>
<tr>
<td data-label="File"><a href="data/amendment.csv">Entity Amendments</a></td>
<td data-label="Size">6 MB</td>
</tr>
<tr>
<td data-label="File"><a href="data/corp.csv">Corporate Entities</a></td>
<td data-label="Size">87 MB</td>
</tr>
<tr>
<td data-label="File"><a href="data/llc.csv">LLC Entities</a></td>
<td data-label="Size">156 MB</td>
</tr>
<tr>
<td data-label="File"><a href="data/lp.csv">LP Entities</a></td>
<td data-label="Size">3 MB</td>
</tr>
<tr>
<td data-label="File"><a href="data/merger.csv">Entity Mergers</a></td>
<td data-label="Size">3 MB</td>
</tr>
<tr>
<td data-label="File"><a href="data/name.history.csv">Entity Name/Fictitious Name History</a></td>
<td data-label="Size">16 MB</td>
</tr>
<tr>
<td data-label="File"><a href="data/officer.csv">Entity Officers/Directors</a></td>
<td data-label="Size">29 MB</td>
</tr>
<tr>
<td data-label="File"><a href="data/reserved.name.csv">Entity Reserved Names</a></td>
<td data-label="Size">0.1 MB</td>
</tr>
<tr>
<td data-label="File"><a href="data/tables.csv">Descriptive Tables</a></td>
<td data-label="Size">0.1 MB</td>
</tr>
<tr>
<td data-label="File"><a href="http://scc.virginia.gov/clk/data/CISbemon.CSV.zip">All Data, CSV</a></td>
<td data-label="Size">77 MB</td>
</tr>
<tr>
<td data-label="File"><a href="data/vabusinesses.sqlite">All Data, SQLite</a></td>
<td data-label="Size">321 MB</td>
</tr>
</tbody>
</table>
</article>';
$template->assign('page_body', $page_body);
$template->assign('page_title', $page_title);
$template->assign('browser_title', $browser_title);
$template->display('includes/templates/simple.tpl');