<!-- GET POLL BOX | FREEZY -->
<!--showing poll-->
{get_poll box=1}
{foreach from=$get_poll key=poll_id item=poll}
    <form method="post">
        <input type="hidden" name="poll_id" value="{$poll_id}" />
        <table class="bordered" id="poll_box">
            <tr>
                <td colspan="3" align="center" style="font-weight: bold;">
                    {$poll.question|stripslashes}
                </td>
            </tr>
            {foreach from=$poll.option key=option_id item=option}
                {math equation="(x / y) * 100" format="%.1f" x=$option.vote_count y=$poll.vote_count assign=option_percent}
                <tr>
                    <td>
                        {if $poll.vote.date == "" and $poll.end == ""}
                            <input type="radio" name="poll_option_id" value="{$option_id}" />
                            {$option.option|stripslashes}
                        {else}
                            {$option.option|stripslashes}
                        {/if}
                    </td>
                    <td>
                        {if $poll.vote.date == "" and $poll.end == "" and $poll.user_id != $user_id}
                            <div style="width: 1px; margin-right: 49px; background-color: #6DAE42; height: 10px;">
                                &nbsp;
                            </div>
                        {else}
                            <div style="width: {math equation="(x / 2) + 1" x=$option_percent format="%d"}px; margin-right: {math equation="((100 - x ) / 2) - 1" x=$option_percent format="%d"}px; background-color: #6DAE42; height: 10px;">
                                &nbsp;
                            </div>
                        {/if}
                    </td>
                    <td>
                        {if $poll.vote.date == "" and $poll.end == "" and $poll.user_id != $user_id}
                            0%
                        {else}
                            {$option_percent}%
                        {/if}
                    </td>
                </tr>
            {/foreach}
            {if $poll.vote.date == "" && $poll.end == ""}
                <tr>
                    <td colspan="3" align="center"><input type="submit" name="event" value="vote" /></td>
                </tr>
            {/if}
            <tr>
                <td colspan="3" align="center" style="font-style: italic;">
                    {$poll.vote_count} voted
                </td>
            </tr>
        </table>
    </form>
{/foreach}
<!--end of showing poll-->