Пример #1
0
    if (array_key_exists($eb_type, $verify_voting_area_map)) {
        $eb_id = $verify_voting_area_map[$eb_type];
    } else {
        $eb_id = $fyr_voting_area['parent_area_id'];
    }
    
    $eb_area_info = mapit_get_voting_area_info($eb_id);
    mapit_check_error($eb_area_info);

    // Data bad due to election etc?
    $parent_status = dadem_get_area_status($eb_id);
    dadem_check_error($parent_status);
    $status = dadem_get_area_status($fyr_representative['voting_area']);
    dadem_check_error($status);
    if ($parent_status != 'none' || $status != 'none'){
        $election_error = cobrand_election_error_message($cobrand);
        if (!$election_error) {
             $election_error = 'Sorry, an election is forthcoming or has recently happened here.';
        }
        template_show_error($election_error);
    }

    //Check the contact method exists
    $success = msg_recipient_test($fyr_values['who']);

    if (rabx_is_error($success)) {
        if ($success->code == FYR_QUEUE_MESSAGE_BAD_ADDRESS_DATA) { 
            $error_msg = cobrand_bad_contact_error_msg($cobrand, $eb_area_info);
            if (!$error_msg) {
                 $error_msg = bad_contact_error_msg($eb_area_info);
            }
Пример #2
0
function check_area_status($eb_area, $fyr_voting_area)
{
    global $cobrand;
    $parent_status = dadem_get_area_status($eb_area['id']);
    dadem_check_error($parent_status);
    $status = dadem_get_area_status($fyr_voting_area['id']);
    dadem_check_error($status);
    if ($parent_status != 'none' || $status != 'none') {
        $election_error = cobrand_election_error_message($cobrand);
        if (!$election_error) {
            $election_error = 'Sorry, an election is forthcoming or has recently happened here.';
        }
        template_show_error($election_error);
    }
}