Completed
Branch master (cfcf82)
by Nick
04:51
created
www/includes/easyparliament/templates/html/divisions/index.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@  discard block
 block discarded – undo
7 7
           </div>
8 8
           <div class="business-section__primary">
9 9
                <?php
10
-               if ( isset($divisions) && $divisions ) {
11
-                 $current_date = '';
12
-               ?>
10
+                if ( isset($divisions) && $divisions ) {
11
+                    $current_date = '';
12
+                ?>
13 13
                <ul class="business-list">
14 14
                     <?php foreach ($divisions as $division) { ?>
15 15
                     <li id="<?= $division['division_id'] ?>">
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
                         <h3><?= format_date($division['date'], LONGERDATEFORMAT) ?></h3>
19 19
                         </span>
20 20
                         <?php
21
-                          $current_date = $division['date'];
21
+                            $current_date = $division['date'];
22 22
                         } ?>
23 23
                         <a href="/divisions/<?= $division['division_id'] ?>" class="business-list__title">
24 24
                             <h3><?= $division['division_title'] ?></h3>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
           </div>
8 8
           <div class="business-section__primary">
9 9
                <?php
10
-               if ( isset($divisions) && $divisions ) {
10
+               if (isset($divisions) && $divisions) {
11 11
                  $current_date = '';
12 12
                ?>
13 13
                <ul class="business-list">
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
                             <br>
30 30
                             <span class="business-list__meta">
31 31
                                 <?= $division['summary'] ?>
32
-                                <?= $division['mp_vote'] !== '' ? '. <b>Your MP, ' . $mp_name . ', ' . $division['mp_vote'] . '.</b>': '' ?>
32
+                                <?= $division['mp_vote'] !== '' ? '. <b>Your MP, ' . $mp_name . ', ' . $division['mp_vote'] . '.</b>' : '' ?>
33 33
                             </span>
34 34
                         </p>
35 35
                     </li>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/comments_recent.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,7 +18,9 @@  discard block
 block discarded – undo
18 18
     }
19 19
     $PAGE->block_start(array('id'=>'recentcomments', 'title'=>$title));
20 20
 
21
-    if ($this_page != 'home') $PAGE->page_links($data);
21
+    if ($this_page != 'home') {
22
+        $PAGE->page_links($data);
23
+    }
22 24
     $USERURL = new URL('userview');
23 25
     ?>
24 26
                         <ul>
@@ -50,7 +52,9 @@  discard block
 block discarded – undo
50 52
                         <p><a href="<?php echo $MOREURL->generate(); ?>#c<?php echo count($data['comments'])+1; ?>">See more annotations posted recently</a></p>
51 53
 <?php
52 54
     }
53
-    if ($this_page != 'home') $PAGE->page_links($data);
55
+    if ($this_page != 'home') {
56
+        $PAGE->page_links($data);
57
+    }
54 58
     $PAGE->block_end();
55 59
 }
56 60
 ?>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         $date = format_date($date, SHORTDATEFORMAT);
34 34
         $time = format_time($time, TIMEFORMAT);
35 35
 
36
-        $count = $n+1;
36
+        $count = $n + 1;
37 37
 
38 38
         $USERURL->insert(array('u'=>$comment['user_id']));
39 39
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     if ($this_page == 'home') {
48 48
         $MOREURL = new URL('comments_recent');
49 49
         ?>
50
-                        <p><a href="<?php echo $MOREURL->generate(); ?>#c<?php echo count($data['comments'])+1; ?>">See more annotations posted recently</a></p>
50
+                        <p><a href="<?php echo $MOREURL->generate(); ?>#c<?php echo count($data['comments']) + 1; ?>">See more annotations posted recently</a></p>
51 51
 <?php
52 52
     }
53 53
     if ($this_page != 'home') $PAGE->page_links($data);
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/footer.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -84,13 +84,13 @@
 block discarded – undo
84 84
         $db->display_total_duration();
85 85
 
86 86
         $duration = getmicrotime() - STARTTIME;
87
-        twfy_debug ("TIME", "Total time for page: $duration seconds.");
87
+        twfy_debug("TIME", "Total time for page: $duration seconds.");
88 88
         if (!isset($_SERVER['WINDIR'])) {
89 89
             $rusage = getrusage();
90
-            $duration = $rusage['ru_utime.tv_sec']*1000000 + $rusage['ru_utime.tv_usec'] - STARTTIMEU;
91
-            twfy_debug ('TIME', "Total user time: $duration microseconds.");
92
-            $duration = $rusage['ru_stime.tv_sec']*1000000 + $rusage['ru_stime.tv_usec'] - STARTTIMES;
93
-            twfy_debug ('TIME', "Total system time: $duration microseconds.");
90
+            $duration = $rusage['ru_utime.tv_sec'] * 1000000 + $rusage['ru_utime.tv_usec'] - STARTTIMEU;
91
+            twfy_debug('TIME', "Total user time: $duration microseconds.");
92
+            $duration = $rusage['ru_stime.tv_sec'] * 1000000 + $rusage['ru_stime.tv_usec'] - STARTTIMES;
93
+            twfy_debug('TIME', "Total system time: $duration microseconds.");
94 94
         }
95 95
 
96 96
 ?>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/html/static/search_help.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 </li>
32 32
 
33 33
 <?php
34
-$user_agent = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? strtolower( $_SERVER['HTTP_USER_AGENT'] ) : '';
34
+$user_agent = (isset($_SERVER['HTTP_USER_AGENT'])) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
35 35
 if (stristr($user_agent, 'Firefox/')) {
36 36
 ?>
37 37
      <li>You can also add TheyWorkForYou to <a href="http://mycroft.mozdev.org/download.html?name=theyworkforyou">Firefox's search box</a>.</li>
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/api/hansard_gid.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,4 +67,4 @@
 block discarded – undo
67 67
     api_output($out);
68 68
 } else {
69 69
     api_error('Nothing');
70
-   }
70
+    }
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@  discard block
 block discarded – undo
