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

<form method="post" action="<?php e($this->_vars['action']['url']); ?>"><?php HTML::requires(); ?>
<?php if ($this->_vars['action']['complete']): ?>
	<?php _e('Your invitation was sent to your friend.'); ?><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 bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('E-mail'); ?>:<br></td></tr>
	<tr><td><?php e($this->_vars['fri_invite']['email']); ?><br></td></tr>

	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('Comment'); ?>:<br></td></tr>
	<tr><td><?php HTML::nl2br($this->_vars['fri_invite']['comment']); ?><br></td></tr>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center">
		<input type="submit" name="manip" value="<?php _e('Submit'); ?>">
		<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 bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php _e('E-mail'); ?>:<br></td></tr>
	<tr><td>
		<?php if (!empty($this->_vars['alert']['email'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Please type.'); ?></font><br><?php endif; ?> 
		<?php if (!empty($this->_vars['alert']['registered'])): ?><font color="<?php Theme::exec()->alertColor(); ?>"><?php _e('Registered member.'); ?></font><br><?php endif; ?> 
		<input type="text" name="email" value="<?php e($this->_vars['fri_invite']['email']); ?>">
	<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 type.'); ?></font><br><?php endif; ?>
		<textarea name="comment"><?php e($this->_vars['fri_invite']['comment']); ?></textarea>
	<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>
<hr color="<?php Theme::exec()->borderColor(); ?>" noshade="noshade">

<?php if(!empty($this->_vars['invites'])): ?>
<form method="post" action="<?php e(HTTP_ACTION); ?>private/home/invite/"><?php HTML::requires(); ?>
<table border="0" width="<?php Theme::exec()->mainWidth(); ?>">
<?php foreach($this->_vars['invites'] as $_row): ?>
	<tr><td bgcolor="<?php Theme::exec()->bgColumnColor(); ?>"><?php eDate($_row['modified'], _('Y-m-d H:i')); ?>:<br></td></tr>
	<tr><td><input type="checkbox" name="invitations[]" value="<?php e($_row['id']); ?>"><?php e(RKT_Crypt::getDecrypted($_row['email'])); ?><br></td></tr>
<?php endforeach; ?>
	<tr><td bgcolor="<?php Theme::exec()->bgColor(); ?>" align="center"><input name="delete" type="submit" value="<?php _e('Delete'); ?>"><br></td></tr>
</table></form>
<?php endif; ?>
