コード例 #1
0
ファイル: api_getDebates.php プロジェクト: leowmjw/twfy
function api_getDebates_type($t)
{
    if ($t == 'representatives') {
        $list = 'DEBATE';
        $type = 'debates';
    } elseif ($t == 'senate') {
        $list = 'LORDSDEBATE';
        $type = 'lords';
    } else {
        api_error('Unknown type');
        return;
    }
    if ($d = get_http_var('date')) {
        _api_getHansard_date($list, $d);
    } elseif (get_http_var('search') || get_http_var('person')) {
        $s = get_http_var('search');
        $pid = get_http_var('person');
        _api_getHansard_search(array('s' => $s, 'pid' => $pid, 'type' => $type));
    } elseif ($gid = get_http_var('gid')) {
        $redirect = _api_getHansard_gid($list, $gid);
        if (is_string($redirect)) {
            $URL = $_SERVER['REQUEST_URI'];
            $URL = str_replace($gid, $redirect, $URL);
            #header('Location: http://' . DOMAIN . $URL);
            #exit;
        }
    } elseif ($y = get_http_var('year')) {
        _api_getHansard_year($list, $y);
    } else {
        api_error('That is not a valid search.');
    }
}
コード例 #2
0
ファイル: api_getWMS.php プロジェクト: leowmjw/twfy
function api_getWMS_date($d)
{
    _api_getHansard_date('WMS', $d);
}
コード例 #3
0
function api_getDebates_type($t) {
	if ($t == 'commons') {
		$list = 'DEBATE';
		$type = 'debates';
	} elseif ($t == 'lords') {
		$list = 'LORDSDEBATE';
		$type = 'lords';
	} elseif ($t == 'westminsterhall') {
		$list = 'WHALL';
		$type = 'whall';
	} elseif ($t == 'scotland') {
		$list = 'SP';
		$type = 'sp';
	} elseif ($t == 'northernireland') {
		$list = 'NI';
		$type = 'ni';
	} else {
		api_error('Unknown type');
		return;
	}
	if ($d = get_http_var('date')) {
		_api_getHansard_date($list, $d);
	} elseif (get_http_var('search') || get_http_var('person')) {
		$s = get_http_var('search');
		$pid = get_http_var('person');
		_api_getHansard_search(array(
			's' => $s,
			'pid' => $pid,
			'type' => $type,
		));
	} elseif ($gid = get_http_var('gid')) {
		$redirect = _api_getHansard_gid($list, $gid);
		if (is_string($redirect)) {
            api_output(array(
                'redirect' => $redirect
            ));
		}
	} elseif ($y = get_http_var('year')) {
		_api_getHansard_year($list, $y);
	} else {
		api_error('That is not a valid search.');
	}
}
コード例 #4
0
ファイル: api_getWrans.php プロジェクト: udp12/theyworkforyou
function api_getWrans_date($d)
{
    _api_getHansard_date('WRANS', $d);
}