"; //show poll form $xml = loadPoll($pollId, $year, $success, $name, $content, $submitted, $correctSubmitted); if (($submitted == true) && (!$correctSubmitted)) { echo "Vul aub je naam EN je reactie in.

"; } $xsl = 'Reactions.xsl';// FIXME } else { $ar_crumbs[1][0] = "Alle polls"; $ar_crumbs[1][1] = "http://www.centrumbredevoort.nl/Poll/index.php?pollId=all"; if ($pollId == "all") { if ($year != "") { $ar_crumbs[1][0] = "Alle polls (".$year.")"; $ar_crumbs[1][1] = "http://www.centrumbredevoort.nl/Poll/index.php?year=".$year."&pollId=all"; define(YEAR, $year); define($lastYearId, true); } loadBreadCrumbs($ar_crumbs); loadSubNavigation($ar_navi, 1); $xml = GetAllPollYears(); echo "
"; echo "   |  "; loadXML($xml); echo "
"; $xml = GetAllPolls(YEAR); $xsl = 'AllPolls.xsl'; } else { $ar_crumbs[1][0] = "Alle polls (".$year.")"; $ar_crumbs[1][1] = "http://www.centrumbredevoort.nl/Poll/index.php?year=".$year."&pollId=all"; $title = GetPollTitle($pollId); $ar_crumbs[2][0] = $title; loadBreadCrumbs($ar_crumbs); loadSubNavigation($ar_navi, 1); echo ""; } $xsl = 'Reactions.xsl'; //FIXME } } //returns loaded xml file function loadPoll($pollId, $year, $success, $name, $content, $submitted, $correctSubmitted) { $ip = getip(); if (IsClosed($pollId) == "TRUE") { $xml = GetPollResultsDetailed($pollId); $xsl = "Poll_Results.xsl"; print XMLtoHTML($xml, $xsl); echo "
(Je kunt niet meer stemmen op deze poll)


"; } else if (HasVoted($ip, $pollId) == "FALSE") { $xml = GetPollDetailed($pollId); $xsl = "Poll.xsl"; print XMLtoHTML($xml, $xsl); } else { $xml = GetPollResultsDetailed($pollId); $xsl = "Poll_Results.xsl"; print XMLtoHTML($xml, $xsl); echo "
"; if ($success == "1") { echo "Bedankt voor je stem!"; } else { echo "Je hebt al op deze poll gestemd."; } echo "


"; } //show reaction form loadFormPoll($pollId, $name, $content, $correctSubmitted, $submitted);// FIXME echo "
"; return $xml; } function startElement($parser, $name, $attrs) { //echo $name; } function endElement($parser, $name) { //echo $name; } function printYearMenu($parser, $data) { //make menu with links to year pages if ($lastYearId == false) { define(YEAR, $data); define($lastYearId, true); } echo "".$data."  |  "; } function loadXML($x) { $xml_parser = xml_parser_create(); // use case-folding so we are sure to find the tag in $map_array xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "printYearMenu"); if (!xml_parse($xml_parser, $x)) { die(sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser))); } xml_parser_free($xml_parser); } if (($xml == "") && ($xsl == "")) echo ""; else if ($xsl == "") echo ""; else { $html = XMLtoHTML($xml, $xsl); print textToSmilie($html); print "

"; print "

"; $xml = loadPoll($pollId, $year, $success, $name, $content, $submitted, $correctSubmitted); if (($submitted == true) && (!$correctSubmitted)) { echo "
Vul aub je naam EN je reactie in.

"; } //-------------------------------------- loadHTMLBodyMainAreaEnd(); loadHTMLBodyEnd(PAGE_POLL, "../"); ?>