<?php include VIEW_DIR.'mobile/common/menu/poll.tpl'; ?>

<?php if (empty($this->_vars['v_sum_poll'])):?>
	<?php _e('Sorry, no results found.'); ?><br><br>
	<?php loadPlugin::callFunc('hitsuji_banner', POSITION_MOBILE); ?><br>
<?php else: ?>
<?php HTML::mobilePager($this->_vars['p_sum_poll']); ?>

<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
<?php foreach ($this->_vars['v_sum_poll'] as $_row): ?>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>"><font size="<?php Theme::exec()->fontSize(); ?>">
	<img src="<?php e(BASE_URL); ?>resource/img/icons/chart_pie.gif" width="16" height="16" alt="&gt;">&nbsp;<a href="<?php e(HTTP_ACTION); ?>member/poll/view/<?php e($_row['id']); ?>/"><?php e($_row['poll']); ?></a><br>
	<font color="<?php Theme::exec()->columnColor(); ?>"><?php _e('Deadline'); ?>:</font><?php eDate($_row['deadline'], _('Y-m-d')); ?><br>
	<font color="<?php Theme::exec()->columnColor(); ?>"><?php _e('Answers'); ?>:</font><?php printf(_('%s answers'), $_row['posts']); ?><br>
	<font color="<?php Theme::exec()->columnColor(); ?>"><?php _e('Posted by'); ?>:</font><?php loadPlugin::callFunc('hitsuji_profile', $_row['ref_account'], 'nickname'); ?><br></font>
<?php if ($this->_vars['base']['account']['id'] == $_row['ref_account']): ?>
	<div align="right"><font size="<?php Theme::exec()->fontSize(); ?>"><img src="<?php e(BASE_URL); ?>resource/img/icons/chart_pie_edit.gif" width="16" height="16" alt="&gt;">&nbsp;<a href="<?php e(HTTP_ACTION); ?>private/post/poll/<?php e($_row['id']); ?>/"><?php _e('Edit'); ?></a>&nbsp;/
	<img src="<?php e(BASE_URL); ?>resource/img/icons/trash.gif" width="16" height="16" alt="&gt;">&nbsp;<a href="<?php e(HTTP_ACTION); ?>private/post/poll/<?php e($_row['id']); ?>/delete/"><?php _e('Delete'); ?></a><br></font></div>
<?php endif; ?>
	</td></tr>
<?php endforeach; ?>
</table>
<?php HTML::mobilePager($this->_vars['p_sum_poll']); ?>
<?php endif; ?>
