@@ -125,7 +125,7 @@ |
||
125 | 125 | <span class="label">Security status:</span> |
126 | 126 | <span class="formw"><select name="status"> |
127 | 127 | <?php |
128 | - foreach ($statuses as $n => $status_name) { ?> |
|
128 | + foreach ($statuses as $n => $status_name) { ?> |
|
129 | 129 | <option value="<?= $status_name ?>"<?= $status_name == $status ? ' selected' : '' ?>> |
130 | 130 | <?= $status_name ?> |
131 | 131 | </option> |
@@ -1,43 +1,43 @@ discard block |
||
1 | 1 | <div class="calendar"> |
2 | 2 | <?php if(isset($month)) { |
3 | - // What is the first day of the month in question? |
|
4 | - $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year); |
|
5 | - |
|
6 | - // How many days does this month contain? |
|
7 | - $numberDays = date('t', $firstDayOfMonth); |
|
8 | - |
|
9 | - // What is the name of the month in question? |
|
10 | - $monthName = strftime('%B', $firstDayOfMonth); |
|
11 | - |
|
12 | - if (isset($info['onday'])) { |
|
13 | - // 'onday' is like 'yyyy-mm-dd'. |
|
14 | - $datebits = explode('-', $info['onday']); |
|
15 | - if (count($datebits) > 2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
16 | - $toDay = $datebits[2]; |
|
17 | - } else { |
|
18 | - $toDay = ''; |
|
19 | - } |
|
20 | - } else { |
|
21 | - // If this calendar is for this current, real world, month |
|
22 | - // we get the value of today, so we can highlight it. |
|
23 | - $nowDateComponents = getdate(); |
|
24 | - |
|
25 | - if ($nowDateComponents['year'] == $year && $nowDateComponents['mon'] == $month) { |
|
26 | - $toDay = $nowDateComponents['mday']; |
|
27 | - } else { |
|
28 | - $toDay = ''; |
|
29 | - } |
|
30 | - } |
|
31 | - |
|
32 | - $dayOfWeek = strftime('%w', $firstDayOfMonth) - 1; |
|
33 | - |
|
34 | - // Adjusted to cope with the week starting on Monday. |
|
35 | - if ($dayOfWeek < 0) { |
|
36 | - $dayOfWeek = 6; |
|
37 | - } |
|
38 | - ?> |
|
3 | + // What is the first day of the month in question? |
|
4 | + $firstDayOfMonth = mktime(0, 0, 0, $month, 1, $year); |
|
5 | + |
|
6 | + // How many days does this month contain? |
|
7 | + $numberDays = date('t', $firstDayOfMonth); |
|
8 | + |
|
9 | + // What is the name of the month in question? |
|
10 | + $monthName = strftime('%B', $firstDayOfMonth); |
|
11 | + |
|
12 | + if (isset($info['onday'])) { |
|
13 | + // 'onday' is like 'yyyy-mm-dd'. |
|
14 | + $datebits = explode('-', $info['onday']); |
|
15 | + if (count($datebits) > 2 && $datebits[0] == $year && $datebits[1] == $month) { |
|
16 | + $toDay = $datebits[2]; |
|
17 | + } else { |
|
18 | + $toDay = ''; |
|
19 | + } |
|
20 | + } else { |
|
21 | + // If this calendar is for this current, real world, month |
|
22 | + // we get the value of today, so we can highlight it. |
|
23 | + $nowDateComponents = getdate(); |
|
24 | + |
|
25 | + if ($nowDateComponents['year'] == $year && $nowDateComponents['mon'] == $month) { |
|
26 | + $toDay = $nowDateComponents['mday']; |
|
27 | + } else { |
|
28 | + $toDay = ''; |
|
29 | + } |
|
30 | + } |
|
31 | + |
|
32 | + $dayOfWeek = strftime('%w', $firstDayOfMonth) - 1; |
|
33 | + |
|
34 | + // Adjusted to cope with the week starting on Monday. |
|
35 | + if ($dayOfWeek < 0) { |
|
36 | + $dayOfWeek = 6; |
|
37 | + } |
|
38 | + ?> |
|
39 | 39 | <?php } |
40 | - if (!isset($years)) { ?> |
|
40 | + if (!isset($years)) { ?> |
|
41 | 41 | <div class="calendar__controls"> |
42 | 42 | <?php if (isset($prev)) { ?> |
43 | 43 | <a href="<?= $prev['url'] ?>" class="calendar__controls__previous">←</a> |
@@ -75,93 +75,93 @@ discard block |
||
75 | 75 | <tr> |
76 | 76 | |
77 | 77 | <?php |
78 | - if ($dayOfWeek > 0) { |
|
79 | - print "<td colspan=\"$dayOfWeek\"> </td>"; |
|
80 | - } |
|
78 | + if ($dayOfWeek > 0) { |
|
79 | + print "<td colspan=\"$dayOfWeek\"> </td>"; |
|
80 | + } |
|
81 | 81 | |
82 | - $currentDay = 1; |
|
82 | + $currentDay = 1; |
|
83 | 83 | |
84 | - while ($currentDay <= $numberDays) { |
|
84 | + while ($currentDay <= $numberDays) { |
|
85 | 85 | |
86 | - // Seventh column (Sunday) reached. Start a new row. |
|
86 | + // Seventh column (Sunday) reached. Start a new row. |
|
87 | 87 | |
88 | - if ($dayOfWeek == 7) { |
|
88 | + if ($dayOfWeek == 7) { |
|
89 | 89 | |
90 | - $dayOfWeek = 0; |
|
91 | - ?></tr> |
|
90 | + $dayOfWeek = 0; |
|
91 | + ?></tr> |
|
92 | 92 | <tr><?php |
93 | - } |
|
94 | - |
|
95 | - $recess = recess_prettify($currentDay, $month, $year, $recess_major); |
|
96 | - |
|
97 | - // Is this day actually Today in the real world? |
|
98 | - // If so, higlight it. |
|
99 | - // Also highlight days where there are no |
|
100 | - // sittings - e.g. WH is only Tuesday-Thursday |
|
101 | - if ($currentDay == $toDay) { |
|
102 | - print '<td class="on"'; |
|
103 | - if ($recess[0] && $recess[0] != 1) { |
|
104 | - print ' title="' . $recess[0] . '"'; |
|
105 | - } |
|
106 | - print '>'; |
|
107 | - } elseif ($recess[0]) { |
|
108 | - print '<td class="no"'; |
|
109 | - if ($recess[0] != 1) { |
|
110 | - print ' title="' . $recess[0] . '"'; |
|
111 | - } |
|
112 | - print '>'; |
|
113 | - } else { |
|
114 | - print '<td>'; |
|
115 | - } |
|
116 | - |
|
117 | - // Is the $currentDay a member of $dates? If so, |
|
118 | - // the day should be linked. |
|
119 | - if (in_array($currentDay, $dates)) { |
|
120 | - |
|
121 | - $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay); |
|
122 | - |
|
123 | - if ($currentDay == $toDay) { |
|
124 | - print '<span>' . $currentDay . '</span></td>'; |
|
125 | - } else { |
|
126 | - $day_section = $section; |
|
127 | - if ($section == 'sp') { |
|
128 | - $day_section = 'spdebates'; |
|
129 | - } |
|
130 | - $urls[$day_section . 'day']->insert(['d' => $date]); |
|
131 | - print "<a href=\"" . $urls[$day_section . 'day']->generate() . "\">$currentDay</a></td>"; |
|
132 | - } |
|
133 | - |
|
134 | - // $currentDay is not a member of $dates. |
|
135 | - |
|
136 | - } else { |
|
137 | - |
|
138 | - print '<span>' . $currentDay . '</span></td>'; |
|
139 | - } |
|
140 | - // Increment counters |
|
141 | - |
|
142 | - $currentDay++; |
|
143 | - $dayOfWeek++; |
|
144 | - } |
|
145 | - |
|
146 | - // Complete the row of the last week in month, if necessary |
|
147 | - |
|
148 | - if ($dayOfWeek != 7) { |
|
149 | - |
|
150 | - $remainingDays = 7 - $dayOfWeek; |
|
151 | - print "<td colspan=\"$remainingDays\"> </td>"; |
|
152 | - } |
|
153 | - ?> |
|
93 | + } |
|
94 | + |
|
95 | + $recess = recess_prettify($currentDay, $month, $year, $recess_major); |
|
96 | + |
|
97 | + // Is this day actually Today in the real world? |
|
98 | + // If so, higlight it. |
|
99 | + // Also highlight days where there are no |
|
100 | + // sittings - e.g. WH is only Tuesday-Thursday |
|
101 | + if ($currentDay == $toDay) { |
|
102 | + print '<td class="on"'; |
|
103 | + if ($recess[0] && $recess[0] != 1) { |
|
104 | + print ' title="' . $recess[0] . '"'; |
|
105 | + } |
|
106 | + print '>'; |
|
107 | + } elseif ($recess[0]) { |
|
108 | + print '<td class="no"'; |
|
109 | + if ($recess[0] != 1) { |
|
110 | + print ' title="' . $recess[0] . '"'; |
|
111 | + } |
|
112 | + print '>'; |
|
113 | + } else { |
|
114 | + print '<td>'; |
|
115 | + } |
|
116 | + |
|
117 | + // Is the $currentDay a member of $dates? If so, |
|
118 | + // the day should be linked. |
|
119 | + if (in_array($currentDay, $dates)) { |
|
120 | + |
|
121 | + $date = sprintf("%04d-%02d-%02d", $year, $month, $currentDay); |
|
122 | + |
|
123 | + if ($currentDay == $toDay) { |
|
124 | + print '<span>' . $currentDay . '</span></td>'; |
|
125 | + } else { |
|
126 | + $day_section = $section; |
|
127 | + if ($section == 'sp') { |
|
128 | + $day_section = 'spdebates'; |
|
129 | + } |
|
130 | + $urls[$day_section . 'day']->insert(['d' => $date]); |
|
131 | + print "<a href=\"" . $urls[$day_section . 'day']->generate() . "\">$currentDay</a></td>"; |
|
132 | + } |
|
133 | + |
|
134 | + // $currentDay is not a member of $dates. |
|
135 | + |
|
136 | + } else { |
|
137 | + |
|
138 | + print '<span>' . $currentDay . '</span></td>'; |
|
139 | + } |
|
140 | + // Increment counters |
|
141 | + |
|
142 | + $currentDay++; |
|
143 | + $dayOfWeek++; |
|
144 | + } |
|
145 | + |
|
146 | + // Complete the row of the last week in month, if necessary |
|
147 | + |
|
148 | + if ($dayOfWeek != 7) { |
|
149 | + |
|
150 | + $remainingDays = 7 - $dayOfWeek; |
|
151 | + print "<td colspan=\"$remainingDays\"> </td>"; |
|
152 | + } |
|
153 | + ?> |
|
154 | 154 | </tr> |
155 | 155 | </tbody> |
156 | 156 | </table> |
157 | 157 | <?php if(!isset($years)) { ?> |
158 | 158 | <div class="calendar__footer"> |
159 | 159 | <?php |
160 | - $y = $urls['day']; |
|
161 | - $y->reset(); |
|
162 | - $y->insert([ 'y' => $year ]); |
|
163 | - $url = $y->generate(); |
|
164 | - ?> |
|
160 | + $y = $urls['day']; |
|
161 | + $y->reset(); |
|
162 | + $y->insert([ 'y' => $year ]); |
|
163 | + $url = $y->generate(); |
|
164 | + ?> |
|
165 | 165 | <a href="<?= $url ?>"><?= sprintf(gettext('See all of %s'), $year) ?></a> |
166 | 166 | </div> |
167 | 167 | <?php } ?> |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | <ul class="business-list"> |
15 | 15 | <?php |
16 | 16 | $prevlevel = ''; |
17 | - foreach ($rows as $row) { ?> |
|
17 | + foreach ($rows as $row) { ?> |
|
18 | 18 | <?php if ($row['htype'] == 10) { |
19 | 19 | if ($prevlevel == 'sub') { ?> |
20 | 20 | </ul> |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | <?php } ?> |
50 | 50 | </a> |
51 | 51 | <?php } |
52 | - if (isset($row['excerpt'])) { ?> |
|
52 | + if (isset($row['excerpt'])) { ?> |
|
53 | 53 | <p class="business-list__excerpt"> |
54 | 54 | <?= trim_characters($row['excerpt'], 0, 200) ?> |
55 | 55 | </p> |
@@ -32,9 +32,9 @@ |
||
32 | 32 | </div> |
33 | 33 | </div> |
34 | 34 | <?php } else { |
35 | - $section = false; |
|
36 | - include '_section_content.php'; |
|
37 | - } ?> |
|
35 | + $section = false; |
|
36 | + include '_section_content.php'; |
|
37 | + } ?> |
|
38 | 38 | |
39 | 39 | </div> |
40 | 40 |
@@ -116,19 +116,19 @@ discard block |
||
116 | 116 | <?php } ?> |
117 | 117 | |
118 | 118 | <?php |
119 | - if( |
|
120 | - $members || |
|
119 | + if( |
|
120 | + $members || |
|
121 | 121 | (isset($constituencies) && count($constituencies) > 0) || |
122 | 122 | ($alertsearch) |
123 | - ) { |
|
124 | - /* We need to disambiguate the user's instructions */ |
|
125 | - $member_options = false; |
|
126 | - ?> |
|
123 | + ) { |
|
124 | + /* We need to disambiguate the user's instructions */ |
|
125 | + $member_options = false; |
|
126 | + ?> |
|
127 | 127 | <div class="alert-section alert-section--disambiguation"> |
128 | 128 | <div class="alert-section__primary"> |
129 | 129 | |
130 | 130 | <?php if ($members) { |
131 | - $member_options = true; ?> |
|
131 | + $member_options = true; ?> |
|
132 | 132 | <h3><?= sprintf(gettext('Sign up for alerts when people matching <i>%s</i> speaks'), _htmlspecialchars($alertsearch)) ?></h3> |
133 | 133 | <ul> |
134 | 134 | <?php |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | <input type="hidden" name="email" value="<?= _htmlspecialchars($email) ?>"> |
141 | 141 | <input type="hidden" name="pid" value="<?= $row['person_id'] ?>"> |
142 | 142 | <?php |
143 | - $name = member_full_name($row['house'], $row['title'], $row['given_name'], $row['family_name'], $row['lordofname']); |
|
143 | + $name = member_full_name($row['house'], $row['title'], $row['given_name'], $row['family_name'], $row['lordofname']); |
|
144 | 144 | if ($row['constituency']) { |
145 | 145 | $name .= ' (' . gettext($row['constituency']) . ')'; |
146 | 146 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | <?php } ?> |
155 | 155 | |
156 | 156 | <?php if (isset($constituencies) && count($constituencies) > 0) { |
157 | - $member_options = true; ?> |
|
157 | + $member_options = true; ?> |
|
158 | 158 | <h3><?= sprintf(gettext('Sign up for alerts when MPs for constituencies matching <i>%s</i> speaks'), _htmlspecialchars($alertsearch)) ?></h3> |
159 | 159 | <ul> |
160 | 160 | <?php foreach ($constituencies as $constituency => $member) { ?> |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | <?php } ?> |
173 | 173 | |
174 | 174 | <?php if ($alertsearch) { |
175 | - if ($member_options) { ?> |
|
175 | + if ($member_options) { ?> |
|
176 | 176 | <h3><?= gettext('Sign up for alerts for topics') ?></h3> |
177 | 177 | <?php } else { ?> |
178 | 178 | <h3><?= gettext('Great! Can you just confirm what you mean?') ?></h3> |
@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | want? You will only get an alert if all of these |
203 | 203 | are mentioned in the same debate.') ?> |
204 | 204 | <?php if (isset($member_alertsearch)) { |
205 | - printf(gettext('Did you mean to get alerts for when your representative mentions something instead? If so maybe you want to subscribe to…')); |
|
206 | - } ?> |
|
205 | + printf(gettext('Did you mean to get alerts for when your representative mentions something instead? If so maybe you want to subscribe to…')); |
|
206 | + } ?> |
|
207 | 207 | </em> |
208 | 208 | <?php } ?> |
209 | 209 | </li> |
@@ -287,9 +287,9 @@ discard block |
||
287 | 287 | <h3> |
288 | 288 | <?php |
289 | 289 | $name = $pid_member->full_name(); |
290 | - if ($pid_member->constituency()) { |
|
291 | - $name .= ' (' . _htmlspecialchars($pid_member->constituency()) . ')'; |
|
292 | - } ?> |
|
290 | + if ($pid_member->constituency()) { |
|
291 | + $name .= ' (' . _htmlspecialchars($pid_member->constituency()) . ')'; |
|
292 | + } ?> |
|
293 | 293 | <?= sprintf(gettext('Sign up for an alert when %s speaks.'), $name) ?> |
294 | 294 | </h3> |
295 | 295 | <?php } elseif ($keyword) { ?> |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | </div> |
83 | 83 | |
84 | 84 | <?php } else { |
85 | - $pc_form = ($type == 'mlas' || $type == 'msps' || $type == 'mss'); |
|
86 | - ?> |
|
85 | + $pc_form = ($type == 'mlas' || $type == 'msps' || $type == 'mss'); |
|
86 | + ?> |
|
87 | 87 | |
88 | 88 | <form action="/<?= $pc_form ? 'postcode' : 'search' ?>/"> |
89 | 89 | <div class="search-page__section search-page__section--search"> |
@@ -107,10 +107,10 @@ discard block |
||
107 | 107 | |
108 | 108 | <div class="search-page__section search-page__section--results"> |
109 | 109 | <?php |
110 | - if (isset($former)) { |
|
111 | - if ($type == 'mps') { |
|
112 | - # No reps. Election period! |
|
113 | - ?> |
|
110 | + if (isset($former)) { |
|
111 | + if ($type == 'mps') { |
|
112 | + # No reps. Election period! |
|
113 | + ?> |
|
114 | 114 | <div class="search-page__section__primary"> |
115 | 115 | During the period from the dissolution of Parliament to the general election, there are no Members of Parliament. |
116 | 116 | <a href="/mps/?date=<?=$dissolution[1] ?>">View list of MPs as it was when Parliament was dissolved</a> |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | </div> |
133 | 133 | <?php |
134 | 134 | } |
135 | - } else { ?> |
|
135 | + } else { ?> |
|
136 | 136 | |
137 | 137 | <div class="search-page__section__primary"> |
138 | 138 | <h2><?= sprintf(gettext('All %s'), $rep_plural) ?></h2> |
@@ -201,18 +201,18 @@ discard block |
||
201 | 201 | $a_to_z_key = 'given_name'; |
202 | 202 | } |
203 | 203 | } |
204 | - $initial_link = ''; |
|
205 | - foreach ($data as $person) { |
|
206 | - if ($order != 'party') { |
|
207 | - $initial = substr(strtoupper($person[$a_to_z_key]), 0, 1); |
|
208 | - if ($initial != $current_initial) { |
|
209 | - $current_initial = $initial; |
|
210 | - $initial_link = "name=\"$initial\" "; |
|
211 | - } else { |
|
212 | - $initial_link = ""; |
|
213 | - } |
|
214 | - } |
|
215 | - ?> |
|
204 | + $initial_link = ''; |
|
205 | + foreach ($data as $person) { |
|
206 | + if ($order != 'party') { |
|
207 | + $initial = substr(strtoupper($person[$a_to_z_key]), 0, 1); |
|
208 | + if ($initial != $current_initial) { |
|
209 | + $current_initial = $initial; |
|
210 | + $initial_link = "name=\"$initial\" "; |
|
211 | + } else { |
|
212 | + $initial_link = ""; |
|
213 | + } |
|
214 | + } |
|
215 | + ?> |
|
216 | 216 | <a <?= $initial_link ?>href="/mp/<?= $person['url'] ?>" class="people-list__person"> |
217 | 217 | <noscript class="loading-lazy"> |
218 | 218 | <img class="people-list__person__image" src="<?= $person['image'] ?>" loading="lazy" alt=""> |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | </h2> |
27 | 27 | |
28 | 28 | <?php if (isset($data['mp_data'])) { |
29 | - include('_your_mp.php'); |
|
30 | - } ?> |
|
29 | + include('_your_mp.php'); |
|
30 | + } ?> |
|
31 | 31 | |
32 | 32 | <div class="debate-speech__division__details"> |
33 | 33 | <p> |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | <?php } else { ?> |
39 | 39 | <?php if ($mp_vote['with_majority']) { ?> |
40 | 40 | <?php $vote_prefix = 'A majority of ' . $division['members']['plural'] . ' <b>agreed</b> and'; |
41 | - include('_vote_description.php'); ?> |
|
41 | + include('_vote_description.php'); ?> |
|
42 | 42 | <?php } else { ?> |
43 | 43 | <?php $vote_prefix = 'A majority of ' . $division['members']['plural'] . ' <b>disagreed</b> and'; |
44 | - include('_vote_description.php'); ?> |
|
44 | + include('_vote_description.php'); ?> |
|
45 | 45 | <?php } ?> |
46 | 46 | <?php } ?> |
47 | 47 | </p> |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <p> |
2 | 2 | <a href="#for"><?= sprintf(gettext('%s for'), $division['for']) ?></a>, |
3 | 3 | <a href="#against"><?= sprintf(gettext('%s against'), $division['against']) ?></a><?php |
4 | - if ($division['both'] > 0) { ?>, |
|
4 | + if ($division['both'] > 0) { ?>, |
|
5 | 5 | <a href="#both"><?= sprintf(gettext('%s abstained'), $division['both']) ?></a><?php |
6 | - } |
|
6 | + } |
|
7 | 7 | if ($division['absent'] > 0) { ?>, |
8 | 8 | <a href="#absent"><?= sprintf(gettext('%s absent'), $division['absent']) ?></a><?php |
9 | 9 | } ?>. |
@@ -11,29 +11,29 @@ |
||
11 | 11 | <a href="<?= $data['mp_data']['mp_url'] ?>" class="your-mp__content"> |
12 | 12 | <?php if (isset($mp_vote)) { ?> |
13 | 13 | <span class="your-mp__vote your-mp__vote--<?= $mp_vote['vote'] ?>"><?php |
14 | - switch ($mp_vote['vote']) { |
|
15 | - case 'aye': |
|
14 | + switch ($mp_vote['vote']) { |
|
15 | + case 'aye': |
|
16 | 16 | echo 'Aye'; |
17 | - break; |
|
18 | - case 'no': |
|
17 | + break; |
|
18 | + case 'no': |
|
19 | 19 | echo 'No'; |
20 | - break; |
|
21 | - case 'absent': |
|
20 | + break; |
|
21 | + case 'absent': |
|
22 | 22 | echo 'Absent'; |
23 | - break; |
|
24 | - case 'both': |
|
23 | + break; |
|
24 | + case 'both': |
|
25 | 25 | echo 'Abstain'; |
26 | - break; |
|
27 | - case 'tellaye': |
|
26 | + break; |
|
27 | + case 'tellaye': |
|
28 | 28 | echo 'Aye (Teller)'; |
29 | - break; |
|
30 | - case 'tellno': |
|
29 | + break; |
|
30 | + case 'tellno': |
|
31 | 31 | echo 'No (Teller)'; |
32 | - break; |
|
33 | - default: |
|
32 | + break; |
|
33 | + default: |
|
34 | 34 | echo 'N/A'; |
35 | - } |
|
36 | - ?></span> |
|
35 | + } |
|
36 | + ?></span> |
|
37 | 37 | <?php } elseif (isset($before_mp) || isset($after_mp)) { ?> |
38 | 38 | <span class="your-mp__vote">N/A</span> |
39 | 39 | <?php } ?> |