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

<?php if (empty($this->_vars['poll'])):?>
	<?php _e('Sorry, no results found.'); ?><br><br>
	<?php loadPlugin::callFunc('hitsuji_banner', POSITION_MOBILE); ?><br>
<?php else: ?>
<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
	<tr><td align="center" bgcolor="<?php Theme::exec()->bgTitleColor(); ?>"><img src="<?php e(BASE_URL); ?>resource/img/icons/chart_pie.gif" width="16" height="16" alt="&gt;">&nbsp;<?php e($this->_vars['poll']['poll']); ?></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>"><font size="<?php Theme::exec()->fontSize(); ?>">
		<font color="<?php Theme::exec()->columnColor(); ?>"><?php _e('Deadline'); ?>:</font><?php eDate($this->_vars['poll']['deadline'], _('Y-m-d')); ?><br>
		<font color="<?php Theme::exec()->columnColor(); ?>"><?php _e('Answers'); ?>:</font><?php printf(_('%s answers'), $this->_vars['poll']['posts']); ?><br>
		<font color="<?php Theme::exec()->columnColor(); ?>"><?php _e('Posted by'); ?>:</font><?php loadPlugin::callFunc('hitsuji_profile', $this->_vars['poll']['ref_account'], 'nickname'); ?>
		<?php eDate(ifNull($this->_vars['poll']['regist_date'], 'now'), _('Y-m-d H:i')); ?>
		<img src="<?php e(BASE_URL); ?>resource/img/icons/<?php e($this->_vars['base']['visibility_icon'][$this->_vars['poll']['visibility']]); ?>" width="16" height="16" alt="&gt;"><br></font>
<?php if ($this->_vars['base']['account']['id'] == $this->_vars['poll']['ref_account']): ?>
		<div align="right"><font size="<?php Theme::exec()->fontSize(); ?>"><img src="<?php e(BASE_URL); ?>resource/img/icons/edit.gif" width="16" height="16" alt="&gt;">&nbsp;<a href="<?php e(HTTP_ACTION); ?>private/post/poll/<?php e($this->_vars['poll']['id']); ?>/"><?php _e('Edit'); ?></a>
		<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($this->_vars['poll']['id']); ?>/delete/"><?php _e('Delete'); ?></a></font></div>
<?php endif; ?>
	</td></tr>
</table>
<hr color="<?php Theme::exec()->borderColor(); ?>" noshade="noshade">
<font size="<?php Theme::exec()->fontSize(); ?>"><?php HTML::htmlBody($this->_vars['poll']['comment']); ?></font>
<?php loadPlugin::callFunc('hitsuji_mobileChart', $this->_vars['datas'], 'small'); ?>
<hr color="<?php Theme::exec()->borderColor(); ?>" noshade="noshade">
<form method="post" action="<?php e(HTTP_ACTION); ?>member/poll/answer/<?php e($this->_vars['poll']['id']); ?>/confirm/"><?php HTML::requires(); ?>
<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>">
		<?php if (!empty($this->_vars['alert']['answer'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<?php HTML::radio('answer', $this->_vars['answers'], null, '<br>'); ?>
		<input type="submit" name="confirm" value="<?php _e('Answer'); ?>">
	</td></tr>
</table>
</form>
<?php endif; ?>
