-
Notifications
You must be signed in to change notification settings - Fork 1
/
single_org.php
executable file
·59 lines (50 loc) · 1.47 KB
/
single_org.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
<?php
namespace greenbase;
include_once 'Database.php';
include_once 'Organization.php';
include_once 'Event.php';
include 'get_config.php';
if (!isset($_GET["org_id"])) {
echo "USAGE (for test): single_org.php?org_id=x where x is your org id";
return;
}
$org_id = $_GET['org_id'];
$con = Database::getDefaultDBConnection();
$org = Organization::getOrg($org_id, $con);
if (is_null($org)) {
echo "NULL ORG";
return;
}
$events = Event::getEventsForOrg($org_id, $con);
?>
<img alt="<?php echo(htmlspecialchars($org->name)); ?> Logo" src="<?php echo Config::$greenbase_root ?>/localimage.php?org_id=<?php echo ($org_id);?>">
<p ><?php echo (htmlspecialchars($org->name)); ?> (founded <?php echo($org->founding_year); ?>)</p>
<p><a href="<?php echo ($org->website);?>"><?php echo ($org->website);?></a></p>
<p>Address:</p>
<p>
<?php echo (htmlspecialchars($org->address));?><br>
<?php echo (htmlspecialchars($org->city));?>, <?php echo ($org->state);?><br>
<?php echo ($org->phone);?>
</p>
<p>
</p>
<blockquote>
<?php echo(htmlspecialchars($org->headline)); ?>
</blockquote>
<div>
<h2>Organization detailed description</h2>
<?php echo (htmlspecialchars($org->description)); ?>
</div>
<div class="twitter-feed">
<?php
if (!is_null($events)) {
foreach ($events as $event) {
$event->printSimpleEventBlock();
echo ("<br>");
}
}
?>
</div>
<?php
$con->close();
?>