dadem_check_error($parent_status); $status = dadem_get_area_status($va_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); } // Get the representative info $area_representatives = dadem_get_representatives($va_id); dadem_check_error($area_representatives); debug("FRONTEND", "area representatives $area_representatives"); $area_representatives = array($va_id => $area_representatives); euro_check($area_representatives, $voting_areas); $all_representatives = array_values($area_representatives[$va_id]); $representatives_info = dadem_get_representatives_info($all_representatives); dadem_check_error($representatives_info); debug_timestamp(); debug("FRONTEND", "representatives info $representatives_info"); //Check the contact method exists for each representative $any_contacts = false; $error_msg = ""; $fyr_valid_reps = array(); # randomize the order that representatives will be displayed in shuffle($all_representatives); foreach ($all_representatives as $rep_specificid) {
debug_timestamp(); $area_representatives = dadem_get_representatives(array_values($voting_areas)); $error = dadem_get_error($area_representatives); dadem_check_error($area_representatives); debug_timestamp(); $all_representatives = array(); foreach (array_values($area_representatives) as $rr) { $all_representatives = array_merge($all_representatives, $rr); } $representatives_info = dadem_get_representatives_info($all_representatives); dadem_check_error($representatives_info); debug_timestamp(); $meps_hidden = euro_check($area_representatives, $voting_areas); // For each voting area in order, find all the representatives. Put // descriptive text and form text in an array for the template to // render. $fyr_representatives = array(); $fyr_headings = array(); $fyr_rep_descs = array(); $fyr_rep_lists = array(); $fyr_error = null; foreach ($va_display_order as $va_type) { // Search for whether display type is fully present if (is_array($va_type)) { $ok = false; foreach ($va_type as $vat) { if (array_key_exists($vat, $voting_areas))
} if ($arr['type'] == $eb_type) { $eb_area = $arr; } } if (!$eb_area || !$fyr_voting_area) { mismatch_error(); } // Data bad due to election etc? check_area_status($eb_area, $fyr_voting_area); // Get the representative info $area_representatives = dadem_get_representatives($fyr_voting_area['id']); dadem_check_error($area_representatives); debug("FRONTEND", "area representatives", $area_representatives); $area_representatives = array($fyr_voting_area['id'] => $area_representatives); euro_check($area_representatives, $area_ids); $all_representatives = array_values($area_representatives[$fyr_voting_area['id']]); $representatives_info = dadem_get_representatives_info($all_representatives); dadem_check_error($representatives_info); debug_timestamp(); debug("FRONTEND", "representatives info", $representatives_info); //Check the contact method exists for each representative $any_contacts = false; $error_msg = ""; $stash['valid_reps'] = array(); # randomize the order that representatives will be displayed in shuffle($all_representatives); foreach ($all_representatives as $rep_specificid) { $success = msg_recipient_test($rep_specificid); $rep_name = "<strong>" . $fyr_voting_area['rep_prefix'] . " " . $representatives_info[$rep_specificid]['name'] . " " . $fyr_voting_area['rep_suffix'] . "</strong>"; if (rabx_is_error($success)) {
*/ $attend_prep = array('LBO' => "on the", 'LAS' => "on the", 'CTY' => "on", 'DIS' => "on", 'UTA' => "on", 'MTD' => "on", 'COI' => "on", 'LGD' => "on", 'SPA' => "in the", 'WAS' => "on the", 'NIA' => "on the", 'WMP' => "in the", 'HOL' => "in the", 'EUP' => "in the"); require_once "../phplib/fyr.php"; require_once "../commonlib/phplib/utility.php"; require_once "../commonlib/phplib/dadem.php"; require_once "../commonlib/phplib/mapit.php"; require_once "../commonlib/phplib/votingarea.php"; $fyr_postcode = get_postcode(); $area_types = get_area_types(); $voting_areas = postcode_to_areas($fyr_postcode); $fyr_all_url = limit_areas($area_types, $voting_areas); # Might alter voting_areas $va_ids = area_ids($voting_areas); $area_representatives = get_reps($va_ids); $representatives_info = get_reps_info($area_representatives); $meps_hidden = euro_check($area_representatives, $va_ids); // For each voting area in order, find all the representatives. Put // descriptive text and form text in an array for the template to // render. $fyr_representatives = array(); $fyr_headings = array(); $fyr_blurbs = array(); $fyr_more = array(); $fyr_rep_descs = array(); $fyr_rep_lists = array(); foreach ($va_display_order as $va_types) { $has_list_reps = is_array($va_types); # e.g. Welsh Assembly, Scottish Parliament, London Assembly if (!is_array($va_types)) { $va_types = array($va_types); }