} # $year = substr($date, 0, 4); # $URL = new URL($hansardmajors[1]['page_year']); # $URL->insert(array('y'=>$year)); # $nextprevdata['up'] = array ( # 'body' => "All of $year", # 'title' => '', # 'url' => $URL->generate() # ); $DATA->set_page_metadata($this_page, 'nextprev', $nextprevdata); $PAGE->page_start(); $PAGE->stripe_start(); include_once INCLUDESPATH . 'easyparliament/recess.php'; $time = strtotime($date); $dayofweek = date('w', $time); $recess = recess_prettify(date('j', $time), date('n', $time), date('Y', $time), 1); if ($recess[0]) { print '<p>The Houses of Parliament are in ' . $recess[0] . ' at this time.</p>'; } elseif ($dayofweek == 0 || $dayofweek == 6) { print '<p>The Houses of Parliament do not meet at weekends.</p>'; } else { $data = array('date' => $date); foreach (array_keys($hansardmajors) as $major) { $URL = new URL($hansardmajors[$major]['page_all']); $URL->insert(array('d' => $date)); $data[$major] = array('listurl' => $URL->generate()); } major_summary($data); } $PAGE->stripe_end(array(array('type' => 'nextprev'))); $PAGE->page_end();
function recess_message() { // Returns a message if parliament is currently in recess. include_once INCLUDESPATH . "easyparliament/recess.php"; $message = ''; list($name, $from, $to) = recess_prettify(date('j'), date('n'), date('Y'), 1); if ($name) { $message = 'The Houses of Parliament are in ' . $name . ' '; if ($from && $to) { $from = format_date($from, SHORTDATEFORMAT); $to = format_date($to, SHORTDATEFORMAT); if (substr($from, -4, 4) == substr($to, -4, 4)) { $from = substr($from, 0, strlen($from) - 4); } $message .= "from {$from} until {$to}."; } else { $message .= 'at this time.'; } } return $message; }
print "<td colspan=\"{$dayOfWeek}\"> </td>"; } $DAYURL = new URL($data['info']['page']); while ($currentDay <= $numberDays) { // Seventh column (Sunday) reached. Start a new row. if ($dayOfWeek == 7) { $dayOfWeek = 0; ?> </tr> <tr><?php } if ($data['info']['major'] == 5) { # NI $recess = array(''); } else { $recess = recess_prettify($currentDay, $month, $year, $hansardmajors[$data['info']['major']]['location'] == 'Scotland' ? 4 : 1); } // Is this day actually Today in the real world? // If so, higlight it. // Also highlight days where there are no // sittings - e.g. WH is only Tuesday-Thursday if ($currentDay == $toDay) { print '<td class="on"'; if ($recess[0] && $recess[0] != 1) { print ' title="' . $recess[0] . '"'; } print '>'; } elseif ($recess[0]) { print '<td class="no"'; if ($recess[0] != 1) { print ' title="' . $recess[0] . '"';
$dayOfWeek = 0; ?> </tr> <tr><?php } $recess_major = 1; # For all of UK Parliament if ($hansardmajors[$data['info']['major']]['location'] == 'NI') { $recess_major = 5; } elseif ($hansardmajors[$data['info']['major']]['location'] == 'Scotland') { $recess_major = 4; } elseif ($data['info']['major'] == 101) { $recess_major = 101; } # Lords slightly different $recess = recess_prettify($currentDay, $month, $year, $recess_major); // Is this day actually Today in the real world? // If so, higlight it. // Also highlight days where there are no // sittings - e.g. WH is only Tuesday-Thursday if ($currentDay == $toDay) { print '<td class="on"'; if ($recess[0] && $recess[0] != 1) { print ' title="' . $recess[0] . '"'; } print '>'; } elseif ($recess[0]) { print '<td class="no"'; if ($recess[0] != 1) { print ' title="' . $recess[0] . '"'; }
echo count($events) - 3; ?> more</a><!-- (just links to relevant upcoming page) --> <?php } ?> <?php } ?> </div> <?php } ?> <?php } else { list($recess, $from, $to) = recess_prettify(date('j'), date('n'), date('Y'), 1); if ($recess) { ?> <p> Parliament is on <?php echo $recess; ?> . It returns on <?php echo format_date($to, LONGERDATEFORMAT); ?> . </p> <?php } else { ?> <p>