Esempio n. 1
0
function list_reps($type, $rep_plural, $search_sidebar)
{
    global $this_page, $PAGE, $DATA;
    $this_page = $type;
    $args = array();
    if ($type == 'peers') {
        $args['order'] = 'name';
    }
    $date = get_http_var('date');
    if ($date) {
        $date = parse_date($date);
        if ($date) {
            $DATA->set_page_metadata($this_page, 'title', $rep_plural . ', as on ' . format_date($date['iso'], LONGDATEFORMAT));
            $args['date'] = $date['iso'];
        }
    } elseif (get_http_var('all')) {
        $DATA->set_page_metadata($this_page, 'title', 'All ' . $rep_plural . ', including former ones');
        $args['all'] = true;
    } else {
        $DATA->set_page_metadata($this_page, 'title', 'All ' . $rep_plural);
    }
    if (get_http_var('f') != 'csv') {
        $PAGE->page_start();
        $PAGE->stripe_start();
        $format = 'html';
    } else {
        $format = 'csv';
    }
    $order = get_http_var('o');
    $orders = array('n' => 'name', 'f' => 'given_name', 'l' => 'family_name', 'c' => 'constituency', 'p' => 'party', 'd' => 'debates');
    if (array_key_exists($order, $orders)) {
        $args['order'] = $orders[$order];
    }
    $PEOPLE = new PEOPLE();
    $PEOPLE->display($type, $args, $format);
    if (get_http_var('f') != 'csv') {
        $PAGE->stripe_end(array(array('type' => 'include', 'content' => 'minisurvey'), array('type' => 'include', 'content' => 'people'), array('type' => 'include', 'content' => $search_sidebar)));
        $PAGE->page_end();
    }
}
Esempio n. 2
0
include_once "../../includes/easyparliament/init.php";
include_once INCLUDESPATH . "easyparliament/people.php";
$this_page = 'peers';
$args = array('order' => 'name');
if (get_http_var('all')) {
    $DATA->set_page_metadata($this_page, 'title', 'All Peers, including former ones');
    $args['all'] = true;
}
if (get_http_var('f') != 'csv') {
    $PAGE->page_start();
    $PAGE->stripe_start();
    $format = 'html';
} else {
    $format = 'csv';
}
if (get_http_var('o') == 'n') {
    $args['order'] = 'name';
} elseif (get_http_var('o') == 'p') {
    $args['order'] = 'party';
} elseif (get_http_var('o') == 'c') {
    $args['order'] = 'constituency';
} elseif (get_http_var('o') == 'd') {
    $args['order'] = 'debates';
}
$PEOPLE = new PEOPLE();
$PEOPLE->display('peers', $args, $format);
if (get_http_var('f') != 'csv') {
    $PAGE->stripe_end(array(array('type' => 'include', 'content' => 'people'), array('type' => 'include', 'content' => 'peer_search')));
    $PAGE->page_end();
}
Esempio n. 3
0
include_once "../../includes/easyparliament/init.php";
include_once INCLUDESPATH . "easyparliament/people.php";
$this_page = 'mlas';
$args = array();
if (get_http_var('all')) {
    $DATA->set_page_metadata($this_page, 'title', 'All MLAs, including former ones');
    $args['all'] = true;
}
if (get_http_var('f') != 'csv') {
    $PAGE->page_start();
    $PAGE->stripe_start();
    $format = 'html';
} else {
    $format = 'csv';
}
if (get_http_var('o') == 'f') {
    $args['order'] = 'first_name';
} elseif (get_http_var('o') == 'l') {
    $args['order'] = 'last_name';
} elseif (get_http_var('o') == 'c') {
    $args['order'] = 'constituency';
} elseif (get_http_var('o') == 'p') {
    $args['order'] = 'party';
}
$PEOPLE = new PEOPLE();
$PEOPLE->display('mlas', $args, $format);
if (get_http_var('f') != 'csv') {
    $PAGE->stripe_end(array(array('type' => 'include', 'content' => 'people'), array('type' => 'include', 'content' => 'mla_search')));
    $PAGE->page_end();
}