@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | <input type="text" name="q" value="<?= _htmlentities($search_keyword) ?>" class="form-control"> |
5 | 5 | <input type="submit" class="button" value="Search"> |
6 | 6 | </p> |
7 | - <?php if (isset($warnings) ) { ?> |
|
7 | + <?php if (isset($warnings)) { ?> |
|
8 | 8 | <p class="error"> |
9 | 9 | <?= $warnings ?> |
10 | 10 | </p> |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | <p> |
19 | 19 | <ul class="search-result-display-options"> |
20 | 20 | <li><a href="#options" class="search-options-toggle js-toggle-search-options">Advanced search</a></li> |
21 | - <?php if ( $is_adv ) { ?> |
|
21 | + <?php if ($is_adv) { ?> |
|
22 | 22 | <?= $search_phrase ? '<li>Exactly: ' . _htmlentities($search_phrase) . '</li>' : '' ?> |
23 | 23 | <?= $search_exclude ? '<li>Excluding: ' . _htmlentities($search_exclude) . '</li>' : '' ?> |
24 | 24 | <?= $search_from ? '<li>From: ' . _htmlentities($search_from) . '</li>' : '' ?> |
@@ -4,7 +4,7 @@ |
||
4 | 4 | <p class="search-result__description"> |
5 | 5 | <?php $details = $member->getMostRecentMembership(); ?> |
6 | 6 | <?= $details['left_house'] != '9999-12-31' ? 'Former ' : '' ?><?= $details['party'] ? $details['party'] . ' ' : '' ?><?= $details['rep_name'] ?><?= $details['cons'] ? ', ' . $details['cons'] : ''?> |
7 | - <?php if ( $details['entered_house'] || ( $details['left_house'] && $details['left_house'] != '9999-12-31' ) ) { ?> |
|
7 | + <?php if ($details['entered_house'] || ($details['left_house'] && $details['left_house'] != '9999-12-31')) { ?> |
|
8 | 8 | , <?= format_date($details['entered_house'], SHORTDATEFORMAT) ?> – <?= $details['left_house'] != '9999-12-31' ? format_date($details['left_house'], SHORTDATEFORMAT) : '' ?> |
9 | 9 | <?php } ?> |
10 | 10 | </p> |
@@ -9,17 +9,17 @@ discard block |
||
9 | 9 | <div class="search-page__section__primary"> |
10 | 10 | <h2>Who says <em class="current-search-term"><?= _htmlentities($searchstring) ?></em> the most?</h2> |
11 | 11 | |
12 | - <?php if ( isset($error) ) { ?> |
|
13 | - <?php if ( $error == 'No results' && isset( $house ) && $house != 0 ) { ?> |
|
12 | + <?php if (isset($error)) { ?> |
|
13 | + <?php if ($error == 'No results' && isset($house) && $house != 0) { ?> |
|
14 | 14 | <ul class="search-result-display-options"> |
15 | 15 | <li> |
16 | - <?php if ( $house == 1 ) { ?> |
|
16 | + <?php if ($house == 1) { ?> |
|
17 | 17 | No results for MPs only |
18 | - <?php } else if ( $house == 2 ) { ?> |
|
18 | + <?php } else if ($house == 2) { ?> |
|
19 | 19 | No results for Peers only |
20 | - <?php } else if ( $house == 4 ) { ?> |
|
20 | + <?php } else if ($house == 4) { ?> |
|
21 | 21 | No results for MSPs only |
22 | - <?php } else if ( $house == 3 ) { ?> |
|
22 | + <?php } else if ($house == 3) { ?> |
|
23 | 23 | No results for MLAs only |
24 | 24 | <?php } ?> |
25 | 25 | | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | <?php } ?> |
32 | 32 | <?php } ?> |
33 | 33 | |
34 | - <?php if ( $wtt ) { ?> |
|
34 | + <?php if ($wtt) { ?> |
|
35 | 35 | <p><strong>Now, try reading what a couple of these Lords are saying, |
36 | 36 | to help you find someone appropriate. When you've found someone, |
37 | 37 | hit the "I want to write to this Lord" button on their results page |
@@ -39,37 +39,37 @@ discard block |
||
39 | 39 | </strong></p> |
40 | 40 | <?php } ?> |
41 | 41 | |
42 | - <?php if ( isset($speakers) && count($speakers) ) { ?> |
|
42 | + <?php if (isset($speakers) && count($speakers)) { ?> |
|
43 | 43 | |
44 | - <?php if ( !$wtt ) { ?> |
|
44 | + <?php if (!$wtt) { ?> |
|
45 | 45 | <ul class="search-result-display-options"> |
46 | 46 | <li>Results grouped by person</li> |
47 | 47 | <li> |
48 | - <?php if ( $house == 0 ) { ?> |
|
48 | + <?php if ($house == 0) { ?> |
|
49 | 49 | Show All |
50 | 50 | <?php } else { ?> |
51 | 51 | <a href="<?= $this_url->generate('html') ?>">Show All</a> |
52 | 52 | <?php } ?> |
53 | 53 | | |
54 | - <?php if ( $house == 1 ) { ?> |
|
54 | + <?php if ($house == 1) { ?> |
|
55 | 55 | MPs only |
56 | 56 | <?php } else { ?> |
57 | 57 | <a href="<?= $this_url->generate('html', array('house'=>1)) ?>">MPs only</a> |
58 | 58 | <?php } ?> |
59 | 59 | | |
60 | - <?php if ( $house == 2 ) { ?> |
|
60 | + <?php if ($house == 2) { ?> |
|
61 | 61 | Peers only |
62 | 62 | <?php } else { ?> |
63 | 63 | <a href="<?= $this_url->generate('html', array('house'=>2)) ?>">Lords only</a> |
64 | 64 | <?php } ?> |
65 | 65 | | |
66 | - <?php if ( $house == 4 ) { ?> |
|
66 | + <?php if ($house == 4) { ?> |
|
67 | 67 | MSPs only |
68 | 68 | <?php } else { ?> |
69 | 69 | <a href="<?= $this_url->generate('html', array('house'=>4)) ?>">MSPs only</a> |
70 | 70 | <?php } ?> |
71 | 71 | | |
72 | - <?php if ( $house == 3 ) { ?> |
|
72 | + <?php if ($house == 3) { ?> |
|
73 | 73 | MLAs only |
74 | 74 | <?php } else { ?> |
75 | 75 | <a href="<?= $this_url->generate('html', array('house'=>3)) ?>">MLAs only</a> |
@@ -90,25 +90,25 @@ discard block |
||
90 | 90 | </tr> |
91 | 91 | </thead> |
92 | 92 | <tbody> |
93 | - <?php foreach ( $speakers as $pid => $speaker ) { ?> |
|
93 | + <?php foreach ($speakers as $pid => $speaker) { ?> |
|
94 | 94 | |
95 | - <?php if ( $wtt && $pid == 0 ) { continue; } // skip heading count for WTT lords list ?> |
|
95 | + <?php if ($wtt && $pid == 0) { continue; } // skip heading count for WTT lords list ?> |
|
96 | 96 | |
97 | 97 | <tr> |
98 | 98 | <td><?= $speaker['count'] ?></td> |
99 | 99 | <td> |
100 | - <?php if ( $pid ) { ?> |
|
101 | - <?php if ( !$wtt || $speaker['left'] == '9999-12-31' ) { ?> |
|
100 | + <?php if ($pid) { ?> |
|
101 | + <?php if (!$wtt || $speaker['left'] == '9999-12-31') { ?> |
|
102 | 102 | <a href="/search/?q=<?= _htmlentities($searchstring) ?>&pid=<?= $pid ?><?= isset($wtt) && $speaker['left'] == '9999-12-31' ? '&wtt=2' : '' ?>"> |
103 | 103 | <?php } ?> |
104 | 104 | <?= isset($speaker['name']) ? $speaker['name'] : 'N/A' ?> |
105 | - <?php if ( !$wtt || $speaker['left'] == '9999-12-31' ) { ?> |
|
105 | + <?php if (!$wtt || $speaker['left'] == '9999-12-31') { ?> |
|
106 | 106 | </a> |
107 | 107 | <?php } ?> |
108 | - <?php if ( isset($speaker['party']) ) { ?> |
|
108 | + <?php if (isset($speaker['party'])) { ?> |
|
109 | 109 | <span class="search-results-grouped__speaker-party">(<?= $speaker['party'] ?>)</span> |
110 | 110 | <?php } ?> |
111 | - <?php if ( $house != 2 ) { ?> |
|
111 | + <?php if ($house != 2) { ?> |
|
112 | 112 | <?= isset($speaker['office']) ? ' - ' . join('; ', $speaker['office']) : '' ?> |
113 | 113 | <?php } ?> |
114 | 114 | <?php } else { // no $pid ?> |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | <?php } ?> |
117 | 117 | </td> |
118 | 118 | <td> |
119 | - <?php if ( format_date($speaker['pmindate'], 'M Y') == format_date($speaker['pmaxdate'], 'M Y') ) { ?> |
|
119 | + <?php if (format_date($speaker['pmindate'], 'M Y') == format_date($speaker['pmaxdate'], 'M Y')) { ?> |
|
120 | 120 | <?= format_date($speaker['pmindate'], 'M Y') ?> |
121 | 121 | <?php } else { ?> |
122 | 122 | <?= format_date($speaker['pmindate'], 'M Y') ?> – <?= format_date($speaker['pmaxdate'], 'M Y') ?> |
@@ -15,18 +15,22 @@ discard block |
||
15 | 15 | <li> |
16 | 16 | <?php if ( $house == 1 ) { ?> |
17 | 17 | No results for MPs only |
18 | - <?php } else if ( $house == 2 ) { ?> |
|
18 | + <?php } |
|
19 | +else if ( $house == 2 ) { ?> |
|
19 | 20 | No results for Peers only |
20 | - <?php } else if ( $house == 4 ) { ?> |
|
21 | + <?php } |
|
22 | +else if ( $house == 4 ) { ?> |
|
21 | 23 | No results for MSPs only |
22 | - <?php } else if ( $house == 3 ) { ?> |
|
24 | + <?php } |
|
25 | +else if ( $house == 3 ) { ?> |
|
23 | 26 | No results for MLAs only |
24 | 27 | <?php } ?> |
25 | 28 | | |
26 | 29 | <a href="<?= $this_url->generate('html') ?>">Show results for all speakers</a> |
27 | 30 | </li> |
28 | 31 | </ul> |
29 | - <?php } else { ?> |
|
32 | + <?php } |
|
33 | +else { ?> |
|
30 | 34 | <p class="search-results-legend"><?= $error ?></p> |
31 | 35 | <?php } ?> |
32 | 36 | <?php } ?> |
@@ -47,31 +51,36 @@ discard block |
||
47 | 51 | <li> |
48 | 52 | <?php if ( $house == 0 ) { ?> |
49 | 53 | Show All |
50 | - <?php } else { ?> |
|
54 | + <?php } |
|
55 | +else { ?> |
|
51 | 56 | <a href="<?= $this_url->generate('html') ?>">Show All</a> |
52 | 57 | <?php } ?> |
53 | 58 | | |
54 | 59 | <?php if ( $house == 1 ) { ?> |
55 | 60 | MPs only |
56 | - <?php } else { ?> |
|
61 | + <?php } |
|
62 | +else { ?> |
|
57 | 63 | <a href="<?= $this_url->generate('html', array('house'=>1)) ?>">MPs only</a> |
58 | 64 | <?php } ?> |
59 | 65 | | |
60 | 66 | <?php if ( $house == 2 ) { ?> |
61 | 67 | Peers only |
62 | - <?php } else { ?> |
|
68 | + <?php } |
|
69 | +else { ?> |
|
63 | 70 | <a href="<?= $this_url->generate('html', array('house'=>2)) ?>">Lords only</a> |
64 | 71 | <?php } ?> |
65 | 72 | | |
66 | 73 | <?php if ( $house == 4 ) { ?> |
67 | 74 | MSPs only |
68 | - <?php } else { ?> |
|
75 | + <?php } |
|
76 | +else { ?> |
|
69 | 77 | <a href="<?= $this_url->generate('html', array('house'=>4)) ?>">MSPs only</a> |
70 | 78 | <?php } ?> |
71 | 79 | | |
72 | 80 | <?php if ( $house == 3 ) { ?> |
73 | 81 | MLAs only |
74 | - <?php } else { ?> |
|
82 | + <?php } |
|
83 | +else { ?> |
|
75 | 84 | <a href="<?= $this_url->generate('html', array('house'=>3)) ?>">MLAs only</a> |
76 | 85 | <?php } ?> |
77 | 86 | </li> |
@@ -111,14 +120,17 @@ discard block |
||
111 | 120 | <?php if ( $house != 2 ) { ?> |
112 | 121 | <?= isset($speaker['office']) ? ' - ' . join('; ', $speaker['office']) : '' ?> |
113 | 122 | <?php } ?> |
114 | - <?php } else { // no $pid ?> |
|
123 | + <?php } |
|
124 | +else { |
|
125 | +// no $pid ?> |
|
115 | 126 | <?= $speaker['name'] ?> |
116 | 127 | <?php } ?> |
117 | 128 | </td> |
118 | 129 | <td> |
119 | 130 | <?php if ( format_date($speaker['pmindate'], 'M Y') == format_date($speaker['pmaxdate'], 'M Y') ) { ?> |
120 | 131 | <?= format_date($speaker['pmindate'], 'M Y') ?> |
121 | - <?php } else { ?> |
|
132 | + <?php } |
|
133 | +else { ?> |
|
122 | 134 | <?= format_date($speaker['pmindate'], 'M Y') ?> – <?= format_date($speaker['pmaxdate'], 'M Y') ?> |
123 | 135 | <?php } ?> |
124 | 136 | </td> |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <div class="search-page__section__secondary search-page-sidebar"> |
2 | - <?php if ( isset( $search_sidebar['email'] ) ) { ?> |
|
2 | + <?php if (isset($search_sidebar['email'])) { ?> |
|
3 | 3 | <h2>Create an alert</h2> |
4 | 4 | <p class="sidebar-item-with-icon"> |
5 | 5 | <a href="<?= $search_sidebar['email'] ?>">Subscribe to an email alert</a> |
6 | 6 | for <em class="current-search-term"><?= $search_sidebar['email_desc'] ?></em> |
7 | - <?php if (isset( $search_sidebar['email_section'] ) ) { ?> |
|
7 | + <?php if (isset($search_sidebar['email_section'])) { ?> |
|
8 | 8 | <br><small>(or just <a href="<?= $search_sidebar['email_section'] ?>"><?= $search_sidebar['email_desc_section'] ?></a>)</small> |
9 | 9 | <?php } ?> |
10 | 10 | </p> |
@@ -16,5 +16,5 @@ discard block |
||
16 | 16 | <?php } ?> |
17 | 17 | |
18 | 18 | |
19 | - <?php include( dirname(__FILE__) . '/../sidebar/looking_for.php' ) ?> |
|
19 | + <?php include(dirname(__FILE__) . '/../sidebar/looking_for.php') ?> |
|
20 | 20 | </div> |
@@ -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"; |
@@ -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 \MySociety\TheyWorkForYou\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'])) { |
@@ -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"> |