Exemplo n.º 1
0
 protected function display_front()
 {
     global $DATA, $this_page;
     if (get_http_var('type') == 'wrans') {
         return parent::display_front();
     }
     $data = array();
     $args = array('months' => 1);
     $WRANSLIST = new \WRANSLIST();
     $wrans = array();
     $wrans['data'] = $WRANSLIST->display('recent_wrans', array('days' => 7, 'num' => 5), 'none');
     $wrans['calendar'] = $WRANSLIST->display('calendar', $args, 'none');
     $WMSLIST = new \WMSLIST();
     $wms = array();
     $wms['data'] = $WMSLIST->display('recent_wms', array('days' => 7, 'num' => 20), 'none');
     $wms['calendar'] = $WMSLIST->display('calendar', $args, 'none');
     $wms['rssurl'] = $DATA->page_metadata('wmsfront', 'rss');
     $data['wrans'] = $wrans;
     $data['wms'] = $wms;
     $data['template'] = 'section/wrans_index';
     return $data;
 }
Exemplo n.º 2
0
function comment_on_recent_bullet_point()
{
    global $hansardmajors;
    ?>
	<li><p><strong>Read and comment on:</strong></p>

<?php 
    $DEBATELIST = new DEBATELIST();
    $data[1] = $DEBATELIST->most_recent_day();
    $WRANSLIST = new WRANSLIST();
    $data[3] = $WRANSLIST->most_recent_day();
    $WHALLLIST = new WHALLLIST();
    $data[2] = $WHALLLIST->most_recent_day();
    $WMSLIST = new WMSLIST();
    $data[4] = $WMSLIST->most_recent_day();
    $LORDSDEBATELIST = new LORDSDEBATELIST();
    $data[101] = $LORDSDEBATELIST->most_recent_day();
    $NILIST = new NILIST();
    $data[5] = $NILIST->most_recent_day();
    foreach (array_keys($hansardmajors) as $major) {
        if (array_key_exists($major, $data)) {
            unset($data[$major]['listurl']);
            if (count($data[$major]) == 0) {
                unset($data[$major]);
            }
        }
    }
    major_summary($data);
    ?>
 </li> <?php 
}
Exemplo n.º 3
0
$DEBATELIST = new DEBATELIST();
$LORDSDEBATELIST = new LORDSDEBATELIST();
$last_dates = array();
// holds the most recent data there is data for, indexed by type
$last_dates[1] = $DEBATELIST->most_recent_day();
$last_dates[101] = $LORDSDEBATELIST->most_recent_day();
//get html
$latest_html = major_summary($last_dates, false);
echo $latest_html;
?>
    </div>
    <div>
        <?php 
//Latest activity (column 2)
$WHALLLIST = new WHALLLIST();
$WMSLIST = new WMSLIST();
$last_dates = array();
$last_dates[4] = $WMSLIST->most_recent_day();
$last_dates[2] = $WHALLLIST->most_recent_day();
//get html
$latest_html = major_summary($last_dates, false);
echo $latest_html;
?>
    </div>
    <div>
        <?php 
