Example #1
0
 protected function display_front()
 {
     global $PAGE, $DATA, $this_page;
     // No date or debate id. Show some recent debates
     $this_page = "alldebatesfront";
     $DEBATELIST = new \DEBATELIST();
     $debates = array();
     $debates['data'] = $DEBATELIST->display('biggest_debates', array('days' => 7, 'num' => 10), 'none');
     $args = array('months' => 1);
     $debates['calendar'] = $DEBATELIST->display('calendar', $args, 'none');
     $debates['rssurl'] = $DATA->page_metadata($this_page, 'rss');
     $this_page = "whallfront";
     $whall = array();
     $WHALLLIST = new \WHALLLIST();
     $whall['data'] = $WHALLLIST->display('biggest_debates', array('days' => 7, 'num' => 10), 'none');
     $args = array('months' => 1);
     $whall['calendar'] = $WHALLLIST->display('calendar', $args, 'none');
     $whall['rssurl'] = $DATA->page_metadata($this_page, 'rss');
     $this_page = "lordsdebatesfront";
     $lords = array();
     $LORDSDEBATELIST = new \LORDSDEBATELIST();
     $lords['data'] = $LORDSDEBATELIST->display('biggest_debates', array('days' => 7, 'num' => 10), 'none');
     $args = array('months' => 1);
     $lords['calendar'] = $LORDSDEBATELIST->display('calendar', $args, 'none');
     $lords['rssurl'] = $DATA->page_metadata($this_page, 'rss');
     $data = array('debates' => $debates, 'lords' => $lords, 'whall' => $whall);
     $data['template'] = 'section/index';
     $this_page = "alldebatesfront";
     return $data;
 }
Example #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 
}
Example #3
0
//Latest activity (column 1)
$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();
Example #4
0
</p>
</form>
</div>
</div>
'), array('type' => 'include', 'content' => 'calendar_hocdebates'), array('type' => 'include', 'content' => "hocdebates"), array('type' => 'html', 'content' => '<div class="block">
<h4>RSS feed</h4>
<p><a href="' . WEBPATH . $rssurl . '"><img align="middle" src="http://www.theyworkforyou.com/images/rss.gif" border="0" alt="RSS feed"></a>
<a href="' . WEBPATH . $rssurl . '">RSS feed of most recent debates</a></p>
</div>')));
    $this_page = "whallfront";
    $PAGE->page_start();
    $PAGE->stripe_start();
    ?>
	<h4>Recent Westminster Hall debates</h4>
