Example #1
0
function WriteEleCalcTableTrans($issues, $candidates, $vkey, $person, $bthreadopinionrows)
{
    global $constituency;
    print "<tr class=\"candidaterow\">\n";
    print "<td>Candidates for <b>{$constituency}</b> contituency:</td>\n";
    foreach ($candidates as $candidate) {
        print CandidateTdEntry($candidate, "-name");
    }
    print "</tr>\n";
    print "<tr class=\"agreementrow\"><td>Agreement rating:</td>\n";
    foreach ($candidates as $candidate) {
        print "\t<td><div class=\"myrankcol\" id=\"" . $candidate['candidate_id'] . "-rank\">RK</div></td>\n";
    }
    print "</tr>\n";
    for ($i = 0; $i < count($issues); $i++) {
        $issue = $issues[$i];
        $dreamid = $issue['dream_id'];
        print "\n\n<tr class=\"selerow\">";
        print "<td id=\"selerowc-{$dreamid}\" class=\"selerowc\" rowspan=\"2\">";
        $prevote = $vkey && $i < strlen($vkey) ? $vkey[$i] : "";
        print "<div style=\"height:50%\">";
        WriteEleIssueSection($issue, $prevote, $person);
        print "</div>";
        if ($i < count($issues) - 1) {
            $dreamidnext = $issues[$i + 1]["dream_id"];
            print "<div style=\"float:right\"><a onclick=\"NextClick('{$dreamidnext}')\">next</a></div>";
        } else {
            print "<div style=\"float:right\"><a onclick=\"NextClick('')\">finish</a></div>";
        }
        print "</td></tr>\n";
        print "<tr id=\"newsart-{$dreamid}\"><td colspan=\"" . count($candidates) . "\">";
        WriteLongListNews($issue["name"]);
        print "</td></tr>\n";
        WriteIssueRow($issue, $candidates);
    }
    print "<tr class=\"agreementrow2\"><td>Agreement rating:</td>\n";
    foreach ($candidates as $candidate) {
        print "\t<td><div class=\"myrankcol\" id=\"" . $candidate['candidate_id'] . "-rankl\">RK</div></td>\n";
    }
    print "</tr>\n";
    print "<tr class=\"candidaterow\">\n";
    print "<td>Candidates for <b>{$constituency}</b> contituency:</td>\n";
    foreach ($candidates as $candidate) {
        print CandidateTdEntry($candidate, "-namel");
    }
    print "</tr>\n";
}
 print "<div class=\"{$secpol}\" id=\"sec-" . $issue["dream_id"] . "\">";
 if (!$vprintview) {
     print "<h2>" . $issue["name"] . " {$ofnumber}</h2>\n";
 }
 if ($vprintview) {
     print "<table class=\"elecalc elecalc-print\">\n";
     $issuestrengthid = "issue-strength-" . $issue["dream_id"];
     $imap = (int) $vpresel * ($_GET[$issuestrengthid] ? 3 : 1);
     WriteIssueRow($issue, $candidates, $imap);
 } else {
     print "<table class=\"elecalc elecalc-single\">\n";
     WriteIssueRow($issue, $candidates, null);
 }
 print "</table>\n";
 print "\n\n<div class=\"" . ($vprintview ? "sissueprint" : "sissue") . "\">\n";
 WriteEleIssueSection($issue, $vpresel, $person, $vprintview);
 print "</div>\n";
 if (!$vprintview) {
     WriteLongListNews($issue["name"]);
 }
 $acont = "http://www.publicwhip.org.uk/policy.php?id=" . $issue["dream_id"];
 if (!$vprintview) {
     print "<p class=\"seclinks\">";
     if ($i == count($issues) - 1) {
         print "<a href=\"#sec-summs\" class=\"st\">next &gt;&gt;</a>\n";
     } else {
         print "<a href=\"#sec-" . $issues[$i + 1]["dream_id"] . "\" class=\"st\" title=\"Go to next question\">next &gt;&gt;</a>\n";
     }
     if ($i != 0) {
         print "<a class=\"ss\" href=\"#sec-" . $issues[$i - 1]["dream_id"] . "\" title=\"Go to previous question\">previous &lt;&lt;</a>\n";
     }