-
Notifications
You must be signed in to change notification settings - Fork 1
/
staff_list_by_working_group.php
142 lines (128 loc) · 5.36 KB
/
staff_list_by_working_group.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
<?php
$showchildren = "n";
$showsiblings = "n";
$titleoverride = "";
include("./inc/head.php");
$workinggroup = $page->relate_working_group;
?>
<div id="page_body" class="row">
<div class='col-sm-9'>
<h2><?=$page->title; ?></h2>
<span class='bodytext'><?=$page->body; ?> </span>
<?
// The following grabs the working group ID's tied to this page.
$workinggroup = $page->relate_working_group;
// Goes and finds the chairs for the working group
$temp_relate_staff_chair = $pages->get("id=$workinggroup")->relate_staff_chair;
// Goes and finds the coordinator for the working group
$temp_relate_staff_coordinator = $pages->get("id=$workinggroup")->relate_staff_coordinator;
// Goes and finds the members for the working group
$temp_relate_staff = $pages->get("id=$workinggroup")->relate_staff;
?>
<?
// The following finds all of the chairs is tied with, loops through and prints.
$matches = $temp_relate_staff_chair;
foreach($matches as $match) {
$i++; // Increments the key
$temprow = ($i % 2 == 1 ? 'clear-left' : ''); // adds this class to the 3rd
if ($match->image) {
$img_sized = $match->image->size(300);
$tempimg = "<div class='col-sm-4'>
<a href='{$match->url}' class='text-bold thumbnail' title='{$match->title}'>
<img src='{$img_sized->url}' class='img-responsive ' alt='{$match->title} {$img_sized->description}'>
</a>
</div>";
$tempcss = "padding-top-sm"; // This helps push the text down to balance out the position of the text next to the image
}
$tempval .= "<div class='col-sm-6 {$temprow}'>
{$tempimg}
<div class='col-sm-8 $tempcss'>
<a href='{$match->url}' class='text-bold' title='{$match->title}'>{$match->title}</a>
<div class='text-muted text-xs'>{$match->staff_title}</div>
</div>
</div>
";
}
if($tempval) {
$temptitle = $matches->count() == "1" ? "Chair" : 'Chairs'; // This changes the title to account for more than 1 location
echo "<hr /><h3>{$temptitle}</h3>";
echo "<div class='row'>{$tempval}</div>";
unset($tempcss);
unset($temptitle);
unset($tempval);
unset($tempimg);
}
?>
<?
// The following finds all of the coordinator is tied with, loops through and prints.
$matches = $temp_relate_staff_coordinator;
$i = 0; // sets a key valye
foreach($matches as $match) {
$i++; // Increments the key
$temprow = ($i % 2 == 1 ? 'clear-left' : ''); // adds this class to the 3rd
if ($match->image) {
$img_sized = $match->image->size(300);
$tempimg = "<div class='col-sm-4'>
<a href='{$match->url}' class='text-bold thumbnail' title='{$match->title}'>
<img src='{$img_sized->url}' class='img-responsive ' alt='{$match->title} {$img_sized->description}'>
</a>
</div>";
$tempcss = "padding-top-md"; // This helps push the text down to balance out the position of the text next to the image
}
$tempval .= "<div class='col-sm-6 {$temprow}'>
{$tempimg}
<div class='col-sm-8 $tempcss'>
<a href='{$match->url}' class='text-bold' title='{$match->title}'>{$match->title}</a>
<div class='text-muted text-sm'>{$match->staff_title}</div>
</div>
</div>
";
}
if($tempval) {
$temptitle = $matches->count() == "1" ? "Coordinator" : 'Coordinators'; // This changes the title to account for more than 1 location
echo "<hr /><h3>{$temptitle}</h3>";
echo "<div class='row'>{$tempval}</div>";
unset($tempcss);
unset($temptitle);
unset($tempval);
unset($tempimg);
}
?>
<?
// The following finds all the staff person is tied with, loops through and prints.
$matches = $temp_relate_staff;
foreach($matches as $match) {
$i++; // Increments the key
$temprow = ($i % 2 == 1 ? 'clear-left' : ''); // adds this class to the 3rd
if ($match->image) {
$img_sized = $match->image->size(300);
$tempimg = "<div class='col-sm-4'>
<a href='{$match->url}' class='text-bold thumbnail' title='{$match->title}'>
<img src='{$img_sized->url}' class='img-responsive ' alt='{$match->title} {$img_sized->description}'>
</a>
</div>";
$tempcss = "padding-top-md"; // This helps push the text down to balance out the position of the text next to the image
}
$tempval .= "<div class='col-sm-6 {$temprow}'>
{$tempimg}
<div class='col-sm-8 $tempcss'>
<a href='{$match->url}' class='text-bold' title='{$match->title}'>{$match->title}</a>
<div class='text-muted text-sm'>{$match->staff_title}</div>
</div>
</div>
";
}
if($tempval) {
$temptitle = $matches->count() == "1" ? "Member" : 'Members'; // This changes the title to account for more than 1 location
echo "<hr /><h3>{$temptitle}</h3>";
echo "<div class='row'>{$tempval}</div>";
unset($tempcss);
unset($temptitle);
unset($tempval);
unset($tempimg);
}
?>
</div>
<? include("./inc/nav_well.php"); ?>
</div>
<? include("./inc/foot.php");