14 14
 if (isset ($data['rows'])) {
15 15
     for ($i=0; $i<count($data['rows']); $i++) {
16 16
         $row = $data['rows'][$i];
17
-        if (count($row) == 0) continue;
17
+        if (count($row) == 0) {
18
+            continue;
19
+        }
18 20
         if ($row['htype'] == '12') {
19 21
             if (isset($row['speaker']) && count($row['speaker']) > 0) {
20 22
                 $speaker = $row['speaker'];
@@ -36,7 +38,9 @@  discard block
 block discarded – undo
36 38
                     $desc .= $speaker['constituency'] . ', ';
37 39
                 }
38 40
                 $desc .= _htmlentities($speaker['party']);
39
-                if ($desc) $row['speaker']['desc'] = $desc;
41
+                if ($desc) {
42
+                    $row['speaker']['desc'] = $desc;
43
+                }
40 44
             }
41 45
         }
42 46
         $out[] = $row;
@@ -52,8 +56,9 @@  discard block
 block discarded – undo
52 56
                 $has_content = false;
53 57
             }
54 58
             $entry = $row;
55
-            if (isset($row['excerpt']))
56
-                $entry['excerpt'] = trim_characters($entry['excerpt'], 0, 200);
59
+            if (isset($row['excerpt'])) {
60
+                            $entry['excerpt'] = trim_characters($entry['excerpt'], 0, 200);
61
+            }
57 62
             if ($has_content) {
58 63
             } else {
59 64
                 unset($entry['listurl']);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
 $out = array();
14 14
 if (isset ($data['rows'])) {
15
-    for ($i=0; $i<count($data['rows']); $i++) {
15
+    for ($i = 0; $i < count($data['rows']); $i++) {
16 16
         $row = $data['rows'][$i];
17 17
         if (count($row) == 0) continue;
18 18
         if ($row['htype'] == '12') {
Please login to merge, or discard this patch.
www/includes/easyparliament/templates/api/hansard_date.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 if (isset ($data['rows'])) {
13 13
     $out = array();
14
-    for ($i=0; $i<count($data['rows']); $i++) {
14
+    for ($i = 0; $i < count($data['rows']); $i++) {
15 15
         $row = $data['rows'][$i];
16 16
 
17 17
         if ($row['htype'] == '10' && isset($row['excerpt']) && strstr($row['excerpt'], "was asked&#8212;")) {
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
         if ($row['htype'] == '10') {
41 41
             $out[] = array('entry' => $entry, 'subs' => array());
42 42
         } else {
43
-            $out[sizeof($out)-1]['subs'][] = $entry;
43
+            $out[sizeof($out) - 1]['subs'][] = $entry;
44 44
         }
45 45
 
46 46
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,9 @@
 block discarded – undo
27 27
         }
28 28
 
29 29
         $entry = $row;
30
-        if (isset($row['excerpt']))
31
-            $entry['excerpt'] = trim_characters($entry['excerpt'], 0, 200);
30
+        if (isset($row['excerpt'])) {
31
+                    $entry['excerpt'] = trim_characters($entry['excerpt'], 0, 200);
32
+        }
32 33
         if ($has_content) {
33 34
         } else {
34 35
             unset($entry['listurl']);
Please login to merge, or discard this patch.
www/includes/easyparliament/sidebars/search_filters.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
  <select id="section" name="section">
67 67
  <option value="">Any
68 68
 <?php
69
- optgroups(array(
69
+    optgroups(array(
70 70
     'UK Parliament' => array(
71 71
         'uk' => 'All UK',
72 72
         'debates' => 'House of Commons debates',
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
         'sp' => 'Debates',
86 86
         'spwrans' => 'Written answers',
87 87
     ),
88
- ), $section);
89
- ?>
88
+    ), $section);
89
+    ?>
90 90
  </select>
91 91
  <div class="help">
92 92
  Restrict results to a particular parliament or assembly that we cover (e.g. the
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 if (preg_match('#\s*([0-9/.-]*)\.\.([0-9/.-]*)#', $filter_ss, $m)) {
24 24
     $from = $m[1];
25 25
     $to = $m[2];
26
-    $filter_ss =  preg_replace('#\s*([0-9/.-]*)\.\.([0-9/.-]*)#', '', $filter_ss);
26
+    $filter_ss = preg_replace('#\s*([0-9/.-]*)\.\.([0-9/.-]*)#', '', $filter_ss);
27 27
 }
28 28
 $section = get_http_var('section');
29 29
 if (preg_match('#\s*section:([a-z]*)#', $filter_ss, $m)) {
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     $filter_ss = preg_replace('#\s*speaker:[0-9]*#', '', $filter_ss);
37 37
 }
38 38
 
39
-$this->block_start(array( 'title' => "Filtering your results"));
39
+$this->block_start(array('title' => "Filtering your results"));
40 40
 
41 41
 ?>
42 42
 <form method="get" action="/search/">
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@
 block discarded – undo
5 5
         echo '<optgroup label="', $key, '">';
6 6
         foreach ($values as $k => $v) {
7 7
             echo '<option';
8
-            if ($current == $k) echo ' selected';
8
+            if ($current == $k) {
9
+                echo ' selected';
10
+            }
9 11
             echo ' value="', $k, '">', $v;
10 12
         }
11 13
         echo "</optgroup>\n";
Please login to merge, or discard this patch.
www/includes/easyparliament/comment.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -210,8 +210,8 @@
 block discarded – undo
210 210
                             array(':epobject_id' => $this->epobject_id));
211 211
 
212 212
             if ($q->rows() > 0) {
213
-                 // If you change stuff here, you might have to change it in
214
-                 // $COMMENTLIST->_get_comment_data() too...
213
+                    // If you change stuff here, you might have to change it in
214
+                    // $COMMENTLIST->_get_comment_data() too...
215 215
 
216 216
                 $gid = fix_gid_from_db($q->field(0, 'gid')); // In includes/utility.php
217 217
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     public $body = '';
32 32
     public $posted = '';
33 33
     public $visible = false;
34
-    public $modflagged = NULL;	// Is a datetime when set.
34
+    public $modflagged = null;	// Is a datetime when set.
35 35
     public $firstname = '';	// Of the person who posted it.
36 36
     public $lastname = '';
37 37
     public $url = '';
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             $flag = "'$date'";
139 139
 
140 140
         } elseif ($switch == 'off') {
141
-            $date = NULL;
141
+            $date = null;
142 142
             $flag = 'NULL';
143 143
 
144 144
         } else {
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
     public $body = '';
32 32
     public $posted = '';
33 33
     public $visible = false;
34
-    public $modflagged = NULL;	// Is a datetime when set.
35
-    public $firstname = '';	// Of the person who posted it.
34
+    public $modflagged = NULL; // Is a datetime when set.
35
+    public $firstname = ''; // Of the person who posted it.
36 36
     public $lastname = '';
37 37
     public $url = '';
38 38
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     public $exists = false;
42 42
 
43 43
 
44
-    public function __construct($comment_id='') {
44
+    public function __construct($comment_id = '') {
45 45
 
46 46
         $this->db = new ParlDB;
47 47
 
@@ -69,12 +69,12 @@  discard block
 block discarded – undo
69 69
             if ($q->rows() > 0) {
70 70
 
71 71
                 $this->comment_id 	= $comment_id;
72
-                $this->user_id		= $q->field(0, 'user_id');
72
+                $this->user_id = $q->field(0, 'user_id');
73 73
                 $this->epobject_id	= $q->field(0, 'epobject_id');
74
-                $this->body			= $q->field(0, 'body');
75
-                $this->posted		= $q->field(0, 'posted');
76
-                $this->visible		= $q->field(0, 'visible');
77
-                $this->modflagged	= $q->field(0, 'modflagged');
74
+                $this->body = $q->field(0, 'body');
75
+                $this->posted = $q->field(0, 'posted');
76
+                $this->visible = $q->field(0, 'visible');
77
+                $this->modflagged = $q->field(0, 'modflagged');
78 78
 
79 79
                 // Sets the URL and username for this comment. Duh.
80 80
                 $this->_set_url();
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
     public function comments_enabled() { return $this->comments_enabled; }
105 105
 
106 106
 
107
-    public function display($format='html', $template='comments') {
107
+    public function display($format = 'html', $template = 'comments') {
108 108
 
109
-        $data['comments'][0] = array (
109
+        $data['comments'][0] = array(
110 110
             'comment_id'	=> $this->comment_id,
111 111
             'user_id'		=> $this->user_id,
112 112
             'epobject_id'	=> $this->epobject_id,
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             $flag = 'NULL';
143 143
 
144 144
         } else {
145
-            $PAGE->error_message ("Why are you trying to switch this comment's modflag to '" . _htmlentities($switch) . "'!");
145
+            $PAGE->error_message("Why are you trying to switch this comment's modflag to '" . _htmlentities($switch) . "'!");
146 146
         }
147 147
 
148 148
         $q = $this->db->query("UPDATE comments
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             $this->modflagged = $date;
155 155
             return true;
156 156
         } else {
157
-            $message = array (
157
+            $message = array(
158 158
                 'title' => 'Sorry',
159 159
                 'text' => "We couldn't update the annotation's modflag."
160 160
             );
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             if ($q->success()) {
177 177
                 return true;
178 178
             } else {
179
-                $message = array (
179
+                $message = array(
180 180
                     'title' => 'Sorry',
181 181
                     'text' => "We were unable to delete the annotation."
182 182
                 );
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
             }
186 186
 
187 187
         } else {
188
-            $message = array (
188
+            $message = array(
189 189
                 'title' => 'Sorry',
190 190
                 'text' => "You are not authorised to delete annotations."
191 191
             );
Please login to merge, or discard this patch.
www/includes/easyparliament/recess.php 2 patches
Braces   +30 added lines, -19 removed lines patch added patch discarded remove patch
@@ -362,12 +362,13 @@  discard block
 block discarded – undo
362 362
         } else {
363 363
             $from = "$year-7-" . $dates[$year][7]['more'];
364 364
         }
365
-        if (!isset($dates[$year][9]))
366
-            $to = "$year-08-31";
367
-        elseif (isset($dates[$year][9]['all']))
368
-            $to = "$year-10-" . $dates[$year][10]['less'];
369
-        else
370
-            $to = "$year-9-" . $dates[$year][9]['less'];
365
+        if (!isset($dates[$year][9])) {
366
+                    $to = "$year-08-31";
367
+        } elseif (isset($dates[$year][9]['all'])) {
368
+                    $to = "$year-10-" . $dates[$year][10]['less'];
369
+        } else {
370
+                    $to = "$year-9-" . $dates[$year][9]['less'];
371
+        }
371 372
     }
372 373
     if ( (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less'])
373 374
     || (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more'])
@@ -375,11 +376,17 @@  discard block
 block discarded – undo
375 376
     || (isset($dates[$year][$month]['between'][2]) && $day > $dates[$year][$month]['between'][2] && $day < $dates[$year][$month]['between'][3]) ) {
376 377
         switch ($month) {
377 378
             case 1: case 12: $recess = 'Christmas Recess'; break;
378
-            case 2: if ($body==1 || $body==101) $recess = 'Half Term Week';
379
-                elseif ($body==4) $recess = 'February Recess';
379
+            case 2: if ($body==1 || $body==101) {
380
+                $recess = 'Half Term Week';
381
+            } elseif ($body==4) {
382
+                    $recess = 'February Recess';
383
+                }
380 384
                 break;
381
-            case 3: if ($body==1 || $body==101) $recess = 'Easter Recess';
382
-                elseif ($body==4) $recess = 'Spring Recess';
385
+            case 3: if ($body==1 || $body==101) {
386
+                $recess = 'Easter Recess';
387
+            } elseif ($body==4) {
388
+                    $recess = 'Spring Recess';
389
+                }
383 390
                 break;
384 391
             case 4: if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) {
385 392
                     $recess = 'Election Recess';
@@ -417,9 +424,13 @@  discard block
 block discarded – undo
417 424
                     trigger_error("Argh9");
418 425
                 }
419 426
                 break;
420
-            case 10: if ($body==1 || $body==101) $recess = 'Conference Recess';
421
-                elseif ($body==4) $recess = 'Autumn Recess';
422
-                elseif ($body==5) $recess = 'Halloween Recess';
427
+            case 10: if ($body==1 || $body==101) {
428
+                $recess = 'Conference Recess';
429
+            } elseif ($body==4) {
430
+                    $recess = 'Autumn Recess';
431
+                } elseif ($body==5) {
432
+                    $recess = 'Halloween Recess';
433
+                }
423 434
                 break;
424 435
             case 11: $recess = 'Autumn Recess';
425 436
                 break;
@@ -427,9 +438,9 @@  discard block
 block discarded – undo
427 438
         }
428 439
         if (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) {
429 440
             $to = "$year-$month-" . $dates[$year][$month]['less'];
430
-            if ($month==1)
431
-                $from = ($year-1)."-12-" . $dates[$year-1][12]['more'];
432
-            else {
441
+            if ($month==1) {
442
+                            $from = ($year-1)."-12-" . $dates[$year-1][12]['more'];
443
+            } else {
433 444
                 for ($newmonth = $month-1; $newmonth>=1; $newmonth--) {
434 445
                     if (isset($dates[$year][$newmonth]['more'])) {
435 446
                         $from = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['more'];
@@ -440,9 +451,9 @@  discard block
 block discarded – undo
440 451
         }
441 452
         if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) {
442 453
             $from = "$year-$month-" . $dates[$year][$month]['more'];
443
-            if ($month==12)
444
-                $to = ($year+1)."-01-" . $dates[$year+1][1]['less'];
445
-            else {
454
+            if ($month==12) {
455
+                            $to = ($year+1)."-01-" . $dates[$year+1][1]['less'];
456
+            } else {
446 457
                 for ($newmonth = $month+1; $newmonth<=12; $newmonth++) {
447 458
                     if (isset($dates[$year][$newmonth]['less'])) {
448 459
                         $to = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['less'];
Please login to merge, or discard this patch.
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -12,20 +12,20 @@  discard block
 block discarded – undo
12 12
     ),
13 13
     2001 => array(
14 14
         1=>array('less'=>8),
15
-        2=>array('between'=>array(15,26)),
16
-        4=>array('between'=>array(10,23)),
15
+        2=>array('between'=>array(15, 26)),
16
+        4=>array('between'=>array(10, 23)),
17 17
         5=>array('more'=>13),
18 18
         6=>array('less'=>13),
19 19
         7=>array('more'=>20),
20 20
         8=>array('all'=>1),
21 21
         9=>array('less'=>14, 'more'=>14),
22
-        10=>array('less'=>4, 'between'=>array(4,8, 8,15)),
22
+        10=>array('less'=>4, 'between'=>array(4, 8, 8, 15)),
23 23
         12=>array('more'=>19) ),
24 24
     2002 => array(
25 25
         1=>array('less'=>8),
26
-        2=>array('between'=>array(14,25)),
26
+        2=>array('between'=>array(14, 25)),
27 27
         3=>array('more'=>26),
28
-        4=>array('less'=>3, 'between'=>array(3,10)),
28
+        4=>array('less'=>3, 'between'=>array(3, 10)),
29 29
         5=>array('more'=>24),
30 30
         6=>array('less'=>10),
31 31
         7=>array('more'=>24),
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
         12=>array('more'=>19) ),
36 36
     2003 => array(
37 37
         1=>array('less'=>7),
38
-        2=>array('between'=>array(13,24)),
39
-        4=>array('between'=>array(14,28)),
38
+        2=>array('between'=>array(13, 24)),
39
+        4=>array('between'=>array(14, 28)),
40 40
         5=>array('more'=>22),
41 41
         6=>array('less'=>3),
42 42
         7=>array('more'=>17),
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
         12=>array('more'=>18)),
47 47
     2004 => array(
48 48
         1=>array('less'=>5),
49
-        2=>array('between'=>array(12,23)),
50
-        4=>array('between'=>array(1,19)),
49
+        2=>array('between'=>array(12, 23)),
50
+        4=>array('between'=>array(1, 19)),
51 51
         5=>array('more'=>27),
52 52
         6=>array('less'=>7),
53 53
         7=>array('more'=>22),
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         12=>array('more'=>21) ),
58 58
     2005 => array(
59 59
         1=>array('less'=>10),
60
-        2=>array('between'=>array(10,21)),
60
+        2=>array('between'=>array(10, 21)),
61 61
         3=>array('more'=>24),
62 62
         4=>array('less'=>4, 'more'=>10),
63 63
         5=>array('less'=>11, 'more'=>26),
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         12=>array('more'=>20) ),
70 70
     2006 => array(
71 71
         1=>array('less'=>9),
72
-        2=>array('between'=>array(16,27)),
72
+        2=>array('between'=>array(16, 27)),
73 73
         3=>array('more'=>30),
74 74
         4=>array('less'=>18),
75 75
         5=>array('more'=>25),
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     ),
83 83
     2007 => array(
84 84
         1=>array('less'=>8),
85
-        2=>array('between'=>array(8,19)),
85
+        2=>array('between'=>array(8, 19)),
86 86
         3=>array('more'=>29),
87 87
         4=>array('less'=>16),
88 88
         5=>array('more'=>24),
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
     ),
96 96
     2008 => array(
97 97
         1=>array('less'=>7),
98
-        2=>array('between'=>array(7,18)),
99
-        4=>array('between'=>array(3,21)),
98
+        2=>array('between'=>array(7, 18)),
99
+        4=>array('between'=>array(3, 21)),
100 100
         5=>array('more'=>22),
101 101
         6=>array('less'=>2),
102 102
         7=>array('more'=>22),
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
     ),
108 108
     2009 => array(
109 109
         1=>array('less'=>12),
110
-        2=>array('between'=>array(12,23)),
111
-        4=>array('between'=>array(2,20)),
110
+        2=>array('between'=>array(12, 23)),
111
+        4=>array('between'=>array(2, 20)),
112 112
         5=>array('more'=>21),
113 113
         6=>array('less'=>1),
114 114
         7=>array('more'=>21),
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     ),
120 120
     2010 => array(
121 121
         1=>array('less'=>5),
122
-        2=>array('between'=>array(10,22)),
122
+        2=>array('between'=>array(10, 22)),
123 123
         3=>array('more'=>30),
124 124
         4=>array('less'=>6, 'more'=>8),
125 125
         5=>array('less'=>18, 'more'=>27),
@@ -132,62 +132,62 @@  discard block
 block discarded – undo
132 132
     ),
133 133
     2011 => array(
134 134
         1=>array('less'=>10),
135
-        2=>array('between'=>array(17,28)),
136
-        4=>array('between'=>array(5,26)),
135
+        2=>array('between'=>array(17, 28)),
136
+        4=>array('between'=>array(5, 26)),
137 137
         5=>array('more'=>24),
138 138
         6=>array('less'=>7),
139 139
         7=>array('more'=>19),
140 140
         8=>array('all'=>1),
141 141
         9=>array('less'=>5, 'more'=>15),
142 142
         10=>array('less'=>10),
143
-        11=>array('between'=>array(15,21)),
143
+        11=>array('between'=>array(15, 21)),
144 144
         12=>array('more'=>20),
145 145
     ),
146 146
     2012 => array(
147 147
         1=>array('less'=>10),
148
-        2=>array('between'=>array(9,20)),
148
+        2=>array('between'=>array(9, 20)),
149 149
         3=>array('more'=>27),
150 150
         4=>array('less'=>16),
151 151
         5=>array('more'=>24),
152 152
         6=>array('less'=>11),
153 153
         7=>array('more'=>17),
154 154
         8=>array('all'=>1),
155
-        9=>array('less'=>3,'more'=>18),
155
+        9=>array('less'=>3, 'more'=>18),
156 156
         10=>array('less'=>15),
157
-        11=>array('between'=>array(13,19)),
157
+        11=>array('between'=>array(13, 19)),
158 158
         12=>array('more'=>20)
159 159
     ),
160 160
     2013 => array(
161 161
         1=>array('less'=>7),
162
-        2=>array('between'=>array(14,25)),
162
+        2=>array('between'=>array(14, 25)),
163 163
         3=>array('more'=>26),
164 164
         4=>array('less'=>15),
165 165
         5=>array('more'=>21),
166 166
         6=>array('less'=>3),
167 167
         7=>array('more'=>18),
168 168
         8=>array('all'=>1),
169
-        9=>array('less'=>2,'more'=>13),
169
+        9=>array('less'=>2, 'more'=>13),
170 170
         10=>array('less'=>8),
171
-        11=>array('between'=>array(12,18)),
171
+        11=>array('between'=>array(12, 18)),
172 172
         12=>array('more'=>19)
173 173
     ),
174 174
     2014 => array(
175 175
         1=>array('less'=>6),
176
-        2=>array('between'=>array(13,24)),
177
-        4=>array('between'=>array(10,28)),
178
-        5=>array('between'=>array(1,6))
176
+        2=>array('between'=>array(13, 24)),
177
+        4=>array('between'=>array(10, 28)),
178
+        5=>array('between'=>array(1, 6))
179 179
     ),
180 180
     2015 => array(
181 181
         7=>array('more'=>21),
182 182
         8=>array('all'=>1),
183 183
         9=>array('less'=>7, 'more'=>17),
184 184
         10=>array('less'=>12),
185
-        11=>array('between'=>array(10,16)),
185
+        11=>array('between'=>array(10, 16)),
186 186
         12=>array('more'=>17)
187 187
     ),
188 188
     2016 => array(
189 189
         1=>array('less'=>5),
190
-        2=>array('between'=>array(11,22))
190
+        2=>array('between'=>array(11, 22))
191 191
     )
192 192
 );
193 193
 # Lords differences
@@ -199,15 +199,15 @@  discard block
 block discarded – undo
199 199
 $GLOBALS['recessdates'][101][2010][12]['more'] = 22;
200 200
 $GLOBALS['recessdates'][101][2011] = array(
201 201
     1 => array('less'=>10),
202
-    2 => array('between'=>array(16,28)),
203
-    4 => array('between'=>array(6,26)),
202
+    2 => array('between'=>array(16, 28)),
203
+    4 => array('between'=>array(6, 26)),
204 204
     5 => array('more'=>25),
205 205
     6 => array('less'=>6),
206 206
     7 => array('more'=>20),
207 207
     8 => array('all'=>1),
208 208
     9 => array('less'=>5, 'more'=>15),
209 209
     10 => array('less'=>3),
210
-    11=>array('between'=>array(16,21)),
210
+    11=>array('between'=>array(16, 21)),
211 211
     12 => array('more'=>21),
212 212
 );
213 213
 
@@ -216,74 +216,74 @@  discard block
 block discarded – undo
216 216
     1999 => array(
217 217
         7 => array('more' => 2),
218 218
         8 => array('less' => 31),
219
-        10 => array('between' => array(8,25)),
219
+        10 => array('between' => array(8, 25)),
220 220
         12 => array('more' => 17)
221 221
     ),
222 222
     2000 => array(
223 223
         1 => array('less' => 10),
224
-        4 => array('between' => array(7,25)),
224
+        4 => array('between' => array(7, 25)),
225 225
         7 => array('more' => 7),
226 226
         8 => array('all' => 1),
227 227
         9 => array('less' => 4),
228
-        10 => array('between' => array(6,23)),
228
+        10 => array('between' => array(6, 23)),
229 229
         12 => array('more' => 20)
230 230
     ),
231 231
     2001 => array(
232 232
         1=>array('less'=>8),
233
-        2=>array('between'=>array(16,26)),
234
-        4=>array('between'=>array(6,23)),
233
+        2=>array('between'=>array(16, 26)),
234
+        4=>array('between'=>array(6, 23)),
235 235
         6=>array('more'=>29),
236 236
         7=>array('all'=>1),
237 237
         8=>array('all'=>1),
238 238
         9=>array('less'=>3),
239
-        10=>array('between'=>array(5,22)),
239
+        10=>array('between'=>array(5, 22)),
240 240
         12=>array('more'=>21) ),
241 241
     2002 => array(
242 242
         1=>array('less'=>7),
243
-        2=>array('between'=>array(15,25)),
243
+        2=>array('between'=>array(15, 25)),
244 244
         3=>array('more'=>28),
245 245
         4=>array('less'=>15),
246 246
         7=>array('more'=>10),
247 247
         8=>array('all'=>1),
248 248
         9=>array('less'=>2),
249
-        10=>array('between'=>array(11,28)),
249
+        10=>array('between'=>array(11, 28)),
250 250
         12=>array('more'=>20) ),
251 251
     2003 => array(
252 252
         1=>array('less'=>6),
253
-        4=>array('between'=>array(0,31)),
253
+        4=>array('between'=>array(0, 31)),
254 254
         5=>array('less'=>2),
255 255
         6=>array('more'=>27),
256 256
         7=>array('all'=>1),
257 257
         8=>array('all'=>1),
258
-        10=>array('between'=>array(10,27)),
258
+        10=>array('between'=>array(10, 27)),
259 259
         12=>array('more'=>19)),
260 260
     2004 => array(
261 261
         1=>array('less'=>5),
262
-        2=>array('between'=>array(13,23)),
263
-        4=>array('between'=>array(2,19)),
262
+        2=>array('between'=>array(13, 23)),
263
+        4=>array('between'=>array(2, 19)),
264 264
         6=>array('more'=>25),
265 265
         7=>array('all'=>1),
266 266
         8=>array('less'=>30),
267
-        10=>array('between'=>array(10,23)),
267
+        10=>array('between'=>array(10, 23)),
268 268
         12=>array('more'=>26) ),
269 269
     2005 => array(
270 270
         1=>array('less'=>8),
271
-        2=>array('between'=>array(11,21)),
271
+        2=>array('between'=>array(11, 21)),
272 272
         3=>array('more'=>24),
273 273
         4=>array('less'=>11),
274 274
         7=>array('more'=>1),
275 275
         8=>array('all'=>1),
276 276
         9=>array('less'=>5),
277
-        10=>array('between'=>array(7,24)),
277
+        10=>array('between'=>array(7, 24)),
278 278
         12=>array('more'=>23) ),
279 279
     2006 => array(
280 280
         1=>array('less'=>9),
281
-        2=>array('between'=>array(10,20)),
281
+        2=>array('between'=>array(10, 20)),
282 282
         4=>array('less'=>18),
283 283
         7=>array('more'=>0),
284 284
         8=>array('all'=>1),
285 285
         9=>array('less'=>4),
286
-        10=>array('between'=>array(6,23)),
286
+        10=>array('between'=>array(6, 23)),
287 287
         12=>array('more'=>22),
288 288
     ),
289 289
     2007 => array(
@@ -293,18 +293,18 @@  discard block
 block discarded – undo
293 293
         7=>array('all'=>1),
294 294
         8=>array('all'=>1),
295 295
         9=>array('less'=>3),
296
-        10=>array('between'=>array(5,22)),
296
+        10=>array('between'=>array(5, 22)),
297 297
         12=>array('more'=>21),
298 298
     ),
299 299
     2008 => array(
300 300
         1=>array('less'=>5),
301
-        2=>array('between'=>array(8,18)),
301
+        2=>array('between'=>array(8, 18)),
302 302
         3=>array('more'=>28),
303 303
         4=>array('less'=>14),
304 304
         6=>array('more'=>27),
305 305
         7=>array('all'=>1),
306 306
         8=>array('all'=>1),
307
-        10=>array('between'=>array(10,27)),
307
+        10=>array('between'=>array(10, 27)),
308 308
     ),
309 309
 );
310 310
 
@@ -369,39 +369,39 @@  discard block
 block discarded – undo
369 369
         else
370 370
             $to = "$year-9-" . $dates[$year][9]['less'];
371 371
     }
372
-    if ( (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less'])
372
+    if ((isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less'])
373 373
     || (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more'])
374 374
     || (isset($dates[$year][$month]['between']) && $day > $dates[$year][$month]['between'][0] && $day < $dates[$year][$month]['between'][1])
375
-    || (isset($dates[$year][$month]['between'][2]) && $day > $dates[$year][$month]['between'][2] && $day < $dates[$year][$month]['between'][3]) ) {
375
+    || (isset($dates[$year][$month]['between'][2]) && $day > $dates[$year][$month]['between'][2] && $day < $dates[$year][$month]['between'][3])) {
376 376
         switch ($month) {
377 377
             case 1: case 12: $recess = 'Christmas Recess'; break;
378
-            case 2: if ($body==1 || $body==101) $recess = 'Half Term Week';
379
-                elseif ($body==4) $recess = 'February Recess';
378
+            case 2: if ($body == 1 || $body == 101) $recess = 'Half Term Week';
379
+                elseif ($body == 4) $recess = 'February Recess';
380 380
                 break;
381
-            case 3: if ($body==1 || $body==101) $recess = 'Easter Recess';
382
-                elseif ($body==4) $recess = 'Spring Recess';
381
+            case 3: if ($body == 1 || $body == 101) $recess = 'Easter Recess';
382
+                elseif ($body == 4) $recess = 'Spring Recess';
383 383
                 break;
384 384
             case 4: if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) {
385 385
                     $recess = 'Election Recess';
386
-                } elseif ($body==4 && $year==2003) {
386
+                } elseif ($body == 4 && $year == 2003) {
387 387
                     $recess = 'Election Recess';
388
-                } elseif ($body==1 || $body==101) {
388
+                } elseif ($body == 1 || $body == 101) {
389 389
                     $recess = 'Easter Recess';
390
-                } elseif ($body==4) {
390
+                } elseif ($body == 4) {
391 391
                     $recess = 'Spring Recess';
392 392
                 }
393 393
                 break;
394
-            case 5: if ($year==2001 || (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less'])) {
394
+            case 5: if ($year == 2001 || (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less'])) {
395 395
                     $recess = 'Election Recess';
396 396
                 } else {
397 397
                     $recess = 'Whit Recess';
398 398
                 }
399 399
                 break;
400
-            case 6: if ($year==2001) {
400
+            case 6: if ($year == 2001) {
401 401
                     $recess = 'Election Recess';
402
-                } elseif ($body==1 || $body==101) {
402
+                } elseif ($body == 1 || $body == 101) {
403 403
                     $recess = 'Whit Recess';
404
-                } elseif ($body==4) {
404
+                } elseif ($body == 4) {
405 405
                     $recess = 'Summer Recess';
406 406
                 } else {
407 407
                     trigger_error("Argh6");
@@ -411,15 +411,15 @@  discard block
 block discarded – undo
411 411
                 break;
412 412
             case 9: if (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) {
413 413
                     $recess = 'Summer Recess';
414
-                } elseif ($body==1 || $body==101) {
414
+                } elseif ($body == 1 || $body == 101) {
415 415
                     $recess = 'Conference Recess';
416 416
                 } else {
417 417
                     trigger_error("Argh9");
418 418
                 }
419 419
                 break;
420
-            case 10: if ($body==1 || $body==101) $recess = 'Conference Recess';
421
-                elseif ($body==4) $recess = 'Autumn Recess';
422
-                elseif ($body==5) $recess = 'Halloween Recess';
420
+            case 10: if ($body == 1 || $body == 101) $recess = 'Conference Recess';
421
+                elseif ($body == 4) $recess = 'Autumn Recess';
422
+                elseif ($body == 5) $recess = 'Halloween Recess';
423 423
                 break;
424 424
             case 11: $recess = 'Autumn Recess';
425 425
                 break;
@@ -427,12 +427,12 @@  discard block
 block discarded – undo
427 427
         }
428 428
         if (isset($dates[$year][$month]['less']) && $day < $dates[$year][$month]['less']) {
429 429
             $to = "$year-$month-" . $dates[$year][$month]['less'];
430
-            if ($month==1)
431
-                $from = ($year-1)."-12-" . $dates[$year-1][12]['more'];
430
+            if ($month == 1)
431
+                $from = ($year - 1) . "-12-" . $dates[$year - 1][12]['more'];
432 432
             else {
433
-                for ($newmonth = $month-1; $newmonth>=1; $newmonth--) {
433
+                for ($newmonth = $month - 1; $newmonth >= 1; $newmonth--) {
434 434
                     if (isset($dates[$year][$newmonth]['more'])) {
435
-                        $from = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['more'];
435
+                        $from = "$year-" . ($newmonth) . "-" . $dates[$year][$newmonth]['more'];
436 436
                         break;
437 437
                     }
438 438
                 }
@@ -440,12 +440,12 @@  discard block
 block discarded – undo
440 440
         }
441 441
         if (isset($dates[$year][$month]['more']) && $day > $dates[$year][$month]['more']) {
442 442
             $from = "$year-$month-" . $dates[$year][$month]['more'];
443
-            if ($month==12)
444
-                $to = ($year+1)."-01-" . $dates[$year+1][1]['less'];
443
+            if ($month == 12)
444
+                $to = ($year + 1) . "-01-" . $dates[$year + 1][1]['less'];
445 445
             else {
446
-                for ($newmonth = $month+1; $newmonth<=12; $newmonth++) {
446
+                for ($newmonth = $month + 1; $newmonth <= 12; $newmonth++) {
447 447
                     if (isset($dates[$year][$newmonth]['less'])) {
448
-                        $to = "$year-".($newmonth)."-" . $dates[$year][$newmonth]['less'];
448
+                        $to = "$year-" . ($newmonth) . "-" . $dates[$year][$newmonth]['less'];
449 449
                         break;
450 450
                     }
451 451
                 }
Please login to merge, or discard this patch.