Пример #1
0
    function showResults(&$poll, &$votes, $first_vote, $last_vote, $pollist, $params)
    {
        global $mosConfig_live_site;
        ?>
		<script type = "text/javascript">
		<!--
		var link = document.createElement('link');
		link.setAttribute('href', 'components/com_poll/poll_bars.css');
		link.setAttribute('rel', 'stylesheet');
		link.setAttribute('type', 'text/css');
		var head = document.getElementsByTagName('head').item(0);
		head.appendChild(link);
		//-->
		</script>
		<form action="index.php" method="post" name="poll" id="poll"> 
		<?php 
        if ($params->get('page_title')) {
            ?>
			<div class="componentheading<?php 
            echo $params->get('pageclass_sfx');
            ?>
">
				<?php 
            echo _POLL_TITLE;
            ?>
			</div> 
			<?php 
        }
        ?>
		<table width="100%" class="contentpane<?php 
        echo $params->get('pageclass_sfx');
        ?>
"> 
		<tr> 
			<td align="center"> 
				<table class="contentpane<?php 
        echo $params->get('pageclass_sfx');
        ?>
"> 
				<tr> 
					<td align="left">
					<?php 
        echo _SEL_POLL;
        ?>
&nbsp;
					</td> 
					<td align="left">
					<?php 
        echo $pollist;
        ?>
					</td> 
				</tr> 
				</table> 

				<table cellpadding="0" cellspacing="0" border="0" class="contentpane<?php 
        echo $params->get('pageclass_sfx');
        ?>
"> 
				<?php 
        if ($votes) {
            $j = 0;
            $data_arr["text"] = null;
            $data_arr["hits"] = null;
            foreach ($votes as $vote) {
                $data_arr["text"][$j] = trim($vote->text);
                $data_arr["hits"][$j] = $vote->hits;
                $j++;
            }
            ?>
					<tr> 
						<td> 
						<?php 
            poll_html::graphit($data_arr, $poll->title, $first_vote, $last_vote);
            ?>
						</td> 
					</tr> 
					<?php 
        } else {
            ?>
					<tr> 
						<td valign="bottom">
						<?php 
            echo _NO_RESULTS;
            ?>
						</td> 
					</tr> 
					<?php 
        }
        ?>
 
				</table> 
			</td>	
		</tr> 
		</table> 
		<?php 
        // displays back button
        mosHTML::BackButton($params);
        ?>
		</form> 
		<?php 
    }