<?php if (!empty($polls)): ?>
<div class="poll-block">    
    <?php foreach ($polls as $poll): ?> 
    <form action="<?php echo htmlspecialchars($poll['action']) ?>" method="Post">
    <div class="poll-block-poll">
        <div class="poll-block-poll-title">
            <?php echo $poll['title'] ?>
        </div>
        <?php if (!$poll['out_of_time']): ?>
        <div class="poll-block-poll-variants">
            <?php foreach ($poll['variants'] as $variant): ?>
            <div class="poll-block-poll-variants-variant">
                <input id="poll<?php echo $poll['id'] ?>-<?php echo $variant['id'] ?>" type="radio" name="variant" value="<?php echo $variant['id'] ?>" />
                <label for="poll<?php echo $poll['id'] ?>-<?php echo $variant['id'] ?>"><?php echo $variant['title'] ?></label>
            </div>
            <?php endforeach; ?>
        </div>        
        <div class="poll-block-submit">
            <input type="submit" name="submit" value="Проголосовать" />
        </div>
        <?php endif; ?>
        <div class="poll-block-results">
            <a href="<?php echo htmlspecialchars($poll['results_link']) ?>">Результаты</a>
        </div>
    </div>    
    </form>
    <?php endforeach; ?>    
</div>
<?php endif; ?>