Esempio n. 1
0
     }
     $divtabattr["voter1"] = $mppropt;
     $events = $mppropt["mpevents"];
     # a bit confused, but a complete list of events per mpid makes the code simple
     if ($events && $divtabattr["sortby"] == 'datereversed') {
         $events = array_reverse($events);
     }
     # slip in a title in the multiperson case
     if ($voter1attr['bmultiperson'] && $divtabattr["votedisplay"] != "fullmotion") {
         print "<tr><td colspan=7 align=left>\n                    <b>Votes by <a href=\"mp.php?" . $mppropt['mpanchor'] . "\">" . $mppropt["name"] . " MP</a></b>\n                    </td></tr>\n";
     }
     # apply a designated voter
     $divtabattr["divhrefappend"] = "&" . $mppropt['mpanchor'];
     # apply a date range to the current MP in this list, and roll up the year range.
     # long asignment for return value because we're lacking foreach as &
     $voter1attr['mpprops'][$lkey]["dismetric"] = division_table($db, $divtabattr, $db2, $events);
     # remove repeated listing of headings
     #if ($divtabattr["headings"] == 'columns')
     #	$divtabattr["headings"] = 'none';
 }
 print "</table>\n";
 # generate a friendliness table from the data
 if ($voter2type == "dreammp") {
     print "<h2><a name=\"ratioexpl\">How the number is calculated</a></h2>\n";
     if (count($voter1attr['mpprops']) == 0) {
         print "<p><b>There is no overlap between this MPs term and the votes in this policy.</b></p>\n";
     } elseif ($voter1attr['bmultiperson']) {
         print "<p><b>Calculation only available for single MPs.</b></p>\n";
     } else {
         print "<p>The MP's votes count towards a weighted average where the most important votes\n                          get 50 points, less important votes get 10 points, and less important votes for which the \n                          MP was absent get 2 points.  \n                          In important votes the MP gets awarded the full 50 points for voting the same as the policy, \n                          no points for voting against the policy, and 25 points for not voting.\n                          In less important votes, the MP gets 10 points for voting with the policy, \n                          no points for voting against, and 1 (out of 2) if absent.</p>\n";
         print "<p>Questions about this formula can be discussed on <a href=\"http://www.publicwhip.org.uk/forum/viewtopic.php?t=150\">the forum</a>.</p>\n";
Esempio n. 2
0
        $mptabattr["tooltips"] = "walterzorn";
        $mptabattr["headings"] = "";
        $tableclass = "rvotes";
    } else {
        $tableclass = "votes";
    }
    print "<table class=\"{$tableclass}\" id=\"votetable\">\n";
    mp_table($mptabattr);
    print "</table>\n";
}
if ($dismode["listsimilardivisions"]) {
    # comment out lazy evaluation that is done to completion in a separate job.
    #fill_division_distances($db, $db2, $divattr["house"], $divattr);
    $divtabattr = array("showwhich" => 'everyvote', "headings" => 'columns', "sortby" => 'closeness', "limitby" => $dismode["listsimilardivisions"] == 'short' ? "10" : "", "divclose" => $divattr, "display_house" => $divattr["house"]);
    if ($dismode["listsimilardivisions"] == "thisparliament") {
        $divtabattr["parldatelimit"] = $parliaments[$divattr["parliament"]];
    }
    #print "<h2><a name=\"simdiv\">Similar Divisions</a></h2>";
    print "<p>Divisions where the " . ($divattr["house"] == "lords" ? "Lords" : "MPs") . "\n                voted in a similar way to the\n                division on this page.  Click 'details...' to see which\n                votes differ between the two divisions.</p>";
    print "<table class=\"votes\">\n";
    print "</tr>";
    division_table($db, $divtabattr);
    print "</table>\n";
}
# explanation of metric
if (!$singlemotionpage and $display != "opposites") {
    print "<h3><a name=\"simexpl\">Division Similarity Ratio</a></h3>\n";
    print "<p>The measure of similarity between these two divisions is a calculation\n\t\t\t\tbased on a comparison of their votes.</p>\n";
    print_divdiv_distance($divattr, $divattr2, "MP");
}
pw_footer();
Esempio n. 3
0
 }
 if ($party_comp) {
     print "<p>The <b>{$party_comp}</b> votes are listed along side.</p>\n";
 }
 if ($party_comp) {
     $divtabattr["showwhich"] = "party";
     $divtabattr["party"] = $party_comp;
 }
 $divtabattr["sortby"] = "datereversed";
 if ($dismode["dtype"] == "motions") {
     $divtabattr["votedisplay"] = "fullmotion";
     print "<table>";
 } else {
     print "<table class=\"votes\">";
 }
 $dismetric = division_table($db, $divtabattr, $db2);
 print "</table>\n";
 // should this be a button
 if ($bAggregateEditable && ($dismetric["updates"] != 0 || $dismetric["clashes"] != 0)) {
     if ($dismetric["clashes"] != 0) {
         print "<p>There are <strong>" . $dismetric["clashes"] . "</strong> divisions where your policy choices clash.</p>\n";
     }
     if ($dismetric["updates"] != 0) {
         print '<p>There are <strong>' . $dismetric["updates"] . '</strong>
                     changed votes which need saving into your Dream MP.
                     <a href="policy.php?id=' . $dreamid . '&display=' . $display . '&savevotes=yes">CLICK HERE TO SAVE THEM</a></p>';
     }
     if ($clashesonsave != -1) {
         print "<h2>Error: After saving, none to update and {$clashesonsave} clashes found</h2>\n";
     }
 }