//Latest activity (column 3)
$WRANSLIST = new WRANSLIST();
$last_dates = array();
$last_dates[3] = $WRANSLIST->most_recent_day();
/*
Exemplo n.º 4
0
$WRANSLIST = new WRANSLIST();
$WRANSLIST->display('recent_wrans', array('days' => 7, 'num' => 5));
$PAGE->stripe_end(array(array('type' => 'html', 'content' => '
<div class="block">
<h4>Search written answers and statements</h4>
<div class="blockbody">
<form action="/search/" method="get">
<p><input type="text" name="s" value="" size="40"> <input type="submit" value="Go">
<br><input type="checkbox" name="section[]" value="wrans" checked id="section_wrans">
<label for="section_wrans">Written answers</label>
<input type="checkbox" name="section[]" value="wms" checked id="section_wms">
<label for="section_wms">Written ministerial statements</label>
</p>
</form>
</div>
</div>
'), array('type' => 'nextprev'), array('type' => 'include', 'content' => 'calendar_wrans'), array('type' => 'include', 'content' => "wrans")));
echo '</div>';
echo '<div id="written-statements">';
$PAGE->stripe_start();
echo '<h2>Some recent written ministerial statements</h2>';
$WMSLIST = new WMSLIST();
$WMSLIST->display('recent_wms', array('days' => 7, 'num' => 20));
$rssurl = $DATA->page_metadata($this_page, 'rss');
$PAGE->stripe_end(array(array('type' => 'nextprev'), array('type' => 'include', 'content' => 'calendar_wms'), array('type' => 'include', 'content' => "wms"), array('type' => 'html', 'content' => '<div class="block">
<h4>RSS feed</h4>
<p><a href="' . WEBPATH . $rssurl . '"><img border="0" alt="RSS feed" align="middle" src="http://www.theyworkforyou.com/images/rss.gif"></a>
<a href="' . WEBPATH . $rssurl . '">RSS feed of recent statements</a></p>
</div>')));
echo '</div>';
$PAGE->page_end();
Exemplo n.º 5
0
$this_page = "home";
include_once '../includes/easyparliament/init.php';
include_once INCLUDESPATH . "easyparliament/member.php";
$PAGE->page_start();
$PAGE->stripe_start();
///////////////////////////////////////////////////////////////////////////
//  SEARCH AND RECENT HANSARD
// Get the dates, timestamps and links for the most recent debates and wrans.
$DEBATELIST = new DEBATELIST();
$debatesdata = $DEBATELIST->most_recent_day();
$WRANSLIST = new WRANSLIST();
$wransdata = $WRANSLIST->most_recent_day();
$WHALLLIST = new WHALLLIST();
$whalldata = $WHALLLIST->most_recent_day();
$WMSLIST = new WMSLIST();
$wmsdata = $WMSLIST->most_recent_day();
if (count($debatesdata) > 0 && count($wransdata) > 0 && count($whalldata) > 0 && count($wmsdata) > 0) {
    // Links to Debates and Wrans.
    $debatestext = '<a href="' . $debatesdata['listurl'] . '">Debates</a>';
    $wranstext = '<a href="' . $wransdata['listurl'] . '">Written Answers</a>';
    $whalltext = '<a href="' . $whalldata['listurl'] . '">Westminster Hall debates</a>';
    $wmstext = '<a href="' . $wmsdata['listurl'] . '">Written Ministerial Statements</a>';
    // Now we work out whether the debates/wrans are from yesterday or another day...
    // And create the appropriate text ($daytext) to display accordingly.
    $todaystime = gmmktime(0, 0, 0, date('m'), date('d'), date('Y'));
    if ($debatesdata['hdate'] == $wransdata['hdate'] && $debatesdata['hdate'] == $whalldata['hdate'] && $debatesdata['hdate'] == $wmsdata['hdate']) {
        // They're on the same day, which is nice, and most common.
        if ($todaystime - $debatesdata['timestamp'] == 86400) {
            $daytext = "yesterday's";
        } elseif ($todaystime - $debatesdata['timestamp'] <= 6 * 86400) {
Exemplo n.º 6
0
<?php

global $PAGE;
// The calendar that appears in sidebars linking to debates.
// There is a separate one for wrans (so we can have both on the same page).
// Contents varies depending on the page we're on...
if ($this_page == 'wmsday') {
    $date = get_http_var('d');
    if (preg_match('#^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$#', $date, $m)) {
        $year = $m[1];
        $month = $m[2];
        $day = $m[3];
        $args = array('year' => $year, 'month' => $month, 'onday' => $date);
        $title = 'Written Ministerial Statements this month';
    } else {
        $args = array('months' => 1);
        $title = 'Recent Written Ministerial Statements';
    }
} else {
    $args = array('months' => 1);
    $title = 'Recent Written Ministerial Statements';
}
$PAGE->block_start(array('title' => $title));
$LIST = new WMSLIST();
$LIST->display('calendar', $args);
$PAGE->block_end();
Exemplo n.º 7
0
<?php

include_once "../includes/easyparliament/init.php";
//set page name (selects relevant bottom menu item)
$this_page = 'overview';
$PAGE->page_start();
$PAGE->supress_heading = true;
$PAGE->stripe_start("full");
$last_dates = array();
// holds the most recent data there is data for, indexed by type
$DEBATELIST = new DEBATELIST();
$LORDSDEBATELIST = new LORDSDEBATELIST();
$WHALLLIST = new WHALLLIST();
$WMSLIST = new WMSLIST();
$WRANSLIST = new WRANSLIST();
$COMMITTEE = new StandingCommittee();
$last_dates[1] = $DEBATELIST->most_recent_day();
$last_dates[101] = $LORDSDEBATELIST->most_recent_day();
$last_dates[4] = $WMSLIST->most_recent_day();
$last_dates[2] = $WHALLLIST->most_recent_day();
$last_dates[3] = $WRANSLIST->most_recent_day();
$last_dates[6] = $COMMITTEE->most_recent_day();
?>

<div class="welcome_col1">

<!-- Actions -->
<div id="welcome_uk" class="welcome_actions">

    <div>
        <h2>Your representative</h2>