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

<form method="post" action="<?php e($this->_vars['action']['url']); ?>"><?php HTML::requires(); ?>
<input type="hidden" name="ref_to" value="<?php e(ifNull($this->_vars['fri_message']['ref_to'], $this->_vars['request']['ref_to'])); ?>">

<?php if ($this->_vars['action']['complete']): ?>
<?php _e('Updated'); ?><br><br><?php loadPlugin::callFunc('hitsuji_banner', POSITION_MOBILE); ?><br>
<?php elseif ($this->_vars['action']['confirm']): ?>
<table border="0" width="<?php Theme::exec()->mainWidth(); ?>"><tr>
<td><?php loadPlugin::callFunc('hitsuji_profile', $this->_vars['fri_message']['ref_to'], 'vSmall'); ?></td>
<td><font size="<?php Theme::exec()->fontSize(); ?>"><?php loadPlugin::callFunc('hitsuji_profile', $this->_vars['fri_message']['ref_to'], 'nickname'); ?></font></td>
</tr><tr>
<td><font color="<?php Theme::exec()->columnColor(); ?>" size="<?php Theme::exec()->fontSize(); ?>"><?php _e('Date'); ?></font></td>
<td><font size="<?php Theme::exec()->fontSize(); ?>"><?php eDate(ifNull($this->_vars['fri_message']['regist_date'], 'now'), _('Y-m-d H:i')); ?></font></td>
</tr><tr>
<td><font color="<?php Theme::exec()->columnColor(); ?>" size="<?php Theme::exec()->fontSize(); ?>"><?php _e('Subject'); ?></font></td>
<td><font size="<?php Theme::exec()->fontSize(); ?>"><?php e($this->_vars['fri_message']['subject']); ?></font></td>
</tr></table>
<hr color="<?php Theme::exec()->borderColor(); ?>" noshade="noshade">
<font size="<?php Theme::exec()->fontSize(); ?>"><?php HTML::htmlBody($this->_vars['fri_message']['body']); ?></font>
<hr color="<?php Theme::exec()->borderColor(); ?>" noshade="noshade">

<input type="hidden" name="status" value="<?php e(MESSAGE_SEND) ?>">
<input type="submit" name="manip" value="<?php _e('Send Message'); ?>">
<input type="submit" name="manip" value="<?php _e('Save Draft'); ?>" onclick="document.edit.status.value=<?php e(MESSAGE_DRAFT) ?>;">
<input type="submit" name="<?php e($this->_vars['action']['goback']); ?>" value="<?php _e('Go back'); ?>">

<?php else: ?>
<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('To'); ?>:<br></td></tr>

<tr><td><?php loadPlugin::callFunc('hitsuji_profile', ifNull($this->_vars['fri_message']['ref_to'], $this->_vars['request']['ref_to']), 'vSmall,nickname'); ?></td></tr>

<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Subject'); ?>:<br></td></tr>
<tr><td><?php if (!empty($this->_vars['alert']['subject'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
<input type="text" name="subject" value="<?php e(ifNull($this->_vars['fri_message']['subject'], $this->_vars['subject'])); ?>"><br></td></tr>

<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Body'); ?>:<br></td></tr>

<tr><td><?php if (!empty($this->_vars['alert']['body'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please enter.'); ?></font><br><?php endif; ?>
<?php HTML::mobileRichEditor('body', ifNull($this->_vars['fri_message']['body'], $this->_vars['body']), _('Body')); ?><br></td></tr>
<br><input name="attach" type="submit" value="<?php _e('Attach'); ?>">

<tr><td><input type="submit" name="confirm" value="<?php _e('Confirm'); ?>" onclick="javascript:document.edit.action='<?php e($this->_vars['action']['url']); ?>';"><br></td></tr>
</table>
<?php endif; ?>
</form>

