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

<?php if (empty($this->_vars['event'])): ?>
	<?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/event.gif" width="16" height="16" alt="&gt;">&nbsp;<?php e($this->_vars['event']['event']); ?></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>">
		<font color="<?php Theme::exec()->columnColor(); ?>" size="<?php Theme::exec()->fontSize(); ?>"><?php _e('When'); ?>:</font>
		<font size="<?php Theme::exec()->fontSize(); ?>"><?php eDate($this->_vars['event']['start_date'], _('Y-m-d')); ?>
		<?php e($this->_vars['event']['start_hour']); ?>:
		<?php e($this->_vars['event']['start_minute']); ?><br></font>
		<font color="<?php Theme::exec()->columnColor(); ?>" size="<?php Theme::exec()->fontSize(); ?>"><?php _e('Where'); ?>:</font>
		<font size="<?php Theme::exec()->fontSize(); ?>"><?php HTML::reference('ara_region', $this->_vars['event']['ref_region']); ?><?php HTML::reference('ara_city', $this->_vars['event']['ref_city']); ?>
		<?php if (!empty($this->_vars['event']['locale'])): ?>(<?php e($this->_vars['event']['locale']); ?>)<?php endif; ?><br>
		<img src="<?php e(BASE_URL); ?>resource/img/icons/report.gif" width="16" height="16" alt="&gt;">&nbsp;<a href="<?php e(HTTP_ACTION); ?>community/event/reports/<?php e($this->_vars['base']['community']['id']); ?>/<?php e($this->_vars['event']['id']); ?>/"><?php _e('Reports'); ?>&nbsp;(<?php e($this->_vars['event']['posts']); ?>)</a></font>
	</td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>">
		<font color="<?php Theme::exec()->columnColor(); ?>" size="<?php Theme::exec()->fontSize(); ?>"><?php _e('Deadline'); ?>:</font><font size="<?php Theme::exec()->fontSize(); ?>"><?php eDate($this->_vars['event']['deadline'], _('Y-m-d')); ?><br></font>
<?php if ($this->_vars['base']['permission'] & PERMISSION_MEMBERS): ?>
		<font color="<?php Theme::exec()->columnColor(); ?>" size="<?php Theme::exec()->fontSize(); ?>"><?php _e('Entries'); ?>:</font><font size="<?php Theme::exec()->fontSize(); ?>"><a href="<?php e(HTTP_ACTION); ?>community/event/entries/<?php e($this->_vars['event']['id']); ?>/"><?php printf(_('%s entries'), $this->_vars['event']['entries']); ?></a><br></font>
		<font color="<?php Theme::exec()->columnColor(); ?>" size="<?php Theme::exec()->fontSize(); ?>"><?php _e('Posted by'); ?>:</font><font size="<?php Theme::exec()->fontSize(); ?>"><?php loadPlugin::callFunc('hitsuji_profile', $this->_vars['event']['ref_author'], 'nickname'); ?>
<?php endif; ?></font>
	</td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>"><font size="<?php Theme::exec()->fontSize(); ?>">
		<?php eDate(ifNull($this->_vars['event']['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['event']['visibility']]); ?>" width="16" height="16" alt="<?php e($this->_vars['base']['visibility'][$this->_vars['event']['visibility']]); ?>"><br></font>
<?php if ($this->_vars['base']['account']['id'] == $this->_vars['event']['ref_author'] || $this->_vars['base']['permission'] & PERMISSION_LEADER): ?>
		<div align="right"><font size="<?php Theme::exec()->fontSize(); ?>"><img src="<?php e(BASE_URL); ?>resource/img/icons/sent.gif" width="16" height="16" alt="&gt;">&nbsp;<a href="<?php e(HTTP_ACTION); ?>community/event/send/<?php e($this->_vars['event']['id']); ?>/"><?php _e('Send Message'); ?></a><br>
		<img src="<?php e(BASE_URL); ?>resource/img/icons/edit.gif" width="16" height="16" alt="&gt;">&nbsp;<a href="<?php e(HTTP_ACTION); ?>community/event/post/<?php e($this->_vars['base']['community']['id']); ?>/<?php e($this->_vars['event']['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); ?>community/event/post/<?php e($this->_vars['base']['community']['id']); ?>/<?php e($this->_vars['event']['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['event']['comment']); ?></font>
<hr color="<?php Theme::exec()->borderColor(); ?>" noshade="noshade">
<?php endif; ?>

<a name="Attend"></a>
<?php if ($this->_vars['base']['permission'] & PERMISSION_MEMBERS): ?>
<form method="post" action="<?php e(HTTP_ACTION); ?>community/event/view/<?php e($this->_vars['event']['id']); ?>/#Attend"><?php HTML::requires(); ?>
<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
<?php if (empty($this->_vars['attend'])): ?>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center"><font size="<?php Theme::exec()->fontSize(); ?>"><input name="attend" type="submit" value="<?php _e('Attend an Event.'); ?>"><br></font></td></tr>
<?php else : ?>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center"><font size="<?php Theme::exec()->fontSize(); ?>"><?php _e('Take part in the Event.'); ?><br><input name="delete" type="submit" value="<?php _e("Don't attend an Event."); ?>"><br></font></td></tr>
<?php endif; ?>
</table>
</form>
<?php endif; ?>

