-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·213 lines (203 loc) · 5.86 KB
/
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?php
require_once "config.php";
require_once "graphical/header.php";
?>
<h4>Holmes County Human Services</h4>
<p>This is the main search for the Holmes County Human Services. A search will return information across all organizations, locations, and services. You can also browse all three areas by selecting them on the left hand navigation.</p>
<center>
<form method="post" action="/" method="get">
<div class="row uniform">
<div align="center" style="width: 80%">
<center><input type="text" name="query" id="query" value="<?php if(isset($_REQUEST['query'])){ echo $_REQUEST['query']; } ?>" placeholder="Search Keyword or Phrase" style="width: 100%; margin-left: 100px; margin-right: 100px;" /></center>
</div>
<!-- Break -->
<div class="12u$">
<ul class="actions">
<li><input type="submit" value="Search" class="special" /></li>
<li><input type="reset" value="Reset" /></li>
</ul>
</div>
</div>
</form>
</center>
<?php
if(isset($_REQUEST['query']))
{
$query = $_REQUEST['query'];
//echo "query: " . $query . "<br />";
// grab this path
$host = "http://" . $openapi['hsda-search']['host'];
//echo "host: " . $host . "<br />";
// grab this path
$definitions = $openapi['hsda-search']['definitions'];
// organizations
$search_path = '/search/?query=' . $query;
$search_url = $host . $search_path;
//echo "url: " . $search_url . "<br />";
$http = curl_init();
curl_setopt($http, CURLOPT_URL, $search_url);
curl_setopt($http, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($http);
//echo $output;
$http_status = curl_getinfo($http, CURLINFO_HTTP_CODE);
$info = curl_getinfo($http);
$search = json_decode($output);
//var_dump($search);
$organizations = $search->organizations;
?>
<h4>Organizations</h4>
<div class="table-wrapper">
<table class="alt">
<tbody>
<?php
if(count($organizations) > 0)
{
foreach($organizations as $organization)
{
$id = $organization->id;
$name = $organization->name;
$alternate_name = $organization->alternate_name;
$description = $organization->description;
$email = $organization->email;
$url = $organization->url;
$tax_status = $organization->tax_status;
$tax_id = $organization->tax_id;
$year_incorporated = $organization->year_incorporated;
$legal_status = $organization->legal_status;
$contacts = $organization->contacts;
$funding = $organization->funding;
$locations = $organization->locations;
$programs = $organization->programs;
$services = $organization->services;
?>
<tr>
<td><?php echo $name; ?></td>
<td><?php echo $description; ?></td>
<td align="center" valign="middle">
<a href="details.php?id=<?php echo $id; ?>" class="button">View Details</a></li>
</td>
</tr>
<?php
}
}
else
{
?>
<tr>
<td colspan="3" align="center">No Organizations Returned</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php
$locations = $search->locations;
?>
<h4>Locations</h4>
<div class="table-wrapper">
<table class="alt">
<tbody>
<?php
if(count($services) > 0)
{
foreach($locations as $location)
{
$id = $location->id;
$organization_id = $location->organization_id;
$name = $location->name;
$alternate_name = $location->alternate_name;
$description = $location->description;
$transportation = $location->transportation;
$latitude = $location->latitude;
$longitude = $location->longitude;
$regular_schedule = $location->regular_schedule;
$holiday_schedule = $location->holiday_schedule;
$languages = $location->languages;
$postal_address = $location->postal_address;
$physical_address = $location->physical_address;
$phones = $location->phones;
$service = $location->service;
$accessibility_for_disabilities = $location->accessibility_for_disabilities;
?>
<tr>
<td><?php echo $name; ?></td>
<td><?php echo $description; ?></td>
<td align="center" valign="middle">
<a href="details.php?id=<?php echo $id; ?>" class="button">View Details</a>
</td>
</tr>
<?php
}
}
else
{
?>
<tr>
<td colspan="3" align="center">No Locations Returned</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php
$services = $search->services;
?>
<h4>Services</h4>
<div class="table-wrapper">
<table class="alt">
<tbody>
<?php
if(count($services) > 0)
{
foreach($services as $service)
{
$id = $service->id;
$organization_id = $service->organization_id;
$program_id = $service->program_id;
$location_id = $service->location_id;
$name = $service->name;
$alternate_name = $service->alternate_name;
$description = $service->description;
$url = $service->url;
$email = $service->email;
$status = $service->status;
$interpretation_services = $service->interpretation_services;
$application_process = $service->application_process;
$wait_time = $service->wait_time;
$fees = $service->fees;
$accreditations = $service->accreditations;
$licenses = $service->licenses;
?>
<tr>
<td><?php echo $name; ?></td>
<td><?php echo $description; ?></td>
<td align="center" valign="middle">
<a href="/services/details.php?id=<?php echo $id; ?>" class="button">View Details</a>
</td>
</tr>
<?php
}
}
else
{
?>
<tr>
<td colspan="3" align="center">No Services Returned</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<?php
}
?>
<p>Use the left hand navigation to browse organizations, locations, and services. You can also navigate to the developer API for the Holmes County Human Services, as well as the administrative area if you have proper access.</p>
<?php
require_once "graphical/footer.php";
?>