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

<form method="post" action="<?php e($this->_vars['action']['url']); ?>"><?php HTML::requires(); ?>
<?php if ($this->_vars['action']['complete'] || $this->_vars['action']['deleted']): ?>
	<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('Post an Event'); ?></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center">
		<?php e($this->_vars['action']['complete']? _('Updated'):_('Deleted')); ?><br><br><?php loadPlugin::callFunc('hitsuji_banner', POSITION_MOBILE); ?><br>
	<br></td></tr>
<?php elseif ($this->_vars['action']['confirm'] || $this->_vars['action']['delete']): ?>
<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['com_event']['event']); ?></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>">
		<font color="<?php Theme::exec()->columnColor(); ?>"><?php _e('When'); ?>:</font>
		<?php eDate($this->_vars['com_event']['start_date'], _('Y-m-d')); ?>
		<?php e($this->_vars['com_event']['start_hour']); ?>:
		<?php e($this->_vars['com_event']['start_minute']); ?><br>

		<font color="<?php Theme::exec()->columnColor(); ?>"><?php _e('Where'); ?>:</font>
		<?php e($this->_vars['reference']['ara_region'][$this->_vars['com_event']['ref_region']]); ?><?php HTML::reference('ara_city', $this->_vars['com_event']['ref_city']); ?>
		<?php if (!empty($this->_vars['com_event']['locale'])) : ?>(<?php e($this->_vars['com_event']['locale']); ?>)<?php endif; ?><br>
	</td></tr>
</table>
<hr color="<?php Theme::exec()->borderColor(); ?>" noshade="noshade">
	<?php HTML::htmlBody($this->_vars['com_event']['comment']); ?>
<hr color="<?php Theme::exec()->borderColor(); ?>" noshade="noshade">

<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>">
		<font color="<?php Theme::exec()->columnColor(); ?>"><?php _e('Deadline'); ?>:</font><?php eDate($this->_vars['com_event']['deadline'], _('Y-m-d')); ?><br>
		<font color="<?php Theme::exec()->columnColor(); ?>"><?php _e('Entries'); ?>:</font><?php printf(_('%s entries'), 0); ?><br>
		<font color="<?php Theme::exec()->columnColor(); ?>"><?php _e('Posted by'); ?>:</font><?php loadPlugin::callFunc('hitsuji_profile', $this->_vars['base']['account']['id'], 'nickname'); ?>
	</td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center">
		<?php eDate(ifNull($this->_vars['com_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['com_event']['visibility']]); ?>" width="16" height="16" alt="&gt;">
	<br></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center">
		<input type="submit" name="manip" value="<?php e($this->_vars['action']['confirm']? _('Submit'):_('Delete')); ?>">
		<input type="submit" name="<?php e($this->_vars['action']['goback']); ?>" value="<?php _e('Go back'); ?>">
	<br></td></tr>
</table>
<?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('Post an Event'); ?></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Title'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['event'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
		<input type="text" name="event" value="<?php e($this->_vars['com_event']['event']); ?>" size="42">
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Start Date'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['start_date'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select date.'); ?></font><br><?php endif; ?>
		<?php HTML::dateSelect('start_date', $this->_vars['com_event']['start_date']); ?>
		<select name="start_hour"><option value="">--</option><?php HTML::options($this->_vars['hours'], $this->_vars['com_event']['start_hour']); ?></select>:
		<select name="start_minute"><option value="">--</option><?php HTML::options($this->_vars['sixty'], $this->_vars['com_event']['start_minute']); ?></select>
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Deadline'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['deadline'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select date.'); ?></font><br><?php endif; ?>
		<?php HTML::dateSelect('deadline', $this->_vars['com_event']['deadline']); ?>
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Region'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['ref_region'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<select name="ref_region"><option value=""><?php _e('- Select One -'); ?></option><?php HTML::options($this->_vars['reference']['ara_region'], $this->_vars['com_event']['ref_region']); ?></select>
		<input type="hidden" name="ref_city" value="0"><br>
		(<input type="text" name="locale" value="<?php e($this->_vars['com_event']['locale']); ?>">)
	<br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Visibility'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['visibility'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please select.'); ?></font><br><?php endif; ?>
		<?php HTML::radio('visibility', $this->_vars['visibility'], $this->_vars['com_event']['visibility'], '<br>'); ?>
	</td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Comment'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['comment'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
		<?php HTML::mobileRichEditor('comment', $this->_vars['com_event']['comment'], _('Comment')); ?>
		<br><input name="attach" type="submit" value="<?php _e('Attach'); ?>">
	<br></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center"><input type="submit" name="confirm" value="<?php _e('Confirm'); ?>"><br></td></tr>
</table>
<?php endif; ?>
</form>
