@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | if (isset ($data['rows']) && count($data['rows']) > 0) { |
67 | 67 | |
68 | 68 | echo '<dl id="searchresults">'; |
69 | - for ($i=0; $i<count($data['rows']); $i++) { |
|
69 | + for ($i = 0; $i < count($data['rows']); $i++) { |
|
70 | 70 | |
71 | 71 | $row = $data['rows'][$i]; |
72 | 72 | echo '<dt><a href="', $row['listurl'], '">'; |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | } |
80 | 80 | if (isset($row['collapsed']) && $row['collapsed'] && $row['subsection_id']) { |
81 | 81 | $URL = new URL('search'); |
82 | - $URL->insert(array('s' => $info['s'] . " segment:$row[subsection_id]" )); |
|
82 | + $URL->insert(array('s' => $info['s'] . " segment:$row[subsection_id]")); |
|
83 | 83 | echo ' <a href="', $URL->generate(), '">See ', $row['collapsed'], |
84 | - ' other result', $row['collapsed']>1?'s':'', ' from this ', |
|
84 | + ' other result', $row['collapsed'] > 1 ? 's' : '', ' from this ', |
|
85 | 85 | $hansardmajors[$row['major']]['singular'], '</a>'; |
86 | 86 | } |
87 | 87 | echo '</small>'; |
88 | 88 | if ($match = get_http_var('match')) { |
89 | - echo ' – <a href="/search/record.php?result=', $row['gid'] , '&match=', _htmlspecialchars($match), '">This is the correct match</a>'; |
|
89 | + echo ' – <a href="/search/record.php?result=', $row['gid'], '&match=', _htmlspecialchars($match), '">This is the correct match</a>'; |
|
90 | 90 | } |
91 | 91 | echo '</dt> <dd><p>'; |
92 | 92 | if (isset($row['speaker']) && count($row['speaker'])) { |
@@ -46,7 +46,8 @@ discard block |
||
46 | 46 | |
47 | 47 | print "\t\t\t\t<h3 style='font-weight:normal'>Results <strong>" . number_format($info['first_result']) . '-' . number_format($last_result) . '</strong> of ' . number_format($info['total_results']) . " for <strong>" . _htmlentities($searchdescription) . "</strong></h3>\n"; |
48 | 48 | |
49 | -} elseif ($info['total_results'] == 0) { |
|
49 | +} |
|
50 | +elseif ($info['total_results'] == 0) { |
|
50 | 51 | echo '<h3 style="font-weight:normal">Your search for <strong>', _htmlentities($searchdescription), '</strong> did not match anything.</h3>'; |
51 | 52 | } |
52 | 53 | |
@@ -91,7 +92,9 @@ discard block |
||
91 | 92 | echo '</dt> <dd><p>'; |
92 | 93 | if (isset($row['speaker']) && count($row['speaker'])) { |
93 | 94 | echo "<em>" . ucfirst($row['speaker']['name']) . "</em>"; |
94 | - if ($row['extract']) echo ": "; |
|
95 | + if ($row['extract']) { |
|
96 | + echo ": "; |
|
97 | + } |
|
95 | 98 | } |
96 | 99 | |
97 | 100 | echo $row['extract'] . "</p></dd>\n"; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | Based on postcode <strong><?= $mp_data['postcode'] ?></strong> |
27 | 27 | <a href="<?= $mp_data['change_url'] ?>">(Change postcode)</a> |
28 | 28 | </p> |
29 | - <?php if ( isset( $mp_data ) && $type != 'mlas' ) { ?> |
|
29 | + <?php if (isset($mp_data) && $type != 'mlas') { ?> |
|
30 | 30 | <h3>Your <?= $mp_data['former'] ? $mp_data['former'] . ' ' : '' ?><?= $rep_name ?> is</h3> |
31 | 31 | </div> |
32 | 32 | <a href="<?= $mp_data['mp_url'] ?>" class="people-list__person"> |
@@ -34,23 +34,23 @@ discard block |
||
34 | 34 | <h2 class="people-list__person__name"><?= $mp_data['name'] ?></h2> |
35 | 35 | <p class="people-list__person__memberships"> |
36 | 36 | <span class="people-list__person__constituency"><?= $mp_data['constituency'] ?></span> |
37 | - <span class="people-list__person__party <?= strtolower( $mp_data['party'] ) ?>"><?= $mp_data['party'] ?></span> |
|
37 | + <span class="people-list__person__party <?= strtolower($mp_data['party']) ?>"><?= $mp_data['party'] ?></span> |
|
38 | 38 | </p> |
39 | 39 | </a> |
40 | 40 | <?php } |
41 | - if ( isset($reps) ) { |
|
42 | - if ( isset($mp_data) && $type != 'mlas' ) { ?> |
|
41 | + if (isset($reps)) { |
|
42 | + if (isset($mp_data) && $type != 'mlas') { ?> |
|
43 | 43 | <div class="people-list__your-mp__replist-header"> |
44 | 44 | <?php } ?> |
45 | 45 | <h3>Your <?=$former ?> <?= $rep_plural == 'MSPs' ? 'regional ' : '' ?><?= $rep_plural ?> are</h3> |
46 | 46 | </div> |
47 | - <?php foreach ( $reps as $rep ) { ?> |
|
47 | + <?php foreach ($reps as $rep) { ?> |
|
48 | 48 | <a href="<?= $rep['mp_url'] ?>" class="people-list__person"> |
49 | 49 | <img class="people-list__person__image" src="<?= $rep['image'] ?>"> |
50 | 50 | <h2 class="people-list__person__name"><?= $rep['name'] ?></h2> |
51 | 51 | <p class="people-list__person__memberships"> |
52 | 52 | <span class="people-list__person__constituency"><?= $rep['constituency'] ?></span> |
53 | - <span class="people-list__person__party <?= strtolower( $rep['party'] ) ?>"><?= $rep['party'] ?></span> |
|
53 | + <span class="people-list__person__party <?= strtolower($rep['party']) ?>"><?= $rep['party'] ?></span> |
|
54 | 54 | </p> |
55 | 55 | </a> |
56 | 56 | <?php } ?> |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | <div class="search-page__section search-page__section--search"> |
66 | 66 | <div class="search-page__section__primary"> |
67 | 67 | <p class="search-page-main-inputs"> |
68 | - <?php if ( $type == 'peers' ) { ?> |
|
68 | + <?php if ($type == 'peers') { ?> |
|
69 | 69 | <label for="find-mp-by-name-or-postcode">Find <?= $rep_plural ?> by name:</label> |
70 | - <?php } elseif ( $type == 'mlas' || $type == 'msps' ) { ?> |
|
70 | + <?php } elseif ($type == 'mlas' || $type == 'msps') { ?> |
|
71 | 71 | <label for="find-mp-by-name-or-postcode">Find your <?= $rep_name ?> by postcode:</label> |
72 | 72 | <?php } else { ?> |
73 | 73 | <label for="find-mp-by-name-or-postcode">Find your <?= $rep_name ?> by name or postcode:</label> |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | <div class="search-page__section__primary"> |
109 | 109 | <h2>All <?= $rep_plural ?></h2> |
110 | 110 | |
111 | - <?php if ( $type != 'peers' ) { ?> |
|
111 | + <?php if ($type != 'peers') { ?> |
|
112 | 112 | <ul class="search-result-display-options"> |
113 | - <?php if ( $order == 'given_name' ) { ?> |
|
113 | + <?php if ($order == 'given_name') { ?> |
|
114 | 114 | <li><strong>Sorted by</strong> First name</li> |
115 | 115 | <li>Sort by <a href="<?= $urls['by_last'] ?>">Last name</a> / <a href="<?= $urls['by_party'] ?>">Party</a></li> |
116 | - <?php } else if ( $order == 'party' ) { ?> |
|
116 | + <?php } else if ($order == 'party') { ?> |
|
117 | 117 | <li><strong>Sorted by</strong> Party</li> |
118 | 118 | <li>Sort by <a href="<?= $urls['by_first'] ?>">First name</a> / <a href="<?= $urls['by_last'] ?>">Last name</a></li> |
119 | 119 | <?php } else { ?> |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | </ul> |
124 | 124 | <?php } else { ?> |
125 | 125 | <ul class="search-result-display-options"> |
126 | - <?php if ( $order == 'party' ) { ?> |
|
126 | + <?php if ($order == 'party') { ?> |
|
127 | 127 | <li><strong>Sorted by</strong> Party</li> |
128 | 128 | <li>Sort by <a href="<?= $urls['by_name'] ?>">Name</a></li> |
129 | 129 | <?php } else { ?> |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | } |
174 | 174 | } |
175 | 175 | $initial_link = ''; |
176 | - foreach ( $data as $person ) { |
|
176 | + foreach ($data as $person) { |
|
177 | 177 | if ($order != 'party') { |
178 | - $initial = substr( strtoupper($person[$a_to_z_key]), 0, 1); |
|
179 | - if ( $initial != $current_initial ) { |
|
178 | + $initial = substr(strtoupper($person[$a_to_z_key]), 0, 1); |
|
179 | + if ($initial != $current_initial) { |
|
180 | 180 | $current_initial = $initial; |
181 | 181 | $initial_link = "name=\"$initial\" "; |
182 | 182 | } else { |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | <img class="people-list__person__image" src="<?= $person['image'] ?>"> |
189 | 189 | <h2 class="people-list__person__name"><?= ucfirst($person['name']) ?></h2> |
190 | 190 | <p class="people-list__person__memberships"> |
191 | - <?php if ( $person['constituency'] ) { ?> |
|
191 | + <?php if ($person['constituency']) { ?> |
|
192 | 192 | <span class="people-list__person__constituency"><?= $person['constituency'] ?></span> |
193 | 193 | <?php } ?> |
194 | 194 | <span class="people-list__person__party <?= strtolower($person['party']) ?>"><?= $person['party'] ?></span> |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | <a href="<?= $urls['by_csv'] ?>">Download this list as a CSV</a> |
207 | 207 | suitable for Excel |
208 | 208 | </p> |
209 | - <?php if ( $type == 'mps' ) { ?> |
|
209 | + <?php if ($type == 'mps') { ?> |
|
210 | 210 | <form method="get" action="<?= $urls['plain'] ?>" class="sidebar-item-with-icon sidebar-item-with-icon--date"> |
211 | 211 | <p> |
212 | 212 | Or view a past list |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | }) |
251 | 251 | }); |
252 | 252 | </script> |
253 | - <?php } else if ( $type == 'msps' ) { ?> |
|
253 | + <?php } else if ($type == 'msps') { ?> |
|
254 | 254 | <p class="past-list-dates" id="past-list-dates"> |
255 | 255 | <a href="<?= $urls['plain'] ?>?date=2011-05-05">MSPs at 2011 election</a> |
256 | 256 | <a href="<?= $urls['plain'] ?>?date=2007-05-03">MSPs at 2007 election</a> |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | </p> |
265 | 265 | <?php } ?> |
266 | 266 | |
267 | - <?php include( dirname(__FILE__) . '/../sidebar/looking_for.php' ) ?> |
|
267 | + <?php include(dirname(__FILE__) . '/../sidebar/looking_for.php') ?> |
|
268 | 268 | </div> |
269 | 269 | </div> |
270 | 270 |
@@ -4,9 +4,11 @@ discard block |
||
4 | 4 | if (!count($data)) { |
5 | 5 | if ($type == 'mps' && isset($dissolution[1])) { |
6 | 6 | $former = 'former'; |
7 | - } elseif ($type == 'msps' && isset($dissolution[4])) { |
|
7 | + } |
|
8 | + elseif ($type == 'msps' && isset($dissolution[4])) { |
|
8 | 9 | $former = 'former'; |
9 | - } elseif ($type == 'mlas' && isset($dissolution[3])) { |
|
10 | + } |
|
11 | + elseif ($type == 'mlas' && isset($dissolution[3])) { |
|
10 | 12 | $former = 'former'; |
11 | 13 | } |
12 | 14 | } |
@@ -59,7 +61,8 @@ discard block |
||
59 | 61 | </div> |
60 | 62 | </div> |
61 | 63 | |
62 | - <?php } else { ?> |
|
64 | + <?php } |
|
65 | +else { ?> |
|
63 | 66 | |
64 | 67 | <form action="/<?= ($type == 'mlas' || $type == 'msps') ? 'postcode' : 'search' ?>/"> |
65 | 68 | <div class="search-page__section search-page__section--search"> |
@@ -67,9 +70,11 @@ discard block |
||
67 | 70 | <p class="search-page-main-inputs"> |
68 | 71 | <?php if ( $type == 'peers' ) { ?> |
69 | 72 | <label for="find-mp-by-name-or-postcode">Find <?= $rep_plural ?> by name:</label> |
70 | - <?php } elseif ( $type == 'mlas' || $type == 'msps' ) { ?> |
|
73 | + <?php } |
|
74 | +elseif ( $type == 'mlas' || $type == 'msps' ) { ?> |
|
71 | 75 | <label for="find-mp-by-name-or-postcode">Find your <?= $rep_name ?> by postcode:</label> |
72 | - <?php } else { ?> |
|
76 | + <?php } |
|
77 | +else { ?> |
|
73 | 78 | <label for="find-mp-by-name-or-postcode">Find your <?= $rep_name ?> by name or postcode:</label> |
74 | 79 | <?php } ?> |
75 | 80 | <input type="text" class="form-control" name="<?= ($type == 'mlas' || $type == 'msps') ? 'pc' : 'q' ?>" id="find-mp-by-name-or-postcode"> |
@@ -91,19 +96,22 @@ discard block |
||
91 | 96 | During the period from the dissolution of Parliament to the general election, there are no Members of Parliament. |
92 | 97 | <a href="/mps/?date=<?=$dissolution[1] ?>">View list of MPs as it was when Parliament was dissolved</a> |
93 | 98 | </div> |
94 | - <?php } elseif ($type == 'msps') { ?> |
|
99 | + <?php } |
|
100 | +elseif ($type == 'msps') { ?> |
|
95 | 101 | <div class="search-page__section__primary"> |
96 | 102 | During the period from the dissolution of the Scottish Parliament to the election, there are no Members of the Scottish Parliament. |
97 | 103 | <a href="/msps/?date=<?=$dissolution[4] ?>">View list of MSPs as it was when the Scottish Parliament was dissolved</a> |
98 | 104 | </div> |
99 | - <?php } elseif ($type == 'mlas') { ?> |
|
105 | + <?php } |
|
106 | +elseif ($type == 'mlas') { ?> |
|
100 | 107 | <div class="search-page__section__primary"> |
101 | 108 | During the period from the dissolution of the Northern Ireland Assembly to the election, there are no Members of the Northern Ireland Assembly. |
102 | 109 | <a href="/mlas/?date=<?=$dissolution[3] ?>">View list of MLAs as it was when the Northern Ireland Assembly was dissolved</a> |
103 | 110 | </div> |
104 | 111 | <?php |
105 | 112 | } |
106 | - } else { ?> |
|
113 | + } |
|
114 | + else { ?> |
|
107 | 115 | |
108 | 116 | <div class="search-page__section__primary"> |
109 | 117 | <h2>All <?= $rep_plural ?></h2> |
@@ -113,20 +121,24 @@ discard block |
||
113 | 121 | <?php if ( $order == 'given_name' ) { ?> |
114 | 122 | <li><strong>Sorted by</strong> First name</li> |
115 | 123 | <li>Sort by <a href="<?= $urls['by_last'] ?>">Last name</a> / <a href="<?= $urls['by_party'] ?>">Party</a></li> |
116 | - <?php } else if ( $order == 'party' ) { ?> |
|
124 | + <?php } |
|
125 | +else if ( $order == 'party' ) { ?> |
|
117 | 126 | <li><strong>Sorted by</strong> Party</li> |
118 | 127 | <li>Sort by <a href="<?= $urls['by_first'] ?>">First name</a> / <a href="<?= $urls['by_last'] ?>">Last name</a></li> |
119 | - <?php } else { ?> |
|
128 | + <?php } |
|
129 | +else { ?> |
|
120 | 130 | <li><strong>Sorted by</strong> Last name</li> |
121 | 131 | <li>Sort by <a href="<?= $urls['by_first'] ?>">First name</a> / <a href="<?= $urls['by_party'] ?>">Party</a></li> |
122 | 132 | <?php } ?> |
123 | 133 | </ul> |
124 | - <?php } else { ?> |
|
134 | + <?php } |
|
135 | +else { ?> |
|
125 | 136 | <ul class="search-result-display-options"> |
126 | 137 | <?php if ( $order == 'party' ) { ?> |
127 | 138 | <li><strong>Sorted by</strong> Party</li> |
128 | 139 | <li>Sort by <a href="<?= $urls['by_name'] ?>">Name</a></li> |
129 | - <?php } else { ?> |
|
140 | + <?php } |
|
141 | +else { ?> |
|
130 | 142 | <li><strong>Sorted by</strong> Name</li> |
131 | 143 | <li>Sort by <a href="<?= $urls['by_party'] ?>">Party</a></li> |
132 | 144 | <?php } ?> |
@@ -179,7 +191,8 @@ discard block |
||
179 | 191 | if ( $initial != $current_initial ) { |
180 | 192 | $current_initial = $initial; |
181 | 193 | $initial_link = "name=\"$initial\" "; |
182 | - } else { |
|
194 | + } |
|
195 | + else { |
|
183 | 196 | $initial_link = ""; |
184 | 197 | } |
185 | 198 | } |
@@ -250,7 +263,8 @@ discard block |
||
250 | 263 | }) |
251 | 264 | }); |
252 | 265 | </script> |
253 | - <?php } else if ( $type == 'msps' ) { ?> |
|
266 | + <?php } |
|
267 | +else if ( $type == 'msps' ) { ?> |
|
254 | 268 | <p class="past-list-dates" id="past-list-dates"> |
255 | 269 | <a href="<?= $urls['plain'] ?>?date=2011-05-05">MSPs at 2011 election</a> |
256 | 270 | <a href="<?= $urls['plain'] ?>?date=2007-05-03">MSPs at 2007 election</a> |
@@ -258,7 +272,8 @@ discard block |
||
258 | 272 | <a href="<?= $urls['plain'] ?>?date=1999-05-06">MSPs at 1999 election</a> |
259 | 273 | <a href="<?= $urls['plain'] ?>?all=1">Historical list of all MSPs</a> |
260 | 274 | </p> |
261 | - <?php } else { ?> |
|
275 | + <?php } |
|
276 | +else { ?> |
|
262 | 277 | <p class="past-list-dates" id="past-list-dates"> |
263 | 278 | <a href="<?= $urls['plain'] ?>?all=1">Historical list of all <?= $rep_plural ?></a> |
264 | 279 | </p> |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <div class="regional-header regional-header--<?= $current_assembly ?>"> |
2 | 2 | <div class="regional-header__overlay"></div> |
3 | - <div class="person-header <?= $this_page ?> <?= (isset($data['photo_attribution_text'])?'has-data-attribution':'') ?>"> |
|
3 | + <div class="person-header <?= $this_page ?> <?= (isset($data['photo_attribution_text']) ? 'has-data-attribution' : '') ?>"> |
|
4 | 4 | <div class="full-page__row"> |
5 | 5 | <div class="full-page__unit"> |
6 | 6 | <div class="person-header__content"> |
7 | 7 | <div class="person-name"> |
8 | - <?php if ( $image ) { ?> |
|
8 | + <?php if ($image) { ?> |
|
9 | 9 | <div class="mp-image"> |
10 | 10 | <img src="<?= $image['url'] ?>" height="48"> |
11 | 11 | </div> |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | <?php } ?> |
18 | 18 | </div> |
19 | 19 | </div> |
20 | - <?php if($image && $image['exists']): ?> |
|
21 | - <?php if(isset($data['photo_attribution_text'])) { ?> |
|
20 | + <?php if ($image && $image['exists']): ?> |
|
21 | + <?php if (isset($data['photo_attribution_text'])) { ?> |
|
22 | 22 | <div class="person-data-attribution"> |
23 | - <?php if(isset($data['photo_attribution_link'])) { ?> |
|
23 | + <?php if (isset($data['photo_attribution_link'])) { ?> |
|
24 | 24 | Profile photo: <a href="<?= $data['photo_attribution_link'] ?>"><?= $data['photo_attribution_text'] ?></a> |
25 | 25 | <?php } else { ?> |
26 | 26 | Profile photo: <?= $data['photo_attribution_text'] ?> |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | </div> |
39 | 39 | <?php endif; ?> |
40 | 40 | <div class="person-constituency"> |
41 | - <?php if ( $constituency && $this_page != 'peer' && $this_page != 'royal' ) { ?> |
|
41 | + <?php if ($constituency && $this_page != 'peer' && $this_page != 'royal') { ?> |
|
42 | 42 | <span class="constituency"><?= $constituency ?></span> |
43 | 43 | <?php } ?> |
44 | - <?php if ( $party ) { ?> |
|
44 | + <?php if ($party) { ?> |
|
45 | 45 | <span class="party <?= $party_short ?>"><?= $party ?></span> |
46 | 46 | <?php } ?> |
47 | 47 | </div> |
@@ -22,12 +22,14 @@ discard block |
||
22 | 22 | <div class="person-data-attribution"> |
23 | 23 | <?php if(isset($data['photo_attribution_link'])) { ?> |
24 | 24 | Profile photo: <a href="<?= $data['photo_attribution_link'] ?>"><?= $data['photo_attribution_text'] ?></a> |
25 | - <?php } else { ?> |
|
25 | + <?php } |
|
26 | +else { ?> |
|
26 | 27 | Profile photo: <?= $data['photo_attribution_text'] ?> |
27 | 28 | <?php } ?> |
28 | 29 | </div> |
29 | 30 | <?php } ?> |
30 | - <?php else: ?> |
|
31 | + <?php else { |
|
32 | + : ?> |
|
31 | 33 | <div class="person-data-attribution"> |
32 | 34 | We’re missing a photo of <?= $full_name ?>. If you have a |
33 | 35 | photo <em>that you can release under a Creative Commons Attribution-ShareAlike |
@@ -36,7 +38,9 @@ discard block |
||
36 | 38 | Please do not email us about copyrighted photos elsewhere on the internet; we can’t |
37 | 39 | use them. |
38 | 40 | </div> |
39 | - <?php endif; ?> |
|
41 | + <?php endif; |
|
42 | +} |
|
43 | +?> |
|
40 | 44 | <div class="person-constituency"> |
41 | 45 | <?php if ( $constituency && $this_page != 'peer' && $this_page != 'royal' ) { ?> |
42 | 46 | <span class="constituency"><?= $constituency ?></span> |
@@ -44,11 +44,11 @@ |
||
44 | 44 | ?></dt> |
45 | 45 | <dd> |
46 | 46 | <div class="appearance-date"> |
47 | - <div class="day"><?php echo format_date($row['hdate'], 'j' ) ?></div><!-- |
|
47 | + <div class="day"><?php echo format_date($row['hdate'], 'j') ?></div><!-- |
|
48 | 48 | <?php if ($year < $cur_year) { ?> |
49 | - --><div class="month"><?php echo format_date($row['hdate'], 'M y' ) ?></div> |
|
49 | + --><div class="month"><?php echo format_date($row['hdate'], 'M y') ?></div> |
|
50 | 50 | <?php } else { ?> |
51 | - --><div class="month"><?php echo format_date($row['hdate'], 'M' ) ?></div> |
|
51 | + --><div class="month"><?php echo format_date($row['hdate'], 'M') ?></div> |
|
52 | 52 | <?php } ?> |
53 | 53 | </div> |
54 | 54 |
@@ -47,7 +47,8 @@ discard block |
||
47 | 47 | <div class="day"><?php echo format_date($row['hdate'], 'j' ) ?></div><!-- |
48 | 48 | <?php if ($year < $cur_year) { ?> |
49 | 49 | --><div class="month"><?php echo format_date($row['hdate'], 'M y' ) ?></div> |
50 | - <?php } else { ?> |
|
50 | + <?php } |
|
51 | +else { ?> |
|
51 | 52 | --><div class="month"><?php echo format_date($row['hdate'], 'M' ) ?></div> |
52 | 53 | <?php } ?> |
53 | 54 | </div> |
@@ -61,7 +62,8 @@ discard block |
||
61 | 62 | |
62 | 63 | <?php |
63 | 64 | |
64 | -} else { ?> |
|
65 | +} |
|
66 | +else { ?> |
|
65 | 67 | <p>No data to display.</p> |
66 | 68 | <?php |
67 | 69 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | |
14 | 14 | <div class="row"> |
15 | 15 | <span class="label">Website</span> |
16 | - <span class="formw"><?= $website == '' ? 'none' : '<a href="' . _htmlentities($website) . '">'. _htmlentities($website) . '</a>' ?></span> |
|
16 | + <span class="formw"><?= $website == '' ? 'none' : '<a href="' . _htmlentities($website) . '">' . _htmlentities($website) . '</a>' ?></span> |
|
17 | 17 | </div> |
18 | 18 | |
19 | 19 | <div class="row"> |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | }(document, 'script', 'facebook-jssdk')); |
159 | 159 | </script> |
160 | 160 | |
161 | - <?php if ( $banner_text ) { ?> |
|
161 | + <?php if ($banner_text) { ?> |
|
162 | 162 | <div class="banner"> |
163 | 163 | <div class="full-page__row"> |
164 | 164 | <div class="banner__content"> |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | <img src="/style/img/[email protected]" width="24" height="24" alt=""><span>Your Profile</span> |
228 | 228 | </a> |
229 | 229 | <ul id="nav-user"> |
230 | - <?php foreach ($user_nav_links as $nav_link){ ?> |
|
230 | + <?php foreach ($user_nav_links as $nav_link) { ?> |
|
231 | 231 | <li><a href="<?= $nav_link['href']; ?>" title="<?= $nav_link['title']; ?>" class="<?= $nav_link['classes']; ?>"><?= $nav_link['text'] ?></a></li> |
232 | 232 | <?php } ?> |
233 | 233 | </ul> |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | <div class="full-page legacy-page static-page"> |
249 | 249 | <div class="full-page__row"> |
250 | 250 | <div class="panel"> |
251 | - <?php foreach ( $page_errors as $error ) { ?> |
|
251 | + <?php foreach ($page_errors as $error) { ?> |
|
252 | 252 | <p><?= $error['text'] ?></p> |
253 | 253 | <?php } ?> |
254 | 254 | </div> |
@@ -30,7 +30,8 @@ discard block |
||
30 | 30 | <meta property="og:image:width" content="1000"> |
31 | 31 | <meta property="og:image:height" content="500"> |
32 | 32 | <meta property="og:type" content="profile"> |
33 | - <?php } else { ?> |
|
33 | + <?php } |
|
34 | +else { ?> |
|
34 | 35 | <meta property="og:type" content="website"> |
35 | 36 | <meta property="og:image" content="https://<?= DOMAIN ?>/images/facebook-avatar.png"> |
36 | 37 | <meta property="og:image:width" content="200"> |
@@ -174,11 +175,14 @@ discard block |
||
174 | 175 | <div class="banner__content"> |
175 | 176 | <?php if ($country == 'NZ') { ?> |
176 | 177 | You’re in New Zealand, so check out <a href="http://www.theyworkforyou.co.nz">TheyWorkForYou.co.nz</a> |
177 | - <?php } elseif ($country == 'AU') { ?> |
|
178 | + <?php } |
|
179 | +elseif ($country == 'AU') { ?> |
|
178 | 180 | You’re in Australia, so check out <a href="http://www.openaustralia.org">OpenAustralia</a>, a TheyWorkForYou for down under |
179 | - <?php } elseif ($country == 'IE') { ?> |
|
181 | + <?php } |
|
182 | +elseif ($country == 'IE') { ?> |
|
180 | 183 | Check out <a href="https://www.kildarestreet.com/">KildareStreet</a>, a TheyWorkForYou for the Houses of the Oireachtas |
181 | - <?php } elseif ($country == 'CA') { ?> |
|
184 | + <?php } |
|
185 | +elseif ($country == 'CA') { ?> |
|
182 | 186 | Check out <a href="https://openparliament.ca/">OpenParliament.ca</a> |
183 | 187 | <?php } ?> |
184 | 188 | </div> |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | // $data['info'] may have 'onday', a 'yyyy-mm-dd' date which indicates |
24 | 24 | // which date will be highlighted (otherwise, today is). |
25 | 25 | |
26 | -include_once INCLUDESPATH."easyparliament/recess.php"; |
|
26 | +include_once INCLUDESPATH . "easyparliament/recess.php"; |
|
27 | 27 | global $PAGE, $DATA, $this_page, $hansardmajors; |
28 | 28 | |
29 | 29 | twfy_debug("TEMPLATE", "hansard_calendar.php"); |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | |
41 | 41 | |
42 | 42 | // Create array containing abbreviations of days of week. |
43 | - $daysOfWeek = array('Mon','Tue','Wed','Thu','Fri','Sat','Sun'); |
|
43 | + $daysOfWeek = array('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'); |
|
44 | 44 | |
45 | 45 | // What is the first day of the month in question? |
46 | - $firstDayOfMonth = mktime(0,0,0,$month,1,$year); |
|
46 | + $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year); |
|
47 | 47 | |
48 | 48 | // How many days does this month contain? |
49 | - $numberDays = date('t',$firstDayOfMonth); |
|
49 | + $numberDays = date('t', $firstDayOfMonth); |
|
50 | 50 | |
51 | 51 | // Retrieve some information about the first day of the |
52 | 52 | // month in question. |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | if (isset($data['info']['onday'])) { |
61 | 61 | // 'onday' is like 'yyyy-mm-dd'. |
62 | 62 | $datebits = explode('-', $data['info']['onday']); |
63 | - if (count($datebits)>2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
63 | + if (count($datebits) > 2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
64 | 64 | $toDay = $datebits[2]; |
65 | 65 | } else { |
66 | 66 | $toDay = ''; |
@@ -149,11 +149,11 @@ discard block |
||
149 | 149 | // sittings - e.g. WH is only Tuesday-Thursday |
150 | 150 | if ($currentDay == $toDay) { |
151 | 151 | print '<td class="on"'; |
152 | - if ($recess[0] && $recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
152 | + if ($recess[0] && $recess[0] != 1) print ' title="' . $recess[0] . '"'; |
|
153 | 153 | print '>'; |
154 | 154 | } elseif ($recess[0]) { |
155 | 155 | print '<td class="no"'; |
156 | - if ($recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
156 | + if ($recess[0] != 1) print ' title="' . $recess[0] . '"'; |
|
157 | 157 | print '>'; |
158 | 158 | } else { |
159 | 159 | print '<td>'; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | // Is the $currentDay a member of $dates? If so, |
163 | 163 | // the day should be linked. |
164 | - if (in_array($currentDay,$dates)) { |
|
164 | + if (in_array($currentDay, $dates)) { |
|
165 | 165 | |
166 | 166 | $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay); |
167 | 167 |
@@ -62,17 +62,20 @@ discard block |
||
62 | 62 | $datebits = explode('-', $data['info']['onday']); |
63 | 63 | if (count($datebits)>2 && $datebits[0] == $year && $datebits[1] == $month) { |
64 | 64 | $toDay = $datebits[2]; |
65 | - } else { |
|
65 | + } |
|
66 | + else { |
|
66 | 67 | $toDay = ''; |
67 | 68 | } |
68 | - } else { |
|
69 | + } |
|
70 | + else { |
|
69 | 71 | // If this calendar is for this current, real world, month |
70 | 72 | // we get the value of today, so we can highlight it. |
71 | 73 | $nowDateComponents = getdate(); |
72 | 74 | |
73 | 75 | if ($nowDateComponents['year'] == $year && $nowDateComponents['mon'] == $month) { |
74 | 76 | $toDay = $nowDateComponents['mday']; |
75 | - } else { |
|
77 | + } |
|
78 | + else { |
|
76 | 79 | $toDay = ''; |
77 | 80 | } |
78 | 81 | } |
@@ -135,12 +138,17 @@ discard block |
||
135 | 138 | } |
136 | 139 | |
137 | 140 | $recess_major = 1; # For all of UK Parliament |
138 | - if ($hansardmajors[$data['info']['major']]['location'] == 'NI') |
|
139 | - $recess_major = 5; |
|
140 | - elseif ($hansardmajors[$data['info']['major']]['location'] == 'Scotland') |
|
141 | - $recess_major = 4; # For all of Scotland |
|
142 | - elseif ($data['info']['major'] == 101) |
|
143 | - $recess_major = 101; # Lords slightly different |
|
141 | + if ($hansardmajors[$data['info']['major']]['location'] == 'NI') { |
|
142 | + $recess_major = 5; |
|
143 | + } |
|
144 | + elseif ($hansardmajors[$data['info']['major']]['location'] == 'Scotland') { |
|
145 | + $recess_major = 4; |
|
146 | + } |
|
147 | + # For all of Scotland |
|
148 | + elseif ($data['info']['major'] == 101) { |
|
149 | + $recess_major = 101; |
|
150 | + } |
|
151 | + # Lords slightly different |
|
144 | 152 | $recess = recess_prettify($currentDay, $month, $year, $recess_major); |
145 | 153 | |
146 | 154 | // Is this day actually Today in the real world? |
@@ -149,13 +157,19 @@ discard block |
||
149 | 157 | // sittings - e.g. WH is only Tuesday-Thursday |
150 | 158 | if ($currentDay == $toDay) { |
151 | 159 | print '<td class="on"'; |
152 | - if ($recess[0] && $recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
160 | + if ($recess[0] && $recess[0]!=1) { |
|
161 | + print ' title="'.$recess[0].'"'; |
|
162 | + } |
|
153 | 163 | print '>'; |
154 | - } elseif ($recess[0]) { |
|
164 | + } |
|
165 | + elseif ($recess[0]) { |
|
155 | 166 | print '<td class="no"'; |
156 | - if ($recess[0]!=1) print ' title="'.$recess[0].'"'; |
|
167 | + if ($recess[0]!=1) { |
|
168 | + print ' title="'.$recess[0].'"'; |
|
169 | + } |
|
157 | 170 | print '>'; |
158 | - } else { |
|
171 | + } |
|
172 | + else { |
|
159 | 173 | print '<td>'; |
160 | 174 | } |
161 | 175 | |
@@ -167,14 +181,16 @@ discard block |
||
167 | 181 | |
168 | 182 | if ($currentDay == $toDay) { |
169 | 183 | print '<span>' . $currentDay . '</span></td>'; |
170 | - } else { |
|
184 | + } |
|
185 | + else { |
|
171 | 186 | $DAYURL->insert(array('d'=>$date)); |
172 | 187 | print "<a href=\"" . $DAYURL->generate() . "\">$currentDay</a></td>"; |
173 | 188 | } |
174 | 189 | |
175 | 190 | // $currentDay is not a member of $dates. |
176 | 191 | |
177 | - } else { |
|
192 | + } |
|
193 | + else { |
|
178 | 194 | |
179 | 195 | print '<span>' . $currentDay . '</span></td>'; |
180 | 196 | } |
@@ -212,7 +228,8 @@ discard block |
||
212 | 228 | print '<p><a href="' . $URL->generate() . '">See all of ' . $year . '</a></p>'; |
213 | 229 | } |
214 | 230 | } |
215 | -} else { |
|
231 | +} |
|
232 | +else { |
|
216 | 233 | ?> |
217 | 234 | <p>There is no data, sorry.</p> |
218 | 235 | <?php |
@@ -43,7 +43,8 @@ |
||
43 | 43 | </form> |
44 | 44 | |
45 | 45 | <a href="<?= $fb_login_url ?>">Log in with Facebook!</a> </div> <!-- end .main --> |
46 | - <?php } else { ?> |
|
46 | + <?php } |
|
47 | +else { ?> |
|
47 | 48 | |
48 | 49 | // ASK FOR POSTCODE |
49 | 50 | <?php } ?> |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | <div class="panel panel--flushtop clearfix"> |
46 | 46 | <div class="row nested-row"> |
47 | 47 | <div class="homepage-in-the-news homepage-content-section"> |
48 | - <?php if ( count($featured) > 0 ) { |
|
48 | + <?php if (count($featured) > 0) { |
|
49 | 49 | include 'homepage/featured.php'; |
50 | 50 | } else { ?> |
51 | 51 | No debates found. |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | <div class="homepage-recently homepage-content-section"> |
109 | 109 | <h2>Recently in Parliament</h2> |
110 | 110 | <ul class="recently__list"><?php |
111 | - foreach ( $debates['recent'] as $recent ) { |
|
111 | + foreach ($debates['recent'] as $recent) { |
|
112 | 112 | include 'homepage/recent-debates.php'; |
113 | 113 | } |
114 | 114 | ?></ul> |
115 | 115 | </div> |
116 | 116 | <div class="homepage-upcoming homepage-content-section"> |
117 | 117 | <h2>Upcoming</h2> |
118 | - <?php if ( count($calendar) ) { ?> |
|
118 | + <?php if (count($calendar)) { ?> |
|
119 | 119 | <div class="upcoming__controls"> |
120 | 120 | <!-- |
121 | 121 | These controls should make the upcoming section slide to the next day. |
@@ -134,24 +134,24 @@ discard block |
||
134 | 134 | </div> |
135 | 135 | </div> |
136 | 136 | <?php $first = true; $count = 0; |
137 | - foreach ( $calendar as $date => $places ) { |
|
137 | + foreach ($calendar as $date => $places) { |
|
138 | 138 | $count++; ?> |
139 | 139 | <div class="cal-wrapper <?= $first ? 'visible' : 'hidden' ?>" id="day-<?= $count ?>" data-count="<?= $count ?>" data-date="<?= format_date($date, SHORTDATEFORMAT); ?>"> |
140 | 140 | <?php foreach ($places as $place => $events) { ?> |
141 | 141 | <?php $first = false; ?> |
142 | 142 | <h3><?= $place ?></h3> |
143 | 143 | <ul class="upcoming__list"> |
144 | - <?php for ( $i = 0; $i < 3; $i++ ) { |
|
145 | - if ( isset( $events[$i] ) ) { ?> |
|
144 | + <?php for ($i = 0; $i < 3; $i++) { |
|
145 | + if (isset($events[$i])) { ?> |
|
146 | 146 | <li> |
147 | 147 | <h4 class="upcoming__title"><a href="<?= $events[$i]['link_external'] ?>"><?= $events[$i]['title'] ?></a></h4> |
148 | 148 | <p class="meta"><?php |
149 | 149 | $meta_items = array(); |
150 | 150 | $meta_items[] = $events[$i]['debate_type']; |
151 | - if( isset($events[$i]['time_start']) && $events[$i]['time_start'] != '00:00:00' ){ |
|
151 | + if (isset($events[$i]['time_start']) && $events[$i]['time_start'] != '00:00:00') { |
|
152 | 152 | $times = format_time($events[$i]['time_start'], 'g:i a'); |
153 | 153 | |
154 | - if( isset($events[$i]['time_end']) && $events[$i]['time_end'] != '00:00:00' ){ |
|
154 | + if (isset($events[$i]['time_end']) && $events[$i]['time_end'] != '00:00:00') { |
|
155 | 155 | $times = $times . ' - ' . format_time($events[$i]['time_end'], 'g:i a'); |
156 | 156 | } |
157 | 157 | $meta_items[] = $times; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | <?php } ?> |
164 | 164 | <?php } ?> |
165 | 165 | </ul> |
166 | - <?php if ( count($events) - 3 > 0 ) { ?> |
|
166 | + <?php if (count($events) - 3 > 0) { ?> |
|
167 | 167 | <a href="/calendar/?d=<?= format_date($date, 'Y-m-d') ?>" class="upcoming__more">And <?= count($events) - 3 ?> more</a><!-- (just links to relevant upcoming page) --> |
168 | 168 | <?php } ?> |
169 | 169 | <?php } ?> |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | <?php } ?> |
172 | 172 | <?php } else { |
173 | 173 | list($recess, $from, $to) = recess_prettify(date('j'), date('n'), date('Y'), 1); |
174 | - if ( $recess ) { ?> |
|
174 | + if ($recess) { ?> |
|
175 | 175 | <p> |
176 | 176 | Parliament is on holiday until <?= format_date($to, LONGERDATEFORMAT) ?>. |
177 | 177 | Follow us on <a href="https://twitter.com/theyworkforyou">Twitter</a> and you'll |
@@ -14,7 +14,8 @@ discard block |
||
14 | 14 | <a class="homepage-search__change-postcode" href="<?= $mp_data['change_url'] ?>">Change postcode</a> |
15 | 15 | </div> |
16 | 16 | </div> |
17 | - <?php } else { ?> |
|
17 | + <?php } |
|
18 | +else { ?> |
|
18 | 19 | <h1>Does your MP represent you?</h1> |
19 | 20 | <div class="row collapse"> |
20 | 21 | <form action="/postcode/" class="mp-search__form" onsubmit="trackFormSubmit(this, 'PostcodeSearch', 'Submit', 'Home'); return false;"> |
@@ -47,7 +48,8 @@ discard block |
||
47 | 48 | <div class="homepage-in-the-news homepage-content-section"> |
48 | 49 | <?php if ( count($featured) > 0 ) { |
49 | 50 | include 'homepage/featured.php'; |
50 | - } else { ?> |
|
51 | + } |
|
52 | + else { ?> |
|
51 | 53 | No debates found. |
52 | 54 | <?php } ?> |
53 | 55 | |
@@ -148,10 +150,10 @@ discard block |
||
148 | 150 | <p class="meta"><?php |
149 | 151 | $meta_items = array(); |
150 | 152 | $meta_items[] = $events[$i]['debate_type']; |
151 | - if( isset($events[$i]['time_start']) && $events[$i]['time_start'] != '00:00:00' ){ |
|
153 | + if( isset($events[$i]['time_start']) && $events[$i]['time_start'] != '00:00:00' ) { |
|
152 | 154 | $times = format_time($events[$i]['time_start'], 'g:i a'); |
153 | 155 | |
154 | - if( isset($events[$i]['time_end']) && $events[$i]['time_end'] != '00:00:00' ){ |
|
156 | + if( isset($events[$i]['time_end']) && $events[$i]['time_end'] != '00:00:00' ) { |
|
155 | 157 | $times = $times . ' - ' . format_time($events[$i]['time_end'], 'g:i a'); |
156 | 158 | } |
157 | 159 | $meta_items[] = $times; |
@@ -169,7 +171,8 @@ discard block |
||
169 | 171 | <?php } ?> |
170 | 172 | </div> |
171 | 173 | <?php } ?> |
172 | - <?php } else { |
|
174 | + <?php } |
|
175 | +else { |
|
173 | 176 | list($recess, $from, $to) = recess_prettify(date('j'), date('n'), date('Y'), 1); |
174 | 177 | if ( $recess ) { ?> |
175 | 178 | <p> |
@@ -177,7 +180,8 @@ discard block |
||
177 | 180 | Follow us on <a href="https://twitter.com/theyworkforyou">Twitter</a> and you'll |
178 | 181 | be the first to know when they're back in session. |
179 | 182 | </p> |
180 | - <?php } else { ?> |
|
183 | + <?php } |
|
184 | +else { ?> |
|
181 | 185 | <p> |
182 | 186 | We don’t have details of any upcoming events. |
183 | 187 | </p> |