@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | public function display() { |
8 | 8 | $data = array(); |
9 | 9 | $data['recent_election'] = false; |
10 | - if ( $this->user->loggedin() ) { |
|
10 | + if ($this->user->loggedin()) { |
|
11 | 11 | $data['user_signed_in'] = true; |
12 | 12 | } |
13 | 13 | |
@@ -17,21 +17,21 @@ discard block |
||
17 | 17 | $data['postcode'] = get_http_var('postcode'); |
18 | 18 | |
19 | 19 | $result = $this->createAlertForPostCode($data['email'], $data['postcode']); |
20 | - $data = array_merge( $data, $result ); |
|
20 | + $data = array_merge($data, $result); |
|
21 | 21 | } elseif (get_http_var('update')) { |
22 | 22 | $result = $this->getNewMP(get_http_var('update')); |
23 | - $data = array_merge( $data, $result ); |
|
23 | + $data = array_merge($data, $result); |
|
24 | 24 | } elseif (get_http_var('update-alert')) { |
25 | - $success = $this->replaceAlert( get_http_var('confirmation') ); |
|
25 | + $success = $this->replaceAlert(get_http_var('confirmation')); |
|
26 | 26 | $data['confirmation_received'] = $success; |
27 | 27 | } elseif (get_http_var('confirmed')) { |
28 | - $success = $this->confirmAlert( get_http_var('confirmed') ); |
|
28 | + $success = $this->confirmAlert(get_http_var('confirmed')); |
|
29 | 29 | $data['confirmation_received'] = $success; |
30 | 30 | } else { |
31 | 31 | $data['email'] = $this->user->email() ? $this->user->email() : ''; |
32 | 32 | $data['postcode'] = $this->user->postcode_is_set() ? $this->user->postcode() : ''; |
33 | 33 | |
34 | - if ( $this->isEmailSignedUpForPostCode( $data['email'], $data['postcode'] ) ) { |
|
34 | + if ($this->isEmailSignedUpForPostCode($data['email'], $data['postcode'])) { |
|
35 | 35 | $data['already_signed_up'] = True; |
36 | 36 | $mp = $this->getPersonFromPostcode($data['postcode']); |
37 | 37 | $data['mp_name'] = $mp->full_name(); |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | private function createAlertForPostCode($email, $postcode) { |
69 | - if ( !$this->validateDetails($email, $postcode) ) { |
|
69 | + if (!$this->validateDetails($email, $postcode)) { |
|
70 | 70 | return array('invalid-postcode-or-email' => True); |
71 | 71 | } |
72 | 72 | |
73 | 73 | try { |
74 | 74 | $person = $this->getPersonFromPostcode($postcode); |
75 | - } catch ( \MySociety\TheyWorkForYou\MemberException $e ) { |
|
75 | + } catch (\MySociety\TheyWorkForYou\MemberException $e) { |
|
76 | 76 | return array('bad-constituency' => True); |
77 | 77 | } |
78 | 78 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | switch ($result) { |
91 | 91 | case self::ALERT_EXISTS: |
92 | - if ( $not_logged_in ) { |
|
92 | + if ($not_logged_in) { |
|
93 | 93 | // no logged in user so send them an email to let them |
94 | 94 | // know someone tried to create an alert |
95 | 95 | $this->alert->send_already_signedup_email($details); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $data['error'] = True; |
103 | 103 | break; |
104 | 104 | default: // alert created |
105 | - if ( $not_logged_in ) { |
|
105 | + if ($not_logged_in) { |
|
106 | 106 | $data['confirmation_sent'] = True; |
107 | 107 | } else { |
108 | 108 | $data['signedup_no_confirm'] = True; |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | $existing = $this->alert->fetch_by_token($confirmation); |
117 | 117 | preg_match('/speaker:(\d+)/', $existing['criteria'], $matches); |
118 | 118 | $old_mp_id = $matches[1]; |
119 | - $old_mp = new \MySociety\TheyWorkForYou\Member(array( 'person_id' => $old_mp_id ) ); |
|
120 | - $new_mp = new \MySociety\TheyWorkForYou\Member(array( 'constituency' => $old_mp->constituency, 'house' => 1 )); |
|
119 | + $old_mp = new \MySociety\TheyWorkForYou\Member(array('person_id' => $old_mp_id)); |
|
120 | + $new_mp = new \MySociety\TheyWorkForYou\Member(array('constituency' => $old_mp->constituency, 'house' => 1)); |
|
121 | 121 | |
122 | 122 | $q = $this->db->query( |
123 | 123 | "SELECT alert_id, criteria, registrationtoken FROM alerts |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | 'pid' => $new_mp->person_id, |
142 | 142 | 'pc' => '', |
143 | 143 | ); |
144 | - if ( $other_criteria ) { |
|
144 | + if ($other_criteria) { |
|
145 | 145 | $details['keyword'] = $other_criteria; |
146 | 146 | } |
147 | 147 | |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | private function isEmailSignedUpForPostCode($email, $postcode) { |
159 | 159 | $is_signed_up = false; |
160 | 160 | |
161 | - if ( $email && $postcode ) { |
|
161 | + if ($email && $postcode) { |
|
162 | 162 | try { |
163 | 163 | $person = $this->getPersonFromPostcode($postcode); |
164 | 164 | $is_signed_up = $this->alert->fetch_by_mp($email, $person->person_id); |
165 | - } catch ( \MySociety\TheyWorkForYou\MemberException $e ) { |
|
165 | + } catch (\MySociety\TheyWorkForYou\MemberException $e) { |
|
166 | 166 | $is_signed_up = false; |
167 | 167 | } |
168 | 168 | } |
@@ -178,10 +178,10 @@ discard block |
||
178 | 178 | preg_match('/speaker:(\d+)/', $existing['criteria'], $matches); |
179 | 179 | $criteria = $matches[1]; |
180 | 180 | |
181 | - $old_mp = new \MySociety\TheyWorkForYou\Member(array( 'person_id' => $criteria ) ); |
|
182 | - $new_mp = new \MySociety\TheyWorkForYou\Member(array( 'constituency' => $old_mp->constituency, 'house' => 1 )); |
|
181 | + $old_mp = new \MySociety\TheyWorkForYou\Member(array('person_id' => $criteria)); |
|
182 | + $new_mp = new \MySociety\TheyWorkForYou\Member(array('constituency' => $old_mp->constituency, 'house' => 1)); |
|
183 | 183 | |
184 | - if ( $this->alert->fetch_by_mp( $existing['email'], $new_mp->person_id) ) { |
|
184 | + if ($this->alert->fetch_by_mp($existing['email'], $new_mp->person_id)) { |
|
185 | 185 | $data = array( |
186 | 186 | 'already_signed_up' => True, |
187 | 187 | 'old_mp' => $old_mp->full_name(), |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $data['postcode'] = $this->user->postcode_is_set() ? $this->user->postcode() : ''; |
33 | 33 | |
34 | 34 | if ( $this->isEmailSignedUpForPostCode( $data['email'], $data['postcode'] ) ) { |
35 | - $data['already_signed_up'] = True; |
|
35 | + $data['already_signed_up'] = true; |
|
36 | 36 | $mp = $this->getPersonFromPostcode($data['postcode']); |
37 | 37 | $data['mp_name'] = $mp->full_name(); |
38 | 38 | } |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | |
68 | 68 | private function createAlertForPostCode($email, $postcode) { |
69 | 69 | if ( !$this->validateDetails($email, $postcode) ) { |
70 | - return array('invalid-postcode-or-email' => True); |
|
70 | + return array('invalid-postcode-or-email' => true); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | try { |
74 | 74 | $person = $this->getPersonFromPostcode($postcode); |
75 | 75 | } catch ( \MySociety\TheyWorkForYou\MemberException $e ) { |
76 | - return array('bad-constituency' => True); |
|
76 | + return array('bad-constituency' => true); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | $details = array( |
@@ -93,19 +93,19 @@ discard block |
||
93 | 93 | // no logged in user so send them an email to let them |
94 | 94 | // know someone tried to create an alert |
95 | 95 | $this->alert->send_already_signedup_email($details); |
96 | - $data['confirmation_sent'] = True; |
|
96 | + $data['confirmation_sent'] = true; |
|
97 | 97 | } else { |
98 | - $data['already_signed_up'] = True; |
|
98 | + $data['already_signed_up'] = true; |
|
99 | 99 | } |
100 | 100 | break; |
101 | 101 | case self::CREATE_FAILED: |
102 | - $data['error'] = True; |
|
102 | + $data['error'] = true; |
|
103 | 103 | break; |
104 | 104 | default: // alert created |
105 | 105 | if ( $not_logged_in ) { |
106 | - $data['confirmation_sent'] = True; |
|
106 | + $data['confirmation_sent'] = true; |
|
107 | 107 | } else { |
108 | - $data['signedup_no_confirm'] = True; |
|
108 | + $data['signedup_no_confirm'] = true; |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | } |
147 | 147 | |
148 | 148 | $this->alert->delete($row['alert_id'] . '::' . $row['registrationtoken']); |
149 | - $this->alert->add($details, False); |
|
149 | + $this->alert->add($details, false); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | return array( |
153 | - 'signedup_no_confirm' => True, |
|
153 | + 'signedup_no_confirm' => true, |
|
154 | 154 | 'new_mp' => $new_mp->full_name(), |
155 | 155 | ); |
156 | 156 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | if ( $this->alert->fetch_by_mp( $existing['email'], $new_mp->person_id) ) { |
185 | 185 | $data = array( |
186 | - 'already_signed_up' => True, |
|
186 | + 'already_signed_up' => true, |
|
187 | 187 | 'old_mp' => $old_mp->full_name(), |
188 | 188 | 'mp_name' => $new_mp->full_name(), |
189 | 189 | ); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | ); |
195 | 195 | } |
196 | 196 | |
197 | - $data['update'] = True; |
|
197 | + $data['update'] = true; |
|
198 | 198 | $data['confirmation'] = $confirmation; |
199 | 199 | |
200 | 200 | return $data; |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $this->db = new \ParlDB; |
24 | 24 | } |
25 | 25 | |
26 | - private function query($where='') { |
|
26 | + private function query($where = '') { |
|
27 | 27 | $q = $this->db->query( |
28 | 28 | "SELECT id, slug, title, description, search_string, front_page, image FROM topics $where" |
29 | 29 | ); |
@@ -41,15 +41,15 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | public function getTopic($topic_name) { |
44 | - $q = $this->db->query( |
|
45 | - "SELECT id, slug, title, description, search_string, front_page, image FROM topics WHERE slug = :slug", |
|
46 | - array(':slug' => $topic_name) |
|
47 | - )->first(); |
|
48 | - if ($q) { |
|
49 | - return new Topic($q); |
|
50 | - } |
|
44 | + $q = $this->db->query( |
|
45 | + "SELECT id, slug, title, description, search_string, front_page, image FROM topics WHERE slug = :slug", |
|
46 | + array(':slug' => $topic_name) |
|
47 | + )->first(); |
|
48 | + if ($q) { |
|
49 | + return new Topic($q); |
|
50 | + } |
|
51 | 51 | |
52 | - return NULL; |
|
52 | + return NULL; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | public function getFrontPageTopics() { |
@@ -60,15 +60,15 @@ discard block |
||
60 | 60 | // PDO doesn't cope with arrays so we have to do this by hand :| |
61 | 61 | $quoted = array(); |
62 | 62 | if ($topics) { |
63 | - foreach ($topics as $topic) { |
|
64 | - $quoted[] = $this->db->quote($topic); |
|
65 | - } |
|
66 | - $topics_str = implode(',', $quoted); |
|
63 | + foreach ($topics as $topic) { |
|
64 | + $quoted[] = $this->db->quote($topic); |
|
65 | + } |
|
66 | + $topics_str = implode(',', $quoted); |
|
67 | 67 | |
68 | - $this->db->query("UPDATE topics SET front_page = TRUE WHERE slug IN ($topics_str)"); |
|
69 | - $this->db->query("UPDATE topics SET front_page = FALSE WHERE slug NOT IN ($topics_str)"); |
|
68 | + $this->db->query("UPDATE topics SET front_page = TRUE WHERE slug IN ($topics_str)"); |
|
69 | + $this->db->query("UPDATE topics SET front_page = FALSE WHERE slug NOT IN ($topics_str)"); |
|
70 | 70 | } else { |
71 | - $this->db->query("UPDATE topics SET front_page = FALSE"); |
|
71 | + $this->db->query("UPDATE topics SET front_page = FALSE"); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | return true; |
@@ -49,7 +49,7 @@ |
||
49 | 49 | return new Topic($q); |
50 | 50 | } |
51 | 51 | |
52 | - return NULL; |
|
52 | + return null; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | public function getFrontPageTopics() { |
@@ -10,12 +10,12 @@ |
||
10 | 10 | order by hdate, hpos'); |
11 | 11 | $last = array('hdate'=>''); |
12 | 12 | foreach ($q as $row) { |
13 | - if ($row['hdate'] != $last['hdate']) |
|
14 | - $last = array(); |
|
15 | - if ($last && $row['atime'] < $last['atime']-5) { |
|
16 | - print "PROBLEM; current row is $row[gid] $row[hdate] $row[atime]\n"; |
|
17 | - print " Last was $last[gid] $last[hdate] $last[atime]\n"; |
|
18 | - } |
|
19 | - $last = $row; |
|
13 | + if ($row['hdate'] != $last['hdate']) |
|
14 | + $last = array(); |
|
15 | + if ($last && $row['atime'] < $last['atime']-5) { |
|
16 | + print "PROBLEM; current row is $row[gid] $row[hdate] $row[atime]\n"; |
|
17 | + print " Last was $last[gid] $last[hdate] $last[atime]\n"; |
|
18 | + } |
|
19 | + $last = $row; |
|
20 | 20 | } |
21 | 21 |
@@ -12,7 +12,7 @@ |
||
12 | 12 | foreach ($q as $row) { |
13 | 13 | if ($row['hdate'] != $last['hdate']) |
14 | 14 | $last = array(); |
15 | - if ($last && $row['atime'] < $last['atime']-5) { |
|
15 | + if ($last && $row['atime'] < $last['atime'] - 5) { |
|
16 | 16 | print "PROBLEM; current row is $row[gid] $row[hdate] $row[atime]\n"; |
17 | 17 | print " Last was $last[gid] $last[hdate] $last[atime]\n"; |
18 | 18 | } |
@@ -10,8 +10,9 @@ |
||
10 | 10 | order by hdate, hpos'); |
11 | 11 | $last = array('hdate'=>''); |
12 | 12 | foreach ($q as $row) { |
13 | - if ($row['hdate'] != $last['hdate']) |
|
14 | - $last = array(); |
|
13 | + if ($row['hdate'] != $last['hdate']) { |
|
14 | + $last = array(); |
|
15 | + } |
|
15 | 16 | if ($last && $row['atime'] < $last['atime']-5) { |
16 | 17 | print "PROBLEM; current row is $row[gid] $row[hdate] $row[atime]\n"; |
17 | 18 | print " Last was $last[gid] $last[hdate] $last[atime]\n"; |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | $db = new ParlDB; |
7 | 7 | |
8 | 8 | $q = $db->query( |
9 | - 'select person_id, |
|
9 | + 'select person_id, |
|
10 | 10 | count(hansard.epobject_id) as wrans, |
11 | 11 | sum(yes_votes) + IFNULL((select sum(vote) from uservotes, hansard as hansard2 |
12 | 12 | where uservotes.epobject_id=hansard2.epobject_id |
@@ -20,23 +20,23 @@ discard block |
||
20 | 20 | group by person_id'); |
21 | 21 | |
22 | 22 | foreach ($q as $row) { |
23 | - $p_id = $row['person_id']; |
|
24 | - $name = $row['first_name'] . ' ' . $row['last_name']; |
|
25 | - $con = $row['constituency']; |
|
26 | - $wrans = $row['wrans']; |
|
27 | - $yes = $row['yes']; |
|
28 | - $no = $row['no']; |
|
29 | - if ($p_id) { |
|
30 | - $qq = $db->query('(select hansard.epobject_id from hansard, uservotes |
|
23 | + $p_id = $row['person_id']; |
|
24 | + $name = $row['first_name'] . ' ' . $row['last_name']; |
|
25 | + $con = $row['constituency']; |
|
26 | + $wrans = $row['wrans']; |
|
27 | + $yes = $row['yes']; |
|
28 | + $no = $row['no']; |
|
29 | + if ($p_id) { |
|
30 | + $qq = $db->query('(select hansard.epobject_id from hansard, uservotes |
|
31 | 31 | where hansard.epobject_id=uservotes.epobject_id |
32 | 32 | and hansard.person_id = '.$p_id.' and major=3 and minor=2 and left_house>curdate()) |
33 | 33 | union |
34 | 34 | (select hansard.epobject_id from hansard,member,anonvotes |
35 | 35 | where hansard.epobject_id=anonvotes.epobject_id |
36 | 36 | and hansard.person_id = '.$p_id.' and major=3 and minor=2 and left_house>curdate())'); |
37 | - $wrans_with_votes = $qq->rows(); |
|
38 | - } else { |
|
39 | - $wrans_with_votes = ''; |
|
40 | - } |
|
41 | - print "$name\t$con\t$wrans\t$wrans_with_votes\t$yes\t$no\n"; |
|
37 | + $wrans_with_votes = $qq->rows(); |
|
38 | + } else { |
|
39 | + $wrans_with_votes = ''; |
|
40 | + } |
|
41 | + print "$name\t$con\t$wrans\t$wrans_with_votes\t$yes\t$no\n"; |
|
42 | 42 | } |
@@ -29,11 +29,11 @@ |
||
29 | 29 | if ($p_id) { |
30 | 30 | $qq = $db->query('(select hansard.epobject_id from hansard, uservotes |
31 | 31 | where hansard.epobject_id=uservotes.epobject_id |
32 | - and hansard.person_id = '.$p_id.' and major=3 and minor=2 and left_house>curdate()) |
|
32 | + and hansard.person_id = '.$p_id . ' and major=3 and minor=2 and left_house>curdate()) |
|
33 | 33 | union |
34 | 34 | (select hansard.epobject_id from hansard,member,anonvotes |
35 | 35 | where hansard.epobject_id=anonvotes.epobject_id |
36 | - and hansard.person_id = '.$p_id.' and major=3 and minor=2 and left_house>curdate())'); |
|
36 | + and hansard.person_id = '.$p_id . ' and major=3 and minor=2 and left_house>curdate())'); |
|
37 | 37 | $wrans_with_votes = $qq->rows(); |
38 | 38 | } else { |
39 | 39 | $wrans_with_votes = ''; |
@@ -28,12 +28,12 @@ discard block |
||
28 | 28 | public function get_text() { |
29 | 29 | $text = $this->mem->get('banner'); |
30 | 30 | |
31 | - if ( $text === false ) { |
|
31 | + if ($text === false) { |
|
32 | 32 | $q = $this->db->query("SELECT value FROM editorial WHERE item = 'banner'")->first(); |
33 | 33 | |
34 | 34 | if ($q) { |
35 | 35 | $text = $q['value']; |
36 | - if ( trim($text) == '' ) { |
|
36 | + if (trim($text) == '') { |
|
37 | 37 | $text = NULL; |
38 | 38 | } |
39 | 39 | $this->mem->set('banner', $text, 86400); |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | ) |
51 | 51 | ); |
52 | 52 | |
53 | - if ( $q->success() ) { |
|
54 | - if ( trim($text) == '' ) { |
|
53 | + if ($q->success()) { |
|
54 | + if (trim($text) == '') { |
|
55 | 55 | $text = NULL; |
56 | 56 | } |
57 | 57 | $this->mem->set('banner', $text, 86400); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | if ($q) { |
35 | 35 | $text = $q['value']; |
36 | 36 | if ( trim($text) == '' ) { |
37 | - $text = NULL; |
|
37 | + $text = null; |
|
38 | 38 | } |
39 | 39 | $this->mem->set('banner', $text, 86400); |
40 | 40 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | if ( $q->success() ) { |
54 | 54 | if ( trim($text) == '' ) { |
55 | - $text = NULL; |
|
55 | + $text = null; |
|
56 | 56 | } |
57 | 57 | $this->mem->set('banner', $text, 86400); |
58 | 58 | return true; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | if ($q) { |
66 | 66 | $text = $q['value']; |
67 | - if ( trim($text) == '' ) { |
|
67 | + if (trim($text) == '') { |
|
68 | 68 | $text = NULL; |
69 | 69 | } |
70 | 70 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | private function _set($key, $value) { |
76 | - if ( trim($value) == '' ) { |
|
76 | + if (trim($value) == '') { |
|
77 | 77 | $value = NULL; |
78 | 78 | } |
79 | 79 | $check_q = $this->db->query( |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | ':key' => $key |
83 | 83 | ) |
84 | 84 | ); |
85 | - if ( $check_q->rows() ) { |
|
85 | + if ($check_q->rows()) { |
|
86 | 86 | $set_q = $this->db->query("UPDATE editorial set value = :value WHERE item = :key", |
87 | 87 | array( |
88 | 88 | ':key' => $key, |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | ); |
99 | 99 | } |
100 | 100 | |
101 | - if ( $set_q->success() ) { |
|
101 | + if ($set_q->success()) { |
|
102 | 102 | return true; |
103 | 103 | } |
104 | 104 | return false; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | private function _get($key) { |
56 | - $text = NULL; |
|
56 | + $text = null; |
|
57 | 57 | |
58 | 58 | $q = $this->db->query( |
59 | 59 | "SELECT value FROM editorial WHERE item = :key", |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | if ($q) { |
66 | 66 | $text = $q['value']; |
67 | 67 | if ( trim($text) == '' ) { |
68 | - $text = NULL; |
|
68 | + $text = null; |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | private function _set($key, $value) { |
76 | 76 | if ( trim($value) == '' ) { |
77 | - $value = NULL; |
|
77 | + $value = null; |
|
78 | 78 | } |
79 | 79 | $check_q = $this->db->query( |
80 | 80 | "SELECT value FROM editorial WHERE item = :key", |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include_once '../../includes/easyparliament/init.php'; |
4 | -include_once (INCLUDESPATH."easyparliament/commentreportlist.php"); |
|
4 | +include_once (INCLUDESPATH . "easyparliament/commentreportlist.php"); |
|
5 | 5 | |
6 | 6 | $this_page = "admin_home"; |
7 | 7 | |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | |
19 | 19 | $confirmedusers = $db->query("SELECT COUNT(*) AS count FROM users WHERE confirmed = '1'")->first()['count']; |
20 | 20 | $unconfirmedusers = $db->query("SELECT COUNT(*) AS count FROM users WHERE confirmed = '0'")->first()['count']; |
21 | -$olddate = gmdate("Y-m-d H:i:s", time()-86400); |
|
21 | +$olddate = gmdate("Y-m-d H:i:s", time() - 86400); |
|
22 | 22 | $dayusers = $db->query("SELECT COUNT(*) AS count FROM users WHERE lastvisit > '$olddate'")->first()['count']; |
23 | -$olddate = gmdate("Y-m-d H:i:s", time()-86400*7); |
|
23 | +$olddate = gmdate("Y-m-d H:i:s", time() - 86400 * 7); |
|
24 | 24 | $weekusers = $db->query("SELECT COUNT(*) AS count FROM users WHERE lastvisit > '$olddate'")->first()['count']; |
25 | 25 | ?> |
26 | 26 | <ul> |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $name = _htmlspecialchars($row['firstname'] . ' ' . $row['lastname']); |
74 | 74 | } |
75 | 75 | |
76 | - $rows[] = array ( |
|
76 | + $rows[] = array( |
|
77 | 77 | $name, |
78 | 78 | '<a href="mailto:' . $row['email'] . '">' . $row['email'] . '</a>', |
79 | 79 | $confirmed, |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | ); |
82 | 82 | } |
83 | 83 | |
84 | -$tabledata = array ( |
|
85 | - 'header' => array ( |
|
84 | +$tabledata = array( |
|
85 | + 'header' => array( |
|
86 | 86 | 'Name', |
87 | 87 | 'Email', |
88 | 88 | 'Confirmed?', |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | include_once '../../includes/easyparliament/init.php'; |
4 | -include_once (INCLUDESPATH."easyparliament/commentreportlist.php"); |
|
4 | +include_once (INCLUDESPATH . "easyparliament/commentreportlist.php"); |
|
5 | 5 | |
6 | 6 | $this_page = "admin_badusers"; |
7 | 7 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $totalcomments = $r['totalcount']; |
44 | 44 | |
45 | - $percentagedeleted = ( $row['deletedcount'] / $totalcomments ) * 100; |
|
45 | + $percentagedeleted = ($row['deletedcount'] / $totalcomments) * 100; |
|
46 | 46 | |
47 | 47 | |
48 | 48 | // Get complaints made about this user's comments, but not upheld. |
@@ -57,17 +57,17 @@ discard block |
||
57 | 57 | |
58 | 58 | $USERURL->insert(array('u'=>$user_id)); |
59 | 59 | |
60 | - $rows[] = array ( |
|
60 | + $rows[] = array( |
|
61 | 61 | '<a href="' . $USERURL->generate() . '">' . $row['firstname'] . ' ' . $row['lastname'] . '</a>', |
62 | 62 | $totalcomments, |
63 | 63 | $row['deletedcount'], |
64 | - $percentagedeleted.'%', |
|
64 | + $percentagedeleted . '%', |
|
65 | 65 | $notupheldcount |
66 | 66 | ); |
67 | 67 | } |
68 | 68 | |
69 | -$tabledata = array ( |
|
70 | - 'header' => array ( |
|
69 | +$tabledata = array( |
|
70 | + 'header' => array( |
|
71 | 71 | 'Name', |
72 | 72 | 'Total comments', |
73 | 73 | 'Number deleted', |
@@ -114,15 +114,15 @@ discard block |
||
114 | 114 | WHERE user_id = '$user_id' |
115 | 115 | AND upheld = '1'")->first(); |
116 | 116 | |
117 | - $rows[] = array ( |
|
117 | + $rows[] = array( |
|
118 | 118 | '<a href="' . $USERURL->generate() . '">' . $row['firstname'] . ' ' . $row['lastname'] . '</a>', |
119 | 119 | $row['rejectedcount'], |
120 | 120 | $r['upheldcount'] |
121 | 121 | ); |
122 | 122 | |
123 | 123 | } |
124 | -$tabledata = array ( |
|
125 | - 'header' => array ( |
|
124 | +$tabledata = array( |
|
125 | + 'header' => array( |
|
126 | 126 | 'Name', |
127 | 127 | 'Reports not upheld', |
128 | 128 | 'Reports upheld' |
@@ -7,7 +7,7 @@ |
||
7 | 7 | |
8 | 8 | $PAGE->page_start(); |
9 | 9 | $PAGE->stripe_start(); |
10 | -$PAGE->block_start(array ('id'=>'alerts', 'title'=>'Reporting Statistics')); |
|
10 | +$PAGE->block_start(array('id'=>'alerts', 'title'=>'Reporting Statistics')); |
|
11 | 11 | $db = new ParlDB; |
12 | 12 | $q = $db->query('select year(created) as the_year, month(created) as the_month, count(*) as c from alerts where confirmed and not deleted group by year(created) desc, month(created) desc'); |
13 | 13 | print '<h3>Alert signups per month</h3> <table>'; |