<?php 
    $WHALLLIST = new WHALLLIST();
    $WHALLLIST->display('biggest_debates', array('days' => 7, 'num' => 10));
    $rssurl = $DATA->page_metadata($this_page, 'rss');
    $PAGE->stripe_end(array(array('type' => 'include', 'content' => 'calendar_whalldebates'), array('type' => 'include', 'content' => "whalldebates"), array('type' => 'html', 'content' => '<div class="block">
<h4>RSS feed</h4>
<p><a href="' . WEBPATH . $rssurl . '"><img alt="RSS feed" border="0" align="middle" src="http://www.theyworkforyou.com/images/rss.gif"></a>
<a href="' . WEBPATH . $rssurl . '">RSS feed of most recent debates</a></p>
</div>')));
    $this_page = "lordsdebatesfront";
    $PAGE->page_start();
    $PAGE->stripe_start();
    ?>
	<h4>Recent House of Lords debates</h4>
<?php 
    $LORDSDEBATELIST = new LORDSDEBATELIST();
    $LORDSDEBATELIST->display('biggest_debates', array('days' => 7, 'num' => 10));
Example #5
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 == 'whallday') {
    $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 = 'Westminster Hall debates this month';
    } else {
        $args = array('months' => 1);
        $title = 'Recent Westminster Hall debates';
    }
} else {
    $args = array('months' => 1);
    $title = 'Recent Westminster Hall debates';
}
$PAGE->block_start(array('title' => $title));
$LIST = new WHALLLIST();
$LIST->display('calendar', $args);
$PAGE->block_end();
Example #6
0
<?php

$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";
Example #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>
Example #8
0
 protected function display_front()
 {
     global $PAGE, $DATA, $this_page;
     // No date or debate id. Show some recent debates
     $this_page = "alldebatesfront";
     $PAGE->page_start();
     $PAGE->stripe_start();
     ?>
     <h2>Recent House of Commons debates</h2>
 <?php 
     $DEBATELIST = new \DEBATELIST();
     $DEBATELIST->display('biggest_debates', array('days' => 7, 'num' => 10));
     $rssurl = $DATA->page_metadata($this_page, 'rss');
     $PAGE->stripe_end(array(array('type' => 'include', 'content' => 'minisurvey'), array('type' => 'html', 'content' => '
 <div class="block">
 <h4>Search debates</h4>
 <div class="blockbody">
 <form action="/search/" method="get">
 <p><input type="text" name="q" id="search_input" value="" size="40"> <input type="submit" value="Go">
 <br><input type="checkbox" name="section[]" value="debates" checked id="section_commons">
 <label for="section_commons">Commons</label>
 <input type="checkbox" name="section[]" value="whall" checked id="section_whall">
 <label for="section_whall">Westminster Hall</label>
 <input type="checkbox" name="section[]" value="lords" checked id="section_lords">
 <label for="section_lords">Lords</label>
 </p>
 </form>
 </div>
 </div>
 '), array('type' => 'include', 'content' => 'calendar_hocdebates'), array('type' => 'include', 'content' => "hocdebates"), array('type' => 'html', 'content' => '<div class="block">
 <h4>RSS feed</h4>
 <p><a href="' . WEBPATH . $rssurl . '"><img align="middle" src="http://www.theyworkforyou.com/images/rss.gif" border="0" alt="RSS feed"></a>
 <a href="' . WEBPATH . $rssurl . '">RSS feed of most recent debates</a></p>
 </div>')));
     $this_page = "whallfront";
     $PAGE->page_start();
     $PAGE->stripe_start();
     ?>
     <h2>Recent Westminster Hall debates</h2>
 <?php 
     $WHALLLIST = new \WHALLLIST();
     $WHALLLIST->display('biggest_debates', array('days' => 7, 'num' => 10));
     $rssurl = $DATA->page_metadata($this_page, 'rss');
     $PAGE->stripe_end(array(array('type' => 'include', 'content' => 'minisurvey'), array('type' => 'include', 'content' => 'calendar_whalldebates'), array('type' => 'include', 'content' => "whalldebates"), array('type' => 'html', 'content' => '<div class="block">
 <h4>RSS feed</h4>
 <p><a href="' . WEBPATH . $rssurl . '"><img alt="RSS feed" border="0" align="middle" src="http://www.theyworkforyou.com/images/rss.gif"></a>
 <a href="' . WEBPATH . $rssurl . '">RSS feed of most recent debates</a></p>
 </div>')));
     $this_page = "lordsdebatesfront";
     $PAGE->page_start();
     $PAGE->stripe_start();
     ?>
     <h2>Recent House of Lords debates</h2>
 <?php 
     $LORDSDEBATELIST = new \LORDSDEBATELIST();
     $LORDSDEBATELIST->display('biggest_debates', array('days' => 7, 'num' => 10));
     $rssurl = $DATA->page_metadata($this_page, 'rss');
     $PAGE->stripe_end(array(array('type' => 'nextprev'), array('type' => 'include', 'content' => 'minisurvey'), array('type' => 'include', 'content' => 'calendar_holdebates'), array('type' => 'include', 'content' => "holdebates"), array('type' => 'html', 'content' => '<div class="block">
 <h4>RSS feed</h4>
 <p><a href="' . WEBPATH . $rssurl . '"><img alt="RSS feed" border="0" align="middle" src="http://www.theyworkforyou.com/images/rss.gif"></a>
 <a href="' . WEBPATH . $rssurl . '">RSS feed of most recent debates</a></p>
 </div>')));
 }